1 | <?php |
||
20 | class Builder |
||
21 | { |
||
22 | /** |
||
23 | * @var InputInterface |
||
24 | */ |
||
25 | protected $input; |
||
26 | |||
27 | /** |
||
28 | * @var MetaCharacters |
||
29 | */ |
||
30 | protected $meta; |
||
31 | |||
32 | /** |
||
33 | * @var Runner |
||
34 | */ |
||
35 | protected $runner; |
||
36 | |||
37 | /** |
||
38 | * @var Serializer |
||
39 | */ |
||
40 | protected $serializer; |
||
41 | |||
42 | /** |
||
43 | * @param array $config |
||
44 | */ |
||
45 | 13 | public function __construct(array $config = []) |
|
61 | |||
62 | /** |
||
63 | * Build and return a regular expression that matches all of the given strings |
||
64 | * |
||
65 | * @param string[] $strings Literal strings to be matched |
||
66 | * @return string Regular expression (without delimiters) |
||
67 | */ |
||
68 | 13 | public function build(array $strings) |
|
83 | |||
84 | /** |
||
85 | * Compare two split strings |
||
86 | * |
||
87 | * Will sort strings in ascending order |
||
88 | * |
||
89 | * @param integer[] $a |
||
90 | * @param integer[] $b |
||
91 | * @return integer |
||
92 | */ |
||
93 | 11 | protected function compareStrings(array $a, array $b) |
|
107 | |||
108 | /** |
||
109 | * Test whether the list of strings is empty |
||
110 | * |
||
111 | * @param string[] $strings |
||
112 | * @return bool |
||
113 | */ |
||
114 | 13 | protected function isEmpty(array $strings) |
|
118 | |||
119 | /** |
||
120 | * Set the InputInterface instance in $this->input |
||
121 | * |
||
122 | * @param string $inputType |
||
123 | * @param array $inputOptions |
||
124 | * @return void |
||
125 | */ |
||
126 | 13 | protected function setInput($inputType, array $inputOptions) |
|
131 | |||
132 | /** |
||
133 | * Set the MetaCharacters instance in $this->meta |
||
134 | * |
||
135 | * @param array $map |
||
136 | * @return void |
||
137 | */ |
||
138 | 13 | protected function setMeta(array $map) |
|
146 | |||
147 | /** |
||
148 | * Set the Runner instance $in this->runner |
||
149 | * |
||
150 | * @return void |
||
151 | */ |
||
152 | 13 | protected function setRunner() |
|
163 | |||
164 | /** |
||
165 | * Set the Serializer instance in $this->serializer |
||
166 | * |
||
167 | * @param string $outputType |
||
168 | * @param array $outputOptions |
||
169 | * @param string $delimiter |
||
170 | * @return void |
||
171 | */ |
||
172 | 13 | protected function setSerializer($outputType, array $outputOptions, $delimiter) |
|
180 | |||
181 | /** |
||
182 | * Split all given strings by character |
||
183 | * |
||
184 | * @param string[] $strings List of strings |
||
185 | * @return array[] List of arrays |
||
186 | */ |
||
187 | 12 | protected function splitStrings(array $strings) |
|
191 | } |