Bug #19726 [Opn->Csd]: Wrong number of spaces expected after instanceof static

From: Date: Mon, 03 Dec 2012 00:23:01 +0000
Subject: Bug #19726 [Opn->Csd]: Wrong number of spaces expected after instanceof static
References: 1  Groups: php.pear.bugs 
Request: Send a blank email to pear-bugs+get-9385@lists.php.net to get a copy of this message
Edit report at https://pear.php.net/bugs/bug.php?id=19726&edit=1 ID: 19726 Updated by: gsherwood@squiz.net Reported By: info at strictcoding dot co dot uk Summary: Wrong number of spaces expected after instanceof static -Status: Open +Status: Closed Type: Bug Package: PHP_CodeSniffer Operating System: CentOS Package Version: 1.4.2 PHP Version: 5.4.7 -Assigned To: +Assigned To: squiz Roadmap Versions: New Comment: -Status: Open +Status: Closed -Assigned To: +Assigned To: squiz That was a strange one. PHP was tokenizing that class name as a T_STATIC token. I changed the PHPCS tokenizer to correct it back to T_STRING. Commit is here: https://github.com/squizlabs/PHP_CodeSniffer/commit/2fc7017e28fd5285deca84b818f 6ba1ff732a785 Previous Comments: ------------------------------------------------------------------------ [2012-11-29 15:41:52] bmorel I forgot the most important: this is when using the PSR2 standard. ------------------------------------------------------------------------ [2012-11-29 15:39:38] bmorel Description: ------------ When 'static' is used after 'instanceof', it is thought to be a static variable declaration, and wrongly expects a space after it. Test script: --------------- if ($geometry instanceof static) {} Expected result: ---------------- No errors Actual result: -------------- ERROR | Scope keyword "static" must be followed by a single space ------------------------------------------------------------------------ -- Edit this bug report at https://pear.php.net/bugs/bug.php?id=19726&edit=1

« previous php.pear.bugs (#9385) next »