| @@ 259-273 (lines=15) @@ | ||
| 256 | * |
|
| 257 | * @return bool Whether or not $str contains $needle |
|
| 258 | */ |
|
| 259 | public function containsAll($needles, $caseSensitive = true) |
|
| 260 | { |
|
| 261 | /** @noinspection IsEmptyFunctionUsageInspection */ |
|
| 262 | if (empty($needles)) { |
|
| 263 | return false; |
|
| 264 | } |
|
| 265 | ||
| 266 | foreach ($needles as $needle) { |
|
| 267 | if (!$this->contains($needle, $caseSensitive)) { |
|
| 268 | return false; |
|
| 269 | } |
|
| 270 | } |
|
| 271 | ||
| 272 | return true; |
|
| 273 | } |
|
| 274 | ||
| 275 | /** |
|
| 276 | * Returns true if the string contains $needle, false otherwise. By default |
|
| @@ 306-320 (lines=15) @@ | ||
| 303 | * |
|
| 304 | * @return bool Whether or not $str contains $needle |
|
| 305 | */ |
|
| 306 | public function containsAny($needles, $caseSensitive = true) |
|
| 307 | { |
|
| 308 | /** @noinspection IsEmptyFunctionUsageInspection */ |
|
| 309 | if (empty($needles)) { |
|
| 310 | return false; |
|
| 311 | } |
|
| 312 | ||
| 313 | foreach ($needles as $needle) { |
|
| 314 | if ($this->contains($needle, $caseSensitive)) { |
|
| 315 | return true; |
|
| 316 | } |
|
| 317 | } |
|
| 318 | ||
| 319 | return false; |
|
| 320 | } |
|
| 321 | ||
| 322 | /** |
|
| 323 | * Returns the length of the string, implementing the countable interface. |
|