Code Duplication    Length = 15-15 lines in 3 locations

src/voku/helper/UTF8.php 3 locations

@@ 4443-4457 (lines=15) @@
4440
   *
4441
   * @return bool
4442
   */
4443
  public static function str_iends_with($haystack, $needle)
4444
  {
4445
    $haystack = (string)$haystack;
4446
    $needle = (string)$needle;
4447
4448
    if (!isset($haystack[0], $needle[0])) {
4449
      return false;
4450
    }
4451
4452
    if (self::strcasecmp(self::substr($haystack, -self::strlen($needle)), $needle) === 0) {
4453
      return true;
4454
    }
4455
4456
    return false;
4457
  }
4458
4459
  /**
4460
   * Case-insensitive and UTF-8 safe version of <function>str_replace</function>.
@@ 4511-4525 (lines=15) @@
4508
   *
4509
   * @return bool
4510
   */
4511
  public static function str_istarts_with($haystack, $needle)
4512
  {
4513
    $haystack = (string)$haystack;
4514
    $needle = (string)$needle;
4515
4516
    if (!isset($haystack[0], $needle[0])) {
4517
      return false;
4518
    }
4519
4520
    if (self::stripos($haystack, $needle) === 0) {
4521
      return true;
4522
    }
4523
4524
    return false;
4525
  }
4526
4527
  /**
4528
   * Limit the number of characters in a string, but also after the next word.
@@ 4797-4811 (lines=15) @@
4794
   *
4795
   * @return bool
4796
   */
4797
  public static function str_starts_with($haystack, $needle)
4798
  {
4799
    $haystack = (string)$haystack;
4800
    $needle = (string)$needle;
4801
4802
    if (!isset($haystack[0], $needle[0])) {
4803
      return false;
4804
    }
4805
4806
    if (self::strpos($haystack, $needle) === 0) {
4807
      return true;
4808
    }
4809
4810
    return false;
4811
  }
4812
4813
  /**
4814
   * Get a binary representation of a specific string.