-
-
Notifications
You must be signed in to change notification settings - Fork 439
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
Analyze most of the source code with phpstan. Provide baseline. #2035
Conversation
interestingly, here on github phpstan finds more issues then running locally. I'm investigating |
mystery solved, its due to php version. locally I run it with 7.4 and github runs 8.1 |
looks good now |
I'd keep _getHelper() method. It could be used in 3rd party code. Maybe mark it as deprecated and ignore it from sniffs? |
This issue cant be ignored afaik, only whole file can be skipped. |
This patch makes phpstan analyze almost whole OpenMage source code. To make the phpstan green despite not all issues are yet solved, a baseline file is introduced, which contains "known issues". Thanks to this approach we can make sure new changes are not introducing new issues, and its easy to fix issues from baseline one by one. This patch also fixes some issues along the way: 1. Fix non existing class name Mage_Catalog_Model_Entity_Product_Collection with correct one Mage_Catalog_Model_Resource_Product_Collection 2. Correct casing of the class name Zend_Pdf_Color_Rgb 3. few minor phpdocs changes 4. update macopedia/phpstan-magento1 to newest version which brings performance improvements 5. add #[\ReturnTypeWillChange] in some places to avoid errors on php8.1
@sreichel I've excluded the RSS files from analysing and deprecated the method. We might want to remove this method in v20 branch. but this will be a different patch. |
NICE! Thanks for your effort. ❤️ Not ready for PR, i already tried to bring it to level 2,3 or 4 as where it is possible :) (not sure if #784 is up2date ... guess not) |
This patch makes phpstan analyze almost whole OpenMage source code.
To make the phpstan green despite not all issues are yet solved,
a baseline file is introduced, which contains "known issues".
Thanks to this approach we can make sure new changes
are not introducing new issues, and its easy to fix issues from baseline
one by one.
This patch also fixes some issues along the way:
as it had incompatible interface with parent class, and was used only in one place.
with correct one Mage_Catalog_Model_Resource_Product_Collection
performance improvements
Description (*)
Related Pull Requests
Fixed Issues (if relevant)
Manual testing scenarios (*)
Questions or comments
Contribution checklist (*)