| Total Complexity | 3 |
| Total Lines | 28 |
| Duplicated Lines | 0 % |
| Coverage | 100% |
| Changes | 0 | ||
| 1 | <?php |
||
| 7 | class Registry |
||
| 8 | { |
||
| 9 | /** |
||
| 10 | * @var TypeAccessorInterface[] |
||
| 11 | */ |
||
| 12 | private $accessors = []; |
||
| 13 | |||
| 14 | /** |
||
| 15 | * @param string $type |
||
| 16 | * @return TypeAccessorInterface|null |
||
| 17 | */ |
||
| 18 | 17 | public function getAccessor($type) |
|
| 19 | { |
||
| 20 | 17 | if (isset($this->accessors[$type])) { |
|
| 21 | 14 | return $this->accessors[$type]; |
|
| 22 | } |
||
| 23 | 3 | return null; |
|
| 24 | } |
||
| 25 | |||
| 26 | /** |
||
| 27 | * @param string $type |
||
| 28 | * @param TypeAccessorInterface $accessor |
||
| 29 | * @return $this |
||
| 30 | */ |
||
| 31 | 21 | public function registerAccessor($type, TypeAccessorInterface $accessor) |
|
| 35 | } |
||
| 36 | } |
||
| 37 |