| Total Complexity | 9 |
| Total Lines | 38 |
| Duplicated Lines | 0 % |
| Coverage | 100% |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 7 | class TopicRegistry implements TopicRegistryInterface |
||
| 8 | { |
||
| 9 | private array $patterns = []; |
||
| 10 | |||
| 11 | 3 | public function __construct(array $topics = []) |
|
| 12 | { |
||
| 13 | 3 | foreach ($topics as $topic => $callback) { |
|
| 14 | 2 | $this->register($topic, $callback); |
|
| 15 | } |
||
| 16 | } |
||
| 17 | |||
| 18 | 2 | public function register(string $topic, callable $callback): void |
|
| 21 | } |
||
| 22 | |||
| 23 | 2 | public function findCallback(string $topic, array &$matches): ?callable |
|
| 32 | } |
||
| 33 | |||
| 34 | 2 | private function compilePattern(string $topic): string |
|
| 47 |