getAccessChecker()->canManageUsers()) { throw new Forbidden(); } $this->renderView(['user1' => $this->getUserRepository()->get($id)]); } private function getUserRepository(): UserRepository { return new UserRepository(); } private function getAccessChecker(): AccessChecker { return new AccessChecker(); } }