@@ -1,6 +1,6 @@ |
||
1 | 1 | <?php |
2 | 2 | $obj = new MyClass(); |
3 | -$obj =& new MyClass(); |
|
3 | +$obj = & new MyClass(); |
|
4 | 4 | $obj = &new MyClass(); |
5 | 5 | new MyClass(); |
6 | 6 |
@@ -45,7 +45,7 @@ |
||
45 | 45 | return array( |
46 | 46 | 5 => 1, |
47 | 47 | 8 => 1, |
48 | - ); |
|
48 | + ); |
|
49 | 49 | |
50 | 50 | }//end getErrorList() |
51 | 51 |
@@ -50,7 +50,7 @@ |
||
50 | 50 | 1 => 1, |
51 | 51 | 22 => 1, |
52 | 52 | 38 => 1, |
53 | - ); |
|
53 | + ); |
|
54 | 54 | |
55 | 55 | }//end getErrorList() |
56 | 56 |
@@ -40,7 +40,7 @@ |
||
40 | 40 | * |
41 | 41 | * @return array<int, int> |
42 | 42 | */ |
43 | - public function getErrorList($testFile='ObjectMemberCommaUnitTest.js') |
|
43 | + public function getErrorList($testFile = 'ObjectMemberCommaUnitTest.js') |
|
44 | 44 | { |
45 | 45 | if ($testFile !== 'ObjectMemberCommaUnitTest.js') { |
46 | 46 | return array(); |
@@ -40,7 +40,7 @@ |
||
40 | 40 | T_CLASS, |
41 | 41 | T_INTERFACE, |
42 | 42 | T_TRAIT, |
43 | - ); |
|
43 | + ); |
|
44 | 44 | |
45 | 45 | }//end register() |
46 | 46 |
@@ -59,9 +59,9 @@ discard block |
||
59 | 59 | if ($result['symbol'] !== null && $result['effect'] !== null) { |
60 | 60 | $error = 'A file should declare new symbols (classes, functions, constants, etc.) and cause no other side effects, or it should execute logic with side effects, but should not do both. The first symbol is defined on line %s and the first side effect is on line %s.'; |
61 | 61 | $data = array( |
62 | - $tokens[$result['symbol']]['line'], |
|
63 | - $tokens[$result['effect']]['line'], |
|
64 | - ); |
|
62 | + $tokens[$result['symbol']]['line'], |
|
63 | + $tokens[$result['effect']]['line'], |
|
64 | + ); |
|
65 | 65 | $phpcsFile->addWarning($error, 0, 'FoundWithSymbols', $data); |
66 | 66 | $phpcsFile->recordMetric($stackPtr, 'Declarations and side effects mixed', 'yes'); |
67 | 67 | } else { |
@@ -96,13 +96,13 @@ discard block |
||
96 | 96 | T_INTERFACE => T_INTERFACE, |
97 | 97 | T_TRAIT => T_TRAIT, |
98 | 98 | T_FUNCTION => T_FUNCTION, |
99 | - ); |
|
99 | + ); |
|
100 | 100 | |
101 | 101 | $conditions = array( |
102 | - T_IF => T_IF, |
|
103 | - T_ELSE => T_ELSE, |
|
104 | - T_ELSEIF => T_ELSEIF, |
|
105 | - ); |
|
102 | + T_IF => T_IF, |
|
103 | + T_ELSE => T_ELSE, |
|
104 | + T_ELSEIF => T_ELSEIF, |
|
105 | + ); |
|
106 | 106 | |
107 | 107 | $firstSymbol = null; |
108 | 108 | $firstEffect = null; |
@@ -230,7 +230,7 @@ discard block |
||
230 | 230 | return array( |
231 | 231 | 'symbol' => $firstSymbol, |
232 | 232 | 'effect' => $firstEffect, |
233 | - ); |
|
233 | + ); |
|
234 | 234 | |
235 | 235 | }//end _searchForConflict() |
236 | 236 |
@@ -50,11 +50,11 @@ |
||
50 | 50 | return array( |
51 | 51 | 2 => 1, |
52 | 52 | 3 => 2, |
53 | - ); |
|
53 | + ); |
|
54 | 54 | } else { |
55 | 55 | return array( |
56 | 56 | 3 => 1, |
57 | - ); |
|
57 | + ); |
|
58 | 58 | } |
59 | 59 | |
60 | 60 | }//end getErrorList() |
@@ -40,7 +40,7 @@ |
||
40 | 40 | * |
41 | 41 | * @return array<int, int> |
42 | 42 | */ |
43 | - public function getErrorList($testFile='') |
|
43 | + public function getErrorList($testFile = '') |
|
44 | 44 | { |
45 | 45 | if ($testFile === 'ClassDeclarationUnitTest.2.inc') { |
46 | 46 | return array(); |
@@ -65,7 +65,7 @@ |
||
65 | 65 | case 'SideEffectsUnitTest.5.inc': |
66 | 66 | return array( |
67 | 67 | 1 => 1, |
68 | - ); |
|
68 | + ); |
|
69 | 69 | default: |
70 | 70 | return array(); |
71 | 71 | }//end switch |
@@ -60,14 +60,14 @@ |
||
60 | 60 | public function getWarningList($testFile='') |
61 | 61 | { |
62 | 62 | switch ($testFile) { |
63 | - case 'SideEffectsUnitTest.3.inc': |
|
64 | - case 'SideEffectsUnitTest.4.inc': |
|
65 | - case 'SideEffectsUnitTest.5.inc': |
|
66 | - return array( |
|
67 | - 1 => 1, |
|
68 | - ); |
|
69 | - default: |
|
70 | - return array(); |
|
63 | + case 'SideEffectsUnitTest.3.inc': |
|
64 | + case 'SideEffectsUnitTest.4.inc': |
|
65 | + case 'SideEffectsUnitTest.5.inc': |
|
66 | + return array( |
|
67 | + 1 => 1, |
|
68 | + ); |
|
69 | + default: |
|
70 | + return array(); |
|
71 | 71 | }//end switch |
72 | 72 | |
73 | 73 | }//end getWarningList() |
@@ -40,7 +40,7 @@ discard block |
||
40 | 40 | * |
41 | 41 | * @return array<int, int> |
42 | 42 | */ |
43 | - public function getErrorList($testFile='') |
|
43 | + public function getErrorList($testFile = '') |
|
44 | 44 | { |
45 | 45 | return array(); |
46 | 46 | |
@@ -57,7 +57,7 @@ discard block |
||
57 | 57 | * |
58 | 58 | * @return array<int, int> |
59 | 59 | */ |
60 | - public function getWarningList($testFile='') |
|
60 | + public function getWarningList($testFile = '') |
|
61 | 61 | { |
62 | 62 | switch ($testFile) { |
63 | 63 | case 'SideEffectsUnitTest.3.inc': |
@@ -7,9 +7,9 @@ |
||
7 | 7 | use Something; |
8 | 8 | use SomethingElse; |
9 | 9 | |
10 | -declare(ticks=1); |
|
10 | +declare(ticks = 1); |
|
11 | 11 | |
12 | -declare(ticks=1) { |
|
12 | +declare(ticks = 1) { |
|
13 | 13 | // Code. |
14 | 14 | } |
15 | 15 |
@@ -13,7 +13,7 @@ |
||
13 | 13 | echo $object->define(); |
14 | 14 | echo $object -> define(); |
15 | 15 | |
16 | -$c = new class extends Something{ |
|
16 | +$c = new class extends Something { |
|
17 | 17 | |
18 | 18 | public function someMethod() |
19 | 19 | { |