getCategoryAccessChecker()->canDelete()) { throw new Forbidden(); } $category = $this->getCategoryRepository()->get(Uuid::fromString($id)); $category->delete(); $this->response->redirect('/'); } private function getCategoryRepository(): CategoryWriteRepository { return new CategoryWriteRepository(); } private function getCategoryAccessChecker(): CategoryAccessChecker { return new CategoryAccessChecker(); } }