Code Duplication    Length = 17-18 lines in 2 locations

src/voku/helper/Hooks.php 2 locations

@@ 873-889 (lines=17) @@
870
   *
871
   * @return string Content with shortcodes filtered out.
872
   */
873
  public function do_shortcode($content)
874
  {
875
    if (empty(self::$shortcode_tags) || !is_array(self::$shortcode_tags)) {
876
      return $content;
877
    }
878
879
    $pattern = $this->get_shortcode_regex();
880
881
    return preg_replace_callback(
882
        "/$pattern/s",
883
        array(
884
            $this,
885
            '__do_shortcode_tag',
886
        ),
887
        $content
888
    );
889
  }
890
891
  /**
892
   * Retrieve the shortcode regular expression for searching.
@@ 1080-1097 (lines=18) @@
1077
   *
1078
   * @return string Content without shortcode tags.
1079
   */
1080
  public function strip_shortcodes($content)
1081
  {
1082
1083
    if (empty(self::$shortcode_tags) || !is_array(self::$shortcode_tags)) {
1084
      return $content;
1085
    }
1086
1087
    $pattern = $this->get_shortcode_regex();
1088
1089
    return preg_replace_callback(
1090
        "/$pattern/s",
1091
        array(
1092
            $this,
1093
            '__strip_shortcode_tag',
1094
        ),
1095
        $content
1096
    );
1097
  }
1098
1099
  /**
1100
   * Strip shortcode by tag.