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

Version 3.0 #1

Merged
merged 5 commits into from Mar 7, 2018
Merged

Version 3.0 #1

merged 5 commits into from Mar 7, 2018

Conversation

hotline-emu
Copy link
Contributor

No description provided.

@hotline-emu hotline-emu changed the title [WIP] Version 1.0 [WIP] Version 3.0 Mar 5, 2018
* @throws \InvalidArgumentException if minvalue is not greater or equal to zero.
* @throws FilterException on failure to filter.
*/
public static function filter($value, bool $allowNull = false, int $minValue = null, int $maxValue = PHP_INT_MAX)
Copy link
Contributor

Choose a reason for hiding this comment

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

default $minValue to 0 instead of 'null

*/
public static function filter($value, bool $allowNull = false, int $minValue = null, int $maxValue = PHP_INT_MAX)
{
if ($minValue === null) {
Copy link
Contributor

Choose a reason for hiding this comment

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

If you default $minValue to 0, this check can be removed

{
if ($minValue === null) {
$minValue = 0;
} elseif (is_int($minValue) && $minValue < 0) {
Copy link
Contributor

Choose a reason for hiding this comment

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

you can remove the is_int check

@hotline-emu hotline-emu changed the title [WIP] Version 3.0 Version 3.0 Mar 7, 2018
@chadicus chadicus merged commit 9480871 into traderinteractive:master Mar 7, 2018
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