Bug #19755 [Opn]: Token of T_CLASS type has no scope_opener and scope_closer keys.

From: Date: Wed, 19 Dec 2012 00:46:11 +0000
Subject: Bug #19755 [Opn]: Token of T_CLASS type has no scope_opener and scope_closer keys.
References: 1  Groups: php.pear.bugs 
Request: Send a blank email to pear-bugs+get-9429@lists.php.net to get a copy of this message
Edit report at https://pear.php.net/bugs/bug.php?id=19755&edit=1 ID: 19755 Updated by: gsherwood@squiz.net Reported By: awakehl at gmail dot com Summary: Token of T_CLASS type has no scope_opener and scope_closer keys. Status: Open Type: Bug Package: PHP_CodeSniffer Operating System: ubuntu 11.10 Package Version: 1.4.3 PHP Version: 5.3.6 -Assigned To: +Assigned To: squiz Roadmap Versions: New Comment: -Assigned To: +Assigned To: squiz This is caused by the fact that the first IF statement has no openers or closers of any kind, and the second has no keyword. So the tokenizer matches the keyword on the first line of the function with the opener on the second. Previous Comments: ------------------------------------------------------------------------ [2012-12-17 11:25:40] awakehl Description: ------------ Just upgraded from 1.3.3 to 1.4.3 and now have errors with some of my class files. Something like Notice: Undefined index: scope_closer in ../Sniffs/WhiteSpace/FunctionSpacingSniff.php on line 38. There is no scope_closer and scope_opener keys in T_CLASS type token. Test script: --------------- This error reproducing when i'm trying to check this file: <?php class Test { public function test() { if (1) 1; 1 ? (1 ? 1 : 1) : 1; } } Expected result: ---------------- Expected scope_closer and scope_opener keys in token. Actual result: -------------- No scope_closer and scope_opener keys in token. Got php Notice in my sniff. ------------------------------------------------------------------------ -- Edit this bug report at https://pear.php.net/bugs/bug.php?id=19755&edit=1

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