getAccessChecker()->canManageAccesses()) { throw new Forbidden(); } $user = $this->getUserRepository()->get($userId); echo $this->view->render( __DIR__ . '/../Views/moderate-categories', [ 'user1' => $user, 'categories' => $this->getModerateCategoryRepository()->findByUserId($userId), ] ); } private function getModerateCategoryRepository(): ModerateCategoryRepository { return new ModerateCategoryRepository(); } private function getUserRepository(): UserRepository { return new UserRepository(); } private function getAccessChecker(): AccessChecker { return new AccessChecker(); } }