Completed
Push — master ( dadb56...eddcd6 )
by Michał
02:10
created
math/bigint/Gmp.php 2 patches
Doc Comments   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -108,7 +108,7 @@
 block discarded – undo
108 108
     /**
109 109
      * Constructs a new GMP BigInt instance.
110 110
      *
111
-     * @param   \GMP    $value  The GMP object holding the actual value.
111
+     * @param   resource    $value  The GMP object holding the actual value.
112 112
      */
113 113
     public function __construct(\GMP $value)
114 114
     {
Please login to merge, or discard this patch.
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -84,7 +84,7 @@  discard block
 block discarded – undo
84 84
                 } else {
85 85
                     $matches[1] = '';
86 86
                 }
87
-                $number = str_pad(($matches[1] . $matches[2]), ($matches[3] + 1), '0', STR_PAD_RIGHT);
87
+                $number = str_pad(($matches[1].$matches[2]), ($matches[3] + 1), '0', STR_PAD_RIGHT);
88 88
             } else {
89 89
                 $base = 0;
90 90
             }
@@ -275,7 +275,7 @@  discard block
 block discarded – undo
275 275
         $hex = gmp_strval($decimal, 16);
276 276
 
277 277
         if (strlen($hex) & 1) {
278
-            $hex = '0' . $hex;
278
+            $hex = '0'.$hex;
279 279
         }
280 280
 
281 281
         // Pack the hexadecimals into a string and remove the nullbyte.
Please login to merge, or discard this patch.
Unit.php 1 patch
Unused Use Statements   -1 removed lines patch added patch discarded remove patch
@@ -1,7 +1,6 @@
 block discarded – undo
1 1
 <?php namespace nyx\utils;
2 2
 
3 3
 // External dependencies
4
-use nyx\core;
5 4
 
6 5
 /**
7 6
  * Unit
Please login to merge, or discard this patch.
str/Cases.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -103,7 +103,7 @@  discard block
 block discarded – undo
103 103
         $encoding = $encoding ?: utils\Str::encoding($str);
104 104
 
105 105
         // Lowercase the first character and append the remainder.
106
-        return mb_strtolower(mb_substr($str, 0, 1, $encoding), $encoding) . mb_substr($str, 1, null, $encoding);
106
+        return mb_strtolower(mb_substr($str, 0, 1, $encoding), $encoding).mb_substr($str, 1, null, $encoding);
107 107
     }
108 108
 
109 109
     /**
@@ -180,6 +180,6 @@  discard block
 block discarded – undo
180 180
         $encoding = $encoding ?: utils\Str::encoding($str);
181 181
 
182 182
         // Uppercase the first character and append the remainder.
183
-        return mb_strtoupper(mb_substr($str, 0, 1, $encoding), $encoding) . mb_substr($str, 1, null, $encoding);
183
+        return mb_strtoupper(mb_substr($str, 0, 1, $encoding), $encoding).mb_substr($str, 1, null, $encoding);
184 184
     }
185 185
 }
Please login to merge, or discard this patch.
str/Character.php 1 patch
Spacing   +10 added lines, -10 removed lines patch added patch discarded remove patch
@@ -26,15 +26,15 @@  discard block
 block discarded – undo
26 26
     /**
27 27
      * Flags used to combine different characters into a set via self::buildCharacterSet()
28 28
      */
29
-    const CHARS_UPPER       = 1;   // Uppercase letters.
30
-    const CHARS_LOWER       = 2;   // Lowercase letters.
31
-    const CHARS_ALPHA       = 3;   // CHARS_UPPER and CHARS_LOWER.
32
-    const CHARS_NUMERIC     = 4;   // Digits.
33
-    const CHARS_ALNUM       = 7;   // CHARS_ALPHA and CHARS_NUMERIC (Base62)
34
-    const CHARS_HEX_UPPER   = 12;  // Uppercase hexadecimal symbols - CHARS_DIGITS and 8.
35
-    const CHARS_HEX_LOWER   = 20;  // Lowercase hexadecimal symbols - CHARS_DIGITS and 16.
36
-    const CHARS_BASE64      = 39;  // CHARS_ALNUM and 32.
37
-    const CHARS_SYMBOLS     = 64;  // Additional symbols ($%& etc.) accessible on most if not all keyboards.
29
+    const CHARS_UPPER       = 1; // Uppercase letters.
30
+    const CHARS_LOWER       = 2; // Lowercase letters.
31
+    const CHARS_ALPHA       = 3; // CHARS_UPPER and CHARS_LOWER.
32
+    const CHARS_NUMERIC     = 4; // Digits.
33
+    const CHARS_ALNUM       = 7; // CHARS_ALPHA and CHARS_NUMERIC (Base62)
34
+    const CHARS_HEX_UPPER   = 12; // Uppercase hexadecimal symbols - CHARS_DIGITS and 8.
35
+    const CHARS_HEX_LOWER   = 20; // Lowercase hexadecimal symbols - CHARS_DIGITS and 16.
36
+    const CHARS_BASE64      = 39; // CHARS_ALNUM and 32.
37
+    const CHARS_SYMBOLS     = 64; // Additional symbols ($%& etc.) accessible on most if not all keyboards.
38 38
     const CHARS_BRACKETS    = 128; // Brackets.
39 39
     const CHARS_PUNCTUATION = 256; // Punctuation marks.
40 40
 
@@ -42,7 +42,7 @@  discard block
 block discarded – undo
42 42
      * @const Special character flag for alphanumeric characters excluding characters which tend
43 43
      *        to be hard to distinguish from each other.
44 44
      */
45
-    const CHARS_LEGIBLE     = 512;
45
+    const CHARS_LEGIBLE = 512;
46 46
 
47 47
     /**
48 48
      * @var array   A map of CHARS_* flags to their actual character lists. @todo Make writable, handle cache?
Please login to merge, or discard this patch.
Random.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -350,7 +350,7 @@  discard block
 block discarded – undo
350 350
                     /* @var random\interfaces\Source $source */
351 351
                     try {
352 352
                         $source = new $class;
353
-                    } catch(\RuntimeException $exception) {
353
+                    } catch (\RuntimeException $exception) {
354 354
                         $source = false;
355 355
                         continue;
356 356
                     }
@@ -360,7 +360,7 @@  discard block
 block discarded – undo
360 360
                 // by exceptions being thrown by Source::generate() itself and will prevent the return.
361 361
                 try {
362 362
                     return $source->generate($length);
363
-                } catch(\RuntimeException $exception) {
363
+                } catch (\RuntimeException $exception) {
364 364
                     // Ignoring the Exception since we handled it by not returning any valid result.
365 365
                 }
366 366
             }
Please login to merge, or discard this patch.
Arr.php 2 patches
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -758,7 +758,7 @@  discard block
 block discarded – undo
758 758
                 return;
759 759
             }
760 760
 
761
-            $array =& $array[$key];
761
+            $array = & $array[$key];
762 762
         }
763 763
 
764 764
         unset($array[array_shift($keys)]);
@@ -852,7 +852,7 @@  discard block
 block discarded – undo
852 852
                 $array[$key] = [];
853 853
             }
854 854
 
855
-            $array =& $array[$key];
855
+            $array = & $array[$key];
856 856
         }
857 857
 
858 858
         return $array[array_shift($keys)] = $value;
Please login to merge, or discard this patch.
Doc Comments   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -394,7 +394,7 @@  discard block
 block discarded – undo
394 394
      * @param   array           $array      The array to search in.
395 395
      * @param   string|array    $key        The string delimited key or a chain (array) of nested keys pointing
396 396
      *                                      to the desired key.
397
-     * @param   mixed           $default    The default value.
397
+     * @param   null|string           $default    The default value.
398 398
      * @param   string          $delimiter  The delimiter to use when exploding the key into parts.
399 399
      * @return  mixed
400 400
      */
@@ -779,7 +779,7 @@  discard block
 block discarded – undo
779 779
      *  - @see Arr::tail()
780 780
      *
781 781
      * @param   array               $array      The array to traverse.
782
-     * @param   callable|int|bool   $callback   The truth test the value should pass or an integer denoting how many
782
+     * @param   boolean   $callback   The truth test the value should pass or an integer denoting how many
783 783
      *                                          of the initial elements of the array should be excluded. The count
784 784
      *                                          is 1-indexed, ie. if you want to exclude the first 2 elements, pass 2.
785 785
      *                                          When a falsy value is given, the method will return all but the first
Please login to merge, or discard this patch.
Str.php 1 patch
Spacing   +14 added lines, -14 removed lines patch added patch discarded remove patch
@@ -100,7 +100,7 @@  discard block
 block discarded – undo
100 100
      */
101 101
     public static function beginWith(string $haystack, string $needle) : string
102 102
     {
103
-        return $needle . preg_replace('/^(?:'.preg_quote($needle, '/').')+/', '', $haystack);
103
+        return $needle.preg_replace('/^(?:'.preg_quote($needle, '/').')+/', '', $haystack);
104 104
     }
105 105
 
106 106
     /**
@@ -130,9 +130,9 @@  discard block
 block discarded – undo
130 130
         // error-inducing combinations of invalid input which all will be caught when we attempt
131 131
         // to actually look for the indices of the needles. Anything else is just way too much overhead.
132 132
         if ($haystack === '' || $startNeedle === '' || $endNeedle === '') {
133
-            $endNeedle   === '' && $arg = '$endNeedle';
133
+            $endNeedle === '' && $arg = '$endNeedle';
134 134
             $startNeedle === '' && $arg = '$startNeedle';
135
-            $haystack    === '' && $arg = '$haystack';
135
+            $haystack === '' && $arg = '$haystack';
136 136
 
137 137
             throw new \InvalidArgumentException($arg.' must not be an empty string.');
138 138
         }
@@ -357,7 +357,7 @@  discard block
 block discarded – undo
357 357
      */
358 358
     public static function finishWith(string $haystack, string $needle) : string
359 359
     {
360
-        return preg_replace('/(?:'.preg_quote($needle, '/').')+$/', '', $haystack) . $needle;
360
+        return preg_replace('/(?:'.preg_quote($needle, '/').')+$/', '', $haystack).$needle;
361 361
     }
362 362
 
363 363
     /**
@@ -456,7 +456,7 @@  discard block
 block discarded – undo
456 456
 
457 457
         // With a negative offset, we'll convert it to a positive one for the initial part (before the inserted
458 458
         // substring), since we'll be using that as a length actually.
459
-        return mb_substr($haystack, 0, $offset < 0 ? $length + $offset : $offset, $encoding) . $needle . mb_substr($haystack, $offset, null, $encoding);
459
+        return mb_substr($haystack, 0, $offset < 0 ? $length + $offset : $offset, $encoding).$needle.mb_substr($haystack, $offset, null, $encoding);
460 460
     }
461 461
 
462 462
     /**
@@ -603,11 +603,11 @@  discard block
 block discarded – undo
603 603
         }
604 604
 
605 605
         // Construct the requested padding strings.
606
-        $leftPadding  = 0 === $left  ? '' : mb_substr(str_repeat($with, ceil($left / $padLen)), 0, $left, $encoding);
606
+        $leftPadding  = 0 === $left ? '' : mb_substr(str_repeat($with, ceil($left / $padLen)), 0, $left, $encoding);
607 607
         $rightPadding = 0 === $right ? '' : mb_substr(str_repeat($with, ceil($right / $padLen)), 0, $right, $encoding);
608 608
 
609 609
         // Apply the padding and return the glued string.
610
-        return $leftPadding . $str . $rightPadding;
610
+        return $leftPadding.$str.$rightPadding;
611 611
     }
612 612
 
613 613
     /**
@@ -761,7 +761,7 @@  discard block
 block discarded – undo
761 761
     {
762 762
         // If multiple values to replace were passed.
763 763
         if (is_array($needles)) {
764
-            $needles = '(' .implode('|', $needles). ')';
764
+            $needles = '('.implode('|', $needles).')';
765 765
         }
766 766
 
767 767
         // Keep track of the internal encoding as we'll change it temporarily and then revert back to it.
@@ -971,7 +971,7 @@  discard block
 block discarded – undo
971 971
      */
972 972
     public static function surroundWith(string $haystack, string $needle) : string
973 973
     {
974
-        return static::beginWith($haystack, $needle) . $needle . static::finishWith($haystack, $needle);
974
+        return static::beginWith($haystack, $needle).$needle.static::finishWith($haystack, $needle);
975 975
     }
976 976
 
977 977
     /**
@@ -993,13 +993,13 @@  discard block
 block discarded – undo
993 993
         if (preg_match("/[\x80-\xFF]/", $str)) {
994 994
             // Grab the transliteration table since we'll need it.
995 995
             if (null === static::$ascii) {
996
-                static::$ascii = unserialize(file_get_contents(__DIR__ . '/str/resources/transliteration_table.ser'));
996
+                static::$ascii = unserialize(file_get_contents(__DIR__.'/str/resources/transliteration_table.ser'));
997 997
             }
998 998
 
999 999
             $str = \Normalizer::normalize($str, \Normalizer::NFKD);
1000 1000
             $str = preg_replace('/\p{Mn}+/u', '', $str);
1001 1001
             $str = str_replace(static::$ascii[0], static::$ascii[1], $str);
1002
-            $str = iconv('UTF-8', 'ASCII' . ('glibc' !== ICONV_IMPL ? '//IGNORE' : '') . '//TRANSLIT', $str);
1002
+            $str = iconv('UTF-8', 'ASCII'.('glibc' !== ICONV_IMPL ? '//IGNORE' : '').'//TRANSLIT', $str);
1003 1003
         }
1004 1004
 
1005 1005
         return $str;
@@ -1169,7 +1169,7 @@  discard block
 block discarded – undo
1169 1169
             $result = mb_substr($result, 0, mb_strrpos($result, ' ', 0, $encoding), $encoding);
1170 1170
         }
1171 1171
 
1172
-        return $result . $end;
1172
+        return $result.$end;
1173 1173
     }
1174 1174
 
1175 1175
     /**
@@ -1247,7 +1247,7 @@  discard block
 block discarded – undo
1247 1247
         }
1248 1248
 
1249 1249
         $encoding = $encoding ?: static::encoding($haystack);
1250
-        $method   = $first    ? 'indexOf' : 'indexOfLast';
1250
+        $method   = $first ? 'indexOf' : 'indexOfLast';
1251 1251
 
1252 1252
         foreach ((array) $needles as $needle) {
1253 1253
 
@@ -1259,7 +1259,7 @@  discard block
 block discarded – undo
1259 1259
 
1260 1260
             // Grab the substrings before and after the needle occurs, insert the replacement in between
1261 1261
             // and glue it together omitting the needle.
1262
-            $haystack = mb_substr($haystack, 0, $offset, $encoding) . $replacement . mb_substr($haystack, $offset + $needleLen, null, $encoding);
1262
+            $haystack = mb_substr($haystack, 0, $offset, $encoding).$replacement.mb_substr($haystack, $offset + $needleLen, null, $encoding);
1263 1263
         }
1264 1264
 
1265 1265
         return $haystack;
Please login to merge, or discard this patch.