Completed
Branch master (073708)
by Josh
02:11
created
src/Passes/GroupSingleCharacters.php 1 patch
Indentation   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -10,8 +10,8 @@  discard block
 block discarded – undo
10 10
 class GroupSingleCharacters extends AbstractPass
11 11
 {
12 12
 	/**
13
-	* {@inheritdoc}
14
-	*/
13
+	 * {@inheritdoc}
14
+	 */
15 15
 	protected function processStrings(array $strings)
16 16
 	{
17 17
 		$singles = $this->getSingleCharStrings($strings);
@@ -27,11 +27,11 @@  discard block
 block discarded – undo
27 27
 	}
28 28
 
29 29
 	/**
30
-	* Return an array of every single-char string in given list of strings
31
-	*
32
-	* @param  array[] $strings
33
-	* @return array[]
34
-	*/
30
+	 * Return an array of every single-char string in given list of strings
31
+	 *
32
+	 * @param  array[] $strings
33
+	 * @return array[]
34
+	 */
35 35
 	protected function getSingleCharStrings(array $strings)
36 36
 	{
37 37
 		$singles = [];
Please login to merge, or discard this patch.
src/Passes/PromoteSingleStrings.php 1 patch
Indentation   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -10,19 +10,19 @@
 block discarded – undo
10 10
 class PromoteSingleStrings extends AbstractPass
11 11
 {
12 12
 	/**
13
-	* {@inheritdoc}
14
-	*/
13
+	 * {@inheritdoc}
14
+	 */
15 15
 	protected function processStrings(array $strings)
16 16
 	{
17 17
 		return array_map([$this, 'promoteSingleStrings'], $strings);
18 18
 	}
19 19
 
20 20
 	/**
21
-	* Promote single strings found inside given string
22
-	*
23
-	* @param  array $string Original string
24
-	* @return array         Modified string
25
-	*/
21
+	 * Promote single strings found inside given string
22
+	 *
23
+	 * @param  array $string Original string
24
+	 * @return array         Modified string
25
+	 */
26 26
 	protected function promoteSingleStrings(array $string)
27 27
 	{
28 28
 		$newString = [];
Please login to merge, or discard this patch.
src/Passes/Recurse.php 1 patch
Indentation   +11 added lines, -11 removed lines patch added patch discarded remove patch
@@ -12,32 +12,32 @@
 block discarded – undo
12 12
 class Recurse extends AbstractPass
13 13
 {
14 14
 	/**
15
-	* @var Runner
16
-	*/
15
+	 * @var Runner
16
+	 */
17 17
 	protected $runner;
18 18
 
19 19
 	/**
20
-	* @param Runner $runner
21
-	*/
20
+	 * @param Runner $runner
21
+	 */
22 22
 	public function __construct(Runner $runner)
23 23
 	{
24 24
 		$this->runner = $runner;
25 25
 	}
26 26
 
27 27
 	/**
28
-	* {@inheritdoc}
29
-	*/
28
+	 * {@inheritdoc}
29
+	 */
30 30
 	protected function processStrings(array $strings)
31 31
 	{
32 32
 		return array_map([$this, 'recurseString'], $strings);
33 33
 	}
34 34
 
35 35
 	/**
36
-	* Recurse into given string and run all passes on each element
37
-	*
38
-	* @param  array $string
39
-	* @return array
40
-	*/
36
+	 * Recurse into given string and run all passes on each element
37
+	 *
38
+	 * @param  array $string
39
+	 * @return array
40
+	 */
41 41
 	protected function recurseString(array $string)
42 42
 	{
43 43
 		foreach ($string as $k => $element)
Please login to merge, or discard this patch.
src/Passes/MergePrefix.php 1 patch
Indentation   +25 added lines, -25 removed lines patch added patch discarded remove patch
@@ -10,8 +10,8 @@  discard block
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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];
Please login to merge, or discard this patch.
src/Passes/AbstractPass.php 1 patch
Indentation   +24 added lines, -24 removed lines patch added patch discarded remove patch
@@ -10,13 +10,13 @@  discard block
 block discarded – undo
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);
@@ -30,11 +30,11 @@  discard block
 block discarded – undo
30 30
 	}
31 31
 
32 32
 	/**
33
-	* Process the list of strings after the pass is run
34
-	*
35
-	* @param  array[] $strings
36
-	* @return array[]
37
-	*/
33
+	 * Process the list of strings after the pass is run
34
+	 *
35
+	 * @param  array[] $strings
36
+	 * @return array[]
37
+	 */
38 38
 	protected function afterRun(array $strings)
39 39
 	{
40 40
 		if ($this->isOptional && $strings[0] !== [])
@@ -46,11 +46,11 @@  discard block
 block discarded – undo
46 46
 	}
47 47
 
48 48
 	/**
49
-	* Prepare the list of strings before the pass is run
50
-	*
51
-	* @param  array[] $strings
52
-	* @return array[]
53
-	*/
49
+	 * Prepare the list of strings before the pass is run
50
+	 *
51
+	 * @param  array[] $strings
52
+	 * @return array[]
53
+	 */
54 54
 	protected function beforeRun(array $strings)
55 55
 	{
56 56
 		$this->isOptional = (isset($strings[0]) && $strings[0] === []);
@@ -63,21 +63,21 @@  discard block
 block discarded – undo
63 63
 	}
64 64
 
65 65
 	/**
66
-	* Test whether this pass can be run on a given list of strings
67
-	*
68
-	* @param  array[] $strings
69
-	* @return bool
70
-	*/
66
+	 * Test whether this pass can be run on a given list of strings
67
+	 *
68
+	 * @param  array[] $strings
69
+	 * @return bool
70
+	 */
71 71
 	protected function canRun(array $strings)
72 72
 	{
73 73
 		return true;
74 74
 	}
75 75
 
76 76
 	/**
77
-	* Run this pass on a list of strings
78
-	*
79
-	* @param  array[] $strings
80
-	* @return array[]
81
-	*/
77
+	 * Run this pass on a list of strings
78
+	 *
79
+	 * @param  array[] $strings
80
+	 * @return array[]
81
+	 */
82 82
 	abstract protected function runPass(array $strings);
83 83
 }
84 84
\ No newline at end of file
Please login to merge, or discard this patch.
src/Passes/CoalesceSingleCharacterPrefix.php 1 patch
Indentation   +12 added lines, -12 removed lines patch added patch discarded remove patch
@@ -13,8 +13,8 @@  discard block
 block discarded – undo
13 13
 class CoalesceSingleCharacterPrefix extends AbstractPass
14 14
 {
15 15
 	/**
16
-	* {@inheritdoc}
17
-	*/
16
+	 * {@inheritdoc}
17
+	 */
18 18
 	protected function runPass(array $strings)
19 19
 	{
20 20
 		$newStrings = [];
@@ -36,11 +36,11 @@  discard block
 block discarded – undo
36 36
 	}
37 37
 
38 38
 	/**
39
-	* Filter the list of eligible keys and keep those that have at least two matches
40
-	*
41
-	* @param  array[] $eligibleKeys List of lists of keys
42
-	* @return array[]
43
-	*/
39
+	 * Filter the list of eligible keys and keep those that have at least two matches
40
+	 *
41
+	 * @param  array[] $eligibleKeys List of lists of keys
42
+	 * @return array[]
43
+	 */
44 44
 	protected function filterEligibleKeys(array $eligibleKeys)
45 45
 	{
46 46
 		$filteredKeys = [];
@@ -56,11 +56,11 @@  discard block
 block discarded – undo
56 56
 	}
57 57
 
58 58
 	/**
59
-	* Get a list of keys of strings eligible to be merged together, grouped by suffix
60
-	*
61
-	* @param  array[] $strings
62
-	* @return array[]
63
-	*/
59
+	 * Get a list of keys of strings eligible to be merged together, grouped by suffix
60
+	 *
61
+	 * @param  array[] $strings
62
+	 * @return array[]
63
+	 */
64 64
 	protected function getEligibleKeys(array $strings)
65 65
 	{
66 66
 		$eligibleKeys = [];
Please login to merge, or discard this patch.
src/Passes/MergeSuffix.php 1 patch
Indentation   +14 added lines, -14 removed lines patch added patch discarded remove patch
@@ -13,16 +13,16 @@  discard block
 block discarded – undo
13 13
 class MergeSuffix extends AbstractPass
14 14
 {
15 15
 	/**
16
-	* {@inheritdoc}
17
-	*/
16
+	 * {@inheritdoc}
17
+	 */
18 18
 	protected function canRun(array $strings)
19 19
 	{
20 20
 		return (count($strings) > 1 && $this->hasMatchingSuffix($strings));
21 21
 	}
22 22
 
23 23
 	/**
24
-	* {@inheritdoc}
25
-	*/
24
+	 * {@inheritdoc}
25
+	 */
26 26
 	protected function runPass(array $strings)
27 27
 	{
28 28
 		$newString = [];
@@ -37,11 +37,11 @@  discard block
 block discarded – undo
37 37
 	}
38 38
 
39 39
 	/**
40
-	* Test whether all given strings have the same last element
41
-	*
42
-	* @param  array[] $strings
43
-	* @return bool
44
-	*/
40
+	 * Test whether all given strings have the same last element
41
+	 *
42
+	 * @param  array[] $strings
43
+	 * @return bool
44
+	 */
45 45
 	protected function hasMatchingSuffix(array $strings)
46 46
 	{
47 47
 		$suffix = end($strings[1]);
@@ -57,11 +57,11 @@  discard block
 block discarded – undo
57 57
 	}
58 58
 
59 59
 	/**
60
-	* Remove the last element of every string
61
-	*
62
-	* @param  array[] $strings Original strings
63
-	* @return array[]          Processed strings
64
-	*/
60
+	 * Remove the last element of every string
61
+	 *
62
+	 * @param  array[] $strings Original strings
63
+	 * @return array[]          Processed strings
64
+	 */
65 65
 	protected function pop(array $strings)
66 66
 	{
67 67
 		$cnt = count($strings);
Please login to merge, or discard this patch.