Code Duplication    Length = 14-27 lines in 2 locations

src/User/AdminController.php 1 location

@@ 67-80 (lines=14) @@
64
65
66
67
    public function editUser($id)
68
    {
69
        $title = "Admin | Edit user";
70
71
        $user = $this->user->getUser("id", $id);
72
73
        $form = new UpdateUserForm($this->di, $user);
74
        $form->check();
75
76
        $data = $this->user->getUser('id', $id);
77
78
        $this->view->add("user/profile", ["user" => $data, "form" => $form->getHTML()]);
79
        $this->pageRender->renderPage(["title" => $title]);
80
    }
81
82
83

src/User/UserController.php 1 location

@@ 77-103 (lines=27) @@
74
     *
75
     * @return void
76
     */
77
    public function getPostLogin()
78
    {
79
        if ($this->user->isLoggedIn()) {
80
            $this->response->redirect("user");
81
        }
82
83
        $title      = "A login page";
84
        $view       = $this->di->get("view");
85
        $pageRender = $this->di->get("pageRender");
86
        $form       = new UserLoginForm($this->di);
87
88
        $form->check();
89
90
        $data = [
91
            "content" => $form->getHTML(),
92
        ];
93
94
        // var_dump($form);
95
        // exit;
96
        // $this->utils->login()
97
98
        // $response->redirect('user');
99
100
        $view->add("default2/article", $data);
101
102
        $pageRender->renderPage(["title" => $title]);
103
    }
104
105
106