| Conditions | 4 |
| Paths | 4 |
| Total Lines | 30 |
| Code Lines | 11 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 11 |
| CRAP Score | 4 |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 30 | 1 | public function loadRDMMetadataForClass(string $className): ?EntityMappingInterface |
|
| 31 | { |
||
| 32 | /** @var ?EntityMappingInterface $mapping */ |
||
| 33 | 1 | $mapping = null; |
|
| 34 | |||
| 35 | 1 | if ($this->fileLocator->fileExists($className)) { |
|
| 36 | /** @var string $mappingFile */ |
||
| 37 | 1 | $mappingFile = $this->fileLocator->findMappingFile($className); |
|
| 38 | |||
| 39 | 1 | if (file_exists($mappingFile)) { |
|
| 40 | /** @var mixed $mappingCandidate */ |
||
| 41 | 1 | $mappingCandidate = null; |
|
| 42 | |||
| 43 | ( |
||
| 44 | /** |
||
| 45 | * @param mixed $rdmMapping |
||
| 46 | */ |
||
| 47 | 1 | function (&$rdmMapping) use ($mappingFile): void { |
|
| 48 | /** @psalm-suppress UnresolvableInclude */ |
||
| 49 | 1 | include $mappingFile; |
|
| 50 | } |
||
| 51 | )($mappingCandidate); |
||
| 52 | |||
| 53 | 1 | if ($mappingCandidate instanceof EntityMappingInterface) { |
|
| 54 | 1 | $mapping = $mappingCandidate; |
|
| 55 | } |
||
| 56 | } |
||
| 57 | } |
||
| 58 | |||
| 59 | 1 | return $mapping; |
|
| 60 | } |
||
| 63 |