getAccessChecker()->canManageUsers()) { throw new Forbidden(); } $rowsPerPage = 10; $users = $this->getUserRepository()->find( $rowsPerPage, $this->getSkipRowsNumber($rowsPerPage) ); $this->renderView([ 'users' => $users, 'page' => $this->getCurrentPage(), 'pages' => $this->getTotalPages($this->getUserRepository()->count(), $rowsPerPage), ]); } private function getUserRepository(): UserRepository { return new UserRepository(); } private function getAccessChecker(): AccessChecker { return new AccessChecker(); } }