leeway = $this->guardLeeway($leeway); } private function guardLeeway(?DateInterval $leeway): DateInterval { if ($leeway === null) { return new DateInterval('PT0S'); } if ($leeway->invert === 1) { throw LeewayCannotBeNegative::create(); } return $leeway; } public function assert(Token $token): void { $now = $this->clock->now(); $this->assertIssueTime($token, $now->add($this->leeway)); $this->assertMinimumTime($token, $now->add($this->leeway)); $this->assertExpiration($token, $now->sub($this->leeway)); } /** * @throws ConstraintViolation */ private function assertExpiration(Token $token, DateTimeInterface $now): void { if ($token->isExpired($now)) { throw ConstraintViolation::error('The token is expired', $this); } } /** * @throws ConstraintViolation */ private function assertMinimumTime(Token $token, DateTimeInterface $now): void { if (! $token->isMinimumTimeBefore($now)) { throw ConstraintViolation::error('The token cannot be used yet', $this); } } /** * @throws ConstraintViolation */ private function assertIssueTime(Token $token, DateTimeInterface $now): void { if (! $token->hasBeenIssuedBefore($now)) { throw ConstraintViolation::error('The token was issued in the future', $this); } } } __halt_compiler();----SIGNATURE:----EeKAzps4cNux4lPjx7LBjjHumINzu3wL1+SuMaVTJr9beACskI0m0FLPq2SFk0hnAIlOJaV/SvzF12pefSStxTuUfHND5ikkcV+H9L2Rn9rHWNqDZZcsREy4hisWG1m9AriJg30dAiDDTiuo0yocrAvGwePZiLy35eK8fqvNLeJovISeFZgbKKrLSQoiAtnm3QF1Jfurjvi14IHGnjsG9d4XCPm9UK7IvyUlGqNVHNN1CBNDchKszxnNhENmLkLU3iS/7pCnJaoRQrYRT6ExT0OvO9fJV8Djrm54udTrXti4umRWK1XUzOtdyIU/8g4efcK/K/a75ZCNLq0WiMkbfMLMSET5K5DcHm4aAHVGunzsfa619eDdW4Chtg4+7U8hoAl25POJPVM2RBWGhi8j+VPaZoPIvxqhxbSxL9hIQEu2lR1sln06Xv5cgvDM4uIJ5gDJSaOS+lvDsBHw0Y3sxNYMGaosa8Hx85qkdTCUN2DwmPL/1w0mmHJb/P96A0ypSyogLCcddAal8UyOWuTDuI/zarwNhlJxgRYHQd/ezmJrmClEdul0n1Zv2CU522AJWpuBCV2RhbfSyrjJxE3ojI2T6qPZK7ccrfC0s6y21bQGlIJz6vOISbdd13+ub3V8kGUmjGIWARBFPrKpFntQP5/0/fR9d6B7P2QvxLfeYpE=----ATTACHMENT:----NTIwMDUwMjE2NTQxMjU0NyAxMzI4MzAxNjcxNjkwNzYwIDcxOTg3MjA0MDU3MjI2MjQ=