1 | <?php |
||
16 | final class MetadataPropertyCollection |
||
17 | { |
||
18 | /** |
||
19 | * An array of property metadata objects |
||
20 | * |
||
21 | * @var PropertyMetadata[] |
||
22 | */ |
||
23 | private $properties = []; |
||
24 | |||
25 | /** |
||
26 | * Add a property metadata object |
||
27 | * |
||
28 | * @param PropertyMetadata $property |
||
29 | */ |
||
30 | 2 | public function add(PropertyMetadata $property): void |
|
34 | |||
35 | /** |
||
36 | * Get property metadata by its name, returns null if the property |
||
37 | * doesn't exist. |
||
38 | * |
||
39 | * @param string $name |
||
40 | * @return PropertyMetadata |
||
|
|||
41 | */ |
||
42 | 3 | public function get(string $name): ?PropertyMetadata |
|
50 | } |
||
51 |
This check compares the return type specified in the
@return
annotation of a function or method doc comment with the types returned by the function and raises an issue if they mismatch.