1 | <?php |
||
16 | class PredicateFactory { |
||
17 | /** |
||
18 | * A predicate that is always true. |
||
19 | * |
||
20 | * @return Predicate |
||
21 | */ |
||
22 | 19 | public function _true() { |
|
25 | |||
26 | /** |
||
27 | * A predicate that is always false. |
||
28 | * |
||
29 | * @return Predicate |
||
30 | */ |
||
31 | 12 | public function _false() { |
|
34 | |||
35 | /** |
||
36 | * Connect some predicates with AND. |
||
37 | * |
||
38 | * @param Predicate[] $predicates |
||
39 | * @return Predicate |
||
40 | */ |
||
41 | 32 | public function _and(array $predicates) { |
|
44 | |||
45 | /** |
||
46 | * Connect some predicates with OR. |
||
47 | * |
||
48 | * @param Predicate[] $predicates |
||
49 | * @return Predicate |
||
50 | */ |
||
51 | 39 | public function _or(array $predicates) { |
|
54 | |||
55 | /** |
||
56 | * A negated predicate. |
||
57 | * |
||
58 | * @param Predicate $predicate |
||
59 | * @return Predicate |
||
60 | */ |
||
61 | 10 | public function _not(Predicate $predicate) { |
|
64 | |||
65 | /** |
||
66 | * Is true when the node has the given type. |
||
67 | * |
||
68 | * @param string $type |
||
69 | * @return Predicate |
||
70 | */ |
||
71 | 41 | public function _type_is($type) { |
|
74 | |||
75 | /** |
||
76 | * A predicate about some property. |
||
77 | * |
||
78 | * @param string $name |
||
79 | * @return PropertyPredicate |
||
80 | */ |
||
81 | 30 | public function _property($name) { |
|
84 | |||
85 | /** |
||
86 | * A custom predicate. |
||
87 | * |
||
88 | * @param \Closure $predicate Entity -> bool |
||
|
|||
89 | * @return Predicate |
||
90 | */ |
||
91 | 39 | public function _custom(\Closure $closure) { |
|
94 | } |
||
95 |
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.