Completed
Branch master (d87ed9)
by Tomáš
06:31
created
Standards/Squiz/Tests/NamingConventions/ValidVariableNameUnitTest.php 1 patch
Indentation   +29 added lines, -29 removed lines patch added patch discarded remove patch
@@ -43,35 +43,35 @@
 block discarded – undo
43 43
     public function getErrorList()
44 44
     {
45 45
         $errors = array(
46
-                   3   => 1,
47
-                   5   => 1,
48
-                   10  => 1,
49
-                   12  => 1,
50
-                   15  => 1,
51
-                   17  => 1,
52
-                   20  => 1,
53
-                   22  => 1,
54
-                   25  => 1,
55
-                   27  => 1,
56
-                   31  => 1,
57
-                   33  => 1,
58
-                   36  => 1,
59
-                   37  => 1,
60
-                   39  => 1,
61
-                   42  => 1,
62
-                   44  => 1,
63
-                   53  => 1,
64
-                   58  => 1,
65
-                   62  => 1,
66
-                   63  => 1,
67
-                   64  => 1,
68
-                   67  => 1,
69
-                   81  => 1,
70
-                   106 => 1,
71
-                   107 => 1,
72
-                   108 => 1,
73
-                   117 => 1,
74
-                  );
46
+                    3   => 1,
47
+                    5   => 1,
48
+                    10  => 1,
49
+                    12  => 1,
50
+                    15  => 1,
51
+                    17  => 1,
52
+                    20  => 1,
53
+                    22  => 1,
54
+                    25  => 1,
55
+                    27  => 1,
56
+                    31  => 1,
57
+                    33  => 1,
58
+                    36  => 1,
59
+                    37  => 1,
60
+                    39  => 1,
61
+                    42  => 1,
62
+                    44  => 1,
63
+                    53  => 1,
64
+                    58  => 1,
65
+                    62  => 1,
66
+                    63  => 1,
67
+                    64  => 1,
68
+                    67  => 1,
69
+                    81  => 1,
70
+                    106 => 1,
71
+                    107 => 1,
72
+                    108 => 1,
73
+                    117 => 1,
74
+                    );
75 75
 
76 76
         return $errors;
77 77
 
Please login to merge, or discard this patch.
CodeSniffer/Standards/Squiz/Tests/WhiteSpace/FunctionSpacingUnitTest.inc 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -259,13 +259,13 @@
 block discarded – undo
259 259
 // Closures should be ignored.
260 260
 preg_replace_callback(
261 261
     '~-([a-z])~',
262
-    function ($match) {
262
+    function($match) {
263 263
         return strtoupper($match[1]);
264 264
     },
265 265
     'hello-world'
266 266
 );
267 267
 
268
-$callback = function ($bar) use ($foo)
268
+$callback = function($bar) use ($foo)
269 269
             {
270 270
                 $bar += $foo;
271 271
             };
Please login to merge, or discard this patch.
CodeSniffer/Standards/Squiz/Tests/WhiteSpace/SemicolonSpacingUnitTest.php 3 patches
Switch Indentation   +23 added lines, -23 removed lines patch added patch discarded remove patch
@@ -45,29 +45,29 @@
 block discarded – undo
45 45
     public function getErrorList($testFile='SemicolonSpacingUnitTest.inc')
46 46
     {
47 47
         switch ($testFile) {
48
-        case 'SemicolonSpacingUnitTest.inc':
49
-            return array(
50
-                    3 => 1,
51
-                    4 => 1,
52
-                    5 => 2,
53
-                    6 => 1,
54
-                    8 => 1,
55
-                    9 => 1,
56
-                   );
57
-            break;
58
-        case 'SemicolonSpacingUnitTest.js':
59
-            return array(
60
-                    3  => 1,
61
-                    4  => 1,
62
-                    6  => 1,
63
-                    10 => 2,
64
-                    11 => 1,
65
-                    13 => 1,
66
-                   );
67
-            break;
68
-        default:
69
-            return array();
70
-            break;
48
+            case 'SemicolonSpacingUnitTest.inc':
49
+                return array(
50
+                        3 => 1,
51
+                        4 => 1,
52
+                        5 => 2,
53
+                        6 => 1,
54
+                        8 => 1,
55
+                        9 => 1,
56
+                       );
57
+                break;
58
+            case 'SemicolonSpacingUnitTest.js':
59
+                return array(
60
+                        3  => 1,
61
+                        4  => 1,
62
+                        6  => 1,
63
+                        10 => 2,
64
+                        11 => 1,
65
+                        13 => 1,
66
+                       );
67
+                break;
68
+            default:
69
+                return array();
70
+                break;
71 71
         }//end switch
72 72
 
73 73
     }//end getErrorList()
Please login to merge, or discard this patch.
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -42,7 +42,7 @@
 block discarded – undo
42 42
      *
43 43
      * @return array<int, int>
44 44
      */
45
-    public function getErrorList($testFile='SemicolonSpacingUnitTest.inc')
45
+    public function getErrorList($testFile = 'SemicolonSpacingUnitTest.inc')
46 46
     {
47 47
         switch ($testFile) {
48 48
         case 'SemicolonSpacingUnitTest.inc':
Please login to merge, or discard this patch.
Indentation   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -47,13 +47,13 @@
 block discarded – undo
47 47
             return array(
48 48
                     4 => 1,
49 49
                     5 => 1,
50
-                   );
50
+                    );
51 51
         } else if (version_compare(PHP_VERSION, '5.4.0RC1') >= 0) {
52 52
             // Shorthand echo is always available from PHP 5.4.0 but needed the
53 53
             // short_open_tag ini var to be set for versions before this.
54 54
             return array(
55 55
                     4 => 1,
56
-                   );
56
+                    );
57 57
         }
58 58
 
59 59
         return array();
Please login to merge, or discard this patch.
CodeSniffer/Standards/Squiz/Tests/WhiteSpace/CastSpacingUnitTest.inc 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -1,7 +1,7 @@
 block discarded – undo
1 1
 <?php
2 2
 $var = (int) $var2;
3
-$var = ( int ) $var2;
4
-$var = (int ) $var2;
5
-$var = ( int) $var2;
6
-$var = (	int	) $var2;
3
+$var = (int) $var2;
4
+$var = (int) $var2;
5
+$var = (int) $var2;
6
+$var = (int) $var2;
7 7
 ?>
8 8
\ No newline at end of file
Please login to merge, or discard this patch.
Standards/Squiz/Tests/WhiteSpace/LogicalOperatorSpacingUnitTest.php 2 patches
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -40,7 +40,7 @@
 block discarded – undo
40 40
      *
41 41
      * @return array<int, int>
42 42
      */
43
-    public function getErrorList($testFile='LogicalOperatorSpacingUnitTest.inc')
43
+    public function getErrorList($testFile = 'LogicalOperatorSpacingUnitTest.inc')
44 44
     {
45 45
         return array(
46 46
                 4  => 2,
Please login to merge, or discard this patch.
Indentation   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -57,7 +57,7 @@
 block discarded – undo
57 57
                 48 => 1,
58 58
                 70 => 1,
59 59
                 71 => 1,
60
-               );
60
+                );
61 61
 
62 62
     }//end getErrorList()
63 63
 
Please login to merge, or discard this patch.
Standards/Squiz/Tests/WhiteSpace/ControlStructureSpacingUnitTest.php 3 patches
Switch Indentation   +44 added lines, -44 removed lines patch added patch discarded remove patch
@@ -45,50 +45,50 @@
 block discarded – undo
45 45
     public function getErrorList($testFile='ControlStructureSpacingUnitTest.inc')
46 46
     {
47 47
         switch ($testFile) {
48
-        case 'ControlStructureSpacingUnitTest.inc':
49
-            return array(
50
-                    3   => 1,
51
-                    5   => 1,
52
-                    8   => 1,
53
-                    15  => 1,
54
-                    23  => 1,
55
-                    74  => 1,
56
-                    79  => 1,
57
-                    82  => 1,
58
-                    83  => 1,
59
-                    87  => 1,
60
-                    103 => 1,
61
-                    113 => 2,
62
-                    114 => 2,
63
-                    118 => 1,
64
-                    150 => 1,
65
-                    153 => 1,
66
-                    154 => 1,
67
-                    157 => 1,
68
-                    170 => 1,
69
-                    176 => 2,
70
-                    179 => 1,
71
-                    189 => 1,
72
-                   );
73
-            break;
74
-        case 'ControlStructureSpacingUnitTest.js':
75
-            return array(
76
-                    3  => 1,
77
-                    9  => 1,
78
-                    15 => 1,
79
-                    21 => 1,
80
-                    56 => 1,
81
-                    61 => 1,
82
-                    64 => 1,
83
-                    65 => 1,
84
-                    68 => 1,
85
-                    74 => 2,
86
-                    75 => 2,
87
-                   );
88
-            break;
89
-        default:
90
-            return array();
91
-            break;
48
+            case 'ControlStructureSpacingUnitTest.inc':
49
+                return array(
50
+                        3   => 1,
51
+                        5   => 1,
52
+                        8   => 1,
53
+                        15  => 1,
54
+                        23  => 1,
55
+                        74  => 1,
56
+                        79  => 1,
57
+                        82  => 1,
58
+                        83  => 1,
59
+                        87  => 1,
60
+                        103 => 1,
61
+                        113 => 2,
62
+                        114 => 2,
63
+                        118 => 1,
64
+                        150 => 1,
65
+                        153 => 1,
66
+                        154 => 1,
67
+                        157 => 1,
68
+                        170 => 1,
69
+                        176 => 2,
70
+                        179 => 1,
71
+                        189 => 1,
72
+                       );
73
+                break;
74
+            case 'ControlStructureSpacingUnitTest.js':
75
+                return array(
76
+                        3  => 1,
77
+                        9  => 1,
78
+                        15 => 1,
79
+                        21 => 1,
80
+                        56 => 1,
81
+                        61 => 1,
82
+                        64 => 1,
83
+                        65 => 1,
84
+                        68 => 1,
85
+                        74 => 2,
86
+                        75 => 2,
87
+                       );
88
+                break;
89
+            default:
90
+                return array();
91
+                break;
92 92
         }//end switch
93 93
 
94 94
     }//end getErrorList()
Please login to merge, or discard this patch.
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -42,7 +42,7 @@
 block discarded – undo
42 42
      *
43 43
      * @return array<int, int>
44 44
      */
45
-    public function getErrorList($testFile='ControlStructureSpacingUnitTest.inc')
45
+    public function getErrorList($testFile = 'ControlStructureSpacingUnitTest.inc')
46 46
     {
47 47
         switch ($testFile) {
48 48
         case 'ControlStructureSpacingUnitTest.inc':
Please login to merge, or discard this patch.
Indentation   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -47,13 +47,13 @@
 block discarded – undo
47 47
             return array(
48 48
                     4 => 1,
49 49
                     5 => 1,
50
-                   );
50
+                    );
51 51
         } else if (version_compare(PHP_VERSION, '5.4.0RC1') >= 0) {
52 52
             // Shorthand echo is always available from PHP 5.4.0 but needed the
53 53
             // short_open_tag ini var to be set for versions before this.
54 54
             return array(
55 55
                     4 => 1,
56
-                   );
56
+                    );
57 57
         }
58 58
 
59 59
         return array();
Please login to merge, or discard this patch.
CodeSniffer/Standards/Squiz/Tests/WhiteSpace/OperatorSpacingUnitTest.inc 2 patches
Indentation   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -111,8 +111,8 @@
 block discarded – undo
111 111
 $closureWithDefaultParameter = function (array $testArray=array()) {};
112 112
 
113 113
 switch ($foo) {
114
-	case -1:
115
-		break;
114
+    case -1:
115
+        break;
116 116
 }
117 117
 
118 118
 $y = 1 * -1;
Please login to merge, or discard this patch.
Spacing   +50 added lines, -50 removed lines patch added patch discarded remove patch
@@ -1,67 +1,67 @@  discard block
 block discarded – undo
1 1
 <?php
2 2
 
3 3
 $result = 1 + 2;
4
-$result = 1  + 2;
5
-$result = 1  +   2;
6
-$result = 1 +2;
7
-$result = 1+ 2;
8
-$result = 1+2;
4
+$result = 1 + 2;
5
+$result = 1 + 2;
6
+$result = 1 + 2;
7
+$result = 1 + 2;
8
+$result = 1 + 2;
9 9
 
10 10
 $result = 1 - 2;
11
-$result = 1  - 2;
12
-$result = 1  -   2;
13
-$result = 1 -2;
14
-$result = 1- 2;
15
-$result = 1-2;
11
+$result = 1 - 2;
12
+$result = 1 - 2;
13
+$result = 1 - 2;
14
+$result = 1 - 2;
15
+$result = 1 - 2;
16 16
 
17 17
 $result = 1 * 2;
18
-$result = 1  * 2;
19
-$result = 1  *   2;
20
-$result = 1 *2;
21
-$result = 1* 2;
22
-$result = 1*2;
18
+$result = 1 * 2;
19
+$result = 1 * 2;
20
+$result = 1 * 2;
21
+$result = 1 * 2;
22
+$result = 1 * 2;
23 23
 
24 24
 $result = 1 / 2;
25
-$result = 1  / 2;
26
-$result = 1  /   2;
27
-$result = 1 /2;
28
-$result = 1/ 2;
29
-$result = 1/2;
25
+$result = 1 / 2;
26
+$result = 1 / 2;
27
+$result = 1 / 2;
28
+$result = 1 / 2;
29
+$result = 1 / 2;
30 30
 
31 31
 $result = 1 % 2;
32
-$result = 1  % 2;
33
-$result = 1  %   2;
34
-$result = 1 %2;
35
-$result = 1% 2;
36
-$result = 1%2;
32
+$result = 1 % 2;
33
+$result = 1 % 2;
34
+$result = 1 % 2;
35
+$result = 1 % 2;
36
+$result = 1 % 2;
37 37
 $result = '100%';
38 38
 
39 39
 $result += 4;
40
-$result+=4;
40
+$result += 4;
41
+$result -= 4;
41 42
 $result -= 4;
42
-$result-=4;
43 43
 $result /= 4;
44
-$result/=4;
45
-$result *=4;
46
-$result*=4;
44
+$result /= 4;
45
+$result *= 4;
46
+$result *= 4;
47 47
 
48
-$result =& $thing;
48
+$result = & $thing;
49 49
 if ($result & 4) {
50 50
     if ($result | 4) {
51 51
     }
52 52
 }
53
-if ($result&4 && $result  &  4) {
54
-    if ($result |4 || $result  |  4) {
53
+if ($result & 4 && $result & 4) {
54
+    if ($result | 4 || $result | 4) {
55 55
     }
56 56
 }
57 57
 
58 58
 $result = ((1 + 2) - (3 * 4 / 5) % 6);
59
-$result = ((1+  2)  -  (3*4/5)  %  6);
59
+$result = ((1 + 2) - (3 * 4 / 5) % 6);
60 60
 return -1;
61 61
 $file = '...'.substr($file, (($padding * -1) + 3));
62 62
 
63 63
 $totalErrors   += $errors['errors'];
64
-$totalWarnings +=  $errors['warnings'];
64
+$totalWarnings += $errors['warnings'];
65 65
 
66 66
 if (substr($line, 0, 3) === '/**') {
67 67
     $line = substr($line, 3);
@@ -74,23 +74,23 @@  discard block
 block discarded – undo
74 74
 if ($pos === -1) {
75 75
 }
76 76
 
77
-for ($i=0; $i<=5; $i++) {
78
-    $j^= $i;
79
-    $k %=$i;
80
-    $l&=$i;
81
-    $m.= 'Hello ';
77
+for ($i = 0; $i <= 5; $i++) {
78
+    $j ^= $i;
79
+    $k %= $i;
80
+    $l &= $i;
81
+    $m .= 'Hello ';
82 82
 }
83 83
 
84
-$z = ($a+ $b- $c* $d/ $e% $f^ $g);
85
-$z = ($a +$b -$c *$d /$e %$f ^$g);
84
+$z = ($a + $b - $c * $d / $e % $f ^ $g);
85
+$z = ($a + $b - $c * $d / $e % $f ^ $g);
86 86
 
87
-$a== $b && $c!= $d && $e=== $f && $g!== $h;
88
-$i> $j && $k< $l && $m>= $n && $o<= $p && $q<> $r;
87
+$a == $b && $c != $d && $e === $f && $g !== $h;
88
+$i > $j && $k < $l && $m >= $n && $o <= $p && $q <> $r;
89 89
 
90
-$a ==$b && $c !=$d && $e ===$f && $g !==$h;
91
-$i >$j && $k <$l && $m >=$n && $o <=$p && $q <>$r;
90
+$a == $b && $c != $d && $e === $f && $g !== $h;
91
+$i > $j && $k < $l && $m >= $n && $o <= $p && $q <> $r;
92 92
 
93
-function myFunction($variable=0, $var2='string') {}
93
+function myFunction($variable = 0, $var2 = 'string') {}
94 94
 
95 95
 if (index > -1) {
96 96
 }
@@ -108,7 +108,7 @@  discard block
 block discarded – undo
108 108
 $y = $test ? 1 : -1;
109 109
 $z = $test ?: false;
110 110
 
111
-$closureWithDefaultParameter = function (array $testArray=array()) {};
111
+$closureWithDefaultParameter = function(array $testArray = array()) {};
112 112
 
113 113
 switch ($foo) {
114 114
 	case -1:
@@ -125,7 +125,7 @@  discard block
 block discarded – undo
125 125
 $y = 10 + -2;
126 126
 $y = -10 + 2;
127 127
 
128
-$a = $x?$y:$z;
128
+$a = $x ? $y : $z;
129 129
 $a = $x ? $y : $z;
130 130
 
131 131
 $y = 1
@@ -174,7 +174,7 @@  discard block
 block discarded – undo
174 174
 if ($a <=>$b) {
175 175
 }
176 176
 
177
-$a |=  $b;
177
+$a |= $b;
178 178
 $a **=  $b;
179 179
 
180 180
 $a = +1;
Please login to merge, or discard this patch.
Standards/Squiz/Tests/WhiteSpace/ControlStructureSpacingUnitTest.inc 3 patches
Switch Indentation   +10 added lines, -10 removed lines patch added patch discarded remove patch
@@ -57,16 +57,16 @@
 block discarded – undo
57 57
 }
58 58
 
59 59
 switch ($blah) {
60
-    case 'one':
61
-        if ($blah) {
62
-            // There are no spaces before break.
63
-        }
64
-    break;
65
-
66
-    default:
67
-        if ($blah) {
68
-            // Code here.
69
-        }
60
+        case 'one':
61
+            if ($blah) {
62
+                // There are no spaces before break.
63
+            }
64
+        break;
65
+
66
+        default:
67
+            if ($blah) {
68
+                // Code here.
69
+            }
70 70
 }
71 71
 
72 72
 foreach ($blah as $var) {
Please login to merge, or discard this patch.
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -110,8 +110,8 @@  discard block
 block discarded – undo
110 110
     $settingsUpdated = FALSE;
111 111
 }
112 112
 
113
-foreach ( $blah as $var ) {
114
-    if (  $blah    ) {
113
+foreach ($blah as $var) {
114
+    if ($blah) {
115 115
     }
116 116
 }
117 117
 
@@ -173,7 +173,7 @@  discard block
 block discarded – undo
173 173
 
174 174
 do {
175 175
     echo 'hi';
176
-} while (  $blah  );
176
+} while ($blah);
177 177
 
178 178
 if ($one) {
179 179
 }
Please login to merge, or discard this patch.
Braces   +5 added lines, -5 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,8 +194,7 @@  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 199
 }
200 200
 
Please login to merge, or discard this patch.
Standards/Squiz/Tests/WhiteSpace/FunctionClosingBraceSpaceUnitTest.php 3 patches
Switch Indentation   +25 added lines, -25 removed lines patch added patch discarded remove patch
@@ -45,31 +45,31 @@
 block discarded – undo
45 45
     public function getErrorList($testFile='FunctionClosingBraceSpaceUnitTest.inc')
46 46
     {
47 47
         switch ($testFile) {
48
-        case 'FunctionClosingBraceSpaceUnitTest.inc':
49
-            return array(
50
-                    10 => 1,
51
-                    21 => 1,
52
-                    28 => 1,
53
-                    29 => 1,
54
-                    31 => 1,
55
-                    39 => 1,
56
-                   );
57
-            break;
58
-        case 'FunctionClosingBraceSpaceUnitTest.js':
59
-            return array(
60
-                    13  => 1,
61
-                    25  => 1,
62
-                    32  => 1,
63
-                    53  => 1,
64
-                    59  => 1,
65
-                    67  => 1,
66
-                    84  => 1,
67
-                    128 => 1,
68
-                   );
69
-            break;
70
-        default:
71
-            return array();
72
-            break;
48
+            case 'FunctionClosingBraceSpaceUnitTest.inc':
49
+                return array(
50
+                        10 => 1,
51
+                        21 => 1,
52
+                        28 => 1,
53
+                        29 => 1,
54
+                        31 => 1,
55
+                        39 => 1,
56
+                       );
57
+                break;
58
+            case 'FunctionClosingBraceSpaceUnitTest.js':
59
+                return array(
60
+                        13  => 1,
61
+                        25  => 1,
62
+                        32  => 1,
63
+                        53  => 1,
64
+                        59  => 1,
65
+                        67  => 1,
66
+                        84  => 1,
67
+                        128 => 1,
68
+                       );
69
+                break;
70
+            default:
71
+                return array();
72
+                break;
73 73
         }//end switch
74 74
 
75 75
     }//end getErrorList()
Please login to merge, or discard this patch.
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -42,7 +42,7 @@
 block discarded – undo
42 42
      *
43 43
      * @return array<int, int>
44 44
      */
45
-    public function getErrorList($testFile='FunctionClosingBraceSpaceUnitTest.inc')
45
+    public function getErrorList($testFile = 'FunctionClosingBraceSpaceUnitTest.inc')
46 46
     {
47 47
         switch ($testFile) {
48 48
         case 'FunctionClosingBraceSpaceUnitTest.inc':
Please login to merge, or discard this patch.
Indentation   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -47,13 +47,13 @@
 block discarded – undo
47 47
             return array(
48 48
                     4 => 1,
49 49
                     5 => 1,
50
-                   );
50
+                    );
51 51
         } else if (version_compare(PHP_VERSION, '5.4.0RC1') >= 0) {
52 52
             // Shorthand echo is always available from PHP 5.4.0 but needed the
53 53
             // short_open_tag ini var to be set for versions before this.
54 54
             return array(
55 55
                     4 => 1,
56
-                   );
56
+                    );
57 57
         }
58 58
 
59 59
         return array();
Please login to merge, or discard this patch.