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