Code Duplication    Length = 17-17 lines in 2 locations

src/voku/helper/UTF8.php 2 locations

@@ 4397-4413 (lines=17) @@
4394
   *
4395
   * @return   string The string with unwanted characters stripped from the right
4396
   */
4397
  public static function rtrim($str = '', $chars = INF)
4398
  {
4399
    $str = (string)$str;
4400
4401
    if (!isset($str[0])) {
4402
      return '';
4403
    }
4404
4405
    // Info: http://nadeausoftware.com/articles/2007/9/php_tip_how_strip_punctuation_characters_web_page#Unicodecharactercategories
4406
    if ($chars === INF || !$chars) {
4407
      return preg_replace('/[\pZ\pC]+$/u', '', $str);
4408
    }
4409
4410
    $chars = INF === $chars ? '\s' : self::rxClass($chars);
4411
4412
    return preg_replace("/{$chars}+$/u", '', $str);
4413
  }
4414
4415
  /**
4416
   * rxClass
@@ 3892-3908 (lines=17) @@
3889
   *
3890
   * @return string The string with unwanted characters stripped from the left
3891
   */
3892
  public static function ltrim($str = '', $chars = INF)
3893
  {
3894
    $str = (string)$str;
3895
3896
    if (!isset($str[0])) {
3897
      return '';
3898
    }
3899
3900
    // Info: http://nadeausoftware.com/articles/2007/9/php_tip_how_strip_punctuation_characters_web_page#Unicodecharactercategories
3901
    if ($chars === INF || !$chars) {
3902
      return preg_replace('/^[\pZ\pC]+/u', '', $str);
3903
    }
3904
3905
    $chars = INF === $chars ? '\s' : self::rxClass($chars);
3906
3907
    return preg_replace("/^{$chars}+/u", '', $str);
3908
  }
3909
3910
  /**
3911
   * Returns the UTF-8 character with the maximum code point in the given data.