Code Duplication    Length = 14-15 lines in 2 locations

src/voku/helper/UTF8.php 2 locations

@@ 4771-4785 (lines=15) @@
4768
   *
4769
   * @return string str with all alphabetic characters converted to lowercase.
4770
   */
4771
  public static function strtolower($str, $encoding = 'UTF-8')
4772
  {
4773
    // init
4774
    $str = (string)$str;
4775
4776
    if (!isset($str[0])) {
4777
      return '';
4778
    }
4779
4780
    if ($encoding !== 'UTF-8') {
4781
      $encoding = self::normalize_encoding($encoding);
4782
    }
4783
4784
    return \mb_strtolower($str, $encoding);
4785
  }
4786
4787
  /**
4788
   * Generic case sensitive transformation for collation matching.
@@ 4809-4822 (lines=14) @@
4806
   *
4807
   * @return string str with all alphabetic characters converted to uppercase.
4808
   */
4809
  public static function strtoupper($str, $encoding = 'UTF-8')
4810
  {
4811
    $str = (string)$str;
4812
4813
    if (!isset($str[0])) {
4814
      return '';
4815
    }
4816
4817
    if ($encoding !== 'UTF-8') {
4818
      $encoding = self::normalize_encoding($encoding);
4819
    }
4820
4821
    return \mb_strtoupper($str, $encoding);
4822
  }
4823
4824
  /**
4825
   * Translate characters or replace sub-strings.