Skip to content

phpstan: fix comparison for get_object_vars#5271

Merged
sreichel merged 1 commit intoOpenMage:mainfrom
sreichel:phpstan/get_object_vars
Feb 16, 2026
Merged

phpstan: fix comparison for get_object_vars#5271
sreichel merged 1 commit intoOpenMage:mainfrom
sreichel:phpstan/get_object_vars

Conversation

@sreichel
Copy link
Contributor

@sreichel sreichel commented Feb 16, 2026

Description (*)

Fixes for phpstan update. (baselined one issue ... ignore report here)

Copilot AI review requested due to automatic review settings February 16, 2026 12:19
@github-actions github-actions bot added Component: Checkout Relates to Mage_Checkout Component: Customer Relates to Mage_Customer phpstan labels Feb 16, 2026
@sreichel sreichel added the chore label Feb 16, 2026
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

Updates SOAP API V2 data-preparation helpers to align with PHPStan’s understanding of get_object_vars() return type, and refreshes the PHPStan baseline accordingly.

Changes:

  • Replace get_object_vars(... ) !== null with ... !== [] in several SOAP V2 API helpers (customer/cart/payment) to avoid always-true strict comparisons.
  • Remove now-obsolete PHPStan baseline entries for the above always-true / unreachable-code findings.
  • Add one new PHPStan baseline entry for an if.alwaysFalse report in the WEEE quote total collector.

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated no comments.

File Description
app/code/core/Mage/Customer/Model/Customer/Api/V2.php Fixes get_object_vars() comparison to avoid always-true condition under PHPStan.
app/code/core/Mage/Checkout/Model/Cart/Payment/Api/V2.php Same fix for payment data preparation in SOAP V2.
app/code/core/Mage/Checkout/Model/Cart/Customer/Api/V2.php Same fix for customer/customer-address data preparation in SOAP V2.
.phpstan.dist.baseline.neon Drops baseline items made obsolete by the fix; adds one new baseline suppression for WEEE.

@sonarqubecloud
Copy link

@sreichel sreichel requested a review from Hanmac February 16, 2026 12:51
@Hanmac
Copy link
Contributor

Hanmac commented Feb 16, 2026

@sreichel

@fballiano fixed the Weee-Problem like this: MahoCommerce/maho#520

@sreichel
Copy link
Contributor Author

Thx. Will check that later.

@sreichel
Copy link
Contributor Author

Merged with one green flag .... should be safe.

@sreichel sreichel merged commit 5d31af7 into OpenMage:main Feb 16, 2026
26 of 27 checks passed
@sreichel sreichel deleted the phpstan/get_object_vars branch February 16, 2026 13:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

chore Component: Checkout Relates to Mage_Checkout Component: Customer Relates to Mage_Customer phpstan

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants