Completed
Pull Request — develop (#1492)
by Zack
28:58 queued 09:00
created
Standards/Generic/Tests/CodeAnalysis/UnusedFunctionParameterUnitTest.inc 1 patch
Spacing   +17 added lines, -17 removed lines patch added patch discarded remove patch
@@ -1,36 +1,36 @@  discard block
 block discarded – undo
1 1
 <?php
2 2
 
3
-function foo($a, $b) {
3
+function foo( $a, $b ) {
4 4
     return $a * 2;
5 5
 }
6 6
 
7
-function baz($a, $b) {
7
+function baz( $a, $b ) {
8 8
     echo "baz({$a});";
9 9
 }
10 10
 
11
-function bar($a, $b) {
11
+function bar( $a, $b ) {
12 12
     $x = $b;
13
-    for ($i = 0; $i <$a; $i++) {
13
+    for ( $i = 0; $i < $a; $i++ ) {
14 14
         $x += $a * $i;
15 15
     }
16 16
     return $x;
17 17
 }
18 18
 
19
-function foobar($a, &$b) {
20
-    return (preg_match('/foo/', $a, $b) !== 0);
19
+function foobar( $a, &$b ) {
20
+    return ( preg_match( '/foo/', $a, $b ) !== 0 );
21 21
 }
22 22
 
23 23
 class Foo implements Bar {
24
-    function barfoo($a, $b) {
24
+    function barfoo( $a, $b ) {
25 25
         // Empty body means interface method in many cases.
26 26
     }
27 27
 
28
-    function fooBar($a, $b) {
28
+    function fooBar( $a, $b ) {
29 29
         return;
30 30
     }
31 31
 }
32 32
 
33
-function foo($bar)
33
+function foo( $bar )
34 34
 {
35 35
     print <<<BAZ
36 36
     $bar
@@ -65,17 +65,17 @@  discard block
 block discarded – undo
65 65
 print foo( 'PARAMETER' );
66 66
 print "\n";
67 67
 
68
-function foo($bar)
68
+function foo( $bar )
69 69
 {
70 70
     print "${bar} things\n";
71 71
 }
72 72
 
73
-function bar($x)
73
+function bar( $x )
74 74
 {
75 75
     return 2 * ${x};
76 76
 }
77 77
 
78
-$foo = function ($a, $b) {
78
+$foo = function( $a, $b ) {
79 79
     return $a * 2;
80 80
 };
81 81
 
@@ -91,19 +91,19 @@  discard block
 block discarded – undo
91 91
  */
92 92
 
93 93
 class MyClass {
94
-    public function something($a, $b) {
94
+    public function something( $a, $b ) {
95 95
         return $a * 2;
96 96
     }
97 97
 }
98 98
 
99 99
 class MyExtendedClass extends SomeClass {
100
-    public function something($a, $b) {
100
+    public function something( $a, $b ) {
101 101
         return $a * 2;
102 102
     }
103 103
 }
104 104
 
105 105
 class MyExtendedClass implements SomeInterface {
106
-    public function something($a, $b) {
106
+    public function something( $a, $b ) {
107 107
         return $a * 2;
108 108
     }
109 109
 }
@@ -114,10 +114,10 @@  discard block
 block discarded – undo
114 114
  * Report different violations for params *before* and *after* the last param used.
115 115
  */
116 116
 
117
-function something($a) {
117
+function something( $a ) {
118 118
     return 'foobar';
119 119
 }
120 120
 
121
-function myCallback($a, $b, $c, $d) {
121
+function myCallback( $a, $b, $c, $d ) {
122 122
     return $a * $c;
123 123
 }
Please login to merge, or discard this patch.
src/Standards/Generic/Tests/CodeAnalysis/JumbledIncrementerUnitTest.inc 1 patch
Spacing   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -1,24 +1,24 @@
 block discarded – undo
1 1
 <?php
2 2
 
3
-for ($i = 0; $i < 20; $i++) {
4
-    for ($j = 0; $j < 5; $i += 2) {
5
-        for ($k = 0; $k > 3; $i++) {
3
+for ( $i = 0; $i < 20; $i++ ) {
4
+    for ( $j = 0; $j < 5; $i += 2 ) {
5
+        for ( $k = 0; $k > 3; $i++ ) {
6 6
             
7 7
         }
8 8
     }
9 9
 }
10 10
 
11
-for ($i = 0; $i < 20; $i++) {
12
-    for ($j = 0; $j < 5; $j += 2) {
13
-        for ($k = 0; $k > 3; $k++) {
11
+for ( $i = 0; $i < 20; $i++ ) {
12
+    for ( $j = 0; $j < 5; $j += 2 ) {
13
+        for ( $k = 0; $k > 3; $k++ ) {
14 14
             
15 15
         }
16 16
     }
17 17
 }
18 18
 
19
-for ($i = 0; $i < 20; $i++) {
20
-    for ($j = 0; $j < 5; $j += 2) {
21
-        for ($k = 0; $k > 3; $j++) {
19
+for ( $i = 0; $i < 20; $i++ ) {
20
+    for ( $j = 0; $j < 5; $j += 2 ) {
21
+        for ( $k = 0; $k > 3; $j++ ) {
22 22
             
23 23
         }
24 24
     }
Please login to merge, or discard this patch.
src/Standards/Generic/Tests/CodeAnalysis/AssignmentInConditionUnitTest.inc 1 patch
Spacing   +36 added lines, -36 removed lines patch added patch discarded remove patch
@@ -1,13 +1,13 @@  discard block
 block discarded – undo
1 1
 <?php
2 2
 
3 3
 // OK.
4
-if ($a === 123) {
5
-} elseif ($a == 123) {
6
-} elseif ($a !== 123) {
7
-} elseif ($a != 123) {}
4
+if ( $a === 123 ) {
5
+} elseif ( $a == 123 ) {
6
+} elseif ( $a !== 123 ) {
7
+} elseif ( $a != 123 ) {}
8 8
 
9 9
 function abc( $a = 'default' ) {}
10
-if (in_array( $a, array( 1 => 'a', 2 => 'b' ) ) ) {}
10
+if ( in_array( $a, array( 1 => 'a', 2 => 'b' ) ) ) {}
11 11
 
12 12
 switch ( $a === $b ) {}
13 13
 switch ( true ) {
@@ -18,7 +18,7 @@  discard block
 block discarded – undo
18 18
 for ( $i = 0; $i == 100; $i++ ) {}
19 19
 for ( $i = 0; $i >= 100; $i++ ) {}
20 20
 for ( $i = 0; ; $i++ ) {}
21
-for (;;) {}
21
+for ( ;; ) {}
22 22
 
23 23
 do {
24 24
 } while ( $sample == false );
@@ -26,12 +26,12 @@  discard block
 block discarded – undo
26 26
 while ( $sample === false ) {}
27 27
 
28 28
 // Silly, but not an assignment.
29
-if (123 = $a) {}
30
-if (strtolower($b) = $b) {}
31
-if (array( 1 => 'a', 2 => 'b' ) = $b) {}
29
+if ( 123 = $a ) {}
30
+if ( strtolower( $b ) = $b ) {}
31
+if ( array( 1 => 'a', 2 => 'b' ) = $b ) {}
32 32
 
33
-if (SOME_CONSTANT = 123) {
34
-} else if(self::SOME_CONSTANT -= 10) {}
33
+if ( SOME_CONSTANT = 123 ) {
34
+} else if ( self::SOME_CONSTANT -= 10 ) {}
35 35
 
36 36
 if ( $a() = 123 ) {
37 37
 } else if ( $b->something() = 123 ) {
@@ -43,34 +43,34 @@  discard block
 block discarded – undo
43 43
 }
44 44
 
45 45
 // Assignments in condition.
46
-if ($a = 123) {
47
-} elseif ($a = 'abc') {
48
-} else if( $a += 10 ) {
49
-} else if($a -= 10) {
50
-} else if($a *= 10) {
51
-} else if($a **= 10) {
52
-} else if($a /= 10) {
53
-} else if($a .= strtolower($b)) {
54
-} else if($a %= SOME_CONSTANT) {
55
-} else if($a &= 2) {
56
-} else if($a |= 2) {
57
-} else if($a ^= 2) {
58
-} else if($a <<= 2) {
59
-} else if($a >>= 2) {
60
-} else if($a ??= $b) {
61
-} elseif( $a = 'abc' && $b = 'def' ) {
62
-} elseif(
46
+if ( $a = 123 ) {
47
+} elseif ( $a = 'abc' ) {
48
+} else if ( $a += 10 ) {
49
+} else if ( $a -= 10 ) {
50
+} else if ( $a *= 10 ) {
51
+} else if ( $a **= 10 ) {
52
+} else if ( $a /= 10 ) {
53
+} else if ( $a .= strtolower( $b ) ) {
54
+} else if ( $a %= SOME_CONSTANT ) {
55
+} else if ( $a &= 2 ) {
56
+} else if ( $a |= 2 ) {
57
+} else if ( $a ^= 2 ) {
58
+} else if ( $a <<= 2 ) {
59
+} else if ( $a >>= 2 ) {
60
+} else if ( $a ??= $b ) {
61
+} elseif ( $a = 'abc' && $b = 'def' ) {
62
+} elseif (
63 63
     $a = 'abc'
64 64
 	&& $a .= 'def'
65 65
 ) {}
66 66
 
67
-if ($a[] = 123) {
68
-} elseif ($a['something'] = 123) {
69
-} elseif (self::$a = 123) {
70
-} elseif (parent::$a *= 123) {
71
-} elseif (static::$a = 123) {
72
-} elseif (MyClass::$a .= 'abc') {
73
-} else if( $this->something += 10 ) {}
67
+if ( $a[ ] = 123 ) {
68
+} elseif ( $a[ 'something' ] = 123 ) {
69
+} elseif ( self::$a = 123 ) {
70
+} elseif ( parent::$a *= 123 ) {
71
+} elseif ( static::$a = 123 ) {
72
+} elseif ( MyClass::$a .= 'abc' ) {
73
+} else if ( $this->something += 10 ) {}
74 74
 
75 75
 switch ( $a = $b ) {}
76 76
 switch ( true ) {
@@ -89,5 +89,5 @@  discard block
 block discarded – undo
89 89
 
90 90
 while ( $sample = false ) {}
91 91
 
92
-if ($a = 123) :
92
+if ( $a = 123 ) :
93 93
 endif;
Please login to merge, or discard this patch.
src/Standards/Generic/Tests/Files/EndFileNewlineUnitTest.4.inc 1 patch
Spacing   -1 removed lines patch added patch discarded remove patch
@@ -1,2 +1,1 @@
 block discarded – undo
1 1
 <?php
2
-/** Why me?
3 2
\ No newline at end of file
Please login to merge, or discard this patch.
php_codesniffer/src/Standards/Generic/Tests/Files/LineEndingsUnitTest.inc 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -10,7 +10,7 @@
 block discarded – undo
10 10
 <?php
11 11
 function foo()
12 12
 {
13
-	$query->group('a.id, 
13
+	$query->group( 'a.id, 
14 14
 			uc.name, 
15 15
 			ag.title, 
16 16
 			ua.name'
Please login to merge, or discard this patch.
php_codesniffer/src/Standards/Generic/Tests/Files/ByteOrderMarkUnitTest.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -25,7 +25,7 @@  discard block
 block discarded – undo
25 25
      */
26 26
     public function getErrorList()
27 27
     {
28
-        return [1 => 1];
28
+        return [ 1 => 1 ];
29 29
 
30 30
     }//end getErrorList()
31 31
 
@@ -40,7 +40,7 @@  discard block
 block discarded – undo
40 40
      */
41 41
     public function getWarningList()
42 42
     {
43
-        return [];
43
+        return [ ];
44 44
 
45 45
     }//end getWarningList()
46 46
 
Please login to merge, or discard this patch.
php_codesniffer/src/Standards/Generic/Tests/Files/InlineHTMLUnitTest.php 1 patch
Spacing   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -25,20 +25,20 @@  discard block
 block discarded – undo
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 'InlineHTMLUnitTest.3.inc':
32
-            return [4 => 1];
32
+            return [ 4 => 1 ];
33 33
             break;
34 34
         case 'InlineHTMLUnitTest.4.inc':
35
-            return [1 => 1];
35
+            return [ 1 => 1 ];
36 36
             break;
37 37
         case 'InlineHTMLUnitTest.7.inc':
38
-            return [1 => 1];
38
+            return [ 1 => 1 ];
39 39
             break;
40 40
         default:
41
-            return [];
41
+            return [ ];
42 42
             break;
43 43
         }//end switch
44 44
 
@@ -55,9 +55,9 @@  discard block
 block discarded – undo
55 55
      *
56 56
      * @return array<int, int>
57 57
      */
58
-    public function getWarningList($testFile='')
58
+    public function getWarningList( $testFile = '' )
59 59
     {
60
-        return [];
60
+        return [ ];
61 61
 
62 62
     }//end getWarningList()
63 63
 
Please login to merge, or discard this patch.
src/Standards/Generic/Tests/Files/EndFileNoNewlineUnitTest.6.inc 1 patch
Spacing   -1 removed lines patch added patch discarded remove patch
@@ -1,2 +1,1 @@
 block discarded – undo
1 1
 <?php
2
-/** Why me?
Please login to merge, or discard this patch.
php_codesniffer/src/Standards/Generic/Tests/Files/LineLengthUnitTest.php 1 patch
Spacing   +10 added lines, -10 removed lines patch added patch discarded remove patch
@@ -23,7 +23,7 @@  discard block
 block discarded – undo
23 23
      *
24 24
      * @return void
25 25
      */
26
-    public function setCliValues($testFile, $config)
26
+    public function setCliValues( $testFile, $config )
27 27
     {
28 28
         $config->tabWidth = 4;
29 29
 
@@ -40,9 +40,9 @@  discard block
 block discarded – undo
40 40
      *
41 41
      * @return array<int, int>
42 42
      */
43
-    public function getErrorList($testFile='')
43
+    public function getErrorList( $testFile = '' )
44 44
     {
45
-        switch ($testFile) {
45
+        switch ( $testFile ) {
46 46
         case 'LineLengthUnitTest.1.inc':
47 47
             return [
48 48
                 31 => 1,
@@ -53,10 +53,10 @@  discard block
 block discarded – undo
53 53
             break;
54 54
         case 'LineLengthUnitTest.2.inc':
55 55
         case 'LineLengthUnitTest.3.inc':
56
-            return [7 => 1];
56
+            return [ 7 => 1 ];
57 57
             break;
58 58
         default:
59
-            return [];
59
+            return [ ];
60 60
             break;
61 61
         }//end switch
62 62
 
@@ -73,9 +73,9 @@  discard block
 block discarded – undo
73 73
      *
74 74
      * @return array<int, int>
75 75
      */
76
-    public function getWarningList($testFile='')
76
+    public function getWarningList( $testFile = '' )
77 77
     {
78
-        switch ($testFile) {
78
+        switch ( $testFile ) {
79 79
         case 'LineLengthUnitTest.1.inc':
80 80
             return [
81 81
                 9  => 1,
@@ -91,13 +91,13 @@  discard block
 block discarded – undo
91 91
             break;
92 92
         case 'LineLengthUnitTest.2.inc':
93 93
         case 'LineLengthUnitTest.3.inc':
94
-            return [6 => 1];
94
+            return [ 6 => 1 ];
95 95
             break;
96 96
         case 'LineLengthUnitTest.4.inc':
97
-            return [10 => 1];
97
+            return [ 10 => 1 ];
98 98
             break;
99 99
         default:
100
-            return [];
100
+            return [ ];
101 101
             break;
102 102
         }//end switch
103 103
 
Please login to merge, or discard this patch.