number = $number; } /** * @inheritDoc */ public function validate(ValidationContext $context, Schema $schema): ?ValidationError { if ($context->currentData() >= $this->number) { return null; } return $this->error($schema, $context, 'minimum', "Number must be greater than or equal to {min}", [ 'min' => $this->number, ]); } }