Completed
Pull Request — develop (#1492)
by Zack
28:58 queued 09:00
created
php_codesniffer/src/Standards/Generic/Tests/Commenting/FixmeUnitTest.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -26,7 +26,7 @@  discard block
 block discarded – undo
26 26
      *
27 27
      * @return array<int, int>
28 28
      */
29
-    public function getErrorList($testFile='FixmeUnitTest.inc')
29
+    public function getErrorList( $testFile = 'FixmeUnitTest.inc' )
30 30
     {
31 31
         return [
32 32
             3  => 1,
@@ -52,9 +52,9 @@  discard block
 block discarded – undo
52 52
      *
53 53
      * @return array<int, int>
54 54
      */
55
-    public function getWarningList($testFile='FixmeUnitTest.inc')
55
+    public function getWarningList( $testFile = 'FixmeUnitTest.inc' )
56 56
     {
57
-        return [];
57
+        return [ ];
58 58
 
59 59
     }//end getWarningList()
60 60
 
Please login to merge, or discard this patch.
src/Standards/Generic/Tests/Commenting/DocCommentUnitTest.inc 1 patch
Spacing   -1 removed lines patch added patch discarded remove patch
@@ -249,4 +249,3 @@
 block discarded – undo
249 249
  * @link		http://pear.php.net/package/PHP_CodeSniffer
250 250
  */
251 251
 
252
-/** No docblock close tag. Must be last test without new line.
253 252
\ No newline at end of file
Please login to merge, or discard this patch.
src/Standards/Generic/Tests/Commenting/DocCommentUnitTest.php 1 patch
Spacing   +2 added lines, -2 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
 
@@ -103,7 +103,7 @@  discard block
 block discarded – undo
103 103
      */
104 104
     public function getWarningList()
105 105
     {
106
-        return [];
106
+        return [ ];
107 107
 
108 108
     }//end getWarningList()
109 109
 
Please login to merge, or discard this patch.
php_codesniffer/src/Standards/Generic/Tests/Commenting/TodoUnitTest.inc 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -5,10 +5,10 @@
 block discarded – undo
5 5
  */
6 6
 
7 7
 // TODO: remove this.
8
-error_log('test');
8
+error_log( 'test' );
9 9
 
10 10
 // TODO remove this.
11
-Debug::bam('test');
11
+Debug::bam( 'test' );
12 12
 
13 13
 // todo - remove this.
14 14
 
Please login to merge, or discard this patch.
php_codesniffer/src/Standards/Generic/Tests/Commenting/TodoUnitTest.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -25,9 +25,9 @@  discard block
 block discarded – undo
25 25
      *
26 26
      * @return array<int, int>
27 27
      */
28
-    public function getErrorList($testFile='TodoUnitTest.inc')
28
+    public function getErrorList( $testFile = 'TodoUnitTest.inc' )
29 29
     {
30
-        return [];
30
+        return [ ];
31 31
 
32 32
     }//end getErrorList()
33 33
 
@@ -42,7 +42,7 @@  discard block
 block discarded – undo
42 42
      *
43 43
      * @return array<int, int>
44 44
      */
45
-    public function getWarningList($testFile='TodoUnitTest.inc')
45
+    public function getWarningList( $testFile = 'TodoUnitTest.inc' )
46 46
     {
47 47
         return [
48 48
             3  => 1,
Please login to merge, or discard this patch.
php_codesniffer/src/Standards/Generic/Tests/Commenting/FixmeUnitTest.inc 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -5,10 +5,10 @@
 block discarded – undo
5 5
  */
6 6
 
7 7
 // FIXME: this is broken, don't forget to fix it
8
-error_log('test');
8
+error_log( 'test' );
9 9
 
10 10
 // FIXME remove this.
11
-Debug::bam('test');
11
+Debug::bam( 'test' );
12 12
 
13 13
 // fixme - fix this.
14 14
 
Please login to merge, or discard this patch.
Generic/Tests/ControlStructures/InlineControlStructureUnitTest.5.inc 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -1,4 +1,4 @@
 block discarded – undo
1 1
 <?php
2 2
 
3 3
 // Intentional parse error. Testing that the sniff is *not* triggered in this case.
4
-if ($bar)
4
+if ( $bar )
Please login to merge, or discard this patch.
Generic/Tests/ControlStructures/InlineControlStructureUnitTest.6.inc 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -1,6 +1,6 @@
 block discarded – undo
1 1
 <?php
2 2
 
3 3
 // Intentional parse error. Testing that the sniff is *not* triggered in this case.
4
-if ($bar
4
+if ( $bar
5 5
 
6 6
 function parensDifferentOwner() {}
Please login to merge, or discard this patch.
Generic/Tests/ControlStructures/InlineControlStructureUnitTest.1.inc 1 patch
Spacing   +85 added lines, -85 removed lines patch added patch discarded remove patch
@@ -1,57 +1,57 @@  discard block
 block discarded – undo
1 1
 <?php
2 2
 
3
-if ($something) echo 'hello';
3
+if ( $something ) echo 'hello';
4 4
 
5
-if ($something) {
5
+if ( $something ) {
6 6
     echo 'hello';
7 7
 } else echo 'hi';
8 8
 
9
-if ($something) {
9
+if ( $something ) {
10 10
     echo 'hello';
11
-} else if ($else) echo 'hi';
11
+} else if ( $else ) echo 'hi';
12 12
 
13
-foreach ($something as $thing) echo 'hello';
13
+foreach ( $something as $thing ) echo 'hello';
14 14
 
15
-for ($i; $i > 0; $i--) echo 'hello';
15
+for ( $i; $i > 0; $i-- ) echo 'hello';
16 16
 
17
-while ($something) echo 'hello';
17
+while ( $something ) echo 'hello';
18 18
 
19 19
 do {
20 20
     $i--;
21
-} while ($something);
21
+} while ( $something );
22 22
 
23
-if(true)
23
+if ( true )
24 24
   $someObject->{$name};
25 25
 
26
-if (true) :
26
+if ( true ) :
27 27
     $foo = true;
28 28
 endif;
29 29
 
30
-while (true) :
30
+while ( true ) :
31 31
     $foo = true;
32 32
 endwhile;
33 33
 
34
-for ($i; $i > 0; $i--) :
34
+for ( $i; $i > 0; $i-- ) :
35 35
     echo 'hello';
36 36
 endfor;
37 37
 
38
-foreach ($array as $element) :
38
+foreach ( $array as $element ) :
39 39
     echo 'hello';
40 40
 endforeach;
41 41
 
42
-while (!$this->readLine($tokens, $tag));
43
-while (!$this->readLine($tokens, $tag)); //skip to end of file
42
+while ( ! $this->readLine( $tokens, $tag ) );
43
+while ( ! $this->readLine( $tokens, $tag ) ); //skip to end of file
44 44
 
45
-foreach ($cookies as $cookie)
46
-    if ($cookie->match($uri, $matchSessionCookies, $now))
47
-        $ret[] = $cookie;
45
+foreach ( $cookies as $cookie )
46
+    if ( $cookie->match( $uri, $matchSessionCookies, $now ) )
47
+        $ret[ ] = $cookie;
48 48
 
49
-foreach ($stringParade as $hit)
50
-    $hitParade[] = $hit + 0; //cast to integer
49
+foreach ( $stringParade as $hit )
50
+    $hitParade[ ] = $hit + 0; //cast to integer
51 51
 
52
-if ($foo) :
52
+if ( $foo ) :
53 53
     echo 'true';
54
-elseif ($something) :
54
+elseif ( $something ) :
55 55
     echo 'foo';
56 56
 else:
57 57
     echo 'false';
@@ -59,27 +59,27 @@  discard block
 block discarded – undo
59 59
 
60 60
 function test()
61 61
 {
62
-    if ($a)
63
-        $a.=' '.($b ? 'b' : ($c ? ($d ? 'd' : 'c') : ''));
62
+    if ( $a )
63
+        $a .= ' ' . ( $b ? 'b' : ( $c ? ( $d ? 'd' : 'c' ) : '' ) );
64 64
 }
65 65
 
66
-if ($a)
67
-    foreach ($b as $c) {
68
-        if ($d) {
69
-            $e=$f;
70
-            $g=$h;
71
-        } elseif ($i==0) {
72
-            $j=$k;
66
+if ( $a )
67
+    foreach ( $b as $c ) {
68
+        if ( $d ) {
69
+            $e = $f;
70
+            $g = $h;
71
+        } elseif ( $i == 0 ) {
72
+            $j = $k;
73 73
         }
74 74
     }
75 75
 
76 76
 ?>
77 77
 <div style="text-align: right;">
78
-    <?php if ($model->scenario == 'simple') $widget->renderPager() ?>
78
+    <?php if ( $model->scenario == 'simple' ) $widget->renderPager() ?>
79 79
 </div>
80 80
 
81 81
 <?php
82
-switch ($this->error):
82
+switch ( $this->error ):
83 83
     case Shop_Customer :: ERROR_INVALID_GENDER: ?>
84 84
         Ung&uuml;ltiges Geschlecht!
85 85
     <?php break;
@@ -88,9 +88,9 @@  discard block
 block discarded – undo
88 88
     <?php break;
89 89
 endswitch;
90 90
 
91
-if ($this->allowShopping !== true):
92
-    if ($this->status != Shop_Cart :: OK):
93
-        switch ($this->status):
91
+if ( $this->allowShopping !== true ):
92
+    if ( $this->status != Shop_Cart :: OK ):
93
+        switch ( $this->status ):
94 94
             case Shop_Cart :: NOT_FOUND:
95 95
             echo 'foo';
96 96
         endswitch;
@@ -100,15 +100,15 @@  discard block
 block discarded – undo
100 100
 endif;
101 101
 
102 102
 // ELSE IF split over multiple lines (not inline)
103
-if ($test) {
103
+if ( $test ) {
104 104
 } else
105
-    if ($test) {
105
+    if ( $test ) {
106 106
     } else {
107 107
     }
108 108
 
109
-switch($response = \Bar::baz('bat', function ($foo) {
109
+switch ( $response = \Bar::baz( 'bat', function( $foo ) {
110 110
     return 'bar';
111
-})) {
111
+}) ) {
112 112
     case 1:
113 113
         return 'test';
114 114
 
@@ -116,38 +116,38 @@  discard block
 block discarded – undo
116 116
         return 'other';
117 117
 }
118 118
 
119
-$stuff = [1,2,3];
120
-foreach($stuff as $num)
121
-    if ($num %2 ) {
119
+$stuff = [ 1, 2, 3 ];
120
+foreach ( $stuff as $num )
121
+    if ( $num % 2 ) {
122 122
         echo "even";
123 123
     } else {
124 124
         echo "odd";
125 125
     }
126 126
 
127 127
 $i = 0;
128
-foreach($stuff as $num)
128
+foreach ( $stuff as $num )
129 129
     do {
130 130
         echo $i;
131 131
         $i++;
132
-    } while ($i < 5);
132
+    } while ( $i < 5 );
133 133
 
134
-foreach($stuff as $num)
135
-    if (true) {
134
+foreach ( $stuff as $num )
135
+    if ( true ) {
136 136
         echo "true1\n";
137 137
     }
138
-    if (true) {
138
+    if ( true ) {
139 139
         echo "true2\n";
140 140
     }
141 141
 
142
-if ($foo) echo 'foo';
143
-elseif ($bar) echo 'bar';
142
+if ( $foo ) echo 'foo';
143
+elseif ( $bar ) echo 'bar';
144 144
 else echo 'baz';
145 145
 
146
-switch ($type) {
146
+switch ( $type ) {
147 147
     case 1:
148
-        if ($foo) {
148
+        if ( $foo ) {
149 149
             return true;
150
-        } elseif ($baz)
150
+        } elseif ( $baz )
151 151
             return true;
152 152
         else {
153 153
             echo 'else';
@@ -155,55 +155,55 @@  discard block
 block discarded – undo
155 155
     break;
156 156
 }
157 157
 
158
-foreach ($sql as $s)
159
-        if (!$this->execute) echo "<pre>",$s.";\n</pre>";
158
+foreach ( $sql as $s )
159
+        if ( ! $this->execute ) echo "<pre>", $s . ";\n</pre>";
160 160
         else {
161
-            $ok = $this->connDest->Execute($s);
162
-            if (!$ok)
163
-                if ($this->neverAbort) $ret = false;
161
+            $ok = $this->connDest->Execute( $s );
162
+            if ( ! $ok )
163
+                if ( $this->neverAbort ) $ret = false;
164 164
                 else return false;
165 165
         }
166 166
 
167
-if ($bar)
168
-    if ($foo) echo 'hi'; // lol
167
+if ( $bar )
168
+    if ( $foo ) echo 'hi'; // lol
169 169
 
170
-if ($level == 'district')
171
-    \DB::update(<<<EOD
170
+if ( $level == 'district' )
171
+    \DB::update( <<<EOD
172 172
 some
173 173
 text
174 174
 here
175 175
 EOD
176 176
     );
177 177
 
178
-if ($level == 'district')
178
+if ( $level == 'district' )
179 179
     $var = <<<EOD
180 180
 some
181 181
 text
182 182
 here
183 183
 EOD;
184 184
 
185
-if ($a && $a === Foo::VARIABLE && ($a === Foo::METHOD || $a === Foo::FUNCTION))
185
+if ( $a && $a === Foo::VARIABLE && ( $a === Foo::METHOD || $a === Foo::FUNCTION) )
186 186
     echo 'hi';
187 187
 
188
-$out = array_map(function ($test) { if ($test) return 1; else return 2; }, $input); // comment
188
+$out = array_map( function( $test ) { if ( $test ) return 1; else return 2; }, $input ); // comment
189 189
 
190
-for ($x=0;$x<5;$x++):
191
-    if ($x) continue;
190
+for ( $x = 0; $x < 5; $x++ ):
191
+    if ( $x ) continue;
192 192
 endfor;
193 193
 
194
-for ($x=0;$x<5;$x++):
195
-    if ($x) continue ?> <?php
194
+for ( $x = 0; $x < 5; $x++ ):
195
+    if ( $x ) continue ?> <?php
196 196
 endfor;
197 197
 
198
-if (true)
198
+if ( true )
199 199
     try {
200 200
     }
201
-    catch(Exception $e) {
201
+    catch ( Exception $e ) {
202 202
     }
203 203
 
204
-switch ($num) {
204
+switch ( $num ) {
205 205
     case 0:
206
-        if (1 > $num)
206
+        if ( 1 > $num )
207 207
             return bar(
208 208
                 baz(
209 209
                     "foobarbaz"
@@ -216,25 +216,25 @@  discard block
 block discarded – undo
216 216
 	$i++;
217 217
 }
218 218
 // Comment
219
-while ($i < 10);
219
+while ( $i < 10 );
220 220
 
221
-if ($this) {
222
-    if ($that)
223
-        foo(${$a[$b]});
221
+if ( $this ) {
222
+    if ( $that )
223
+        foo( ${$a[ $b ]});
224 224
 }
225 225
 
226
-while (!$this->readLine($tokens, $tag)); //phpcs:ignore Standard.Category.Sniff
226
+while ( ! $this->readLine( $tokens, $tag ) ); //phpcs:ignore Standard.Category.Sniff
227 227
 
228
-while (!$this->readLine($tokens, $tag)); // comment
228
+while ( ! $this->readLine( $tokens, $tag ) ); // comment
229 229
 
230
-while (!$this->readLine($tokens, $tag)); /* comment */
230
+while ( ! $this->readLine( $tokens, $tag ) ); /* comment */
231 231
 
232
-foreach ($stringParade as $hit)
233
-    $hitParade[] = $hit + 0; // phpcs:ignore Standard.Category.Sniff
232
+foreach ( $stringParade as $hit )
233
+    $hitParade[ ] = $hit + 0; // phpcs:ignore Standard.Category.Sniff
234 234
 
235
-if ($bar)
236
-    if ($foo) echo 'hi'; /* @phpcs:ignore Standard.Category.Sniff */
235
+if ( $bar )
236
+    if ( $foo ) echo 'hi'; /* @phpcs:ignore Standard.Category.Sniff */
237 237
 
238
-if (true) $callable = function () {
238
+if ( true ) $callable = function() {
239 239
     return true;
240 240
 };
Please login to merge, or discard this patch.