Code Duplication    Length = 13-14 lines in 2 locations

application/controllers/MovieController.php 1 location

@@ 91-103 (lines=13) @@
88
        $this->view->paginator = $this->_helper->createPaginator(\mQueue\Model\MovieMapper::getFilteredQuery($filters, $sort));
89
    }
90
91
    public function viewAction(): void
92
    {
93
        if ($this->getRequest()->getParam('id')) {
94
            $this->view->movie = \mQueue\Model\MovieMapper::find($this->getRequest()->getParam('id'));
95
        }
96
97
        if (!$this->view->movie) {
98
            throw new Exception($this->view->translate('Movie not found'));
99
        }
100
101
        $this->view->users = \mQueue\Model\UserMapper::fetchAll();
102
        $this->view->movieActivity = $this->_helper->createPaginator(\mQueue\Model\StatusMapper::getActivityQuery($this->view->movie));
103
    }
104
105
    public function addAction(): void
106
    {

application/controllers/UserController.php 1 location

@@ 80-93 (lines=14) @@
77
        \mQueue\Model\User::setCurrent(null);
78
    }
79
80
    public function viewAction(): void
81
    {
82
        if ($this->getRequest()->getParam('id')) {
83
            $this->view->user = \mQueue\Model\UserMapper::find($this->getRequest()->getParam('id'));
84
        } else {
85
            $this->view->user = \mQueue\Model\User::getCurrent();
86
        }
87
88
        if (!$this->view->user) {
89
            throw new Exception($this->view->translate('User not found'));
90
        }
91
92
        $this->view->userActivity = $this->_helper->createPaginator(\mQueue\Model\StatusMapper::getActivityQuery($this->view->user));
93
    }
94
}
95