| Conditions | 3 |
| Paths | 4 |
| Total Lines | 12 |
| Code Lines | 5 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 29 | public function createInjection( |
||
| 30 | \ReflectionClass $class, |
||
| 31 | \ReflectionParameter|null|string $context = null, |
||
| 32 | ): LoggerInterface { |
||
| 33 | $channel = \is_object($context) ? $this->extractChannelAttribute($context) : null; |
||
| 34 | |||
| 35 | // Check that null argument is available |
||
| 36 | $channel ??= (new \ReflectionMethod($this->factory, 'getLogger'))->getParameters()[0]->allowsNull() |
||
| 37 | ? null |
||
| 38 | : self::DEFAULT_CHANNEL; |
||
| 39 | |||
| 40 | return $this->factory->getLogger($channel); |
||
|
|
|||
| 41 | } |
||
| 54 |