1 | <?php |
||
7 | class AutoConstructReader extends Reader |
||
8 | { |
||
9 | /** |
||
10 | * The name of the annotation class that define the construct arguments. |
||
11 | * |
||
12 | * @var string |
||
13 | */ |
||
14 | private static $constructAnnotationClass = "Accessible\\Annotation\\Construct"; |
||
15 | |||
16 | /** |
||
17 | * The name of the annotation class that define a property's default value. |
||
18 | * |
||
19 | * @var string |
||
20 | */ |
||
21 | private static $initializeAnnotationClass = "Accessible\\Annotation\\Initialize"; |
||
22 | |||
23 | /** |
||
24 | * The name of the annotation class that define the initial value of an object property. |
||
25 | * |
||
26 | * @var string |
||
27 | */ |
||
28 | private static $initializeObjectAnnotationClass = "Accessible\\Annotation\\InitializeObject"; |
||
29 | |||
30 | /** |
||
31 | * Get the list of needed arguments for given object's constructor. |
||
32 | * |
||
33 | * @param array $objectClasses The classes of the object to read. |
||
34 | * @param Reader $objectClasses The annotation reader to use. |
||
35 | * |
||
36 | * @return array The list of arguments. |
||
37 | */ |
||
38 | 6 | public static function getConstructArguments($objectClasses, $annotationReader) |
|
53 | |||
54 | /** |
||
55 | * Get the list of properties that have to be initialized automatically |
||
56 | * during the object construction, plus their value. |
||
57 | * |
||
58 | * @param array $properties The properties of the object to read. |
||
59 | * @param Reader $objectClasses The annotation reader to use. |
||
|
|||
60 | * |
||
61 | * @return array The list of properties and values, |
||
62 | * in the form ["property" => "value"]. |
||
63 | */ |
||
64 | 6 | public static function getPropertiesToInitialize($properties, $annotationReader) |
|
88 | } |
||
89 |
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.