@@ -60,7 +60,7 @@ discard block |
||
| 60 | 60 | |
| 61 | 61 | if ($char == UTF8::substr($otherStr, -$i, 1, $this->encoding)) |
| 62 | 62 | { |
| 63 | - $longestCommonSuffix = $char . $longestCommonSuffix; |
|
| 63 | + $longestCommonSuffix = $char.$longestCommonSuffix; |
|
| 64 | 64 | } |
| 65 | 65 | else |
| 66 | 66 | { |
@@ -117,8 +117,7 @@ discard block |
||
| 117 | 117 | } |
| 118 | 118 | } |
| 119 | 119 | |
| 120 | - return $this->newSelf(UTF8::substr |
|
| 121 | - ( |
|
| 120 | + return $this->newSelf(UTF8::substr( |
|
| 122 | 121 | $this->scalarString, |
| 123 | 122 | $end - $len, |
| 124 | 123 | $len, |
@@ -26,10 +26,8 @@ discard block |
||
| 26 | 26 | { |
| 27 | 27 | if ($this->startsWith($substring)) |
| 28 | 28 | { |
| 29 | - return $this->newSelf |
|
| 30 | - ( |
|
| 31 | - UTF8::substr |
|
| 32 | - ( |
|
| 29 | + return $this->newSelf( |
|
| 30 | + UTF8::substr( |
|
| 33 | 31 | $this->scalarString, |
| 34 | 32 | UTF8::strlen($substring, $this->encoding), |
| 35 | 33 | null, |
@@ -52,10 +50,8 @@ discard block |
||
| 52 | 50 | { |
| 53 | 51 | if ($this->endsWith($substring)) |
| 54 | 52 | { |
| 55 | - return $this->newSelf |
|
| 56 | - ( |
|
| 57 | - UTF8::substr |
|
| 58 | - ( |
|
| 53 | + return $this->newSelf( |
|
| 54 | + UTF8::substr( |
|
| 59 | 55 | $this->scalarString, |
| 60 | 56 | 0, |
| 61 | 57 | $this->getLength() - UTF8::strlen($substring, $this->encoding), |
@@ -36,15 +36,14 @@ discard block |
||
| 36 | 36 | $substringLength = UTF8::strlen($substring, $this->encoding); |
| 37 | 37 | $length -= $substringLength; |
| 38 | 38 | |
| 39 | - $truncated = UTF8::substr |
|
| 40 | - ( |
|
| 39 | + $truncated = UTF8::substr( |
|
| 41 | 40 | $this->scalarString, |
| 42 | 41 | 0, |
| 43 | 42 | $length, |
| 44 | 43 | $this->encoding |
| 45 | 44 | ); |
| 46 | 45 | |
| 47 | - return $this->newSelf($truncated . $substring); |
|
| 46 | + return $this->newSelf($truncated.$substring); |
|
| 48 | 47 | } |
| 49 | 48 | |
| 50 | 49 | /** |
@@ -79,6 +78,6 @@ discard block |
||
| 79 | 78 | $truncated = UTF8::substr($truncated, 0, $lastPos, $this->encoding); |
| 80 | 79 | } |
| 81 | 80 | |
| 82 | - return $this->newSelf($truncated . $substring); |
|
| 81 | + return $this->newSelf($truncated.$substring); |
|
| 83 | 82 | } |
| 84 | 83 | } |
@@ -37,8 +37,7 @@ discard block |
||
| 37 | 37 | { |
| 38 | 38 | if (!in_array($padType, ['left', 'right', 'both'], true)) |
| 39 | 39 | { |
| 40 | - throw new \InvalidArgumentException |
|
| 41 | - ( |
|
| 40 | + throw new \InvalidArgumentException( |
|
| 42 | 41 | 'Pad expects $padType '."to be one of 'left', 'right' or 'both'" |
| 43 | 42 | ); |
| 44 | 43 | } |
@@ -118,16 +117,14 @@ discard block |
||
| 118 | 117 | |
| 119 | 118 | if (!$length || $paddedLength <= $strLength) return $this; |
| 120 | 119 | |
| 121 | - $leftPadding = UTF8::substr |
|
| 122 | - ( |
|
| 120 | + $leftPadding = UTF8::substr( |
|
| 123 | 121 | UTF8::str_repeat($padStr, ceil($left / $length)), |
| 124 | 122 | 0, |
| 125 | 123 | $left, |
| 126 | 124 | $this->encoding |
| 127 | 125 | ); |
| 128 | 126 | |
| 129 | - $rightPadding = UTF8::substr |
|
| 130 | - ( |
|
| 127 | + $rightPadding = UTF8::substr( |
|
| 131 | 128 | UTF8::str_repeat($padStr, ceil($right / $length)), |
| 132 | 129 | 0, |
| 133 | 130 | $right, |
@@ -24,8 +24,7 @@ discard block |
||
| 24 | 24 | { |
| 25 | 25 | $first = UTF8::substr($this->scalarString, 0, 1, $this->encoding); |
| 26 | 26 | |
| 27 | - $rest = UTF8::substr |
|
| 28 | - ( |
|
| 27 | + $rest = UTF8::substr( |
|
| 29 | 28 | $this->scalarString, |
| 30 | 29 | 1, |
| 31 | 30 | $this->getLength() - 1, |
@@ -44,8 +43,7 @@ discard block |
||
| 44 | 43 | { |
| 45 | 44 | $first = UTF8::substr($this->scalarString, 0, 1, $this->encoding); |
| 46 | 45 | |
| 47 | - $rest = UTF8::substr |
|
| 48 | - ( |
|
| 46 | + $rest = UTF8::substr( |
|
| 49 | 47 | $this->scalarString, |
| 50 | 48 | 1, |
| 51 | 49 | $this->getLength() - 1, |
@@ -62,10 +60,9 @@ discard block |
||
| 62 | 60 | */ |
| 63 | 61 | public function swapCase() |
| 64 | 62 | { |
| 65 | - return $this->newSelf(preg_replace_callback |
|
| 66 | - ( |
|
| 63 | + return $this->newSelf(preg_replace_callback( |
|
| 67 | 64 | '/[\S]/u', |
| 68 | - function ($match) |
|
| 65 | + function($match) |
|
| 69 | 66 | { |
| 70 | 67 | $marchToUpper = UTF8::strtoupper($match[0], $this->encoding); |
| 71 | 68 | |
@@ -26,10 +26,8 @@ discard block |
||
| 26 | 26 | */ |
| 27 | 27 | public function htmlDecode($flags = ENT_COMPAT) |
| 28 | 28 | { |
| 29 | - return $this->newSelf |
|
| 30 | - ( |
|
| 31 | - UTF8::html_entity_decode |
|
| 32 | - ( |
|
| 29 | + return $this->newSelf( |
|
| 30 | + UTF8::html_entity_decode( |
|
| 33 | 31 | $this->scalarString, |
| 34 | 32 | $flags, |
| 35 | 33 | $this->encoding |
@@ -54,10 +52,8 @@ discard block |
||
| 54 | 52 | { |
| 55 | 53 | if ($flags === null) $flags = ENT_QUOTES | ENT_SUBSTITUTE; |
| 56 | 54 | |
| 57 | - return $this->newSelf |
|
| 58 | - ( |
|
| 59 | - UTF8::htmlentities |
|
| 60 | - ( |
|
| 55 | + return $this->newSelf( |
|
| 56 | + UTF8::htmlentities( |
|
| 61 | 57 | $this->scalarString, |
| 62 | 58 | $flags, |
| 63 | 59 | $this->encoding, |
@@ -97,8 +93,7 @@ discard block |
||
| 97 | 93 | } |
| 98 | 94 | else |
| 99 | 95 | { |
| 100 | - throw new \RuntimeException |
|
| 101 | - ( |
|
| 96 | + throw new \RuntimeException( |
|
| 102 | 97 | "This method requires \voku\helper\AntiXSS. ". |
| 103 | 98 | "Install with: composer require voku/anti-xss" |
| 104 | 99 | ); |
@@ -122,8 +117,7 @@ discard block |
||
| 122 | 117 | */ |
| 123 | 118 | public function htmlStripTags($allowableTags = null) |
| 124 | 119 | { |
| 125 | - return $this->newSelf |
|
| 126 | - ( |
|
| 120 | + return $this->newSelf( |
|
| 127 | 121 | UTF8::strip_tags($this->scalarString, $allowableTags) |
| 128 | 122 | ); |
| 129 | 123 | } |