Skip to content

Conversation

sreichel
Copy link
Contributor

@sreichel sreichel commented Oct 13, 2025

dependabot bot and others added 4 commits October 13, 2025 01:02
Bumps [phpstan/phpstan](https://github.com/phpstan/phpstan-phar-composer-source) from 2.1.29 to 2.1.31.
- [Commits](https://github.com/phpstan/phpstan-phar-composer-source/commits)

---
updated-dependencies:
- dependency-name: phpstan/phpstan
  dependency-version: 2.1.31
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <[email protected]>
@Copilot Copilot AI review requested due to automatic review settings October 13, 2025 08:49
@github-actions github-actions bot added Component: Catalog Relates to Mage_Catalog Component: lib/Varien Relates to lib/Varien Component: lib/Mage Relates to lib/Mage Component: ImportExport Relates to Mage_ImportExport Component: lib/* Relates to lib/* composer Relates to composer.json labels Oct 13, 2025
Copy link
Contributor

@Copilot 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 addresses PHPStan 2.1.31 compatibility issues by fixing type-related warnings and cleaning up code to meet stricter static analysis requirements.

  • Fixed array key type casting to string where required by PHPStan
  • Removed unused variables and redundant conditions identified by static analysis
  • Updated docblock type annotations for better type safety

Reviewed Changes

Copilot reviewed 6 out of 7 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
lib/Varien/Http/Adapter/Curl.php Updated method parameter docblock and added explicit cURL option initialization
lib/Mage/System/Ftp.php Added string cast for array index to fix type issue
app/code/core/Mage/ImportExport/Model/Export/Entity/Product.php Removed unused variables and redundant conditions, added proper variable cleanup
app/code/core/Mage/ImportExport/Model/Export/Entity/Customer.php Added proper variable cleanup with unset statements
app/code/core/Mage/Catalog/Model/Resource/Category/Flat.php Improved variable naming for better clarity
app/code/core/Mage/Catalog/Model/Layer/Filter/Price/Algorithm.php Added string casts for array indices to fix type issues

@sreichel sreichel added the bug label Oct 13, 2025
@github-actions github-actions bot added Component: PayPal Relates to Mage_Paypal Component: Core Relates to Mage_Core Component: Reports Relates to Mage_Reports Component: Usa Relates to Mage_Usa Component: Customer Relates to Mage_Customer Component: Eav Relates to Mage_Eav Component: Adminhtml Relates to Mage_Adminhtml Component: SalesRule Relates to Mage_SalesRule Component: Widget Relates to Mage_Widget Component: Rule Relates to Mage_Rule Component: Newsletter Relates to Mage_Newsletter Component: Downloadable Relates to Mage_Downloadable labels Oct 13, 2025
@github-actions github-actions bot added Component: Bundle Relates to Mage_Bundle Component: CatalogIndex Relates to Mage_CatalogIndex Component: Api2 Relates to Mage_Api2 Component: CatalogSearch Relates to Mage_CatalogSearch labels Oct 13, 2025
@github-actions github-actions bot added the git label Oct 13, 2025
@github-actions github-actions bot removed the git label Oct 14, 2025
@sreichel sreichel changed the title Fixes for Phpstan 2.1.31 Fixes for Phpstan 2.1.31 and Rector 2.2.3 Oct 15, 2025
@sreichel sreichel requested a review from Copilot October 15, 2025 05:07
Copy link
Contributor

@Copilot 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

Copilot reviewed 42 out of 43 changed files in this pull request and generated 1 comment.

@sonarqubecloud
Copy link

Quality Gate Failed Quality Gate failed

Failed conditions
7.8% Duplication on New Code (required ≤ 3%)

See analysis details on SonarQube Cloud

@sreichel sreichel added this to the 20.16.0 milestone Oct 22, 2025
@sreichel sreichel requested a review from Hanmac October 22, 2025 15:40
*
* @return int
*/
public function getVersionHash(Mage_Core_Model_Encryption $encryptionModel)
Copy link
Contributor

Choose a reason for hiding this comment

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

If the parameter isn't used anymore, maybe deprecate it?

Copy link
Contributor Author

@sreichel sreichel Oct 22, 2025

Choose a reason for hiding this comment

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

Its not an optional parameter.


$value = $this->getData($key);
return $this->escapeHtml($value !== null && strlen($value) > 0 ? $value : $default);
return $this->escapeHtml($value !== null && (string) $value !== '' ? $value : $default);
Copy link
Contributor

Choose a reason for hiding this comment

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

What of them rector/phpstan or pslam is against !empty($value)?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Guess it includes multiple checks that makes it less readable.

@sreichel sreichel added chore and removed bug labels Oct 22, 2025
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: Api2 Relates to Mage_Api2 Component: Bundle Relates to Mage_Bundle Component: Catalog Relates to Mage_Catalog Component: CatalogIndex Relates to Mage_CatalogIndex Component: CatalogSearch Relates to Mage_CatalogSearch Component: Core Relates to Mage_Core Component: Customer Relates to Mage_Customer Component: Downloadable Relates to Mage_Downloadable Component: Eav Relates to Mage_Eav Component: ImportExport Relates to Mage_ImportExport Component: lib/Mage Relates to lib/Mage Component: lib/Varien Relates to lib/Varien Component: lib/* Relates to lib/* Component: Newsletter Relates to Mage_Newsletter Component: PayPal Relates to Mage_Paypal Component: Reports Relates to Mage_Reports Component: Rule Relates to Mage_Rule Component: SalesRule Relates to Mage_SalesRule Component: Usa Relates to Mage_Usa Component: Widget Relates to Mage_Widget composer Relates to composer.json environment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants