Code Duplication    Length = 15-15 lines in 2 locations

src/Stringy.php 2 locations

@@ 329-343 (lines=15) @@
326
   *
327
   * @return bool   Whether or not $str contains $needle
328
   */
329
  public function containsAll($needles, $caseSensitive = true)
330
  {
331
    /** @noinspection IsEmptyFunctionUsageInspection */
332
    if (empty($needles)) {
333
      return false;
334
    }
335
336
    foreach ($needles as $needle) {
337
      if (!$this->contains($needle, $caseSensitive)) {
338
        return false;
339
      }
340
    }
341
342
    return true;
343
  }
344
345
  /**
346
   * Returns true if the string contains $needle, false otherwise. By default
@@ 376-390 (lines=15) @@
373
   *
374
   * @return bool   Whether or not $str contains $needle
375
   */
376
  public function containsAny($needles, $caseSensitive = true)
377
  {
378
    /** @noinspection IsEmptyFunctionUsageInspection */
379
    if (empty($needles)) {
380
      return false;
381
    }
382
383
    foreach ($needles as $needle) {
384
      if ($this->contains($needle, $caseSensitive)) {
385
        return true;
386
      }
387
    }
388
389
    return false;
390
  }
391
392
  /**
393
   * Returns the length of the string, implementing the countable interface.