1 | <?php |
||
17 | class DisconnectedMetadataFactory |
||
18 | { |
||
19 | /** @var ManagerRegistry */ |
||
20 | private $registry; |
||
21 | |||
22 | /** |
||
23 | * @param ManagerRegistry $registry A ManagerRegistry instance |
||
24 | */ |
||
25 | public function __construct(ManagerRegistry $registry) |
||
29 | |||
30 | /** |
||
31 | * Gets the metadata of all classes of a bundle. |
||
32 | * |
||
33 | * @param BundleInterface $bundle A BundleInterface instance |
||
34 | * |
||
35 | * @return ClassMetadataCollection A ClassMetadataCollection instance |
||
36 | * |
||
37 | * @throws RuntimeException When bundle does not contain mapped entities. |
||
38 | */ |
||
39 | public function getBundleMetadata(BundleInterface $bundle) |
||
54 | |||
55 | /** |
||
56 | * Gets the metadata of a class. |
||
57 | * |
||
58 | * @param string $class A class name |
||
59 | * @param string $path The path where the class is stored (if known) |
||
|
|||
60 | * |
||
61 | * @return ClassMetadataCollection A ClassMetadataCollection instance |
||
62 | * |
||
63 | * @throws MappingException When class is not valid entity or mapped superclass. |
||
64 | */ |
||
65 | public function getClassMetadata($class, $path = null) |
||
76 | |||
77 | /** |
||
78 | * Gets the metadata of all classes of a namespace. |
||
79 | * |
||
80 | * @param string $namespace A namespace name |
||
81 | * @param string $path The path where the class is stored (if known) |
||
82 | * |
||
83 | * @return ClassMetadataCollection A ClassMetadataCollection instance |
||
84 | * |
||
85 | * @throws RuntimeException When namespace not contain mapped entities. |
||
86 | */ |
||
87 | public function getNamespaceMetadata($namespace, $path = null) |
||
98 | |||
99 | /** |
||
100 | * Find and configure path and namespace for the metadata collection. |
||
101 | * |
||
102 | * @param string|null $path |
||
103 | * |
||
104 | * @throws RuntimeException When unable to determine the path. |
||
105 | */ |
||
106 | public function findNamespaceAndPathForMetadata(ClassMetadataCollection $metadata, $path = null) |
||
125 | |||
126 | /** |
||
127 | * Get a base path for a class |
||
128 | * |
||
129 | * @throws RuntimeException When base path not found. |
||
130 | */ |
||
131 | private function getBasePathForClass(string $name, string $namespace, string $path) : string |
||
143 | |||
144 | private function getMetadataForNamespace(string $namespace) : ClassMetadataCollection |
||
157 | |||
158 | private function getMetadataForClass(string $entity) : ClassMetadataCollection |
||
171 | |||
172 | /** |
||
173 | * @return ClassMetadata[] |
||
174 | */ |
||
175 | private function getAllMetadata() : array |
||
188 | } |
||
189 |
This check looks for
@param
annotations where the type inferred by our type inference engine differs from the declared type.It makes a suggestion as to what type it considers more descriptive.
Most often this is a case of a parameter that can be null in addition to its declared types.