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

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