| @@ 350-364 (lines=15) @@ | ||
| 347 | * |
|
| 348 | * @return bool <p>Whether or not $str contains $needle.</p> |
|
| 349 | */ |
|
| 350 | public function containsAll(array $needles, bool $caseSensitive = true): bool |
|
| 351 | { |
|
| 352 | /** @noinspection IsEmptyFunctionUsageInspection */ |
|
| 353 | if (empty($needles)) { |
|
| 354 | return false; |
|
| 355 | } |
|
| 356 | ||
| 357 | foreach ($needles as $needle) { |
|
| 358 | if (!$this->contains($needle, $caseSensitive)) { |
|
| 359 | return false; |
|
| 360 | } |
|
| 361 | } |
|
| 362 | ||
| 363 | return true; |
|
| 364 | } |
|
| 365 | ||
| 366 | /** |
|
| 367 | * Returns true if the string contains $needle, false otherwise. By default |
|
| @@ 397-411 (lines=15) @@ | ||
| 394 | * |
|
| 395 | * @return bool <p>Whether or not $str contains $needle.</p> |
|
| 396 | */ |
|
| 397 | public function containsAny(array $needles, bool $caseSensitive = true): bool |
|
| 398 | { |
|
| 399 | /** @noinspection IsEmptyFunctionUsageInspection */ |
|
| 400 | if (empty($needles)) { |
|
| 401 | return false; |
|
| 402 | } |
|
| 403 | ||
| 404 | foreach ($needles as $needle) { |
|
| 405 | if ($this->contains($needle, $caseSensitive)) { |
|
| 406 | return true; |
|
| 407 | } |
|
| 408 | } |
|
| 409 | ||
| 410 | return false; |
|
| 411 | } |
|
| 412 | ||
| 413 | /** |
|
| 414 | * Returns the length of the string, implementing the countable interface. |
|