Code Duplication    Length = 15-15 lines in 3 locations

src/voku/helper/UTF8.php 3 locations

@@ 4536-4550 (lines=15) @@
4533
   *
4534
   * @return bool
4535
   */
4536
  public static function str_iends_with($haystack, $needle)
4537
  {
4538
    $haystack = (string)$haystack;
4539
    $needle = (string)$needle;
4540
4541
    if (!isset($haystack[0], $needle[0])) {
4542
      return false;
4543
    }
4544
4545
    if (self::strcasecmp(self::substr($haystack, -self::strlen($needle)), $needle) === 0) {
4546
      return true;
4547
    }
4548
4549
    return false;
4550
  }
4551
4552
  /**
4553
   * Case-insensitive and UTF-8 safe version of <function>str_replace</function>.
@@ 4604-4618 (lines=15) @@
4601
   *
4602
   * @return bool
4603
   */
4604
  public static function str_istarts_with($haystack, $needle)
4605
  {
4606
    $haystack = (string)$haystack;
4607
    $needle = (string)$needle;
4608
4609
    if (!isset($haystack[0], $needle[0])) {
4610
      return false;
4611
    }
4612
4613
    if (self::stripos($haystack, $needle) === 0) {
4614
      return true;
4615
    }
4616
4617
    return false;
4618
  }
4619
4620
  /**
4621
   * Limit the number of characters in a string, but also after the next word.
@@ 4890-4904 (lines=15) @@
4887
   *
4888
   * @return bool
4889
   */
4890
  public static function str_starts_with($haystack, $needle)
4891
  {
4892
    $haystack = (string)$haystack;
4893
    $needle = (string)$needle;
4894
4895
    if (!isset($haystack[0], $needle[0])) {
4896
      return false;
4897
    }
4898
4899
    if (self::strpos($haystack, $needle) === 0) {
4900
      return true;
4901
    }
4902
4903
    return false;
4904
  }
4905
4906
  /**
4907
   * Get a binary representation of a specific string.