| Total Complexity | 4 |
| Total Lines | 29 |
| Duplicated Lines | 0 % |
| Coverage | 100% |
| Changes | 2 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 10 | trait ContainerAwareTrait |
||
| 11 | { |
||
| 12 | /** |
||
| 13 | * @var ?DefinitionContainerInterface |
||
| 14 | */ |
||
| 15 | protected $container; |
||
| 16 | |||
| 17 | 138 | public function setContainer(DefinitionContainerInterface $container): ContainerAwareInterface |
|
| 18 | { |
||
| 19 | 138 | $this->container = $container; |
|
| 20 | |||
| 21 | 138 | if ($this instanceof ContainerAwareInterface) { |
|
| 22 | 138 | return $this; |
|
| 23 | } |
||
| 24 | |||
| 25 | 3 | throw new BadMethodCallException(sprintf( |
|
| 26 | 3 | 'Attempt to use (%s) while not implementing (%s)', |
|
| 27 | 3 | ContainerAwareTrait::class, |
|
| 28 | 3 | ContainerAwareInterface::class |
|
| 29 | 3 | )); |
|
| 30 | } |
||
| 31 | |||
| 32 | 153 | public function getContainer(): DefinitionContainerInterface |
|
| 39 | } |
||
| 40 | } |
||
| 41 |