services = $services ?: new DefaultServiceCollector(); } public function getPrimaryEmail(EmailInterface $email) : EmailInterface { foreach ($this->services as $service) { if ($service->isSupported($email)) { return $service->getPrimaryEmail($email); } } return $email; } }