Passed
Push — develop ( a3a182...5b7e65 )
by nguereza
02:13
created
src/Helper/Str.php 1 patch
Spacing   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -90,7 +90,7 @@  discard block
 block discarded – undo
90 90
             $value = str_replace($val, $key, $value);
91 91
         }
92 92
 
93
-        return (string)preg_replace('/[^\x20-\x7E]/u', '', $value);
93
+        return (string) preg_replace('/[^\x20-\x7E]/u', '', $value);
94 94
     }
95 95
 
96 96
     /**
@@ -257,7 +257,7 @@  discard block
 block discarded – undo
257 257
         // pattern such as "library/*", making any string check convenient.
258 258
         $cleanQuoted = str_replace('\*', '.*', $quoted);
259 259
 
260
-        return (bool)preg_match('#^' . $cleanQuoted . '\z#', $value);
260
+        return (bool) preg_match('#^' . $cleanQuoted . '\z#', $value);
261 261
     }
262 262
 
263 263
     /**
@@ -569,7 +569,7 @@  discard block
 block discarded – undo
569 569
      */
570 570
     public static function isAscii(string $value): bool
571 571
     {
572
-        return (bool)!preg_match('/[^\x00-\x7F]/S', $value);
572
+        return (bool) !preg_match('/[^\x00-\x7F]/S', $value);
573 573
     }
574 574
 
575 575
     /**
@@ -602,7 +602,7 @@  discard block
 block discarded – undo
602 602
     {
603 603
         $bytes = random_bytes((int) ceil($length / 2));
604 604
 
605
-        return (string)substr(bin2hex($bytes), 0, $length);
605
+        return (string) substr(bin2hex($bytes), 0, $length);
606 606
     }
607 607
 
608 608
     /**
@@ -617,7 +617,7 @@  discard block
 block discarded – undo
617 617
         }
618 618
 
619 619
         // handle boolean, array, & html special chars
620
-        array_walk($attributes, function (&$value, $key) {
620
+        array_walk($attributes, function(&$value, $key) {
621 621
             $value = is_bool($value) ? $value ? 'true' : 'false' : $value;
622 622
             $value = is_array($value) ? implode(' ', $value) : $value;
623 623
             $value = trim($value);
@@ -625,7 +625,7 @@  discard block
 block discarded – undo
625 625
         });
626 626
 
627 627
         // remove empty elements
628
-        $emptyAttributes = array_filter($attributes, function ($value) {
628
+        $emptyAttributes = array_filter($attributes, function($value) {
629 629
             return strlen($value) > 0;
630 630
         });
631 631
 
@@ -700,7 +700,7 @@  discard block
 block discarded – undo
700 700
                 $pool = '2345679ACDEFHJKLMNPRSTUVWXYZ';
701 701
                 break;
702 702
             default:
703
-                $pool = (string)$type;
703
+                $pool = (string) $type;
704 704
                 $utf8 = !self::isAscii($pool);
705 705
                 break;
706 706
         }
@@ -804,7 +804,7 @@  discard block
 block discarded – undo
804 804
         $ignoreKeys = $firstKey === 0;
805 805
 
806 806
         return sprintf('[%s]', implode(', ', array_map(
807
-            function ($key, $value) use ($ignoreKeys) {
807
+            function($key, $value) use ($ignoreKeys) {
808 808
                 return $ignoreKeys
809 809
                         ? self::stringify($value)
810 810
                         : sprintf(
Please login to merge, or discard this patch.