diff --git a/src/Database/Validator/Queries.php b/src/Database/Validator/Queries.php index c80a18366..f184b86bb 100644 --- a/src/Database/Validator/Queries.php +++ b/src/Database/Validator/Queries.php @@ -18,14 +18,20 @@ class Queries extends Validator */ protected array $validators; + /** + * @var int + */ + protected int $length; + /** * Queries constructor * * @param array $validators */ - public function __construct(array $validators = []) + public function __construct(array $validators = [], int $length = 0) { $this->validators = $validators; + $this->length = $length; } /** @@ -51,6 +57,10 @@ public function isValid($value): bool return false; } + if ($this->length && \count($value) > $this->length) { + return false; + } + foreach ($value as $query) { if (!$query instanceof Query) { try {