5

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

6
  • Please, the original post was unreadable. Try to format better your questions and answers next time. Commented Dec 14, 2016 at 17:16
  • 2
    I was doing this now @MarcosPérezGude, thanks for your collaboration anyway. Commented Dec 14, 2016 at 17:19
  • Ok, sorry because I can't help you with this question. But you'll get answers soon I wish. Commented Dec 14, 2016 at 17:21
  • 1
    The --runtime-set arg sets the testVersion value for that single run only, so you'll need to specify that each time. Or you can use phpcs --config-set testVersion 7.0 to set it for all future runs. Commented Dec 14, 2016 at 23:16
  • Can you use composer? What PHP version are you running? Commented May 3, 2017 at 8:38

1 Answer 1

-1

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%)
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.