assertNotEmpty('firstname', $firstname); $this->assertNotEmpty('lastname', $lastname); } public static function fromShopper(Shopper $shopper): self { return new self( matricule: clone $shopper->matricule, firstname: $shopper->prenom, lastname: $shopper->nom, facility: $shopper->etablissement, site: $shopper->site, service: $shopper->service ); } private function assertNotEmpty(string $attribute, string $value): void { if (empty(trim($value))) { throw new \DomainException("{$attribute} cannot be empty"); } } }