original_string: private function get_file_extension( $view_root, $template_name ) {
  		$paths = to_array( $this->get_path_to_views() );
  		// get first element in array
  		$path = reset( $paths );
  
  		if ( ! empty( $view_root ) ) {
  			$path .= '/' . $view_root;
  		}
  
  		$path .= '/' . $template_name;
  
  		$files = glob( $path . '.*' );
  		//return pathinfo of first $files element
  		return pathinfo( reset( $files ), PATHINFO_EXTENSION );
  	}
code: private function get_file_extension( $view_root, $template_name ) {
  		$paths = to_array( $this->get_path_to_views() );
  		// get first element in array
  		$path = reset( $paths );
  
  		if ( ! empty( $view_root ) ) {
  			$path .= '/' . $view_root;
  		}
  
  		$path .= '/' . $template_name;
  
  		$files = glob( $path . '.*' );
  		//return pathinfo of first $files element
  		return pathinfo( reset( $files ), PATHINFO_EXTENSION );
  	}
code_tokens: private function get_file_extension ( $ view_root , $ template_name ) { $ paths = to_array ( $ this -> get_path_to_views ( ) ) ; // get first element in array $ path = reset ( $ paths ) ; if ( ! empty ( $ view_root ) ) { $ path .= '/' . $ view_root ; } $ path .= '/' . $ template_name ; $ files = glob ( $ path . '.*' ) ; //return pathinfo of first $files element return pathinfo ( reset ( $ files ) , PATHINFO_EXTENSION ) ; }
docstring: Find the first file extension that matches for this view template
  
  @param  string $view_root
  @param  string $template_name
  @return mixed
docstring_tokens: Find the first file extension that matches for this view template