@@ -87,7 +87,7 @@ discard block |
||
87 | 87 | 156 => 1, |
88 | 88 | 168 => 1, |
89 | 89 | 184 => 1, |
90 | - ); |
|
90 | + ); |
|
91 | 91 | } |
92 | 92 | |
93 | 93 | if ($testFile === 'ScopeIndentUnitTest.3.inc') { |
@@ -95,7 +95,7 @@ discard block |
||
95 | 95 | 6 => 1, |
96 | 96 | 7 => 1, |
97 | 97 | 10 => 1, |
98 | - ); |
|
98 | + ); |
|
99 | 99 | } |
100 | 100 | |
101 | 101 | return array( |
@@ -159,7 +159,7 @@ discard block |
||
159 | 159 | 1117 => 1, |
160 | 160 | 1119 => 1, |
161 | 161 | 1122 => 1, |
162 | - ); |
|
162 | + ); |
|
163 | 163 | |
164 | 164 | }//end getErrorList() |
165 | 165 |
@@ -61,7 +61,7 @@ |
||
61 | 61 | * |
62 | 62 | * @return array<int, int> |
63 | 63 | */ |
64 | - public function getErrorList($testFile='ScopeIndentUnitTest.inc') |
|
64 | + public function getErrorList($testFile = 'ScopeIndentUnitTest.inc') |
|
65 | 65 | { |
66 | 66 | if ($testFile === 'ScopeIndentUnitTest.1.js') { |
67 | 67 | return array( |
@@ -43,32 +43,32 @@ |
||
43 | 43 | public function getErrorList($testFile='DisallowSpaceIndentUnitTest.inc') |
44 | 44 | { |
45 | 45 | switch ($testFile) { |
46 | - case 'DisallowSpaceIndentUnitTest.inc': |
|
47 | - return array( |
|
48 | - 5 => 1, |
|
49 | - 9 => 1, |
|
50 | - 15 => 1, |
|
51 | - 18 => 1, |
|
52 | - 19 => 1, |
|
53 | - 24 => 1, |
|
54 | - 30 => 1, |
|
55 | - 35 => 1, |
|
56 | - 50 => 1, |
|
57 | - 55 => 1, |
|
58 | - 58 => 1, |
|
59 | - 59 => 1, |
|
60 | - 60 => 1, |
|
61 | - ); |
|
62 | - break; |
|
63 | - case 'DisallowSpaceIndentUnitTest.js': |
|
64 | - return array(3 => 1); |
|
65 | - break; |
|
66 | - case 'DisallowSpaceIndentUnitTest.css': |
|
67 | - return array(2 => 1); |
|
68 | - break; |
|
69 | - default: |
|
70 | - return array(); |
|
71 | - break; |
|
46 | + case 'DisallowSpaceIndentUnitTest.inc': |
|
47 | + return array( |
|
48 | + 5 => 1, |
|
49 | + 9 => 1, |
|
50 | + 15 => 1, |
|
51 | + 18 => 1, |
|
52 | + 19 => 1, |
|
53 | + 24 => 1, |
|
54 | + 30 => 1, |
|
55 | + 35 => 1, |
|
56 | + 50 => 1, |
|
57 | + 55 => 1, |
|
58 | + 58 => 1, |
|
59 | + 59 => 1, |
|
60 | + 60 => 1, |
|
61 | + ); |
|
62 | + break; |
|
63 | + case 'DisallowSpaceIndentUnitTest.js': |
|
64 | + return array(3 => 1); |
|
65 | + break; |
|
66 | + case 'DisallowSpaceIndentUnitTest.css': |
|
67 | + return array(2 => 1); |
|
68 | + break; |
|
69 | + default: |
|
70 | + return array(); |
|
71 | + break; |
|
72 | 72 | }//end switch |
73 | 73 | |
74 | 74 | }//end getErrorList() |
@@ -40,7 +40,7 @@ |
||
40 | 40 | * |
41 | 41 | * @return array<int, int> |
42 | 42 | */ |
43 | - public function getErrorList($testFile='DisallowSpaceIndentUnitTest.inc') |
|
43 | + public function getErrorList($testFile = 'DisallowSpaceIndentUnitTest.inc') |
|
44 | 44 | { |
45 | 45 | switch ($testFile) { |
46 | 46 | case 'DisallowSpaceIndentUnitTest.inc': |
@@ -46,7 +46,7 @@ |
||
46 | 46 | case 'CharacterBeforePHPOpeningTagUnitTest.1.inc': |
47 | 47 | return array( |
48 | 48 | 2 => 1, |
49 | - ); |
|
49 | + ); |
|
50 | 50 | break; |
51 | 51 | default: |
52 | 52 | return array(); |
@@ -11,29 +11,29 @@ |
||
11 | 11 | this is some text |
12 | 12 | EOF; |
13 | 13 | |
14 | - $correctVar = false; |
|
14 | + $correctVar = false; |
|
15 | 15 | $correctVar = true; |
16 | 16 | |
17 | 17 | // Indent with spaces is not allowed |
18 | - $hello = array(); |
|
19 | - $world = ''; |
|
18 | + $hello = array(); |
|
19 | + $world = ''; |
|
20 | 20 | // here the indention is mixed with tabs and spaces |
21 | 21 | // [tab][space][space][space][tab]return "<$name$xmlns$type_str $atts xsi:nil=\"true\"/>"; |
22 | - return "<$name$xmlns$type_str $atts xsi:nil=\"true\"/>"; |
|
22 | + return "<$name$xmlns$type_str $atts xsi:nil=\"true\"/>"; |
|
23 | 23 | // [space][space][space][tab]return "<$name$xmlns$type_str $atts xsi:nil=\"true\"/>"; |
24 | - return "<$name$xmlns$type_str $atts xsi:nil=\"true\"/>"; |
|
24 | + return "<$name$xmlns$type_str $atts xsi:nil=\"true\"/>"; |
|
25 | 25 | // Doc comments are indent with tabs and one space |
26 | 26 | //[tab]/** |
27 | 27 | //[tab][space]* |
28 | - /** |
|
29 | - * CVS revision for HTTP headers. |
|
28 | + /** |
|
29 | + * CVS revision for HTTP headers. |
|
30 | 30 | * |
31 | - * @var string |
|
32 | - * @access private |
|
33 | - */ |
|
34 | - /** |
|
31 | + * @var string |
|
32 | + * @access private |
|
33 | + */ |
|
34 | + /** |
|
35 | 35 | * |
36 | - */ |
|
36 | + */ |
|
37 | 37 | |
38 | 38 | $str = 'hello |
39 | 39 | there'; |
@@ -79,20 +79,20 @@ |
||
79 | 79 | 46 => 1, |
80 | 80 | 47 => 1, |
81 | 81 | 48 => 1, |
82 | - ); |
|
82 | + ); |
|
83 | 83 | break; |
84 | 84 | case 'DisallowTabIndentUnitTest.js': |
85 | 85 | return array( |
86 | 86 | 3 => 1, |
87 | 87 | 5 => 1, |
88 | 88 | 6 => 1, |
89 | - ); |
|
89 | + ); |
|
90 | 90 | break; |
91 | 91 | case 'DisallowTabIndentUnitTest.css': |
92 | 92 | return array( |
93 | 93 | 1 => 1, |
94 | 94 | 2 => 1, |
95 | - ); |
|
95 | + ); |
|
96 | 96 | break; |
97 | 97 | default: |
98 | 98 | return array(); |
@@ -58,45 +58,45 @@ |
||
58 | 58 | public function getErrorList($testFile='DisallowTabIndentUnitTest.inc') |
59 | 59 | { |
60 | 60 | switch ($testFile) { |
61 | - case 'DisallowTabIndentUnitTest.inc': |
|
62 | - return array( |
|
63 | - 5 => 2, |
|
64 | - 9 => 1, |
|
65 | - 15 => 1, |
|
66 | - 20 => 2, |
|
67 | - 21 => 1, |
|
68 | - 22 => 2, |
|
69 | - 23 => 1, |
|
70 | - 24 => 2, |
|
71 | - 31 => 1, |
|
72 | - 32 => 2, |
|
73 | - 33 => 2, |
|
74 | - 41 => 1, |
|
75 | - 42 => 1, |
|
76 | - 43 => 1, |
|
77 | - 44 => 1, |
|
78 | - 45 => 1, |
|
79 | - 46 => 1, |
|
80 | - 47 => 1, |
|
81 | - 48 => 1, |
|
82 | - ); |
|
83 | - break; |
|
84 | - case 'DisallowTabIndentUnitTest.js': |
|
85 | - return array( |
|
86 | - 3 => 1, |
|
87 | - 5 => 1, |
|
88 | - 6 => 1, |
|
89 | - ); |
|
90 | - break; |
|
91 | - case 'DisallowTabIndentUnitTest.css': |
|
92 | - return array( |
|
93 | - 1 => 1, |
|
94 | - 2 => 1, |
|
95 | - ); |
|
96 | - break; |
|
97 | - default: |
|
98 | - return array(); |
|
99 | - break; |
|
61 | + case 'DisallowTabIndentUnitTest.inc': |
|
62 | + return array( |
|
63 | + 5 => 2, |
|
64 | + 9 => 1, |
|
65 | + 15 => 1, |
|
66 | + 20 => 2, |
|
67 | + 21 => 1, |
|
68 | + 22 => 2, |
|
69 | + 23 => 1, |
|
70 | + 24 => 2, |
|
71 | + 31 => 1, |
|
72 | + 32 => 2, |
|
73 | + 33 => 2, |
|
74 | + 41 => 1, |
|
75 | + 42 => 1, |
|
76 | + 43 => 1, |
|
77 | + 44 => 1, |
|
78 | + 45 => 1, |
|
79 | + 46 => 1, |
|
80 | + 47 => 1, |
|
81 | + 48 => 1, |
|
82 | + ); |
|
83 | + break; |
|
84 | + case 'DisallowTabIndentUnitTest.js': |
|
85 | + return array( |
|
86 | + 3 => 1, |
|
87 | + 5 => 1, |
|
88 | + 6 => 1, |
|
89 | + ); |
|
90 | + break; |
|
91 | + case 'DisallowTabIndentUnitTest.css': |
|
92 | + return array( |
|
93 | + 1 => 1, |
|
94 | + 2 => 1, |
|
95 | + ); |
|
96 | + break; |
|
97 | + default: |
|
98 | + return array(); |
|
99 | + break; |
|
100 | 100 | }//end switch |
101 | 101 | |
102 | 102 | }//end getErrorList() |
@@ -55,7 +55,7 @@ |
||
55 | 55 | * |
56 | 56 | * @return array<int, int> |
57 | 57 | */ |
58 | - public function getErrorList($testFile='DisallowTabIndentUnitTest.inc') |
|
58 | + public function getErrorList($testFile = 'DisallowTabIndentUnitTest.inc') |
|
59 | 59 | { |
60 | 60 | switch ($testFile) { |
61 | 61 | case 'DisallowTabIndentUnitTest.inc': |
@@ -37,7 +37,7 @@ |
||
37 | 37 | * |
38 | 38 | * @param string $testFile The name of the file being tested. |
39 | 39 | * |
40 | - * @return array |
|
40 | + * @return string[] |
|
41 | 41 | */ |
42 | 42 | public function getCliValues($testFile) |
43 | 43 | { |
@@ -2,40 +2,40 @@ discard block |
||
2 | 2 | <meta name="twitter:site" content="<?php echo $metaTagsData['twitter:site']; ?>"> |
3 | 3 | <?php |
4 | 4 | class Test { |
5 | - function __construct() |
|
6 | - { |
|
7 | - $this->hello(); |
|
8 | - } |
|
9 | - |
|
10 | - function hello() |
|
11 | - { |
|
12 | - echo 'hello'; |
|
5 | + function __construct() |
|
6 | + { |
|
7 | + $this->hello(); |
|
8 | + } |
|
9 | + |
|
10 | + function hello() |
|
11 | + { |
|
12 | + echo 'hello'; |
|
13 | 13 | }//end hello() |
14 | 14 | |
15 | - function hello2() |
|
16 | - { |
|
17 | - if (TRUE) { |
|
18 | - echo 'hello'; // no error here as its more than 4 spaces. |
|
19 | - } else { |
|
20 | - echo 'bye'; |
|
21 | - } |
|
22 | - |
|
23 | - while (TRUE) { |
|
24 | - echo 'hello'; |
|
25 | - } |
|
26 | - |
|
27 | - do { |
|
28 | - echo 'hello'; |
|
29 | - } while (TRUE); |
|
30 | - } |
|
31 | - |
|
32 | - function hello3() |
|
33 | - { |
|
34 | - switch ($hello) { |
|
35 | - case 'hello': |
|
36 | - break; |
|
37 | - } |
|
38 | - } |
|
15 | + function hello2() |
|
16 | + { |
|
17 | + if (TRUE) { |
|
18 | + echo 'hello'; // no error here as its more than 4 spaces. |
|
19 | + } else { |
|
20 | + echo 'bye'; |
|
21 | + } |
|
22 | + |
|
23 | + while (TRUE) { |
|
24 | + echo 'hello'; |
|
25 | + } |
|
26 | + |
|
27 | + do { |
|
28 | + echo 'hello'; |
|
29 | + } while (TRUE); |
|
30 | + } |
|
31 | + |
|
32 | + function hello3() |
|
33 | + { |
|
34 | + switch ($hello) { |
|
35 | + case 'hello': |
|
36 | + break; |
|
37 | + } |
|
38 | + } |
|
39 | 39 | |
40 | 40 | } |
41 | 41 | |
@@ -45,7 +45,7 @@ discard block |
||
45 | 45 | <body> |
46 | 46 | <?php |
47 | 47 | if ($form->validate()) { |
48 | - $safe = $form->getSubmitValues(); |
|
48 | + $safe = $form->getSubmitValues(); |
|
49 | 49 | } |
50 | 50 | ?> |
51 | 51 | </pre> |
@@ -53,62 +53,62 @@ discard block |
||
53 | 53 | |
54 | 54 | class Test2 |
55 | 55 | { |
56 | - function __construct() |
|
57 | - { |
|
58 | - // $this->open(); // error here |
|
59 | - } |
|
60 | - |
|
61 | - public function open() |
|
62 | - { |
|
63 | - // Some inline stuff that shouldn't error |
|
64 | - if (TRUE) echo 'hello'; |
|
65 | - foreach ($tokens as $token) echo $token; |
|
66 | - } |
|
67 | - |
|
68 | - /** |
|
69 | - * This is a comment 1. |
|
70 | - * This is a comment 2. |
|
71 | - * This is a comment 3. |
|
72 | - * This is a comment 4. |
|
73 | - */ |
|
74 | - public function close() |
|
75 | - { |
|
76 | - // All ok. |
|
77 | - if (TRUE) { |
|
78 | - if (TRUE) { |
|
79 | - } else if (FALSE) { |
|
80 | - foreach ($tokens as $token) { |
|
81 | - switch ($token) { |
|
82 | - case '1': |
|
83 | - case '2': |
|
84 | - if (true) { |
|
85 | - if (false) { |
|
86 | - if (false) { |
|
87 | - if (false) { |
|
88 | - echo 'hello'; |
|
89 | - } |
|
90 | - } |
|
91 | - } |
|
92 | - } |
|
93 | - break; |
|
94 | - case '5': |
|
95 | - break; |
|
96 | - } |
|
97 | - do { |
|
98 | - while (true) { |
|
99 | - foreach ($tokens as $token) { |
|
100 | - for ($i = 0; $i < $token; $i++) { |
|
101 | - echo 'hello'; |
|
102 | - } |
|
103 | - } |
|
104 | - } |
|
105 | - } while (true); |
|
106 | - } |
|
107 | - } |
|
108 | - } |
|
109 | - } |
|
110 | - |
|
111 | - /* |
|
56 | + function __construct() |
|
57 | + { |
|
58 | + // $this->open(); // error here |
|
59 | + } |
|
60 | + |
|
61 | + public function open() |
|
62 | + { |
|
63 | + // Some inline stuff that shouldn't error |
|
64 | + if (TRUE) echo 'hello'; |
|
65 | + foreach ($tokens as $token) echo $token; |
|
66 | + } |
|
67 | + |
|
68 | + /** |
|
69 | + * This is a comment 1. |
|
70 | + * This is a comment 2. |
|
71 | + * This is a comment 3. |
|
72 | + * This is a comment 4. |
|
73 | + */ |
|
74 | + public function close() |
|
75 | + { |
|
76 | + // All ok. |
|
77 | + if (TRUE) { |
|
78 | + if (TRUE) { |
|
79 | + } else if (FALSE) { |
|
80 | + foreach ($tokens as $token) { |
|
81 | + switch ($token) { |
|
82 | + case '1': |
|
83 | + case '2': |
|
84 | + if (true) { |
|
85 | + if (false) { |
|
86 | + if (false) { |
|
87 | + if (false) { |
|
88 | + echo 'hello'; |
|
89 | + } |
|
90 | + } |
|
91 | + } |
|
92 | + } |
|
93 | + break; |
|
94 | + case '5': |
|
95 | + break; |
|
96 | + } |
|
97 | + do { |
|
98 | + while (true) { |
|
99 | + foreach ($tokens as $token) { |
|
100 | + for ($i = 0; $i < $token; $i++) { |
|
101 | + echo 'hello'; |
|
102 | + } |
|
103 | + } |
|
104 | + } |
|
105 | + } while (true); |
|
106 | + } |
|
107 | + } |
|
108 | + } |
|
109 | + } |
|
110 | + |
|
111 | + /* |
|
112 | 112 | This is another c style comment 1. |
113 | 113 | This is another c style comment 2. |
114 | 114 | This is another c style comment 3. |
@@ -116,74 +116,74 @@ discard block |
||
116 | 116 | This is another c style comment 5. |
117 | 117 | */ |
118 | 118 | |
119 | - /* This is a T_COMMENT |
|
119 | + /* This is a T_COMMENT |
|
120 | 120 | * |
121 | 121 | * |
122 | 122 | * |
123 | 123 | */ |
124 | 124 | |
125 | - /** This is a T_DOC_COMMENT |
|
126 | - */ |
|
125 | + /** This is a T_DOC_COMMENT |
|
126 | + */ |
|
127 | 127 | |
128 | - /* |
|
128 | + /* |
|
129 | 129 | This T_COMMENT has a newline in it. |
130 | 130 | |
131 | 131 | */ |
132 | 132 | |
133 | - public function read() |
|
134 | - { |
|
135 | - echo 'hello'; |
|
136 | - |
|
137 | - // no errors below. |
|
138 | - $array = array( |
|
139 | - 'this', |
|
140 | - 'that' => array( |
|
141 | - 'hello', |
|
142 | - 'hello again' => array( |
|
143 | - 'hello', |
|
144 | - ), |
|
145 | - ), |
|
146 | - ); |
|
147 | - } |
|
133 | + public function read() |
|
134 | + { |
|
135 | + echo 'hello'; |
|
136 | + |
|
137 | + // no errors below. |
|
138 | + $array = array( |
|
139 | + 'this', |
|
140 | + 'that' => array( |
|
141 | + 'hello', |
|
142 | + 'hello again' => array( |
|
143 | + 'hello', |
|
144 | + ), |
|
145 | + ), |
|
146 | + ); |
|
147 | + } |
|
148 | 148 | } |
149 | 149 | |
150 | 150 | abstract class Test3 |
151 | 151 | { |
152 | - public function parse() |
|
153 | - { |
|
154 | - |
|
155 | - foreach ($t as $ndx => $token) { |
|
156 | - if (is_array($token)) { |
|
157 | - echo 'here'; |
|
158 | - } else { |
|
159 | - $ts[] = array("token" => $token, "value" => ''); |
|
160 | - |
|
161 | - $last = count($ts) - 1; |
|
162 | - |
|
163 | - switch ($token) { |
|
164 | - case '(': |
|
165 | - |
|
166 | - if ($last >= 3 && |
|
167 | - $ts[0]['token'] != T_CLASS && |
|
168 | - $ts[$last - 2]['token'] == T_OBJECT_OPERATOR && |
|
169 | - $ts[$last - 3]['token'] == T_VARIABLE ) { |
|
170 | - |
|
171 | - |
|
172 | - if (true) { |
|
173 | - echo 'hello'; |
|
174 | - } |
|
175 | - } |
|
176 | - array_push($braces, $token); |
|
177 | - break; |
|
178 | - } |
|
179 | - } |
|
180 | - } |
|
181 | - } |
|
152 | + public function parse() |
|
153 | + { |
|
154 | + |
|
155 | + foreach ($t as $ndx => $token) { |
|
156 | + if (is_array($token)) { |
|
157 | + echo 'here'; |
|
158 | + } else { |
|
159 | + $ts[] = array("token" => $token, "value" => ''); |
|
160 | + |
|
161 | + $last = count($ts) - 1; |
|
162 | + |
|
163 | + switch ($token) { |
|
164 | + case '(': |
|
165 | + |
|
166 | + if ($last >= 3 && |
|
167 | + $ts[0]['token'] != T_CLASS && |
|
168 | + $ts[$last - 2]['token'] == T_OBJECT_OPERATOR && |
|
169 | + $ts[$last - 3]['token'] == T_VARIABLE ) { |
|
170 | + |
|
171 | + |
|
172 | + if (true) { |
|
173 | + echo 'hello'; |
|
174 | + } |
|
175 | + } |
|
176 | + array_push($braces, $token); |
|
177 | + break; |
|
178 | + } |
|
179 | + } |
|
180 | + } |
|
181 | + } |
|
182 | 182 | } |
183 | 183 | |
184 | 184 | public function test() |
185 | 185 | { |
186 | - $o = <<<EOF |
|
186 | + $o = <<<EOF |
|
187 | 187 | this is some text |
188 | 188 | this is some text |
189 | 189 | this is some text |
@@ -192,24 +192,24 @@ discard block |
||
192 | 192 | this is some text |
193 | 193 | EOF; |
194 | 194 | |
195 | - return $o; |
|
195 | + return $o; |
|
196 | 196 | } |
197 | 197 | |
198 | 198 | if ($a === true || $a === true || $a === true || $a === true || |
199 | - $a === true || $a === true || $a === true || $a === true) { |
|
199 | + $a === true || $a === true || $a === true || $a === true) { |
|
200 | 200 | |
201 | - echo 'hello'; |
|
201 | + echo 'hello'; |
|
202 | 202 | } |
203 | 203 | |
204 | 204 | if ($true) { |
205 | - /* First comment line |
|
205 | + /* First comment line |
|
206 | 206 | * |
207 | 207 | * Comment test here |
208 | 208 | * Comment test here |
209 | 209 | * |
210 | 210 | */ |
211 | 211 | |
212 | - /* First comment line |
|
212 | + /* First comment line |
|
213 | 213 | * |
214 | 214 | * Comment test here |
215 | 215 | * Comment test here |
@@ -219,93 +219,93 @@ discard block |
||
219 | 219 | |
220 | 220 | function test() |
221 | 221 | { |
222 | - /* taken from http://de3.php.net/manual/en/reserved.php */ |
|
223 | - # $m[] = 'declare'; |
|
224 | - /* taken from http://de3.php.net/manual/en/reserved.php */ |
|
225 | - # $m[] = 'declare'; |
|
222 | + /* taken from http://de3.php.net/manual/en/reserved.php */ |
|
223 | + # $m[] = 'declare'; |
|
224 | + /* taken from http://de3.php.net/manual/en/reserved.php */ |
|
225 | + # $m[] = 'declare'; |
|
226 | 226 | } |
227 | 227 | |
228 | 228 | foreach ($elements as $element) { |
229 | - if ($something) { |
|
230 | - // Do IF. |
|
231 | - } else if ($somethingElse) { |
|
232 | - // Do ELSE. |
|
233 | - } |
|
229 | + if ($something) { |
|
230 | + // Do IF. |
|
231 | + } else if ($somethingElse) { |
|
232 | + // Do ELSE. |
|
233 | + } |
|
234 | 234 | } |
235 | 235 | |
236 | 236 | if ($condition) { |
237 | - echo "This is a long |
|
237 | + echo "This is a long |
|
238 | 238 | string that spans $numLines lines |
239 | 239 | without indenting. |
240 | 240 | "; |
241 | 241 | } |
242 | 242 | |
243 | 243 | if ($condition) { |
244 | - echo 'This is a long |
|
244 | + echo 'This is a long |
|
245 | 245 | string that spans nultiple lines |
246 | 246 | with indenting. |
247 | 247 | '; |
248 | 248 | } |
249 | 249 | |
250 | 250 | if ($condition) { |
251 | - echo 'This is a long |
|
251 | + echo 'This is a long |
|
252 | 252 | string that spans nultiple lines |
253 | 253 | with indenting.'; |
254 | 254 | } |
255 | 255 | |
256 | 256 | switch ($foo) { |
257 | - case 1: |
|
258 | - switch ($bar) { |
|
259 | - default: |
|
260 | - echo $string{1}; |
|
261 | - } |
|
262 | - break; |
|
257 | + case 1: |
|
258 | + switch ($bar) { |
|
259 | + default: |
|
260 | + echo $string{1}; |
|
261 | + } |
|
262 | + break; |
|
263 | 263 | } |
264 | 264 | |
265 | 265 | function temp($foo, $bar) { |
266 | - switch ($foo) { |
|
267 | - case 1: |
|
268 | - switch ($bar) { |
|
269 | - default: |
|
270 | - return $foo; |
|
271 | - } |
|
272 | - break; |
|
273 | - } |
|
266 | + switch ($foo) { |
|
267 | + case 1: |
|
268 | + switch ($bar) { |
|
269 | + default: |
|
270 | + return $foo; |
|
271 | + } |
|
272 | + break; |
|
273 | + } |
|
274 | 274 | } |
275 | 275 | |
276 | 276 | switch ($foo) { |
277 | - case 1: |
|
278 | - switch ($bar) { |
|
279 | - default: |
|
280 | - if ($something) { |
|
281 | - echo $string{1}; |
|
282 | - } else if ($else) { |
|
283 | - switch ($else) { |
|
284 | - default: |
|
285 | - } |
|
286 | - } |
|
287 | - } |
|
288 | - break; |
|
277 | + case 1: |
|
278 | + switch ($bar) { |
|
279 | + default: |
|
280 | + if ($something) { |
|
281 | + echo $string{1}; |
|
282 | + } else if ($else) { |
|
283 | + switch ($else) { |
|
284 | + default: |
|
285 | + } |
|
286 | + } |
|
287 | + } |
|
288 | + break; |
|
289 | 289 | } |
290 | 290 | |
291 | 291 | switch ($name) { |
292 | - case "1": |
|
293 | - case "2": |
|
294 | - case "3": |
|
295 | - return true; |
|
292 | + case "1": |
|
293 | + case "2": |
|
294 | + case "3": |
|
295 | + return true; |
|
296 | 296 | } |
297 | 297 | |
298 | 298 | switch ($name) { |
299 | - case "1": |
|
300 | - case "2": |
|
301 | - case "3": |
|
302 | - default : |
|
303 | - return true; |
|
299 | + case "1": |
|
300 | + case "2": |
|
301 | + case "3": |
|
302 | + default : |
|
303 | + return true; |
|
304 | 304 | } |
305 | 305 | |
306 | 306 | function myFunction() |
307 | 307 | { |
308 | - ?> |
|
308 | + ?> |
|
309 | 309 | <dynamic_content> |
310 | 310 | |
311 | 311 | </dynamic_content> |
@@ -314,197 +314,197 @@ discard block |
||
314 | 314 | } |
315 | 315 | |
316 | 316 | switch ($name) { |
317 | - case "1": |
|
318 | - switch ($name2) { |
|
319 | - case "1": |
|
320 | - break; |
|
321 | - case "2": |
|
322 | - break; |
|
323 | - } |
|
324 | - break; |
|
325 | - case "2": |
|
326 | - break; |
|
317 | + case "1": |
|
318 | + switch ($name2) { |
|
319 | + case "1": |
|
320 | + break; |
|
321 | + case "2": |
|
322 | + break; |
|
323 | + } |
|
324 | + break; |
|
325 | + case "2": |
|
326 | + break; |
|
327 | 327 | } |
328 | 328 | |
329 | 329 | switch (true) { |
330 | - case true: { |
|
331 | - } |
|
332 | - echo 'hi'; |
|
333 | - break; |
|
334 | - case false: |
|
335 | - case null:{ |
|
336 | - echo 'hi'; |
|
337 | - } |
|
338 | - break; |
|
330 | + case true: { |
|
331 | + } |
|
332 | + echo 'hi'; |
|
333 | + break; |
|
334 | + case false: |
|
335 | + case null:{ |
|
336 | + echo 'hi'; |
|
337 | + } |
|
338 | + break; |
|
339 | 339 | } |
340 | 340 | |
341 | 341 | switch (true) { |
342 | - case true: { |
|
343 | - echo 'hi'; |
|
344 | - } |
|
345 | - // No break here. |
|
346 | - case false: |
|
347 | - case true: |
|
348 | - case null:{ |
|
349 | - echo 'hi'; |
|
350 | - echo 'hi'; |
|
351 | - } |
|
352 | - break; |
|
342 | + case true: { |
|
343 | + echo 'hi'; |
|
344 | + } |
|
345 | + // No break here. |
|
346 | + case false: |
|
347 | + case true: |
|
348 | + case null:{ |
|
349 | + echo 'hi'; |
|
350 | + echo 'hi'; |
|
351 | + } |
|
352 | + break; |
|
353 | 353 | } |
354 | 354 | |
355 | 355 | switch (true) { |
356 | - case true: { |
|
357 | - if (true) { |
|
358 | - echo 'hi'; |
|
359 | - } |
|
360 | - } |
|
361 | - break; |
|
356 | + case true: { |
|
357 | + if (true) { |
|
358 | + echo 'hi'; |
|
359 | + } |
|
360 | + } |
|
361 | + break; |
|
362 | 362 | } |
363 | 363 | |
364 | 364 | // Testing anon function. |
365 | 365 | class a { |
366 | - function c() |
|
367 | - { |
|
368 | - $this->doSomething( |
|
369 | - function () { |
|
370 | - echo 123; |
|
371 | - } |
|
372 | - ); |
|
373 | - } |
|
366 | + function c() |
|
367 | + { |
|
368 | + $this->doSomething( |
|
369 | + function () { |
|
370 | + echo 123; |
|
371 | + } |
|
372 | + ); |
|
373 | + } |
|
374 | 374 | } |
375 | 375 | |
376 | 376 | some_function( |
377 | - function() { |
|
378 | - $a = 403; |
|
379 | - if ($a === 404) { |
|
380 | - $a = 403; |
|
381 | - } |
|
382 | - } |
|
377 | + function() { |
|
378 | + $a = 403; |
|
379 | + if ($a === 404) { |
|
380 | + $a = 403; |
|
381 | + } |
|
382 | + } |
|
383 | 383 | ); |
384 | 384 | |
385 | 385 | some_function( |
386 | - function() { |
|
387 | - $a = 403; |
|
388 | - if ($a === 404) { |
|
389 | - $a = 403; |
|
390 | - } |
|
391 | - } |
|
386 | + function() { |
|
387 | + $a = 403; |
|
388 | + if ($a === 404) { |
|
389 | + $a = 403; |
|
390 | + } |
|
391 | + } |
|
392 | 392 | ); |
393 | 393 | |
394 | 394 | $myFunction = function() { |
395 | - $a = 403; |
|
396 | - if ($a === 404) { |
|
397 | - $a = 403; |
|
398 | - } |
|
395 | + $a = 403; |
|
396 | + if ($a === 404) { |
|
397 | + $a = 403; |
|
398 | + } |
|
399 | 399 | } |
400 | 400 | |
401 | 401 | class Whatever |
402 | 402 | { |
403 | - protected $_protectedArray = array( |
|
404 | - 'normalString' => 'That email address is already in use!', |
|
405 | - 'offendingString' => <<<'STRING' |
|
403 | + protected $_protectedArray = array( |
|
404 | + 'normalString' => 'That email address is already in use!', |
|
405 | + 'offendingString' => <<<'STRING' |
|
406 | 406 | Each line of this string is always said to be at column 0, |
407 | 407 | no matter how many spaces are placed |
408 | 408 | at the beginning of each line |
409 | 409 | and the ending STRING on the next line is reported as having to be indented. |
410 | 410 | STRING |
411 | - ); |
|
411 | + ); |
|
412 | 412 | } |
413 | 413 | |
414 | 414 | class MyClass |
415 | 415 | { |
416 | - public static function myFunction() |
|
417 | - { |
|
418 | - if (empty($keywords) === FALSE) { |
|
419 | - $keywords = 'foo'; |
|
420 | - $existing = 'foo'; |
|
421 | - } |
|
416 | + public static function myFunction() |
|
417 | + { |
|
418 | + if (empty($keywords) === FALSE) { |
|
419 | + $keywords = 'foo'; |
|
420 | + $existing = 'foo'; |
|
421 | + } |
|
422 | 422 | |
423 | - return $keywords; |
|
423 | + return $keywords; |
|
424 | 424 | |
425 | - }//end myFunction() |
|
425 | + }//end myFunction() |
|
426 | 426 | |
427 | 427 | }//end class |
428 | 428 | |
429 | 429 | $var = call_user_func( |
430 | - $new_var = function () use (&$a) { |
|
431 | - if ($a > 0) { |
|
432 | - return $a++; |
|
433 | - } else { |
|
434 | - return $a--; |
|
435 | - } |
|
436 | - } |
|
430 | + $new_var = function () use (&$a) { |
|
431 | + if ($a > 0) { |
|
432 | + return $a++; |
|
433 | + } else { |
|
434 | + return $a--; |
|
435 | + } |
|
436 | + } |
|
437 | 437 | ); |
438 | 438 | |
439 | 439 | class AnonymousFn |
440 | 440 | { |
441 | - public function getAnonFn() |
|
442 | - { |
|
443 | - return array( |
|
444 | - 'functions' => Array( |
|
445 | - 'function1' => function ($a, $b, $c) { |
|
446 | - $a = $b + $c; |
|
447 | - $b = $c / 2; |
|
448 | - return Array($a, $b, $c); |
|
449 | - }, |
|
450 | - ), |
|
451 | - ); |
|
452 | - } |
|
441 | + public function getAnonFn() |
|
442 | + { |
|
443 | + return array( |
|
444 | + 'functions' => Array( |
|
445 | + 'function1' => function ($a, $b, $c) { |
|
446 | + $a = $b + $c; |
|
447 | + $b = $c / 2; |
|
448 | + return Array($a, $b, $c); |
|
449 | + }, |
|
450 | + ), |
|
451 | + ); |
|
452 | + } |
|
453 | 453 | } |
454 | 454 | ?> |
455 | 455 | |
456 | 456 | <div> |
457 | 457 | <?php |
458 | - if ($myvar == 'test') { |
|
459 | - echo 'something'; |
|
460 | - } |
|
461 | - ?> |
|
458 | + if ($myvar == 'test') { |
|
459 | + echo 'something'; |
|
460 | + } |
|
461 | + ?> |
|
462 | 462 | <div> |
463 | 463 | <div> |
464 | 464 | <?php |
465 | - if ($myvar == 'test') { |
|
466 | - echo 'something'; |
|
467 | - } |
|
468 | - ?> |
|
465 | + if ($myvar == 'test') { |
|
466 | + echo 'something'; |
|
467 | + } |
|
468 | + ?> |
|
469 | 469 | <div> |
470 | 470 | <div> |
471 | 471 | <?php |
472 | 472 | if ($myvar == 'test') { |
473 | - echo 'something'; |
|
473 | + echo 'something'; |
|
474 | 474 | } |
475 | - ?> |
|
475 | + ?> |
|
476 | 476 | <div> |
477 | 477 | <body> |
478 | 478 | <?php |
479 | - if (isset($_GET["test"])) { |
|
480 | - if ($_GET["test"] <> "") { |
|
481 | - $test = true; |
|
482 | - } else { |
|
483 | - $test = true; |
|
484 | - } |
|
485 | - } |
|
486 | - ?> |
|
479 | + if (isset($_GET["test"])) { |
|
480 | + if ($_GET["test"] <> "") { |
|
481 | + $test = true; |
|
482 | + } else { |
|
483 | + $test = true; |
|
484 | + } |
|
485 | + } |
|
486 | + ?> |
|
487 | 487 | </body> |
488 | 488 | |
489 | 489 | <?php |
490 | 490 | if (true) { |
491 | - ?> |
|
491 | + ?> |
|
492 | 492 | <div> |
493 | 493 | <div> |
494 | 494 | <div> |
495 | 495 | <?php |
496 | - if (true) { |
|
497 | - echo 'hello'; |
|
498 | - } else { |
|
499 | - echo 'goodbye'; |
|
500 | - } |
|
501 | - ?> |
|
496 | + if (true) { |
|
497 | + echo 'hello'; |
|
498 | + } else { |
|
499 | + echo 'goodbye'; |
|
500 | + } |
|
501 | + ?> |
|
502 | 502 | </div> |
503 | 503 | </div> |
504 | 504 | </div> |
505 | 505 | <?php |
506 | 506 | } else { |
507 | - echo 'else'; |
|
507 | + echo 'else'; |
|
508 | 508 | } |
509 | 509 | ?> |
510 | 510 | <?php if (isset($param)) { ?> |
@@ -512,49 +512,49 @@ discard block |
||
512 | 512 | <?php } |
513 | 513 | |
514 | 514 | $list = [ |
515 | - 'fn' => function ($a) { |
|
516 | - if ($a === true) { |
|
517 | - echo 'hi'; |
|
518 | - } |
|
519 | - } |
|
515 | + 'fn' => function ($a) { |
|
516 | + if ($a === true) { |
|
517 | + echo 'hi'; |
|
518 | + } |
|
519 | + } |
|
520 | 520 | ]; |
521 | 521 | |
522 | 522 | $list = [ |
523 | - 'fn' => function ($a) { |
|
524 | - if ($a === true) { |
|
525 | - echo 'hi'; |
|
526 | - } |
|
527 | - } |
|
523 | + 'fn' => function ($a) { |
|
524 | + if ($a === true) { |
|
525 | + echo 'hi'; |
|
526 | + } |
|
527 | + } |
|
528 | 528 | ]; |
529 | 529 | |
530 | 530 | if ($foo) { |
531 | - foreach ($bar as $baz) { |
|
532 | - if ($baz) { |
|
533 | - ?> |
|
531 | + foreach ($bar as $baz) { |
|
532 | + if ($baz) { |
|
533 | + ?> |
|
534 | 534 | <div> |
535 | 535 | <div> |
536 | 536 | <div> |
537 | 537 | <?php |
538 | - if ($baz > 1) { |
|
539 | - echo '1'; |
|
540 | - } |
|
541 | - ?> |
|
538 | + if ($baz > 1) { |
|
539 | + echo '1'; |
|
540 | + } |
|
541 | + ?> |
|
542 | 542 | </div> |
543 | 543 | <?php |
544 | - if ($baz > 1) { |
|
545 | - echo '1'; |
|
546 | - } |
|
547 | - ?> |
|
544 | + if ($baz > 1) { |
|
545 | + echo '1'; |
|
546 | + } |
|
547 | + ?> |
|
548 | 548 | </div> |
549 | 549 | <?php |
550 | - if ($baz > 1) { |
|
551 | - echo '1'; |
|
552 | - } |
|
553 | - ?> |
|
550 | + if ($baz > 1) { |
|
551 | + echo '1'; |
|
552 | + } |
|
553 | + ?> |
|
554 | 554 | </div> |
555 | 555 | <?php |
556 | - } |
|
557 | - } |
|
556 | + } |
|
557 | + } |
|
558 | 558 | } |
559 | 559 | |
560 | 560 | ?> |
@@ -562,102 +562,102 @@ discard block |
||
562 | 562 | |
563 | 563 | <?php |
564 | 564 | if ($foo) { |
565 | - echo '1'; |
|
566 | - echo '2'; |
|
567 | - echo '3'; |
|
565 | + echo '1'; |
|
566 | + echo '2'; |
|
567 | + echo '3'; |
|
568 | 568 | } |
569 | 569 | |
570 | 570 | $array = array(); |
571 | 571 | array_map( |
572 | - function($x) |
|
573 | - { |
|
574 | - return trim($x); |
|
575 | - }, |
|
576 | - $array |
|
572 | + function($x) |
|
573 | + { |
|
574 | + return trim($x); |
|
575 | + }, |
|
576 | + $array |
|
577 | 577 | ); |
578 | 578 | |
579 | 579 | function foo(){return function(){};} |
580 | 580 | |
581 | 581 | $mockedDatabase->expects($this->at(2)) |
582 | - ->with($this->callback( |
|
583 | - function ($subject) |
|
584 | - { |
|
585 | - } |
|
586 | - ) |
|
587 | - ); |
|
582 | + ->with($this->callback( |
|
583 | + function ($subject) |
|
584 | + { |
|
585 | + } |
|
586 | + ) |
|
587 | + ); |
|
588 | 588 | |
589 | 589 | /** @var Database $mockedDatabase */ |
590 | 590 | /** @var Container $mockedContainer */ |
591 | 591 | |
592 | 592 | echo $string->append('foo') |
593 | - ->appaend('bar') |
|
594 | - ->appaend('baz') |
|
595 | - ->outputUsing( |
|
596 | - function () |
|
597 | - { |
|
598 | - } |
|
599 | - ); |
|
593 | + ->appaend('bar') |
|
594 | + ->appaend('baz') |
|
595 | + ->outputUsing( |
|
596 | + function () |
|
597 | + { |
|
598 | + } |
|
599 | + ); |
|
600 | 600 | |
601 | 601 | echo PHP_EOL; |
602 | 602 | |
603 | 603 | switch ($arg) { |
604 | - case 1: |
|
605 | - break; |
|
606 | - case 2: |
|
607 | - if ($arg2 == 'foo') { |
|
608 | - } |
|
609 | - case 3: |
|
610 | - default: |
|
611 | - echo 'default'; |
|
604 | + case 1: |
|
605 | + break; |
|
606 | + case 2: |
|
607 | + if ($arg2 == 'foo') { |
|
608 | + } |
|
609 | + case 3: |
|
610 | + default: |
|
611 | + echo 'default'; |
|
612 | 612 | } |
613 | 613 | |
614 | 614 | if ($tokens[$stackPtr]['content']{0} === '#') { |
615 | 615 | } else if ($tokens[$stackPtr]['content']{0} === '/' |
616 | - && $tokens[$stackPtr]['content']{1} === '/' |
|
616 | + && $tokens[$stackPtr]['content']{1} === '/' |
|
617 | 617 | ) { |
618 | 618 | } |
619 | 619 | |
620 | 620 | $var = call_user_func( |
621 | - function() { |
|
622 | - if ($foo) { |
|
623 | - $new_var = function() { |
|
624 | - if ($a > 0) { |
|
625 | - return $a++; |
|
626 | - } else { |
|
627 | - return $a--; |
|
628 | - } |
|
629 | - } |
|
630 | - } |
|
631 | - } |
|
621 | + function() { |
|
622 | + if ($foo) { |
|
623 | + $new_var = function() { |
|
624 | + if ($a > 0) { |
|
625 | + return $a++; |
|
626 | + } else { |
|
627 | + return $a--; |
|
628 | + } |
|
629 | + } |
|
630 | + } |
|
631 | + } |
|
632 | 632 | ); |
633 | 633 | |
634 | 634 | a( |
635 | - function() { |
|
636 | - $a = function() { |
|
637 | - $b = false; |
|
638 | - }; |
|
639 | - true |
|
640 | - } |
|
635 | + function() { |
|
636 | + $a = function() { |
|
637 | + $b = false; |
|
638 | + }; |
|
639 | + true |
|
640 | + } |
|
641 | 641 | ); |
642 | 642 | |
643 | 643 | $var = [ |
644 | - [ |
|
645 | - '1' => |
|
646 | - function () { |
|
647 | - return true; |
|
648 | - }, |
|
649 | - ], |
|
650 | - [ |
|
651 | - '1' => |
|
652 | - function () { |
|
653 | - return true; |
|
654 | - }, |
|
655 | - '2' => true, |
|
656 | - ] |
|
644 | + [ |
|
645 | + '1' => |
|
646 | + function () { |
|
647 | + return true; |
|
648 | + }, |
|
649 | + ], |
|
650 | + [ |
|
651 | + '1' => |
|
652 | + function () { |
|
653 | + return true; |
|
654 | + }, |
|
655 | + '2' => true, |
|
656 | + ] |
|
657 | 657 | ]; |
658 | 658 | |
659 | 659 | if ($foo) { |
660 | - ?> |
|
660 | + ?> |
|
661 | 661 | </p> |
662 | 662 | <?php |
663 | 663 | } |
@@ -665,137 +665,137 @@ discard block |
||
665 | 665 | function foo() |
666 | 666 | { |
667 | 667 | $failingTests[$testName][] = array( |
668 | - 'comment' => self::_replaceKeywords($failingComment, $result), |
|
669 | - 'screenshot' => Test::getScreenshotPath( |
|
670 | - $projectid, |
|
671 | - $result['class_name'], |
|
672 | - ), |
|
673 | - ); |
|
668 | + 'comment' => self::_replaceKeywords($failingComment, $result), |
|
669 | + 'screenshot' => Test::getScreenshotPath( |
|
670 | + $projectid, |
|
671 | + $result['class_name'], |
|
672 | + ), |
|
673 | + ); |
|
674 | 674 | |
675 | 675 | } |
676 | 676 | |
677 | 677 | $this->mockedDatabase |
678 | - ->with( |
|
679 | - $this->callback( |
|
680 | - function () { |
|
681 | - return; |
|
682 | - } |
|
683 | - ) |
|
684 | - ); |
|
678 | + ->with( |
|
679 | + $this->callback( |
|
680 | + function () { |
|
681 | + return; |
|
682 | + } |
|
683 | + ) |
|
684 | + ); |
|
685 | 685 | |
686 | 686 | $this->subject->recordLogin(); |
687 | 687 | |
688 | 688 | function a() |
689 | 689 | { |
690 | - if (true) { |
|
691 | - static::$a[$b] = |
|
692 | - static::where($c) |
|
693 | - ->where($c) |
|
694 | - ->where( |
|
695 | - function ($d) { |
|
696 | - $d->whereNull(); |
|
697 | - $d->orWhere(); |
|
698 | - } |
|
699 | - ) |
|
700 | - ->first(); |
|
701 | - |
|
702 | - if (static::$a[$b] === null) { |
|
703 | - static::$a[$b] = new static( |
|
704 | - array( |
|
705 | - 'a' => $a->id, |
|
706 | - 'a' => $a->id, |
|
707 | - ) |
|
708 | - ); |
|
709 | - } |
|
710 | - } |
|
711 | - |
|
712 | - return static::$a[$b]; |
|
690 | + if (true) { |
|
691 | + static::$a[$b] = |
|
692 | + static::where($c) |
|
693 | + ->where($c) |
|
694 | + ->where( |
|
695 | + function ($d) { |
|
696 | + $d->whereNull(); |
|
697 | + $d->orWhere(); |
|
698 | + } |
|
699 | + ) |
|
700 | + ->first(); |
|
701 | + |
|
702 | + if (static::$a[$b] === null) { |
|
703 | + static::$a[$b] = new static( |
|
704 | + array( |
|
705 | + 'a' => $a->id, |
|
706 | + 'a' => $a->id, |
|
707 | + ) |
|
708 | + ); |
|
709 | + } |
|
710 | + } |
|
711 | + |
|
712 | + return static::$a[$b]; |
|
713 | 713 | } |
714 | 714 | |
715 | 715 | $foo->load( |
716 | - array( |
|
717 | - 'bar' => function ($baz) { |
|
718 | - $baz->call(); |
|
719 | - } |
|
720 | - ) |
|
716 | + array( |
|
717 | + 'bar' => function ($baz) { |
|
718 | + $baz->call(); |
|
719 | + } |
|
720 | + ) |
|
721 | 721 | ); |
722 | 722 | |
723 | 723 | hello(); |
724 | 724 | |
725 | 725 | $foo = array_unique( |
726 | - array_map( |
|
727 | - function ($entry) { |
|
728 | - return $entry * 2; |
|
729 | - }, |
|
730 | - array() |
|
731 | - ) |
|
726 | + array_map( |
|
727 | + function ($entry) { |
|
728 | + return $entry * 2; |
|
729 | + }, |
|
730 | + array() |
|
731 | + ) |
|
732 | 732 | ); |
733 | 733 | bar($foo); |
734 | 734 | |
735 | 735 | class PHP_CodeSniffer_Tokenizers_JS |
736 | 736 | { |
737 | 737 | |
738 | - public $scopeOpeners = array( |
|
739 | - T_CASE => array( |
|
740 | - 'end' => array( |
|
741 | - T_BREAK => T_BREAK, |
|
742 | - T_RETURN => T_RETURN, |
|
743 | - ), |
|
744 | - 'strict' => true, |
|
745 | - ), |
|
746 | - ); |
|
738 | + public $scopeOpeners = array( |
|
739 | + T_CASE => array( |
|
740 | + 'end' => array( |
|
741 | + T_BREAK => T_BREAK, |
|
742 | + T_RETURN => T_RETURN, |
|
743 | + ), |
|
744 | + 'strict' => true, |
|
745 | + ), |
|
746 | + ); |
|
747 | 747 | } |
748 | 748 | |
749 | 749 | echo $string-> |
750 | - append('foo')-> |
|
751 | - appaend('bar')-> |
|
752 | - appaend('baz')-> |
|
753 | - outputUsing( |
|
754 | - function () |
|
755 | - { |
|
756 | - } |
|
757 | - ); |
|
750 | + append('foo')-> |
|
751 | + appaend('bar')-> |
|
752 | + appaend('baz')-> |
|
753 | + outputUsing( |
|
754 | + function () |
|
755 | + { |
|
756 | + } |
|
757 | + ); |
|
758 | 758 | |
759 | 759 | $str = 'the items I want to show are: ' . |
760 | - implode( |
|
761 | - ', ', |
|
762 | - array('a', 'b', 'c') |
|
763 | - ); |
|
760 | + implode( |
|
761 | + ', ', |
|
762 | + array('a', 'b', 'c') |
|
763 | + ); |
|
764 | 764 | |
765 | 765 | echo $str; |
766 | 766 | |
767 | 767 | $str = 'foo' |
768 | - . '1' |
|
769 | - . '2'; |
|
768 | + . '1' |
|
769 | + . '2'; |
|
770 | 770 | |
771 | 771 | echo $str; |
772 | 772 | |
773 | 773 | bar([ |
774 | - 'foo' => foo(function () { |
|
775 | - return 'foo'; |
|
776 | - }) |
|
774 | + 'foo' => foo(function () { |
|
775 | + return 'foo'; |
|
776 | + }) |
|
777 | 777 | ]); |
778 | 778 | |
779 | 779 | $domains = array_unique( |
780 | - array_map( |
|
781 | - function ($url) { |
|
782 | - $urlObject = new \Purl\Url($url); |
|
783 | - return $urlObject->registerableDomain; |
|
784 | - }, |
|
785 | - $sites |
|
786 | - ) |
|
780 | + array_map( |
|
781 | + function ($url) { |
|
782 | + $urlObject = new \Purl\Url($url); |
|
783 | + return $urlObject->registerableDomain; |
|
784 | + }, |
|
785 | + $sites |
|
786 | + ) |
|
787 | 787 | ); |
788 | 788 | |
789 | 789 | return $domains; |
790 | 790 | |
791 | 791 | if ($a == 5) : |
792 | - echo "a equals 5"; |
|
793 | - echo "..."; |
|
792 | + echo "a equals 5"; |
|
793 | + echo "..."; |
|
794 | 794 | elseif ($a == 6) : |
795 | - echo "a equals 6"; |
|
796 | - echo "!!!"; |
|
795 | + echo "a equals 6"; |
|
796 | + echo "!!!"; |
|
797 | 797 | else : |
798 | - echo "a is neither 5 nor 6"; |
|
798 | + echo "a is neither 5 nor 6"; |
|
799 | 799 | endif; |
800 | 800 | |
801 | 801 | if ($foo): |
@@ -804,74 +804,74 @@ discard block |
||
804 | 804 | endif; |
805 | 805 | |
806 | 806 | $this |
807 | - ->method(array( |
|
808 | - 'foo' => 'bar', |
|
809 | - ), 'arg', array( |
|
810 | - 'foo' => 'bar', |
|
811 | - )); |
|
807 | + ->method(array( |
|
808 | + 'foo' => 'bar', |
|
809 | + ), 'arg', array( |
|
810 | + 'foo' => 'bar', |
|
811 | + )); |
|
812 | 812 | |
813 | 813 | class Foo |
814 | 814 | { |
815 | - use Bar { |
|
816 | - myMethod as renamedMethod; |
|
817 | - } |
|
815 | + use Bar { |
|
816 | + myMethod as renamedMethod; |
|
817 | + } |
|
818 | 818 | } |
819 | 819 | |
820 | 820 | class Foo |
821 | 821 | { |
822 | - use Bar { |
|
823 | - myMethod as renamedMethod; |
|
824 | - } |
|
822 | + use Bar { |
|
823 | + myMethod as renamedMethod; |
|
824 | + } |
|
825 | 825 | } |
826 | 826 | |
827 | 827 | foo(); |
828 | 828 | |
829 | 829 | array( |
830 | - 'key1' => function ($bar) { |
|
831 | - return $bar; |
|
832 | - }, |
|
833 | - 'key2' => function ($foo) { |
|
834 | - return $foo; |
|
835 | - }, |
|
830 | + 'key1' => function ($bar) { |
|
831 | + return $bar; |
|
832 | + }, |
|
833 | + 'key2' => function ($foo) { |
|
834 | + return $foo; |
|
835 | + }, |
|
836 | 836 | ); |
837 | 837 | |
838 | 838 | ?> |
839 | 839 | <script> |
840 | 840 | var foo = <?php echo bar( |
841 | - 'baz' |
|
842 | - ); ?>; |
|
841 | + 'baz' |
|
842 | + ); ?>; |
|
843 | 843 | </script> |
844 | 844 | <?php |
845 | 845 | |
846 | 846 | try { |
847 | - echo 'foo'; |
|
847 | + echo 'foo'; |
|
848 | 848 | } catch (\Exception $e) { |
849 | - echo 'catch'; |
|
849 | + echo 'catch'; |
|
850 | 850 | } finally { |
851 | - if (false) { |
|
852 | - echo 'finally false'; |
|
853 | - } |
|
851 | + if (false) { |
|
852 | + echo 'finally false'; |
|
853 | + } |
|
854 | 854 | } |
855 | 855 | |
856 | 856 | class C0 |
857 | 857 | { |
858 | - public function m0() |
|
859 | - { |
|
860 | - } |
|
858 | + public function m0() |
|
859 | + { |
|
860 | + } |
|
861 | 861 | |
862 | - public function m1() |
|
863 | - { |
|
864 | - } |
|
862 | + public function m1() |
|
863 | + { |
|
864 | + } |
|
865 | 865 | } |
866 | 866 | |
867 | 867 | namespace Foo { |
868 | 868 | |
869 | - use \Foo\Bar; |
|
870 | - use \Foo\Baz; |
|
869 | + use \Foo\Bar; |
|
870 | + use \Foo\Baz; |
|
871 | 871 | |
872 | - function test() { |
|
873 | - return true; |
|
874 | - } |
|
872 | + function test() { |
|
873 | + return true; |
|
874 | + } |
|
875 | 875 | |
876 | 876 | } |
877 | 877 | |
@@ -880,183 +880,183 @@ discard block |
||
880 | 880 | } |
881 | 881 | |
882 | 882 | $a = |
883 | - ( |
|
884 | - $b = 1 |
|
885 | - ); |
|
883 | + ( |
|
884 | + $b = 1 |
|
885 | + ); |
|
886 | 886 | $c = 2; |
887 | 887 | |
888 | 888 | $a = |
889 | - [ |
|
890 | - $b => 1, |
|
891 | - ]; |
|
889 | + [ |
|
890 | + $b => 1, |
|
891 | + ]; |
|
892 | 892 | $c = 2; |
893 | 893 | |
894 | 894 | class foo |
895 | 895 | { |
896 | - public function get() |
|
897 | - { |
|
898 | - $foo = ['b' => 'c', |
|
899 | - 'd' => [ |
|
900 | - ['e' => 'f'] |
|
901 | - ]]; |
|
902 | - echo '42'; |
|
903 | - |
|
904 | - $foo = array('b' => 'c', |
|
905 | - 'd' => array( |
|
906 | - array('e' => 'f') |
|
907 | - )); |
|
908 | - echo '42'; |
|
909 | - } |
|
896 | + public function get() |
|
897 | + { |
|
898 | + $foo = ['b' => 'c', |
|
899 | + 'd' => [ |
|
900 | + ['e' => 'f'] |
|
901 | + ]]; |
|
902 | + echo '42'; |
|
903 | + |
|
904 | + $foo = array('b' => 'c', |
|
905 | + 'd' => array( |
|
906 | + array('e' => 'f') |
|
907 | + )); |
|
908 | + echo '42'; |
|
909 | + } |
|
910 | 910 | } |
911 | 911 | |
912 | 912 | switch ($foo) { |
913 | - case 1: |
|
914 | - return array(); |
|
915 | - case 2: |
|
916 | - return ''; |
|
917 | - case 3: |
|
918 | - return $function(); |
|
919 | - case 4: |
|
920 | - return $functionCall($param[0]); |
|
921 | - case 5: |
|
922 | - return array() + array(); // Array Merge |
|
923 | - case 6: |
|
924 | - // String connect |
|
925 | - return $functionReturningString('') . $functionReturningString(array()); |
|
926 | - case 7: |
|
927 | - return functionCall( |
|
928 | - $withMultiLineParam[0], |
|
929 | - array(), |
|
930 | - $functionReturningString( |
|
931 | - $withMultiLineParam[1] |
|
932 | - ) |
|
933 | - ); |
|
934 | - case 8: |
|
935 | - return $param[0][0]; |
|
913 | + case 1: |
|
914 | + return array(); |
|
915 | + case 2: |
|
916 | + return ''; |
|
917 | + case 3: |
|
918 | + return $function(); |
|
919 | + case 4: |
|
920 | + return $functionCall($param[0]); |
|
921 | + case 5: |
|
922 | + return array() + array(); // Array Merge |
|
923 | + case 6: |
|
924 | + // String connect |
|
925 | + return $functionReturningString('') . $functionReturningString(array()); |
|
926 | + case 7: |
|
927 | + return functionCall( |
|
928 | + $withMultiLineParam[0], |
|
929 | + array(), |
|
930 | + $functionReturningString( |
|
931 | + $withMultiLineParam[1] |
|
932 | + ) |
|
933 | + ); |
|
934 | + case 8: |
|
935 | + return $param[0][0]; |
|
936 | 936 | } |
937 | 937 | |
938 | 938 | class Test { |
939 | 939 | |
940 | - public |
|
941 | - $foo |
|
942 | - ,$bar |
|
943 | - ,$baz = [ ] |
|
944 | - ; |
|
940 | + public |
|
941 | + $foo |
|
942 | + ,$bar |
|
943 | + ,$baz = [ ] |
|
944 | + ; |
|
945 | 945 | |
946 | - public function wtfindent() { |
|
947 | - } |
|
946 | + public function wtfindent() { |
|
947 | + } |
|
948 | 948 | } |
949 | 949 | |
950 | 950 | switch ($x) { |
951 | - case 1: |
|
952 | - return [1]; |
|
953 | - default: |
|
954 | - return [2]; |
|
951 | + case 1: |
|
952 | + return [1]; |
|
953 | + default: |
|
954 | + return [2]; |
|
955 | 955 | } |
956 | 956 | |
957 | 957 | switch ($foo) { |
958 | - case self::FOO: |
|
959 | - return $this->bar($gfoo, function ($id) { |
|
960 | - return FOO::bar($id); |
|
961 | - }, $values); |
|
962 | - case self::BAR: |
|
963 | - $values = $this->bar($foo, $values); |
|
964 | - break; |
|
958 | + case self::FOO: |
|
959 | + return $this->bar($gfoo, function ($id) { |
|
960 | + return FOO::bar($id); |
|
961 | + }, $values); |
|
962 | + case self::BAR: |
|
963 | + $values = $this->bar($foo, $values); |
|
964 | + break; |
|
965 | 965 | } |
966 | 966 | |
967 | 967 | $var = array( |
968 | - 'long description' => |
|
969 | - array(0, 'something'), |
|
970 | - 'another long description' => |
|
971 | - array(1, "something else") |
|
968 | + 'long description' => |
|
969 | + array(0, 'something'), |
|
970 | + 'another long description' => |
|
971 | + array(1, "something else") |
|
972 | 972 | ); |
973 | 973 | |
974 | 974 | $services = array( |
975 | - 'service 1' => |
|
976 | - Mockery::mock('class 1') |
|
977 | - ->shouldReceive('setFilter')->once() |
|
978 | - ->shouldReceive('getNbResults')->atLeast()->once() |
|
979 | - ->shouldReceive('getSlice')->once()->andReturn(array()) |
|
980 | - ->getMock(), |
|
981 | - 'service 2' => |
|
982 | - Mockery::mock('class 2') |
|
983 | - ->shouldReceive('__invoke')->once() |
|
984 | - ->getMock() |
|
975 | + 'service 1' => |
|
976 | + Mockery::mock('class 1') |
|
977 | + ->shouldReceive('setFilter')->once() |
|
978 | + ->shouldReceive('getNbResults')->atLeast()->once() |
|
979 | + ->shouldReceive('getSlice')->once()->andReturn(array()) |
|
980 | + ->getMock(), |
|
981 | + 'service 2' => |
|
982 | + Mockery::mock('class 2') |
|
983 | + ->shouldReceive('__invoke')->once() |
|
984 | + ->getMock() |
|
985 | 985 | ); |
986 | 986 | |
987 | 987 | class Foo |
988 | 988 | { |
989 | - public function setUp() |
|
990 | - { |
|
991 | - $this->foo = new class { |
|
992 | - public $name = 'Some value'; |
|
993 | - }; |
|
994 | - } |
|
989 | + public function setUp() |
|
990 | + { |
|
991 | + $this->foo = new class { |
|
992 | + public $name = 'Some value'; |
|
993 | + }; |
|
994 | + } |
|
995 | 995 | } |
996 | 996 | |
997 | 997 | try { |
998 | - foo(); |
|
998 | + foo(); |
|
999 | 999 | } catch (\Exception $e) { |
1000 | - $foo = function() { |
|
1001 | - return 'foo'; |
|
1002 | - } |
|
1000 | + $foo = function() { |
|
1001 | + return 'foo'; |
|
1002 | + } |
|
1003 | 1003 | |
1004 | - if (true) { |
|
1005 | - } |
|
1004 | + if (true) { |
|
1005 | + } |
|
1006 | 1006 | } |
1007 | 1007 | |
1008 | 1008 | if ($foo) { |
1009 | - foo(); |
|
1009 | + foo(); |
|
1010 | 1010 | } else if (\Exception $e) { |
1011 | - $foo = function() { |
|
1012 | - return 'foo'; |
|
1013 | - } |
|
1011 | + $foo = function() { |
|
1012 | + return 'foo'; |
|
1013 | + } |
|
1014 | 1014 | |
1015 | - if (true) { |
|
1016 | - } |
|
1015 | + if (true) { |
|
1016 | + } |
|
1017 | 1017 | } else { |
1018 | - $foo = function() { |
|
1019 | - return 'foo'; |
|
1020 | - } |
|
1018 | + $foo = function() { |
|
1019 | + return 'foo'; |
|
1020 | + } |
|
1021 | 1021 | |
1022 | - if (true) { |
|
1023 | - } |
|
1022 | + if (true) { |
|
1023 | + } |
|
1024 | 1024 | } |
1025 | 1025 | |
1026 | 1026 | switch ($parameter) { |
1027 | - case null: |
|
1028 | - return [ |
|
1029 | - 'foo' => in_array( |
|
1030 | - 'foo', |
|
1031 | - [] |
|
1032 | - ), |
|
1033 | - ]; |
|
1034 | - |
|
1035 | - default: |
|
1036 | - return []; |
|
1027 | + case null: |
|
1028 | + return [ |
|
1029 | + 'foo' => in_array( |
|
1030 | + 'foo', |
|
1031 | + [] |
|
1032 | + ), |
|
1033 | + ]; |
|
1034 | + |
|
1035 | + default: |
|
1036 | + return []; |
|
1037 | 1037 | } |
1038 | 1038 | |
1039 | 1039 | class SomeClass |
1040 | 1040 | { |
1041 | - public function someFunc() |
|
1042 | - { |
|
1043 | - a(function () { |
|
1044 | - echo "a"; |
|
1045 | - })->b(function () { |
|
1046 | - echo "b"; |
|
1047 | - }); |
|
1048 | - |
|
1049 | - if (true) { |
|
1050 | - echo "c"; |
|
1051 | - } |
|
1052 | - echo "d"; |
|
1053 | - } |
|
1041 | + public function someFunc() |
|
1042 | + { |
|
1043 | + a(function () { |
|
1044 | + echo "a"; |
|
1045 | + })->b(function () { |
|
1046 | + echo "b"; |
|
1047 | + }); |
|
1048 | + |
|
1049 | + if (true) { |
|
1050 | + echo "c"; |
|
1051 | + } |
|
1052 | + echo "d"; |
|
1053 | + } |
|
1054 | 1054 | } |
1055 | 1055 | |
1056 | 1056 | $params = self::validate_parameters(self::read_competency_framework_parameters(), |
1057 | - array( |
|
1058 | - 'id' => $id, |
|
1059 | - )); |
|
1057 | + array( |
|
1058 | + 'id' => $id, |
|
1059 | + )); |
|
1060 | 1060 | |
1061 | 1061 | $framework = api::read_framework($params['id']); |
1062 | 1062 | self::validate_context($framework->get_context()); |
@@ -1064,62 +1064,62 @@ discard block |
||
1064 | 1064 | |
1065 | 1065 | class Test123 |
1066 | 1066 | { |
1067 | - protected static |
|
1068 | - $prop1 = [ |
|
1069 | - 'testA' => 123, |
|
1070 | - ], |
|
1071 | - $prop2 = [ |
|
1072 | - 'testB' => 456, |
|
1073 | - ], |
|
1074 | - |
|
1075 | - protected static |
|
1076 | - $prop3 = array( |
|
1077 | - 'testA' => 123, |
|
1078 | - ), |
|
1079 | - $prop4 = array( |
|
1080 | - 'testB' => 456, |
|
1081 | - ), |
|
1082 | - |
|
1083 | - protected static $prop5; |
|
1067 | + protected static |
|
1068 | + $prop1 = [ |
|
1069 | + 'testA' => 123, |
|
1070 | + ], |
|
1071 | + $prop2 = [ |
|
1072 | + 'testB' => 456, |
|
1073 | + ], |
|
1074 | + |
|
1075 | + protected static |
|
1076 | + $prop3 = array( |
|
1077 | + 'testA' => 123, |
|
1078 | + ), |
|
1079 | + $prop4 = array( |
|
1080 | + 'testB' => 456, |
|
1081 | + ), |
|
1082 | + |
|
1083 | + protected static $prop5; |
|
1084 | 1084 | } |
1085 | 1085 | |
1086 | 1086 | $foo = foo( |
1087 | - function () { |
|
1088 | - $foo->debug( |
|
1089 | - $a, |
|
1090 | - $b |
|
1091 | - ); |
|
1092 | - |
|
1093 | - if ($a) { |
|
1094 | - $b = $a; |
|
1095 | - } |
|
1096 | - } |
|
1087 | + function () { |
|
1088 | + $foo->debug( |
|
1089 | + $a, |
|
1090 | + $b |
|
1091 | + ); |
|
1092 | + |
|
1093 | + if ($a) { |
|
1094 | + $b = $a; |
|
1095 | + } |
|
1096 | + } |
|
1097 | 1097 | ); |
1098 | 1098 | |
1099 | 1099 | $foo = foo( |
1100 | - function () { |
|
1101 | - $foo->debug( |
|
1102 | - $a, |
|
1103 | - $b |
|
1104 | - ); |
|
1105 | - |
|
1106 | - if ($a) { |
|
1107 | - $b = $a; |
|
1108 | - } |
|
1109 | - } |
|
1100 | + function () { |
|
1101 | + $foo->debug( |
|
1102 | + $a, |
|
1103 | + $b |
|
1104 | + ); |
|
1105 | + |
|
1106 | + if ($a) { |
|
1107 | + $b = $a; |
|
1108 | + } |
|
1109 | + } |
|
1110 | 1110 | ); |
1111 | 1111 | |
1112 | - function foo() |
|
1113 | - { |
|
1114 | - $foo = array( |
|
1115 | - ); |
|
1112 | + function foo() |
|
1113 | + { |
|
1114 | + $foo = array( |
|
1115 | + ); |
|
1116 | 1116 | |
1117 | - if ($foo) { |
|
1118 | - echo 'foo'; |
|
1119 | - } |
|
1117 | + if ($foo) { |
|
1118 | + echo 'foo'; |
|
1119 | + } |
|
1120 | 1120 | |
1121 | - return false; |
|
1122 | - } |
|
1121 | + return false; |
|
1122 | + } |
|
1123 | 1123 | |
1124 | 1124 | /* |
1125 | 1125 | $a = array( |
@@ -254,11 +254,11 @@ discard block |
||
254 | 254 | } |
255 | 255 | |
256 | 256 | switch ($foo) { |
257 | - case 1: |
|
258 | - switch ($bar) { |
|
257 | + case 1: |
|
258 | + switch ($bar) { |
|
259 | 259 | default: |
260 | 260 | echo $string{1}; |
261 | - } |
|
261 | + } |
|
262 | 262 | break; |
263 | 263 | } |
264 | 264 | |
@@ -274,25 +274,25 @@ discard block |
||
274 | 274 | } |
275 | 275 | |
276 | 276 | switch ($foo) { |
277 | - case 1: |
|
278 | - switch ($bar) { |
|
279 | - default: |
|
280 | - if ($something) { |
|
281 | - echo $string{1}; |
|
282 | - } else if ($else) { |
|
283 | - switch ($else) { |
|
284 | - default: |
|
285 | - } |
|
286 | - } |
|
277 | + case 1: |
|
278 | + switch ($bar) { |
|
279 | + default: |
|
280 | + if ($something) { |
|
281 | + echo $string{1}; |
|
282 | + } else if ($else) { |
|
283 | + switch ($else) { |
|
284 | + default: |
|
285 | + } |
|
286 | + } |
|
287 | 287 | } |
288 | 288 | break; |
289 | 289 | } |
290 | 290 | |
291 | 291 | switch ($name) { |
292 | - case "1": |
|
293 | - case "2": |
|
294 | - case "3": |
|
295 | - return true; |
|
292 | + case "1": |
|
293 | + case "2": |
|
294 | + case "3": |
|
295 | + return true; |
|
296 | 296 | } |
297 | 297 | |
298 | 298 | switch ($name) { |
@@ -314,16 +314,16 @@ discard block |
||
314 | 314 | } |
315 | 315 | |
316 | 316 | switch ($name) { |
317 | - case "1": |
|
318 | - switch ($name2) { |
|
317 | + case "1": |
|
318 | + switch ($name2) { |
|
319 | 319 | case "1": |
320 | 320 | break; |
321 | 321 | case "2": |
322 | 322 | break; |
323 | - } |
|
324 | - break; |
|
325 | - case "2": |
|
323 | + } |
|
326 | 324 | break; |
325 | + case "2": |
|
326 | + break; |
|
327 | 327 | } |
328 | 328 | |
329 | 329 | switch (true) { |
@@ -339,17 +339,17 @@ discard block |
||
339 | 339 | } |
340 | 340 | |
341 | 341 | switch (true) { |
342 | - case true: { |
|
343 | - echo 'hi'; |
|
344 | - } |
|
345 | - // No break here. |
|
346 | - case false: |
|
347 | - case true: |
|
348 | - case null:{ |
|
349 | - echo 'hi'; |
|
350 | - echo 'hi'; |
|
351 | - } |
|
352 | - break; |
|
342 | + case true: { |
|
343 | + echo 'hi'; |
|
344 | + } |
|
345 | + // No break here. |
|
346 | + case false: |
|
347 | + case true: |
|
348 | + case null:{ |
|
349 | + echo 'hi'; |
|
350 | + echo 'hi'; |
|
351 | + } |
|
352 | + break; |
|
353 | 353 | } |
354 | 354 | |
355 | 355 | switch (true) { |
@@ -910,29 +910,29 @@ discard block |
||
910 | 910 | } |
911 | 911 | |
912 | 912 | switch ($foo) { |
913 | - case 1: |
|
914 | - return array(); |
|
915 | - case 2: |
|
916 | - return ''; |
|
917 | - case 3: |
|
918 | - return $function(); |
|
919 | - case 4: |
|
920 | - return $functionCall($param[0]); |
|
921 | - case 5: |
|
922 | - return array() + array(); // Array Merge |
|
923 | - case 6: |
|
924 | - // String connect |
|
925 | - return $functionReturningString('') . $functionReturningString(array()); |
|
926 | - case 7: |
|
927 | - return functionCall( |
|
928 | - $withMultiLineParam[0], |
|
929 | - array(), |
|
930 | - $functionReturningString( |
|
931 | - $withMultiLineParam[1] |
|
932 | - ) |
|
933 | - ); |
|
934 | - case 8: |
|
935 | - return $param[0][0]; |
|
913 | + case 1: |
|
914 | + return array(); |
|
915 | + case 2: |
|
916 | + return ''; |
|
917 | + case 3: |
|
918 | + return $function(); |
|
919 | + case 4: |
|
920 | + return $functionCall($param[0]); |
|
921 | + case 5: |
|
922 | + return array() + array(); // Array Merge |
|
923 | + case 6: |
|
924 | + // String connect |
|
925 | + return $functionReturningString('') . $functionReturningString(array()); |
|
926 | + case 7: |
|
927 | + return functionCall( |
|
928 | + $withMultiLineParam[0], |
|
929 | + array(), |
|
930 | + $functionReturningString( |
|
931 | + $withMultiLineParam[1] |
|
932 | + ) |
|
933 | + ); |
|
934 | + case 8: |
|
935 | + return $param[0][0]; |
|
936 | 936 | } |
937 | 937 | |
938 | 938 | class Test { |
@@ -948,10 +948,10 @@ discard block |
||
948 | 948 | } |
949 | 949 | |
950 | 950 | switch ($x) { |
951 | - case 1: |
|
952 | - return [1]; |
|
953 | - default: |
|
954 | - return [2]; |
|
951 | + case 1: |
|
952 | + return [1]; |
|
953 | + default: |
|
954 | + return [2]; |
|
955 | 955 | } |
956 | 956 | |
957 | 957 | switch ($foo) { |
@@ -1024,16 +1024,16 @@ discard block |
||
1024 | 1024 | } |
1025 | 1025 | |
1026 | 1026 | switch ($parameter) { |
1027 | - case null: |
|
1028 | - return [ |
|
1029 | - 'foo' => in_array( |
|
1030 | - 'foo', |
|
1031 | - [] |
|
1032 | - ), |
|
1033 | - ]; |
|
1034 | - |
|
1035 | - default: |
|
1036 | - return []; |
|
1027 | + case null: |
|
1028 | + return [ |
|
1029 | + 'foo' => in_array( |
|
1030 | + 'foo', |
|
1031 | + [] |
|
1032 | + ), |
|
1033 | + ]; |
|
1034 | + |
|
1035 | + default: |
|
1036 | + return []; |
|
1037 | 1037 | } |
1038 | 1038 | |
1039 | 1039 | class SomeClass |
@@ -166,7 +166,7 @@ discard block |
||
166 | 166 | if ($last >= 3 && |
167 | 167 | $ts[0]['token'] != T_CLASS && |
168 | 168 | $ts[$last - 2]['token'] == T_OBJECT_OPERATOR && |
169 | - $ts[$last - 3]['token'] == T_VARIABLE ) { |
|
169 | + $ts[$last - 3]['token'] == T_VARIABLE) { |
|
170 | 170 | |
171 | 171 | |
172 | 172 | if (true) { |
@@ -366,7 +366,7 @@ discard block |
||
366 | 366 | function c() |
367 | 367 | { |
368 | 368 | $this->doSomething( |
369 | - function () { |
|
369 | + function() { |
|
370 | 370 | echo 123; |
371 | 371 | } |
372 | 372 | ); |
@@ -427,7 +427,7 @@ discard block |
||
427 | 427 | }//end class |
428 | 428 | |
429 | 429 | $var = call_user_func( |
430 | - $new_var = function () use (&$a) { |
|
430 | + $new_var = function() use (&$a) { |
|
431 | 431 | if ($a > 0) { |
432 | 432 | return $a++; |
433 | 433 | } else { |
@@ -442,7 +442,7 @@ discard block |
||
442 | 442 | { |
443 | 443 | return array( |
444 | 444 | 'functions' => Array( |
445 | - 'function1' => function ($a, $b, $c) { |
|
445 | + 'function1' => function($a, $b, $c) { |
|
446 | 446 | $a = $b + $c; |
447 | 447 | $b = $c / 2; |
448 | 448 | return Array($a, $b, $c); |
@@ -512,7 +512,7 @@ discard block |
||
512 | 512 | <?php } |
513 | 513 | |
514 | 514 | $list = [ |
515 | - 'fn' => function ($a) { |
|
515 | + 'fn' => function($a) { |
|
516 | 516 | if ($a === true) { |
517 | 517 | echo 'hi'; |
518 | 518 | } |
@@ -520,7 +520,7 @@ discard block |
||
520 | 520 | ]; |
521 | 521 | |
522 | 522 | $list = [ |
523 | - 'fn' => function ($a) { |
|
523 | + 'fn' => function($a) { |
|
524 | 524 | if ($a === true) { |
525 | 525 | echo 'hi'; |
526 | 526 | } |
@@ -576,11 +576,11 @@ discard block |
||
576 | 576 | $array |
577 | 577 | ); |
578 | 578 | |
579 | -function foo(){return function(){};} |
|
579 | +function foo() {return function() {};} |
|
580 | 580 | |
581 | 581 | $mockedDatabase->expects($this->at(2)) |
582 | 582 | ->with($this->callback( |
583 | - function ($subject) |
|
583 | + function($subject) |
|
584 | 584 | { |
585 | 585 | } |
586 | 586 | ) |
@@ -593,7 +593,7 @@ discard block |
||
593 | 593 | ->appaend('bar') |
594 | 594 | ->appaend('baz') |
595 | 595 | ->outputUsing( |
596 | - function () |
|
596 | + function() |
|
597 | 597 | { |
598 | 598 | } |
599 | 599 | ); |
@@ -643,13 +643,13 @@ discard block |
||
643 | 643 | $var = [ |
644 | 644 | [ |
645 | 645 | '1' => |
646 | - function () { |
|
646 | + function() { |
|
647 | 647 | return true; |
648 | 648 | }, |
649 | 649 | ], |
650 | 650 | [ |
651 | 651 | '1' => |
652 | - function () { |
|
652 | + function() { |
|
653 | 653 | return true; |
654 | 654 | }, |
655 | 655 | '2' => true, |
@@ -677,7 +677,7 @@ discard block |
||
677 | 677 | $this->mockedDatabase |
678 | 678 | ->with( |
679 | 679 | $this->callback( |
680 | - function () { |
|
680 | + function() { |
|
681 | 681 | return; |
682 | 682 | } |
683 | 683 | ) |
@@ -692,7 +692,7 @@ discard block |
||
692 | 692 | static::where($c) |
693 | 693 | ->where($c) |
694 | 694 | ->where( |
695 | - function ($d) { |
|
695 | + function($d) { |
|
696 | 696 | $d->whereNull(); |
697 | 697 | $d->orWhere(); |
698 | 698 | } |
@@ -714,7 +714,7 @@ discard block |
||
714 | 714 | |
715 | 715 | $foo->load( |
716 | 716 | array( |
717 | - 'bar' => function ($baz) { |
|
717 | + 'bar' => function($baz) { |
|
718 | 718 | $baz->call(); |
719 | 719 | } |
720 | 720 | ) |
@@ -724,7 +724,7 @@ discard block |
||
724 | 724 | |
725 | 725 | $foo = array_unique( |
726 | 726 | array_map( |
727 | - function ($entry) { |
|
727 | + function($entry) { |
|
728 | 728 | return $entry * 2; |
729 | 729 | }, |
730 | 730 | array() |
@@ -751,12 +751,12 @@ discard block |
||
751 | 751 | appaend('bar')-> |
752 | 752 | appaend('baz')-> |
753 | 753 | outputUsing( |
754 | - function () |
|
754 | + function() |
|
755 | 755 | { |
756 | 756 | } |
757 | 757 | ); |
758 | 758 | |
759 | -$str = 'the items I want to show are: ' . |
|
759 | +$str = 'the items I want to show are: '. |
|
760 | 760 | implode( |
761 | 761 | ', ', |
762 | 762 | array('a', 'b', 'c') |
@@ -771,14 +771,14 @@ discard block |
||
771 | 771 | echo $str; |
772 | 772 | |
773 | 773 | bar([ |
774 | - 'foo' => foo(function () { |
|
774 | + 'foo' => foo(function() { |
|
775 | 775 | return 'foo'; |
776 | 776 | }) |
777 | 777 | ]); |
778 | 778 | |
779 | 779 | $domains = array_unique( |
780 | 780 | array_map( |
781 | - function ($url) { |
|
781 | + function($url) { |
|
782 | 782 | $urlObject = new \Purl\Url($url); |
783 | 783 | return $urlObject->registerableDomain; |
784 | 784 | }, |
@@ -827,10 +827,10 @@ discard block |
||
827 | 827 | foo(); |
828 | 828 | |
829 | 829 | array( |
830 | - 'key1' => function ($bar) { |
|
830 | + 'key1' => function($bar) { |
|
831 | 831 | return $bar; |
832 | 832 | }, |
833 | - 'key2' => function ($foo) { |
|
833 | + 'key2' => function($foo) { |
|
834 | 834 | return $foo; |
835 | 835 | }, |
836 | 836 | ); |
@@ -875,7 +875,7 @@ discard block |
||
875 | 875 | |
876 | 876 | } |
877 | 877 | |
878 | -declare(ticks=1) { |
|
878 | +declare(ticks = 1) { |
|
879 | 879 | echo 'foo'; |
880 | 880 | } |
881 | 881 | |
@@ -922,7 +922,7 @@ discard block |
||
922 | 922 | return array() + array(); // Array Merge |
923 | 923 | case 6: |
924 | 924 | // String connect |
925 | - return $functionReturningString('') . $functionReturningString(array()); |
|
925 | + return $functionReturningString('').$functionReturningString(array()); |
|
926 | 926 | case 7: |
927 | 927 | return functionCall( |
928 | 928 | $withMultiLineParam[0], |
@@ -940,7 +940,7 @@ discard block |
||
940 | 940 | public |
941 | 941 | $foo |
942 | 942 | ,$bar |
943 | - ,$baz = [ ] |
|
943 | + ,$baz = [] |
|
944 | 944 | ; |
945 | 945 | |
946 | 946 | public function wtfindent() { |
@@ -956,7 +956,7 @@ discard block |
||
956 | 956 | |
957 | 957 | switch ($foo) { |
958 | 958 | case self::FOO: |
959 | - return $this->bar($gfoo, function ($id) { |
|
959 | + return $this->bar($gfoo, function($id) { |
|
960 | 960 | return FOO::bar($id); |
961 | 961 | }, $values); |
962 | 962 | case self::BAR: |
@@ -1040,9 +1040,9 @@ discard block |
||
1040 | 1040 | { |
1041 | 1041 | public function someFunc() |
1042 | 1042 | { |
1043 | - a(function () { |
|
1043 | + a(function() { |
|
1044 | 1044 | echo "a"; |
1045 | - })->b(function () { |
|
1045 | + })->b(function() { |
|
1046 | 1046 | echo "b"; |
1047 | 1047 | }); |
1048 | 1048 | |
@@ -1084,7 +1084,7 @@ discard block |
||
1084 | 1084 | } |
1085 | 1085 | |
1086 | 1086 | $foo = foo( |
1087 | - function () { |
|
1087 | + function() { |
|
1088 | 1088 | $foo->debug( |
1089 | 1089 | $a, |
1090 | 1090 | $b |
@@ -1097,7 +1097,7 @@ discard block |
||
1097 | 1097 | ); |
1098 | 1098 | |
1099 | 1099 | $foo = foo( |
1100 | - function () { |
|
1100 | + function() { |
|
1101 | 1101 | $foo->debug( |
1102 | 1102 | $a, |
1103 | 1103 | $b |
@@ -61,8 +61,12 @@ discard block |
||
61 | 61 | public function open() |
62 | 62 | { |
63 | 63 | // Some inline stuff that shouldn't error |
64 | - if (TRUE) echo 'hello'; |
|
65 | - foreach ($tokens as $token) echo $token; |
|
64 | + if (TRUE) { |
|
65 | + echo 'hello'; |
|
66 | + } |
|
67 | + foreach ($tokens as $token) { |
|
68 | + echo $token; |
|
69 | + } |
|
66 | 70 | } |
67 | 71 | |
68 | 72 | /** |
@@ -794,13 +798,18 @@ discard block |
||
794 | 798 | elseif ($a == 6) : |
795 | 799 | echo "a equals 6"; |
796 | 800 | echo "!!!"; |
797 | -else : |
|
801 | +else { |
|
802 | + : |
|
798 | 803 | echo "a is neither 5 nor 6"; |
804 | +} |
|
799 | 805 | endif; |
800 | 806 | |
801 | 807 | if ($foo): |
802 | -if ($bar) $foo = 1; |
|
803 | -elseif ($baz) $foo = 2; |
|
808 | +if ($bar) { |
|
809 | + $foo = 1; |
|
810 | +} elseif ($baz) { |
|
811 | + $foo = 2; |
|
812 | +} |
|
804 | 813 | endif; |
805 | 814 | |
806 | 815 | $this |
@@ -15,7 +15,7 @@ discard block |
||
15 | 15 | myclass::myfunc(&$myvar); |
16 | 16 | myclass::myfunc($myvar); |
17 | 17 | |
18 | -while(testfunc($var1, &$var2, $var3, &$var4) === false) { |
|
18 | +while (testfunc($var1, &$var2, $var3, &$var4) === false) { |
|
19 | 19 | } |
20 | 20 | |
21 | 21 | sprintf("0%o", 0777 & $p); |
@@ -25,9 +25,9 @@ discard block |
||
25 | 25 | if (is_array($foo = &$this->bar())) { |
26 | 26 | } |
27 | 27 | |
28 | -Hooks::run( 'SecondaryDataUpdates', [ $title, $old, $recursive, $parserOutput, &$updates ] ); |
|
28 | +Hooks::run('SecondaryDataUpdates', [$title, $old, $recursive, $parserOutput, &$updates]); |
|
29 | 29 | |
30 | 30 | $foo = Bar(&$fooBar); |
31 | 31 | |
32 | -myfunc($myvar&$myvar); |
|
33 | -myfunc($myvar[0]&$myvar); |
|
32 | +myfunc($myvar & $myvar); |
|
33 | +myfunc($myvar[0] & $myvar); |
@@ -21,7 +21,7 @@ discard block |
||
21 | 21 | |
22 | 22 | // Space before brace. |
23 | 23 | function myFunction() |
24 | - { |
|
24 | + { |
|
25 | 25 | } |
26 | 26 | |
27 | 27 | class myClass() |
@@ -52,7 +52,7 @@ discard block |
||
52 | 52 | |
53 | 53 | // Space before brace. |
54 | 54 | function myFunction() |
55 | - { |
|
55 | + { |
|
56 | 56 | } |
57 | 57 | } |
58 | 58 | |
@@ -88,7 +88,7 @@ discard block |
||
88 | 88 | // Space before brace. |
89 | 89 | function myFunction($variable1, $variable2, |
90 | 90 | $variable3, $variable4) |
91 | - { |
|
91 | + { |
|
92 | 92 | } |
93 | 93 | |
94 | 94 | class myClass() |
@@ -125,7 +125,7 @@ discard block |
||
125 | 125 | // Space before brace. |
126 | 126 | function myFunction($variable1, $variable2, |
127 | 127 | $variable3, $variable4) |
128 | - { |
|
128 | + { |
|
129 | 129 | } |
130 | 130 | } |
131 | 131 |
@@ -10,7 +10,7 @@ discard block |
||
10 | 10 | } |
11 | 11 | |
12 | 12 | // Too many spaces. |
13 | -function myFunction() { |
|
13 | +function myFunction() { |
|
14 | 14 | } |
15 | 15 | |
16 | 16 | // Too many newlines. |
@@ -41,7 +41,7 @@ discard block |
||
41 | 41 | } |
42 | 42 | |
43 | 43 | // Too many spaces. |
44 | - function myFunction() { |
|
44 | + function myFunction() { |
|
45 | 45 | } |
46 | 46 | |
47 | 47 | // Too many newlines. |
@@ -75,7 +75,7 @@ discard block |
||
75 | 75 | |
76 | 76 | // Too many spaces. |
77 | 77 | function myFunction($variable1, $variable2, |
78 | - $variable3, $variable4) { |
|
78 | + $variable3, $variable4) { |
|
79 | 79 | } |
80 | 80 | |
81 | 81 | // Too many newlines. |
@@ -112,7 +112,7 @@ discard block |
||
112 | 112 | |
113 | 113 | // Too many spaces. |
114 | 114 | function myFunction($variable1, $variable2, |
115 | - $variable3, $variable4) { |
|
115 | + $variable3, $variable4) { |
|
116 | 116 | } |
117 | 117 | |
118 | 118 | // Too many newlines. |
@@ -161,25 +161,25 @@ discard block |
||
161 | 161 | |
162 | 162 | // @codingStandardsChangeSetting Generic.Functions.OpeningFunctionBraceBsdAllman checkClosures 1 |
163 | 163 | |
164 | -$closureWithArgs = function ($arg1, $arg2) { |
|
164 | +$closureWithArgs = function($arg1, $arg2) { |
|
165 | 165 | // body |
166 | 166 | }; |
167 | 167 | |
168 | -$closureWithArgsAndVars = function ($arg1, $arg2) use ($var1, $var2) { |
|
168 | +$closureWithArgsAndVars = function($arg1, $arg2) use ($var1, $var2) { |
|
169 | 169 | // body |
170 | 170 | }; |
171 | 171 | |
172 | -$test = function ($param) use ($result) { |
|
172 | +$test = function($param) use ($result) { |
|
173 | 173 | return null; |
174 | 174 | } |
175 | 175 | |
176 | -$test = function ($param) use ($result) : Something { |
|
176 | +$test = function($param) use ($result) : Something { |
|
177 | 177 | return null; |
178 | 178 | }; |
179 | 179 | |
180 | 180 | // @codingStandardsChangeSetting Generic.Functions.OpeningFunctionBraceBsdAllman checkClosures 0 |
181 | 181 | |
182 | -$closureWithArgs = function ($arg1, $arg2) { |
|
182 | +$closureWithArgs = function($arg1, $arg2) { |
|
183 | 183 | // body |
184 | 184 | }; |
185 | 185 |
@@ -10,11 +10,11 @@ discard block |
||
10 | 10 | } |
11 | 11 | |
12 | 12 | // Too many spaces. |
13 | -function myFunction() { |
|
13 | +function myFunction() { |
|
14 | 14 | } |
15 | 15 | |
16 | 16 | // Uses tab. |
17 | -function myFunction() { |
|
17 | +function myFunction() { |
|
18 | 18 | } |
19 | 19 | |
20 | 20 | |
@@ -30,11 +30,11 @@ discard block |
||
30 | 30 | } |
31 | 31 | |
32 | 32 | // Too many spaces. |
33 | - function myFunction() { |
|
33 | + function myFunction() { |
|
34 | 34 | } |
35 | 35 | |
36 | 36 | // Uses tab. |
37 | - function myFunction() { |
|
37 | + function myFunction() { |
|
38 | 38 | } |
39 | 39 | } |
40 | 40 | |
@@ -55,12 +55,12 @@ discard block |
||
55 | 55 | |
56 | 56 | // Too many spaces. |
57 | 57 | function myFunction($variable1, $variable2, |
58 | - $variable3, $variable4) { |
|
58 | + $variable3, $variable4) { |
|
59 | 59 | } |
60 | 60 | |
61 | 61 | // Uses tab. |
62 | 62 | function myFunction($variable1, $variable2, |
63 | - $variable3, $variable4) { |
|
63 | + $variable3, $variable4) { |
|
64 | 64 | } |
65 | 65 | |
66 | 66 | |
@@ -79,12 +79,12 @@ discard block |
||
79 | 79 | |
80 | 80 | // Too many spaces. |
81 | 81 | function myFunction($variable1, $variable2, |
82 | - $variable3, $variable4) { |
|
82 | + $variable3, $variable4) { |
|
83 | 83 | } |
84 | 84 | |
85 | 85 | // Uses tab. |
86 | 86 | function myFunction($variable1, $variable2, |
87 | - $variable3, $variable4) { |
|
87 | + $variable3, $variable4) { |
|
88 | 88 | } |
89 | 89 | } |
90 | 90 | |
@@ -120,27 +120,27 @@ discard block |
||
120 | 120 | |
121 | 121 | // @codingStandardsChangeSetting Generic.Functions.OpeningFunctionBraceKernighanRitchie checkClosures 1 |
122 | 122 | |
123 | -$closureWithArgs = function ($arg1, $arg2){ |
|
123 | +$closureWithArgs = function($arg1, $arg2) { |
|
124 | 124 | // body |
125 | 125 | }; |
126 | 126 | |
127 | -$closureWithArgsAndVars = function ($arg1, $arg2) use ($var1, $var2){ |
|
127 | +$closureWithArgsAndVars = function($arg1, $arg2) use ($var1, $var2){ |
|
128 | 128 | // body |
129 | 129 | }; |
130 | 130 | |
131 | -$test = function ($param) use ($result) |
|
131 | +$test = function($param) use ($result) |
|
132 | 132 | { |
133 | 133 | return null; |
134 | 134 | } |
135 | 135 | |
136 | -$test = function ($param) use ($result) : Something |
|
136 | +$test = function($param) use ($result) : Something |
|
137 | 137 | { |
138 | 138 | return null; |
139 | 139 | } |
140 | 140 | |
141 | 141 | // @codingStandardsChangeSetting Generic.Functions.OpeningFunctionBraceKernighanRitchie checkClosures 0 |
142 | 142 | |
143 | -$closureWithArgs = function ($arg1, $arg2){ |
|
143 | +$closureWithArgs = function($arg1, $arg2) { |
|
144 | 144 | // body |
145 | 145 | }; |
146 | 146 |
@@ -13,13 +13,13 @@ |
||
13 | 13 | $result = myFunction($arg1 , $arg2=array()); |
14 | 14 | |
15 | 15 | $result = myFunction($arg1, |
16 | - $arg2 = array(), |
|
17 | - $arg3, |
|
18 | - $arg4, |
|
19 | - $arg5); |
|
16 | + $arg2 = array(), |
|
17 | + $arg3, |
|
18 | + $arg4, |
|
19 | + $arg5); |
|
20 | 20 | |
21 | 21 | throw new Exception("This is some massive string for a message", |
22 | - $cause); |
|
22 | + $cause); |
|
23 | 23 | |
24 | 24 | // Function definitions are ignored |
25 | 25 | function myFunction($arg1,$arg2) |
@@ -2,15 +2,15 @@ discard block |
||
2 | 2 | |
3 | 3 | $result = myFunction(); |
4 | 4 | $result = myFunction($arg1, $arg2); |
5 | -$result = myFunction($arg1,$arg2); |
|
6 | -$result = myFunction($arg1 , $arg2); |
|
7 | -$result = myFunction($arg1 , $arg2); |
|
8 | -$result = myFunction($arg1, $arg2, $arg3,$arg4, $arg5); |
|
5 | +$result = myFunction($arg1, $arg2); |
|
6 | +$result = myFunction($arg1, $arg2); |
|
7 | +$result = myFunction($arg1, $arg2); |
|
8 | +$result = myFunction($arg1, $arg2, $arg3, $arg4, $arg5); |
|
9 | 9 | $result = myFunction($arg1, $arg2, $arg3, $arg4, $arg5); |
10 | 10 | $result = myFunction($arg1, $arg2 = array()); |
11 | -$result = myFunction($arg1 , $arg2 =array()); |
|
12 | -$result = myFunction($arg1 , $arg2= array()); |
|
13 | -$result = myFunction($arg1 , $arg2=array()); |
|
11 | +$result = myFunction($arg1, $arg2 = array()); |
|
12 | +$result = myFunction($arg1, $arg2 = array()); |
|
13 | +$result = myFunction($arg1, $arg2 = array()); |
|
14 | 14 | |
15 | 15 | $result = myFunction($arg1, |
16 | 16 | $arg2 = array(), |
@@ -22,28 +22,28 @@ discard block |
||
22 | 22 | $cause); |
23 | 23 | |
24 | 24 | // Function definitions are ignored |
25 | -function myFunction($arg1,$arg2) |
|
25 | +function myFunction($arg1, $arg2) |
|
26 | 26 | { |
27 | 27 | } |
28 | 28 | |
29 | -function myFunction ($arg1,$arg2) |
|
29 | +function myFunction($arg1, $arg2) |
|
30 | 30 | { |
31 | 31 | } |
32 | 32 | |
33 | -function myFunction($arg1=1,$arg2=2) |
|
33 | +function myFunction($arg1 = 1, $arg2 = 2) |
|
34 | 34 | { |
35 | 35 | } |
36 | 36 | |
37 | 37 | |
38 | -function myFunction($arg1 = 1,$arg2 = 2) |
|
38 | +function myFunction($arg1 = 1, $arg2 = 2) |
|
39 | 39 | { |
40 | 40 | } |
41 | 41 | |
42 | -$key = array_search($this->getArray($one, $two,$three),$this->arrayMap); |
|
43 | -$this->error($obj->getCode(),$obj->getMessage(),$obj->getFile(),$obj->getLine()); |
|
42 | +$key = array_search($this->getArray($one, $two, $three), $this->arrayMap); |
|
43 | +$this->error($obj->getCode(), $obj->getMessage(), $obj->getFile(), $obj->getLine()); |
|
44 | 44 | |
45 | -make_foo($string /*the string*/ , true /*test*/); |
|
46 | -make_foo($string/*the string*/ , /*test*/ true); |
|
45 | +make_foo($string /*the string*/, true /*test*/); |
|
46 | +make_foo($string/*the string*/, /*test*/ true); |
|
47 | 47 | make_foo($string /*the string*/, /*test*/ true); |
48 | 48 | |
49 | 49 | class MyClass { |
@@ -53,7 +53,7 @@ discard block |
||
53 | 53 | } |
54 | 54 | |
55 | 55 | // Function definition, not function call, so should be ignored |
56 | -function &myFunction($arg1=1,$arg2=2) |
|
56 | +function &myFunction($arg1 = 1, $arg2 = 2) |
|
57 | 57 | { |
58 | 58 | } |
59 | 59 | |
@@ -61,7 +61,7 @@ discard block |
||
61 | 61 | $foo, |
62 | 62 | $bar, |
63 | 63 | function($a, $b) { |
64 | - $foo='bar'; |
|
64 | + $foo = 'bar'; |
|
65 | 65 | return $foo; |
66 | 66 | } |
67 | 67 | ); |
@@ -84,12 +84,12 @@ discard block |
||
84 | 84 | THEN |
85 | 85 | ); |
86 | 86 | |
87 | -if (in_array($arg1, ['foo','bar'])) {} |
|
88 | -if (in_array($arg1, array('foo','bar'))) {} |
|
87 | +if (in_array($arg1, ['foo', 'bar'])) {} |
|
88 | +if (in_array($arg1, array('foo', 'bar'))) {} |
|
89 | 89 | |
90 | 90 | $b = foo( |
91 | 91 | "1", // this is a comment |
92 | - "2", // this is a comment |
|
93 | - "3",// this is a comment |
|
92 | + "2", // this is a comment |
|
93 | + "3", // this is a comment |
|
94 | 94 | "4" |
95 | 95 | ); |