phpcs --standard=PHPCompatibility not working

3.7k views Asked by At

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:

  1. Installation of PHP_CodeSniffer using pear.
  2. 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

  1. Add PHPCompatibility to the standards

    $ phpcs --config-set installed_paths /Applications/MAMP/bin/php/php7.0.12/lib/php/PHP/CodeSniffer/Standards/PHPCompatibility/

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

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

1

There are 1 answers

0
mbomb007 On

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:

.....SSSSSSSSSSSSSSSSSSSSSSSSSSSSSSS........................  60 / 181 (33%)
.S.......................................................... 120 / 181 (66%)
....................................S......S.S.............. 180 / 181 (99%)
.                                                            181 / 181 (100%)