| Total Complexity | 7 |
| Total Lines | 50 |
| Duplicated Lines | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 22 | trait LoggerTrait |
||
| 23 | { |
||
| 24 | /** @var LoggerInterface|null @internal */ |
||
| 25 | private $logger = null; |
||
| 26 | |||
| 27 | /** |
||
| 28 | * Sets a logger. |
||
| 29 | * |
||
| 30 | * @param LoggerInterface $logger |
||
| 31 | */ |
||
| 32 | public function setLogger(LoggerInterface $logger): void |
||
| 35 | } |
||
| 36 | |||
| 37 | /** |
||
| 38 | * Get associated or create new instance of LoggerInterface. |
||
| 39 | * |
||
| 40 | * @param string $channel |
||
| 41 | * @return LoggerInterface |
||
| 42 | */ |
||
| 43 | protected function getLogger(string $channel = null): LoggerInterface |
||
| 55 | } |
||
| 56 | |||
| 57 | /** |
||
| 58 | * Create new instance of associated logger (on demand creation). |
||
| 59 | * |
||
| 60 | * @param string $channel |
||
| 61 | * @return LoggerInterface |
||
| 62 | */ |
||
| 63 | private function allocateLogger(string $channel): LoggerInterface |
||
| 74 |