magento-ecg / coding-standard

Magento PHP_CodeSniffer Coding Standard
MIT License
309 stars 100 forks source link

Fatal error - interface `PHP_CodeSniffer_Sniff` not found when using PHPCS 3.0.0-RC4 #48

Closed erfanimani closed 7 years ago

erfanimani commented 7 years ago
PHP Fatal error:  Interface 'PHP_CodeSniffer_Sniff' not found in vendor/magento-ecg/coding-standard/EcgM2/Sniffs/Plugins/PluginSniff.php on line 7

Clean Magento 2.1.6 (except for the upped version of PHPCS to 3.0.0-RC4, and added "magento-ecg/coding-standard": "dev-master#5f8143d94677d79bca6f428ad71da63214a2efeb" as a dev dependency)

mageinferno/magento2-php docker image which runs following commands:

composer install --no-interaction --no-progress --optimize-autoloader --no-ansi
php -d memory_limit=128M vendor/bin/phpcs app/code  --extensions=php,phtml --standard=./vendor/magento-ecg/coding-standard/EcgM2/
erikhansen commented 7 years ago

I ran into the same issue with PHPCS 3.0.0. I downgraded to PHPCS 2.9.0 and it worked just fine for me. I just submitted a PR to update the README with this information.

Screenshot demonstrating that this only works with 2.9.0:

12-23-47 new message-pzco5

erfanimani commented 7 years ago

Thanks, yeah, downgrading to 2.9 worked for me too.

On 19 May 2017 01:24, "Erik Hansen" notifications@github.com wrote:

I ran into the same issue with PHPCS 3.0.0. I downgraded to PHPCS 2.9.0 and it worked just fine for me. I just submitted a PR https://github.com/magento-ecg/coding-standard/pull/51 to update the README with this information.

Screenshot demonstrating that this only works with 2.9.0:

[image: 12-23-47 new message-pzco5] https://cloud.githubusercontent.com/assets/129031/26215165/e9e67fe4-3bc4-11e7-8a93-fb76744ba359.png

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/magento-ecg/coding-standard/issues/48#issuecomment-302482601, or mute the thread https://github.com/notifications/unsubscribe-auth/AA4ypnCJTLanC3JF9YlC8thbeF8lvm8zks5r7H7TgaJpZM4M-l2j .

Zifius commented 7 years ago

Hi guys, can you check if #52 works well for you?

erikhansen commented 7 years ago

@Zifius I pulled in the code from your pull request and it appears to work great with CodeSniffer 3.0. Thanks for working on this! Screenshot demonstrating it working:

image

Zifius commented 7 years ago

Cool, thanks for checking @erikhansen, I've sent email to @zlik so we should get it into master soon if the PR passes review therefore I propose closing #51

P.S. You might want to check my small project https://github.com/Zifius/Magizendo which is based on this one

erickpatrick commented 7 years ago

So, since May 4th the project PHPCodeSniffer released its version 3.0.0. It would be really interesting to see some movement/response regarding the code review.

If needed I can help code reviewing it,.

Zifius commented 7 years ago

Hi @erickpatrick, I emailed @zlik on the same day I did the PR so he either busy or on vacation. Anyway go on and review my changes and their own compliance with the coding standards (which I was fixing for PSR-2). I'll try to get merge rights for this project since I'm ECG member as well. Thanks for your help in advance

andreasemer commented 7 years ago

Thx @Zifius this works for me with version 3.0 👍