Code Duplication    Length = 18-18 lines in 2 locations

src/voku/helper/UTF8.php 2 locations

@@ 4819-4836 (lines=18) @@
4816
   *
4817
   * @return bool <p>Whether or not $str starts with $substring.</p>
4818
   */
4819
  public static function str_istarts_with_any(string $str, array $substrings): bool
4820
  {
4821
    if (!isset($str[0])) {
4822
      return false;
4823
    }
4824
4825
    if (empty($substrings)) {
4826
      return false;
4827
    }
4828
4829
    foreach ($substrings as $substring) {
4830
      if (self::str_istarts_with($str, $substring)) {
4831
        return true;
4832
      }
4833
    }
4834
4835
    return false;
4836
  }
4837
4838
  /**
4839
   * Limit the number of characters in a string, but also after the next word.
@@ 5138-5155 (lines=18) @@
5135
   *
5136
   * @return bool <p>Whether or not $str starts with $substring.</p>
5137
   */
5138
  public static function str_starts_with_any(string $str, array $substrings): bool
5139
  {
5140
    if (!isset($str[0])) {
5141
      return false;
5142
    }
5143
5144
    if (empty($substrings)) {
5145
      return false;
5146
    }
5147
5148
    foreach ($substrings as $substring) {
5149
      if (self::str_starts_with($str, $substring)) {
5150
        return true;
5151
      }
5152
    }
5153
5154
    return false;
5155
  }
5156
5157
  /**
5158
   * Get a binary representation of a specific string.