Code Duplication    Length = 15-15 lines in 3 locations

src/voku/helper/UTF8.php 3 locations

@@ 4482-4496 (lines=15) @@
4479
   *
4480
   * @return bool
4481
   */
4482
  public static function str_iends_with($haystack, $needle)
4483
  {
4484
    $haystack = (string)$haystack;
4485
    $needle = (string)$needle;
4486
4487
    if (!isset($haystack[0], $needle[0])) {
4488
      return false;
4489
    }
4490
4491
    if (self::strcasecmp(self::substr($haystack, -self::strlen($needle)), $needle) === 0) {
4492
      return true;
4493
    }
4494
4495
    return false;
4496
  }
4497
4498
  /**
4499
   * Case-insensitive and UTF-8 safe version of <function>str_replace</function>.
@@ 4550-4564 (lines=15) @@
4547
   *
4548
   * @return bool
4549
   */
4550
  public static function str_istarts_with($haystack, $needle)
4551
  {
4552
    $haystack = (string)$haystack;
4553
    $needle = (string)$needle;
4554
4555
    if (!isset($haystack[0], $needle[0])) {
4556
      return false;
4557
    }
4558
4559
    if (self::stripos($haystack, $needle) === 0) {
4560
      return true;
4561
    }
4562
4563
    return false;
4564
  }
4565
4566
  /**
4567
   * Limit the number of characters in a string, but also after the next word.
@@ 4836-4850 (lines=15) @@
4833
   *
4834
   * @return bool
4835
   */
4836
  public static function str_starts_with($haystack, $needle)
4837
  {
4838
    $haystack = (string)$haystack;
4839
    $needle = (string)$needle;
4840
4841
    if (!isset($haystack[0], $needle[0])) {
4842
      return false;
4843
    }
4844
4845
    if (self::strpos($haystack, $needle) === 0) {
4846
      return true;
4847
    }
4848
4849
    return false;
4850
  }
4851
4852
  /**
4853
   * Get a binary representation of a specific string.