Code Duplication    Length = 15-15 lines in 2 locations

src/Stringy.php 2 locations

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