Passed
Push — master ( dfdef9...3fdc52 )
by Peter
05:08
created
debug-test.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -3,7 +3,7 @@
 block discarded – undo
3 3
  * Codeception CLI
4 4
  */
5 5
 
6
-require_once dirname(__FILE__).'/vendor/autoload.php';
6
+require_once dirname(__FILE__) . '/vendor/autoload.php';
7 7
 
8 8
 use Symfony\Component\Console\Application;
9 9
 
Please login to merge, or discard this patch.
src/Whitelist.php 2 patches
Spacing   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -98,9 +98,9 @@  discard block
 block discarded – undo
98 98
 
99 99
 		// Instantiate checkers if not already provided as instances
100 100
 		$checkers = [];
101
-		foreach($this->checkers as $checker)
101
+		foreach ($this->checkers as $checker)
102 102
 		{
103
-			if(!$checker instanceof CheckerInterface)
103
+			if (!$checker instanceof CheckerInterface)
104 104
 			{
105 105
 				assert(is_string($checker) || is_array($checker));
106 106
 				$checkers[] = EmbeDi::fly()->apply($checker);
@@ -109,11 +109,11 @@  discard block
 block discarded – undo
109 109
 		$this->checkers = $checkers;
110 110
 
111 111
 		// Ensure that all aspects have sane values
112
-		foreach(['whitelist', 'require'] as $name)
112
+		foreach (['whitelist', 'require'] as $name)
113 113
 		{
114
-			foreach($this->aspects as $aspect)
114
+			foreach ($this->aspects as $aspect)
115 115
 			{
116
-				if(empty($this->$name[$aspect]) || !is_array($this->$name[$aspect]))
116
+				if (empty($this->$name[$aspect]) || !is_array($this->$name[$aspect]))
117 117
 				{
118 118
 					$this->$name[$aspect] = [];
119 119
 				}
@@ -125,17 +125,17 @@  discard block
 block discarded – undo
125 125
 	{
126 126
 		$tokenizer = new Tokenizer($code);
127 127
 
128
-		if(empty($ec))
128
+		if (empty($ec))
129 129
 		{
130 130
 			$ec = new ErrorCollector;
131 131
 		}
132 132
 
133 133
 		$results = [];
134 134
 
135
-		foreach($this->checkers as $checker)
135
+		foreach ($this->checkers as $checker)
136 136
 		{
137 137
 			assert($checker instanceof CheckerInterface);
138
-			if($checker instanceof LoggerAwareInterface)
138
+			if ($checker instanceof LoggerAwareInterface)
139 139
 			{
140 140
 				$checker->setLogger($this->logger);
141 141
 			}
Please login to merge, or discard this patch.
Braces   +1 added lines, -2 removed lines patch added patch discarded remove patch
@@ -90,8 +90,7 @@
 block discarded – undo
90 90
 		if (is_string($config))
91 91
 		{
92 92
 			EmbeDi::fly($config)->configure($this);
93
-		}
94
-		else
93
+		} else
95 94
 		{
96 95
 			EmbeDi::fly()->apply($config, $this);
97 96
 		}
Please login to merge, or discard this patch.
src/Helpers/ListNormalizer.php 2 patches
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -23,14 +23,14 @@
 block discarded – undo
23 23
 	public static function normalize(array $list)
24 24
 	{
25 25
 		$proper = [];
26
-		foreach($list as $key => $value)
26
+		foreach ($list as $key => $value)
27 27
 		{
28
-			if(is_string($key) && is_bool($value))
28
+			if (is_string($key) && is_bool($value))
29 29
 			{
30 30
 				$key = str_replace(['(', ')'], '', $key);
31 31
 				$proper[$key] = $value;
32 32
 			}
33
-			elseif(is_numeric($key) && is_string($value))
33
+			elseif (is_numeric($key) && is_string($value))
34 34
 			{
35 35
 				$value = str_replace(['(', ')'], '', $value);
36 36
 				$proper[$value] = true;
Please login to merge, or discard this patch.
Braces   +2 added lines, -4 removed lines patch added patch discarded remove patch
@@ -29,13 +29,11 @@
 block discarded – undo
29 29
 			{
30 30
 				$key = str_replace(['(', ')'], '', $key);
31 31
 				$proper[$key] = $value;
32
-			}
33
-			elseif(is_numeric($key) && is_string($value))
32
+			} elseif(is_numeric($key) && is_string($value))
34 33
 			{
35 34
 				$value = str_replace(['(', ')'], '', $value);
36 35
 				$proper[$value] = true;
37
-			}
38
-			else
36
+			} else
39 37
 			{
40 38
 				assert(false, "Unsupported list");
41 39
 			}
Please login to merge, or discard this patch.
src/Tokenizer/Collectors/StaticMethodCallsCollector.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -22,7 +22,7 @@  discard block
 block discarded – undo
22 22
 		foreach ($tokens as $index => $token)
23 23
 		{
24 24
 			// Skip all except double colon
25
-			if($token->not(T_DOUBLE_COLON))
25
+			if ($token->not(T_DOUBLE_COLON))
26 26
 			{
27 27
 				continue;
28 28
 			}
@@ -30,13 +30,13 @@  discard block
 block discarded – undo
30 30
 			$next = $token->next();
31 31
 
32 32
 			// Should start with class name
33
-			if($prev->not(T_STRING))
33
+			if ($prev->not(T_STRING))
34 34
 			{
35 35
 				continue;
36 36
 			}
37 37
 
38 38
 			// Should have method name
39
-			if($next->not(T_STRING))
39
+			if ($next->not(T_STRING))
40 40
 			{
41 41
 				continue;
42 42
 			}
@@ -44,7 +44,7 @@  discard block
 block discarded – undo
44 44
 			$finishing = $next->next();
45 45
 
46 46
 			// Should have opening bracket after method name
47
-			if($finishing->value !== '(')
47
+			if ($finishing->value !== '(')
48 48
 			{
49 49
 				continue;
50 50
 			}
@@ -55,7 +55,7 @@  discard block
 block discarded – undo
55 55
 			$methodName = $next->value;
56 56
 			$name = sprintf('%s::%s', $className, $methodName);
57 57
 
58
-			$result[] = new StaticMethod($name,$tokens, $index);
58
+			$result[] = new StaticMethod($name, $tokens, $index);
59 59
 		}
60 60
 		return $result;
61 61
 	}
Please login to merge, or discard this patch.
src/Tokenizer/Collectors/FunctionCallsCollector.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -53,9 +53,9 @@  discard block
 block discarded – undo
53 53
 				T_DO
54 54
 			];
55 55
 
56
-			foreach($toCheck as $type)
56
+			foreach ($toCheck as $type)
57 57
 			{
58
-				if($token->is($type))
58
+				if ($token->is($type))
59 59
 				{
60 60
 					$result[] = $token;
61 61
 					continue 2;
@@ -83,13 +83,13 @@  discard block
 block discarded – undo
83 83
 			$prev = $token->prev();
84 84
 
85 85
 			// Method call
86
-			if($prev->is(T_OBJECT_OPERATOR))
86
+			if ($prev->is(T_OBJECT_OPERATOR))
87 87
 			{
88 88
 				continue;
89 89
 			}
90 90
 
91 91
 			// Static method call
92
-			if($prev->is(T_DOUBLE_COLON))
92
+			if ($prev->is(T_DOUBLE_COLON))
93 93
 			{
94 94
 				continue;
95 95
 			}
Please login to merge, or discard this patch.
src/Tokenizer/Collectors/MethodCallsCollector.php 1 patch
Spacing   +15 added lines, -15 removed lines patch added patch discarded remove patch
@@ -28,7 +28,7 @@  discard block
 block discarded – undo
28 28
 		foreach ($tokens as $index => $token)
29 29
 		{
30 30
 			// Skip all except object operator
31
-			if($token->not(T_OBJECT_OPERATOR))
31
+			if ($token->not(T_OBJECT_OPERATOR))
32 32
 			{
33 33
 				continue;
34 34
 			}
@@ -40,13 +40,13 @@  discard block
 block discarded – undo
40 40
 			// $object->call()
41 41
 			// (new Object)->call()
42 42
 			// $objects[1]->call()
43
-			if($prev->not(T_VARIABLE) xor $prev->value !== ')' xor $prev->value !== ']')
43
+			if ($prev->not(T_VARIABLE) xor $prev->value !== ')' xor $prev->value !== ']')
44 44
 			{
45 45
 				continue;
46 46
 			}
47 47
 
48 48
 			// Should have method name
49
-			if($next->not(T_STRING))
49
+			if ($next->not(T_STRING))
50 50
 			{
51 51
 				continue;
52 52
 			}
@@ -54,7 +54,7 @@  discard block
 block discarded – undo
54 54
 			$finishing = $next->next();
55 55
 
56 56
 			// Should have opening bracket after method name
57
-			if($finishing->value !== '(')
57
+			if ($finishing->value !== '(')
58 58
 			{
59 59
 				continue;
60 60
 			}
@@ -73,18 +73,18 @@  discard block
 block discarded – undo
73 73
 			// myFunc()->method()
74 74
 			// This does not (yet?) support nested calls like:
75 75
 			// EG.: Yii::app()->getClientScript()->registerScript()
76
-			if(implode('', $className) === '()')
76
+			if (implode('', $className) === '()')
77 77
 			{
78 78
 				$function = $prev->prev()->prev();
79 79
 				array_unshift($className, $function->value);
80 80
 				$calledFrom = $function->prev();
81
-				if($calledFrom->is(T_DOUBLE_COLON) || $calledFrom->is(T_OBJECT_OPERATOR))
81
+				if ($calledFrom->is(T_DOUBLE_COLON) || $calledFrom->is(T_OBJECT_OPERATOR))
82 82
 				{
83 83
 					array_unshift($className, $calledFrom->value);
84 84
 					$parent = $calledFrom->prev();
85
-					if($parent->is(T_STRING) || $parent->is(T_VARIABLE))
85
+					if ($parent->is(T_STRING) || $parent->is(T_VARIABLE))
86 86
 					{
87
-						array_unshift($className,$parent->value);
87
+						array_unshift($className, $parent->value);
88 88
 					}
89 89
 				}
90 90
 			}
@@ -92,7 +92,7 @@  discard block
 block discarded – undo
92 92
 			$methodName = $next->value;
93 93
 			$name = sprintf('%s->%s', implode($className), $methodName);
94 94
 
95
-			$result[] = new StaticMethod($name,$tokens, $index);
95
+			$result[] = new StaticMethod($name, $tokens, $index);
96 96
 		}
97 97
 		return $result;
98 98
 	}
@@ -100,33 +100,33 @@  discard block
 block discarded – undo
100 100
 	private function resolve(&$className, TokenInterface $prev, $opened, $until)
101 101
 	{
102 102
 		$opening = null;
103
-		if($prev->value === $until)
103
+		if ($prev->value === $until)
104 104
 		{
105 105
 			$part = $prev->value;
106 106
 			$opening = $prev;
107
-			while($part !== $opened)
107
+			while ($part !== $opened)
108 108
 			{
109 109
 				$opening = $opening->prev();
110
-				if(empty($opening))
110
+				if (empty($opening))
111 111
 				{
112 112
 					break;
113 113
 				}
114 114
 				$part = $opening->value;
115 115
 
116 116
 				// Ensure space after `new`
117
-				if($opening->is(T_NEW))
117
+				if ($opening->is(T_NEW))
118 118
 				{
119 119
 					$part = "$part ";
120 120
 				}
121 121
 				array_unshift($className, $part);
122 122
 			}
123 123
 		}
124
-		if(empty($opening))
124
+		if (empty($opening))
125 125
 		{
126 126
 			return;
127 127
 		}
128 128
 		$preOpening = $opening->prev();
129
-		if($preOpening->is(T_VARIABLE))
129
+		if ($preOpening->is(T_VARIABLE))
130 130
 		{
131 131
 			array_unshift($className, $preOpening->value);
132 132
 		}
Please login to merge, or discard this patch.
src/Tokenizer/Tokenizer.php 1 patch
Braces   +1 added lines, -2 removed lines patch added patch discarded remove patch
@@ -40,8 +40,7 @@
 block discarded – undo
40 40
 			if (is_array($token))
41 41
 			{
42 42
 				$this->tokens[$index] = new Token($token, $this->tokens, $index);
43
-			}
44
-			else
43
+			} else
45 44
 			{
46 45
 				$this->tokens[$index] = new SimpleToken($token, $this->tokens, $index);
47 46
 			}
Please login to merge, or discard this patch.