cvs: pear /PHP_CodeSniffer/CodeSniffer File.php
| From: | Greg Sherwood | Date: | Fri, 12 Jan 2007 02:50:23 +0000 |
| Subject: | cvs: pear /PHP_CodeSniffer/CodeSniffer File.php | ||
| Groups: | php.pear.cvs | ||
| Request: | Send a blank email to pear-cvs+get-44187@lists.php.net to get a copy of this message | ||
squiz Fri Jan 12 02:50:23 2007 UTC
Modified files:
/pear/PHP_CodeSniffer/CodeSniffer File.php
Log:
Store the actual variable type hint so that we can later do comparison in sniffs.
http://cvs.php.net/viewvc.cgi/pear/PHP_CodeSniffer/CodeSniffer/File.php?r1=1.17&r2=1.18&diff_format=u
Index: pear/PHP_CodeSniffer/CodeSniffer/File.php
diff -u pear/PHP_CodeSniffer/CodeSniffer/File.php:1.17
pear/PHP_CodeSniffer/CodeSniffer/File.php:1.18
--- pear/PHP_CodeSniffer/CodeSniffer/File.php:1.17 Tue Jan 9 23:04:44 2007
+++ pear/PHP_CodeSniffer/CodeSniffer/File.php Fri Jan 12 02:50:23 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.17 2007/01/09 23:04:44 squiz Exp $
+ * @version CVS: $Id: File.php,v 1.18 2007/01/12 02:50:23 squiz Exp $
* @link http://pear.php.net/package/PHP_CodeSniffer
*/
@@ -1305,9 +1305,8 @@
* <code>
* 0 => array(
* 'name' => '$var', // The variable name.
- * 'is_array' => false, // An array hint was used.
* 'pass_by_reference' => false, // Passed by reference.
- * 'type_hint' => false, // A custom type hint
+ * 'type_hint' => string, // Type hint for array or custom type
* )
* </code>
*
@@ -1334,7 +1333,6 @@
$currVar = null;
$defaultStart = null;
$paramCount = 0;
- $isArray = false;
$passByReference = false;
$typeHint = '';
@@ -1359,7 +1357,7 @@
$currVar = $i;
break;
case T_ARRAY_HINT:
- $isArray = true;
+ $typeHint = $this->_tokens[$i]['content'];
break;
case T_STRING:
$typeHint = $this->_tokens[$i]['content'];
@@ -1379,13 +1377,11 @@
$vars[$paramCount]['default'] =
$this->getTokensAsString($defaultStart, ($i - $defaultStart));
}
- $vars[$paramCount]['is_array'] = $isArray;
$vars[$paramCount]['pass_by_reference'] = $passByReference;
$vars[$paramCount]['type_hint'] = $typeHint;
// Reset the vars, as we are about to process the next parameter.
$defaultStart = null;
- $isArray = false;
$passByReference = false;
$typeHint = '';