Package home | Report new bug | New search | Development Roadmap Status: Open | Feedback | All | Closed Since Version 3.7.2

Bug #20377 Error when trying to execute phpcs with report=json
Submitted: 2014-08-28 18:37 UTC
From: austerus Assigned: squiz
Status: Closed Package: PHP_CodeSniffer (version 2.0.0RC1)
PHP Version: 5.4.31 OS: CentOS 6
Roadmaps: (Not assigned)    
Subscription  
Comments Add Comment Add patch


Anyone can comment on a bug. Have a simpler test case? Does it work for you on a different platform? Let us know! Just going to say 'Me too!'? Don't clutter the database with that please !
Your email address:
MUST BE VALID
Solve the problem : 14 - 13 = ?

 
 [2014-08-28 18:37 UTC] austerus (Andrei Avram)
Description: ------------ Hello, I am running (src is a folder containing PHP files): phpcs --report=json --standard="PSR2" src I am getting: PHP Fatal error: Declaration of PHP_CodeSniffer_Reports_Json::generateFileReport() must be compatible with PHP_CodeSniffer_Report::generateFileReport($report, PHP_CodeSniffer_File $phpcsFile, $showSources = false, $width = 80) in /usr/share/pear/PHP/CodeSniffer/Reports/Json.php on line 31 PHP Stack trace: PHP 1. {main}() /usr/bin/phpcs:0 PHP 2. PHP_CodeSniffer_CLI->runphpcs() /usr/bin/phpcs:25 PHP 3. PHP_CodeSniffer_CLI->process() /usr/share/pear/PHP/CodeSniffer/CLI.php:91 PHP 4. PHP_CodeSniffer->processFiles() /usr/share/pear/PHP/CodeSniffer/CLI.php:789 PHP 5. PHP_CodeSniffer->processFile() /usr/share/pear/PHP/CodeSniffer.php:615 PHP 6. PHP_CodeSniffer->_processFile() /usr/share/pear/PHP/CodeSniffer.php:1534 PHP 7. PHP_CodeSniffer_File->__construct() /usr/share/pear/PHP/CodeSniffer.php:1648 PHP 8. PHP_CodeSniffer_Reporting->factory() /usr/share/pear/PHP/CodeSniffer/File.php:317 PHP 9. class_exists() /usr/share/pear/PHP/CodeSniffer/Reporting.php:118 PHP 10. PHP_CodeSniffer::autoload() /usr/share/pear/PHP/CodeSniffer/Reporting.php:0 PHP 11. include() /usr/share/pear/PHP/CodeSniffer.php:282 Test script: --------------- #PHP_CodeSniffer installed via pear phpcs --report=json --standard="PSR2" src Expected result: ---------------- receive a JSON report Actual result: -------------- PHP Fatal error: Declaration of PHP_CodeSniffer_Reports_Json::generateFileReport() must be compatible with PHP_CodeSniffer_Report::generateFileReport($report, PHP_CodeSniffer_File $phpcsFile, $showSources = false, $width = 80) in /usr/share/pear/PHP/CodeSniffer/Reports/Json.php on line 31 PHP Stack trace: PHP 1. {main}() /usr/bin/phpcs:0 PHP 2. PHP_CodeSniffer_CLI->runphpcs() /usr/bin/phpcs:25 PHP 3. PHP_CodeSniffer_CLI->process() /usr/share/pear/PHP/CodeSniffer/CLI.php:91 PHP 4. PHP_CodeSniffer->processFiles() /usr/share/pear/PHP/CodeSniffer/CLI.php:789 PHP 5. PHP_CodeSniffer->processFile() /usr/share/pear/PHP/CodeSniffer.php:615 PHP 6. PHP_CodeSniffer->_processFile() /usr/share/pear/PHP/CodeSniffer.php:1534 PHP 7. PHP_CodeSniffer_File->__construct() /usr/share/pear/PHP/CodeSniffer.php:1648 PHP 8. PHP_CodeSniffer_Reporting->factory() /usr/share/pear/PHP/CodeSniffer/File.php:317 PHP 9. class_exists() /usr/share/pear/PHP/CodeSniffer/Reporting.php:118 PHP 10. PHP_CodeSniffer::autoload() /usr/share/pear/PHP/CodeSniffer/Reporting.php:0 PHP 11. include() /usr/share/pear/PHP/CodeSniffer.php:282

Comments

 [2014-08-28 18:46 UTC] austerus (Andrei Avram)
I'd like to add that the same works with 1.5.4 stable.
 [2014-09-01 05:03 UTC] squiz (Greg Sherwood)
-Status: Open +Status: Closed -Assigned To: +Assigned To: squiz
Fix committed to Github repo: https://github.com/squizlabs/PHP_CodeSniffer/commit/185a486af0da98720cbdb3e4c5a 81018f650af61