0

Currently i am having PSR2 installed which gets invoked while git commit and show the lines which are in not in PSR2 coding standards.

But i want to install PSR12 coding standard, for which i just tried by changing the PSR2 to PSR12 in my pre-commit git hook (./vendor/bin/phpcs --standard=PSR12 --encoding=utf-8 -n -p $TMP_DIR) but it is showing me following message

ERROR: the "PSR12" coding standard is not installed. The installed coding standards are PEAR, Squiz, PSR1, PHPCS, PSR2, Zend and MySource

Anyone having any idea how to install the same for php using composer or any other method for git commit

vinit agrawal
  • 159
  • 1
  • 1
  • 9

1 Answers1

1

There is no stable release of PHP_CodeSniffer with PSR12 standard. You need to install phpcs from dev-master:

composer require squizlabs/php_codesniffer:dev-master --dev

Or wait for stable release (probably 3.3.0).

rob006
  • 21,383
  • 5
  • 53
  • 74