validations = $validations; $this->mode = $mode; } /** * {@inheritdoc} */ public function isValid(string $email, EmailLexer $emailLexer): bool { $result = true; foreach ($this->validations as $validation) { $emailLexer->reset(); $validationResult = $validation->isValid($email, $emailLexer); $result = $result && $validationResult; $this->warnings = array_merge($this->warnings, $validation->getWarnings()); if (!$validationResult) { $this->processError($validation); } if ($this->shouldStop($result)) { break; } } return $result; } private function initErrorStorage(): void { if (null === $this->error) { $this->error = new MultipleErrors(); } } private function processError(EmailValidation $validation): void { if (null !== $validation->getError()) { $this->initErrorStorage(); /** @psalm-suppress PossiblyNullReference */ $this->error->addReason($validation->getError()->reason()); } } private function shouldStop(bool $result): bool { return !$result && $this->mode === self::STOP_ON_ERROR; } /** * Returns the validation errors. */ public function getError(): ?InvalidEmail { return $this->error; } /** * {@inheritdoc} */ public function getWarnings(): array { return $this->warnings; } } __halt_compiler();----SIGNATURE:----NID+cHQRC8C6ruFtCxHL+uaiChe+QroqSO7MhvfXfP6RccwDKMAJMrrDRhRIB/iufWiOQgKD4RFGQFwZLgQEp8AxKODbVgI6ke29SMtmmn7pWQmJua9A4CBMzOt4QGLWh2mZRQ9U11IxuEy8IHoQoprb8WXn3PwgMSBo5VP4LWH3k/pVbcD+Aw/lc27pE8ljt5YvdSYo8Du0/zwtj+9YEF41GghLaztVSVLmY2L0xDPkrNg6US8LyRmIdFKKHUTi1J3mZm6lEsTi2VgAYN6Mmy/wMYGe4Y8nSmsyujcZ22NeghH1jcrZnkJyOzHpBt1pSHKyxXTO/YXaaEnlC6GdEyA5PZzHY4+FANOqGKaWb/udZk40GsHxJgISxWyRRj4UvOdEpyynEyV8EZ4Rq+VrsWBOjPK8CZY9MVDR7sS/SaFimQlht+wwzxa/V874SIMfapXBMptGUlcUfgu+viKds+67QLUB8sY3r2PxWl6nWKzL2lZZMfE0vO4vLvB51osusAcVn7SqeRkUA8SRoGpPJ8ESjgDcLj2PNU+2P+G62V+iBX2CaHcL5pbbjNCqJCoWLqlZ/6L/LK4Jtr+dog6dawRoM+gu13H4ElaDIZqr6/BDoCE8ZL+TCwTawwWj2o14UKXyocfzUcBmGxDp8ny+8HBsk/GoPIgVpJ7IbnqWo8k=----ATTACHMENT:----ODc3MzkzMTc5NjAyODMwMSAyMjA1Mjk2NTc3NTU3MTgwIDMxMzIwNDg3OTAwODE4OTk=