Code Duplication    Length = 12-12 lines in 2 locations

src/voku/helper/UTF8.php 2 locations

@@ 3189-3200 (lines=12) @@
3186
   *
3187
   * @return   string The string with unwanted characters stripped from the left
3188
   */
3189
  public static function ltrim($str = '', $chars = INF)
3190
  {
3191
    $str = (string)$str;
3192
3193
    if (!isset($str[0])) {
3194
      return '';
3195
    }
3196
3197
    $chars = INF === $chars ? '\s' : self::rxClass($chars);
3198
3199
    return preg_replace("/^{$chars}+/u", '', $str);
3200
  }
3201
3202
  /**
3203
   * Returns the UTF-8 character with the maximum code point in the given data.
@@ 3638-3649 (lines=12) @@
3635
   *
3636
   * @return   string The string with unwanted characters stripped from the right
3637
   */
3638
  public static function rtrim($str = '', $chars = INF)
3639
  {
3640
    $str = (string)$str;
3641
3642
    if (!isset($str[0])) {
3643
      return '';
3644
    }
3645
3646
    $chars = INF === $chars ? '\s' : self::rxClass($chars);
3647
3648
    return preg_replace("/{$chars}+$/u", '', $str);
3649
  }
3650
3651
  /**
3652
   * rxClass