Fix max amount.

This commit is contained in:
James Cole
2018-07-22 08:36:30 +02:00
parent aed7e6d289
commit 662b832274
4 changed files with 23 additions and 5 deletions

View File

@@ -203,6 +203,23 @@ class FireflyValidator extends Validator
return bccomp((string)$value, (string)$compare) > 0;
}
/**
* @param $attribute
* @param $value
* @param $parameters
* @SuppressWarnings(PHPMD.UnusedFormalParameter)
*
* @return bool
*/
public function validateLess($attribute, $value, $parameters): bool
{
/** @var mixed $compare */
$compare = $parameters[0] ?? '0';
return bccomp((string)$value, (string)$compare) < 0;
}
/**
* @SuppressWarnings(PHPMD.UnusedFormalParameter)
*