@@ -4,5 +4,5 @@ |
||
4 | 4 | //some code |
5 | 5 | function foo() |
6 | 6 | { |
7 | - return 'bar'; |
|
7 | + return 'bar'; |
|
8 | 8 | } |
@@ -2,5 +2,5 @@ |
||
2 | 2 | define("MAXSIZE", 100); |
3 | 3 | $defined = true; |
4 | 4 | if (defined('MINSIZE') === false) { |
5 | - $defined = false; |
|
5 | + $defined = false; |
|
6 | 6 | } |
@@ -5,7 +5,7 @@ discard block |
||
5 | 5 | const CONSTANT2 = 2; |
6 | 6 | |
7 | 7 | if ($something) { |
8 | - echo 'hi'; |
|
8 | + echo 'hi'; |
|
9 | 9 | } |
10 | 10 | |
11 | 11 | $var = myFunction(); |
@@ -16,9 +16,9 @@ discard block |
||
16 | 16 | |
17 | 17 | $c = new class extends Something{ |
18 | 18 | |
19 | - public function someMethod() |
|
20 | - { |
|
21 | - // ... |
|
22 | - } |
|
19 | + public function someMethod() |
|
20 | + { |
|
21 | + // ... |
|
22 | + } |
|
23 | 23 | |
24 | 24 | }; |
@@ -14,7 +14,7 @@ |
||
14 | 14 | echo $object -> define(); |
15 | 15 | Foo::define(); |
16 | 16 | |
17 | -$c = new class extends Something{ |
|
17 | +$c = new class extends Something { |
|
18 | 18 | |
19 | 19 | public function someMethod() |
20 | 20 | { |
@@ -4,5 +4,5 @@ |
||
4 | 4 | // phpcs:enable |
5 | 5 | $defined = true; |
6 | 6 | if (defined('MINSIZE') === false) { |
7 | - $defined = false; |
|
7 | + $defined = false; |
|
8 | 8 | } |
@@ -1,7 +1,7 @@ |
||
1 | 1 | <html> |
2 | 2 | <?php |
3 | 3 | function printHead() { |
4 | - echo '<head></head>'; |
|
4 | + echo '<head></head>'; |
|
5 | 5 | } |
6 | 6 | |
7 | 7 | printHead(); |
@@ -25,7 +25,7 @@ discard block |
||
25 | 25 | * |
26 | 26 | * @return array<int, int> |
27 | 27 | */ |
28 | - public function getErrorList($testFile='') |
|
28 | + public function getErrorList($testFile = '') |
|
29 | 29 | { |
30 | 30 | return []; |
31 | 31 | |
@@ -42,7 +42,7 @@ discard block |
||
42 | 42 | * |
43 | 43 | * @return array<int, int> |
44 | 44 | */ |
45 | - public function getWarningList($testFile='') |
|
45 | + public function getWarningList($testFile = '') |
|
46 | 46 | { |
47 | 47 | switch ($testFile) { |
48 | 48 | case 'SideEffectsUnitTest.3.inc': |
@@ -15,66 +15,66 @@ |
||
15 | 15 | { |
16 | 16 | |
17 | 17 | |
18 | - /** |
|
19 | - * Set CLI values before the file is tested. |
|
20 | - * |
|
21 | - * @param string $testFile The name of the file being tested. |
|
22 | - * @param \PHP_CodeSniffer\Config $config The config data for the test run. |
|
23 | - * |
|
24 | - * @return void |
|
25 | - */ |
|
26 | - public function setCliValues($testFile, $config) |
|
27 | - { |
|
28 | - if ($testFile === 'SideEffectsUnitTest.12.inc') { |
|
29 | - $config->annotations = false; |
|
30 | - } |
|
18 | + /** |
|
19 | + * Set CLI values before the file is tested. |
|
20 | + * |
|
21 | + * @param string $testFile The name of the file being tested. |
|
22 | + * @param \PHP_CodeSniffer\Config $config The config data for the test run. |
|
23 | + * |
|
24 | + * @return void |
|
25 | + */ |
|
26 | + public function setCliValues($testFile, $config) |
|
27 | + { |
|
28 | + if ($testFile === 'SideEffectsUnitTest.12.inc') { |
|
29 | + $config->annotations = false; |
|
30 | + } |
|
31 | 31 | |
32 | - }//end setCliValues() |
|
32 | + }//end setCliValues() |
|
33 | 33 | |
34 | 34 | |
35 | - /** |
|
36 | - * Returns the lines where errors should occur. |
|
37 | - * |
|
38 | - * The key of the array should represent the line number and the value |
|
39 | - * should represent the number of errors that should occur on that line. |
|
40 | - * |
|
41 | - * @param string $testFile The name of the file being tested. |
|
42 | - * |
|
43 | - * @return array<int, int> |
|
44 | - */ |
|
45 | - public function getErrorList($testFile='') |
|
46 | - { |
|
47 | - return []; |
|
35 | + /** |
|
36 | + * Returns the lines where errors should occur. |
|
37 | + * |
|
38 | + * The key of the array should represent the line number and the value |
|
39 | + * should represent the number of errors that should occur on that line. |
|
40 | + * |
|
41 | + * @param string $testFile The name of the file being tested. |
|
42 | + * |
|
43 | + * @return array<int, int> |
|
44 | + */ |
|
45 | + public function getErrorList($testFile='') |
|
46 | + { |
|
47 | + return []; |
|
48 | 48 | |
49 | - }//end getErrorList() |
|
49 | + }//end getErrorList() |
|
50 | 50 | |
51 | 51 | |
52 | - /** |
|
53 | - * Returns the lines where warnings should occur. |
|
54 | - * |
|
55 | - * The key of the array should represent the line number and the value |
|
56 | - * should represent the number of warnings that should occur on that line. |
|
57 | - * |
|
58 | - * @param string $testFile The name of the file being tested. |
|
59 | - * |
|
60 | - * @return array<int, int> |
|
61 | - */ |
|
62 | - public function getWarningList($testFile='') |
|
63 | - { |
|
64 | - switch ($testFile) { |
|
65 | - case 'SideEffectsUnitTest.3.inc': |
|
66 | - case 'SideEffectsUnitTest.4.inc': |
|
67 | - case 'SideEffectsUnitTest.5.inc': |
|
68 | - case 'SideEffectsUnitTest.10.inc': |
|
69 | - case 'SideEffectsUnitTest.12.inc': |
|
70 | - case 'SideEffectsUnitTest.15.inc': |
|
71 | - case 'SideEffectsUnitTest.16.inc': |
|
72 | - return [1 => 1]; |
|
73 | - default: |
|
74 | - return []; |
|
75 | - }//end switch |
|
52 | + /** |
|
53 | + * Returns the lines where warnings should occur. |
|
54 | + * |
|
55 | + * The key of the array should represent the line number and the value |
|
56 | + * should represent the number of warnings that should occur on that line. |
|
57 | + * |
|
58 | + * @param string $testFile The name of the file being tested. |
|
59 | + * |
|
60 | + * @return array<int, int> |
|
61 | + */ |
|
62 | + public function getWarningList($testFile='') |
|
63 | + { |
|
64 | + switch ($testFile) { |
|
65 | + case 'SideEffectsUnitTest.3.inc': |
|
66 | + case 'SideEffectsUnitTest.4.inc': |
|
67 | + case 'SideEffectsUnitTest.5.inc': |
|
68 | + case 'SideEffectsUnitTest.10.inc': |
|
69 | + case 'SideEffectsUnitTest.12.inc': |
|
70 | + case 'SideEffectsUnitTest.15.inc': |
|
71 | + case 'SideEffectsUnitTest.16.inc': |
|
72 | + return [1 => 1]; |
|
73 | + default: |
|
74 | + return []; |
|
75 | + }//end switch |
|
76 | 76 | |
77 | - }//end getWarningList() |
|
77 | + }//end getWarningList() |
|
78 | 78 | |
79 | 79 | |
80 | 80 | }//end class |
@@ -62,16 +62,16 @@ |
||
62 | 62 | public function getWarningList($testFile='') |
63 | 63 | { |
64 | 64 | switch ($testFile) { |
65 | - case 'SideEffectsUnitTest.3.inc': |
|
66 | - case 'SideEffectsUnitTest.4.inc': |
|
67 | - case 'SideEffectsUnitTest.5.inc': |
|
68 | - case 'SideEffectsUnitTest.10.inc': |
|
69 | - case 'SideEffectsUnitTest.12.inc': |
|
70 | - case 'SideEffectsUnitTest.15.inc': |
|
71 | - case 'SideEffectsUnitTest.16.inc': |
|
72 | - return [1 => 1]; |
|
73 | - default: |
|
74 | - return []; |
|
65 | + case 'SideEffectsUnitTest.3.inc': |
|
66 | + case 'SideEffectsUnitTest.4.inc': |
|
67 | + case 'SideEffectsUnitTest.5.inc': |
|
68 | + case 'SideEffectsUnitTest.10.inc': |
|
69 | + case 'SideEffectsUnitTest.12.inc': |
|
70 | + case 'SideEffectsUnitTest.15.inc': |
|
71 | + case 'SideEffectsUnitTest.16.inc': |
|
72 | + return [1 => 1]; |
|
73 | + default: |
|
74 | + return []; |
|
75 | 75 | }//end switch |
76 | 76 | |
77 | 77 | }//end getWarningList() |
@@ -4,7 +4,7 @@ |
||
4 | 4 | define("MAXSIZE", 100); |
5 | 5 | $defined = true; |
6 | 6 | if (defined('MINSIZE') === false) { |
7 | - $defined = false; |
|
7 | + $defined = false; |
|
8 | 8 | } |
9 | 9 | |
10 | 10 | // phpcs:enable PEAR |
@@ -33,28 +33,28 @@ |
||
33 | 33 | echo 'hi'; |
34 | 34 | } |
35 | 35 | |
36 | -if (!function_exists('YourFunction')) { |
|
36 | +if ( ! function_exists('YourFunction')) { |
|
37 | 37 | // Define a function. |
38 | 38 | function YourFunction() { |
39 | 39 | echo 'hi'; |
40 | 40 | } |
41 | 41 | } |
42 | 42 | |
43 | -if (!class_exists('MyClass')) { |
|
43 | +if ( ! class_exists('MyClass')) { |
|
44 | 44 | // Define a class. |
45 | 45 | class MyClass |
46 | 46 | { |
47 | 47 | function SomeFunction() {} |
48 | 48 | } |
49 | -} else if (!interface_exists('MyInterface')) { |
|
49 | +} else if ( ! interface_exists('MyInterface')) { |
|
50 | 50 | interface MyInterface {} |
51 | -} elseif (!interface_exists('MyInterface')) { |
|
51 | +} elseif ( ! interface_exists('MyInterface')) { |
|
52 | 52 | interface MyInterface {} |
53 | 53 | } else { |
54 | 54 | interface MyInterface {} |
55 | 55 | } |
56 | 56 | |
57 | -if (!interface_exists('MyInterface')) { |
|
57 | +if ( ! interface_exists('MyInterface')) { |
|
58 | 58 | // Define an interface. |
59 | 59 | interface MyInterface {} |
60 | 60 | } |
@@ -10,62 +10,62 @@ |
||
10 | 10 | declare(ticks=1); |
11 | 11 | |
12 | 12 | declare(ticks=1) { |
13 | - echo $i; |
|
13 | + echo $i; |
|
14 | 14 | } |
15 | 15 | |
16 | 16 | declare(ticks=1) : |
17 | - echo $i; |
|
17 | + echo $i; |
|
18 | 18 | enddeclare; |
19 | 19 | |
20 | 20 | define("MAXSIZE", 100); |
21 | 21 | if (defined('MINSIZE') === false) { |
22 | - define("MINSIZE", 10); |
|
22 | + define("MINSIZE", 10); |
|
23 | 23 | } |
24 | 24 | |
25 | 25 | // Class comment. |
26 | 26 | final class Foo |
27 | 27 | { |
28 | - public $myvar = 'foo'; |
|
28 | + public $myvar = 'foo'; |
|
29 | 29 | |
30 | - // Function comment. |
|
31 | - function Bar() { |
|
32 | - echo 'hi'; |
|
33 | - } |
|
30 | + // Function comment. |
|
31 | + function Bar() { |
|
32 | + echo 'hi'; |
|
33 | + } |
|
34 | 34 | } |
35 | 35 | |
36 | 36 | function MyFunction() { |
37 | - echo 'hi'; |
|
37 | + echo 'hi'; |
|
38 | 38 | } |
39 | 39 | |
40 | 40 | if (!function_exists('YourFunction')) { |
41 | - // Define a function. |
|
42 | - function YourFunction() { |
|
43 | - echo 'hi'; |
|
44 | - } |
|
41 | + // Define a function. |
|
42 | + function YourFunction() { |
|
43 | + echo 'hi'; |
|
44 | + } |
|
45 | 45 | } |
46 | 46 | |
47 | 47 | if (!class_exists('MyClass')) { |
48 | - // Define a class. |
|
49 | - class MyClass |
|
50 | - { |
|
51 | - function SomeFunction() {} |
|
52 | - } |
|
48 | + // Define a class. |
|
49 | + class MyClass |
|
50 | + { |
|
51 | + function SomeFunction() {} |
|
52 | + } |
|
53 | 53 | } else if (!interface_exists('MyInterface')) { |
54 | - interface MyInterface {} |
|
54 | + interface MyInterface {} |
|
55 | 55 | } elseif (!interface_exists('MyInterface')) { |
56 | - interface MyInterface {} |
|
56 | + interface MyInterface {} |
|
57 | 57 | } else { |
58 | - interface MyInterface {} |
|
58 | + interface MyInterface {} |
|
59 | 59 | } |
60 | 60 | |
61 | 61 | if (!interface_exists('MyInterface')) { |
62 | - // Define an interface. |
|
63 | - interface MyInterface {} |
|
62 | + // Define an interface. |
|
63 | + interface MyInterface {} |
|
64 | 64 | } |
65 | 65 | |
66 | 66 | #[\Attribute] |
67 | 67 | namespace { |
68 | - class A {} |
|
68 | + class A {} |
|
69 | 69 | } |
70 | 70 | |
71 | 71 | defined('APP_BASE_URL') or define('APP_BASE_URL', '/'); |
@@ -25,7 +25,7 @@ |
||
25 | 25 | * |
26 | 26 | * @return array<int, int> |
27 | 27 | */ |
28 | - public function getErrorList($testFile='') |
|
28 | + public function getErrorList($testFile = '') |
|
29 | 29 | { |
30 | 30 | if ($testFile === 'ClassDeclarationUnitTest.2.inc') { |
31 | 31 | return []; |
@@ -15,43 +15,43 @@ |
||
15 | 15 | { |
16 | 16 | |
17 | 17 | |
18 | - /** |
|
19 | - * Returns the lines where errors should occur. |
|
20 | - * |
|
21 | - * The key of the array should represent the line number and the value |
|
22 | - * should represent the number of errors that should occur on that line. |
|
23 | - * |
|
24 | - * @param string $testFile The name of the file being tested. |
|
25 | - * |
|
26 | - * @return array<int, int> |
|
27 | - */ |
|
28 | - public function getErrorList($testFile='') |
|
29 | - { |
|
30 | - if ($testFile === 'ClassDeclarationUnitTest.2.inc') { |
|
31 | - return []; |
|
32 | - } |
|
33 | - |
|
34 | - return [ |
|
35 | - 2 => 1, |
|
36 | - 3 => 2, |
|
37 | - ]; |
|
38 | - |
|
39 | - }//end getErrorList() |
|
40 | - |
|
41 | - |
|
42 | - /** |
|
43 | - * Returns the lines where warnings should occur. |
|
44 | - * |
|
45 | - * The key of the array should represent the line number and the value |
|
46 | - * should represent the number of warnings that should occur on that line. |
|
47 | - * |
|
48 | - * @return array<int, int> |
|
49 | - */ |
|
50 | - public function getWarningList() |
|
51 | - { |
|
52 | - return []; |
|
53 | - |
|
54 | - }//end getWarningList() |
|
18 | + /** |
|
19 | + * Returns the lines where errors should occur. |
|
20 | + * |
|
21 | + * The key of the array should represent the line number and the value |
|
22 | + * should represent the number of errors that should occur on that line. |
|
23 | + * |
|
24 | + * @param string $testFile The name of the file being tested. |
|
25 | + * |
|
26 | + * @return array<int, int> |
|
27 | + */ |
|
28 | + public function getErrorList($testFile='') |
|
29 | + { |
|
30 | + if ($testFile === 'ClassDeclarationUnitTest.2.inc') { |
|
31 | + return []; |
|
32 | + } |
|
33 | + |
|
34 | + return [ |
|
35 | + 2 => 1, |
|
36 | + 3 => 2, |
|
37 | + ]; |
|
38 | + |
|
39 | + }//end getErrorList() |
|
40 | + |
|
41 | + |
|
42 | + /** |
|
43 | + * Returns the lines where warnings should occur. |
|
44 | + * |
|
45 | + * The key of the array should represent the line number and the value |
|
46 | + * should represent the number of warnings that should occur on that line. |
|
47 | + * |
|
48 | + * @return array<int, int> |
|
49 | + */ |
|
50 | + public function getWarningList() |
|
51 | + { |
|
52 | + return []; |
|
53 | + |
|
54 | + }//end getWarningList() |
|
55 | 55 | |
56 | 56 | |
57 | 57 | }//end class |