Skip to content

Conversation

@sreichel
Copy link
Contributor

@sreichel sreichel commented Nov 2, 2025

Copilot AI review requested due to automatic review settings November 2, 2025 07:20
@sreichel sreichel added the chore label Nov 2, 2025
@github-actions github-actions bot added Component: Catalog Relates to Mage_Catalog Component: Api PageRelates to Mage_Api Component: Admin Relates to Mage_Admin php-cs-fixer phpunit labels Nov 2, 2025
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR introduces standardized ordering of union type declarations across the codebase to improve code consistency and readability. The changes are enforced by adding new PHP-CS-Fixer rules.

  • Adds ordered_types and types_spaces rules to PHP-CS-Fixer configuration
  • Reorders union types in function signatures to follow a consistent pattern (null first, then primitive types alphabetically, then class types alphabetically)
  • Updates both test files and production code with the new ordering convention

Reviewed Changes

Copilot reviewed 16 out of 16 changed files in this pull request and generated 5 comments.

Show a summary per file
File Description
.php-cs-fixer.dist.php Adds ordered_types, single_class_element_per_statement, and types_spaces rules to enforce consistent type declaration formatting
tests/unit/Mage/Rule/Model/AbstractTest.php Reorders bool|array to array|bool in union type declarations
tests/unit/Mage/GiftMessage/Helper/MessageTest.php Reorders union types to place null first in parameter type declaration
tests/unit/Mage/Core/Model/AppTest.php Reorders union types to place null first, followed by primitive types, then class types
tests/unit/Mage/Core/Helper/DataTest.php Reorders string|int|null to null|int|string
tests/unit/Mage/Cms/Block/Widget/Page/LinkTest.php Reorders bool|string|null to null|bool|string
tests/unit/Mage/Catalog/Model/Resource/Eav/AttributeTest.php Reorders int|string|null to null|int|string
tests/unit/Mage/AdminNotification/Model/InboxTest.php Reorders array|string|null to null|array|string
tests/unit/Mage/Admin/Model/VariableTest.php Reorders bool|array to array|bool
tests/unit/Mage/Admin/Model/BlockTest.php Reorders bool|array to array|bool
tests/unit/Base/DefaultConfigTest.php Reorders union types to place null first
app/code/core/Mage/Catalog/Model/Category/Api.php Reorders Mage_Core_Exception|Exception to Exception|Mage_Core_Exception in catch block
app/code/core/Mage/Api/Model/Server/Wsi/Adapter/Soap.php Reorders Zend_Soap_Server_Exception|Exception to Exception|Zend_Soap_Server_Exception in catch block
app/code/core/Mage/Api/Model/Server/V2/Adapter/Soap.php Reorders Zend_Soap_Server_Exception|Exception to Exception|Zend_Soap_Server_Exception in catch block
app/code/core/Mage/Api/Model/Server/Adapter/Soap.php Reorders Zend_Soap_Server_Exception|Exception to Exception|Zend_Soap_Server_Exception in catch block
app/code/core/Mage/Admin/Model/Resource/User.php Reorders Mage_Core_Exception|Exception to Exception|Mage_Core_Exception in catch block

@sreichel
Copy link
Contributor Author

sreichel commented Nov 5, 2025

Merged w/o review. Tests only and splitted catch blocks.

@sreichel sreichel merged commit fb5f95d into OpenMage:main Nov 5, 2025
20 checks passed
@sreichel sreichel deleted the cleanup/ordered_types branch November 5, 2025 20:15
@sonarqubecloud
Copy link

sonarqubecloud bot commented Nov 5, 2025

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

chore Component: Admin Relates to Mage_Admin Component: Api PageRelates to Mage_Api Component: Catalog Relates to Mage_Catalog php-cs-fixer phpunit

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant