-
-
Notifications
You must be signed in to change notification settings - Fork 436
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
Running a PHP code sniff against fresh install for PHP compatibility with PHP 7 shouldn't find errors. #1157
Comments
Actually even if the core isn't using the method it is conceivable that a third-party module might, therefore would fixing the problems be preferable to writing a custom rule to ignore them?? |
Probably a rule could be written that ignores the known errors in the libraries' functions but errors if said function is called from elsewhere in the codebase. Obviously this rule will need to also ban other methods in the core libraries that call the troublesome library functions. |
I'd really like to remove all code that doesn't currently serve a valid purpose. E.g. #903 #952 #374 |
I agree - so we fork the libraries and then remove all code that isn't being used. I've started this by using PHPstorm to identify dead code... I'll post back here the results of my research.
The report produces mostly false positives because it doesn't understand the xml based autoloader. |
by now we got a lot further with php compatibility, and use various tools to check the code statically. Also we have a lot of users with current php versions. Therefore I close this issue for now, feel free to open a new issue, if you find further issues, (or reopen here, if you want us to also add this specific codesniff) |
This is issue is still valid. We have a PHP compatibility check, but it does not fail on error. Just check current output from github action workflow. |
Description (*)
In migrating to OpenMage I ran a PHP code sniff for PHP7 compatibility - I was expecting to need to patch third-party modules. However, because PHP7 is the minimum requirement I wasn't expecting core libraries to have errors.
There were hundreds of Mcrypt warnings but I notice you are using lib/mcryptcompat/mcrypt.php to polyfill mcrypt so this is a false positive.
The link below contains other errors. They are mostly coming from PEAR and Zend. It is possible/probable that the Mage code isn't calling the methods with the problems.
php7sniffs_core.txt
Feature request
Expected behavior (*)
Running a PHP code sniff against fresh install for PHP compatibility with PHP 7 shouldn't find errors.
Benefits
PHP code sniff can be part of a CI/CD pipeline
Future stability will be more reliable when adding third-party modules
The text was updated successfully, but these errors were encountered: