Php_codesniffer: ERROR: Referenced sniff "Generic.PHP.LowerCaseType" does not exist

Created on 11 Jan 2019  路  4Comments  路  Source: squizlabs/PHP_CodeSniffer

Hello. Please help me fix this error.
ERROR: Referenced sniff "Generic.PHP.LowerCaseType" does not exist

phpcs -i

The installed coding standards are PSR12, PEAR, PSR2, Squiz, Zend, PSR1, MySource, WordPress-Docs, WordPress-Core, WordPress-Extra, WordPress, PHPCompatibility, WebDevStudios, Generic and Security

phpcs --config-show
Using config file: /etc/php-codesniffer/CodeSniffer.conf

default_standard: Squiz
installed_paths: /usr/share/php/PHP/CodeSniffer/src/Standards/WordPress-Coding-Standards/,/usr/share/php/PHP/CodeSniffer/src/Standards/PHPCompatibility/,/usr/share/php/PHP/CodeSniffer/src/Standards/WDS-Coding-Standards/,/usr/share/php/PHP/CodeSniffer/src/Standards/Generic,/usr/share/php/PHP/CodeSniffer/src/Standards/phpcs-security-audit
php_path: /usr/bin/php


phpcs --version
PHP_CodeSniffer version 3.2.3 (stable) by Squiz (http://www.squiz.net)


php --version
PHP 7.2.10-0ubuntu0.18.04.1 (cli) (built: Sep 13 2018 13:45:02) ( NTS )
Copyright (c) 1997-2018 The PHP Group
Zend Engine v3.2.0, Copyright (c) 1998-2018 Zend Technologies
with Zend OPcache v7.2.10-0ubuntu0.18.04.1, Copyright (c) 1999-2018, by Zend Technologies

Most helpful comment

@dimative Well, that depends on how you installed PHPCS.

  • Phar: download the latest release and copy it over the old version. If you don't know where the old version is, try which phpcs to find out.
  • Composer: run composer update squizlabs/php_codesniffer
  • PEAR: run pear upgrade --alldeps PHP_CodeSniffer
  • Git clone: pull in the latest version.

All 4 comments

@dimative Please update your PHPCS install, the version of WPCS you are using has a minimum PHPCS requirement of PHPCS 3.3.1. You are using version 3.2.3.

@jrfnl Hello. Thanks for the reply. How can i update it? I am new in phpcs. My OS in Ubuntu 18.0.4

@jrfnl My problem already fixed. Thanks again.

@dimative Well, that depends on how you installed PHPCS.

  • Phar: download the latest release and copy it over the old version. If you don't know where the old version is, try which phpcs to find out.
  • Composer: run composer update squizlabs/php_codesniffer
  • PEAR: run pear upgrade --alldeps PHP_CodeSniffer
  • Git clone: pull in the latest version.
Was this page helpful?
0 / 5 - 0 ratings