Conditions | 2 |
Paths | 2 |
Total Lines | 11 |
Code Lines | 4 |
Lines | 0 |
Ratio | 0 % |
Tests | 5 |
CRAP Score | 2 |
Changes | 0 |
1 | <?php |
||
17 | 1 | public function findMetadata(string $class): ?ClassMetadata |
|
18 | 1 | { |
|
19 | try { |
||
20 | 1 | // We could not use the hasMetadataFor() method as it is not working if the entity is not loaded. But |
|
21 | // the getMetadataFor() method could throw an exception if the class is not found |
||
22 | 1 | return $this->entityManager->getMetadataFactory()->getMetadataFor($class); |
|
23 | } catch (Exception) { |
||
24 | // If an exception is raised, nothing to do. Extra data from metadata will be not used. |
||
25 | } |
||
26 | |||
27 | 1 | return null; |
|
28 | 1 | } |
|
30 |