$dto->email->value(), ]); return $this->toDomain($model); } public function find(int $id): ?User { $model = UserModel::find($id); if ($model === null) { return null; } return $this->toDomain($model); } private function toDomain(UserModel $model): User { return new User( id: $model->id, email: new EmailAddress($model->email), ); } }