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

ID: 19926
Updated by: gsherwood@squiz.net
Reported By: daniel@danielgimenes.com dot br
Summary: PSR2 - Incorrect sniff inherited from PEAR
-Status: Open
+Status: Bogus
Type: Bug
Package: PHP_CodeSniffer
Operating System: Ubuntu 12.10 Quantal Quetzal
Package Version: 1.4.5
PHP Version: 5.4.14
-Assigned To:
+Assigned To: squiz
Roadmap Versions:
New Comment:

-Status: Open
+Status: Bogus
-Assigned To:
+Assigned To: squiz
The sniff was not inherited from the PEAR standard; it was specifically
selected so
that it could implement part of the PSR2 standard. See the ruleset here:

https://github.com/squizlabs/PHP_CodeSniffer/blob/master/CodeSniffer/Standards/
PSR2/ruleset.xml#L133

Standards grab sniffs from other standards so they don't duplicate code.
It's a core
feature of PHP_CodeSniffer's standard implementation. The code may refer
to
PEAR, but that is only to allow you to see where the sniff exists and to
let you
override the error messages globally.

If you want to see where all the sniffs are coming from to generate the
PSR2
standard, run: phpcs -e --standard=PSR2

Only 9 of the 40 sniffs are actually PSR2-specific.


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

[2013-04-30 23:47:31] danizord

Description:
------------
1) Opening parenthesis of a multi-line function call must be the
last content on the line.

2) Closing parenthesis of a multi-line function call must be on a
line by itself

These 2 sniffs are not in the PSR2 standard and were inherited
from PEAR

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

Search Discussions

  • Daniel at May 1, 2013 at 1:07 am
    Edit report at https://pear.php.net/bugs/bug.php?id=19926&edit=1

    ID: 19926
    Updated by: daniel@danielgimenes.com.br
    Reported By: daniel@danielgimenes.com dot br
    Summary: PSR2 - Incorrect sniff inherited from PEAR
    Status: Bogus
    Type: Bug
    Package: PHP_CodeSniffer
    Operating System: Ubuntu 12.10 Quantal Quetzal
    Package Version: 1.4.5
    PHP Version: 5.4.14
    Assigned To: squiz
    Roadmap Versions:
    New Comment:

    I got it, but this rule is not part of PSR-2 Standard. So this sniff
    need to be removed.


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

    [2013-05-01 02:38:04] squiz

    -Status: Open
    +Status: Bogus
    -Assigned To:
    +Assigned To: squiz
    The sniff was not inherited from the PEAR standard; it was specifically
    selected so
    that it could implement part of the PSR2 standard. See the ruleset here:

    https://github.com/squizlabs/PHP_CodeSniffer/blob/master/CodeSniffer/Standards/
    PSR2/ruleset.xml#L133

    Standards grab sniffs from other standards so they don't duplicate code.
    It's a core
    feature of PHP_CodeSniffer's standard implementation. The code may refer
    to
    PEAR, but that is only to allow you to see where the sniff exists and to
    let you
    override the error messages globally.

    If you want to see where all the sniffs are coming from to generate the
    PSR2
    standard, run: phpcs -e --standard=PSR2

    Only 9 of the 40 sniffs are actually PSR2-specific.

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

    [2013-04-30 23:47:31] danizord

    Description:
    ------------
    1) Opening parenthesis of a multi-line function call must be the
    last content on the line.

    2) Closing parenthesis of a multi-line function call must be on a
    line by itself

    These 2 sniffs are not in the PSR2 standard and were inherited
    from PEAR

    ------------------------------------------------------------------------
  • Gsherwood at May 1, 2013 at 4:04 am
    Edit report at https://pear.php.net/bugs/bug.php?id=19926&edit=1

    ID: 19926
    Updated by: gsherwood@squiz.net
    Reported By: daniel@danielgimenes.com dot br
    Summary: PSR2 - Incorrect sniff inherited from PEAR
    Status: Bogus
    Type: Bug
    Package: PHP_CodeSniffer
    Operating System: Ubuntu 12.10 Quantal Quetzal
    Package Version: 1.4.5
    PHP Version: 5.4.14
    Assigned To: squiz
    Roadmap Versions:
    New Comment:

    Yes, it is part of the PSR-2 standard.

    https://github.com/php-fig/fig-standards/blob/master/accepted/PSR-2-coding-style-
    guide.md#46-method-and-function-calls

    "Argument lists MAY be split across multiple lines, where each
    subsequent line is
    indented once. When doing so, the first item in the list MUST be on the
    next line,
    and there MUST be only one argument per line."

    Also look at the example code under that text.


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

    [2013-05-01 03:09:28] danizord

    I got it, but this rule is not part of PSR-2 Standard. So this sniff
    need to be removed.

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

    [2013-05-01 02:38:04] squiz

    -Status: Open
    +Status: Bogus
    -Assigned To:
    +Assigned To: squiz
    The sniff was not inherited from the PEAR standard; it was specifically
    selected so
    that it could implement part of the PSR2 standard. See the ruleset here:

    https://github.com/squizlabs/PHP_CodeSniffer/blob/master/CodeSniffer/Standards/
    PSR2/ruleset.xml#L133

    Standards grab sniffs from other standards so they don't duplicate code.
    It's a core
    feature of PHP_CodeSniffer's standard implementation. The code may refer
    to
    PEAR, but that is only to allow you to see where the sniff exists and to
    let you
    override the error messages globally.

    If you want to see where all the sniffs are coming from to generate the
    PSR2
    standard, run: phpcs -e --standard=PSR2

    Only 9 of the 40 sniffs are actually PSR2-specific.

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

    [2013-04-30 23:47:31] danizord

    Description:
    ------------
    1) Opening parenthesis of a multi-line function call must be the
    last content on the line.

    2) Closing parenthesis of a multi-line function call must be on a
    line by itself

    These 2 sniffs are not in the PSR2 standard and were inherited
    from PEAR

    ------------------------------------------------------------------------
  • Daniel at May 1, 2013 at 9:11 pm
    Edit report at https://pear.php.net/bugs/bug.php?id=19926&edit=1

    ID: 19926
    Updated by: daniel@danielgimenes.com.br
    Reported By: daniel@danielgimenes.com dot br
    Summary: PSR2 - Incorrect sniff inherited from PEAR
    Status: Bogus
    Type: Bug
    Package: PHP_CodeSniffer
    Operating System: Ubuntu 12.10 Quantal Quetzal
    Package Version: 1.4.5
    PHP Version: 5.4.14
    Assigned To: squiz
    Roadmap Versions:
    New Comment:

    I'm not talking about method declaration, but function call. See:

    $this->myFunction(array(
    'test1',
    'test2',
    ));

    OR

    throw new InvalidArgumentException(sprintf(
    '%s is invalid',
    $param
    ));

    This is valid in PSR-2


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

    [2013-05-01 06:06:26] squiz

    Yes, it is part of the PSR-2 standard.

    https://github.com/php-fig/fig-standards/blob/master/accepted/PSR-2-coding-style-
    guide.md#46-method-and-function-calls

    "Argument lists MAY be split across multiple lines, where each
    subsequent line is
    indented once. When doing so, the first item in the list MUST be on the
    next line,
    and there MUST be only one argument per line."

    Also look at the example code under that text.

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

    [2013-05-01 03:09:28] danizord

    I got it, but this rule is not part of PSR-2 Standard. So this sniff
    need to be removed.

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

    [2013-05-01 02:38:04] squiz

    -Status: Open
    +Status: Bogus
    -Assigned To:
    +Assigned To: squiz
    The sniff was not inherited from the PEAR standard; it was specifically
    selected so
    that it could implement part of the PSR2 standard. See the ruleset here:

    https://github.com/squizlabs/PHP_CodeSniffer/blob/master/CodeSniffer/Standards/
    PSR2/ruleset.xml#L133

    Standards grab sniffs from other standards so they don't duplicate code.
    It's a core
    feature of PHP_CodeSniffer's standard implementation. The code may refer
    to
    PEAR, but that is only to allow you to see where the sniff exists and to
    let you
    override the error messages globally.

    If you want to see where all the sniffs are coming from to generate the
    PSR2
    standard, run: phpcs -e --standard=PSR2

    Only 9 of the 40 sniffs are actually PSR2-specific.

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

    [2013-04-30 23:47:31] danizord

    Description:
    ------------
    1) Opening parenthesis of a multi-line function call must be the
    last content on the line.

    2) Closing parenthesis of a multi-line function call must be on a
    line by itself

    These 2 sniffs are not in the PSR2 standard and were inherited
    from PEAR

    ------------------------------------------------------------------------
  • Gsherwood at May 1, 2013 at 10:21 pm
    Edit report at https://pear.php.net/bugs/bug.php?id=19926&edit=1

    ID: 19926
    Updated by: gsherwood@squiz.net
    Reported By: daniel@danielgimenes.com dot br
    Summary: PSR2 - Incorrect sniff inherited from PEAR
    Status: Bogus
    Type: Bug
    Package: PHP_CodeSniffer
    Operating System: Ubuntu 12.10 Quantal Quetzal
    Package Version: 1.4.5
    PHP Version: 5.4.14
    Assigned To: squiz
    Roadmap Versions:
    New Comment:

    If you visited the link I provided, you'll see that it points to section
    4.6. Method and
    Function Calls of the PSR-2 standard. We're talking about the same
    thing.

    What you have is not valid as per that part of the standard.

    It clearly states that you MAY split your call over multiple lines
    (obviously when you
    arg list makes it necessary) and that if you do, you MUST start the
    first item on the
    next line.

    Please note that there is a section in the standard about method
    declarations which
    defines the exact same rule. These are different rules, but use almost
    the same
    text.


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

    [2013-05-01 23:12:47] danizord

    I'm not talking about method declaration, but function call. See:

    $this->myFunction(array(
    'test1',
    'test2',
    ));

    OR

    throw new InvalidArgumentException(sprintf(
    '%s is invalid',
    $param
    ));

    This is valid in PSR-2

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

    [2013-05-01 06:06:26] squiz

    Yes, it is part of the PSR-2 standard.

    https://github.com/php-fig/fig-standards/blob/master/accepted/PSR-2-coding-style-
    guide.md#46-method-and-function-calls

    "Argument lists MAY be split across multiple lines, where each
    subsequent line is
    indented once. When doing so, the first item in the list MUST be on the
    next line,
    and there MUST be only one argument per line."

    Also look at the example code under that text.

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

    [2013-05-01 03:09:28] danizord

    I got it, but this rule is not part of PSR-2 Standard. So this sniff
    need to be removed.

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

    [2013-05-01 02:38:04] squiz

    -Status: Open
    +Status: Bogus
    -Assigned To:
    +Assigned To: squiz
    The sniff was not inherited from the PEAR standard; it was specifically
    selected so
    that it could implement part of the PSR2 standard. See the ruleset here:

    https://github.com/squizlabs/PHP_CodeSniffer/blob/master/CodeSniffer/Standards/
    PSR2/ruleset.xml#L133

    Standards grab sniffs from other standards so they don't duplicate code.
    It's a core
    feature of PHP_CodeSniffer's standard implementation. The code may refer
    to
    PEAR, but that is only to allow you to see where the sniff exists and to
    let you
    override the error messages globally.

    If you want to see where all the sniffs are coming from to generate the
    PSR2
    standard, run: phpcs -e --standard=PSR2

    Only 9 of the 40 sniffs are actually PSR2-specific.

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

    [2013-04-30 23:47:31] danizord

    Description:
    ------------
    1) Opening parenthesis of a multi-line function call must be the
    last content on the line.

    2) Closing parenthesis of a multi-line function call must be on a
    line by itself

    These 2 sniffs are not in the PSR2 standard and were inherited
    from PEAR

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

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
grouppear-bugs @
categoriesphp
postedMay 1, '13 at 12:36a
activeMay 1, '13 at 10:21p
posts5
users2
websitepear.php.net

2 users in discussion

Gsherwood: 3 posts Daniel: 2 posts

People

Translate

site design / logo © 2022 Grokbase