const = $const; } /** * @inheritDoc */ public function validate(ValidationContext $context, Schema $schema): ?ValidationError { if (Helper::equals($this->const, $context->currentData())) { return null; } return $this->error($schema, $context, 'const', 'The data must match the const value', [ 'const' => $this->const ]); } }