value = $value; parent::__construct(0); } /** * @inheritDoc */ public function validate(ValidationContext $context, Schema $schema): ?ValidationError { /** @var float|int $number */ $number = $this->value->data($context->rootData(), $context->currentDataPath(), $this); if ($number === $this || !(is_float($number) || is_int($number))) { return $this->error($schema, $context, 'exclusiveMaximum', 'Invalid $data', [ 'pointer' => (string)$this->value, ]); } $this->number = $number; return parent::validate($context, $schema); } }