FAQ
Edit report at https://pear.php.net/bugs/bug.php?id=19471&edit=1

ID: 19471
Comment by: brian.kendig@disney.com
Reported By: brian dot kendig@disney.com
Summary: phpcs on Windows, when using Zend standard, doesn't
catch problems
Status: Closed
Type: Bug
Package: PHP_CodeSniffer
Operating System: Windows 7
Package Version: 1.3.4
PHP Version: 5.3.9
Assigned To: squiz
Roadmap Versions:
New Comment:

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!


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

[2012-06-18 06:55:27] squiz

-Status: Assigned
+Status: Closed
Pull request merged in. Fix is now in Github repo.

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

[2012-06-18 06:54:09] squiz

-Assigned To:
+Assigned To: squiz
Fixed by pull request:
https://github.com/squizlabs/PHP_CodeSniffer/pull/35

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

[2012-06-13 19:41:20] bkendig

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-13 19:27:57] bkendig

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 19:25:54] bkendig

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.

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

Search Discussions

Related Discussions

Discussion Navigation
viewthread | post
posts ‹ prev | 1 of 1 | next ›
Discussion Overview
grouppear-bugs @
categoriesphp
postedJul 2, '12 at 7:54p
activeJul 2, '12 at 7:54p
posts1
users1
websitepear.php.net

1 user in discussion

Brian Kendig: 1 post

People

Translate

site design / logo © 2022 Grokbase