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: Open
Type: Bug
Package: PHP_CodeSniffer
Operating System: Windows 7
Package Version: 1.3.4
PHP Version: 5.3.9
Roadmap Versions:
New Comment:

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.


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

[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

  • Brian Kendig at Jun 13, 2012 at 5:36 pm
    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: Open
    Type: Bug
    Package: PHP_CodeSniffer
    Operating System: Windows 7
    Package Version: 1.3.4
    PHP Version: 5.3.9
    Roadmap Versions:
    New Comment:

    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


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

    [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.

    ------------------------------------------------------------------------
  • Gsherwood at Jun 18, 2012 at 4:48 am
    Edit report at https://pear.php.net/bugs/bug.php?id=19471&edit=1

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

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


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

    [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.

    ------------------------------------------------------------------------
  • Gsherwood at Jun 18, 2012 at 4:50 am
    Edit report at https://pear.php.net/bugs/bug.php?id=19471&edit=1

    ID: 19471
    Updated by: gsherwood@squiz.net
    Reported By: brian dot kendig@disney.com
    Summary: phpcs on Windows, when using Zend standard, doesn't
    catch problems
    -Status: Assigned
    +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:

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


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

    [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.

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

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
grouppear-bugs @
categoriesphp
postedJun 13, '12 at 5:22p
activeJun 18, '12 at 4:50a
posts4
users2
websitepear.php.net

2 users in discussion

Brian Kendig: 2 posts Gsherwood: 2 posts

People

Translate

site design / logo © 2022 Grokbase