[PEAR-BUG] Bug #20377 [Opn]: Error when trying to execute phpcs with report=json

[email protected]
Newsgroups php.pear.bugs
Message-ID <[email protected]>
Edit report at https://pear.php.net/bugs/bug.php?id=20377&edit=1

 ID:               20377
 Updated by:       [email protected]
 Reported By:      elven_rangers at yahoo dot com
 Summary:          Error when trying to execute phpcs with report=json
 Status:           Open
 Type:             Bug
 Package:          PHP_CodeSniffer
 Operating System: CentOS 6
 Package Version:  2.0.0RC1
 PHP Version:      5.4.31
 Roadmap Versions: 
 New Comment:

I'd like to add that the same works with 1.5.4 stable.


Previous Comments:
------------------------------------------------------------------------

[2014-08-28 14:37:05] austerus

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

------------------------------------------------------------------------


-- 
Edit this bug report at https://pear.php.net/bugs/bug.php?id=20377&edit=1
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.