Code Duplication    Length = 14-15 lines in 2 locations

src/voku/helper/UTF8.php 2 locations

@@ 4788-4802 (lines=15) @@
4785
   *
4786
   * @return string str with all alphabetic characters converted to lowercase.
4787
   */
4788
  public static function strtolower($str, $encoding = 'UTF-8')
4789
  {
4790
    // init
4791
    $str = (string)$str;
4792
4793
    if (!isset($str[0])) {
4794
      return '';
4795
    }
4796
4797
    if ($encoding !== 'UTF-8') {
4798
      $encoding = self::normalize_encoding($encoding);
4799
    }
4800
4801
    return \mb_strtolower($str, $encoding);
4802
  }
4803
4804
  /**
4805
   * Generic case sensitive transformation for collation matching.
@@ 4826-4839 (lines=14) @@
4823
   *
4824
   * @return string str with all alphabetic characters converted to uppercase.
4825
   */
4826
  public static function strtoupper($str, $encoding = 'UTF-8')
4827
  {
4828
    $str = (string)$str;
4829
4830
    if (!isset($str[0])) {
4831
      return '';
4832
    }
4833
4834
    if ($encoding !== 'UTF-8') {
4835
      $encoding = self::normalize_encoding($encoding);
4836
    }
4837
4838
    return \mb_strtoupper($str, $encoding);
4839
  }
4840
4841
  /**
4842
   * Translate characters or replace sub-strings.