1 | <?php |
||
19 | abstract class Property { |
||
20 | /** |
||
21 | * Name of the property. |
||
22 | * |
||
23 | * @return string |
||
24 | */ |
||
25 | abstract public function name(); |
||
26 | |||
27 | /** |
||
28 | * How to match property during parsing. |
||
29 | * |
||
30 | * Defaults to "with $name" |
||
31 | * |
||
32 | * @return string |
||
33 | */ |
||
34 | 25 | public function parse_as() { |
|
37 | |||
38 | /** |
||
39 | * Fetch arguments for the Property from a stream of tokens during parsing. |
||
40 | * |
||
41 | * @param ArgumentParser $parser |
||
42 | * @return array |
||
43 | */ |
||
44 | abstract public function fetch_arguments(ArgumentParser $parser); |
||
45 | |||
46 | /** |
||
47 | * Check if the given arguments are valid for the property. |
||
48 | * |
||
49 | * @param array $arguments |
||
50 | * @return bool |
||
51 | */ |
||
52 | abstract public function arguments_are_valid(array &$arguments); |
||
53 | |||
54 | /** |
||
55 | * Compile the property to an SQL expression. |
||
56 | * |
||
57 | * @param array $argument |
||
|
|||
58 | * @param ExpressionBuilder $builder |
||
59 | * @param string $table_name |
||
60 | * @param bool $negate |
||
61 | * @return string|CompositeExpression |
||
62 | */ |
||
63 | abstract public function compile(array &$arguments, ExpressionBuilder $builder, $table_name, $negate = false); |
||
64 | } |
||
65 |
This check looks for PHPDoc comments describing methods or function parameters that do not exist on the corresponding method or function. It has, however, found a similar but not annotated parameter which might be a good fit.
Consider the following example. The parameter
$ireland
is not defined by the methodfinale(...)
.The most likely cause is that the parameter was changed, but the annotation was not.