Skip to content

Varien_Data_Collection_Db: fix type for _map property - #5606

Merged
sreichel merged 1 commit into
OpenMage:mainfrom
Hanmac:varienCollection
May 22, 2026
Merged

Varien_Data_Collection_Db: fix type for _map property#5606
sreichel merged 1 commit into
OpenMage:mainfrom
Hanmac:varienCollection

Conversation

@Hanmac

@Hanmac Hanmac commented May 22, 2026

Copy link
Copy Markdown
Contributor

Description (*)

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)

@Hanmac
Hanmac requested a review from sreichel May 22, 2026 12:47
@github-actions github-actions Bot added Component: lib/Varien Relates to lib/Varien Component: lib/* Relates to lib/* phpstan labels May 22, 2026
@sreichel
sreichel merged commit 0712294 into OpenMage:main May 22, 2026
12 checks passed
@sreichel sreichel added the chore label May 22, 2026
@Hanmac
Hanmac deleted the varienCollection branch May 22, 2026 12:50
@sonarqubecloud

Copy link
Copy Markdown

@sreichel
sreichel requested a review from Copilot May 22, 2026 14:30

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Updates Varien_Data_Collection_Db’s $_map PHPDoc to reflect its real runtime structure (including Zend_Db_Expr mappings) and adjusts addFilterToMap() initialization logic to avoid accessing an undefined group key. The PHPStan baseline is updated accordingly by removing now-unneeded ignores.

Changes:

  • Broadened $_map property type from a fixed fields-only shape to a generic group map that supports string|Zend_Db_Expr values.
  • Replaced a potentially undefined-offset null check with an array_key_exists() group presence check in addFilterToMap().
  • Removed PHPStan baseline suppressions that were only required due to the previous $_map type.

Reviewed changes

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

File Description
lib/Varien/Data/Collection/Db.php Fixes $_map typing to match actual usage and makes addFilterToMap() group initialization safe.
.phpstan.dist.baselines/assign.propertyType.php Drops baseline ignores that should no longer trigger after the type correction.

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

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants