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