cvs: pear /PHP_CodeSniffer/CodeSniffer File.php

From: Date: Thu, 01 Mar 2007 00:45:11 +0000
Subject: cvs: pear /PHP_CodeSniffer/CodeSniffer File.php
Groups: php.pear.cvs 
Request: Send a blank email to pear-cvs+get-44916@lists.php.net to get a copy of this message
squiz Thu Mar 1 00:45:11 2007 UTC Modified files: /pear/PHP_CodeSniffer/CodeSniffer File.php Log: PHP_CodeSniffer_File no longer throws an except if you dont pass it a T_BITWISE_AND token, it just returns false. This allows you to check tokens for references without additional checking in your code. http://cvs.php.net/viewvc.cgi/pear/PHP_CodeSniffer/CodeSniffer/File.php?r1=1.20&r2=1.21&diff_format=u Index: pear/PHP_CodeSniffer/CodeSniffer/File.php diff -u pear/PHP_CodeSniffer/CodeSniffer/File.php:1.20 pear/PHP_CodeSniffer/CodeSniffer/File.php:1.21 --- pear/PHP_CodeSniffer/CodeSniffer/File.php:1.20 Wed Feb 28 05:58:01 2007 +++ pear/PHP_CodeSniffer/CodeSniffer/File.php Thu Mar 1 00:45:11 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: File.php,v 1.20 2007/02/28 05:58:01 squiz Exp $ + * @version CVS: $Id: File.php,v 1.21 2007/03/01 00:45:11 squiz Exp $ * @link http://pear.php.net/package/PHP_CodeSniffer */ @@ -1570,12 +1570,11 @@ * @param int $stackPtr The position of the T_BITWISE_AND token. * * @return boolean - * @throws PHP_CodeSniffer_Exception If the token is not T_BITWISE_AND. */ public function isReference($stackPtr) { if ($this->_tokens[$stackPtr]['code'] !== T_BITWISE_AND) { - throw new PHP_CodeSniffer_Exception('$stackPtr must represent a T_BITWISE_AND token'); + return false; } $tokenBefore = $this->findPrevious(PHP_CodeSniffer_Tokens::$emptyTokens, ($stackPtr - 1), null, true);

« previous php.pear.cvs (#44916) next »