Completed
Push — master ( d3a134...42e39c )
by Lars
01:43
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/CollectionStringy.php 1 patch
Doc Comments   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -59,7 +59,7 @@  discard block
 block discarded – undo
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
 block discarded – undo
75 75
     }
76 76
 
77 77
     /**
78
-     * @param Stringy ...$stringy
78
+     * @param Stringy Stringy[]
79 79
      *
80 80
      * @return $this
81 81
      */
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/Template/TemplateFormatter.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -39,7 +39,7 @@
 block discarded – undo
39 39
      * @return $this
40 40
      */
41 41
     public function append(string $var, string $value): self {
42
-        $this->vars[$var] = ($this->vars[$var] ?? '') . $value;
42
+        $this->vars[$var] = ($this->vars[$var] ?? '').$value;
43 43
 
44 44
         return $this;
45 45
     }
Please login to merge, or discard this patch.
build/generate_docs.php 1 patch
Spacing   +12 added lines, -12 removed lines patch added patch discarded remove patch
@@ -6,16 +6,16 @@  discard block
 block discarded – undo
6 6
 use voku\build\Template\TemplateFormatter;
7 7
 use voku\helper\UTF8;
8 8
 
9
-require __DIR__ . '/../vendor/autoload.php';
10
-require __DIR__ . '/vendor/autoload.php';
9
+require __DIR__.'/../vendor/autoload.php';
10
+require __DIR__.'/vendor/autoload.php';
11 11
 
12
-$phpFiles = \voku\SimplePhpParser\Parsers\PhpCodeParser::getPhpFiles(__DIR__ . '/../src/Stringy.php');
12
+$phpFiles = \voku\SimplePhpParser\Parsers\PhpCodeParser::getPhpFiles(__DIR__.'/../src/Stringy.php');
13 13
 $phpClasses = $phpFiles->getClasses();
14 14
 $phpUtf8Class = $phpClasses[Stringy::class];
15 15
 
16 16
 // -------------------------------------
17 17
 
18
-$templateDocument = file_get_contents(__DIR__ . '/docs/base.md');
18
+$templateDocument = file_get_contents(__DIR__.'/docs/base.md');
19 19
 
20 20
 $templateMethodParam = <<<RAW
21 21
 - `%param%`
@@ -70,9 +70,9 @@  discard block
 block discarded – undo
70 70
     $paramsTypes = [];
71 71
     foreach ($method->parameters as $param) {
72 72
         $paramsTemplate = new TemplateFormatter($templateMethodParam);
73
-        $paramsTemplate->set('param', ($param->typeFromPhpDocPslam ?: $param->typeFromPhpDoc) . UTF8::str_replace_beginning($param->typeMaybeWithComment, $param->typeFromPhpDoc, ''));
73
+        $paramsTemplate->set('param', ($param->typeFromPhpDocPslam ?: $param->typeFromPhpDoc).UTF8::str_replace_beginning($param->typeMaybeWithComment, $param->typeFromPhpDoc, ''));
74 74
         $params[] = $paramsTemplate->format();
75
-        $paramsTypes[] = $param->typeFromPhpDoc . ' ' . '$' . $param->name;
75
+        $paramsTypes[] = $param->typeFromPhpDoc.' '.'$'.$param->name;
76 76
     }
77 77
 
78 78
     if (count($params) !== 0) {
@@ -83,16 +83,16 @@  discard block
 block discarded – undo
83 83
 
84 84
     // -- return
85 85
 
86
-    $methodWithType = $method->name . '(' . implode(', ', $paramsTypes) . '): ' . $method->returnTypeFromPhpDoc;
86
+    $methodWithType = $method->name.'('.implode(', ', $paramsTypes).'): '.$method->returnTypeFromPhpDoc;
87 87
 
88
-    $description = trim($method->summary . "\n\n" . $method->description);
88
+    $description = trim($method->summary."\n\n".$method->description);
89 89
 
90 90
     $methodTemplate->set('name', $methodWithType);
91 91
     $methodTemplate->set('description', $description);
92 92
     $methodTemplate->set('return', $method->returnTypeMaybeWithComment);
93 93
 
94 94
     $methodIndexTemplate->set('title', $method->name);
95
-    $methodIndexTemplate->set('href', '#' . UTF8::css_identifier($methodWithType));
95
+    $methodIndexTemplate->set('href', '#'.UTF8::css_identifier($methodWithType));
96 96
 
97 97
     $functionsDocumentation[$method->name] = $methodTemplate->format();
98 98
     $functionsIndex[$method->name] = $methodIndexTemplate->format();
@@ -118,7 +118,7 @@  discard block
 block discarded – undo
118 118
         $indexStrResult .= '<tr>';
119 119
     }
120 120
 
121
-    $indexStrResult .= '<td>' . sprintf("%s\n", $_template) . '</td>';
121
+    $indexStrResult .= '<td>'.sprintf("%s\n", $_template).'</td>';
122 122
 
123 123
     if ($counterTmp === 4) {
124 124
         $counterTmp = 0;
@@ -130,10 +130,10 @@  discard block
 block discarded – undo
130 130
 }
131 131
 $indexStrResult = '
132 132
 <table>
133
-    ' . $indexStrResult . '
133
+    ' . $indexStrResult.'
134 134
 </table>
135 135
 ';
136 136
 
137 137
 $documentTemplate->set('__functions_index__', $indexStrResult);
138 138
 
139
-file_put_contents(__DIR__ . '/../README.md', $documentTemplate->format());
139
+file_put_contents(__DIR__.'/../README.md', $documentTemplate->format());
Please login to merge, or discard this patch.