1 | <?php |
||
16 | trait HasActivators |
||
17 | { |
||
18 | /** |
||
19 | * Intent activators. |
||
20 | * |
||
21 | * @return Activator[] |
||
22 | */ |
||
23 | abstract public function activators(): array; |
||
24 | |||
25 | /** |
||
26 | * Create "Exact" activator. |
||
27 | * |
||
28 | * @param string $value |
||
29 | * |
||
30 | * @param bool $caseSensitive |
||
31 | * |
||
32 | * @return Exact |
||
33 | */ |
||
34 | 1 | protected function exact(string $value, bool $caseSensitive = false): Exact |
|
38 | |||
39 | /** |
||
40 | * @param string|array $needles |
||
41 | * |
||
42 | * @return Contains |
||
43 | */ |
||
44 | 1 | protected function contains($needles): Contains |
|
48 | |||
49 | /** |
||
50 | * Create "Pattern" activator. |
||
51 | * |
||
52 | * @param string $value |
||
53 | * |
||
54 | * @return Pattern |
||
55 | */ |
||
56 | 1 | protected function pattern(string $value): Pattern |
|
60 | |||
61 | /** |
||
62 | * Create "InArray" activator. |
||
63 | * |
||
64 | * @param array|Collection $values |
||
65 | * @param bool $strict |
||
66 | * |
||
67 | * @return InArray |
||
68 | */ |
||
69 | 1 | protected function inArray($values, bool $strict = true): InArray |
|
73 | |||
74 | /** |
||
75 | * Create "WithAttachment" activator. |
||
76 | * |
||
77 | * @param string|null $type |
||
78 | * |
||
79 | * @return WithAttachment |
||
80 | */ |
||
81 | 1 | protected function withAttachment(string $type = null): WithAttachment |
|
85 | |||
86 | /** |
||
87 | * Create "WithPayload" activator. |
||
88 | * |
||
89 | * @param string $value |
||
90 | * |
||
91 | * @return WithPayload |
||
92 | */ |
||
93 | 1 | protected function withPayload(string $value): WithPayload |
|
97 | } |
||
98 |