Skip to content

Running a PHP code sniff against fresh install for PHP compatibility with PHP 7 shouldn't find errors. #1157

Closed
@waynetheisinger

Description

@waynetheisinger

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

  1. 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.
  2. 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

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions