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

[Documentation] Diference between Doc and Package #180

Open
allanbarbosa opened this issue Jan 29, 2018 · 4 comments
Open

[Documentation] Diference between Doc and Package #180

allanbarbosa opened this issue Jan 29, 2018 · 4 comments

Comments

@allanbarbosa
Copy link

What

Hello, good morning.
I am using your package and i notice that the documentation about the NotEmpty validate on optional fields is not equal in the package code. In your documentation you said that the optional validation accept by default the allowEmpty = false, but in the code package is inverse, the allowEmpty = true.

What is expected

Change the code package or change the documentation.

Thank you so much
Sorry for my bad english, i'm trainning.

@rick-nu
Copy link

rick-nu commented Jan 30, 2018

@allanbarbosa good catch, in optional($key, $name = null, $allowEmpty = true) allow empty is true by default, instead of false as the documentation suggests.

@berry-langerak do you know if there was a specific reason for this? Or should I revert it to be false by default.

@allanbarbosa
Copy link
Author

@RickvdStaaij thank you, this is a excelent package. Good job.

@berry-langerak
Copy link
Member

Hi. If something is optional, I think the most logical default would be to allow the value to be empty. Right?

@rick-nu
Copy link

rick-nu commented Jan 30, 2018

Hmm I'm not sure if that's the most logical, I can't really decide. But I think that it's probably better to adjust the documentation at this point. It might lead to unexpected behavior for people who rely on this principle. I'll create a PR to update the docs soon. Agreed? :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants