Skip to content

Conversation

@sreichel
Copy link
Contributor

@sreichel sreichel commented Nov 6, 2025

No description provided.

Copilot AI review requested due to automatic review settings November 6, 2025 01:24
@sreichel sreichel added the chore label Nov 6, 2025
@github-actions github-actions bot added Component: Sales Relates to Mage_Sales Component: Adminhtml Relates to Mage_Adminhtml phpstan labels Nov 6, 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 fixes PHPStan type errors by adding explicit type casts and correcting function arguments. The changes address issues where functions expected string parameters but received other types (float or int).

Key changes:

  • Added explicit string casts to trim() calls in Creditmemo.php to handle float inputs
  • Corrected rtrim() second parameter from int 0 to string '0' in Matrix.php
  • Fixed incorrect array access pattern using $value instead of $oldCurrencies[$key] in Matrix.php
  • Added missing @throws documentation tags for exceptions
  • Removed resolved PHPStan baseline entries

Reviewed Changes

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

File Description
app/code/core/Mage/Sales/Model/Order/Creditmemo.php Added string casts for trim() calls and @throws documentation tags
app/code/core/Mage/Adminhtml/Block/System/Currency/Rate/Matrix.php Fixed rtrim() argument type and corrected array access logic
.phpstan.dist.baseline.neon Removed PHPStan baseline entries for fixed type errors

@sreichel
Copy link
Contributor Author

sreichel commented Nov 6, 2025

Safe to merge.

@sonarqubecloud
Copy link

sonarqubecloud bot commented Nov 6, 2025

@sreichel sreichel merged commit e6645d2 into OpenMage:main Nov 6, 2025
27 checks passed
@sreichel sreichel deleted the phpstan/params-trim branch November 6, 2025 01:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

chore Component: Adminhtml Relates to Mage_Adminhtml Component: Sales Relates to Mage_Sales phpstan

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant