Skip to content

phpstan: checks around getConfig + asArray#5601

Open
Hanmac wants to merge 15 commits into
OpenMage:mainfrom
Hanmac:getNodeFix
Open

phpstan: checks around getConfig + asArray#5601
Hanmac wants to merge 15 commits into
OpenMage:mainfrom
Hanmac:getNodeFix

Conversation

@Hanmac
Copy link
Copy Markdown
Contributor

@Hanmac Hanmac commented May 22, 2026

Description (*)

Some fixes regarding:

  • getConfig() which might return null when called as static,
  • getNode() which might return false,
  • asArray() which might return string and not array. (says PHPStan)

Related Pull Requests

Fixed Issues (if relevant)

  • fixes OpenMage/magento-lts#<issue_number>

Manual testing scenarios (*)

  1. ...
  2. ...

Questions or comments

Contribution checklist (*)

  • Pull request has a meaningful description of its purpose
  • All automated tests passed successfully (all builds are green, SonarCloud checks are not required to merge)

@github-actions github-actions Bot added Component: lib/Varien Relates to lib/Varien Component: Payment Relates to Mage_Payment Component: Api2 Relates to Mage_Api2 Component: lib/* Relates to lib/* labels May 22, 2026
Comment thread app/code/core/Mage/Payment/Model/Config.php Outdated
Comment thread app/code/core/Mage/Api2/Helper/Data.php Outdated
Comment thread app/code/core/Mage/Payment/Model/Config.php Outdated
Comment thread lib/Varien/Data/Collection/Db.php Outdated
Comment thread lib/Varien/Data/Collection/Db.php
@sreichel sreichel added the chore label May 22, 2026
@Hanmac
Copy link
Copy Markdown
Contributor Author

Hanmac commented May 22, 2026

Stupid PHPStrom, lied to me that in && (bool) (int), the (bool) was unnecessary -,-

@sreichel
Copy link
Copy Markdown
Contributor

sreichel commented May 22, 2026

`Pls dont add too much. Better smaller PRs.

@Hanmac
Copy link
Copy Markdown
Contributor Author

Hanmac commented May 22, 2026

@sreichel yeah, that should be enough for now in Mage_Payment_Helper

@Hanmac Hanmac marked this pull request as ready for review May 22, 2026 12:12
@sonarqubecloud
Copy link
Copy Markdown

@sreichel
Copy link
Copy Markdown
Contributor

imho ... its already to big ... w/ various changes.

DocBlock fixex are worth a small PR ...

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

Labels

chore Component: Api2 Relates to Mage_Api2 Component: lib/Varien Relates to lib/Varien Component: lib/* Relates to lib/* Component: Payment Relates to Mage_Payment phpstan

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants