Code Duplication    Length = 14-14 lines in 2 locations

src/Stringy.php 2 locations

@@ 528-541 (lines=14) @@
525
   *
526
   * @return bool  <p>Whether or not $str starts with $substring.</p>
527
   */
528
  public function startsWithAny(array $substrings, bool $caseSensitive = true): bool
529
  {
530
    if (empty($substrings)) {
531
      return false;
532
    }
533
534
    foreach ($substrings as $substring) {
535
      if ($this->startsWith($substring, $caseSensitive)) {
536
        return true;
537
      }
538
    }
539
540
    return false;
541
  }
542
543
  /**
544
   * Ensures that the string ends with $substring. If it doesn't, it's appended.
@@ 601-614 (lines=14) @@
598
   *
599
   * @return bool     <p>Whether or not $str ends with $substring.</p>
600
   */
601
  public function endsWithAny(array $substrings, bool $caseSensitive = true): bool
602
  {
603
    if (empty($substrings)) {
604
      return false;
605
    }
606
607
    foreach ($substrings as $substring) {
608
      if ($this->endsWith($substring, $caseSensitive)) {
609
        return true;
610
      }
611
    }
612
613
    return false;
614
  }
615
616
  /**
617
   * Returns the first $n characters of the string.