Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add check for length in Queries Validator #359

Merged
merged 1 commit into from
Nov 28, 2023

Conversation

vermakhushboo
Copy link
Member

There are some scenarios where we need both length and queries validation.

@@ -51,6 +57,10 @@ public function isValid($value): bool
return false;
}

if ($this->length && \count($value) > $this->length) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure we need the first since it is constructed with 0?

Copy link
Member

@abnegate abnegate Nov 28, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@fogelito It looks like we are using 0 to mean unlimited, so when 0, \count($value) > $this->length won't be checked since 0 == false

@fogelito
Copy link
Contributor

Besides small comment looks ok 👍
@abnegate?

@abnegate abnegate merged commit ebd030f into main Nov 28, 2023
3 checks passed
@abnegate abnegate deleted the fix-add-length-to-query-validator branch November 28, 2023 00:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants