Failed Conditions
Push — main ( 5e853a...7a764b )
by Roman
01:57
created
src/NumberTool.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -16,7 +16,7 @@  discard block
 block discarded – undo
16 16
      */
17 17
     private static function f($s)
18 18
     {
19
-        return sprintf('%.' . self::SCALE . 'f', $s);
19
+        return sprintf('%.'.self::SCALE.'f', $s);
20 20
     }
21 21
 
22 22
     /**
@@ -105,7 +105,7 @@  discard block
 block discarded – undo
105 105
         if ($precision === 0) {
106 106
             return $x[0];
107 107
         }
108
-        return $x[0] . '.' . substr($x[1], 0, $precision);
108
+        return $x[0].'.'.substr($x[1], 0, $precision);
109 109
     }
110 110
 
111 111
     /**
@@ -255,7 +255,7 @@  discard block
 block discarded – undo
255 255
 
256 256
     public static function isZero($number): bool
257 257
     {
258
-        return (float)$number === .0;
258
+        return (float) $number === .0;
259 259
     }
260 260
 
261 261
     /**
Please login to merge, or discard this patch.
src/Financial.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -276,12 +276,12 @@
 block discarded – undo
276 276
         array_multisort($timestamps, $values);
277 277
 
278 278
         //XIRR determine first timestamp
279
-        $lowestTimestamp = new \DateTime('@' . min($timestamps));
279
+        $lowestTimestamp = new \DateTime('@'.min($timestamps));
280 280
 
281 281
         $dates = [];
282 282
         foreach ($values as $key => $value) {
283 283
             //XIRR Calculate the number of days between the given timestamp and the lowest timestamp
284
-            $dates[] = date_diff($lowestTimestamp, date_create('@' . $timestamps[$key]))->days;
284
+            $dates[] = date_diff($lowestTimestamp, date_create('@'.$timestamps[$key]))->days;
285 285
 
286 286
             if ($value > 0) {
287 287
                 $positive = true;
Please login to merge, or discard this patch.
src/DateTool.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -34,11 +34,11 @@
 block discarded – undo
34 34
 
35 35
     public static function smallerOrSameDate(?\DateTimeInterface $d1, ?\DateTimeInterface $d2): bool
36 36
     {
37
-        if(null === $d1) {
37
+        if (null === $d1) {
38 38
             return true;
39 39
         }
40 40
 
41
-        if(null === $d2) {
41
+        if (null === $d2) {
42 42
             return false;
43 43
         }
44 44
 
Please login to merge, or discard this patch.
src/Censor.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -14,7 +14,7 @@
 block discarded – undo
14 14
             return $value;
15 15
         }
16 16
 
17
-        $string = (string)$value;
17
+        $string = (string) $value;
18 18
 
19 19
         return preg_replace('/\p{L}|\d/u', '█', $string);
20 20
     }
Please login to merge, or discard this patch.
src/StringTool.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -14,7 +14,7 @@  discard block
 block discarded – undo
14 14
         return mb_stripos($haystack, $needle, 0) === 0;
15 15
     }
16 16
 
17
-    public static function endsWith($haystack,$needle, $case = true)
17
+    public static function endsWith($haystack, $needle, $case = true)
18 18
     {
19 19
         mb_internal_encoding('UTF-8');
20 20
         
@@ -89,7 +89,7 @@  discard block
 block discarded – undo
89 89
         $string = str_replace($search, $replace, $string);
90 90
 
91 91
         // Remove any non-ASCII Characters (keeps cyrillic)
92
-        $string = preg_replace("/[^\x80-\xFF, \x01-\x7F]/","", $string);
92
+        $string = preg_replace("/[^\x80-\xFF, \x01-\x7F]/", "", $string);
93 93
 
94 94
         return $string; 
95 95
     }
@@ -248,8 +248,8 @@  discard block
 block discarded – undo
248 248
      */
249 249
     public static function polishToLatin($string)
250 250
     {
251
-        $polishChars = ['Ą','Ć','Ę','Ł','Ó','Ś','Ź','Ż','Ń','ą','ć','ę','ł','ó','ś','ź','ż','ń'];
252
-        $latinChars = ['A','C','E','L','O','S','Z','Z','N','a','c','e','l','o','s','z','z','n'];
251
+        $polishChars = ['Ą', 'Ć', 'Ę', 'Ł', 'Ó', 'Ś', 'Ź', 'Ż', 'Ń', 'ą', 'ć', 'ę', 'ł', 'ó', 'ś', 'ź', 'ż', 'ń'];
252
+        $latinChars = ['A', 'C', 'E', 'L', 'O', 'S', 'Z', 'Z', 'N', 'a', 'c', 'e', 'l', 'o', 's', 'z', 'z', 'n'];
253 253
 
254 254
         return str_replace($polishChars, $latinChars, $string);
255 255
     }
@@ -307,7 +307,7 @@  discard block
 block discarded – undo
307 307
         }
308 308
 
309 309
         $price = preg_replace('/[^0-9]+/', '', $price);
310
-        $price = $price . '.' . $decimals;
310
+        $price = $price.'.'.$decimals;
311 311
 
312 312
         return $price;
313 313
     }
Please login to merge, or discard this patch.
src/XML2Array.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -58,7 +58,7 @@  discard block
 block discarded – undo
58 58
         }
59 59
 
60 60
         $array[$xml->documentElement->tagName] = self::convert($xml->documentElement);
61
-        self::$xml = null;    // clear the xml node in the class for 2nd time use.
61
+        self::$xml = null; // clear the xml node in the class for 2nd time use.
62 62
 
63 63
         return $array;
64 64
     }
@@ -78,7 +78,7 @@  discard block
 block discarded – undo
78 78
             $xml = self::$xml = $input_xml;
79 79
         }
80 80
         $array[$xml->documentElement->tagName] = self::convert($xml->documentElement);
81
-        self::$xml = null;    // clear the xml node in the class for 2nd time use.
81
+        self::$xml = null; // clear the xml node in the class for 2nd time use.
82 82
 
83 83
         return $array;
84 84
     }
@@ -139,7 +139,7 @@  discard block
 block discarded – undo
139 139
                 if ($node->attributes->length) {
140 140
                     $a = [];
141 141
                     foreach ($node->attributes as $attrName => $attrNode) {
142
-                        $a[$attrName] = (string)$attrNode->value;
142
+                        $a[$attrName] = (string) $attrNode->value;
143 143
                     }
144 144
                     // if its an leaf node, store the value in @value instead of directly storing it.
145 145
                     if (!is_array($output)) {
Please login to merge, or discard this patch.
src/FtpSimpleClient.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -171,7 +171,7 @@  discard block
 block discarded – undo
171 171
         }
172 172
 
173 173
         throw new \Exception(sprintf($this->error,
174
-            'Unable to put the file "' . $remote_file . '"'
174
+            'Unable to put the file "'.$remote_file.'"'
175 175
         ));
176 176
     }
177 177
 
@@ -193,7 +193,7 @@  discard block
 block discarded – undo
193 193
         }
194 194
 
195 195
         throw new \Exception(sprintf($this->error,
196
-            'Unable to put the remote file from the local file "' . $local_file . '"'
196
+            'Unable to put the remote file from the local file "'.$local_file.'"'
197 197
         ));
198 198
     }
199 199
 
@@ -338,7 +338,7 @@  discard block
 block discarded – undo
338 338
      */
339 339
     public function __call($function, array $arguments)
340 340
     {
341
-        $function = 'ftp_' . $function;
341
+        $function = 'ftp_'.$function;
342 342
 
343 343
         if (function_exists($function)) {
344 344
             array_unshift($arguments, $this->conn);
Please login to merge, or discard this patch.
src/Transliterator.php 1 patch
Spacing   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -7,14 +7,14 @@
 block discarded – undo
7 7
     public static function unaccent(string $string, bool $transliterateCyrillic = true): string
8 8
     {
9 9
         if ($transliterateCyrillic) {
10
-            $cyr  = ['а','б','в','г','д','е','ё','ж','з','и','й','к','л','м','н','о','п','р','с','т','у',
11
-                'ф','х','ц','ч','ш','щ','ъ', 'ы','ь', 'э', 'ю','я',
12
-                'А','Б','В','Г','Д','Е','Ё','Ж','З','И','Й','К','Л','М','Н','О','П','Р','С','Т','У',
13
-                'Ф','Х','Ц','Ч','Ш','Щ','Ъ', 'Ы','Ь', 'Э', 'Ю','Я'];
14
-            $lat = ['a','b','v','g','d','e','e','zh','z','i','y','k','l','m','n','o','p','r','s','t','u',
15
-                'f' ,'h' ,'ts' ,'ch','sh' ,'sht' ,'i', 'y', 'y', 'e' ,'yu' ,'ya','A','B','V','G','D','E','E','Zh',
16
-                'Z','I','Y','K','L','M','N','O','P','R','S','T','U',
17
-                'F' ,'H' ,'Ts' ,'Ch','Sh' ,'Sht' ,'I' ,'Y' ,'Y', 'E', 'Yu' ,'Ya'];
10
+            $cyr = ['а', 'б', 'в', 'г', 'д', 'е', 'ё', 'ж', 'з', 'и', 'й', 'к', 'л', 'м', 'н', 'о', 'п', 'р', 'с', 'т', 'у',
11
+                'ф', 'х', 'ц', 'ч', 'ш', 'щ', 'ъ', 'ы', 'ь', 'э', 'ю', 'я',
12
+                'А', 'Б', 'В', 'Г', 'Д', 'Е', 'Ё', 'Ж', 'З', 'И', 'Й', 'К', 'Л', 'М', 'Н', 'О', 'П', 'Р', 'С', 'Т', 'У',
13
+                'Ф', 'Х', 'Ц', 'Ч', 'Ш', 'Щ', 'Ъ', 'Ы', 'Ь', 'Э', 'Ю', 'Я'];
14
+            $lat = ['a', 'b', 'v', 'g', 'd', 'e', 'e', 'zh', 'z', 'i', 'y', 'k', 'l', 'm', 'n', 'o', 'p', 'r', 's', 't', 'u',
15
+                'f', 'h', 'ts', 'ch', 'sh', 'sht', 'i', 'y', 'y', 'e', 'yu', 'ya', 'A', 'B', 'V', 'G', 'D', 'E', 'E', 'Zh',
16
+                'Z', 'I', 'Y', 'K', 'L', 'M', 'N', 'O', 'P', 'R', 'S', 'T', 'U',
17
+                'F', 'H', 'Ts', 'Ch', 'Sh', 'Sht', 'I', 'Y', 'Y', 'E', 'Yu', 'Ya'];
18 18
 
19 19
             $string = str_replace($cyr, $lat, $string);
20 20
         }
Please login to merge, or discard this patch.