-
-
Notifications
You must be signed in to change notification settings - Fork 452
PhpStan: fix wrong params null given
#5075
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
There was a problem hiding this 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 focuses on code quality improvements by standardizing variable naming conventions, improving docblock annotations, and simplifying code expressions. The changes enhance maintainability and align with PHPStan static analysis requirements.
Key changes:
- Renamed loop iteration variables from generic names like
$i,$k,$v,$eto more descriptive names ($index,$key,$value,$exception) - Improved PHPDoc annotations with accurate return types and
@throwsdeclarations - Simplified ternary expressions using the
?:operator - Fixed string interpolation syntax consistency
- Corrected PHPStan baseline issues
Reviewed Changes
Copilot reviewed 15 out of 15 changed files in this pull request and generated 5 comments.
Show a summary per file
| File | Description |
|---|---|
| lib/Varien/Simplexml/Element.php | Renamed $newLine to $eol for clarity |
| lib/Varien/Db/Adapter/Pdo/Mysql.php | Standardized variable names, improved docblocks, simplified ternary operators, fixed string interpolation |
| lib/Varien/Db/Adapter/Interface.php | Added null type to docblock for optional parameter |
| app/code/core/Mage/Weee/Helper/Data.php | Simplified ternary operator, improved docblocks |
| app/code/core/Mage/Tax/Model/Resource/Calculation.php | Renamed loop indices, improved docblocks, fixed string interpolation |
| app/code/core/Mage/Tax/Model/Calculation.php | Renamed variables, improved docblocks, fixed null handling |
| app/code/core/Mage/Sales/Model/Order/Creditmemo/Total/Shipping.php | Changed null to empty array for currency format method |
| app/code/core/Mage/Oauth/controllers/Adminhtml/Oauth/ConsumerController.php | Renamed $id to $consumerId, $e to specific exception names |
| app/code/core/Mage/ImportExport/Block/Adminhtml/Export/Filter.php | Changed default limit from null to 0, improved docblocks, simplified assignment |
| app/code/core/Mage/Core/Model/Resource/Db/Abstract.php | Renamed generic loop variables, improved docblocks |
| app/code/core/Mage/ConfigurableSwatches/Model/System/Config/Source/Catalog/Product/Configattribute/Select.php | Fixed array_unshift usage to avoid modifying reference |
| app/code/core/Mage/ConfigurableSwatches/Model/System/Config/Source/Catalog/Product/Configattribute.php | Updated property docblock type |
| app/code/core/Mage/Checkout/Block/Cart/Item/Renderer.php | Added null type to docblocks |
| app/code/core/Mage/Catalog/Block/Product/List/Toolbar.php | Improved docblocks with accurate types and exception annotations |
| .phpstan.dist.baseline.neon | Removed resolved PHPStan errors from baseline |
...e/ConfigurableSwatches/Model/System/Config/Source/Catalog/Product/Configattribute/Select.php
Show resolved
Hide resolved
app/code/core/Mage/ImportExport/Block/Adminhtml/Export/Filter.php
Outdated
Show resolved
Hide resolved
|
|
Safe. |



... docblocks.