value = $value; } /** * @inheritDoc */ public function validate(ValidationContext $context, Schema $schema): ?ValidationError { if ($this->value === false) { return null; } if ($this->value === true) { return $this->error($schema, $context, 'not', "The data is never valid"); } if (is_object($this->value) && !($this->value instanceof Schema)) { $this->value = $context->loader()->loadObjectSchema($this->value); } $error = $context->validateSchemaWithoutEvaluated($this->value, 1); if ($error) { return null; } return $this->error($schema, $context, 'not', 'The data must not match schema'); } }