Code Duplication    Length = 15-15 lines in 2 locations

src/Stringy.php 2 locations

@@ 344-358 (lines=15) @@
341
   *
342
   * @return bool   Whether or not $str contains $needle
343
   */
344
  public function containsAll($needles, $caseSensitive = true)
345
  {
346
    /** @noinspection IsEmptyFunctionUsageInspection */
347
    if (empty($needles)) {
348
      return false;
349
    }
350
351
    foreach ($needles as $needle) {
352
      if (!$this->contains($needle, $caseSensitive)) {
353
        return false;
354
      }
355
    }
356
357
    return true;
358
  }
359
360
  /**
361
   * Returns true if the string contains $needle, false otherwise. By default
@@ 391-405 (lines=15) @@
388
   *
389
   * @return bool   Whether or not $str contains $needle
390
   */
391
  public function containsAny($needles, $caseSensitive = true)
392
  {
393
    /** @noinspection IsEmptyFunctionUsageInspection */
394
    if (empty($needles)) {
395
      return false;
396
    }
397
398
    foreach ($needles as $needle) {
399
      if ($this->contains($needle, $caseSensitive)) {
400
        return true;
401
      }
402
    }
403
404
    return false;
405
  }
406
407
  /**
408
   * Returns the length of the string, implementing the countable interface.