| Total Complexity | 4 |
| Total Lines | 23 |
| Duplicated Lines | 0 % |
| Coverage | 0% |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 10 | final class LogBroadcast extends AbstractBroadcast |
||
| 11 | { |
||
| 12 | private LoggerInterface $logger; |
||
| 13 | |||
| 14 | public function __construct(LoggerInterface $logger) |
||
| 17 | } |
||
| 18 | |||
| 19 | public function publish($topics, $messages): void |
||
| 20 | { |
||
| 21 | $topics = implode(', ', $this->formatTopics($topics)); |
||
| 22 | |||
| 23 | /** @var string $message */ |
||
| 24 | foreach ($this->toArray($messages) as $message) { |
||
| 25 | assert(\is_string($message), 'Message argument must be a type of string'); |
||
| 26 | $this->logger->info('Broadcasting on channels [' . $topics . '] with payload:' . PHP_EOL . $message); |
||
| 27 | } |
||
| 28 | } |
||
| 29 | |||
| 30 | public function authorize(ServerRequestInterface $request): bool |
||
| 33 | } |
||
| 34 | } |
||
| 35 |