Code Duplication    Length = 18-18 lines in 2 locations

src/voku/helper/UTF8.php 2 locations

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