Code Duplication    Length = 17-18 lines in 2 locations

src/voku/helper/Hooks.php 2 locations

@@ 885-901 (lines=17) @@
882
   *
883
   * @return string <p>Content with shortcodes filtered out.</p>
884
   */
885
  public function do_shortcode($content)
886
  {
887
    if (empty(self::$shortcode_tags) || !is_array(self::$shortcode_tags)) {
888
      return $content;
889
    }
890
891
    $pattern = $this->get_shortcode_regex();
892
893
    return preg_replace_callback(
894
        "/$pattern/s",
895
        array(
896
            $this,
897
            '_do_shortcode_tag',
898
        ),
899
        $content
900
    );
901
  }
902
903
  /**
904
   * Retrieve the shortcode regular expression for searching.
@@ 1094-1111 (lines=18) @@
1091
   *
1092
   * @return string <p>Content without shortcode tags.</p>
1093
   */
1094
  public function strip_shortcodes($content)
1095
  {
1096
1097
    if (empty(self::$shortcode_tags) || !is_array(self::$shortcode_tags)) {
1098
      return $content;
1099
    }
1100
1101
    $pattern = $this->get_shortcode_regex();
1102
1103
    return preg_replace_callback(
1104
        "/$pattern/s",
1105
        array(
1106
            $this,
1107
            '_strip_shortcode_tag',
1108
        ),
1109
        $content
1110
    );
1111
  }
1112
1113
  /**
1114
   * Strip shortcode by tag.