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

ID: 17048
Updated by: gsherwood@squiz.net
Reported By: kukulich at kukulich dot cz
Summary: False positive in
Squiz_WhiteSpace_ScopeKeywordSpacingSniff
-Status: Open
+Status: Closed
Type: Bug
Package: PHP_CodeSniffer
Package Version: 1.2.2
PHP Version: 5.3.1
-Assigned To:
+Assigned To: squiz
Roadmap Versions:
New Comment:

-Status: Open
+Status: Closed
-Assigned To:
+Assigned To: squiz
This bug has been fixed in SVN.

If this was a documentation problem, the fix will appear on
pear.php.net by the end of next Sunday (CET).

If this was a problem with the pear.php.net website, the change should
be live shortly.

Otherwise, the fix will appear in the package's next release.

Thank you for the report and for helping us make PEAR better.




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

[2010-01-31 11:19:40] kukulich

Description:
------------
Patch:

--- ScopeKeywordSpacingSniff.php
+++ ScopeKeywordSpacingSniff.new.php
@@ -68,6 +68,11 @@
return;
}

+ if ($tokens[($stackPtr - 2)]['code'] === T_NEW) {
+ // new static();
+ return;
+ }
+
if ($nextToken['code'] !== T_WHITESPACE
strlen($nextToken['content']) !== 1
$nextToken['content'] === $phpcsFile->eolChar


Test script:
---------------
<?php

abstract class Foo
{
public static function getInstance()
{
return new static();
}
}

Expected result:
----------------
No error

Actual result:
--------------
FOUND 1 ERROR(S) AND 0 WARNING(S) AFFECTING 1 LINE(S)
-------------------------------------------------------------------------
7 | ERROR | Scope keyword "static" must be followed by a single space
-------------------------------------------------------------------------

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

Search Discussions

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
grouppear-bugs @
categoriesphp
postedFeb 2, '10 at 12:35a
activeFeb 2, '10 at 12:35a
posts1
users1
websitepear.php.net

1 user in discussion

Gsherwood: 1 post

People

Translate

site design / logo © 2022 Grokbase