Completed
Pull Request — master (#34)
by
unknown
15:29
created
src/StaticStringy.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -145,7 +145,7 @@
 block discarded – undo
145 145
         }
146 146
 
147 147
         if (!isset(static::$methodArgs[$name])) {
148
-            throw new \BadMethodCallException($name . ' is not a valid method');
148
+            throw new \BadMethodCallException($name.' is not a valid method');
149 149
         }
150 150
 
151 151
         $numArgs = \count($arguments);
Please login to merge, or discard this patch.
src/Stringy.php 2 patches
Spacing   +17 added lines, -17 removed lines patch added patch discarded remove patch
@@ -238,7 +238,7 @@  discard block
 block discarded – undo
238 238
             $suffix = \implode('', $suffix);
239 239
         }
240 240
 
241
-        return static::create($this->str . $suffix, $this->encoding);
241
+        return static::create($this->str.$suffix, $this->encoding);
242 242
     }
243 243
 
244 244
     /**
@@ -296,7 +296,7 @@  discard block
 block discarded – undo
296 296
             }
297 297
         }
298 298
 
299
-        return static::create($this->str . $suffixStr, $this->encoding);
299
+        return static::create($this->str.$suffixStr, $this->encoding);
300 300
     }
301 301
 
302 302
     /**
@@ -1068,7 +1068,7 @@  discard block
 block discarded – undo
1068 1068
         }
1069 1069
 
1070 1070
         return \array_map(
1071
-            function ($str) {
1071
+            function($str) {
1072 1072
                 return new static($str, $this->encoding);
1073 1073
             },
1074 1074
             $strings
@@ -1192,7 +1192,7 @@  discard block
 block discarded – undo
1192 1192
                     $name = (string) $name;
1193 1193
 
1194 1194
                     if (\strpos($name, '%:') !== 0) {
1195
-                        $nameTmp = '%:' . $name;
1195
+                        $nameTmp = '%:'.$name;
1196 1196
                     } else {
1197 1197
                         $nameTmp = $name;
1198 1198
                     }
@@ -1323,7 +1323,7 @@  discard block
 block discarded – undo
1323 1323
     {
1324 1324
         $string = \preg_replace_callback(
1325 1325
             '/\\\\x([0-9A-Fa-f]+)/',
1326
-            function (array $matched) {
1326
+            function(array $matched) {
1327 1327
                 return (string) $this->utf8::hex_to_chr($matched[1]);
1328 1328
             },
1329 1329
             $this->str
@@ -1346,8 +1346,8 @@  discard block
 block discarded – undo
1346 1346
     {
1347 1347
         $string = \array_reduce(
1348 1348
             $this->chars(),
1349
-            function (string $str, string $char) {
1350
-                return $str . $this->utf8::chr_to_hex($char);
1349
+            function(string $str, string $char) {
1350
+                return $str.$this->utf8::chr_to_hex($char);
1351 1351
             },
1352 1352
             ''
1353 1353
         );
@@ -1674,7 +1674,7 @@  discard block
 block discarded – undo
1674 1674
         $quotedPattern = \preg_quote($pattern, '/');
1675 1675
         $replaceWildCards = \str_replace('\*', '.*', $quotedPattern);
1676 1676
 
1677
-        return $this->matchesPattern('^' . $replaceWildCards . '\z');
1677
+        return $this->matchesPattern('^'.$replaceWildCards.'\z');
1678 1678
     }
1679 1679
 
1680 1680
     /**
@@ -1813,7 +1813,7 @@  discard block
 block discarded – undo
1813 1813
                     return false;
1814 1814
                 }
1815 1815
             } else {
1816
-                throw new \InvalidArgumentException('expected: int|float|string|Stringy -> given: ' . \print_r($strTmp, true) . ' [' . \gettype($strTmp) . ']');
1816
+                throw new \InvalidArgumentException('expected: int|float|string|Stringy -> given: '.\print_r($strTmp, true).' ['.\gettype($strTmp).']');
1817 1817
             }
1818 1818
         }
1819 1819
 
@@ -1845,7 +1845,7 @@  discard block
 block discarded – undo
1845 1845
                     return false;
1846 1846
                 }
1847 1847
             } else {
1848
-                throw new \InvalidArgumentException('expected: int|float|string|Stringy -> given: ' . \print_r($strTmp, true) . ' [' . \gettype($strTmp) . ']');
1848
+                throw new \InvalidArgumentException('expected: int|float|string|Stringy -> given: '.\print_r($strTmp, true).' ['.\gettype($strTmp).']');
1849 1849
             }
1850 1850
         }
1851 1851
 
@@ -2044,7 +2044,7 @@  discard block
 block discarded – undo
2044 2044
     public function kebabCase(): self
2045 2045
     {
2046 2046
         $words = \array_map(
2047
-            static function (self $word) {
2047
+            static function(self $word) {
2048 2048
                 return $word->toLowerCase();
2049 2049
             },
2050 2050
             $this->words('', true)
@@ -2420,7 +2420,7 @@  discard block
 block discarded – undo
2420 2420
         }
2421 2421
 
2422 2422
         \preg_match_all(
2423
-            "/(?:^|(?:.|\p{L}|\w){" . $length . "})(.|\p{L}|\w)/u",
2423
+            "/(?:^|(?:.|\p{L}|\w){".$length."})(.|\p{L}|\w)/u",
2424 2424
             $substring,
2425 2425
             $matches
2426 2426
         );
@@ -2644,7 +2644,7 @@  discard block
 block discarded – undo
2644 2644
             $prefix = \implode('', $prefix);
2645 2645
         }
2646 2646
 
2647
-        return static::create($prefix . $this->str, $this->encoding);
2647
+        return static::create($prefix.$this->str, $this->encoding);
2648 2648
     }
2649 2649
 
2650 2650
     /**
@@ -2670,7 +2670,7 @@  discard block
 block discarded – undo
2670 2670
             }
2671 2671
         }
2672 2672
 
2673
-        return static::create($prefixStr . $this->str, $this->encoding);
2673
+        return static::create($prefixStr.$this->str, $this->encoding);
2674 2674
     }
2675 2675
 
2676 2676
     /**
@@ -3175,7 +3175,7 @@  discard block
 block discarded – undo
3175 3175
     public function snakeCase(): self
3176 3176
     {
3177 3177
         $words = \array_map(
3178
-            static function (self $word) {
3178
+            static function(self $word) {
3179 3179
                 return $word->toLowerCase();
3180 3180
             },
3181 3181
             $this->words('', true)
@@ -3401,7 +3401,7 @@  discard block
 block discarded – undo
3401 3401
     public function studlyCase(): self
3402 3402
     {
3403 3403
         $words = \array_map(
3404
-            static function (self $word) {
3404
+            static function(self $word) {
3405 3405
                 return $word->substr(0, 1)
3406 3406
                     ->toUpperCase()
3407 3407
                     ->appendStringy($word->substr(1));
@@ -3519,7 +3519,7 @@  discard block
 block discarded – undo
3519 3519
     public function surround(string $substring): self
3520 3520
     {
3521 3521
         return static::create(
3522
-            $substring . $this->str . $substring,
3522
+            $substring.$this->str.$substring,
3523 3523
             $this->encoding
3524 3524
         );
3525 3525
     }
Please login to merge, or discard this patch.
Doc Comments   +3 added lines, -1 removed lines patch added patch discarded remove patch
@@ -249,6 +249,7 @@  discard block
 block discarded – undo
249 249
      * </code>
250 250
      *
251 251
      * @param string ...$suffix <p>The string to append.</p>
252
+     * @param string[] $suffix
252 253
      *
253 254
      * @psalm-mutation-free
254 255
      *
@@ -3048,6 +3049,7 @@  discard block
 block discarded – undo
3048 3049
      * </code>
3049 3050
      *
3050 3051
      * @param string ...$prefix <p>The string to append.</p>
3052
+     * @param string[] $prefix
3051 3053
      *
3052 3054
      * @psalm-mutation-free
3053 3055
      *
@@ -3322,7 +3324,7 @@  discard block
 block discarded – undo
3322 3324
      * </code>
3323 3325
      *
3324 3326
      * @param string[]        $search        <p>The elements to search for.</p>
3325
-     * @param string|string[] $replacement   <p>The string to replace with.</p>
3327
+     * @param string $replacement   <p>The string to replace with.</p>
3326 3328
      * @param bool            $caseSensitive [optional] <p>Whether or not to enforce case-sensitivity. Default: true</p>
3327 3329
      *
3328 3330
      * @psalm-mutation-free
Please login to merge, or discard this patch.
build/generate_docs.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -1,11 +1,11 @@
 block discarded – undo
1 1
 <?php
2 2
 
3
-require __DIR__ . '/../vendor/autoload.php';
4
-require __DIR__ . '/vendor/autoload.php';
3
+require __DIR__.'/../vendor/autoload.php';
4
+require __DIR__.'/vendor/autoload.php';
5 5
 
6 6
 $readmeText = (new \voku\PhpReadmeHelper\GenerateApi())->generate(
7
-    __DIR__ . '/../src/Stringy.php',
8
-    __DIR__ . '/docs/base.md'
7
+    __DIR__.'/../src/Stringy.php',
8
+    __DIR__.'/docs/base.md'
9 9
 );
10 10
 
11
-file_put_contents(__DIR__ . '/../README.md', $readmeText);
11
+file_put_contents(__DIR__.'/../README.md', $readmeText);
Please login to merge, or discard this patch.
src/CollectionStringy.php 1 patch
Doc Comments   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -14,7 +14,7 @@  discard block
 block discarded – undo
14 14
     /**
15 15
      * Creates an CollectionInterface object.
16 16
      *
17
-     * @param mixed  $data
17
+     * @param Stringy[]  $data
18 18
      * @param string $iteratorClass
19 19
      * @param bool   $checkPropertiesInConstructor
20 20
      *
@@ -85,7 +85,7 @@  discard block
 block discarded – undo
85 85
     }
86 86
 
87 87
     /**
88
-     * @param string ...$string
88
+     * @param string string[]
89 89
      *
90 90
      * @return $this
91 91
      */
@@ -100,7 +100,7 @@  discard block
 block discarded – undo
100 100
     }
101 101
 
102 102
     /**
103
-     * @param Stringy ...$stringy
103
+     * @param Stringy Stringy[]
104 104
      *
105 105
      * @return $this
106 106
      */
Please login to merge, or discard this patch.