@@ -53,11 +53,17 @@ discard block |
||
| 53 | 53 | */ |
| 54 | 54 | public function containsAll($needles, $caseSensitive = true) |
| 55 | 55 | { |
| 56 | - if (empty($needles)) return false; |
|
| 56 | + if (empty($needles)) |
|
| 57 | + { |
|
| 58 | + return false; |
|
| 59 | + } |
|
| 57 | 60 | |
| 58 | 61 | foreach ($needles as $needle) |
| 59 | 62 | { |
| 60 | - if (!$this->contains($needle, $caseSensitive)) return false; |
|
| 63 | + if (!$this->contains($needle, $caseSensitive)) |
|
| 64 | + { |
|
| 65 | + return false; |
|
| 66 | + } |
|
| 61 | 67 | } |
| 62 | 68 | |
| 63 | 69 | return true; |
@@ -77,11 +83,17 @@ discard block |
||
| 77 | 83 | */ |
| 78 | 84 | public function containsAny($needles, $caseSensitive = true) |
| 79 | 85 | { |
| 80 | - if (empty($needles)) return false; |
|
| 86 | + if (empty($needles)) |
|
| 87 | + { |
|
| 88 | + return false; |
|
| 89 | + } |
|
| 81 | 90 | |
| 82 | 91 | foreach ($needles as $needle) |
| 83 | 92 | { |
| 84 | - if ($this->contains($needle, $caseSensitive)) return true; |
|
| 93 | + if ($this->contains($needle, $caseSensitive)) |
|
| 94 | + { |
|
| 95 | + return true; |
|
| 96 | + } |
|
| 85 | 97 | } |
| 86 | 98 | |
| 87 | 99 | return false; |
@@ -30,7 +30,10 @@ discard block |
||
| 30 | 30 | */ |
| 31 | 31 | public function truncate($length, $substring = '') |
| 32 | 32 | { |
| 33 | - if ($length >= $this->getLength()) return $this; |
|
| 33 | + if ($length >= $this->getLength()) |
|
| 34 | + { |
|
| 35 | + return $this; |
|
| 36 | + } |
|
| 34 | 37 | |
| 35 | 38 | // Need to further trim the string so we can append the substring |
| 36 | 39 | $substringLength = UTF8::strlen($substring, $this->encoding); |
@@ -63,7 +66,10 @@ discard block |
||
| 63 | 66 | */ |
| 64 | 67 | public function safeTruncate($length, $substring = '') |
| 65 | 68 | { |
| 66 | - if ($length >= $this->getLength()) return $this; |
|
| 69 | + if ($length >= $this->getLength()) |
|
| 70 | + { |
|
| 71 | + return $this; |
|
| 72 | + } |
|
| 67 | 73 | |
| 68 | 74 | // Need to further trim the string so we can append the substring |
| 69 | 75 | $substringLength = UTF8::strlen($substring, $this->encoding); |
@@ -76,7 +82,10 @@ discard block |
||
| 76 | 82 | { |
| 77 | 83 | // Find pos of the last occurrence of a space, get up to that |
| 78 | 84 | $lastPos = UTF8::strrpos($truncated, ' ', 0, $this->encoding); |
| 79 | - if (!is_integer($lastPos)) $lastPos = 0; |
|
| 85 | + if (!is_integer($lastPos)) |
|
| 86 | + { |
|
| 87 | + $lastPos = 0; |
|
| 88 | + } |
|
| 80 | 89 | $truncated = UTF8::substr($truncated, 0, $lastPos, $this->encoding); |
| 81 | 90 | } |
| 82 | 91 | |