Code Duplication    Length = 15-15 lines in 3 locations

src/voku/helper/UTF8.php 3 locations

@@ 4531-4545 (lines=15) @@
4528
   *
4529
   * @return bool
4530
   */
4531
  public static function str_iends_with($haystack, $needle)
4532
  {
4533
    $haystack = (string)$haystack;
4534
    $needle = (string)$needle;
4535
4536
    if (!isset($haystack[0], $needle[0])) {
4537
      return false;
4538
    }
4539
4540
    if (self::strcasecmp(self::substr($haystack, -self::strlen($needle)), $needle) === 0) {
4541
      return true;
4542
    }
4543
4544
    return false;
4545
  }
4546
4547
  /**
4548
   * Case-insensitive and UTF-8 safe version of <function>str_replace</function>.
@@ 4599-4613 (lines=15) @@
4596
   *
4597
   * @return bool
4598
   */
4599
  public static function str_istarts_with($haystack, $needle)
4600
  {
4601
    $haystack = (string)$haystack;
4602
    $needle = (string)$needle;
4603
4604
    if (!isset($haystack[0], $needle[0])) {
4605
      return false;
4606
    }
4607
4608
    if (self::stripos($haystack, $needle) === 0) {
4609
      return true;
4610
    }
4611
4612
    return false;
4613
  }
4614
4615
  /**
4616
   * Limit the number of characters in a string, but also after the next word.
@@ 4885-4899 (lines=15) @@
4882
   *
4883
   * @return bool
4884
   */
4885
  public static function str_starts_with($haystack, $needle)
4886
  {
4887
    $haystack = (string)$haystack;
4888
    $needle = (string)$needle;
4889
4890
    if (!isset($haystack[0], $needle[0])) {
4891
      return false;
4892
    }
4893
4894
    if (self::strpos($haystack, $needle) === 0) {
4895
      return true;
4896
    }
4897
4898
    return false;
4899
  }
4900
4901
  /**
4902
   * Get a binary representation of a specific string.