Code Duplication    Length = 12-12 lines in 2 locations

src/voku/helper/UTF8.php 2 locations

@@ 3221-3232 (lines=12) @@
3218
   *
3219
   * @return   string The string with unwanted characters stripped from the left
3220
   */
3221
  public static function ltrim($str = '', $chars = INF)
3222
  {
3223
    $str = (string)$str;
3224
3225
    if (!isset($str[0])) {
3226
      return '';
3227
    }
3228
3229
    $chars = INF === $chars ? '\s' : self::rxClass($chars);
3230
3231
    return preg_replace("/^{$chars}+/u", '', $str);
3232
  }
3233
3234
  /**
3235
   * Returns the UTF-8 character with the maximum code point in the given data.
@@ 3682-3693 (lines=12) @@
3679
   *
3680
   * @return   string The string with unwanted characters stripped from the right
3681
   */
3682
  public static function rtrim($str = '', $chars = INF)
3683
  {
3684
    $str = (string)$str;
3685
3686
    if (!isset($str[0])) {
3687
      return '';
3688
    }
3689
3690
    $chars = INF === $chars ? '\s' : self::rxClass($chars);
3691
3692
    return preg_replace("/{$chars}+$/u", '', $str);
3693
  }
3694
3695
  /**
3696
   * rxClass