Passed
Pull Request — master (#5)
by
unknown
08:17
created
src/Standards/Squiz/Tests/PHP/NonExecutableCodeUnitTest.1.inc 1 patch
Braces   +16 added lines, -12 removed lines patch added patch discarded remove patch
@@ -60,8 +60,9 @@  discard block
 block discarded – undo
60 60
 
61 61
 while ($line=fgets($fp,2*1024*1024))
62 62
 {
63
-    if (!preg_match("/^<([a-z0-9_]+)/",$line,$matches))
64
-    continue;
63
+    if (!preg_match("/^<([a-z0-9_]+)/",$line,$matches)) {
64
+        continue;
65
+    }
65 66
     print $line;
66 67
 }
67 68
 
@@ -183,19 +184,21 @@  discard block
 block discarded – undo
183 184
 function test(){
184 185
     switch($a) {
185 186
         case 1:
186
-            if (empty($b))
187
-                return 0;
187
+            if (empty($b)) {
188
+                            return 0;
189
+            }
188 190
             break;
189 191
         default:
190 192
             return 2;
191 193
     }
192 194
 
193
-    if (empty($a))
194
-        echo '1';
195
-    elseif ($empty($b))
196
-        return 0;
197
-    else
198
-        return 1;
195
+    if (empty($a)) {
196
+            echo '1';
197
+    } elseif ($empty($b)) {
198
+            return 0;
199
+    } else {
200
+            return 1;
201
+    }
199 202
 
200 203
     echo "oi";
201 204
     return 1;
@@ -203,8 +206,9 @@  discard block
 block discarded – undo
203 206
 
204 207
 switch ($foo) {
205 208
     case 'foo':
206
-        if ($foo)
207
-            return $foo;
209
+        if ($foo) {
210
+                    return $foo;
211
+        }
208 212
         return $bar;
209 213
     default:
210 214
         return $bar;
Please login to merge, or discard this patch.
src/Standards/Squiz/Tests/PHP/DisallowMultipleAssignmentsUnitTest.inc 1 patch
Braces   +2 added lines, -1 removed lines patch added patch discarded remove patch
@@ -44,8 +44,9 @@
 block discarded – undo
44 44
 @$a = 1;
45 45
 
46 46
 $a = [];
47
-foreach ($a as $b)
47
+foreach ($a as $b) {
48 48
     $c = 'd';
49
+}
49 50
 
50 51
 $var = $var2;
51 52
 list ($a, $b) = explode(',', $c);
Please login to merge, or discard this patch.
src/Standards/Squiz/Tests/WhiteSpace/ControlStructureSpacingUnitTest.inc 1 patch
Braces   +6 added lines, -7 removed lines patch added patch discarded remove patch
@@ -17,7 +17,8 @@  discard block
 block discarded – undo
17 17
 }
18 18
 
19 19
 if ($one) {
20
-} else ($two) {
20
+} else {
21
+    ($two) {
21 22
 } else if ($three) {
22 23
 } elseif ($four) {
23 24
 }
@@ -48,6 +49,7 @@  discard block
 block discarded – undo
48 49
             // There are no spaces before break.
49 50
         }
50 51
     break;
52
+}
51 53
 
52 54
     default:
53 55
         if ($blah) {
@@ -158,8 +160,7 @@  discard block
 block discarded – undo
158 160
 }
159 161
 
160 162
 if ($one) {
161
-}
162
-elseif ($two) {
163
+} elseif ($two) {
163 164
 }
164 165
 // else if something
165 166
 else if ($three) {
@@ -193,11 +194,9 @@  discard block
 block discarded – undo
193 194
 
194 195
 try {
195 196
     // Something
196
-}
197
-catch (Exception $e) {
197
+} catch (Exception $e) {
198 198
     // Something
199
-}
200
-finally {
199
+} finally {
201 200
     // Something
202 201
 }
203 202
 
Please login to merge, or discard this patch.
src/Standards/Squiz/Tests/Commenting/FileCommentUnitTest.3.inc 1 patch
Braces   -8 removed lines patch added patch discarded remove patch
@@ -1,9 +1,1 @@
 block discarded – undo
1 1
 <?php
2
-/**
3
- * File comment.
4
- *
5
- * @package    Package
6
- * @subpackage Subpackage
7
- * @author     Squiz Pty Ltd <[email protected]>
8
- * @copyright  2010-2014 Squiz Pty Ltd (ABN 77 084 670 600)
9
- *
Please login to merge, or discard this patch.
Standards/Squiz/Tests/Commenting/LongConditionClosingCommentUnitTest.inc 1 patch
Braces   +2 added lines, -1 removed lines patch added patch discarded remove patch
@@ -697,8 +697,9 @@
 block discarded – undo
697 697
 // Yes, code like this does exist.
698 698
 if ($foo) {
699 699
     return $foo;
700
-} elseif ($bar)
700
+} elseif ($bar) {
701 701
     return $bar;
702
+}
702 703
 
703 704
 switch ($foo) {
704 705
     case 1:
Please login to merge, or discard this patch.
src/Standards/Squiz/Tests/Formatting/OperatorBracketUnitTest.inc 1 patch
Braces   +6 added lines, -2 removed lines patch added patch discarded remove patch
@@ -105,8 +105,12 @@
 block discarded – undo
105 105
 
106 106
 }//end class
107 107
 
108
-if ($index < -1) $index = 0;
109
-if ($index < - 1) $index = 0;
108
+if ($index < -1) {
109
+    $index = 0;
110
+}
111
+if ($index < - 1) {
112
+    $index = 0;
113
+}
110 114
 
111 115
 $three = ceil($one / $two);
112 116
 $three = ceil(($one / $two) / $four);
Please login to merge, or discard this patch.
src/Standards/Squiz/Tests/ControlStructures/ControlSignatureUnitTest.inc 1 patch
Braces   +30 added lines, -21 removed lines patch added patch discarded remove patch
@@ -59,7 +59,7 @@  discard block
 block discarded – undo
59 59
 
60 60
 if ($i == 0) {
61 61
     $i = 1;
62
-}else{
62
+} else{
63 63
     $i = 0;
64 64
 }
65 65
 
@@ -73,7 +73,7 @@  discard block
 block discarded – undo
73 73
 
74 74
 if ($i == 0) {
75 75
     $i = 1;
76
-}else   if($i == 2){
76
+} else   if($i == 2){
77 77
     $i = 0;
78 78
 }
79 79
 
@@ -96,11 +96,13 @@  discard block
 block discarded – undo
96 96
     $i = 1;
97 97
 }
98 98
 
99
-if ($i == 0) /* this is ok */ {
99
+if ($i == 0) {
100
+    /* this is ok */ {
100 101
 }
101 102
 
102 103
 try {
103 104
     $code = 'this';
105
+}
104 106
 } catch (Exception $e) {
105 107
     // Caught!
106 108
 }
@@ -119,8 +121,7 @@  discard block
 block discarded – undo
119 121
 
120 122
 if ($a) {
121 123
 
122
-}
123
-elseif ($b) {
124
+} elseif ($b) {
124 125
 }
125 126
 
126 127
 foreach ($items as $item) {
@@ -131,27 +132,29 @@  discard block
 block discarded – undo
131 132
     echo $item;
132 133
 }
133 134
 
134
-if ($a && $b) // && $c)
135
+if ($a && $b) {
136
+    // && $c)
135 137
 {
136 138
 }
137 139
 
138 140
 if ($a == 5) :
139 141
     echo "a equals 5";
142
+}
140 143
     echo "...";
141 144
 elseif ($a == 6) :
142 145
     echo "a equals 6";
143 146
     echo "!!!";
144
-else :
147
+else {
148
+    :
145 149
     echo "a is neither 5 nor 6";
150
+}
146 151
 endif;
147 152
 
148 153
 try {
149 154
     // try body
150
-}
151
-catch (FirstExceptionType $e) {
155
+} catch (FirstExceptionType $e) {
152 156
     // catch body
153
-}
154
-catch (OtherExceptionType $e) {
157
+} catch (OtherExceptionType $e) {
155 158
     // catch body
156 159
 }
157 160
 
@@ -207,9 +210,10 @@  discard block
 block discarded – undo
207 210
         echo 'b';
208 211
     } else {
209 212
         echo 'not b';
210
-    }
211
-else :
213
+    } else {
214
+    :
212 215
     echo 'not 1';
216
+}
213 217
 endif;
214 218
 
215 219
 // @codingStandardsChangeSetting Squiz.ControlStructures.ControlSignature requiredSpacesBeforeColon 0
@@ -220,8 +224,10 @@  discard block
 block discarded – undo
220 224
 elseif ($a == 6):
221 225
     echo "a equals 6";
222 226
     echo "!!!";
223
-else:
227
+else {
228
+    :
224 229
     echo "a is neither 5 nor 6";
230
+}
225 231
 endif;
226 232
 
227 233
 switch($foo) {
@@ -280,20 +286,23 @@  discard block
 block discarded – undo
280 286
 // phpcs:ignore Standard.Category.Sniff
281 287
 catch (Exception $exception) {
282 288
     $x = 2;
283
-}
284
-finally {
289
+} finally {
285 290
     $x = 3;
286 291
 }
287 292
 
288 293
 if ($this) {
289
-    if ($that)
290
-        foo(${$a[$b]});
291
-}
294
+    if ($that) {
295
+            foo(${$a[$b]});
296
+    }
297
+    }
292 298
 
293
-while ( $level-- ) ob_end_clean();
299
+while ( $level-- ) {
300
+    ob_end_clean();
301
+}
294 302
 
295
-while ( $level-- )
303
+while ( $level-- ) {
296 304
 	ob_end_clean();
305
+}
297 306
 
298 307
 while ( $level-- ):
299 308
 	ob_end_clean();
Please login to merge, or discard this patch.
src/Standards/PSR2/Tests/Files/EndFileNewlineUnitTest.10.inc 1 patch
Braces   -2 removed lines patch added patch discarded remove patch
@@ -1,3 +1,1 @@
 block discarded – undo
1 1
 <?php
2
-/** Why me?
3
-
Please login to merge, or discard this patch.
php_codesniffer/src/Standards/PSR2/Tests/Files/EndFileNewlineUnitTest.8.inc 1 patch
Braces   -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.