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

ID: 17123
Updated by: gsherwood@squiz.net
Reported By: team at fazend dot com
Summary: curled braces in Zend standard, would be nice to
validate them
Status: Open
Type: Feature/Change Request
Package: PHP_CodeSniffer
Operating System: MacOS
Package Version: 1.2.2
PHP Version: 5.3.0
Roadmap Versions:
New Comment:

The Zend standard is not a complete standard; just a collection of
contributed sniffs. Other sniffs are able to do this and you are able to
use them easily in your own standard using the new ruleset.xml format.


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

[2010-03-17 16:10:25] jsotuyod

You can have the same behaviour using
PEAR/Sniffs/ControlStructures/ControlSignatureSniff.php

It requires a single space before the brace, and the brace is required.
Just like ZF standard.

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

[2010-02-17 09:36:08] fazend

Description:
------------
According to Zend Coding Standard if(), foreach(), and while() should
always have their statements wrapped in curled braces.

Would be nice to have PHPCS to validate this requirement.

Test script:
---------------
if ($a == $b)
echo "works";

Expected result:
----------------
if ($a == $b) {
echo "works";
}

Actual result:
--------------
no error or warning, but would be nice to have it here

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

Search Discussions

  • Gsherwood at Aug 11, 2010 at 6:34 am
    Edit report at http://pear.php.net/bugs/bug.php?id=17123&edit=1

    ID: 17123
    Updated by: gsherwood@squiz.net
    Reported By: team at fazend dot com
    Summary: curled braces in Zend standard, would be nice to
    validate them
    -Status: Open
    +Status: Closed
    Type: Feature/Change Request
    Package: PHP_CodeSniffer
    Operating System: MacOS
    Package Version: 1.2.2
    PHP Version: 5.3.0
    -Assigned To:
    +Assigned To: squiz
    Roadmap Versions:
    New Comment:

    -Status: Open
    +Status: Closed
    -Assigned To:
    +Assigned To: squiz



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

    [2010-08-11 06:34:18] squiz

    The Zend standard is not a complete standard; just a collection of
    contributed sniffs. Other sniffs are able to do this and you are able to
    use them easily in your own standard using the new ruleset.xml format.

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

    [2010-03-17 16:10:25] jsotuyod

    You can have the same behaviour using
    PEAR/Sniffs/ControlStructures/ControlSignatureSniff.php

    It requires a single space before the brace, and the brace is required.
    Just like ZF standard.

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

    [2010-02-17 09:36:08] fazend

    Description:
    ------------
    According to Zend Coding Standard if(), foreach(), and while() should
    always have their statements wrapped in curled braces.

    Would be nice to have PHPCS to validate this requirement.

    Test script:
    ---------------
    if ($a == $b)
    echo "works";

    Expected result:
    ----------------
    if ($a == $b) {
    echo "works";
    }

    Actual result:
    --------------
    no error or warning, but would be nice to have it here

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

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
grouppear-bugs @
categoriesphp
postedAug 11, '10 at 6:34a
activeAug 11, '10 at 6:34a
posts2
users1
websitepear.php.net

1 user in discussion

Gsherwood: 2 posts

People

Translate

site design / logo © 2022 Grokbase