Skip to content

Validations #118

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

Closed
wants to merge 9 commits into from
Closed

Validations #118

wants to merge 9 commits into from

Conversation

BruceDev
Copy link
Contributor

Added integer validations

@vlucas
Copy link
Owner

vlucas commented Aug 19, 2015

Whoops - commented on the wrong PR - didn't notice you closed it and opened this one instead. Please check the comments on #117 - they all still apply to this one.

@BruceDev
Copy link
Contributor Author

Hey thanks for the tips. New to contributing so appreciate you helping me out. I did the changes and tested. It throws the error if its anything BUT solid numbers, so no periods, commas, percentage signs, and plus signs are able to pass by.

{
return $this->assertCallback(
function ($value) {
return (ctype_digit($value) == true);
Copy link
Owner

Choose a reason for hiding this comment

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

The ctype_digit function already returns a boolean. Change this to return ctype_digit($value);.

@GrahamCampbell
Copy link
Collaborator

What's wrong with is_numeric?

@GrahamCampbell
Copy link
Collaborator

We're missing tests.

@GrahamCampbell
Copy link
Collaborator

I've squashed and merged this. Thanks for the contribution.

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