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

Fix issue #46 #48

Merged
merged 9 commits into from
Jan 26, 2018
Merged

Fix issue #46 #48

merged 9 commits into from
Jan 26, 2018

Conversation

eclipxe13
Copy link
Contributor

The issue #46 is reproducible for any rule that:

  1. extends AbstractRule
  2. set the options using cvs syntax with only one parameter that casting to boolean returns false, specifically '0'

A workaround could be just use another notation, like 'min=0' or '{"min":0}'

But well, this fix prevents options to be rejected if the option is '0' and the rule has $optionsIndexMap declared and with a count greater than zero. In this special case then change the value of the options to the array of the first index of $optionsIndexMap as key and '0' as value.

@eclipxe13
Copy link
Contributor Author

It also includes code style changes made by running phpcbf --standard=PSR2 ./src to allow travis to pass.

@adrianmiu adrianmiu merged commit 84f51cf into siriusphp:master Jan 26, 2018
@adrianmiu
Copy link
Contributor

@eclipxe13 Thank you

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.

None yet

2 participants