cvs: pear /PHP_CodeSniffer/CodeSniffer/Standards AbstractScopeSniff.php
| From: | Greg Sherwood | Date: | Tue, 02 Jan 2007 00:07:31 +0000 |
| Subject: | cvs: pear /PHP_CodeSniffer/CodeSniffer/Standards AbstractScopeSniff.php | ||
| Groups: | php.pear.cvs | ||
| Request: | Send a blank email to pear-cvs+get-43914@lists.php.net to get a copy of this message | ||
squiz Tue Jan 2 00:07:31 2007 UTC
Modified files:
/pear/PHP_CodeSniffer/CodeSniffer/Standards AbstractScopeSniff.php
Log:
Scope sniff needs to listen for tokens outside the scope (if required) or those tokens will not be
checked.
http://cvs.php.net/viewvc.cgi/pear/PHP_CodeSniffer/CodeSniffer/Standards/AbstractScopeSniff.php?r1=1.2&r2=1.3&diff_format=u
Index: pear/PHP_CodeSniffer/CodeSniffer/Standards/AbstractScopeSniff.php
diff -u pear/PHP_CodeSniffer/CodeSniffer/Standards/AbstractScopeSniff.php:1.2
pear/PHP_CodeSniffer/CodeSniffer/Standards/AbstractScopeSniff.php:1.3
--- pear/PHP_CodeSniffer/CodeSniffer/Standards/AbstractScopeSniff.php:1.2 Tue Dec 12 02:19:03 2006
+++ pear/PHP_CodeSniffer/CodeSniffer/Standards/AbstractScopeSniff.php Tue Jan 2 00:07:31 2007
@@ -11,7 +11,7 @@
* @author Marc McIntyre <mmcintyre@squiz.net>
* @copyright 2006 Squiz Pty Ltd (ABN 77 084 670 600)
* @license http://matrix.squiz.net/developer/tools/php_cs/licence
BSD Licence
- * @version CVS: $Id: AbstractScopeSniff.php,v 1.2 2006/12/12 02:19:03 squiz Exp $
+ * @version CVS: $Id: AbstractScopeSniff.php,v 1.3 2007/01/02 00:07:31 squiz Exp $
* @link http://pear.php.net/package/PHP_CodeSniffer
*/
@@ -136,7 +136,11 @@
*/
public final function register()
{
- return $this->_scopeTokens;
+ if ($this->_listenOutside === false) {
+ return $this->_scopeTokens;
+ } else {
+ return array_merge($this->_scopeTokens, $this->_tokens);
+ }
}//end register()