PHPCSStandards/PHPCSUtils

Attempt to read property "enabled" on null

Closed this issue · 4 comments

Following #464, I'm now seeing test failures in the testsuite for https://github.com/magento/magento-coding-standard (example: https://github.com/magento/magento-coding-standard/actions/runs/4990320894/jobs/9174508171?pr=445).

The stack trace for this error is below. The entry point into PHPCSUtils is: FunctionDeclarations::getProperties($phpcsFile, $stackPtr);, which does not seem wrong to me. The logic inside Cache::isCached() assumes that a fixer is always available, which seems to not hold true in this particular case.

+ vendor/bin/phpunit --stop-on-failure
PHPUnit 9.6.8 by Sebastian Bergmann and contributors.

........E

Time: 00:00.087, Memory: 18.00 MB

There was 1 error:

1) Magento2\Tests\PHPCompatibility\ForbiddenFinalPrivateMethodsUnitTest::testSniff
Attempt to read property "enabled" on null

/home/fredden/Dropbox/development/magento-coding-standard/vendor/phpcsstandards/phpcsutils/PHPCSUtils/Internal/Cache.php:98
/home/fredden/Dropbox/development/magento-coding-standard/vendor/phpcsstandards/phpcsutils/PHPCSUtils/Utils/FunctionDeclarations.php:196
/home/fredden/Dropbox/development/magento-coding-standard/PHPCompatibility/Sniffs/FunctionDeclarations/ForbiddenFinalPrivateMethodsSniff.php:84
/home/fredden/Dropbox/development/magento-coding-standard/Magento2/Sniffs/PHPCompatibility/ForbiddenFinalPrivateMethodsSniff.php:32
/home/fredden/Dropbox/development/magento-coding-standard/vendor/squizlabs/php_codesniffer/src/Files/File.php:498
/home/fredden/Dropbox/development/magento-coding-standard/vendor/squizlabs/php_codesniffer/src/Files/LocalFile.php:92
/home/fredden/Dropbox/development/magento-coding-standard/PHP_CodeSniffer/Tests/Standards/AbstractSniffUnitTest.php:173

ERRORS!
Tests: 9, Assertions: 0, Errors: 1.
jrfnl commented

@fredden Sorry, but I'm shocked and very dismayed to see the copyright infringement going on here and am absolutely not willing to spend one second of my time on debugging issues with stolen code.

Please tell the Magento standard to use the PHPCompatibility standard as a Composer dependency and remove any and all remnants of the stolen code from their codebase.

jrfnl commented

I really am very very angry about this. The amount of time I spend writing these sniffs without any compensation is HUGE, only to then see them being ripped off and passed off as if they are from another standard is extremely offensive. This needs to be remedied and fast.

wimg commented

Unbelievable and totally unacceptable. Either these people don't have a clue how open source and codesniffer standards work, or they just don't care.

This shows very little respect for all the incredibly hard work @jrfnl has put in for years.

Credit must always be given where it's due. Don't copy other repos, that's very disrespectful and a violation of the license.