| Conditions | 5 |
| Paths | 7 |
| Total Lines | 22 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 0 |
| CRAP Score | 30 |
| Changes | 0 | ||
| 1 | <?php |
||
| 13 | public function getContainerExtension() |
||
| 14 | { |
||
| 15 | if (null === $this->extension) { |
||
| 16 | $class = $this->getContainerExtensionClass(); |
||
| 17 | |||
| 18 | if (class_exists($class)) { |
||
| 19 | $extension = new $class(); |
||
| 20 | |||
| 21 | if (!$extension instanceof ExtensionInterface) { |
||
| 22 | throw new \LogicException(sprintf('Extension %s must implement Symfony\Component\DependencyInjection\Extension\ExtensionInterface.', $class)); |
||
| 23 | } |
||
| 24 | $this->extension = $extension; |
||
| 25 | } else { |
||
| 26 | $this->extension = false; |
||
| 27 | } |
||
| 28 | } |
||
| 29 | if ($this->extension) { |
||
| 30 | return $this->extension; |
||
| 31 | } |
||
| 32 | |||
| 33 | return null; |
||
| 34 | } |
||
| 35 | } |
||
| 36 |