Total Complexity | 4 |
Total Lines | 24 |
Duplicated Lines | 0 % |
Changes | 1 | ||
Bugs | 1 | Features | 0 |
1 | <?php |
||
10 | class DependencyInjectionExtension |
||
11 | { |
||
12 | /** |
||
13 | * @var ContainerInterface |
||
14 | */ |
||
15 | private $typeContainer; |
||
16 | |||
17 | public function __construct($typeContainer) |
||
20 | } |
||
21 | |||
22 | public function getType($name) |
||
23 | { |
||
24 | if (!$this->typeContainer->has($name)) { |
||
25 | throw new InvalidArgumentException(sprintf('The field type "%s" is not registered in the service container.', $name)); |
||
26 | } |
||
27 | |||
28 | return $this->typeContainer->get($name); |
||
29 | } |
||
30 | |||
31 | public function hasType($name) |
||
34 | } |
||
35 | } |