Total Complexity | 4 |
Total Lines | 29 |
Duplicated Lines | 0 % |
Coverage | 88.89% |
Changes | 0 |
1 | <?php |
||
11 | class Regex implements Activator |
||
12 | { |
||
13 | /** @var array|string */ |
||
14 | protected $patterns; |
||
15 | |||
16 | 2 | protected function __construct($patterns) |
|
17 | { |
||
18 | 2 | if ($patterns instanceof Collection) { |
|
19 | $patterns = $patterns->toArray(); |
||
20 | } |
||
21 | |||
22 | 2 | $this->patterns = $patterns; |
|
23 | 2 | } |
|
24 | |||
25 | 2 | public static function make($patterns) |
|
28 | } |
||
29 | |||
30 | /** |
||
31 | * Result of matching activator. |
||
32 | * |
||
33 | * @param MessageReceived $message |
||
34 | * |
||
35 | * @return bool |
||
36 | */ |
||
37 | 2 | public function matches(MessageReceived $message): bool |
|
42 |