@@ -15,42 +15,42 @@ |
||
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 | - * @return array<int, int> |
|
25 | - */ |
|
26 | - public function getErrorList() |
|
27 | - { |
|
28 | - return [ |
|
29 | - 8 => 1, |
|
30 | - 10 => 1, |
|
31 | - 12 => 1, |
|
32 | - 14 => 1, |
|
33 | - 19 => 1, |
|
34 | - 28 => 1, |
|
35 | - 30 => 1, |
|
36 | - ]; |
|
37 | - |
|
38 | - }//end getErrorList() |
|
39 | - |
|
40 | - |
|
41 | - /** |
|
42 | - * Returns the lines where warnings should occur. |
|
43 | - * |
|
44 | - * The key of the array should represent the line number and the value |
|
45 | - * should represent the number of warnings that should occur on that line. |
|
46 | - * |
|
47 | - * @return array<int, int> |
|
48 | - */ |
|
49 | - public function getWarningList() |
|
50 | - { |
|
51 | - return []; |
|
52 | - |
|
53 | - }//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 | + * @return array<int, int> |
|
25 | + */ |
|
26 | + public function getErrorList() |
|
27 | + { |
|
28 | + return [ |
|
29 | + 8 => 1, |
|
30 | + 10 => 1, |
|
31 | + 12 => 1, |
|
32 | + 14 => 1, |
|
33 | + 19 => 1, |
|
34 | + 28 => 1, |
|
35 | + 30 => 1, |
|
36 | + ]; |
|
37 | + |
|
38 | + }//end getErrorList() |
|
39 | + |
|
40 | + |
|
41 | + /** |
|
42 | + * Returns the lines where warnings should occur. |
|
43 | + * |
|
44 | + * The key of the array should represent the line number and the value |
|
45 | + * should represent the number of warnings that should occur on that line. |
|
46 | + * |
|
47 | + * @return array<int, int> |
|
48 | + */ |
|
49 | + public function getWarningList() |
|
50 | + { |
|
51 | + return []; |
|
52 | + |
|
53 | + }//end getWarningList() |
|
54 | 54 | |
55 | 55 | |
56 | 56 | }//end class |
@@ -11,8 +11,7 @@ discard block |
||
11 | 11 | |
12 | 12 | use PHP_CodeSniffer\Tests\Standards\AbstractSniffUnitTest; |
13 | 13 | |
14 | -class UpperCaseConstantNameUnitTest extends AbstractSniffUnitTest |
|
15 | -{ |
|
14 | +class UpperCaseConstantNameUnitTest extends AbstractSniffUnitTest { |
|
16 | 15 | |
17 | 16 | |
18 | 17 | /** |
@@ -23,8 +22,7 @@ discard block |
||
23 | 22 | * |
24 | 23 | * @return array<int, int> |
25 | 24 | */ |
26 | - public function getErrorList() |
|
27 | - { |
|
25 | + public function getErrorList() { |
|
28 | 26 | return [ |
29 | 27 | 8 => 1, |
30 | 28 | 10 => 1, |
@@ -46,8 +44,7 @@ discard block |
||
46 | 44 | * |
47 | 45 | * @return array<int, int> |
48 | 46 | */ |
49 | - public function getWarningList() |
|
50 | - { |
|
47 | + public function getWarningList() { |
|
51 | 48 | return []; |
52 | 49 | |
53 | 50 | }//end getWarningList() |
@@ -64,7 +64,7 @@ |
||
64 | 64 | */ |
65 | 65 | public function getWarningList() |
66 | 66 | { |
67 | - return []; |
|
67 | + return [ ]; |
|
68 | 68 | |
69 | 69 | }//end getWarningList() |
70 | 70 |
@@ -15,40 +15,40 @@ |
||
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 | - * @return array<int, int> |
|
25 | - */ |
|
26 | - public function getErrorList() |
|
27 | - { |
|
28 | - return [ |
|
29 | - 6 => 1, |
|
30 | - 11 => 1, |
|
31 | - 47 => 1, |
|
32 | - 62 => 1, |
|
33 | - 91 => 1, |
|
34 | - ]; |
|
35 | - |
|
36 | - }//end getErrorList() |
|
37 | - |
|
38 | - |
|
39 | - /** |
|
40 | - * Returns the lines where warnings should occur. |
|
41 | - * |
|
42 | - * The key of the array should represent the line number and the value |
|
43 | - * should represent the number of warnings that should occur on that line. |
|
44 | - * |
|
45 | - * @return array<int, int> |
|
46 | - */ |
|
47 | - public function getWarningList() |
|
48 | - { |
|
49 | - return []; |
|
50 | - |
|
51 | - }//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 | + * @return array<int, int> |
|
25 | + */ |
|
26 | + public function getErrorList() |
|
27 | + { |
|
28 | + return [ |
|
29 | + 6 => 1, |
|
30 | + 11 => 1, |
|
31 | + 47 => 1, |
|
32 | + 62 => 1, |
|
33 | + 91 => 1, |
|
34 | + ]; |
|
35 | + |
|
36 | + }//end getErrorList() |
|
37 | + |
|
38 | + |
|
39 | + /** |
|
40 | + * Returns the lines where warnings should occur. |
|
41 | + * |
|
42 | + * The key of the array should represent the line number and the value |
|
43 | + * should represent the number of warnings that should occur on that line. |
|
44 | + * |
|
45 | + * @return array<int, int> |
|
46 | + */ |
|
47 | + public function getWarningList() |
|
48 | + { |
|
49 | + return []; |
|
50 | + |
|
51 | + }//end getWarningList() |
|
52 | 52 | |
53 | 53 | |
54 | 54 | }//end class |
@@ -11,8 +11,7 @@ discard block |
||
11 | 11 | |
12 | 12 | use PHP_CodeSniffer\Tests\Standards\AbstractSniffUnitTest; |
13 | 13 | |
14 | -class ConstructorNameUnitTest extends AbstractSniffUnitTest |
|
15 | -{ |
|
14 | +class ConstructorNameUnitTest extends AbstractSniffUnitTest { |
|
16 | 15 | |
17 | 16 | |
18 | 17 | /** |
@@ -23,8 +22,7 @@ discard block |
||
23 | 22 | * |
24 | 23 | * @return array<int, int> |
25 | 24 | */ |
26 | - public function getErrorList() |
|
27 | - { |
|
25 | + public function getErrorList() { |
|
28 | 26 | return [ |
29 | 27 | 6 => 1, |
30 | 28 | 11 => 1, |
@@ -44,8 +42,7 @@ discard block |
||
44 | 42 | * |
45 | 43 | * @return array<int, int> |
46 | 44 | */ |
47 | - public function getWarningList() |
|
48 | - { |
|
45 | + public function getWarningList() { |
|
49 | 46 | return []; |
50 | 47 | |
51 | 48 | }//end getWarningList() |
@@ -64,7 +64,7 @@ |
||
64 | 64 | */ |
65 | 65 | public function getWarningList() |
66 | 66 | { |
67 | - return []; |
|
67 | + return [ ]; |
|
68 | 68 | |
69 | 69 | }//end getWarningList() |
70 | 70 |
@@ -16,8 +16,8 @@ discard block |
||
16 | 16 | class TestClass extends MyClass implements MyInterface, YourInterface |
17 | 17 | { |
18 | 18 | |
19 | - const const1 = 'hello'; |
|
20 | - const CONST2 = 'hello'; |
|
19 | + const const1 = 'hello'; |
|
20 | + const CONST2 = 'hello'; |
|
21 | 21 | } |
22 | 22 | |
23 | 23 | $foo->define('bar'); |
@@ -25,7 +25,7 @@ discard block |
||
25 | 25 | Foo::define('bar'); |
26 | 26 | |
27 | 27 | class ClassConstBowOutTest { |
28 | - const /* comment */ abc = 1; |
|
29 | - const // phpcs:ignore Standard.Category.Sniff |
|
30 | - some_constant = 2; |
|
28 | + const /* comment */ abc = 1; |
|
29 | + const // phpcs:ignore Standard.Category.Sniff |
|
30 | + some_constant = 2; |
|
31 | 31 | } |
@@ -4,14 +4,14 @@ discard block |
||
4 | 4 | namespace foo\bar; |
5 | 5 | namespace bar\foo\baz; |
6 | 6 | |
7 | -define('VALID_NAME', true); |
|
8 | -define('invalidName', true); |
|
9 | -define("VALID_NAME", true); |
|
10 | -define("invalidName", true); |
|
11 | -define('bar\foo\baz\VALID_NAME_WITH_NAMESPACE', true); |
|
12 | -define('bar\foo\baz\invalidNameWithNamespace', true); |
|
13 | -define("bar\foo\baz\VALID_NAME_WITH_NAMESPACE", true); |
|
14 | -define("bar\foo\baz\invalidNameWithNamespace", true); |
|
7 | +define( 'VALID_NAME', true ); |
|
8 | +define( 'invalidName', true ); |
|
9 | +define( "VALID_NAME", true ); |
|
10 | +define( "invalidName", true ); |
|
11 | +define( 'bar\foo\baz\VALID_NAME_WITH_NAMESPACE', true ); |
|
12 | +define( 'bar\foo\baz\invalidNameWithNamespace', true ); |
|
13 | +define( "bar\foo\baz\VALID_NAME_WITH_NAMESPACE", true ); |
|
14 | +define( "bar\foo\baz\invalidNameWithNamespace", true ); |
|
15 | 15 | |
16 | 16 | class TestClass extends MyClass implements MyInterface, YourInterface |
17 | 17 | { |
@@ -20,9 +20,9 @@ discard block |
||
20 | 20 | const CONST2 = 'hello'; |
21 | 21 | } |
22 | 22 | |
23 | -$foo->define('bar'); |
|
24 | -$foo->getBar()->define('foo'); |
|
25 | -Foo::define('bar'); |
|
23 | +$foo->define( 'bar' ); |
|
24 | +$foo->getBar()->define( 'foo' ); |
|
25 | +Foo::define( 'bar' ); |
|
26 | 26 | |
27 | 27 | class ClassConstBowOutTest { |
28 | 28 | const /* comment */ abc = 1; |
@@ -2,91 +2,91 @@ |
||
2 | 2 | class TestClass extends MyClass |
3 | 3 | { |
4 | 4 | |
5 | - function TestClass() { |
|
6 | - parent::MyClass(); |
|
7 | - parent::__construct(); |
|
8 | - } |
|
5 | + function TestClass() { |
|
6 | + parent::MyClass(); |
|
7 | + parent::__construct(); |
|
8 | + } |
|
9 | 9 | |
10 | - function __construct() { |
|
11 | - parent::MYCLASS(); |
|
12 | - parent::__construct(); |
|
13 | - } |
|
10 | + function __construct() { |
|
11 | + parent::MYCLASS(); |
|
12 | + parent::__construct(); |
|
13 | + } |
|
14 | 14 | |
15 | 15 | } |
16 | 16 | |
17 | 17 | class MyClass |
18 | 18 | { |
19 | 19 | |
20 | - function MyClass() { |
|
21 | - parent::YourClass(); |
|
22 | - parent::__construct(); |
|
23 | - } |
|
20 | + function MyClass() { |
|
21 | + parent::YourClass(); |
|
22 | + parent::__construct(); |
|
23 | + } |
|
24 | 24 | |
25 | - function __construct() { |
|
26 | - parent::YourClass(); |
|
27 | - parent::__construct(); |
|
28 | - } |
|
25 | + function __construct() { |
|
26 | + parent::YourClass(); |
|
27 | + parent::__construct(); |
|
28 | + } |
|
29 | 29 | |
30 | 30 | } |
31 | 31 | |
32 | 32 | class MyOtherClass extends \MyNamespace\SomeClass |
33 | 33 | { |
34 | - function __construct() { |
|
35 | - something::MyNamespace(); |
|
36 | - } |
|
34 | + function __construct() { |
|
35 | + something::MyNamespace(); |
|
36 | + } |
|
37 | 37 | |
38 | 38 | } |
39 | 39 | |
40 | 40 | abstract class MyAbstractClass extends \MyNamespace\SomeClass |
41 | 41 | { |
42 | - abstract public function __construct(); |
|
42 | + abstract public function __construct(); |
|
43 | 43 | } |
44 | 44 | |
45 | 45 | class OldClass |
46 | 46 | { |
47 | - function OldClass() |
|
48 | - { |
|
47 | + function OldClass() |
|
48 | + { |
|
49 | 49 | |
50 | - } |
|
50 | + } |
|
51 | 51 | } |
52 | 52 | |
53 | 53 | foo(new class extends MyClass |
54 | 54 | { |
55 | 55 | |
56 | - function TestClass() { |
|
57 | - parent::MyClass(); |
|
58 | - parent::__construct(); |
|
59 | - } |
|
56 | + function TestClass() { |
|
57 | + parent::MyClass(); |
|
58 | + parent::__construct(); |
|
59 | + } |
|
60 | 60 | |
61 | - function __construct() { |
|
62 | - parent::MyClass(); |
|
63 | - parent::__construct(); |
|
64 | - } |
|
61 | + function __construct() { |
|
62 | + parent::MyClass(); |
|
63 | + parent::__construct(); |
|
64 | + } |
|
65 | 65 | |
66 | 66 | }); |
67 | 67 | |
68 | 68 | class OlderClass |
69 | 69 | { |
70 | - function OlderClass() {} |
|
70 | + function OlderClass() {} |
|
71 | 71 | |
72 | - function __CONSTRUCT() {} |
|
72 | + function __CONSTRUCT() {} |
|
73 | 73 | } |
74 | 74 | |
75 | 75 | |
76 | 76 | // Issue #2178. |
77 | 77 | class Nested extends Another { |
78 | - public function getAnonymousClass() { |
|
79 | - return new class() extends Something { |
|
80 | - public function nested() { |
|
81 | - echo 'In method nested!'; |
|
82 | - parent::Another(); // OK. |
|
83 | - } |
|
84 | - |
|
85 | - public function __construct() { |
|
86 | - parent::Another(); // OK. |
|
78 | + public function getAnonymousClass() { |
|
79 | + return new class() extends Something { |
|
80 | + public function nested() { |
|
81 | + echo 'In method nested!'; |
|
82 | + parent::Another(); // OK. |
|
87 | 83 | } |
88 | - }; |
|
89 | - } |
|
90 | 84 | |
91 | - abstract public function nested(); |
|
85 | + public function __construct() { |
|
86 | + parent::Another(); // OK. |
|
87 | + } |
|
88 | + }; |
|
89 | + } |
|
90 | + |
|
91 | + abstract public function nested(); |
|
92 | 92 | } |
@@ -50,7 +50,7 @@ |
||
50 | 50 | } |
51 | 51 | } |
52 | 52 | |
53 | -foo(new class extends MyClass |
|
53 | +foo( new class extends MyClass |
|
54 | 54 | { |
55 | 55 | |
56 | 56 | function TestClass() { |
@@ -1,6 +1,5 @@ discard block |
||
1 | 1 | <?php |
2 | -class TestClass extends MyClass |
|
3 | -{ |
|
2 | +class TestClass extends MyClass { |
|
4 | 3 | |
5 | 4 | function TestClass() { |
6 | 5 | parent::MyClass(); |
@@ -14,8 +13,7 @@ discard block |
||
14 | 13 | |
15 | 14 | } |
16 | 15 | |
17 | -class MyClass |
|
18 | -{ |
|
16 | +class MyClass { |
|
19 | 17 | |
20 | 18 | function MyClass() { |
21 | 19 | parent::YourClass(); |
@@ -29,29 +27,24 @@ discard block |
||
29 | 27 | |
30 | 28 | } |
31 | 29 | |
32 | -class MyOtherClass extends \MyNamespace\SomeClass |
|
33 | -{ |
|
30 | +class MyOtherClass extends \MyNamespace\SomeClass { |
|
34 | 31 | function __construct() { |
35 | 32 | something::MyNamespace(); |
36 | 33 | } |
37 | 34 | |
38 | 35 | } |
39 | 36 | |
40 | -abstract class MyAbstractClass extends \MyNamespace\SomeClass |
|
41 | -{ |
|
37 | +abstract class MyAbstractClass extends \MyNamespace\SomeClass { |
|
42 | 38 | abstract public function __construct(); |
43 | 39 | } |
44 | 40 | |
45 | -class OldClass |
|
46 | -{ |
|
47 | - function OldClass() |
|
48 | - { |
|
41 | +class OldClass { |
|
42 | + function OldClass() { |
|
49 | 43 | |
50 | 44 | } |
51 | 45 | } |
52 | 46 | |
53 | -foo(new class extends MyClass |
|
54 | -{ |
|
47 | +foo(new class extends MyClass { |
|
55 | 48 | |
56 | 49 | function TestClass() { |
57 | 50 | parent::MyClass(); |
@@ -65,8 +58,7 @@ discard block |
||
65 | 58 | |
66 | 59 | }); |
67 | 60 | |
68 | -class OlderClass |
|
69 | -{ |
|
61 | +class OlderClass { |
|
70 | 62 | function OlderClass() {} |
71 | 63 | |
72 | 64 | function __CONSTRUCT() {} |
@@ -2,27 +2,27 @@ discard block |
||
2 | 2 | |
3 | 3 | abstract class My_Class { |
4 | 4 | |
5 | - public function __construct() {} |
|
6 | - public function My_Class() {} |
|
7 | - public function _My_Class() {} |
|
5 | + public function __construct() {} |
|
6 | + public function My_Class() {} |
|
7 | + public function _My_Class() {} |
|
8 | 8 | |
9 | - public function getSomeValue() {} |
|
10 | - public function parseMyDSN() {} |
|
11 | - public function get_some_value() {} |
|
12 | - public function GetSomeValue() {} |
|
13 | - public function getSomeValue_Again() {} |
|
9 | + public function getSomeValue() {} |
|
10 | + public function parseMyDSN() {} |
|
11 | + public function get_some_value() {} |
|
12 | + public function GetSomeValue() {} |
|
13 | + public function getSomeValue_Again() {} |
|
14 | 14 | |
15 | - protected function getSomeValue() {} |
|
16 | - protected function parseMyDSN() {} |
|
17 | - protected function get_some_value() {} |
|
15 | + protected function getSomeValue() {} |
|
16 | + protected function parseMyDSN() {} |
|
17 | + protected function get_some_value() {} |
|
18 | 18 | |
19 | - private function _getSomeValue() {} |
|
20 | - private function parseMyDSN() {} |
|
21 | - private function _get_some_value() {} |
|
19 | + private function _getSomeValue() {} |
|
20 | + private function parseMyDSN() {} |
|
21 | + private function _get_some_value() {} |
|
22 | 22 | |
23 | - function getSomeValue() {} |
|
24 | - function parseMyDSN() {} |
|
25 | - function get_some_value() {} |
|
23 | + function getSomeValue() {} |
|
24 | + function parseMyDSN() {} |
|
25 | + function get_some_value() {} |
|
26 | 26 | |
27 | 27 | }//end class |
28 | 28 | |
@@ -34,23 +34,23 @@ discard block |
||
34 | 34 | /* Test for magic functions */ |
35 | 35 | |
36 | 36 | class Magic_Test { |
37 | - function __construct() {} |
|
38 | - function __destruct() {} |
|
39 | - function __call($name, $args) {} |
|
40 | - static function __callStatic($name, $args) {} |
|
41 | - function __get($name) {} |
|
42 | - function __set($name, $value) {} |
|
43 | - function __isset($name) {} |
|
44 | - function __unset($name) {} |
|
45 | - function __sleep() {} |
|
46 | - function __wakeup() {} |
|
47 | - function __toString() {} |
|
48 | - function __set_state() {} |
|
49 | - function __clone() {} |
|
50 | - function __autoload() {} |
|
51 | - function __invoke() {} |
|
52 | - function __myFunction() {} |
|
53 | - function __my_function() {} |
|
37 | + function __construct() {} |
|
38 | + function __destruct() {} |
|
39 | + function __call($name, $args) {} |
|
40 | + static function __callStatic($name, $args) {} |
|
41 | + function __get($name) {} |
|
42 | + function __set($name, $value) {} |
|
43 | + function __isset($name) {} |
|
44 | + function __unset($name) {} |
|
45 | + function __sleep() {} |
|
46 | + function __wakeup() {} |
|
47 | + function __toString() {} |
|
48 | + function __set_state() {} |
|
49 | + function __clone() {} |
|
50 | + function __autoload() {} |
|
51 | + function __invoke() {} |
|
52 | + function __myFunction() {} |
|
53 | + function __my_function() {} |
|
54 | 54 | |
55 | 55 | } |
56 | 56 | |
@@ -74,94 +74,94 @@ discard block |
||
74 | 74 | |
75 | 75 | |
76 | 76 | class Closure_Test { |
77 | - function test() { |
|
78 | - $foo = function() { echo 'foo'; }; |
|
79 | - } |
|
77 | + function test() { |
|
78 | + $foo = function() { echo 'foo'; }; |
|
79 | + } |
|
80 | 80 | } |
81 | 81 | |
82 | 82 | function test() { |
83 | - $foo = function() { echo 'foo'; }; |
|
83 | + $foo = function() { echo 'foo'; }; |
|
84 | 84 | } |
85 | 85 | |
86 | 86 | /* @codingStandardsIgnoreStart */ |
87 | 87 | class MyClass |
88 | 88 | { |
89 | - /* @codingStandardsIgnoreEnd */ |
|
90 | - public function __construct() {} |
|
89 | + /* @codingStandardsIgnoreEnd */ |
|
90 | + public function __construct() {} |
|
91 | 91 | } |
92 | 92 | |
93 | 93 | trait Foo |
94 | 94 | { |
95 | - function __call($name, $args) {} |
|
95 | + function __call($name, $args) {} |
|
96 | 96 | } |
97 | 97 | |
98 | 98 | class Magic_Case_Test { |
99 | - function __Construct() {} |
|
100 | - function __isSet($name) {} |
|
101 | - function __tostring() {} |
|
99 | + function __Construct() {} |
|
100 | + function __isSet($name) {} |
|
101 | + function __tostring() {} |
|
102 | 102 | } |
103 | 103 | function __autoLoad($class) {} |
104 | 104 | |
105 | 105 | class Foo extends \SoapClient |
106 | 106 | { |
107 | - public function __soapCall( |
|
108 | - $functionName, |
|
109 | - $arguments, |
|
110 | - $options = array(), |
|
111 | - $inputHeaders = null, |
|
112 | - &$outputHeaders = array() |
|
113 | - ) { |
|
114 | - // body |
|
115 | - } |
|
107 | + public function __soapCall( |
|
108 | + $functionName, |
|
109 | + $arguments, |
|
110 | + $options = array(), |
|
111 | + $inputHeaders = null, |
|
112 | + &$outputHeaders = array() |
|
113 | + ) { |
|
114 | + // body |
|
115 | + } |
|
116 | 116 | } |
117 | 117 | |
118 | 118 | function __debugInfo() {} |
119 | 119 | class Foo { |
120 | - function __debugInfo() {} |
|
120 | + function __debugInfo() {} |
|
121 | 121 | } |
122 | 122 | |
123 | 123 | function ___tripleUnderscore() {} // Ok. |
124 | 124 | |
125 | 125 | class triple { |
126 | - public function ___tripleUnderscore() {} // Ok. |
|
126 | + public function ___tripleUnderscore() {} // Ok. |
|
127 | 127 | } |
128 | 128 | |
129 | 129 | /* Magic methods in anonymous classes. */ |
130 | 130 | $a = new class { |
131 | - function __construct() {} |
|
132 | - function __destruct() {} |
|
133 | - function __call($name, $args) {} |
|
134 | - static function __callStatic($name, $args) {} |
|
135 | - function __get($name) {} |
|
136 | - function __set($name, $value) {} |
|
137 | - function __isset($name) {} |
|
138 | - function __unset($name) {} |
|
139 | - function __sleep() {} |
|
140 | - function __wakeup() {} |
|
141 | - function __toString() {} |
|
142 | - function __set_state() {} |
|
143 | - function __clone() {} |
|
144 | - function __autoload() {} |
|
145 | - function __invoke() {} |
|
146 | - function __myFunction() {} |
|
147 | - function __my_function() {} |
|
131 | + function __construct() {} |
|
132 | + function __destruct() {} |
|
133 | + function __call($name, $args) {} |
|
134 | + static function __callStatic($name, $args) {} |
|
135 | + function __get($name) {} |
|
136 | + function __set($name, $value) {} |
|
137 | + function __isset($name) {} |
|
138 | + function __unset($name) {} |
|
139 | + function __sleep() {} |
|
140 | + function __wakeup() {} |
|
141 | + function __toString() {} |
|
142 | + function __set_state() {} |
|
143 | + function __clone() {} |
|
144 | + function __autoload() {} |
|
145 | + function __invoke() {} |
|
146 | + function __myFunction() {} |
|
147 | + function __my_function() {} |
|
148 | 148 | |
149 | 149 | }; |
150 | 150 | |
151 | 151 | class FooBar extends \SoapClient { |
152 | - public function __getCookies() {} |
|
152 | + public function __getCookies() {} |
|
153 | 153 | } |
154 | 154 | |
155 | 155 | class Nested { |
156 | - public function getAnonymousClass() { |
|
157 | - return new class() { |
|
158 | - public function nested_function() {} |
|
159 | - function __something() {} |
|
160 | - }; |
|
161 | - } |
|
156 | + public function getAnonymousClass() { |
|
157 | + return new class() { |
|
158 | + public function nested_function() {} |
|
159 | + function __something() {} |
|
160 | + }; |
|
161 | + } |
|
162 | 162 | } |
163 | 163 | |
164 | 164 | abstract class My_Class { |
165 | - public function my_class() {} |
|
166 | - public function _MY_CLASS() {} |
|
165 | + public function my_class() {} |
|
166 | + public function _MY_CLASS() {} |
|
167 | 167 | } |
@@ -36,12 +36,12 @@ discard block |
||
36 | 36 | class Magic_Test { |
37 | 37 | function __construct() {} |
38 | 38 | function __destruct() {} |
39 | - function __call($name, $args) {} |
|
40 | - static function __callStatic($name, $args) {} |
|
41 | - function __get($name) {} |
|
42 | - function __set($name, $value) {} |
|
43 | - function __isset($name) {} |
|
44 | - function __unset($name) {} |
|
39 | + function __call( $name, $args ) {} |
|
40 | + static function __callStatic( $name, $args ) {} |
|
41 | + function __get( $name ) {} |
|
42 | + function __set( $name, $value ) {} |
|
43 | + function __isset( $name ) {} |
|
44 | + function __unset( $name ) {} |
|
45 | 45 | function __sleep() {} |
46 | 46 | function __wakeup() {} |
47 | 47 | function __toString() {} |
@@ -67,7 +67,7 @@ discard block |
||
67 | 67 | function __toString() {} |
68 | 68 | function __set_state() {} |
69 | 69 | function __clone() {} |
70 | -function __autoload($class) {} |
|
70 | +function __autoload( $class ) {} |
|
71 | 71 | function __invoke() {} |
72 | 72 | function __myFunction() {} |
73 | 73 | function __my_function() {} |
@@ -92,15 +92,15 @@ discard block |
||
92 | 92 | |
93 | 93 | trait Foo |
94 | 94 | { |
95 | - function __call($name, $args) {} |
|
95 | + function __call( $name, $args ) {} |
|
96 | 96 | } |
97 | 97 | |
98 | 98 | class Magic_Case_Test { |
99 | 99 | function __Construct() {} |
100 | - function __isSet($name) {} |
|
100 | + function __isSet( $name ) {} |
|
101 | 101 | function __tostring() {} |
102 | 102 | } |
103 | -function __autoLoad($class) {} |
|
103 | +function __autoLoad( $class ) {} |
|
104 | 104 | |
105 | 105 | class Foo extends \SoapClient |
106 | 106 | { |
@@ -130,12 +130,12 @@ discard block |
||
130 | 130 | $a = new class { |
131 | 131 | function __construct() {} |
132 | 132 | function __destruct() {} |
133 | - function __call($name, $args) {} |
|
134 | - static function __callStatic($name, $args) {} |
|
135 | - function __get($name) {} |
|
136 | - function __set($name, $value) {} |
|
137 | - function __isset($name) {} |
|
138 | - function __unset($name) {} |
|
133 | + function __call( $name, $args ) {} |
|
134 | + static function __callStatic( $name, $args ) {} |
|
135 | + function __get( $name ) {} |
|
136 | + function __set( $name, $value ) {} |
|
137 | + function __isset( $name ) {} |
|
138 | + function __unset( $name ) {} |
|
139 | 139 | function __sleep() {} |
140 | 140 | function __wakeup() {} |
141 | 141 | function __toString() {} |
@@ -84,14 +84,12 @@ discard block |
||
84 | 84 | } |
85 | 85 | |
86 | 86 | /* @codingStandardsIgnoreStart */ |
87 | -class MyClass |
|
88 | -{ |
|
87 | +class MyClass { |
|
89 | 88 | /* @codingStandardsIgnoreEnd */ |
90 | 89 | public function __construct() {} |
91 | 90 | } |
92 | 91 | |
93 | -trait Foo |
|
94 | -{ |
|
92 | +trait Foo { |
|
95 | 93 | function __call($name, $args) {} |
96 | 94 | } |
97 | 95 | |
@@ -102,8 +100,7 @@ discard block |
||
102 | 100 | } |
103 | 101 | function __autoLoad($class) {} |
104 | 102 | |
105 | -class Foo extends \SoapClient |
|
106 | -{ |
|
103 | +class Foo extends \SoapClient { |
|
107 | 104 | public function __soapCall( |
108 | 105 | $functionName, |
109 | 106 | $arguments, |
@@ -15,74 +15,74 @@ |
||
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 | - * @return array<int, int> |
|
25 | - */ |
|
26 | - public function getErrorList() |
|
27 | - { |
|
28 | - $errors = [ |
|
29 | - 10 => 1, |
|
30 | - 11 => 1, |
|
31 | - 12 => 1, |
|
32 | - 13 => 1, |
|
33 | - 16 => 1, |
|
34 | - 17 => 1, |
|
35 | - 20 => 1, |
|
36 | - 21 => 1, |
|
37 | - 24 => 1, |
|
38 | - 25 => 1, |
|
39 | - 30 => 1, |
|
40 | - 31 => 1, |
|
41 | - 50 => 1, |
|
42 | - 52 => 1, |
|
43 | - 53 => 2, |
|
44 | - 57 => 1, |
|
45 | - 58 => 1, |
|
46 | - 59 => 1, |
|
47 | - 60 => 1, |
|
48 | - 61 => 1, |
|
49 | - 62 => 1, |
|
50 | - 63 => 1, |
|
51 | - 64 => 1, |
|
52 | - 65 => 1, |
|
53 | - 66 => 1, |
|
54 | - 67 => 1, |
|
55 | - 68 => 2, |
|
56 | - 69 => 1, |
|
57 | - 71 => 1, |
|
58 | - 72 => 1, |
|
59 | - 73 => 2, |
|
60 | - 118 => 1, |
|
61 | - 144 => 1, |
|
62 | - 146 => 1, |
|
63 | - 147 => 2, |
|
64 | - 158 => 1, |
|
65 | - 159 => 1, |
|
66 | - ]; |
|
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 | + * @return array<int, int> |
|
25 | + */ |
|
26 | + public function getErrorList() |
|
27 | + { |
|
28 | + $errors = [ |
|
29 | + 10 => 1, |
|
30 | + 11 => 1, |
|
31 | + 12 => 1, |
|
32 | + 13 => 1, |
|
33 | + 16 => 1, |
|
34 | + 17 => 1, |
|
35 | + 20 => 1, |
|
36 | + 21 => 1, |
|
37 | + 24 => 1, |
|
38 | + 25 => 1, |
|
39 | + 30 => 1, |
|
40 | + 31 => 1, |
|
41 | + 50 => 1, |
|
42 | + 52 => 1, |
|
43 | + 53 => 2, |
|
44 | + 57 => 1, |
|
45 | + 58 => 1, |
|
46 | + 59 => 1, |
|
47 | + 60 => 1, |
|
48 | + 61 => 1, |
|
49 | + 62 => 1, |
|
50 | + 63 => 1, |
|
51 | + 64 => 1, |
|
52 | + 65 => 1, |
|
53 | + 66 => 1, |
|
54 | + 67 => 1, |
|
55 | + 68 => 2, |
|
56 | + 69 => 1, |
|
57 | + 71 => 1, |
|
58 | + 72 => 1, |
|
59 | + 73 => 2, |
|
60 | + 118 => 1, |
|
61 | + 144 => 1, |
|
62 | + 146 => 1, |
|
63 | + 147 => 2, |
|
64 | + 158 => 1, |
|
65 | + 159 => 1, |
|
66 | + ]; |
|
67 | 67 | |
68 | - return $errors; |
|
68 | + return $errors; |
|
69 | 69 | |
70 | - }//end getErrorList() |
|
70 | + }//end getErrorList() |
|
71 | 71 | |
72 | 72 | |
73 | - /** |
|
74 | - * Returns the lines where warnings should occur. |
|
75 | - * |
|
76 | - * The key of the array should represent the line number and the value |
|
77 | - * should represent the number of warnings that should occur on that line. |
|
78 | - * |
|
79 | - * @return array<int, int> |
|
80 | - */ |
|
81 | - public function getWarningList() |
|
82 | - { |
|
83 | - return []; |
|
73 | + /** |
|
74 | + * Returns the lines where warnings should occur. |
|
75 | + * |
|
76 | + * The key of the array should represent the line number and the value |
|
77 | + * should represent the number of warnings that should occur on that line. |
|
78 | + * |
|
79 | + * @return array<int, int> |
|
80 | + */ |
|
81 | + public function getWarningList() |
|
82 | + { |
|
83 | + return []; |
|
84 | 84 | |
85 | - }//end getWarningList() |
|
85 | + }//end getWarningList() |
|
86 | 86 | |
87 | 87 | |
88 | 88 | }//end class |
@@ -11,8 +11,7 @@ discard block |
||
11 | 11 | |
12 | 12 | use PHP_CodeSniffer\Tests\Standards\AbstractSniffUnitTest; |
13 | 13 | |
14 | -class CamelCapsFunctionNameUnitTest extends AbstractSniffUnitTest |
|
15 | -{ |
|
14 | +class CamelCapsFunctionNameUnitTest extends AbstractSniffUnitTest { |
|
16 | 15 | |
17 | 16 | |
18 | 17 | /** |
@@ -23,8 +22,7 @@ discard block |
||
23 | 22 | * |
24 | 23 | * @return array<int, int> |
25 | 24 | */ |
26 | - public function getErrorList() |
|
27 | - { |
|
25 | + public function getErrorList() { |
|
28 | 26 | $errors = [ |
29 | 27 | 10 => 1, |
30 | 28 | 11 => 1, |
@@ -78,8 +76,7 @@ discard block |
||
78 | 76 | * |
79 | 77 | * @return array<int, int> |
80 | 78 | */ |
81 | - public function getWarningList() |
|
82 | - { |
|
79 | + public function getWarningList() { |
|
83 | 80 | return []; |
84 | 81 | |
85 | 82 | }//end getWarningList() |
@@ -64,7 +64,7 @@ |
||
64 | 64 | */ |
65 | 65 | public function getWarningList() |
66 | 66 | { |
67 | - return []; |
|
67 | + return [ ]; |
|
68 | 68 | |
69 | 69 | }//end getWarningList() |
70 | 70 |
@@ -16,55 +16,55 @@ |
||
16 | 16 | { |
17 | 17 | |
18 | 18 | |
19 | - /** |
|
20 | - * Should this test be skipped for some reason. |
|
21 | - * |
|
22 | - * @return void |
|
23 | - */ |
|
24 | - protected function shouldSkipTest() |
|
25 | - { |
|
26 | - $csslintPath = Config::getExecutablePath('csslint'); |
|
27 | - if ($csslintPath === null) { |
|
28 | - return true; |
|
29 | - } |
|
19 | + /** |
|
20 | + * Should this test be skipped for some reason. |
|
21 | + * |
|
22 | + * @return void |
|
23 | + */ |
|
24 | + protected function shouldSkipTest() |
|
25 | + { |
|
26 | + $csslintPath = Config::getExecutablePath('csslint'); |
|
27 | + if ($csslintPath === null) { |
|
28 | + return true; |
|
29 | + } |
|
30 | 30 | |
31 | - return false; |
|
31 | + return false; |
|
32 | 32 | |
33 | - }//end shouldSkipTest() |
|
33 | + }//end shouldSkipTest() |
|
34 | 34 | |
35 | 35 | |
36 | - /** |
|
37 | - * Returns the lines where errors should occur. |
|
38 | - * |
|
39 | - * The key of the array should represent the line number and the value |
|
40 | - * should represent the number of errors that should occur on that line. |
|
41 | - * |
|
42 | - * @return array<int, int> |
|
43 | - */ |
|
44 | - public function getErrorList() |
|
45 | - { |
|
46 | - return []; |
|
36 | + /** |
|
37 | + * Returns the lines where errors should occur. |
|
38 | + * |
|
39 | + * The key of the array should represent the line number and the value |
|
40 | + * should represent the number of errors that should occur on that line. |
|
41 | + * |
|
42 | + * @return array<int, int> |
|
43 | + */ |
|
44 | + public function getErrorList() |
|
45 | + { |
|
46 | + return []; |
|
47 | 47 | |
48 | - }//end getErrorList() |
|
48 | + }//end getErrorList() |
|
49 | 49 | |
50 | 50 | |
51 | - /** |
|
52 | - * Returns the lines where warnings should occur. |
|
53 | - * |
|
54 | - * The key of the array should represent the line number and the value |
|
55 | - * should represent the number of warnings that should occur on that line. |
|
56 | - * |
|
57 | - * @return array<int, int> |
|
58 | - */ |
|
59 | - public function getWarningList() |
|
60 | - { |
|
61 | - return [ |
|
62 | - 3 => 1, |
|
63 | - 4 => 1, |
|
64 | - 5 => 1, |
|
65 | - ]; |
|
51 | + /** |
|
52 | + * Returns the lines where warnings should occur. |
|
53 | + * |
|
54 | + * The key of the array should represent the line number and the value |
|
55 | + * should represent the number of warnings that should occur on that line. |
|
56 | + * |
|
57 | + * @return array<int, int> |
|
58 | + */ |
|
59 | + public function getWarningList() |
|
60 | + { |
|
61 | + return [ |
|
62 | + 3 => 1, |
|
63 | + 4 => 1, |
|
64 | + 5 => 1, |
|
65 | + ]; |
|
66 | 66 | |
67 | - }//end getWarningList() |
|
67 | + }//end getWarningList() |
|
68 | 68 | |
69 | 69 | |
70 | 70 | }//end class |
@@ -23,8 +23,8 @@ discard block |
||
23 | 23 | */ |
24 | 24 | protected function shouldSkipTest() |
25 | 25 | { |
26 | - $csslintPath = Config::getExecutablePath('csslint'); |
|
27 | - if ($csslintPath === null) { |
|
26 | + $csslintPath = Config::getExecutablePath( 'csslint' ); |
|
27 | + if ( $csslintPath === null ) { |
|
28 | 28 | return true; |
29 | 29 | } |
30 | 30 | |
@@ -43,7 +43,7 @@ discard block |
||
43 | 43 | */ |
44 | 44 | public function getErrorList() |
45 | 45 | { |
46 | - return []; |
|
46 | + return [ ]; |
|
47 | 47 | |
48 | 48 | }//end getErrorList() |
49 | 49 |
@@ -12,8 +12,7 @@ discard block |
||
12 | 12 | use PHP_CodeSniffer\Tests\Standards\AbstractSniffUnitTest; |
13 | 13 | use PHP_CodeSniffer\Config; |
14 | 14 | |
15 | -class CSSLintUnitTest extends AbstractSniffUnitTest |
|
16 | -{ |
|
15 | +class CSSLintUnitTest extends AbstractSniffUnitTest { |
|
17 | 16 | |
18 | 17 | |
19 | 18 | /** |
@@ -21,8 +20,7 @@ discard block |
||
21 | 20 | * |
22 | 21 | * @return void |
23 | 22 | */ |
24 | - protected function shouldSkipTest() |
|
25 | - { |
|
23 | + protected function shouldSkipTest() { |
|
26 | 24 | $csslintPath = Config::getExecutablePath('csslint'); |
27 | 25 | if ($csslintPath === null) { |
28 | 26 | return true; |
@@ -41,8 +39,7 @@ discard block |
||
41 | 39 | * |
42 | 40 | * @return array<int, int> |
43 | 41 | */ |
44 | - public function getErrorList() |
|
45 | - { |
|
42 | + public function getErrorList() { |
|
46 | 43 | return []; |
47 | 44 | |
48 | 45 | }//end getErrorList() |
@@ -56,8 +53,7 @@ discard block |
||
56 | 53 | * |
57 | 54 | * @return array<int, int> |
58 | 55 | */ |
59 | - public function getWarningList() |
|
60 | - { |
|
56 | + public function getWarningList() { |
|
61 | 57 | return [ |
62 | 58 | 3 => 1, |
63 | 59 | 4 => 1, |
@@ -19,7 +19,7 @@ |
||
19 | 19 | /** |
20 | 20 | * Should this test be skipped for some reason. |
21 | 21 | * |
22 | - * @return void |
|
22 | + * @return boolean |
|
23 | 23 | */ |
24 | 24 | protected function shouldSkipTest() |
25 | 25 | { |
@@ -16,52 +16,52 @@ |
||
16 | 16 | { |
17 | 17 | |
18 | 18 | |
19 | - /** |
|
20 | - * Should this test be skipped for some reason. |
|
21 | - * |
|
22 | - * @return void |
|
23 | - */ |
|
24 | - protected function shouldSkipTest() |
|
25 | - { |
|
26 | - $rhinoPath = Config::getExecutablePath('rhino'); |
|
27 | - $jshintPath = Config::getExecutablePath('jshint'); |
|
28 | - if ($rhinoPath === null && $jshintPath === null) { |
|
29 | - return true; |
|
30 | - } |
|
19 | + /** |
|
20 | + * Should this test be skipped for some reason. |
|
21 | + * |
|
22 | + * @return void |
|
23 | + */ |
|
24 | + protected function shouldSkipTest() |
|
25 | + { |
|
26 | + $rhinoPath = Config::getExecutablePath('rhino'); |
|
27 | + $jshintPath = Config::getExecutablePath('jshint'); |
|
28 | + if ($rhinoPath === null && $jshintPath === null) { |
|
29 | + return true; |
|
30 | + } |
|
31 | 31 | |
32 | - return false; |
|
32 | + return false; |
|
33 | 33 | |
34 | - }//end shouldSkipTest() |
|
34 | + }//end shouldSkipTest() |
|
35 | 35 | |
36 | 36 | |
37 | - /** |
|
38 | - * Returns the lines where errors should occur. |
|
39 | - * |
|
40 | - * The key of the array should represent the line number and the value |
|
41 | - * should represent the number of errors that should occur on that line. |
|
42 | - * |
|
43 | - * @return array<int, int> |
|
44 | - */ |
|
45 | - public function getErrorList() |
|
46 | - { |
|
47 | - return []; |
|
37 | + /** |
|
38 | + * Returns the lines where errors should occur. |
|
39 | + * |
|
40 | + * The key of the array should represent the line number and the value |
|
41 | + * should represent the number of errors that should occur on that line. |
|
42 | + * |
|
43 | + * @return array<int, int> |
|
44 | + */ |
|
45 | + public function getErrorList() |
|
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 | - * @return array<int, int> |
|
59 | - */ |
|
60 | - public function getWarningList() |
|
61 | - { |
|
62 | - return [3 => 2]; |
|
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 | + * @return array<int, int> |
|
59 | + */ |
|
60 | + public function getWarningList() |
|
61 | + { |
|
62 | + return [3 => 2]; |
|
63 | 63 | |
64 | - }//end getWarningList() |
|
64 | + }//end getWarningList() |
|
65 | 65 | |
66 | 66 | |
67 | 67 | }//end class |
@@ -23,9 +23,9 @@ discard block |
||
23 | 23 | */ |
24 | 24 | protected function shouldSkipTest() |
25 | 25 | { |
26 | - $rhinoPath = Config::getExecutablePath('rhino'); |
|
27 | - $jshintPath = Config::getExecutablePath('jshint'); |
|
28 | - if ($rhinoPath === null && $jshintPath === null) { |
|
26 | + $rhinoPath = Config::getExecutablePath( 'rhino' ); |
|
27 | + $jshintPath = Config::getExecutablePath( 'jshint' ); |
|
28 | + if ( $rhinoPath === null && $jshintPath === null ) { |
|
29 | 29 | return true; |
30 | 30 | } |
31 | 31 | |
@@ -44,7 +44,7 @@ discard block |
||
44 | 44 | */ |
45 | 45 | public function getErrorList() |
46 | 46 | { |
47 | - return []; |
|
47 | + return [ ]; |
|
48 | 48 | |
49 | 49 | }//end getErrorList() |
50 | 50 | |
@@ -59,7 +59,7 @@ discard block |
||
59 | 59 | */ |
60 | 60 | public function getWarningList() |
61 | 61 | { |
62 | - return [3 => 2]; |
|
62 | + return [ 3 => 2 ]; |
|
63 | 63 | |
64 | 64 | }//end getWarningList() |
65 | 65 |
@@ -12,8 +12,7 @@ discard block |
||
12 | 12 | use PHP_CodeSniffer\Tests\Standards\AbstractSniffUnitTest; |
13 | 13 | use PHP_CodeSniffer\Config; |
14 | 14 | |
15 | -class JSHintUnitTest extends AbstractSniffUnitTest |
|
16 | -{ |
|
15 | +class JSHintUnitTest extends AbstractSniffUnitTest { |
|
17 | 16 | |
18 | 17 | |
19 | 18 | /** |
@@ -21,8 +20,7 @@ discard block |
||
21 | 20 | * |
22 | 21 | * @return void |
23 | 22 | */ |
24 | - protected function shouldSkipTest() |
|
25 | - { |
|
23 | + protected function shouldSkipTest() { |
|
26 | 24 | $rhinoPath = Config::getExecutablePath('rhino'); |
27 | 25 | $jshintPath = Config::getExecutablePath('jshint'); |
28 | 26 | if ($rhinoPath === null && $jshintPath === null) { |
@@ -42,8 +40,7 @@ discard block |
||
42 | 40 | * |
43 | 41 | * @return array<int, int> |
44 | 42 | */ |
45 | - public function getErrorList() |
|
46 | - { |
|
43 | + public function getErrorList() { |
|
47 | 44 | return []; |
48 | 45 | |
49 | 46 | }//end getErrorList() |
@@ -57,8 +54,7 @@ discard block |
||
57 | 54 | * |
58 | 55 | * @return array<int, int> |
59 | 56 | */ |
60 | - public function getWarningList() |
|
61 | - { |
|
57 | + public function getWarningList() { |
|
62 | 58 | return [3 => 2]; |
63 | 59 | |
64 | 60 | }//end getWarningList() |
@@ -19,7 +19,7 @@ |
||
19 | 19 | /** |
20 | 20 | * Should this test be skipped for some reason. |
21 | 21 | * |
22 | - * @return void |
|
22 | + * @return boolean |
|
23 | 23 | */ |
24 | 24 | protected function shouldSkipTest() |
25 | 25 | { |
@@ -15,12 +15,12 @@ discard block |
||
15 | 15 | class ESLintUnitTest extends AbstractSniffUnitTest |
16 | 16 | { |
17 | 17 | |
18 | - /** |
|
19 | - * Basic ESLint config to use for testing the sniff. |
|
20 | - * |
|
21 | - * @var string |
|
22 | - */ |
|
23 | - const ESLINT_CONFIG = '{ |
|
18 | + /** |
|
19 | + * Basic ESLint config to use for testing the sniff. |
|
20 | + * |
|
21 | + * @var string |
|
22 | + */ |
|
23 | + const ESLINT_CONFIG = '{ |
|
24 | 24 | "parserOptions": { |
25 | 25 | "ecmaVersion": 5, |
26 | 26 | "sourceType": "script", |
@@ -33,81 +33,81 @@ discard block |
||
33 | 33 | }'; |
34 | 34 | |
35 | 35 | |
36 | - /** |
|
37 | - * Sets up this unit test. |
|
38 | - * |
|
39 | - * @return void |
|
40 | - */ |
|
41 | - protected function setUp() |
|
42 | - { |
|
43 | - parent::setUp(); |
|
44 | - |
|
45 | - $cwd = getcwd(); |
|
46 | - file_put_contents($cwd.'/.eslintrc.json', self::ESLINT_CONFIG); |
|
47 | - |
|
48 | - }//end setUp() |
|
49 | - |
|
50 | - |
|
51 | - /** |
|
52 | - * Remove artifact. |
|
53 | - * |
|
54 | - * @return void |
|
55 | - */ |
|
56 | - protected function tearDown() |
|
57 | - { |
|
58 | - parent::tearDown(); |
|
59 | - |
|
60 | - $cwd = getcwd(); |
|
61 | - unlink($cwd.'/.eslintrc.json'); |
|
62 | - |
|
63 | - }//end tearDown() |
|
64 | - |
|
65 | - |
|
66 | - /** |
|
67 | - * Should this test be skipped for some reason. |
|
68 | - * |
|
69 | - * @return void |
|
70 | - */ |
|
71 | - protected function shouldSkipTest() |
|
72 | - { |
|
73 | - $eslintPath = Config::getExecutablePath('eslint'); |
|
74 | - if ($eslintPath === null) { |
|
75 | - return true; |
|
76 | - } |
|
77 | - |
|
78 | - return false; |
|
79 | - |
|
80 | - }//end shouldSkipTest() |
|
81 | - |
|
82 | - |
|
83 | - /** |
|
84 | - * Returns the lines where errors should occur. |
|
85 | - * |
|
86 | - * The key of the array should represent the line number and the value |
|
87 | - * should represent the number of errors that should occur on that line. |
|
88 | - * |
|
89 | - * @return array<int, int> |
|
90 | - */ |
|
91 | - public function getErrorList() |
|
92 | - { |
|
93 | - return [1 => 2]; |
|
94 | - |
|
95 | - }//end getErrorList() |
|
96 | - |
|
97 | - |
|
98 | - /** |
|
99 | - * Returns the lines where warnings should occur. |
|
100 | - * |
|
101 | - * The key of the array should represent the line number and the value |
|
102 | - * should represent the number of warnings that should occur on that line. |
|
103 | - * |
|
104 | - * @return array<int, int> |
|
105 | - */ |
|
106 | - public function getWarningList() |
|
107 | - { |
|
108 | - return []; |
|
109 | - |
|
110 | - }//end getWarningList() |
|
36 | + /** |
|
37 | + * Sets up this unit test. |
|
38 | + * |
|
39 | + * @return void |
|
40 | + */ |
|
41 | + protected function setUp() |
|
42 | + { |
|
43 | + parent::setUp(); |
|
44 | + |
|
45 | + $cwd = getcwd(); |
|
46 | + file_put_contents($cwd.'/.eslintrc.json', self::ESLINT_CONFIG); |
|
47 | + |
|
48 | + }//end setUp() |
|
49 | + |
|
50 | + |
|
51 | + /** |
|
52 | + * Remove artifact. |
|
53 | + * |
|
54 | + * @return void |
|
55 | + */ |
|
56 | + protected function tearDown() |
|
57 | + { |
|
58 | + parent::tearDown(); |
|
59 | + |
|
60 | + $cwd = getcwd(); |
|
61 | + unlink($cwd.'/.eslintrc.json'); |
|
62 | + |
|
63 | + }//end tearDown() |
|
64 | + |
|
65 | + |
|
66 | + /** |
|
67 | + * Should this test be skipped for some reason. |
|
68 | + * |
|
69 | + * @return void |
|
70 | + */ |
|
71 | + protected function shouldSkipTest() |
|
72 | + { |
|
73 | + $eslintPath = Config::getExecutablePath('eslint'); |
|
74 | + if ($eslintPath === null) { |
|
75 | + return true; |
|
76 | + } |
|
77 | + |
|
78 | + return false; |
|
79 | + |
|
80 | + }//end shouldSkipTest() |
|
81 | + |
|
82 | + |
|
83 | + /** |
|
84 | + * Returns the lines where errors should occur. |
|
85 | + * |
|
86 | + * The key of the array should represent the line number and the value |
|
87 | + * should represent the number of errors that should occur on that line. |
|
88 | + * |
|
89 | + * @return array<int, int> |
|
90 | + */ |
|
91 | + public function getErrorList() |
|
92 | + { |
|
93 | + return [1 => 2]; |
|
94 | + |
|
95 | + }//end getErrorList() |
|
96 | + |
|
97 | + |
|
98 | + /** |
|
99 | + * Returns the lines where warnings should occur. |
|
100 | + * |
|
101 | + * The key of the array should represent the line number and the value |
|
102 | + * should represent the number of warnings that should occur on that line. |
|
103 | + * |
|
104 | + * @return array<int, int> |
|
105 | + */ |
|
106 | + public function getWarningList() |
|
107 | + { |
|
108 | + return []; |
|
109 | + |
|
110 | + }//end getWarningList() |
|
111 | 111 | |
112 | 112 | |
113 | 113 | }//end class |
@@ -43,7 +43,7 @@ discard block |
||
43 | 43 | parent::setUp(); |
44 | 44 | |
45 | 45 | $cwd = getcwd(); |
46 | - file_put_contents($cwd.'/.eslintrc.json', self::ESLINT_CONFIG); |
|
46 | + file_put_contents( $cwd . '/.eslintrc.json', self::ESLINT_CONFIG ); |
|
47 | 47 | |
48 | 48 | }//end setUp() |
49 | 49 | |
@@ -58,7 +58,7 @@ discard block |
||
58 | 58 | parent::tearDown(); |
59 | 59 | |
60 | 60 | $cwd = getcwd(); |
61 | - unlink($cwd.'/.eslintrc.json'); |
|
61 | + unlink( $cwd . '/.eslintrc.json' ); |
|
62 | 62 | |
63 | 63 | }//end tearDown() |
64 | 64 | |
@@ -70,8 +70,8 @@ discard block |
||
70 | 70 | */ |
71 | 71 | protected function shouldSkipTest() |
72 | 72 | { |
73 | - $eslintPath = Config::getExecutablePath('eslint'); |
|
74 | - if ($eslintPath === null) { |
|
73 | + $eslintPath = Config::getExecutablePath( 'eslint' ); |
|
74 | + if ( $eslintPath === null ) { |
|
75 | 75 | return true; |
76 | 76 | } |
77 | 77 | |
@@ -90,7 +90,7 @@ discard block |
||
90 | 90 | */ |
91 | 91 | public function getErrorList() |
92 | 92 | { |
93 | - return [1 => 2]; |
|
93 | + return [ 1 => 2 ]; |
|
94 | 94 | |
95 | 95 | }//end getErrorList() |
96 | 96 | |
@@ -105,7 +105,7 @@ discard block |
||
105 | 105 | */ |
106 | 106 | public function getWarningList() |
107 | 107 | { |
108 | - return []; |
|
108 | + return [ ]; |
|
109 | 109 | |
110 | 110 | }//end getWarningList() |
111 | 111 |
@@ -12,8 +12,7 @@ discard block |
||
12 | 12 | use PHP_CodeSniffer\Tests\Standards\AbstractSniffUnitTest; |
13 | 13 | use PHP_CodeSniffer\Config; |
14 | 14 | |
15 | -class ESLintUnitTest extends AbstractSniffUnitTest |
|
16 | -{ |
|
15 | +class ESLintUnitTest extends AbstractSniffUnitTest { |
|
17 | 16 | |
18 | 17 | /** |
19 | 18 | * Basic ESLint config to use for testing the sniff. |
@@ -38,8 +37,7 @@ discard block |
||
38 | 37 | * |
39 | 38 | * @return void |
40 | 39 | */ |
41 | - protected function setUp() |
|
42 | - { |
|
40 | + protected function setUp() { |
|
43 | 41 | parent::setUp(); |
44 | 42 | |
45 | 43 | $cwd = getcwd(); |
@@ -53,8 +51,7 @@ discard block |
||
53 | 51 | * |
54 | 52 | * @return void |
55 | 53 | */ |
56 | - protected function tearDown() |
|
57 | - { |
|
54 | + protected function tearDown() { |
|
58 | 55 | parent::tearDown(); |
59 | 56 | |
60 | 57 | $cwd = getcwd(); |
@@ -68,8 +65,7 @@ discard block |
||
68 | 65 | * |
69 | 66 | * @return void |
70 | 67 | */ |
71 | - protected function shouldSkipTest() |
|
72 | - { |
|
68 | + protected function shouldSkipTest() { |
|
73 | 69 | $eslintPath = Config::getExecutablePath('eslint'); |
74 | 70 | if ($eslintPath === null) { |
75 | 71 | return true; |
@@ -88,8 +84,7 @@ discard block |
||
88 | 84 | * |
89 | 85 | * @return array<int, int> |
90 | 86 | */ |
91 | - public function getErrorList() |
|
92 | - { |
|
87 | + public function getErrorList() { |
|
93 | 88 | return [1 => 2]; |
94 | 89 | |
95 | 90 | }//end getErrorList() |
@@ -103,8 +98,7 @@ discard block |
||
103 | 98 | * |
104 | 99 | * @return array<int, int> |
105 | 100 | */ |
106 | - public function getWarningList() |
|
107 | - { |
|
101 | + public function getWarningList() { |
|
108 | 102 | return []; |
109 | 103 | |
110 | 104 | }//end getWarningList() |
@@ -19,7 +19,7 @@ |
||
19 | 19 | /** |
20 | 20 | * Should this test be skipped for some reason. |
21 | 21 | * |
22 | - * @return void |
|
22 | + * @return boolean |
|
23 | 23 | */ |
24 | 24 | protected function shouldSkipTest() |
25 | 25 | { |