Code Duplication    Length = 10-11 lines in 2 locations

src/View/ViewRenderFile.php 1 location

@@ 31-40 (lines=10) @@
28
     *
29
     * @throws \Anax\View\Exception when template file is not found.
30
     */
31
    public function render($file, $data)
32
    {
33
        if (!is_readable($file)) {
34
            throw new Exception("Could not find template file: " . $this->template);
35
        }
36
37
        $data["app"] = $this->app;
38
        extract($data);
39
        include $file;
40
    }
41
}
42

src/View/ViewRenderFile2.php 1 location

@@ 35-45 (lines=11) @@
32
     *
33
     * @SuppressWarnings(PHPMD.UnusedLocalVariable)
34
     */
35
    public function render($file, $data)
36
    {
37
        if (!is_readable($file)) {
38
            throw new Exception("Could not find template file: " . $this->template);
39
        }
40
41
        global $app;
42
        $di = $this->di;
43
        extract($data);
44
        require $file;
45
    }
46
47
48