@@ -25,20 +25,20 @@ 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 'EndFileNoNewlineUnitTest.1.inc': |
32 | 32 | case 'EndFileNoNewlineUnitTest.1.css': |
33 | 33 | case 'EndFileNoNewlineUnitTest.1.js': |
34 | 34 | case 'EndFileNoNewlineUnitTest.2.inc': |
35 | - return [3 => 1]; |
|
35 | + return [ 3 => 1 ]; |
|
36 | 36 | case 'EndFileNoNewlineUnitTest.2.css': |
37 | 37 | case 'EndFileNoNewlineUnitTest.2.js': |
38 | 38 | case 'EndFileNoNewlineUnitTest.6.inc': |
39 | - return [2 => 1]; |
|
39 | + return [ 2 => 1 ]; |
|
40 | 40 | default: |
41 | - return []; |
|
41 | + return [ ]; |
|
42 | 42 | }//end switch |
43 | 43 | |
44 | 44 | }//end getErrorList() |
@@ -54,9 +54,9 @@ discard block |
||
54 | 54 | * |
55 | 55 | * @return array<int, int> |
56 | 56 | */ |
57 | - public function getWarningList($testFile='') |
|
57 | + public function getWarningList( $testFile = '' ) |
|
58 | 58 | { |
59 | - return []; |
|
59 | + return [ ]; |
|
60 | 60 | |
61 | 61 | }//end getWarningList() |
62 | 62 |
@@ -4,7 +4,7 @@ |
||
4 | 4 | <?php |
5 | 5 | |
6 | 6 | /* This line is fine. */ |
7 | -if($thisIsOk === true) {} |
|
7 | +if ( $thisIsOk === true ) {} |
|
8 | 8 | |
9 | 9 | /* This line is too long but will be ignored. This line is too long but will be ignored. */ |
10 | -if (($anotherReallyLongVarName === true) || (is_array($anotherReallyLongVarName) === false)) {} |
|
10 | +if ( ( $anotherReallyLongVarName === true ) || ( is_array( $anotherReallyLongVarName ) === false ) ) {} |
@@ -25,16 +25,16 @@ 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 'EndFileNewlineUnitTest.3.inc': |
32 | 32 | case 'EndFileNewlineUnitTest.3.js': |
33 | 33 | case 'EndFileNewlineUnitTest.3.css': |
34 | 34 | case 'EndFileNewlineUnitTest.4.inc': |
35 | - return [2 => 1]; |
|
35 | + return [ 2 => 1 ]; |
|
36 | 36 | default: |
37 | - return []; |
|
37 | + return [ ]; |
|
38 | 38 | }//end switch |
39 | 39 | |
40 | 40 | }//end getErrorList() |
@@ -50,9 +50,9 @@ discard block |
||
50 | 50 | * |
51 | 51 | * @return array<int, int> |
52 | 52 | */ |
53 | - public function getWarningList($testFile='') |
|
53 | + public function getWarningList( $testFile = '' ) |
|
54 | 54 | { |
55 | - return []; |
|
55 | + return [ ]; |
|
56 | 56 | |
57 | 57 | }//end getWarningList() |
58 | 58 |
@@ -1,18 +1,18 @@ discard block |
||
1 | 1 | <?php |
2 | 2 | |
3 | 3 | // This line is okay... just! |
4 | -if (($reallyLongVarName === true) || (is_array($anotherLongVarName) == false)) { |
|
4 | +if ( ( $reallyLongVarName === true ) || ( is_array( $anotherLongVarName ) == false ) ) { |
|
5 | 5 | // Do something. |
6 | 6 | } |
7 | 7 | |
8 | 8 | // This line is not okay... just! |
9 | -if (($reallyLongVarName === true) || (is_array($anotherLongVarName) === false)) { |
|
9 | +if ( ( $reallyLongVarName === true ) || ( is_array( $anotherLongVarName ) === false ) ) { |
|
10 | 10 | // Do something. |
11 | 11 | } |
12 | 12 | |
13 | 13 | |
14 | 14 | // This line is is too long. |
15 | -if (($anotherReallyLongVarName === true) || (is_array($anotherReallyLongVarName) === false)) { |
|
15 | +if ( ( $anotherReallyLongVarName === true ) || ( is_array( $anotherReallyLongVarName ) === false ) ) { |
|
16 | 16 | // Do something. |
17 | 17 | } |
18 | 18 | |
@@ -56,9 +56,9 @@ discard block |
||
56 | 56 | |
57 | 57 | # http://en.wikipedia.org/wiki/Binomial_proportion_confidence_interval#Wilson_score_interval |
58 | 58 | |
59 | -if ($foo) { |
|
60 | - if ($bar) { |
|
61 | - if ($baz) { |
|
59 | +if ( $foo ) { |
|
60 | + if ( $bar ) { |
|
61 | + if ( $baz ) { |
|
62 | 62 | // Next line can be broken: |
63 | 63 | // foo bar baz http://en.wikipedia.org/wiki/Binomial_proportion#blahblahblahblah |
64 | 64 | // But this one is just too long to break with this indent: |
@@ -68,12 +68,12 @@ discard block |
||
68 | 68 | } |
69 | 69 | |
70 | 70 | /* -------------------------------- 80 chars -------------------------------- */ |
71 | -$ab = function () { /* comment */ if ($foo === true) { return (int) $foo; } }; |
|
72 | -$ab = function () { /* comment */ if ($foo === true){ return (int)$foo; }}; |
|
73 | -$ab = function () { /* comment */ if ($foo === true) { return (int) $foo; } }; |
|
74 | - $ab = function () { /* comment */ if ($foo === true) { return(int) $foo; }}; |
|
75 | - $ab = function () { /* comment */ if ($foo === true) { return(int) $foo; }}; |
|
76 | -$ab = $ab = $ab = $ab = $ab = $ab = $ab = $ab = $ab = $ab; |
|
71 | +$ab = function() { /* comment */ if ( $foo === true ) { return (int)$foo; } }; |
|
72 | +$ab = function() { /* comment */ if ( $foo === true ) { return (int)$foo; }}; |
|
73 | +$ab = function() { /* comment */ if ( $foo === true ) { return (int)$foo; } }; |
|
74 | + $ab = function() { /* comment */ if ( $foo === true ) { return(int)$foo; }}; |
|
75 | + $ab = function() { /* comment */ if ( $foo === true ) { return(int)$foo; }}; |
|
76 | +$ab = $ab = $ab = $ab = $ab = $ab = $ab = $ab = $ab = $ab; |
|
77 | 77 | |
78 | 78 | // PHPCS annotations on a line by themselves should be ignored for the metrics. |
79 | 79 | // phpcs:enable Standard.Category.Sniff.ErrorCode1,Standard.Category.Sniff.ErrorCode2 -- for reasons ... |
@@ -1,19 +1,19 @@ |
||
1 | 1 | <?php |
2 | -$x = 'My '.'string'; |
|
3 | -$x = 'My '. 1234; |
|
4 | -$x = 'My '.$y.' test'; |
|
2 | +$x = 'My ' . 'string'; |
|
3 | +$x = 'My ' . 1234; |
|
4 | +$x = 'My ' . $y . ' test'; |
|
5 | 5 | |
6 | -echo $data['my'.'index']; |
|
7 | -echo $data['my'. 4]; |
|
8 | -echo $data['my'.$x]; |
|
9 | -echo $data[$x.$y.'My'.'String']; |
|
6 | +echo $data[ 'my' . 'index' ]; |
|
7 | +echo $data[ 'my' . 4 ]; |
|
8 | +echo $data[ 'my' . $x ]; |
|
9 | +echo $data[ $x . $y . 'My' . 'String' ]; |
|
10 | 10 | |
11 | -$code = '$actions = array();'."\n"; |
|
12 | -$code = "$actions = array();"."\n"; |
|
11 | +$code = '$actions = array();' . "\n"; |
|
12 | +$code = "$actions = array();" . "\n"; |
|
13 | 13 | |
14 | 14 | // No errors for these because they are needed in some cases. |
15 | -$code = ' ?'.'>'; |
|
16 | -$code = '<'.'?php '; |
|
15 | +$code = ' ?' . '>'; |
|
16 | +$code = '<' . '?php '; |
|
17 | 17 | |
18 | 18 | $string = 'This is a really long string. ' |
19 | 19 | . 'It is being used for errors. ' |
@@ -25,9 +25,9 @@ discard block |
||
25 | 25 | * |
26 | 26 | * @return array<int, int> |
27 | 27 | */ |
28 | - public function getErrorList($testFile='UnnecessaryStringConcatUnitTest.inc') |
|
28 | + public function getErrorList( $testFile = 'UnnecessaryStringConcatUnitTest.inc' ) |
|
29 | 29 | { |
30 | - switch ($testFile) { |
|
30 | + switch ( $testFile ) { |
|
31 | 31 | case 'UnnecessaryStringConcatUnitTest.inc': |
32 | 32 | return [ |
33 | 33 | 2 => 1, |
@@ -48,7 +48,7 @@ discard block |
||
48 | 48 | ]; |
49 | 49 | break; |
50 | 50 | default: |
51 | - return []; |
|
51 | + return [ ]; |
|
52 | 52 | break; |
53 | 53 | }//end switch |
54 | 54 | |
@@ -65,7 +65,7 @@ discard block |
||
65 | 65 | */ |
66 | 66 | public function getWarningList() |
67 | 67 | { |
68 | - return []; |
|
68 | + return [ ]; |
|
69 | 69 | |
70 | 70 | }//end getWarningList() |
71 | 71 |
@@ -25,7 +25,7 @@ |
||
25 | 25 | */ |
26 | 26 | public function getErrorList() |
27 | 27 | { |
28 | - return [116 => 1]; |
|
28 | + return [ 116 => 1 ]; |
|
29 | 29 | |
30 | 30 | }//end getErrorList() |
31 | 31 |
@@ -2,20 +2,20 @@ discard block |
||
2 | 2 | |
3 | 3 | function nestingOne() |
4 | 4 | { |
5 | - if ($condition) { |
|
5 | + if ( $condition ) { |
|
6 | 6 | echo 'hi'; |
7 | 7 | } |
8 | 8 | } |
9 | 9 | |
10 | 10 | function nestingFive() |
11 | 11 | { |
12 | - if ($condition) { |
|
12 | + if ( $condition ) { |
|
13 | 13 | echo 'hi'; |
14 | - switch ($condition) |
|
14 | + switch ( $condition ) |
|
15 | 15 | { |
16 | 16 | case '1': |
17 | - if ($condition === '1') { |
|
18 | - if ($cond) { |
|
17 | + if ( $condition === '1' ) { |
|
18 | + if ( $cond ) { |
|
19 | 19 | echo 'hi'; |
20 | 20 | } |
21 | 21 | } |
@@ -26,14 +26,14 @@ discard block |
||
26 | 26 | |
27 | 27 | function nestingSix() |
28 | 28 | { |
29 | - if ($condition) { |
|
29 | + if ( $condition ) { |
|
30 | 30 | echo 'hi'; |
31 | - switch ($condition) |
|
31 | + switch ( $condition ) |
|
32 | 32 | { |
33 | 33 | case '1': |
34 | - if ($condition === '1') { |
|
35 | - if ($cond) { |
|
36 | - foreach ($conds as $cond) { |
|
34 | + if ( $condition === '1' ) { |
|
35 | + if ( $cond ) { |
|
36 | + foreach ( $conds as $cond ) { |
|
37 | 37 | echo 'hi'; |
38 | 38 | } |
39 | 39 | } |
@@ -45,18 +45,18 @@ discard block |
||
45 | 45 | |
46 | 46 | function nestingTen() |
47 | 47 | { |
48 | - if ($condition) { |
|
48 | + if ( $condition ) { |
|
49 | 49 | echo 'hi'; |
50 | - switch ($condition) |
|
50 | + switch ( $condition ) |
|
51 | 51 | { |
52 | 52 | case '1': |
53 | - if ($condition === '1') { |
|
54 | - if ($cond) { |
|
55 | - switch ($cond) { |
|
53 | + if ( $condition === '1' ) { |
|
54 | + if ( $cond ) { |
|
55 | + switch ( $cond ) { |
|
56 | 56 | case '1': |
57 | - if ($cond === '1') { |
|
58 | - foreach ($conds as $cond) { |
|
59 | - if ($cond === 'hi') { |
|
57 | + if ( $cond === '1' ) { |
|
58 | + foreach ( $conds as $cond ) { |
|
59 | + if ( $cond === 'hi' ) { |
|
60 | 60 | echo 'hi'; |
61 | 61 | } |
62 | 62 | } |
@@ -72,19 +72,19 @@ discard block |
||
72 | 72 | |
73 | 73 | function nestingEleven() |
74 | 74 | { |
75 | - if ($condition) { |
|
75 | + if ( $condition ) { |
|
76 | 76 | echo 'hi'; |
77 | - switch ($condition) |
|
77 | + switch ( $condition ) |
|
78 | 78 | { |
79 | 79 | case '1': |
80 | - if ($condition === '1') { |
|
81 | - if ($cond) { |
|
82 | - switch ($cond) { |
|
80 | + if ( $condition === '1' ) { |
|
81 | + if ( $cond ) { |
|
82 | + switch ( $cond ) { |
|
83 | 83 | case '1': |
84 | - if ($cond === '1') { |
|
85 | - foreach ($conds as $cond) { |
|
86 | - if ($cond === 'hi') { |
|
87 | - if ($cond !== 'bye') { |
|
84 | + if ( $cond === '1' ) { |
|
85 | + foreach ( $conds as $cond ) { |
|
86 | + if ( $cond === 'hi' ) { |
|
87 | + if ( $cond !== 'bye' ) { |
|
88 | 88 | echo 'hi'; |
89 | 89 | } |
90 | 90 | } |
@@ -25,7 +25,7 @@ |
||
25 | 25 | */ |
26 | 26 | public function getErrorList() |
27 | 27 | { |
28 | - return [73 => 1]; |
|
28 | + return [ 73 => 1 ]; |
|
29 | 29 | |
30 | 30 | }//end getErrorList() |
31 | 31 |