@@ -10,8 +10,8 @@ discard block |
||
10 | 10 | class MergePrefix extends AbstractPass |
11 | 11 | { |
12 | 12 | /** |
13 | - * {@inheritdoc} |
|
14 | - */ |
|
13 | + * {@inheritdoc} |
|
14 | + */ |
|
15 | 15 | protected function processStrings(array $strings) |
16 | 16 | { |
17 | 17 | $newStrings = []; |
@@ -24,11 +24,11 @@ discard block |
||
24 | 24 | } |
25 | 25 | |
26 | 26 | /** |
27 | - * Get the number of leading elements common to all given strings |
|
28 | - * |
|
29 | - * @param array[] $strings |
|
30 | - * @return integer |
|
31 | - */ |
|
27 | + * Get the number of leading elements common to all given strings |
|
28 | + * |
|
29 | + * @param array[] $strings |
|
30 | + * @return integer |
|
31 | + */ |
|
32 | 32 | protected function getPrefixLength(array $strings) |
33 | 33 | { |
34 | 34 | $len = 1; |
@@ -42,13 +42,13 @@ discard block |
||
42 | 42 | } |
43 | 43 | |
44 | 44 | /** |
45 | - * Return given strings grouped by their first element |
|
46 | - * |
|
47 | - * NOTE: assumes that this pass is run before the first element of any string could be replaced |
|
48 | - * |
|
49 | - * @param array[] $strings |
|
50 | - * @return array[] |
|
51 | - */ |
|
45 | + * Return given strings grouped by their first element |
|
46 | + * |
|
47 | + * NOTE: assumes that this pass is run before the first element of any string could be replaced |
|
48 | + * |
|
49 | + * @param array[] $strings |
|
50 | + * @return array[] |
|
51 | + */ |
|
52 | 52 | protected function getStringsByPrefix(array $strings) |
53 | 53 | { |
54 | 54 | $byPrefix = []; |
@@ -61,11 +61,11 @@ discard block |
||
61 | 61 | } |
62 | 62 | |
63 | 63 | /** |
64 | - * Merge given strings into a new single string |
|
65 | - * |
|
66 | - * @param array[] $strings |
|
67 | - * @return array |
|
68 | - */ |
|
64 | + * Merge given strings into a new single string |
|
65 | + * |
|
66 | + * @param array[] $strings |
|
67 | + * @return array |
|
68 | + */ |
|
69 | 69 | protected function mergeStrings(array $strings) |
70 | 70 | { |
71 | 71 | $len = $this->getPrefixLength($strings); |
@@ -79,12 +79,12 @@ discard block |
||
79 | 79 | } |
80 | 80 | |
81 | 81 | /** |
82 | - * Test whether all given strings' elements match at given position |
|
83 | - * |
|
84 | - * @param array[] $strings |
|
85 | - * @param integer $pos |
|
86 | - * @return bool |
|
87 | - */ |
|
82 | + * Test whether all given strings' elements match at given position |
|
83 | + * |
|
84 | + * @param array[] $strings |
|
85 | + * @param integer $pos |
|
86 | + * @return bool |
|
87 | + */ |
|
88 | 88 | protected function stringsMatch(array $strings, $pos) |
89 | 89 | { |
90 | 90 | $value = $strings[0][$pos]; |
@@ -10,13 +10,13 @@ discard block |
||
10 | 10 | abstract class AbstractPass implements PassInterface |
11 | 11 | { |
12 | 12 | /** |
13 | - * @var bool Whether the current set of strings is optional |
|
14 | - */ |
|
13 | + * @var bool Whether the current set of strings is optional |
|
14 | + */ |
|
15 | 15 | protected $isOptional; |
16 | 16 | |
17 | 17 | /** |
18 | - * {@inheritdoc} |
|
19 | - */ |
|
18 | + * {@inheritdoc} |
|
19 | + */ |
|
20 | 20 | public function run(array $strings) |
21 | 21 | { |
22 | 22 | $strings = $this->beforeRun($strings); |
@@ -27,11 +27,11 @@ discard block |
||
27 | 27 | } |
28 | 28 | |
29 | 29 | /** |
30 | - * Process the list of strings after the pass is run |
|
31 | - * |
|
32 | - * @param array[] $strings |
|
33 | - * @return array[] |
|
34 | - */ |
|
30 | + * Process the list of strings after the pass is run |
|
31 | + * |
|
32 | + * @param array[] $strings |
|
33 | + * @return array[] |
|
34 | + */ |
|
35 | 35 | protected function afterRun(array $strings) |
36 | 36 | { |
37 | 37 | if ($this->isOptional && $strings[0] !== []) |
@@ -43,11 +43,11 @@ discard block |
||
43 | 43 | } |
44 | 44 | |
45 | 45 | /** |
46 | - * Prepare the list of strings before the pass is run |
|
47 | - * |
|
48 | - * @param array[] $strings |
|
49 | - * @return array[] |
|
50 | - */ |
|
46 | + * Prepare the list of strings before the pass is run |
|
47 | + * |
|
48 | + * @param array[] $strings |
|
49 | + * @return array[] |
|
50 | + */ |
|
51 | 51 | protected function beforeRun(array $strings) |
52 | 52 | { |
53 | 53 | $this->isOptional = (isset($strings[0]) && $strings[0] === []); |
@@ -60,10 +60,10 @@ discard block |
||
60 | 60 | } |
61 | 61 | |
62 | 62 | /** |
63 | - * Process a given list of strings |
|
64 | - * |
|
65 | - * @param array[] $strings |
|
66 | - * @return array[] |
|
67 | - */ |
|
63 | + * Process a given list of strings |
|
64 | + * |
|
65 | + * @param array[] $strings |
|
66 | + * @return array[] |
|
67 | + */ |
|
68 | 68 | abstract protected function processStrings(array $strings); |
69 | 69 | } |
70 | 70 | \ No newline at end of file |