Code Duplication    Length = 13-13 lines in 2 locations

php/class-extension.php 2 locations

@@ 73-85 (lines=13) @@
70
		return $this->get_template( $env, $context, 'sidebar', $name );
71
	}
72
73
	public function get_template_part( \Twig_Environment $env, $context, $slug, $name = null ) {
74
75
		try {
76
			$return = twig_include( $env, $context, $this->get_templates( $slug, $name ) );
77
			do_action( "get_template_part_{$slug}", $slug, $name );
78
		} catch ( \Twig_Error_Loader $e ) {
79
			ob_start();
80
			get_template_part( $slug, $name );
81
			$return = ob_get_clean();
82
		}
83
84
		return $return;
85
	}
86
87
	/**
88
	 * Skips rendering in native function in favor of Plugin->get_search_form() in filter
@@ 97-109 (lines=13) @@
94
		return apply_filters( 'get_search_form', true );
95
	}
96
97
	protected function get_template( \Twig_Environment $env, $context, $type, $name = null ) {
98
99
		try {
100
			$return = twig_include( $env, $context, $this->get_templates( $type, $name ) );
101
			do_action( 'get_' . $type, $name );
102
		} catch ( \Twig_Error_Loader $e ) {
103
			ob_start();
104
			call_user_func( 'get_' . $type, $name );
105
			$return = ob_get_clean();
106
		}
107
108
		return $return;
109
	}
110
111
	public function comments_template( \Twig_Environment $env, $context, $file = 'comments.twig', $separate_comments = false ) {
112