1 | <?php |
||
54 | class IsArray implements Check, ListCheck |
||
55 | { |
||
56 | // saves us having to implement inspectList() ourselves |
||
57 | use ListableCheck; |
||
58 | |||
59 | /** |
||
60 | * do we have something that is an array? |
||
61 | * |
||
62 | * by array, we mean something that you can pass to any of PHP's |
||
63 | * array_xxx() functions |
||
64 | * |
||
65 | * @param mixed $item |
||
|
|||
66 | * the item to be checked |
||
67 | * @return boolean |
||
68 | * TRUE if the item is an array |
||
69 | * FALSE otherwise |
||
70 | */ |
||
71 | public static function check($fieldOrVar) |
||
81 | |||
82 | /** |
||
83 | * do we have something that is an array? |
||
84 | * |
||
85 | * by array, we mean something that you can pass to any of PHP's |
||
86 | * array_xxx() functions |
||
87 | * |
||
88 | * @param mixed $fieldOrVar |
||
89 | * the item to be checked |
||
90 | * @return boolean |
||
91 | * TRUE if the item is an array |
||
92 | * FALSE otherwise |
||
93 | */ |
||
94 | public function inspect($fieldOrVar) |
||
98 | |||
99 | /** |
||
100 | * is every entry in $list an array? |
||
101 | * |
||
102 | * by array, we mean something that you can pass to any of PHP's |
||
103 | * array_xxx() functions |
||
104 | * |
||
105 | * @param mixed $list |
||
106 | * the list of items to be checked |
||
107 | * @return boolean |
||
108 | * TRUE if every item in $list is an array |
||
109 | * FALSE otherwise |
||
110 | */ |
||
111 | public static function checkList($list) |
||
116 | } |
||
117 |
This check looks for PHPDoc comments describing methods or function parameters that do not exist on the corresponding method or function.
Consider the following example. The parameter
$italy
is not defined by the methodfinale(...)
.The most likely cause is that the parameter was removed, but the annotation was not.