Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Getting error in PHP CodeSniffer

When I try to open a file in PHPStorm(10.0.3) getting following message.

phpcs: PHP Fatal error: Call to undefined method PHP_CodeSniffer_File::recordMetric() in /usr/share/php/PHP/CodeSniffer/Standards/PSR2/Sniffs/Files/ClosingTagSniff.php on line 91

Is anyone know whats this?

like image 882
KKK Avatar asked Oct 19 '22 18:10

KKK


1 Answers

Upgrading Code Sniffer fixed this error for me.

I had a similar error and found that I was using an old version (1.5) of code sniffer. I then used pear to install it and now am on version 2.5.1 and the error is gone.

Not sure what OS you are using but for Ubuntu I used:

pear install --alldeps php_codesniffer
like image 85
Anthony Avatar answered Oct 27 '22 11:10

Anthony