protected function findUserOrFail($userId) { $user = $this->userRepository->ofId(new UserId($userId)); if (null === $user) { throw new UserDoesNotExistException(); } return $user; }