Code Duplication    Length = 14-15 lines in 2 locations

src/voku/helper/UTF8.php 2 locations

@@ 4836-4850 (lines=15) @@
4833
   *
4834
   * @return string str with all alphabetic characters converted to lowercase.
4835
   */
4836
  public static function strtolower($str, $encoding = 'UTF-8')
4837
  {
4838
    // init
4839
    $str = (string)$str;
4840
4841
    if (!isset($str[0])) {
4842
      return '';
4843
    }
4844
4845
    if ($encoding !== 'UTF-8') {
4846
      $encoding = self::normalize_encoding($encoding);
4847
    }
4848
4849
    return \mb_strtolower($str, $encoding);
4850
  }
4851
4852
  /**
4853
   * Generic case sensitive transformation for collation matching.
@@ 4874-4887 (lines=14) @@
4871
   *
4872
   * @return string str with all alphabetic characters converted to uppercase.
4873
   */
4874
  public static function strtoupper($str, $encoding = 'UTF-8')
4875
  {
4876
    $str = (string)$str;
4877
4878
    if (!isset($str[0])) {
4879
      return '';
4880
    }
4881
4882
    if ($encoding !== 'UTF-8') {
4883
      $encoding = self::normalize_encoding($encoding);
4884
    }
4885
4886
    return \mb_strtoupper($str, $encoding);
4887
  }
4888
4889
  /**
4890
   * Translate characters or replace sub-strings.