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