Code Duplication    Length = 3-3 lines in 2 locations

src/RSlim.php 2 locations

@@ 62-64 (lines=3) @@
59
                $newResponse = $response->withHeader('Content-Type', 'application/json;charset=utf-8')->withHeader('X-Powered-By',"reformo/rslim")->withStatus($status);
60
            }
61
            else{
62
                if (!file_exists($this->config['base_dir'].$template)){
63
                    throw new \Exception("<strong>Template file not found!</strong> ".$route.'/'.$action." needs a template file at:".$template );
64
                }
65
                $function_output = app_content($request, $args);
66
                if (!isset($function_output['data'])){
67
                    $function_output['data']=[];
@@ 114-116 (lines=3) @@
111
                }
112
                $main_template =  '/apps/'.$this->config['app_name'] . '/templates/_' . $main_template_name . '.html';
113
114
                if (!file_exists($this->config['base_dir'] . $main_template)){
115
                    throw new \Exception("<strong>Main emplate file not found!</strong> ".$route.'/'.$action." needs a main template file at:".$main_template );
116
                }
117
                $app_content =  $this->twig->render( $main_template, $function_output);
118
                $newResponse=$response->withHeader('X-Powered-By',"reformo/rslim");
119
                $newResponse->write($app_content);