@@ -115,7 +115,7 @@ |
||
115 | 115 | throw new InvalidArgumentException($msg, 1, $e); |
116 | 116 | } |
117 | 117 | |
118 | - $stringValue = ltrim($obj, "${intValue}"); |
|
118 | + $stringValue = ltrim($obj, "${intvalue}"); |
|
119 | 119 | |
120 | 120 | // Validate that 0 (zero) is not interpreted as '' (empty string) |
121 | 121 | if ($stringValue === $obj) { |
@@ -169,18 +169,18 @@ discard block |
||
169 | 169 | public function methodIsProvider() : array |
170 | 170 | { |
171 | 171 | return [ |
172 | - [true, (bool) true, [true, false]], |
|
173 | - [false, (bool) false, [true, false, 0]], |
|
174 | - [true, (int) 123, [11, 0, -34]], |
|
175 | - [false, (int) 123, [11, 0, -34.456]], |
|
176 | - [true, (float) 1.23, [11.0, 0.0, -34.6]], |
|
177 | - [false, (float) 1.23, [11.0, 0, -34.4]], |
|
178 | - [true, (string) '', ['', '0', 'i am not a string']], |
|
179 | - [false, (string) '', [11.2, '0', true]], |
|
180 | - [true, null, [null, null]], |
|
181 | - [false, null, [[], null, false]], |
|
182 | - [true, new stdClass, [new stdClass, new stdClass]], |
|
183 | - [false, new stdClass, [[], new stdClass, true]], |
|
172 | + [true, (bool) true, [true, false]], |
|
173 | + [false, (bool) false, [true, false, 0]], |
|
174 | + [true, (int) 123, [11, 0, -34]], |
|
175 | + [false, (int) 123, [11, 0, -34.456]], |
|
176 | + [true, (float) 1.23, [11.0, 0.0, -34.6]], |
|
177 | + [false, (float) 1.23, [11.0, 0, -34.4]], |
|
178 | + [true, (string) '', ['', '0', 'i am not a string']], |
|
179 | + [false, (string) '', [11.2, '0', true]], |
|
180 | + [true, null, [null, null]], |
|
181 | + [false, null, [[], null, false]], |
|
182 | + [true, new stdClass, [new stdClass, new stdClass]], |
|
183 | + [false, new stdClass, [[], new stdClass, true]], |
|
184 | 184 | ]; |
185 | 185 | } |
186 | 186 | |
@@ -195,18 +195,18 @@ discard block |
||
195 | 195 | public function methodIsInProvider() : array |
196 | 196 | { |
197 | 197 | return [ |
198 | - [true, (bool) true, [true, false, 1, 'string']], |
|
199 | - [false, (bool) false, ['true', 'false', 0, 1]], |
|
200 | - [true, (int) 123, [11, 0, -34]], |
|
201 | - [false, (int) 123, [11.2, '0', true]], |
|
202 | - [true, (float) 1.23, [11, 0.5, -34]], |
|
203 | - [false, (float) 1.23, [11, '0', true]], |
|
204 | - [true, (string) '', [11, '0', -34]], |
|
205 | - [false, (string) '', [11.2, 0, true]], |
|
206 | - [true, null, [null, true, 4]], |
|
207 | - [false, null, [[], 'null', false]], |
|
208 | - [true, new stdClass, [new stdClass, new A, 0]], |
|
209 | - [false, new stdClass, [[], 'stdClass', true]], |
|
198 | + [true, (bool) true, [true, false, 1, 'string']], |
|
199 | + [false, (bool) false, ['true', 'false', 0, 1]], |
|
200 | + [true, (int) 123, [11, 0, -34]], |
|
201 | + [false, (int) 123, [11.2, '0', true]], |
|
202 | + [true, (float) 1.23, [11, 0.5, -34]], |
|
203 | + [false, (float) 1.23, [11, '0', true]], |
|
204 | + [true, (string) '', [11, '0', -34]], |
|
205 | + [false, (string) '', [11.2, 0, true]], |
|
206 | + [true, null, [null, true, 4]], |
|
207 | + [false, null, [[], 'null', false]], |
|
208 | + [true, new stdClass, [new stdClass, new A, 0]], |
|
209 | + [false, new stdClass, [[], 'stdClass', true]], |
|
210 | 210 | ]; |
211 | 211 | } |
212 | 212 |
@@ -30,7 +30,7 @@ |
||
30 | 30 | |
31 | 31 | public function __construct() |
32 | 32 | { |
33 | - $this->magic_ = 'magic'; |
|
33 | + $this->magic_ = 'magic'; |
|
34 | 34 | $this->noMagicProperty = 'no magic'; |
35 | 35 | } |
36 | 36 |
@@ -347,7 +347,7 @@ discard block |
||
347 | 347 | } |
348 | 348 | |
349 | 349 | if (!isset($options['format']) && isset($options['before'])) { |
350 | - $str = str_replace($options['escape'] . $options['before'], $options['before'], $str); |
|
350 | + $str = str_replace($options['escape'].$options['before'], $options['before'], $str); |
|
351 | 351 | } |
352 | 352 | |
353 | 353 | return $options['clean'] ? static::cleanInsert($str, $options) : $str; |
@@ -378,7 +378,7 @@ discard block |
||
378 | 378 | } |
379 | 379 | switch ($clean['method']) { |
380 | 380 | case 'html': |
381 | - $clean += [ |
|
381 | + $clean += [ |
|
382 | 382 | 'word' => '[\w,.]+', |
383 | 383 | 'andText' => true, |
384 | 384 | 'replacement' => '', |
@@ -389,7 +389,7 @@ discard block |
||
389 | 389 | $clean['word'], |
390 | 390 | preg_quote($options['after'], '/') |
391 | 391 | ); |
392 | - $str = preg_replace($kleenex, $clean['replacement'], $str); |
|
392 | + $str = preg_replace($kleenex, $clean['replacement'], $str); |
|
393 | 393 | if ($clean['andText']) { |
394 | 394 | $options['clean'] = ['method' => 'text']; |
395 | 395 | $str = static::cleanInsert($str, $options); |
@@ -413,7 +413,7 @@ discard block |
||
413 | 413 | $clean['word'], |
414 | 414 | preg_quote($options['after'], '/') |
415 | 415 | ); |
416 | - $str = preg_replace($kleenex, $clean['replacement'], $str); |
|
416 | + $str = preg_replace($kleenex, $clean['replacement'], $str); |
|
417 | 417 | break; |
418 | 418 | } |
419 | 419 | |
@@ -531,7 +531,7 @@ discard block |
||
531 | 531 | $tmpOffset += 1; |
532 | 532 | $offset = $tmpOffset; |
533 | 533 | } else { |
534 | - $results[] = $buffer . mb_substr($data, $offset); |
|
534 | + $results[] = $buffer.mb_substr($data, $offset); |
|
535 | 535 | $offset = $length + 1; |
536 | 536 | } |
537 | 537 | } |
@@ -577,7 +577,7 @@ discard block |
||
577 | 577 | */ |
578 | 578 | public static function delimit(string $string, string $delimiter = '_'): string |
579 | 579 | { |
580 | - $result = mb_strtolower(preg_replace('/(?<=\\w)([A-Z])/', $delimiter . '\\1', $string)); |
|
580 | + $result = mb_strtolower(preg_replace('/(?<=\\w)([A-Z])/', $delimiter.'\\1', $string)); |
|
581 | 581 | return $result; |
582 | 582 | } |
583 | 583 | |
@@ -595,7 +595,7 @@ discard block |
||
595 | 595 | { |
596 | 596 | $result = explode(' ', str_replace($delimiter, ' ', $string)); |
597 | 597 | foreach ($result as &$word) { |
598 | - $word = mb_strtoupper(mb_substr($word, 0, 1)) . mb_substr($word, 1); |
|
598 | + $word = mb_strtoupper(mb_substr($word, 0, 1)).mb_substr($word, 1); |
|
599 | 599 | } |
600 | 600 | $result = implode(' ', $result); |
601 | 601 | return $result; |
@@ -627,7 +627,7 @@ discard block |
||
627 | 627 | { |
628 | 628 | $camelized = static::camelize(static::underscore($string)); |
629 | 629 | $replace = strtolower(substr($camelized, 0, 1)); |
630 | - $result = $replace . substr($camelized, 1); |
|
630 | + $result = $replace.substr($camelized, 1); |
|
631 | 631 | return $result; |
632 | 632 | } |
633 | 633 | } |