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

Why Number validator extends Url validator? #43

Closed
eusonlito opened this issue Apr 12, 2015 · 4 comments
Closed

Why Number validator extends Url validator? #43

eusonlito opened this issue Apr 12, 2015 · 4 comments

Comments

@eusonlito
Copy link
Contributor

https://github.com/oscarotero/form-manager/blob/master/src/Validators/Number.php#L4

@oscarotero
Copy link
Owner

Because both use the same method to check the value: filter_var, so this avoid code duplication (https://github.com/oscarotero/form-manager/blob/master/src/Validators/Url.php#L24)

@eusonlito
Copy link
Contributor Author

And a trait solution with this validation function? Number extending Url is strange.

@oscarotero
Copy link
Owner

Maybe, but it's a very simple case, I don't see much benefit.

@eusonlito
Copy link
Contributor Author

Because is not easy to remember (and strange) that Number extends Url and on future you could make changes on Url that affect to Number.

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

No branches or pull requests

2 participants