-
-
Notifications
You must be signed in to change notification settings - Fork 451
Fixes for Phpstan 2.1.31 and Rector 2.2.3 #4991
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
base: main
Are you sure you want to change the base?
Conversation
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]>
…-2.1.31' into phpstan/fix2.1.31
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 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 |
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
Copilot reviewed 42 out of 43 changed files in this pull request and generated 1 comment.
|
* | ||
* @return int | ||
*/ | ||
public function getVersionHash(Mage_Core_Model_Encryption $encryptionModel) |
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.
If the parameter isn't used anymore, maybe deprecate it?
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.
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); |
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.
What of them rector/phpstan or pslam is against !empty($value)
?
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.
Guess it includes multiple checks that makes it less readable.
Related ...