@@ 321-335 (lines=15) @@ | ||
318 | * |
|
319 | * @return bool Whether or not $str contains $needle |
|
320 | */ |
|
321 | public function containsAll($needles, $caseSensitive = true) |
|
322 | { |
|
323 | /** @noinspection IsEmptyFunctionUsageInspection */ |
|
324 | if (empty($needles)) { |
|
325 | return false; |
|
326 | } |
|
327 | ||
328 | foreach ($needles as $needle) { |
|
329 | if (!$this->contains($needle, $caseSensitive)) { |
|
330 | return false; |
|
331 | } |
|
332 | } |
|
333 | ||
334 | return true; |
|
335 | } |
|
336 | ||
337 | /** |
|
338 | * Returns true if the string contains $needle, false otherwise. By default |
|
@@ 368-382 (lines=15) @@ | ||
365 | * |
|
366 | * @return bool Whether or not $str contains $needle |
|
367 | */ |
|
368 | public function containsAny($needles, $caseSensitive = true) |
|
369 | { |
|
370 | /** @noinspection IsEmptyFunctionUsageInspection */ |
|
371 | if (empty($needles)) { |
|
372 | return false; |
|
373 | } |
|
374 | ||
375 | foreach ($needles as $needle) { |
|
376 | if ($this->contains($needle, $caseSensitive)) { |
|
377 | return true; |
|
378 | } |
|
379 | } |
|
380 | ||
381 | return false; |
|
382 | } |
|
383 | ||
384 | /** |
|
385 | * Returns the length of the string, implementing the countable interface. |