Code Duplication    Length = 3-3 lines in 2 locations

src/RSlim.php 2 locations

@@ 78-80 (lines=3) @@
75
    }
76
    
77
    private function returnHtml($function_name, $request, $args, $response, $route, $action, $controller, $template){
78
        if (!file_exists($this->config['base_dir'] . $template)) {
79
            throw new \Exception("<strong>Template file not found!</strong> " . $route . '/' . $action . " needs a template file at:" . $template);
80
        }
81
        $function_output = call_user_func($function_name, $request, $args);
82
        if (!isset($function_output['data'])) {
83
            $function_output['data'] = [];
@@ 93-95 (lines=3) @@
90
        }
91
        $main_template = '/' . $this->config['app_dir'] . '/templates/_' . $main_template_name . '.html';
92
        
93
        if (!file_exists($this->config['base_dir'] . $main_template)) {
94
            throw new \Exception("<strong>Main emplate file not found!</strong> ".$route . '/' . $action .
95
                " needs a main template file at:" . $main_template);
96
        }
97
        $app_content = $this->twig->render($main_template, $function_output);
98
        $newResponse = $response->withHeader('X-Powered-By', "reformo/rslim");