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