@@ -145,7 +145,7 @@ |
||
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); |
@@ -197,6 +197,7 @@ discard block |
||
197 | 197 | * Returns a new string with $suffix appended. |
198 | 198 | * |
199 | 199 | * @param string ...$suffix <p>The string to append.</p> |
200 | + * @param string[] $suffix |
|
200 | 201 | * |
201 | 202 | * @psalm-mutation-free |
202 | 203 | * |
@@ -2252,6 +2253,7 @@ discard block |
||
2252 | 2253 | * Returns a new string starting with $prefix. |
2253 | 2254 | * |
2254 | 2255 | * @param string ...$prefix <p>The string to append.</p> |
2256 | + * @param string[] $prefix |
|
2255 | 2257 | * |
2256 | 2258 | * @psalm-mutation-free |
2257 | 2259 | * |
@@ -2457,7 +2459,7 @@ discard block |
||
2457 | 2459 | * Replaces all occurrences of $search in $str by $replacement. |
2458 | 2460 | * |
2459 | 2461 | * @param string[] $search <p>The elements to search for.</p> |
2460 | - * @param string|string[] $replacement <p>The string to replace with.</p> |
|
2462 | + * @param string $replacement <p>The string to replace with.</p> |
|
2461 | 2463 | * @param bool $caseSensitive [optional] <p>Whether or not to enforce case-sensitivity. Default: true</p> |
2462 | 2464 | * |
2463 | 2465 | * @psalm-mutation-free |
@@ -238,7 +238,7 @@ discard block |
||
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 |
||
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 |
||
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 |
||
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 |
||
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 |
||
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 |
||
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 |
||
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 |
||
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 |
||
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 |
||
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 |
||
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 |
||
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 |
||
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 |
||
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 |
||
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 | } |
@@ -59,7 +59,7 @@ discard block |
||
59 | 59 | } |
60 | 60 | |
61 | 61 | /** |
62 | - * @param string ...$string |
|
62 | + * @param string string[] |
|
63 | 63 | * |
64 | 64 | * @return $this |
65 | 65 | * |
@@ -75,7 +75,7 @@ discard block |
||
75 | 75 | } |
76 | 76 | |
77 | 77 | /** |
78 | - * @param Stringy ...$stringy |
|
78 | + * @param Stringy Stringy[] |
|
79 | 79 | * |
80 | 80 | * @return $this |
81 | 81 | */ |