cvs: pear /PHP_CodeSniffer/CodeSniffer/Standards/Squiz/Tests/Commenting FunctionCommentUnitTest.inc FunctionCommentUnitTest.php
| From: | Greg Sherwood | Date: | Fri, 12 Jan 2007 03:14:53 +0000 |
| Subject: | cvs: pear /PHP_CodeSniffer/CodeSniffer/Standards/Squiz/Tests/Commenting FunctionCommentUnitTest.inc FunctionCommentUnitTest.php | ||
| Groups: | php.pear.cvs | ||
| Request: | Send a blank email to pear-cvs+get-44194@lists.php.net to get a copy of this message | ||
squiz Fri Jan 12 03:14:53 2007 UTC
Modified files:
/pear/PHP_CodeSniffer/CodeSniffer/Standards/Squiz/Tests/Commenting
FunctionCommentUnitTest.inc
FunctionCommentUnitTest.php
Log:
Updated unit test cases for type hint, array declaration and return type check.
http://cvs.php.net/viewvc.cgi/pear/PHP_CodeSniffer/CodeSniffer/Standards/Squiz/Tests/Commenting/FunctionCommentUnitTest.inc?r1=1.2&r2=1.3&diff_format=u
Index: pear/PHP_CodeSniffer/CodeSniffer/Standards/Squiz/Tests/Commenting/FunctionCommentUnitTest.inc
diff -u
pear/PHP_CodeSniffer/CodeSniffer/Standards/Squiz/Tests/Commenting/FunctionCommentUnitTest.inc:1.2
pear/PHP_CodeSniffer/CodeSniffer/Standards/Squiz/Tests/Commenting/FunctionCommentUnitTest.inc:1.3
---
pear/PHP_CodeSniffer/CodeSniffer/Standards/Squiz/Tests/Commenting/FunctionCommentUnitTest.inc:1.2 Wed
Jan 10 03:14:44 2007
+++
pear/PHP_CodeSniffer/CodeSniffer/Standards/Squiz/Tests/Commenting/FunctionCommentUnitTest.inc Fri
Jan 12 03:14:53 2007
@@ -222,4 +222,80 @@
}//end missingReturnType()
+/**
+ * Case-sensitive var type check with multiple return type.
+ *
+ * @param String $a1 Comment here.
+ * @param BoOL $a2 Comment here.
+ * @param INT $a3 Comment here.
+ * @param aRRay $a4 Comment here.
+ * @param real $a5 Comment here.
+ * @param double $a6 Comment here.
+ * @param Myclass $a7 Comment here.
+ *
+ * @since 4.0.12
+ * @return int|object|double|float|array(int=>MyClass)
+ */
+public function caseSensitive($a1, $a2, $a3, arRay $a4, $a5, $a6, myclas $a7)
+{
+
+}//end caseSensitive()
+
+
+/**
+ * More type hint check for custom type and array.
+ *
+ * @param array $a1 Comment here.
+ * @param array $a2 Comment here.
+ * @param MyClass $a3 Comment here.
+ * @param MyClass $a4 Comment here.
+ *
+ * @since 4.0.0
+ * @return array(int => MyClass)
+ */
+public function typeHint(MyClass $a1, $a2, myclass $a3, $a4)
+{
+ return (3 => 'myclass obj');
+
+}//end typeHint()
+
+
+/**
+ * Mixed variable type separated by a '|'.
+ *
+ * @param array|string $a1 Comment here.
+ * @param mixed $a2 Comment here.
+ * @param string|array $a3 Comment here.
+ * @param MyClass|int $a4 Comment here.
+ *
+ * @since 4.0.0
+ * @return bool
+ */
+public function mixedType($a1, $a2, $a3, $a4)
+{
+ return true;
+
+}//end mixedType()
+
+
+/**
+ * Array type.
+ *
+ * @param array(MyClass) $a1 OK.
+ * @param array() $a2 Invalid type.
+ * @param array( $a3 Typo.
+ * @param array(int) $a4 Use 'array(integer)' instead.
+ * @param array(int => integer) $a5 Use 'array(integer => integer)' instead.
+ * @param array(integer => bool) $a6 Use 'array(integer => boolean)' instead.
+ * @param aRRay $a7 Use 'array' instead.
+ * @param string $a8 String with unknown type hint.
+ *
+ * @since 4.0.0
+ * @return int
+ */
+public function mixedArrayType($a1, $a2, array $a3, $a4, $a5, $a6, $a7, unknownTypeHint $a8)
+{
+ return 1;
+
+}//end mixedArrayType()
?>
http://cvs.php.net/viewvc.cgi/pear/PHP_CodeSniffer/CodeSniffer/Standards/Squiz/Tests/Commenting/FunctionCommentUnitTest.php?r1=1.2&r2=1.3&diff_format=u
Index: pear/PHP_CodeSniffer/CodeSniffer/Standards/Squiz/Tests/Commenting/FunctionCommentUnitTest.php
diff -u
pear/PHP_CodeSniffer/CodeSniffer/Standards/Squiz/Tests/Commenting/FunctionCommentUnitTest.php:1.2
pear/PHP_CodeSniffer/CodeSniffer/Standards/Squiz/Tests/Commenting/FunctionCommentUnitTest.php:1.3
---
pear/PHP_CodeSniffer/CodeSniffer/Standards/Squiz/Tests/Commenting/FunctionCommentUnitTest.php:1.2 Wed
Jan 10 03:14:44 2007
+++
pear/PHP_CodeSniffer/CodeSniffer/Standards/Squiz/Tests/Commenting/FunctionCommentUnitTest.php Fri
Jan 12 03:14:53 2007
@@ -10,7 +10,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: FunctionCommentUnitTest.php,v 1.2 2007/01/10 03:14:44 squiz Exp $
+ * @version CVS: $Id: FunctionCommentUnitTest.php,v 1.3 2007/01/12 03:14:53 squiz Exp $
* @link http://pear.php.net/package/PHP_CodeSniffer
*/
@@ -66,11 +66,11 @@
124 => 2,
125 => 4,
126 => 6,
- 127 => 3,
+ 127 => 1,
137 => 1,
139 => 1,
141 => 1,
- 143 => 2,
+ 144 => 2,
156 => 1,
159 => 1,
160 => 2,
@@ -85,6 +85,27 @@
201 => 1,
216 => 2,
217 => 2,
+ 228 => 1,
+ 229 => 1,
+ 230 => 1,
+ 231 => 1,
+ 232 => 1,
+ 233 => 1,
+ 237 => 1,
+ 239 => 1,
+ 254 => 1,
+ 256 => 4,
+ 269 => 1,
+ 271 => 1,
+ 272 => 1,
+ 285 => 1,
+ 286 => 1,
+ 287 => 1,
+ 288 => 1,
+ 289 => 1,
+ 290 => 1,
+ 294 => 1,
+ 296 => 2,
);
}//end getErrorList()