@@ -57,7 +57,7 @@ |
||
57 | 57 | 48 => 1, |
58 | 58 | 70 => 1, |
59 | 59 | 71 => 1, |
60 | - ); |
|
60 | + ); |
|
61 | 61 | |
62 | 62 | }//end getErrorList() |
63 | 63 |
@@ -57,7 +57,7 @@ |
||
57 | 57 | 48 => 1, |
58 | 58 | 70 => 1, |
59 | 59 | 71 => 1, |
60 | - ); |
|
60 | + ); |
|
61 | 61 | |
62 | 62 | }//end getErrorList() |
63 | 63 |
@@ -10,7 +10,7 @@ |
||
10 | 10 | // Closures are allowed. |
11 | 11 | function myFunc($foo) |
12 | 12 | { |
13 | - $callback = function ($bar) use ($foo) |
|
13 | + $callback = function($bar) use ($foo) |
|
14 | 14 | { |
15 | 15 | $bar += $foo; |
16 | 16 | }; |
@@ -1,5 +1,5 @@ discard block |
||
1 | 1 | <?php |
2 | -function getVar($varname='var', $var='var') |
|
2 | +function getVar($varname = 'var', $var = 'var') |
|
3 | 3 | { |
4 | 4 | $var = $var2 = getVar(); |
5 | 5 | $var = $var2 = $var3 = ''; |
@@ -38,5 +38,5 @@ discard block |
||
38 | 38 | |
39 | 39 | $obj->$classVar = $prefix.'-'.$type; |
40 | 40 | |
41 | -$closureWithDefaultParamter = function(array $testArray=array()) {}; |
|
41 | +$closureWithDefaultParamter = function(array $testArray = array()) {}; |
|
42 | 42 | ?> |
@@ -57,7 +57,7 @@ |
||
57 | 57 | 48 => 1, |
58 | 58 | 70 => 1, |
59 | 59 | 71 => 1, |
60 | - ); |
|
60 | + ); |
|
61 | 61 | |
62 | 62 | }//end getErrorList() |
63 | 63 |
@@ -49,13 +49,13 @@ discard block |
||
49 | 49 | } |
50 | 50 | |
51 | 51 | switch ($lowerVarType) { |
52 | - case 'bool': |
|
53 | - return 'boolean'; |
|
54 | - echo 'hi'; |
|
55 | - case 'double': |
|
56 | - case 'real': |
|
57 | - return 'float'; |
|
58 | - echo 'hi'; |
|
52 | + case 'bool': |
|
53 | + return 'boolean'; |
|
54 | + echo 'hi'; |
|
55 | + case 'double': |
|
56 | + case 'real': |
|
57 | + return 'float'; |
|
58 | + echo 'hi'; |
|
59 | 59 | } |
60 | 60 | |
61 | 61 | while ($line=fgets($fp,2*1024*1024)) |
@@ -66,14 +66,14 @@ discard block |
||
66 | 66 | } |
67 | 67 | |
68 | 68 | switch ($var) { |
69 | - case 1: |
|
70 | - echo '1'; |
|
71 | - break; |
|
69 | + case 1: |
|
70 | + echo '1'; |
|
71 | + break; |
|
72 | 72 | |
73 | - echo 'non-executable'; |
|
74 | - default: |
|
75 | - echo '2'; |
|
76 | - break; |
|
73 | + echo 'non-executable'; |
|
74 | + default: |
|
75 | + echo '2'; |
|
76 | + break; |
|
77 | 77 | } |
78 | 78 | |
79 | 79 | switch (0) { |
@@ -124,13 +124,13 @@ discard block |
||
124 | 124 | }//end myFunction() |
125 | 125 | |
126 | 126 | switch ($var) { |
127 | - case 1: { |
|
128 | - return '1'; |
|
129 | - } |
|
127 | + case 1: { |
|
128 | + return '1'; |
|
129 | + } |
|
130 | 130 | |
131 | - case 2: { |
|
132 | - return '2'; |
|
133 | - } |
|
131 | + case 2: { |
|
132 | + return '2'; |
|
133 | + } |
|
134 | 134 | } |
135 | 135 | |
136 | 136 | defined('FOO') or die('error'); |
@@ -202,12 +202,12 @@ discard block |
||
202 | 202 | } |
203 | 203 | |
204 | 204 | switch ($foo) { |
205 | - case 'foo': |
|
206 | - if ($foo) |
|
207 | - return $foo; |
|
208 | - return $bar; |
|
209 | - default: |
|
210 | - return $bar; |
|
205 | + case 'foo': |
|
206 | + if ($foo) |
|
207 | + return $foo; |
|
208 | + return $bar; |
|
209 | + default: |
|
210 | + return $bar; |
|
211 | 211 | } |
212 | 212 | |
213 | 213 | function foo() |
@@ -216,13 +216,13 @@ discard block |
||
216 | 216 | } |
217 | 217 | |
218 | 218 | switch (true) { |
219 | - case 1: |
|
220 | - return foo( |
|
221 | - function () { |
|
222 | - $foo = $bar; // when this is removed it works ok |
|
223 | - return false; // from here on it reports unreachable |
|
224 | - } |
|
225 | - ); |
|
219 | + case 1: |
|
220 | + return foo( |
|
221 | + function () { |
|
222 | + $foo = $bar; // when this is removed it works ok |
|
223 | + return false; // from here on it reports unreachable |
|
224 | + } |
|
225 | + ); |
|
226 | 226 | } |
227 | 227 | |
228 | 228 | exit(); |
@@ -58,9 +58,9 @@ discard block |
||
58 | 58 | echo 'hi'; |
59 | 59 | } |
60 | 60 | |
61 | -while ($line=fgets($fp,2*1024*1024)) |
|
61 | +while ($line = fgets($fp, 2 * 1024 * 1024)) |
|
62 | 62 | { |
63 | - if (!preg_match("/^<([a-z0-9_]+)/",$line,$matches)) |
|
63 | + if (!preg_match("/^<([a-z0-9_]+)/", $line, $matches)) |
|
64 | 64 | continue; |
65 | 65 | print $line; |
66 | 66 | } |
@@ -109,7 +109,7 @@ discard block |
||
109 | 109 | }//end myFunction() |
110 | 110 | |
111 | 111 | public static function thisCausesAnError() { |
112 | -return new foo(function() {return $foo;} |
|
112 | +return new foo(function() {return $foo; } |
|
113 | 113 | ); |
114 | 114 | } |
115 | 115 | |
@@ -180,8 +180,8 @@ discard block |
||
180 | 180 | echo $foo; |
181 | 181 | } |
182 | 182 | |
183 | -function test(){ |
|
184 | - switch($a) { |
|
183 | +function test() { |
|
184 | + switch ($a) { |
|
185 | 185 | case 1: |
186 | 186 | if (empty($b)) |
187 | 187 | return 0; |
@@ -212,14 +212,14 @@ discard block |
||
212 | 212 | |
213 | 213 | function foo() |
214 | 214 | { |
215 | - return $bar->{$action . 'JsonAction'}(); |
|
215 | + return $bar->{$action.'JsonAction'}(); |
|
216 | 216 | } |
217 | 217 | |
218 | 218 | switch (true) { |
219 | 219 | case 1: |
220 | 220 | return foo( |
221 | - function () { |
|
222 | - $foo = $bar; // when this is removed it works ok |
|
221 | + function() { |
|
222 | + $foo = $bar; // when this is removed it works ok |
|
223 | 223 | return false; // from here on it reports unreachable |
224 | 224 | } |
225 | 225 | ); |
@@ -60,8 +60,9 @@ discard block |
||
60 | 60 | |
61 | 61 | while ($line=fgets($fp,2*1024*1024)) |
62 | 62 | { |
63 | - if (!preg_match("/^<([a-z0-9_]+)/",$line,$matches)) |
|
64 | - continue; |
|
63 | + if (!preg_match("/^<([a-z0-9_]+)/",$line,$matches)) { |
|
64 | + continue; |
|
65 | + } |
|
65 | 66 | print $line; |
66 | 67 | } |
67 | 68 | |
@@ -183,19 +184,21 @@ discard block |
||
183 | 184 | function test(){ |
184 | 185 | switch($a) { |
185 | 186 | case 1: |
186 | - if (empty($b)) |
|
187 | - return 0; |
|
187 | + if (empty($b)) { |
|
188 | + return 0; |
|
189 | + } |
|
188 | 190 | break; |
189 | 191 | default: |
190 | 192 | return 2; |
191 | 193 | } |
192 | 194 | |
193 | - if (empty($a)) |
|
194 | - echo '1'; |
|
195 | - elseif ($empty($b)) |
|
196 | - return 0; |
|
197 | - else |
|
198 | - return 1; |
|
195 | + if (empty($a)) { |
|
196 | + echo '1'; |
|
197 | + } elseif ($empty($b)) { |
|
198 | + return 0; |
|
199 | + } else { |
|
200 | + return 1; |
|
201 | + } |
|
199 | 202 | |
200 | 203 | echo "oi"; |
201 | 204 | return 1; |
@@ -203,8 +206,9 @@ discard block |
||
203 | 206 | |
204 | 207 | switch ($foo) { |
205 | 208 | case 'foo': |
206 | - if ($foo) |
|
207 | - return $foo; |
|
209 | + if ($foo) { |
|
210 | + return $foo; |
|
211 | + } |
|
208 | 212 | return $bar; |
209 | 213 | default: |
210 | 214 | return $bar; |
@@ -28,15 +28,15 @@ |
||
28 | 28 | public function getErrorList($testFile='DisallowInlineIfUnitTest.inc') |
29 | 29 | { |
30 | 30 | switch ($testFile) { |
31 | - case 'DisallowInlineIfUnitTest.inc': |
|
32 | - return array(8 => 1); |
|
33 | - break; |
|
34 | - case 'DisallowInlineIfUnitTest.js': |
|
35 | - return array(1 => 1); |
|
36 | - break; |
|
37 | - default: |
|
38 | - return array(); |
|
39 | - break; |
|
31 | + case 'DisallowInlineIfUnitTest.inc': |
|
32 | + return array(8 => 1); |
|
33 | + break; |
|
34 | + case 'DisallowInlineIfUnitTest.js': |
|
35 | + return array(1 => 1); |
|
36 | + break; |
|
37 | + default: |
|
38 | + return array(); |
|
39 | + break; |
|
40 | 40 | }//end switch |
41 | 41 | |
42 | 42 | }//end getErrorList() |
@@ -40,7 +40,7 @@ |
||
40 | 40 | * |
41 | 41 | * @return array<int, int> |
42 | 42 | */ |
43 | - public function getErrorList($testFile='DisallowInlineIfUnitTest.inc') |
|
43 | + public function getErrorList($testFile = 'DisallowInlineIfUnitTest.inc') |
|
44 | 44 | { |
45 | 45 | switch ($testFile) { |
46 | 46 | case 'DisallowInlineIfUnitTest.inc': |
@@ -52,7 +52,7 @@ |
||
52 | 52 | do { |
53 | 53 | echo $a->count; |
54 | 54 | $a->count--; |
55 | -} while($a->count); |
|
55 | +} while ($a->count); |
|
56 | 56 | |
57 | 57 | for ($i = 0; $i < $a->count; $i++) {} |
58 | 58 | ?> |
@@ -14,7 +14,7 @@ discard block |
||
14 | 14 | $var = myFunction( |
15 | 15 | 'one', |
16 | 16 | 'two' |
17 | - ); |
|
17 | + ); |
|
18 | 18 | |
19 | 19 | for ($i = ($stackPtr + 1); $i < $endStatement; $i++) { |
20 | 20 | } |
@@ -23,17 +23,17 @@ discard block |
||
23 | 23 | $var = myFunction(!$var); |
24 | 24 | |
25 | 25 | $depthAdv = array( |
26 | - $this, |
|
27 | - !$directLinks, |
|
28 | - FALSE, |
|
26 | + $this, |
|
27 | + !$directLinks, |
|
28 | + FALSE, |
|
29 | 29 | ); |
30 | 30 | |
31 | 31 | $var = myFunction( |
32 | 32 | $var, |
33 | 33 | array( |
34 | - $this, |
|
35 | - !$directLinks, |
|
36 | - FALSE, |
|
34 | + $this, |
|
35 | + !$directLinks, |
|
36 | + FALSE, |
|
37 | 37 | ); |
38 | 38 | ); |
39 | 39 |