I've followed all the steps from the official git page for installing and configure PHPCompatibility for checking the compatibility of my code with PHP7 as described bellow:
- Installation of
PHP_CodeSniffer
using pear. - Download and extraction of the most recent release (PHP 7.1 Sniffs - update 2016-12-14) on https://github.com/wimg/PHPCompatibility/releases to directory
/Applications/MAMP/bin/php/php7.0.12/lib/php/PHP/CodeSniffer/Standards/PHPCompatibility/
After that I additionally did the following commands on terminal
Add PHPCompatibility to the standards
$ phpcs --config-set installed_paths /Applications/MAMP/bin/php/php7.0.12/lib/php/PHP/CodeSniffer/Standards/PHPCompatibility/
Test if the PHPCompatibility was added as a standard
$ phpcs -i
my output is:
The installed coding standards are MySource, PEAR, PHPCompatibility, PHPCS, PSR1, PSR2, Squiz and Zend
Set testVersion to PHP 7
$ phpcs --runtime-set testVersion 7.0 test.php
which correctly prints a report for test.php
But When I try to set PHPCompatibility as a standard anything happens and the terminal jumps to a new line for typing the next command.
`$ phpcs --standard=PHPCompatibility test.php`
`Natalis-MacBook-Air:bin natalisilverio$ `
Could anyone advise what I am missing or doing wrong while trying to set PHPCompatibility as my standard? I tested phpcs --standard=Zend and it works correctly.
I am running MAMP 4.0.6 set to PHP 7.0.12 Thank you very much
Try running with
-p
. This will show the progress of the run.Rather than showing nothing for a good result, it will show something like this: