svn: /pear/packages/PHP_CodeSniffer/trunk/ CodeSniffer/File.php CodeSniffer/Standards/Squiz/Tests/Commenting/FunctionCommentUnitTest.inc
CodeSniffer/Standards/Squiz/Tests/Commenting/FunctionCommentUnitTest.php package.xml
| From: | Greg Sherwood | Date: | Sun, 05 Sep 2010 23:41:13 +0000 |
| Subject: | svn: /pear/packages/PHP_CodeSniffer/trunk/ CodeSniffer/File.php CodeSniffer/Standards/Squiz/Tests/Commenting/FunctionCommentUnitTest.inc CodeSniffer/Standards/Squiz/Tests/Commenting/FunctionCommentUnitTest.php package.xml |
||
| Groups: | php.pear.cvs | ||
| Request: | Send a blank email to pear-cvs+get-60256@lists.php.net to get a copy of this message | ||
squiz Sun, 05 Sep 2010 23:41:13 +0000
Revision: http://svn.php.net/viewvc?view=revision&revision=303061
Log:
Fixed issue with Squiz FunctionCommentSniff reporting incorrect type hint when default value uses
namespace
Changed paths:
U pear/packages/PHP_CodeSniffer/trunk/CodeSniffer/File.php
U
pear/packages/PHP_CodeSniffer/trunk/CodeSniffer/Standards/Squiz/Tests/Commenting/FunctionCommentUnitTest.inc
U
pear/packages/PHP_CodeSniffer/trunk/CodeSniffer/Standards/Squiz/Tests/Commenting/FunctionCommentUnitTest.php
U pear/packages/PHP_CodeSniffer/trunk/package.xml
Modified: pear/packages/PHP_CodeSniffer/trunk/CodeSniffer/File.php
===================================================================
--- pear/packages/PHP_CodeSniffer/trunk/CodeSniffer/File.php 2010-09-05 23:29:15 UTC (rev 303060)
+++ pear/packages/PHP_CodeSniffer/trunk/CodeSniffer/File.php 2010-09-05 23:41:13 UTC (rev 303061)
@@ -1966,11 +1966,17 @@
}
}
- $typeHint .= $this->_tokens[$i]['content'];
+ if ($defaultStart === null) {
+ $typeHint .= $this->_tokens[$i]['content'];
+ }
+
break;
case T_NS_SEPARATOR:
- // Part of a type hint.
- $typeHint .= $this->_tokens[$i]['content'];
+ // Part of a type hint or default value.
+ if ($defaultStart === null) {
+ $typeHint .= $this->_tokens[$i]['content'];
+ }
+
break;
case T_CLOSE_PARENTHESIS:
case T_COMMA:
Modified:
pear/packages/PHP_CodeSniffer/trunk/CodeSniffer/Standards/Squiz/Tests/Commenting/FunctionCommentUnitTest.inc
===================================================================
---
pear/packages/PHP_CodeSniffer/trunk/CodeSniffer/Standards/Squiz/Tests/Commenting/FunctionCommentUnitTest.inc 2010-09-05
23:29:15 UTC (rev 303060)
+++
pear/packages/PHP_CodeSniffer/trunk/CodeSniffer/Standards/Squiz/Tests/Commenting/FunctionCommentUnitTest.inc 2010-09-05
23:41:13 UTC (rev 303061)
@@ -502,4 +502,30 @@
return $test;
}//end test()
+
+/**
+ * Comment.
+ *
+ * @param \first\ns\item $test An argument.
+ *
+ * @return mixed
+ */
+function test(\first\ns\item $test = \second\ns::CONSTANT)
+{
+ return $test;
+
+}//end test()
+
+/**
+ * Comment.
+ *
+ * @param \first\item $test An argument.
+ *
+ * @return mixed
+ */
+function test(\first\ns\item $test = \second\ns::CONSTANT)
+{
+ return $test;
+
+}//end test()
?>
Modified:
pear/packages/PHP_CodeSniffer/trunk/CodeSniffer/Standards/Squiz/Tests/Commenting/FunctionCommentUnitTest.php
===================================================================
---
pear/packages/PHP_CodeSniffer/trunk/CodeSniffer/Standards/Squiz/Tests/Commenting/FunctionCommentUnitTest.php 2010-09-05
23:29:15 UTC (rev 303060)
+++
pear/packages/PHP_CodeSniffer/trunk/CodeSniffer/Standards/Squiz/Tests/Commenting/FunctionCommentUnitTest.php 2010-09-05
23:41:13 UTC (rev 303061)
@@ -116,6 +116,7 @@
470 => 1,
474 => 1,
500 => 1,
+ 526 => 1,
);
}//end getErrorList()
Modified: pear/packages/PHP_CodeSniffer/trunk/package.xml
===================================================================
--- pear/packages/PHP_CodeSniffer/trunk/package.xml 2010-09-05 23:29:15 UTC (rev 303060)
+++ pear/packages/PHP_CodeSniffer/trunk/package.xml 2010-09-05 23:41:13 UTC (rev 303061)
@@ -27,6 +27,7 @@
<license uri="http://matrix.squiz.net/developer/tools/php_cs/licence">BSD
License</license>
<notes>
- Added Generic ClosureLinterSniff to run Google's gjslint over your JS files
+ - Fixed issue with Squiz FunctionCommentSniff reporting incorrect type hint when default value
uses namespace
</notes>
<contents>
<dir name="/">