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

Bug #19471 phpcs on Windows, when using Zend standard, doesn't catch problems
Submitted: 2012-06-13 23:25 UTC
From: bkendig Assigned: squiz
Status: Closed Package: PHP_CodeSniffer (version 1.3.4)
PHP Version: 5.3.9 OS: Windows 7
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 : 19 + 45 = ?

 
 [2012-06-13 23:25 UTC] bkendig (Brian Kendig)
Description: ------------ PHP_CodeSniffer 1.3.3 on Windows, when used with "-- standard=Zend", properly catches problems with my code. When I upgrade to 1.3.4, it passes the code without catching any problems. Test script: --------------- C:\Users\brkendig\main>phpcs -n --standard=Zend --extensions=php test.php FILE: C:\Users\brkendig\main\test.php -------------------------------------------------------------------------------- FOUND 1 ERROR(S) AFFECTING 1 LINE(S) -------------------------------------------------------------------------------- 23 | ERROR | Opening brace of a class must be on the line after the definition -------------------------------------------------------------------------------- Time: 0 seconds, Memory: 7.75Mb C:\Users\brkendig\main>pear upgrade downloading PHP_CodeSniffer-1.3.4.tgz ... Starting to download PHP_CodeSniffer-1.3.4.tgz (335,461 bytes) ........done: 335,461 bytes upgrade ok: channel://pear.php.net/PHP_CodeSniffer-1.3.4 C:\Users\brkendig\main>phpcs -n --standard=Zend --extensions=php test.php Time: 0 seconds, Memory: 7.25Mb Expected result: ---------------- I expected it to find the same problem after the upgrade.

Comments

 [2012-06-13 23:27 UTC] bkendig (Brian Kendig)
I forgot to mention that PHP_CodeSniffer 1.3.4 on my Mac works fine, and properly catches the problems. It's only on Windows that it fails to see problems.
 [2012-06-13 23:41 UTC] bkendig (Brian Kendig)
Here is a better test case, providing a sample file, the results of installing and running phpcs 1.3.3 against it, then the results of installing and running phpcs 1.3.4 against it: C:\Users\brkendig\main>type test.php <?php class Foobar{ public $baz; } C:\Users\brkendig\main>pear install PHP_CodeSniffer-1.3.3 downloading PHP_CodeSniffer-1.3.3.tgz ... Starting to download PHP_CodeSniffer-1.3.3.tgz (330,476 bytes) ........done: 330,476 bytes install ok: channel://pear.php.net/PHP_CodeSniffer-1.3.3 C:\Users\brkendig\main>phpcs --version PHP_CodeSniffer version 1.3.3 (stable) by Squiz Pty Ltd. (http://www.squiz.net) C:\Users\brkendig\main>phpcs --standard=Zend test.php FILE: C:\Users\brkendig\main\test.php -------------------------------------------------------------------------------- FOUND 1 ERROR(S) AFFECTING 1 LINE(S) -------------------------------------------------------------------------------- 2 | ERROR | Opening brace of a class must be on the line after the definition -------------------------------------------------------------------------------- Time: 0 seconds, Memory: 2.50Mb C:\Users\brkendig\main>pear upgrade downloading PHP_CodeSniffer-1.3.4.tgz ... Starting to download PHP_CodeSniffer-1.3.4.tgz (335,461 bytes) ........done: 335,461 bytes upgrade ok: channel://pear.php.net/PHP_CodeSniffer-1.3.4 C:\Users\brkendig\main>phpcs --version PHP_CodeSniffer version 1.3.4 (stable) by Squiz Pty Ltd. (http://www.squiz.net) C:\Users\brkendig\main>phpcs --standard=Zend test.php Time: 0 seconds, Memory: 2.00Mb
 [2012-06-18 10:54 UTC] squiz (Greg Sherwood)
-Assigned To: +Assigned To: squiz
Fixed by pull request: https://github.com/squizlabs/PHP_CodeSniffer/pull/35
 [2012-06-18 10:55 UTC] squiz (Greg Sherwood)
-Status: Assigned +Status: Closed
Pull request merged in. Fix is now in Github repo.
 [2012-07-03 01:59 UTC] bkendig (Brian Kendig)
I'd like to request this fix in a release soon, please - we have people upgrading to the latest phpcs and not realizing that they have code sniffer errors, which their Windows phpcs misses but our Linux build environment catches!