1 | <?php |
||
16 | final class StorageMetadataFactory implements StorageMetadataFactoryInterface |
||
17 | { |
||
18 | /** |
||
19 | * @var EntityUtility |
||
20 | */ |
||
21 | private $entityUtil; |
||
22 | |||
23 | /** |
||
24 | * Constructor. |
||
25 | * |
||
26 | * @param EntityUtility $entityUtil |
||
27 | */ |
||
28 | public function __construct(EntityUtility $entityUtil) |
||
32 | |||
33 | /** |
||
34 | * {@inheritDoc} |
||
35 | */ |
||
36 | public function createInstance(array $mapping) |
||
53 | |||
54 | /** |
||
55 | * {@inheritDoc} |
||
56 | */ |
||
57 | public function handleLoad(EntityMetadata $metadata) |
||
63 | |||
64 | /** |
||
65 | * {@inheritDoc} |
||
66 | */ |
||
67 | public function handleValidate(EntityMetadata $metadata) |
||
74 | |||
75 | /** |
||
76 | * Recursively ksorts an array |
||
77 | * @param array |
||
78 | * @return array |
||
79 | */ |
||
80 | private function rksort(array $array) |
||
90 | |||
91 | /** |
||
92 | * Validates that the collection naming is correct, based on entity format config. |
||
93 | * |
||
94 | * @param EntityMetadata $metadata |
||
95 | * @throws MetadataException |
||
96 | */ |
||
97 | private function validateCollectionNaming(EntityMetadata $metadata) |
||
110 | |||
111 | /** |
||
112 | * Validates that the proper database properties are set. |
||
113 | * |
||
114 | * @param EntityMetadata $metadata |
||
115 | * @throws MetadataException |
||
116 | */ |
||
117 | private function validateDatabase(EntityMetadata $metadata) |
||
124 | |||
125 | /** |
||
126 | * Validates the proper id strategy. |
||
127 | * |
||
128 | * @param EntityMetadata $metadata |
||
129 | * @throws MetadataException |
||
130 | */ |
||
131 | private function validateIdStrategy(EntityMetadata $metadata) |
||
139 | |||
140 | /** |
||
141 | * Validates the schema definitions |
||
142 | * |
||
143 | * @param EntityMetadata $metadata |
||
144 | * @throws MetadataException |
||
145 | */ |
||
146 | private function validateSchemata(EntityMetadata $metadata) |
||
156 | } |
||
157 |
If you access a property on an interface, you most likely code against a concrete implementation of the interface.
Available Fixes
Adding an additional type check:
Changing the type hint: