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

ID: 19869
Updated by: [email protected]
Reported By: rafael at doh dot ms
Summary: PSR-2 Sniff no longer allows operator namespce in IF
negations
-Status: Feedback
+Status: No Feedback
Type: Bug
Package: PHP_CodeSniffer
Package Version: 1.4.4
PHP Version: Irrelevant
Assigned To: squiz
Roadmap Versions:
New Comment:

-Status: Feedback
+Status: No Feedback



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

[2013-03-25 23:23:57] squiz

-Status: Open
+Status: Feedback
-Assigned To:
+Assigned To: squiz
The PSR-2 sniffs receive standard receives bug fixes like everything
else. This one
was fixed in version 1.4.4 and reported on bug #19732

I forgot to add a sniff to check for part of the standard, as described
here:
https://github.com/php-fig/fig-standards/blob/master/accepted/PSR-2-coding-style-
guide.md#5-control-structures

"There MUST NOT be a space after the opening parenthesis"

So everything is working correctly now, and the fact that you didn't get
any errors
was a PHPCS bug as the PSR-2 is pretty clear about what is required.

Does that explain things?

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

[2013-03-25 14:40:42] rdohms

Description:
------------
The statement:

if ( ! $variable) {

was accepted by the first versions of PRS-2 sniffs, but is now
not accepted anymore. As far as I could tell there was no
chance to the PSR-2 rule that forced this to be true.

Is "whitespace around negation operator" triggering the
"whitespace after parenthesis" rule, and if so, should this be
the case?

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

Search Discussions

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
grouppear-bugs @
categoriesphp
postedApr 2, '13 at 12:42a
activeApr 2, '13 at 12:42a
posts1
users1
websitepear.php.net

1 user in discussion

Gsherwood: 1 post

People

Translate

site design / logo © 2023 Grokbase