1 | <?php |
||
19 | class Builder |
||
20 | { |
||
21 | /** |
||
22 | * @var InputInterface |
||
23 | */ |
||
24 | protected $input; |
||
25 | |||
26 | /** |
||
27 | * @var Runner |
||
28 | */ |
||
29 | protected $runner; |
||
30 | |||
31 | /** |
||
32 | * @var Serializer |
||
33 | */ |
||
34 | protected $serializer; |
||
35 | |||
36 | /** |
||
37 | * @param array $config |
||
38 | */ |
||
39 | 9 | public function __construct(array $config = []) |
|
51 | |||
52 | /** |
||
53 | * Build and return a regular expression that matches all of the given strings |
||
54 | * |
||
55 | * @param string[] $strings Literal strings to be matched |
||
56 | * @return string Regular expression (without delimiters) |
||
57 | */ |
||
58 | 9 | public function build(array $strings) |
|
72 | |||
73 | /** |
||
74 | * Compare two split strings |
||
75 | * |
||
76 | * Will sort strings in ascending order |
||
77 | * |
||
78 | * @param integer[] $a |
||
79 | * @param integer[] $b |
||
80 | * @return integer |
||
81 | */ |
||
82 | 8 | protected function compareStrings(array $a, array $b) |
|
96 | |||
97 | /** |
||
98 | * Test whether the list of strings is empty |
||
99 | * |
||
100 | * @param string[] $strings |
||
101 | * @return bool |
||
102 | */ |
||
103 | 9 | protected function isEmpty(array $strings) |
|
107 | |||
108 | /** |
||
109 | * Set the InputInterface instance in $this->input |
||
110 | * |
||
111 | * @param string $inputType |
||
112 | * @return void |
||
113 | */ |
||
114 | 9 | protected function setInput($inputType) |
|
119 | |||
120 | /** |
||
121 | * Set the Runner instance $in this->runner |
||
122 | * |
||
123 | * @return void |
||
124 | */ |
||
125 | 9 | protected function setRunner() |
|
135 | |||
136 | /** |
||
137 | * Set the Serializer instance in $this->serializer |
||
138 | * |
||
139 | * @param string $outputType |
||
140 | * @param string $delimiter |
||
141 | * @return void |
||
142 | */ |
||
143 | 9 | protected function setSerializer($outputType, $delimiter) |
|
151 | |||
152 | /** |
||
153 | * Split all given strings by character |
||
154 | * |
||
155 | * @param string[] $strings List of strings |
||
156 | * @return array[] List of arrays |
||
157 | */ |
||
158 | 8 | protected function splitStrings(array $strings) |
|
162 | } |