Completed
Push — master ( c32898...a8df78 )
by Michał
04:13
created
src/Data/Xml.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -180,7 +180,7 @@  discard block
 block discarded – undo
180 180
      */
181 181
     public function checkId($elementId)
182 182
     {
183
-        return (bool)$this->getElementById($elementId);
183
+        return (bool) $this->getElementById($elementId);
184 184
     }
185 185
 
186 186
     /**
@@ -236,6 +236,6 @@  discard block
 block discarded – undo
236 236
      */
237 237
     public function __toString()
238 238
     {
239
-        return (string)$this->saveXmlFile();
239
+        return (string) $this->saveXmlFile();
240 240
     }
241 241
 }
Please login to merge, or discard this patch.
src/Calculation/Math.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -24,7 +24,7 @@  discard block
 block discarded – undo
24 24
             return 0;
25 25
         }
26 26
 
27
-        return 100 - (($into / $from) *100);
27
+        return 100 - (($into / $from) * 100);
28 28
     }
29 29
 
30 30
     /**
@@ -40,7 +40,7 @@  discard block
 block discarded – undo
40 40
             return 0;
41 41
         }
42 42
 
43
-        return ($part / $all) *100;
43
+        return ($part / $all) * 100;
44 44
     }
45 45
 
46 46
     /**
@@ -56,7 +56,7 @@  discard block
 block discarded – undo
56 56
             return 0;
57 57
         }
58 58
 
59
-        return ($part / 100) *$all;
59
+        return ($part / 100) * $all;
60 60
     }
61 61
 
62 62
     /**
@@ -88,11 +88,11 @@  discard block
 block discarded – undo
88 88
     {
89 89
         sort($data);
90 90
         $valuesCount = count($data);
91
-        $key = ($valuesCount -1 ) / 2;
91
+        $key = ($valuesCount - 1) / 2;
92 92
         $median = $data[$key];
93 93
 
94 94
         if (!($valuesCount % 2)) {
95
-            $median = ($median + $data[$key +1]) / 2;
95
+            $median = ($median + $data[$key + 1]) / 2;
96 96
         }
97 97
 
98 98
         return $median;
Please login to merge, or discard this patch.
src/Check/Validator.php 1 patch
Spacing   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -49,8 +49,8 @@  discard block
 block discarded – undo
49 49
         'date' =>               '#^[\\d]{4}-[\\d]{2}-[\\d]{2}$#',
50 50
         'month' =>              '#^[\\d]{4}-[\\d]{2}$#',
51 51
         'datetime' =>           '#^[\\d]{4}-[\\d]{2}-[\\d]{2} [\\d]{2}:[\\d]{2}$#',
52
-        'jdate' =>              '#^[\\d]{2}/[\\d]{2}/[\\d]{4}$#',                        //time from jquery datepicker
53
-        'jdatetime' =>          '#^[\\d]{2}/[\\d]{2}/[\\d]{4} [\\d]{2}:[\\d]{2}$#',      //time from jquery datepicker
52
+        'jdate' =>              '#^[\\d]{2}/[\\d]{2}/[\\d]{4}$#', //time from jquery datepicker
53
+        'jdatetime' =>          '#^[\\d]{2}/[\\d]{2}/[\\d]{4} [\\d]{2}:[\\d]{2}$#', //time from jquery datepicker
54 54
         'time' =>               '#^[\\d]{2}:[\\d]{2}(:[\\d]{2})?$#',
55 55
         'hex_color' =>          '/^#[\\da-f]{6}$/i',
56 56
         'hex' =>                '/^#[\\da-f]+$/i',
@@ -193,7 +193,7 @@  discard block
 block discarded – undo
193 193
                 $sum += $nip[$key] * $val;
194 194
             }
195 195
 
196
-            return (string)($sum % 11) === $nip[9];
196
+            return (string) ($sum % 11) === $nip[9];
197 197
         }
198 198
 
199 199
         return false;
@@ -274,7 +274,7 @@  discard block
 block discarded – undo
274 274
         $int = 10 - $intSum % 10;
275 275
         $intControlNr = ($int === 10) ? 0 : $int;
276 276
 
277
-        return (string)$intControlNr === $value[10];
277
+        return (string) $intControlNr === $value[10];
278 278
     }
279 279
 
280 280
     /**
@@ -302,7 +302,7 @@  discard block
 block discarded – undo
302 302
         $int = $intSum % 11;
303 303
         $intControlNr = ($int === 10) ? 0 : $int;
304 304
 
305
-        return (string)$intControlNr === $value[8];
305
+        return (string) $intControlNr === $value[8];
306 306
     }
307 307
 
308 308
     /**
@@ -328,7 +328,7 @@  discard block
 block discarded – undo
328 328
         ];
329 329
 
330 330
         foreach ($aNumWeight as $key => $num) {
331
-            $iNumSum += $num * $iNRB[29 -$key];
331
+            $iNumSum += $num * $iNRB[29 - $key];
332 332
         }
333 333
 
334 334
         return $iNumSum % 97 === 1;
@@ -344,7 +344,7 @@  discard block
 block discarded – undo
344 344
     {
345 345
         $values = '';
346 346
         $mod = 0;
347
-        $remove = [' ', '-', '_', '.', ',','/', '|'];
347
+        $remove = [' ', '-', '_', '.', ',', '/', '|'];
348 348
         $cleared = str_replace($remove, '', $value);
349 349
         $temp = strtoupper($cleared);
350 350
 
@@ -364,7 +364,7 @@  discard block
 block discarded – undo
364 364
         $sum = strlen($values);
365 365
         for ($i = 0; $i < $sum; $i += 6) {
366 366
             $separated = $mod . substr($values, $i, 6);
367
-            $mod = (int)($separated) % 97;
367
+            $mod = (int) ($separated) % 97;
368 368
         }
369 369
 
370 370
         return $mod === 1;
@@ -437,7 +437,7 @@  discard block
 block discarded – undo
437 437
             return false;
438 438
         }
439 439
 
440
-        $check = (abs($value) -abs($default)) % $step;
440
+        $check = (abs($value) - abs($default)) % $step;
441 441
 
442 442
         if ($check) {
443 443
             return false;
Please login to merge, or discard this patch.
tests/MathTest.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -68,14 +68,14 @@
 block discarded – undo
68 68
     {
69 69
         return [
70 70
             [
71
-                [1,1,1,1,2,2,3,1,100,5,3,7,2,3,62,8,9,45,3,2,45,6,7,8,99,6,64,3,2,22,1,1],
71
+                [1, 1, 1, 1, 2, 2, 3, 1, 100, 5, 3, 7, 2, 3, 62, 8, 9, 45, 3, 2, 45, 6, 7, 8, 99, 6, 64, 3, 2, 22, 1, 1],
72 72
                 [
73 73
                     'avg' => 16.40625,
74 74
                     'median' => 3,
75 75
                 ]
76 76
             ],
77 77
             [
78
-                [1,2,2,3,1,100,5,3,7,2,3,62,8,9,45,3,2,45,6,7,8,99,6,64,3,2,22,1,1],
78
+                [1, 2, 2, 3, 1, 100, 5, 3, 7, 2, 3, 62, 8, 9, 45, 3, 2, 45, 6, 7, 8, 99, 6, 64, 3, 2, 22, 1, 1],
79 79
                 [
80 80
                     'avg' => 18,
81 81
                     'median' => 5,
Please login to merge, or discard this patch.
tests/ValidatorTest.php 1 patch
Spacing   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -17,7 +17,7 @@  discard block
 block discarded – undo
17 17
     public function testRegularExpressions()
18 18
     {
19 19
         $this->functionTest(
20
-            function ($expression, $type) {
20
+            function($expression, $type) {
21 21
                 return Validator::valid($expression, $type);
22 22
             }
23 23
         );
@@ -28,7 +28,7 @@  discard block
 block discarded – undo
28 28
     public function testMail()
29 29
     {
30 30
         $this->functionTest(
31
-            function ($expression) {
31
+            function($expression) {
32 32
                 return Validator::mail($expression);
33 33
             },
34 34
             'mail'
@@ -38,7 +38,7 @@  discard block
 block discarded – undo
38 38
     public function testPrice()
39 39
     {
40 40
         $this->functionTest(
41
-            function ($expression) {
41
+            function($expression) {
42 42
                 return Validator::price($expression);
43 43
             },
44 44
             'price'
@@ -48,7 +48,7 @@  discard block
 block discarded – undo
48 48
     public function testPostcode()
49 49
     {
50 50
         $this->functionTest(
51
-            function ($expression) {
51
+            function($expression) {
52 52
                 return Validator::postcode($expression);
53 53
             },
54 54
             'postcode'
@@ -74,7 +74,7 @@  discard block
 block discarded – undo
74 74
         ]];
75 75
 
76 76
         $this->check(
77
-            function ($expression) {
77
+            function($expression) {
78 78
                 return Validator::nip($expression);
79 79
             },
80 80
             $values
@@ -168,21 +168,21 @@  discard block
 block discarded – undo
168 168
         $url = $this->regularExpressionsProvider()['url'];
169 169
 
170 170
         $this->check(
171
-            function ($expression) {
171
+            function($expression) {
172 172
                 return Validator::url($expression, 1);
173 173
             },
174 174
             ['url_extend' => $urlExtended]
175 175
         );
176 176
 
177 177
         $this->check(
178
-            function ($expression) {
178
+            function($expression) {
179 179
                 return Validator::url($expression, 2);
180 180
             },
181 181
             ['url_full' => $urlFull]
182 182
         );
183 183
 
184 184
         $this->check(
185
-            function ($expression) {
185
+            function($expression) {
186 186
                 return Validator::url($expression);
187 187
             },
188 188
             ['url' => $url]
@@ -192,7 +192,7 @@  discard block
 block discarded – undo
192 192
     public function testPhone()
193 193
     {
194 194
         $this->functionTest(
195
-            function ($expression) {
195
+            function($expression) {
196 196
                 return Validator::phone($expression);
197 197
             },
198 198
             'phone'
Please login to merge, or discard this patch.
tests/XmlTest.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -131,7 +131,7 @@
 block discarded – undo
131 131
 
132 132
         $this->assertEquals(file_get_contents(self::XML_EXPECTED), $xmlString);
133 133
 
134
-        ob_start(function ($output) {
134
+        ob_start(function($output) {
135 135
             $this->assertEquals(file_get_contents(self::XML_EXPECTED), $output);
136 136
         });
137 137
         echo $xml;
Please login to merge, or discard this patch.