Conditions | 4 |
Paths | 6 |
Total Lines | 13 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | <?php |
||
43 | public function find(string $resource, Identifier $identifier): ?ResourceDescriptor |
||
44 | { |
||
45 | $resourceDescriptor = \array_key_exists($identifier->getId(), $this->resources) ? $this->resources[$identifier->getId()] : null; |
||
46 | if (null === $resourceDescriptor) { |
||
47 | return null; |
||
48 | } |
||
49 | |||
50 | if (!\in_array($resource, $resourceDescriptor->getAliases(), true)) { |
||
51 | return null; |
||
52 | } |
||
53 | |||
54 | return $resourceDescriptor; |
||
55 | } |
||
56 | } |
||
57 |