number = $number; } /** * @inheritDoc */ public function validate(ValidationContext $context, Schema $schema): ?ValidationError { if ($context->currentData() < $this->number) { return null; } return $this->error($schema, $context, 'exclusiveMaximum', "Number must be lower than {max}", [ 'max' => $this->number, ]); } }