Description
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.
Feature request
- If the core code isn't calling the methods with errors, then it would be good to provide a set of custom rules so that PHP code sniff ignores those methods.
- If the core code is calling the method, then we should either fork the library code, ie the project takes over development of the library for ongoing fixes, or patch the code using something like https://github.com/cweagans/composer-patches
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