Skip to content

Conversation

@sreichel
Copy link
Contributor

@sreichel sreichel commented Nov 6, 2025

... docblocks.

Copilot AI review requested due to automatic review settings November 6, 2025 05:16
@sreichel sreichel added the chore label Nov 6, 2025
@github-actions github-actions bot added Component: Core Relates to Mage_Core Component: Catalog Relates to Mage_Catalog Component: Checkout Relates to Mage_Checkout Component: lib/Varien Relates to lib/Varien Component: Sales Relates to Mage_Sales Component: Weee Relates to Mage_Weee Component: Tax Relates to Mage_Tax Component: Oauth Relates to Mage_Oauth Component: ImportExport Relates to Mage_ImportExport Component: ConfigurableSwatches Relates to Mage_ConfigurableSwatches Component: lib/* Relates to lib/* 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 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, $e to more descriptive names ($index, $key, $value, $exception)
  • Improved PHPDoc annotations with accurate return types and @throws declarations
  • 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

@sreichel sreichel marked this pull request as draft November 6, 2025 05:23
@github-actions
Copy link
Contributor

github-actions bot commented Nov 6, 2025

Test Results

880 tests  +1   869 ✅ +1   15s ⏱️ ±0s
195 suites +1    11 💤 ±0 
  1 files   ±0     0 ❌ ±0 

Results for commit c6afdeb. ± Comparison against base commit 2220264.

♻️ This comment has been updated with latest results.

@sreichel sreichel marked this pull request as ready for review November 6, 2025 05:28
@github-actions github-actions bot added the Component: Adminhtml Relates to Mage_Adminhtml label Nov 6, 2025
@sonarqubecloud
Copy link

sonarqubecloud bot commented Nov 6, 2025

@sreichel
Copy link
Contributor Author

sreichel commented Nov 6, 2025

Safe.

@sreichel sreichel merged commit c2ff3ba into main Nov 6, 2025
41 checks passed
@sreichel sreichel deleted the phpstan/params-null-given branch November 6, 2025 07:16
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: Catalog Relates to Mage_Catalog Component: Checkout Relates to Mage_Checkout Component: ConfigurableSwatches Relates to Mage_ConfigurableSwatches Component: Core Relates to Mage_Core Component: ImportExport Relates to Mage_ImportExport Component: lib/Varien Relates to lib/Varien Component: lib/* Relates to lib/* Component: Oauth Relates to Mage_Oauth Component: Sales Relates to Mage_Sales Component: Tax Relates to Mage_Tax Component: Weee Relates to Mage_Weee phpstan phpunit

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants