We could not synchronize checks via GitHub's checks API since Scrutinizer's GitHub App is not installed for this repository.
| Total Complexity | 6 |
| Total Lines | 30 |
| Duplicated Lines | 0 % |
| Coverage | 100% |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 11 | class MetadataFactory implements MetadataFactoryInterface |
||
| 12 | { |
||
| 13 | private $metadataPool; |
||
| 14 | |||
| 15 | 12 | public function __construct() |
|
| 16 | { |
||
| 17 | 12 | $this->metadataPool = []; |
|
| 18 | 12 | } |
|
| 19 | |||
| 20 | 12 | public function getMetadataFor($object): ObjectMetadata |
|
| 21 | { |
||
| 22 | 12 | if ($object instanceof ValidationNode) { |
|
| 23 | 11 | return $this->metadataPool[$object->getName()]; |
|
| 24 | } |
||
| 25 | |||
| 26 | 1 | throw new NoSuchMetadataException(); |
|
| 27 | } |
||
| 28 | |||
| 29 | 2 | public function hasMetadataFor($object): bool |
|
| 36 | } |
||
| 37 | |||
| 38 | 11 | public function addMetadata(ObjectMetadata $metadata): void |
|
| 41 | 11 | } |
|
| 42 | } |
||
| 43 |