@@ -61,10 +61,10 @@ discard block |
||
61 | 61 | use Something\True; |
62 | 62 | class MyClass |
63 | 63 | { |
64 | - public function myFunction() |
|
65 | - { |
|
66 | - $var = array('foo' => new True()); |
|
67 | - } |
|
64 | + public function myFunction() |
|
65 | + { |
|
66 | + $var = array('foo' => new True()); |
|
67 | + } |
|
68 | 68 | } |
69 | 69 | |
70 | 70 | $x = $f?false:TRUE; |
@@ -72,8 +72,8 @@ discard block |
||
72 | 72 | |
73 | 73 | class MyClass |
74 | 74 | { |
75 | - // Spice things up a little. |
|
76 | - const true = FALSE; |
|
75 | + // Spice things up a little. |
|
76 | + const true = FALSE; |
|
77 | 77 | } |
78 | 78 | |
79 | 79 | var_dump(MyClass::true); |
@@ -1,51 +1,51 @@ discard block |
||
1 | 1 | <?php |
2 | 2 | |
3 | 3 | // True |
4 | -function myFunction($arg1, $arg2=TRUE) |
|
4 | +function myFunction( $arg1, $arg2 = TRUE ) |
|
5 | 5 | { |
6 | 6 | } |
7 | -function myFunction($arg1, $arg2=true) |
|
7 | +function myFunction( $arg1, $arg2 = true ) |
|
8 | 8 | { |
9 | 9 | } |
10 | -function myFunction($arg1, $arg2=True) |
|
10 | +function myFunction( $arg1, $arg2 = True ) |
|
11 | 11 | { |
12 | 12 | } |
13 | 13 | |
14 | -if ($variable === TRUE) { } |
|
15 | -if ($variable === true) { } |
|
16 | -if ($variable === True) { } |
|
14 | +if ( $variable === TRUE ) { } |
|
15 | +if ( $variable === true ) { } |
|
16 | +if ( $variable === True ) { } |
|
17 | 17 | |
18 | 18 | |
19 | 19 | // False |
20 | -function myFunction($arg1, $arg2=FALSE) |
|
20 | +function myFunction( $arg1, $arg2 = FALSE ) |
|
21 | 21 | { |
22 | 22 | } |
23 | -function myFunction($arg1, $arg2=false) |
|
23 | +function myFunction( $arg1, $arg2 = false ) |
|
24 | 24 | { |
25 | 25 | } |
26 | -function myFunction($arg1, $arg2=False) |
|
26 | +function myFunction( $arg1, $arg2 = False ) |
|
27 | 27 | { |
28 | 28 | } |
29 | 29 | |
30 | -if ($variable === FALSE) { } |
|
31 | -if ($variable === false) { } |
|
32 | -if ($variable === False) { } |
|
30 | +if ( $variable === FALSE ) { } |
|
31 | +if ( $variable === false ) { } |
|
32 | +if ( $variable === False ) { } |
|
33 | 33 | |
34 | 34 | |
35 | 35 | // Null |
36 | -function myFunction($arg1, $arg2=NULL) |
|
36 | +function myFunction( $arg1, $arg2 = NULL ) |
|
37 | 37 | { |
38 | 38 | } |
39 | -function myFunction($arg1, $arg2=null) |
|
39 | +function myFunction( $arg1, $arg2 = null ) |
|
40 | 40 | { |
41 | 41 | } |
42 | -function myFunction($arg1, $arg2=Null) |
|
42 | +function myFunction( $arg1, $arg2 = Null ) |
|
43 | 43 | { |
44 | 44 | } |
45 | 45 | |
46 | -if ($variable === NULL) { } |
|
47 | -if ($variable === null) { } |
|
48 | -if ($variable === Null) { } |
|
46 | +if ( $variable === NULL ) { } |
|
47 | +if ( $variable === null ) { } |
|
48 | +if ( $variable === Null ) { } |
|
49 | 49 | |
50 | 50 | $x = new stdClass(); |
51 | 51 | $x->null = 7; |
@@ -63,12 +63,12 @@ discard block |
||
63 | 63 | { |
64 | 64 | public function myFunction() |
65 | 65 | { |
66 | - $var = array('foo' => new True()); |
|
66 | + $var = array( 'foo' => new True() ); |
|
67 | 67 | } |
68 | 68 | } |
69 | 69 | |
70 | -$x = $f?false:TRUE; |
|
71 | -$x = $f? false:TRUE; |
|
70 | +$x = $f ?false:TRUE; |
|
71 | +$x = $f ? false:TRUE; |
|
72 | 72 | |
73 | 73 | class MyClass |
74 | 74 | { |
@@ -76,6 +76,6 @@ discard block |
||
76 | 76 | const true = FALSE; |
77 | 77 | } |
78 | 78 | |
79 | -var_dump(MyClass::true); |
|
79 | +var_dump( MyClass::true ); |
|
80 | 80 | |
81 | 81 | function true() {} |
82 | 82 | \ No newline at end of file |
@@ -1,14 +1,11 @@ discard block |
||
1 | 1 | <?php |
2 | 2 | |
3 | 3 | // True |
4 | -function myFunction($arg1, $arg2=TRUE) |
|
5 | -{ |
|
4 | +function myFunction($arg1, $arg2=TRUE) { |
|
6 | 5 | } |
7 | -function myFunction($arg1, $arg2=true) |
|
8 | -{ |
|
6 | +function myFunction($arg1, $arg2=true) { |
|
9 | 7 | } |
10 | -function myFunction($arg1, $arg2=True) |
|
11 | -{ |
|
8 | +function myFunction($arg1, $arg2=True) { |
|
12 | 9 | } |
13 | 10 | |
14 | 11 | if ($variable === TRUE) { } |
@@ -17,14 +14,11 @@ discard block |
||
17 | 14 | |
18 | 15 | |
19 | 16 | // False |
20 | -function myFunction($arg1, $arg2=FALSE) |
|
21 | -{ |
|
17 | +function myFunction($arg1, $arg2=FALSE) { |
|
22 | 18 | } |
23 | -function myFunction($arg1, $arg2=false) |
|
24 | -{ |
|
19 | +function myFunction($arg1, $arg2=false) { |
|
25 | 20 | } |
26 | -function myFunction($arg1, $arg2=False) |
|
27 | -{ |
|
21 | +function myFunction($arg1, $arg2=False) { |
|
28 | 22 | } |
29 | 23 | |
30 | 24 | if ($variable === FALSE) { } |
@@ -33,14 +27,11 @@ discard block |
||
33 | 27 | |
34 | 28 | |
35 | 29 | // Null |
36 | -function myFunction($arg1, $arg2=NULL) |
|
37 | -{ |
|
30 | +function myFunction($arg1, $arg2=NULL) { |
|
38 | 31 | } |
39 | -function myFunction($arg1, $arg2=null) |
|
40 | -{ |
|
32 | +function myFunction($arg1, $arg2=null) { |
|
41 | 33 | } |
42 | -function myFunction($arg1, $arg2=Null) |
|
43 | -{ |
|
34 | +function myFunction($arg1, $arg2=Null) { |
|
44 | 35 | } |
45 | 36 | |
46 | 37 | if ($variable === NULL) { } |
@@ -59,10 +50,8 @@ discard block |
||
59 | 50 | |
60 | 51 | use True\Something; |
61 | 52 | use Something\True; |
62 | -class MyClass |
|
63 | -{ |
|
64 | - public function myFunction() |
|
65 | - { |
|
53 | +class MyClass { |
|
54 | + public function myFunction() { |
|
66 | 55 | $var = array('foo' => new True()); |
67 | 56 | } |
68 | 57 | } |
@@ -70,8 +59,7 @@ discard block |
||
70 | 59 | $x = $f?false:TRUE; |
71 | 60 | $x = $f? false:TRUE; |
72 | 61 | |
73 | -class MyClass |
|
74 | -{ |
|
62 | +class MyClass { |
|
75 | 63 | // Spice things up a little. |
76 | 64 | const true = FALSE; |
77 | 65 | } |
@@ -29,19 +29,19 @@ |
||
29 | 29 | $foo = function (bool $a, callable $b) use ($foo) : Bar {}; |
30 | 30 | |
31 | 31 | class Testing { |
32 | - public function TestThis(SELF $a, obJect $b, Parent $c) : VOID {} |
|
32 | + public function TestThis(SELF $a, obJect $b, Parent $c) : VOID {} |
|
33 | 33 | } |
34 | 34 | |
35 | 35 | function foo( |
36 | - ?Float $a, |
|
37 | - ? String $b, |
|
38 | - ?ITERABLE $c, |
|
39 | - ? Object $d, |
|
40 | - ?Foo\Bar $e |
|
36 | + ?Float $a, |
|
37 | + ? String $b, |
|
38 | + ?ITERABLE $c, |
|
39 | + ? Object $d, |
|
40 | + ?Foo\Bar $e |
|
41 | 41 | ) : ?Foo\Bar {} |
42 | 42 | |
43 | 43 | $foo = function (?Int $a, ? Callable $b) |
44 | - :?INT{}; |
|
44 | + :?INT{}; |
|
45 | 45 | |
46 | 46 | $var = (BInARY) $string; |
47 | 47 | $var = (binary)$string; |
@@ -1,35 +1,35 @@ discard block |
||
1 | 1 | <?php |
2 | -$foo = (int) $bar; |
|
3 | -$foo = (integer) $bar; |
|
4 | -$foo = (bool) $bar; |
|
5 | -$foo = (boolean) $bar; |
|
6 | -$foo = (float) $bar; |
|
7 | -$foo = (double) $bar; |
|
8 | -$foo = (real) $bar; |
|
9 | -$foo = (string) $bar; |
|
10 | -$foo = (array) $bar; |
|
11 | -$foo = (object) $bar; |
|
12 | -$foo = (unset) $bar; |
|
2 | +$foo = (int)$bar; |
|
3 | +$foo = (integer)$bar; |
|
4 | +$foo = (bool)$bar; |
|
5 | +$foo = (boolean)$bar; |
|
6 | +$foo = (float)$bar; |
|
7 | +$foo = (double)$bar; |
|
8 | +$foo = (real)$bar; |
|
9 | +$foo = (string)$bar; |
|
10 | +$foo = (array)$bar; |
|
11 | +$foo = (object)$bar; |
|
12 | +$foo = (unset)$bar; |
|
13 | 13 | |
14 | -$foo = (Int) $bar; |
|
15 | -$foo = (INTEGER) $bar; |
|
16 | -$foo = (BOOL) $bar; |
|
17 | -$foo = (String) $bar; |
|
18 | -$foo = (Array) $bar; |
|
14 | +$foo = (Int)$bar; |
|
15 | +$foo = (INTEGER)$bar; |
|
16 | +$foo = (BOOL)$bar; |
|
17 | +$foo = (String)$bar; |
|
18 | +$foo = (Array)$bar; |
|
19 | 19 | |
20 | -function foo(int $a, string $b, bool $c, array $d, Foo\Bar $e) : int {} |
|
21 | -function foo(Int $a, String $b, BOOL $c, Array $d, Foo\Bar $e) : Foo\Bar {} |
|
22 | -function foo(Int $a, Bar $b, BOOL $c, Array $d, Foo\Bar $e) : Bar {} |
|
23 | -function foo(callable $a, Callable $b, self $c, Iterable $d, iterable $e) : Float {} |
|
20 | +function foo( int $a, string $b, bool $c, array $d, Foo\Bar $e ) : int {} |
|
21 | +function foo( Int $a, String $b, BOOL $c, Array $d, Foo\Bar $e ) : Foo\Bar {} |
|
22 | +function foo( Int $a, Bar $b, BOOL $c, Array $d, Foo\Bar $e ) : Bar {} |
|
23 | +function foo( callable $a, Callable $b, self $c, Iterable $d, iterable $e ) : Float {} |
|
24 | 24 | |
25 | -$foo = function (int $a, Bool $b) {}; |
|
26 | -$foo = function (int $a, Callable $b) :INT{}; |
|
27 | -$foo = function (BOOL $a, float $b) use ($foo) : INT {}; |
|
28 | -$foo = function (Foo $a, Foo\Bar $b) use ($foo) : \Foo\Bar {}; |
|
29 | -$foo = function (bool $a, callable $b) use ($foo) : Bar {}; |
|
25 | +$foo = function( int $a, Bool $b ) {}; |
|
26 | +$foo = function( int $a, Callable $b ) :INT{}; |
|
27 | +$foo = function( BOOL $a, float $b ) use ( $foo ) : INT {}; |
|
28 | +$foo = function( Foo $a, Foo\Bar $b ) use ( $foo ) : \Foo\Bar {}; |
|
29 | +$foo = function( bool $a, callable $b ) use ( $foo ) : Bar {}; |
|
30 | 30 | |
31 | 31 | class Testing { |
32 | - public function TestThis(SELF $a, obJect $b, Parent $c) : VOID {} |
|
32 | + public function TestThis( SELF $a, obJect $b, Parent $c ) : VOID {} |
|
33 | 33 | } |
34 | 34 | |
35 | 35 | function foo( |
@@ -40,8 +40,8 @@ discard block |
||
40 | 40 | ?Foo\Bar $e |
41 | 41 | ) : ?Foo\Bar {} |
42 | 42 | |
43 | -$foo = function (?Int $a, ? Callable $b) |
|
44 | - :?INT{}; |
|
43 | +$foo = function( ?Int $a, ? Callable $b ) |
|
44 | + : ?INT{}; |
|
45 | 45 | |
46 | -$var = (BInARY) $string; |
|
46 | +$var = (BInARY)$string; |
|
47 | 47 | $var = (binary)$string; |
@@ -18,12 +18,12 @@ discard block |
||
18 | 18 | $foo = (Array) $bar; |
19 | 19 | |
20 | 20 | function foo(int $a, string $b, bool $c, array $d, Foo\Bar $e) : int {} |
21 | -function foo(Int $a, String $b, BOOL $c, Array $d, Foo\Bar $e) : Foo\Bar {} |
|
22 | -function foo(Int $a, Bar $b, BOOL $c, Array $d, Foo\Bar $e) : Bar {} |
|
23 | -function foo(callable $a, Callable $b, self $c, Iterable $d, iterable $e) : Float {} |
|
21 | +function foo(Int $a, String $b, BOOL $c, array $d, Foo\Bar $e) : Foo\Bar {} |
|
22 | +function foo(Int $a, Bar $b, BOOL $c, array $d, Foo\Bar $e) : Bar {} |
|
23 | +function foo(callable $a, callable $b, self $c, Iterable $d, iterable $e) : Float {} |
|
24 | 24 | |
25 | 25 | $foo = function (int $a, Bool $b) {}; |
26 | -$foo = function (int $a, Callable $b) :INT{}; |
|
26 | +$foo = function (int $a, callable $b) :INT{}; |
|
27 | 27 | $foo = function (BOOL $a, float $b) use ($foo) : INT {}; |
28 | 28 | $foo = function (Foo $a, Foo\Bar $b) use ($foo) : \Foo\Bar {}; |
29 | 29 | $foo = function (bool $a, callable $b) use ($foo) : Bar {}; |
@@ -40,7 +40,7 @@ discard block |
||
40 | 40 | ?Foo\Bar $e |
41 | 41 | ) : ?Foo\Bar {} |
42 | 42 | |
43 | -$foo = function (?Int $a, ? Callable $b) |
|
43 | +$foo = function (?Int $a, ? callable $b) |
|
44 | 44 | :?INT{}; |
45 | 45 | |
46 | 46 | $var = (BInARY) $string; |
@@ -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 | - switch ($testFile) { |
|
31 | - case 'CharacterBeforePHPOpeningTagUnitTest.1.inc': |
|
32 | - return [2 => 1]; |
|
33 | - break; |
|
34 | - default: |
|
35 | - return []; |
|
36 | - break; |
|
37 | - }//end switch |
|
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 | + switch ($testFile) { |
|
31 | + case 'CharacterBeforePHPOpeningTagUnitTest.1.inc': |
|
32 | + return [2 => 1]; |
|
33 | + break; |
|
34 | + default: |
|
35 | + return []; |
|
36 | + break; |
|
37 | + }//end switch |
|
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 |
@@ -28,12 +28,12 @@ |
||
28 | 28 | public function getErrorList($testFile='') |
29 | 29 | { |
30 | 30 | switch ($testFile) { |
31 | - case 'CharacterBeforePHPOpeningTagUnitTest.1.inc': |
|
32 | - return [2 => 1]; |
|
33 | - break; |
|
34 | - default: |
|
35 | - return []; |
|
36 | - break; |
|
31 | + case 'CharacterBeforePHPOpeningTagUnitTest.1.inc': |
|
32 | + return [2 => 1]; |
|
33 | + break; |
|
34 | + default: |
|
35 | + return []; |
|
36 | + break; |
|
37 | 37 | }//end switch |
38 | 38 | |
39 | 39 | }//end getErrorList() |
@@ -25,14 +25,14 @@ 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 | - switch ($testFile) { |
|
30 | + switch ( $testFile ) { |
|
31 | 31 | case 'CharacterBeforePHPOpeningTagUnitTest.1.inc': |
32 | - return [2 => 1]; |
|
32 | + return [ 2 => 1 ]; |
|
33 | 33 | break; |
34 | 34 | default: |
35 | - return []; |
|
35 | + return [ ]; |
|
36 | 36 | break; |
37 | 37 | }//end switch |
38 | 38 | |
@@ -49,7 +49,7 @@ discard block |
||
49 | 49 | */ |
50 | 50 | public function getWarningList() |
51 | 51 | { |
52 | - return []; |
|
52 | + return [ ]; |
|
53 | 53 | |
54 | 54 | }//end getWarningList() |
55 | 55 |
@@ -11,8 +11,7 @@ discard block |
||
11 | 11 | |
12 | 12 | use PHP_CodeSniffer\Tests\Standards\AbstractSniffUnitTest; |
13 | 13 | |
14 | -class CharacterBeforePHPOpeningTagUnitTest extends AbstractSniffUnitTest |
|
15 | -{ |
|
14 | +class CharacterBeforePHPOpeningTagUnitTest extends AbstractSniffUnitTest { |
|
16 | 15 | |
17 | 16 | |
18 | 17 | /** |
@@ -25,8 +24,7 @@ discard block |
||
25 | 24 | * |
26 | 25 | * @return array<int, int> |
27 | 26 | */ |
28 | - public function getErrorList($testFile='') |
|
29 | - { |
|
27 | + public function getErrorList($testFile='') { |
|
30 | 28 | switch ($testFile) { |
31 | 29 | case 'CharacterBeforePHPOpeningTagUnitTest.1.inc': |
32 | 30 | return [2 => 1]; |
@@ -47,8 +45,7 @@ discard block |
||
47 | 45 | * |
48 | 46 | * @return array<int, int> |
49 | 47 | */ |
50 | - public function getWarningList() |
|
51 | - { |
|
48 | + public function getWarningList() { |
|
52 | 49 | return []; |
53 | 50 | |
54 | 51 | }//end getWarningList() |
@@ -15,70 +15,70 @@ |
||
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='LowerCaseConstantUnitTest.inc') |
|
29 | - { |
|
30 | - switch ($testFile) { |
|
31 | - case 'LowerCaseConstantUnitTest.inc': |
|
32 | - return [ |
|
33 | - 7 => 1, |
|
34 | - 10 => 1, |
|
35 | - 15 => 1, |
|
36 | - 16 => 1, |
|
37 | - 23 => 1, |
|
38 | - 26 => 1, |
|
39 | - 31 => 1, |
|
40 | - 32 => 1, |
|
41 | - 39 => 1, |
|
42 | - 42 => 1, |
|
43 | - 47 => 1, |
|
44 | - 48 => 1, |
|
45 | - 70 => 1, |
|
46 | - 71 => 1, |
|
47 | - ]; |
|
48 | - break; |
|
49 | - case 'LowerCaseConstantUnitTest.js': |
|
50 | - return [ |
|
51 | - 2 => 1, |
|
52 | - 3 => 1, |
|
53 | - 4 => 1, |
|
54 | - 7 => 1, |
|
55 | - 8 => 1, |
|
56 | - 12 => 1, |
|
57 | - 13 => 1, |
|
58 | - 14 => 1, |
|
59 | - ]; |
|
60 | - break; |
|
61 | - default: |
|
62 | - return []; |
|
63 | - break; |
|
64 | - }//end switch |
|
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='LowerCaseConstantUnitTest.inc') |
|
29 | + { |
|
30 | + switch ($testFile) { |
|
31 | + case 'LowerCaseConstantUnitTest.inc': |
|
32 | + return [ |
|
33 | + 7 => 1, |
|
34 | + 10 => 1, |
|
35 | + 15 => 1, |
|
36 | + 16 => 1, |
|
37 | + 23 => 1, |
|
38 | + 26 => 1, |
|
39 | + 31 => 1, |
|
40 | + 32 => 1, |
|
41 | + 39 => 1, |
|
42 | + 42 => 1, |
|
43 | + 47 => 1, |
|
44 | + 48 => 1, |
|
45 | + 70 => 1, |
|
46 | + 71 => 1, |
|
47 | + ]; |
|
48 | + break; |
|
49 | + case 'LowerCaseConstantUnitTest.js': |
|
50 | + return [ |
|
51 | + 2 => 1, |
|
52 | + 3 => 1, |
|
53 | + 4 => 1, |
|
54 | + 7 => 1, |
|
55 | + 8 => 1, |
|
56 | + 12 => 1, |
|
57 | + 13 => 1, |
|
58 | + 14 => 1, |
|
59 | + ]; |
|
60 | + break; |
|
61 | + default: |
|
62 | + return []; |
|
63 | + break; |
|
64 | + }//end switch |
|
65 | 65 | |
66 | - }//end getErrorList() |
|
66 | + }//end getErrorList() |
|
67 | 67 | |
68 | 68 | |
69 | - /** |
|
70 | - * Returns the lines where warnings should occur. |
|
71 | - * |
|
72 | - * The key of the array should represent the line number and the value |
|
73 | - * should represent the number of warnings that should occur on that line. |
|
74 | - * |
|
75 | - * @return array<int, int> |
|
76 | - */ |
|
77 | - public function getWarningList() |
|
78 | - { |
|
79 | - return []; |
|
69 | + /** |
|
70 | + * Returns the lines where warnings should occur. |
|
71 | + * |
|
72 | + * The key of the array should represent the line number and the value |
|
73 | + * should represent the number of warnings that should occur on that line. |
|
74 | + * |
|
75 | + * @return array<int, int> |
|
76 | + */ |
|
77 | + public function getWarningList() |
|
78 | + { |
|
79 | + return []; |
|
80 | 80 | |
81 | - }//end getWarningList() |
|
81 | + }//end getWarningList() |
|
82 | 82 | |
83 | 83 | |
84 | 84 | }//end class |
@@ -28,39 +28,39 @@ |
||
28 | 28 | public function getErrorList($testFile='LowerCaseConstantUnitTest.inc') |
29 | 29 | { |
30 | 30 | switch ($testFile) { |
31 | - case 'LowerCaseConstantUnitTest.inc': |
|
32 | - return [ |
|
33 | - 7 => 1, |
|
34 | - 10 => 1, |
|
35 | - 15 => 1, |
|
36 | - 16 => 1, |
|
37 | - 23 => 1, |
|
38 | - 26 => 1, |
|
39 | - 31 => 1, |
|
40 | - 32 => 1, |
|
41 | - 39 => 1, |
|
42 | - 42 => 1, |
|
43 | - 47 => 1, |
|
44 | - 48 => 1, |
|
45 | - 70 => 1, |
|
46 | - 71 => 1, |
|
47 | - ]; |
|
48 | - break; |
|
49 | - case 'LowerCaseConstantUnitTest.js': |
|
50 | - return [ |
|
51 | - 2 => 1, |
|
52 | - 3 => 1, |
|
53 | - 4 => 1, |
|
54 | - 7 => 1, |
|
55 | - 8 => 1, |
|
56 | - 12 => 1, |
|
57 | - 13 => 1, |
|
58 | - 14 => 1, |
|
59 | - ]; |
|
60 | - break; |
|
61 | - default: |
|
62 | - return []; |
|
63 | - break; |
|
31 | + case 'LowerCaseConstantUnitTest.inc': |
|
32 | + return [ |
|
33 | + 7 => 1, |
|
34 | + 10 => 1, |
|
35 | + 15 => 1, |
|
36 | + 16 => 1, |
|
37 | + 23 => 1, |
|
38 | + 26 => 1, |
|
39 | + 31 => 1, |
|
40 | + 32 => 1, |
|
41 | + 39 => 1, |
|
42 | + 42 => 1, |
|
43 | + 47 => 1, |
|
44 | + 48 => 1, |
|
45 | + 70 => 1, |
|
46 | + 71 => 1, |
|
47 | + ]; |
|
48 | + break; |
|
49 | + case 'LowerCaseConstantUnitTest.js': |
|
50 | + return [ |
|
51 | + 2 => 1, |
|
52 | + 3 => 1, |
|
53 | + 4 => 1, |
|
54 | + 7 => 1, |
|
55 | + 8 => 1, |
|
56 | + 12 => 1, |
|
57 | + 13 => 1, |
|
58 | + 14 => 1, |
|
59 | + ]; |
|
60 | + break; |
|
61 | + default: |
|
62 | + return []; |
|
63 | + break; |
|
64 | 64 | }//end switch |
65 | 65 | |
66 | 66 | }//end getErrorList() |
@@ -25,9 +25,9 @@ discard block |
||
25 | 25 | * |
26 | 26 | * @return array<int, int> |
27 | 27 | */ |
28 | - public function getErrorList($testFile='LowerCaseConstantUnitTest.inc') |
|
28 | + public function getErrorList( $testFile = 'LowerCaseConstantUnitTest.inc' ) |
|
29 | 29 | { |
30 | - switch ($testFile) { |
|
30 | + switch ( $testFile ) { |
|
31 | 31 | case 'LowerCaseConstantUnitTest.inc': |
32 | 32 | return [ |
33 | 33 | 7 => 1, |
@@ -59,7 +59,7 @@ discard block |
||
59 | 59 | ]; |
60 | 60 | break; |
61 | 61 | default: |
62 | - return []; |
|
62 | + return [ ]; |
|
63 | 63 | break; |
64 | 64 | }//end switch |
65 | 65 | |
@@ -76,7 +76,7 @@ discard block |
||
76 | 76 | */ |
77 | 77 | public function getWarningList() |
78 | 78 | { |
79 | - return []; |
|
79 | + return [ ]; |
|
80 | 80 | |
81 | 81 | }//end getWarningList() |
82 | 82 |
@@ -11,8 +11,7 @@ discard block |
||
11 | 11 | |
12 | 12 | use PHP_CodeSniffer\Tests\Standards\AbstractSniffUnitTest; |
13 | 13 | |
14 | -class LowerCaseConstantUnitTest extends AbstractSniffUnitTest |
|
15 | -{ |
|
14 | +class LowerCaseConstantUnitTest extends AbstractSniffUnitTest { |
|
16 | 15 | |
17 | 16 | |
18 | 17 | /** |
@@ -25,8 +24,7 @@ discard block |
||
25 | 24 | * |
26 | 25 | * @return array<int, int> |
27 | 26 | */ |
28 | - public function getErrorList($testFile='LowerCaseConstantUnitTest.inc') |
|
29 | - { |
|
27 | + public function getErrorList($testFile='LowerCaseConstantUnitTest.inc') { |
|
30 | 28 | switch ($testFile) { |
31 | 29 | case 'LowerCaseConstantUnitTest.inc': |
32 | 30 | return [ |
@@ -74,8 +72,7 @@ discard block |
||
74 | 72 | * |
75 | 73 | * @return array<int, int> |
76 | 74 | */ |
77 | - public function getWarningList() |
|
78 | - { |
|
75 | + public function getWarningList() { |
|
79 | 76 | return []; |
80 | 77 | |
81 | 78 | }//end getWarningList() |
@@ -15,34 +15,34 @@ |
||
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 [9 => 1]; |
|
29 | - |
|
30 | - }//end getErrorList() |
|
31 | - |
|
32 | - |
|
33 | - /** |
|
34 | - * Returns the lines where warnings should occur. |
|
35 | - * |
|
36 | - * The key of the array should represent the line number and the value |
|
37 | - * should represent the number of warnings that should occur on that line. |
|
38 | - * |
|
39 | - * @return array<int, int> |
|
40 | - */ |
|
41 | - public function getWarningList() |
|
42 | - { |
|
43 | - return []; |
|
44 | - |
|
45 | - }//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 [9 => 1]; |
|
29 | + |
|
30 | + }//end getErrorList() |
|
31 | + |
|
32 | + |
|
33 | + /** |
|
34 | + * Returns the lines where warnings should occur. |
|
35 | + * |
|
36 | + * The key of the array should represent the line number and the value |
|
37 | + * should represent the number of warnings that should occur on that line. |
|
38 | + * |
|
39 | + * @return array<int, int> |
|
40 | + */ |
|
41 | + public function getWarningList() |
|
42 | + { |
|
43 | + return []; |
|
44 | + |
|
45 | + }//end getWarningList() |
|
46 | 46 | |
47 | 47 | |
48 | 48 | }//end class |
@@ -25,7 +25,7 @@ discard block |
||
25 | 25 | */ |
26 | 26 | public function getErrorList() |
27 | 27 | { |
28 | - return [9 => 1]; |
|
28 | + return [ 9 => 1 ]; |
|
29 | 29 | |
30 | 30 | }//end getErrorList() |
31 | 31 | |
@@ -40,7 +40,7 @@ discard block |
||
40 | 40 | */ |
41 | 41 | public function getWarningList() |
42 | 42 | { |
43 | - return []; |
|
43 | + return [ ]; |
|
44 | 44 | |
45 | 45 | }//end getWarningList() |
46 | 46 |
@@ -11,8 +11,7 @@ discard block |
||
11 | 11 | |
12 | 12 | use PHP_CodeSniffer\Tests\Standards\AbstractSniffUnitTest; |
13 | 13 | |
14 | -class ClosingPHPTagUnitTest extends AbstractSniffUnitTest |
|
15 | -{ |
|
14 | +class ClosingPHPTagUnitTest 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 [9 => 1]; |
29 | 27 | |
30 | 28 | }//end getErrorList() |
@@ -38,8 +36,7 @@ discard block |
||
38 | 36 | * |
39 | 37 | * @return array<int, int> |
40 | 38 | */ |
41 | - public function getWarningList() |
|
42 | - { |
|
39 | + public function getWarningList() { |
|
43 | 40 | return []; |
44 | 41 | |
45 | 42 | }//end getWarningList() |
@@ -15,39 +15,39 @@ |
||
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 | - |
|
30 | - }//end getErrorList() |
|
31 | - |
|
32 | - |
|
33 | - /** |
|
34 | - * Returns the lines where warnings should occur. |
|
35 | - * |
|
36 | - * The key of the array should represent the line number and the value |
|
37 | - * should represent the number of warnings that should occur on that line. |
|
38 | - * |
|
39 | - * @return array<int, int> |
|
40 | - */ |
|
41 | - public function getWarningList() |
|
42 | - { |
|
43 | - return [ |
|
44 | - 3 => 1, |
|
45 | - 6 => 1, |
|
46 | - 11 => 1, |
|
47 | - 16 => 1, |
|
48 | - ]; |
|
49 | - |
|
50 | - }//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 | + |
|
30 | + }//end getErrorList() |
|
31 | + |
|
32 | + |
|
33 | + /** |
|
34 | + * Returns the lines where warnings should occur. |
|
35 | + * |
|
36 | + * The key of the array should represent the line number and the value |
|
37 | + * should represent the number of warnings that should occur on that line. |
|
38 | + * |
|
39 | + * @return array<int, int> |
|
40 | + */ |
|
41 | + public function getWarningList() |
|
42 | + { |
|
43 | + return [ |
|
44 | + 3 => 1, |
|
45 | + 6 => 1, |
|
46 | + 11 => 1, |
|
47 | + 16 => 1, |
|
48 | + ]; |
|
49 | + |
|
50 | + }//end getWarningList() |
|
51 | 51 | |
52 | 52 | |
53 | 53 | }//end class |
@@ -25,7 +25,7 @@ |
||
25 | 25 | */ |
26 | 26 | public function getErrorList() |
27 | 27 | { |
28 | - return []; |
|
28 | + return [ ]; |
|
29 | 29 | |
30 | 30 | }//end getErrorList() |
31 | 31 |
@@ -11,8 +11,7 @@ discard block |
||
11 | 11 | |
12 | 12 | use PHP_CodeSniffer\Tests\Standards\AbstractSniffUnitTest; |
13 | 13 | |
14 | -class DiscourageGotoUnitTest extends AbstractSniffUnitTest |
|
15 | -{ |
|
14 | +class DiscourageGotoUnitTest 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 | |
30 | 28 | }//end getErrorList() |
@@ -38,8 +36,7 @@ discard block |
||
38 | 36 | * |
39 | 37 | * @return array<int, int> |
40 | 38 | */ |
41 | - public function getWarningList() |
|
42 | - { |
|
39 | + public function getWarningList() { |
|
43 | 40 | return [ |
44 | 41 | 3 => 1, |
45 | 42 | 6 => 1, |
@@ -15,44 +15,44 @@ |
||
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 | - |
|
30 | - if (PHP_VERSION_ID >= 70200) { |
|
31 | - $errors[3] = 1; |
|
32 | - } |
|
33 | - |
|
34 | - if (PHP_VERSION_ID >= 70300) { |
|
35 | - $errors[4] = 1; |
|
36 | - } |
|
37 | - |
|
38 | - return $errors; |
|
39 | - |
|
40 | - }//end getErrorList() |
|
41 | - |
|
42 | - |
|
43 | - /** |
|
44 | - * Returns the lines where warnings should occur. |
|
45 | - * |
|
46 | - * The key of the array should represent the line number and the value |
|
47 | - * should represent the number of warnings that should occur on that line. |
|
48 | - * |
|
49 | - * @return array<int, int> |
|
50 | - */ |
|
51 | - public function getWarningList() |
|
52 | - { |
|
53 | - return []; |
|
54 | - |
|
55 | - }//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 | + $errors = []; |
|
29 | + |
|
30 | + if (PHP_VERSION_ID >= 70200) { |
|
31 | + $errors[3] = 1; |
|
32 | + } |
|
33 | + |
|
34 | + if (PHP_VERSION_ID >= 70300) { |
|
35 | + $errors[4] = 1; |
|
36 | + } |
|
37 | + |
|
38 | + return $errors; |
|
39 | + |
|
40 | + }//end getErrorList() |
|
41 | + |
|
42 | + |
|
43 | + /** |
|
44 | + * Returns the lines where warnings should occur. |
|
45 | + * |
|
46 | + * The key of the array should represent the line number and the value |
|
47 | + * should represent the number of warnings that should occur on that line. |
|
48 | + * |
|
49 | + * @return array<int, int> |
|
50 | + */ |
|
51 | + public function getWarningList() |
|
52 | + { |
|
53 | + return []; |
|
54 | + |
|
55 | + }//end getWarningList() |
|
56 | 56 | |
57 | 57 | |
58 | 58 | }//end class |
@@ -25,14 +25,14 @@ discard block |
||
25 | 25 | */ |
26 | 26 | public function getErrorList() |
27 | 27 | { |
28 | - $errors = []; |
|
28 | + $errors = [ ]; |
|
29 | 29 | |
30 | - if (PHP_VERSION_ID >= 70200) { |
|
31 | - $errors[3] = 1; |
|
30 | + if ( PHP_VERSION_ID >= 70200 ) { |
|
31 | + $errors[ 3 ] = 1; |
|
32 | 32 | } |
33 | 33 | |
34 | - if (PHP_VERSION_ID >= 70300) { |
|
35 | - $errors[4] = 1; |
|
34 | + if ( PHP_VERSION_ID >= 70300 ) { |
|
35 | + $errors[ 4 ] = 1; |
|
36 | 36 | } |
37 | 37 | |
38 | 38 | return $errors; |
@@ -50,7 +50,7 @@ discard block |
||
50 | 50 | */ |
51 | 51 | public function getWarningList() |
52 | 52 | { |
53 | - return []; |
|
53 | + return [ ]; |
|
54 | 54 | |
55 | 55 | }//end getWarningList() |
56 | 56 |
@@ -11,8 +11,7 @@ discard block |
||
11 | 11 | |
12 | 12 | use PHP_CodeSniffer\Tests\Standards\AbstractSniffUnitTest; |
13 | 13 | |
14 | -class DeprecatedFunctionsUnitTest extends AbstractSniffUnitTest |
|
15 | -{ |
|
14 | +class DeprecatedFunctionsUnitTest 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 | |
30 | 28 | if (PHP_VERSION_ID >= 70200) { |
@@ -48,8 +46,7 @@ discard block |
||
48 | 46 | * |
49 | 47 | * @return array<int, int> |
50 | 48 | */ |
51 | - public function getWarningList() |
|
52 | - { |
|
49 | + public function getWarningList() { |
|
53 | 50 | return []; |
54 | 51 | |
55 | 52 | }//end getWarningList() |
@@ -1,4 +1,4 @@ |
||
1 | -Foo |
|
1 | +foo |
|
2 | 2 | <?php |
3 | 3 | // Some code |
4 | 4 | ?> |
@@ -4,6 +4,6 @@ |
||
4 | 4 | */ |
5 | 5 | if (@in_array($array, $needle)) |
6 | 6 | { |
7 | - echo '@'; |
|
7 | + echo '@'; |
|
8 | 8 | } |
9 | 9 | ?> |
@@ -2,7 +2,7 @@ |
||
2 | 2 | /** |
3 | 3 | * @see something |
4 | 4 | */ |
5 | -if (@in_array($array, $needle)) |
|
5 | +if ( @in_array( $array, $needle ) ) |
|
6 | 6 | { |
7 | 7 | echo '@'; |
8 | 8 | } |
@@ -2,8 +2,7 @@ |
||
2 | 2 | /** |
3 | 3 | * @see something |
4 | 4 | */ |
5 | -if (@in_array($array, $needle)) |
|
6 | -{ |
|
5 | +if (@in_array($array, $needle)) { |
|
7 | 6 | echo '@'; |
8 | 7 | } |
9 | 8 | ?> |