@@ -1,7 +1,6 @@ discard block |
||
1 | 1 | <?php |
2 | 2 | |
3 | -class TestMemberProperties |
|
4 | -{ |
|
3 | +class TestMemberProperties { |
|
5 | 4 | /* testVar */ |
6 | 5 | var $varA = true; |
7 | 6 | |
@@ -105,8 +104,7 @@ discard block |
||
105 | 104 | |
106 | 105 | } |
107 | 106 | |
108 | -interface Base |
|
109 | -{ |
|
107 | +interface Base { |
|
110 | 108 | /* testInterfaceProperty */ |
111 | 109 | protected $anonymous; |
112 | 110 | } |
@@ -14,8 +14,7 @@ discard block |
||
14 | 14 | use PHP_CodeSniffer\Files\DummyFile; |
15 | 15 | use PHPUnit\Framework\TestCase; |
16 | 16 | |
17 | -class GetMemberPropertiesTest extends TestCase |
|
18 | -{ |
|
17 | +class GetMemberPropertiesTest extends TestCase { |
|
19 | 18 | |
20 | 19 | /** |
21 | 20 | * The PHP_CodeSniffer_File object containing parsed contents of the test case file. |
@@ -33,8 +32,7 @@ discard block |
||
33 | 32 | * |
34 | 33 | * @return void |
35 | 34 | */ |
36 | - public function setUp() |
|
37 | - { |
|
35 | + public function setUp() { |
|
38 | 36 | $config = new Config(); |
39 | 37 | $config->standards = ['Generic']; |
40 | 38 | |
@@ -52,8 +50,7 @@ discard block |
||
52 | 50 | * |
53 | 51 | * @return void |
54 | 52 | */ |
55 | - public function tearDown() |
|
56 | - { |
|
53 | + public function tearDown() { |
|
57 | 54 | unset($this->phpcsFile); |
58 | 55 | |
59 | 56 | }//end tearDown() |
@@ -69,8 +66,7 @@ discard block |
||
69 | 66 | * |
70 | 67 | * @return void |
71 | 68 | */ |
72 | - public function testGetMemberProperties($identifier, $expected) |
|
73 | - { |
|
69 | + public function testGetMemberProperties($identifier, $expected) { |
|
74 | 70 | $start = ($this->phpcsFile->numTokens - 1); |
75 | 71 | $delim = $this->phpcsFile->findPrevious( |
76 | 72 | T_COMMENT, |
@@ -94,8 +90,7 @@ discard block |
||
94 | 90 | * |
95 | 91 | * @return array |
96 | 92 | */ |
97 | - public function dataGetMemberProperties() |
|
98 | - { |
|
93 | + public function dataGetMemberProperties() { |
|
99 | 94 | return [ |
100 | 95 | [ |
101 | 96 | '/* testVar */', |
@@ -334,8 +329,7 @@ discard block |
||
334 | 329 | * |
335 | 330 | * @return void |
336 | 331 | */ |
337 | - public function testNotClassPropertyException($identifier) |
|
338 | - { |
|
332 | + public function testNotClassPropertyException($identifier) { |
|
339 | 333 | $start = ($this->phpcsFile->numTokens - 1); |
340 | 334 | $delim = $this->phpcsFile->findPrevious( |
341 | 335 | T_COMMENT, |
@@ -358,8 +352,7 @@ discard block |
||
358 | 352 | * |
359 | 353 | * @return array |
360 | 354 | */ |
361 | - public function dataNotClassProperty() |
|
362 | - { |
|
355 | + public function dataNotClassProperty() { |
|
363 | 356 | return [ |
364 | 357 | ['/* testMethodParam */'], |
365 | 358 | ['/* testImportedGlobal */'], |
@@ -380,8 +373,7 @@ discard block |
||
380 | 373 | * |
381 | 374 | * @return void |
382 | 375 | */ |
383 | - public function testNotAVariableException() |
|
384 | - { |
|
376 | + public function testNotAVariableException() { |
|
385 | 377 | $start = ($this->phpcsFile->numTokens - 1); |
386 | 378 | $delim = $this->phpcsFile->findPrevious( |
387 | 379 | T_COMMENT, |
@@ -14,8 +14,7 @@ discard block |
||
14 | 14 | use PHP_CodeSniffer\Files\DummyFile; |
15 | 15 | use PHPUnit\Framework\TestCase; |
16 | 16 | |
17 | -class FindExtendedClassNameTest extends TestCase |
|
18 | -{ |
|
17 | +class FindExtendedClassNameTest extends TestCase { |
|
19 | 18 | |
20 | 19 | /** |
21 | 20 | * The PHP_CodeSniffer_File object containing parsed contents of the test case file. |
@@ -33,8 +32,7 @@ discard block |
||
33 | 32 | * |
34 | 33 | * @return void |
35 | 34 | */ |
36 | - public function setUp() |
|
37 | - { |
|
35 | + public function setUp() { |
|
38 | 36 | $config = new Config(); |
39 | 37 | $config->standards = ['Generic']; |
40 | 38 | |
@@ -52,8 +50,7 @@ discard block |
||
52 | 50 | * |
53 | 51 | * @return void |
54 | 52 | */ |
55 | - public function tearDown() |
|
56 | - { |
|
53 | + public function tearDown() { |
|
57 | 54 | unset($this->phpcsFile); |
58 | 55 | |
59 | 56 | }//end tearDown() |
@@ -70,8 +67,7 @@ discard block |
||
70 | 67 | * |
71 | 68 | * @return void |
72 | 69 | */ |
73 | - public function testFindExtendedClassName($identifier, $expected) |
|
74 | - { |
|
70 | + public function testFindExtendedClassName($identifier, $expected) { |
|
75 | 71 | $start = ($this->phpcsFile->numTokens - 1); |
76 | 72 | $delim = $this->phpcsFile->findPrevious( |
77 | 73 | T_COMMENT, |
@@ -95,8 +91,7 @@ discard block |
||
95 | 91 | * |
96 | 92 | * @return array |
97 | 93 | */ |
98 | - public function dataExtendedClass() |
|
99 | - { |
|
94 | + public function dataExtendedClass() { |
|
100 | 95 | return [ |
101 | 96 | [ |
102 | 97 | '/* testExtendedClass */', |
@@ -14,8 +14,7 @@ discard block |
||
14 | 14 | use PHP_CodeSniffer\Files\DummyFile; |
15 | 15 | use PHPUnit\Framework\TestCase; |
16 | 16 | |
17 | -class FindImplementedInterfaceNamesTest extends TestCase |
|
18 | -{ |
|
17 | +class FindImplementedInterfaceNamesTest extends TestCase { |
|
19 | 18 | |
20 | 19 | /** |
21 | 20 | * The \PHP_CodeSniffer\Files\File object containing parsed contents of the test case file. |
@@ -33,8 +32,7 @@ discard block |
||
33 | 32 | * |
34 | 33 | * @return void |
35 | 34 | */ |
36 | - public function setUp() |
|
37 | - { |
|
35 | + public function setUp() { |
|
38 | 36 | $config = new Config(); |
39 | 37 | $config->standards = ['Generic']; |
40 | 38 | |
@@ -52,8 +50,7 @@ discard block |
||
52 | 50 | * |
53 | 51 | * @return void |
54 | 52 | */ |
55 | - public function tearDown() |
|
56 | - { |
|
53 | + public function tearDown() { |
|
57 | 54 | unset($this->phpcsFile); |
58 | 55 | |
59 | 56 | }//end tearDown() |
@@ -69,8 +66,7 @@ discard block |
||
69 | 66 | * |
70 | 67 | * @return void |
71 | 68 | */ |
72 | - public function testFindImplementedInterfaceNames($identifier, $expected) |
|
73 | - { |
|
69 | + public function testFindImplementedInterfaceNames($identifier, $expected) { |
|
74 | 70 | $start = ($this->phpcsFile->numTokens - 1); |
75 | 71 | $delim = $this->phpcsFile->findPrevious( |
76 | 72 | T_COMMENT, |
@@ -94,8 +90,7 @@ discard block |
||
94 | 90 | * |
95 | 91 | * @return array |
96 | 92 | */ |
97 | - public function dataImplementedInterface() |
|
98 | - { |
|
93 | + public function dataImplementedInterface() { |
|
99 | 94 | return [ |
100 | 95 | [ |
101 | 96 | '/* testImplementedClass */', |
@@ -45,8 +45,7 @@ discard block |
||
45 | 45 | \Foo {} |
46 | 46 | } |
47 | 47 | |
48 | -abstract class MyClass |
|
49 | -{ |
|
48 | +abstract class MyClass { |
|
50 | 49 | /* testAbstractMethod */ |
51 | 50 | abstract function myFunction(); |
52 | 51 | |
@@ -54,8 +53,7 @@ discard block |
||
54 | 53 | abstract protected function myFunction(): bool; |
55 | 54 | } |
56 | 55 | |
57 | -interface MyInterface |
|
58 | -{ |
|
56 | +interface MyInterface { |
|
59 | 57 | /* testInterfaceMethod */ |
60 | 58 | function myFunction(); |
61 | 59 | } |
@@ -14,8 +14,7 @@ discard block |
||
14 | 14 | use PHP_CodeSniffer\Files\DummyFile; |
15 | 15 | use PHPUnit\Framework\TestCase; |
16 | 16 | |
17 | -class GetMethodParametersTest extends TestCase |
|
18 | -{ |
|
17 | +class GetMethodParametersTest extends TestCase { |
|
19 | 18 | |
20 | 19 | /** |
21 | 20 | * The PHP_CodeSniffer_File object containing parsed contents of the test case file. |
@@ -33,8 +32,7 @@ discard block |
||
33 | 32 | * |
34 | 33 | * @return void |
35 | 34 | */ |
36 | - public function setUp() |
|
37 | - { |
|
35 | + public function setUp() { |
|
38 | 36 | $config = new Config(); |
39 | 37 | $config->standards = ['Generic']; |
40 | 38 | |
@@ -52,8 +50,7 @@ discard block |
||
52 | 50 | * |
53 | 51 | * @return void |
54 | 52 | */ |
55 | - public function tearDown() |
|
56 | - { |
|
53 | + public function tearDown() { |
|
57 | 54 | unset($this->phpcsFile); |
58 | 55 | |
59 | 56 | }//end tearDown() |
@@ -64,8 +61,7 @@ discard block |
||
64 | 61 | * |
65 | 62 | * @return void |
66 | 63 | */ |
67 | - public function testPassByReference() |
|
68 | - { |
|
64 | + public function testPassByReference() { |
|
69 | 65 | $expected = []; |
70 | 66 | $expected[0] = [ |
71 | 67 | 'name' => '$var', |
@@ -98,8 +94,7 @@ discard block |
||
98 | 94 | * |
99 | 95 | * @return void |
100 | 96 | */ |
101 | - public function testArrayHint() |
|
102 | - { |
|
97 | + public function testArrayHint() { |
|
103 | 98 | $expected = []; |
104 | 99 | $expected[0] = [ |
105 | 100 | 'name' => '$var', |
@@ -132,8 +127,7 @@ discard block |
||
132 | 127 | * |
133 | 128 | * @return void |
134 | 129 | */ |
135 | - public function testTypeHint() |
|
136 | - { |
|
130 | + public function testTypeHint() { |
|
137 | 131 | $expected = []; |
138 | 132 | $expected[0] = [ |
139 | 133 | 'name' => '$var1', |
@@ -177,8 +171,7 @@ discard block |
||
177 | 171 | * |
178 | 172 | * @return void |
179 | 173 | */ |
180 | - public function testSelfTypeHint() |
|
181 | - { |
|
174 | + public function testSelfTypeHint() { |
|
182 | 175 | $expected = []; |
183 | 176 | $expected[0] = [ |
184 | 177 | 'name' => '$var', |
@@ -211,8 +204,7 @@ discard block |
||
211 | 204 | * |
212 | 205 | * @return void |
213 | 206 | */ |
214 | - public function testNullableTypeHint() |
|
215 | - { |
|
207 | + public function testNullableTypeHint() { |
|
216 | 208 | $expected = []; |
217 | 209 | $expected[0] = [ |
218 | 210 | 'name' => '$var1', |
@@ -256,8 +248,7 @@ discard block |
||
256 | 248 | * |
257 | 249 | * @return void |
258 | 250 | */ |
259 | - public function testVariable() |
|
260 | - { |
|
251 | + public function testVariable() { |
|
261 | 252 | $expected = []; |
262 | 253 | $expected[0] = [ |
263 | 254 | 'name' => '$var', |
@@ -290,8 +281,7 @@ discard block |
||
290 | 281 | * |
291 | 282 | * @return void |
292 | 283 | */ |
293 | - public function testSingleDefaultValue() |
|
294 | - { |
|
284 | + public function testSingleDefaultValue() { |
|
295 | 285 | $expected = []; |
296 | 286 | $expected[0] = [ |
297 | 287 | 'name' => '$var1', |
@@ -325,8 +315,7 @@ discard block |
||
325 | 315 | * |
326 | 316 | * @return void |
327 | 317 | */ |
328 | - public function testDefaultValues() |
|
329 | - { |
|
318 | + public function testDefaultValues() { |
|
330 | 319 | $expected = []; |
331 | 320 | $expected[0] = [ |
332 | 321 | 'name' => '$var1', |
@@ -371,8 +360,7 @@ discard block |
||
371 | 360 | * |
372 | 361 | * @return void |
373 | 362 | */ |
374 | - public function testBitwiseAndConstantExpressionDefaultValue() |
|
375 | - { |
|
363 | + public function testBitwiseAndConstantExpressionDefaultValue() { |
|
376 | 364 | $expected = []; |
377 | 365 | $expected[0] = [ |
378 | 366 | 'name' => '$a', |
@@ -14,8 +14,7 @@ discard block |
||
14 | 14 | use PHP_CodeSniffer\Files\DummyFile; |
15 | 15 | use PHPUnit\Framework\TestCase; |
16 | 16 | |
17 | -class GetMethodPropertiesTest extends TestCase |
|
18 | -{ |
|
17 | +class GetMethodPropertiesTest extends TestCase { |
|
19 | 18 | |
20 | 19 | /** |
21 | 20 | * The PHP_CodeSniffer_File object containing parsed contents of the test case file. |
@@ -33,8 +32,7 @@ discard block |
||
33 | 32 | * |
34 | 33 | * @return void |
35 | 34 | */ |
36 | - public function setUp() |
|
37 | - { |
|
35 | + public function setUp() { |
|
38 | 36 | $config = new Config(); |
39 | 37 | $config->standards = ['Generic']; |
40 | 38 | |
@@ -52,8 +50,7 @@ discard block |
||
52 | 50 | * |
53 | 51 | * @return void |
54 | 52 | */ |
55 | - public function tearDown() |
|
56 | - { |
|
53 | + public function tearDown() { |
|
57 | 54 | unset($this->phpcsFile); |
58 | 55 | |
59 | 56 | }//end tearDown() |
@@ -64,8 +61,7 @@ discard block |
||
64 | 61 | * |
65 | 62 | * @return void |
66 | 63 | */ |
67 | - public function testBasicFunction() |
|
68 | - { |
|
64 | + public function testBasicFunction() { |
|
69 | 65 | $expected = [ |
70 | 66 | 'scope' => 'public', |
71 | 67 | 'scope_specified' => false, |
@@ -98,8 +94,7 @@ discard block |
||
98 | 94 | * |
99 | 95 | * @return void |
100 | 96 | */ |
101 | - public function testReturnFunction() |
|
102 | - { |
|
97 | + public function testReturnFunction() { |
|
103 | 98 | $expected = [ |
104 | 99 | 'scope' => 'public', |
105 | 100 | 'scope_specified' => false, |
@@ -132,8 +127,7 @@ discard block |
||
132 | 127 | * |
133 | 128 | * @return void |
134 | 129 | */ |
135 | - public function testNestedClosure() |
|
136 | - { |
|
130 | + public function testNestedClosure() { |
|
137 | 131 | $expected = [ |
138 | 132 | 'scope' => 'public', |
139 | 133 | 'scope_specified' => false, |
@@ -166,8 +160,7 @@ discard block |
||
166 | 160 | * |
167 | 161 | * @return void |
168 | 162 | */ |
169 | - public function testBasicMethod() |
|
170 | - { |
|
163 | + public function testBasicMethod() { |
|
171 | 164 | $expected = [ |
172 | 165 | 'scope' => 'public', |
173 | 166 | 'scope_specified' => false, |
@@ -200,8 +193,7 @@ discard block |
||
200 | 193 | * |
201 | 194 | * @return void |
202 | 195 | */ |
203 | - public function testPrivateStaticMethod() |
|
204 | - { |
|
196 | + public function testPrivateStaticMethod() { |
|
205 | 197 | $expected = [ |
206 | 198 | 'scope' => 'private', |
207 | 199 | 'scope_specified' => true, |
@@ -234,8 +226,7 @@ discard block |
||
234 | 226 | * |
235 | 227 | * @return void |
236 | 228 | */ |
237 | - public function testFinalMethod() |
|
238 | - { |
|
229 | + public function testFinalMethod() { |
|
239 | 230 | $expected = [ |
240 | 231 | 'scope' => 'public', |
241 | 232 | 'scope_specified' => true, |
@@ -268,8 +259,7 @@ discard block |
||
268 | 259 | * |
269 | 260 | * @return void |
270 | 261 | */ |
271 | - public function testProtectedReturnMethod() |
|
272 | - { |
|
262 | + public function testProtectedReturnMethod() { |
|
273 | 263 | $expected = [ |
274 | 264 | 'scope' => 'protected', |
275 | 265 | 'scope_specified' => true, |
@@ -302,8 +292,7 @@ discard block |
||
302 | 292 | * |
303 | 293 | * @return void |
304 | 294 | */ |
305 | - public function testPublicReturnMethod() |
|
306 | - { |
|
295 | + public function testPublicReturnMethod() { |
|
307 | 296 | $expected = [ |
308 | 297 | 'scope' => 'public', |
309 | 298 | 'scope_specified' => true, |
@@ -336,8 +325,7 @@ discard block |
||
336 | 325 | * |
337 | 326 | * @return void |
338 | 327 | */ |
339 | - public function testNullableReturnMethod() |
|
340 | - { |
|
328 | + public function testNullableReturnMethod() { |
|
341 | 329 | $expected = [ |
342 | 330 | 'scope' => 'public', |
343 | 331 | 'scope_specified' => true, |
@@ -370,8 +358,7 @@ discard block |
||
370 | 358 | * |
371 | 359 | * @return void |
372 | 360 | */ |
373 | - public function testMessyNullableReturnMethod() |
|
374 | - { |
|
361 | + public function testMessyNullableReturnMethod() { |
|
375 | 362 | $expected = [ |
376 | 363 | 'scope' => 'public', |
377 | 364 | 'scope_specified' => true, |
@@ -404,8 +391,7 @@ discard block |
||
404 | 391 | * |
405 | 392 | * @return void |
406 | 393 | */ |
407 | - public function testReturnNamespace() |
|
408 | - { |
|
394 | + public function testReturnNamespace() { |
|
409 | 395 | $expected = [ |
410 | 396 | 'scope' => 'public', |
411 | 397 | 'scope_specified' => false, |
@@ -438,8 +424,7 @@ discard block |
||
438 | 424 | * |
439 | 425 | * @return void |
440 | 426 | */ |
441 | - public function testReturnMultilineNamespace() |
|
442 | - { |
|
427 | + public function testReturnMultilineNamespace() { |
|
443 | 428 | $expected = [ |
444 | 429 | 'scope' => 'public', |
445 | 430 | 'scope_specified' => false, |
@@ -472,8 +457,7 @@ discard block |
||
472 | 457 | * |
473 | 458 | * @return void |
474 | 459 | */ |
475 | - public function testAbstractMethod() |
|
476 | - { |
|
460 | + public function testAbstractMethod() { |
|
477 | 461 | $expected = [ |
478 | 462 | 'scope' => 'public', |
479 | 463 | 'scope_specified' => false, |
@@ -506,8 +490,7 @@ discard block |
||
506 | 490 | * |
507 | 491 | * @return void |
508 | 492 | */ |
509 | - public function testAbstractReturnMethod() |
|
510 | - { |
|
493 | + public function testAbstractReturnMethod() { |
|
511 | 494 | $expected = [ |
512 | 495 | 'scope' => 'protected', |
513 | 496 | 'scope_specified' => true, |
@@ -540,8 +523,7 @@ discard block |
||
540 | 523 | * |
541 | 524 | * @return void |
542 | 525 | */ |
543 | - public function testInterfaceMethod() |
|
544 | - { |
|
526 | + public function testInterfaceMethod() { |
|
545 | 527 | $expected = [ |
546 | 528 | 'scope' => 'public', |
547 | 529 | 'scope_specified' => false, |
@@ -14,8 +14,7 @@ discard block |
||
14 | 14 | use PHP_CodeSniffer\Files\DummyFile; |
15 | 15 | use PHPUnit\Framework\TestCase; |
16 | 16 | |
17 | -class IsReferenceTest extends TestCase |
|
18 | -{ |
|
17 | +class IsReferenceTest extends TestCase { |
|
19 | 18 | |
20 | 19 | /** |
21 | 20 | * The PHP_CodeSniffer_File object containing parsed contents of the test case file. |
@@ -33,8 +32,7 @@ discard block |
||
33 | 32 | * |
34 | 33 | * @return void |
35 | 34 | */ |
36 | - public function setUp() |
|
37 | - { |
|
35 | + public function setUp() { |
|
38 | 36 | $config = new Config(); |
39 | 37 | $config->standards = ['Generic']; |
40 | 38 | |
@@ -52,8 +50,7 @@ discard block |
||
52 | 50 | * |
53 | 51 | * @return void |
54 | 52 | */ |
55 | - public function tearDown() |
|
56 | - { |
|
53 | + public function tearDown() { |
|
57 | 54 | unset($this->phpcsFile); |
58 | 55 | |
59 | 56 | }//end tearDown() |
@@ -69,8 +66,7 @@ discard block |
||
69 | 66 | * |
70 | 67 | * @return void |
71 | 68 | */ |
72 | - public function testIsReference($identifier, $expected) |
|
73 | - { |
|
69 | + public function testIsReference($identifier, $expected) { |
|
74 | 70 | $start = ($this->phpcsFile->numTokens - 1); |
75 | 71 | $delim = $this->phpcsFile->findPrevious( |
76 | 72 | T_COMMENT, |
@@ -94,8 +90,7 @@ discard block |
||
94 | 90 | * |
95 | 91 | * @return array |
96 | 92 | */ |
97 | - public function dataIsReference() |
|
98 | - { |
|
93 | + public function dataIsReference() { |
|
99 | 94 | return [ |
100 | 95 | [ |
101 | 96 | '/* bitwiseAndA */', |
@@ -22,8 +22,7 @@ discard block |
||
22 | 22 | require_once 'File/GetMethodPropertiesTest.php'; |
23 | 23 | require_once 'File/IsReferenceTest.php'; |
24 | 24 | |
25 | -class AllTests |
|
26 | -{ |
|
25 | +class AllTests { |
|
27 | 26 | |
28 | 27 | |
29 | 28 | /** |
@@ -31,8 +30,7 @@ discard block |
||
31 | 30 | * |
32 | 31 | * @return void |
33 | 32 | */ |
34 | - public static function main() |
|
35 | - { |
|
33 | + public static function main() { |
|
36 | 34 | TestRunner::run(self::suite()); |
37 | 35 | |
38 | 36 | }//end main() |
@@ -43,8 +41,7 @@ discard block |
||
43 | 41 | * |
44 | 42 | * @return \PHPUnit\Framework\TestSuite |
45 | 43 | */ |
46 | - public static function suite() |
|
47 | - { |
|
44 | + public static function suite() { |
|
48 | 45 | $suite = new TestSuite('PHP CodeSniffer Core'); |
49 | 46 | $suite->addTestSuite('PHP_CodeSniffer\Tests\Core\IsCamelCapsTest'); |
50 | 47 | $suite->addTestSuite('PHP_CodeSniffer\Tests\Core\ErrorSuppressionTest'); |