PHPCompatibility / PHPCompatibility

PHP Compatibility check for PHP_CodeSniffer

Home Page:http://techblog.wimgodden.be/tag/codesniffer/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

PHPCompatibility.Functions.NewFunctions and symfony/polyfill-php80

rdss-sknott opened this issue · comments

Is your feature request related to a problem?

We are using https://github.com/symfony/polyfill-php80 in a project we like to check with PHPCompatibility. PHPCompatibility.Functions.NewFunctions....Found sniffs are raising errors because they do not check if a global function is set by polyfill.

Describe the solution you'd like

I'd like the sniff to only raise errors if the PHP internal function is called.

I'm not sure how to achieve this with PHPCS. As an interim solution, the sniff could check for the existence of symfony/polyfill-php80. For the sniff, would it be appropriate to check if symfony/polyfill-php80 is being used and in that case ignore the polyfilled functions?

If you deem this in scope i would try to provide a pull request to add this behavior

  • I intend to create a pull request to implement this feature.