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

Bug #20200 Invalid JSON produced with specific error message
Submitted: 2014-02-14 06:19 UTC
From: eturner Assigned: squiz
Status: Closed Package: PHP_CodeSniffer (version 1.5.2)
PHP Version: 5.4.6 OS: Linux
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 : 30 + 4 = ?

 
 [2014-02-14 06:19 UTC] eturner (Ernie Turner)
Description: ------------ When running PHPCS and having it dump out the results in a JSON file, it's producing invalid JSON when it displays the error message for the Squiz.Commenting.FunctionCommentThrowTag.WrongType rule. The results id outputs look like so: { "message": "Expected \"\Exception\" but found \"Exception\" for @throws tag exception", "source": "Squiz.Commenting.FunctionCommentThrowTag.WrongType", "severity": 5, "type": "ERROR", "line": 1085, "column": 1 } It seems that the leading \ in Exception isn't accepted. Either removing it or adding an additional slash fixes the problem.

Comments

 [2014-02-20 04:24 UTC] squiz (Greg Sherwood)
-Status: Open +Status: Closed -Assigned To: +Assigned To: squiz
Fix committed to git repo (need the escape slashes): https://github.com/squizlabs/PHP_CodeSniffer/commit/9da64703b33458aa4627ebc8e 1b8cd2bcc5643e2