mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-02-16 10:14:58 -06:00
Temporary log level elevation.
This commit is contained in:
parent
102da7b21e
commit
97b65ac44c
@ -22,21 +22,21 @@ class IsValidAmount implements ValidationRule
|
||||
// must not be empty:
|
||||
if($this->emptyString($value)) {
|
||||
$fail('validation.filled')->translate();
|
||||
Log::debug(sprintf('IsValidAmount: "%s" cannot be empty.', $value));
|
||||
Log::info(sprintf('IsValidAmount: "%s" cannot be empty.', $value));
|
||||
return;
|
||||
}
|
||||
|
||||
// must be a number:
|
||||
if(!$this->isValidNumber($value)) {
|
||||
$fail('validation.numeric')->translate();
|
||||
Log::debug(sprintf('IsValidAmount: "%s" is not a number.', $value));
|
||||
Log::info(sprintf('IsValidAmount: "%s" is not a number.', $value));
|
||||
return;
|
||||
}
|
||||
|
||||
// must not be scientific notation:
|
||||
if($this->scientificNumber($value)) {
|
||||
$fail('validation.scientific_notation')->translate();
|
||||
Log::debug(sprintf('IsValidAmount: "%s" cannot be in the scientific notation.', $value));
|
||||
Log::info(sprintf('IsValidAmount: "%s" cannot be in the scientific notation.', $value));
|
||||
return;
|
||||
}
|
||||
|
||||
@ -44,15 +44,15 @@ class IsValidAmount implements ValidationRule
|
||||
if($this->lessThanLots($value)) {
|
||||
$amount = bcmul('-1', self::BIG_AMOUNT);
|
||||
$fail('validation.gte.numeric')->translate(['value' => $amount]);
|
||||
Log::debug(sprintf('IsValidAmount: "%s" must be more than %s.', $value, $amount));
|
||||
Log::info(sprintf('IsValidAmount: "%s" must be more than %s.', $value, $amount));
|
||||
return;
|
||||
}
|
||||
|
||||
// must be less than 100 million and 1709:
|
||||
if($this->moreThanLots($value)) {
|
||||
Log::debug(sprintf('IsValidPositiveAmount: "%s" must be more than %s.', $value, self::BIG_AMOUNT));
|
||||
Log::info(sprintf('IsValidPositiveAmount: "%s" must be more than %s.', $value, self::BIG_AMOUNT));
|
||||
$fail('validation.lte.numeric')->translate(['value' => self::BIG_AMOUNT]);
|
||||
}
|
||||
Log::debug(sprintf('IsValidAmount: "%s" is a valid positive amount.', $value));
|
||||
Log::info(sprintf('IsValidAmount: "%s" is a valid positive amount.', $value));
|
||||
}
|
||||
}
|
||||
|
@ -21,7 +21,7 @@ class IsValidPositiveAmount implements ValidationRule
|
||||
// must not be empty:
|
||||
if($this->emptyString($value)) {
|
||||
$fail('validation.filled')->translate();
|
||||
Log::debug(sprintf('IsValidPositiveAmount: "%s" cannot be empty.', $value));
|
||||
Log::info(sprintf('IsValidPositiveAmount: "%s" cannot be empty.', $value));
|
||||
|
||||
return;
|
||||
}
|
||||
@ -29,26 +29,26 @@ class IsValidPositiveAmount implements ValidationRule
|
||||
// must be a number:
|
||||
if(!$this->isValidNumber($value)) {
|
||||
$fail('validation.numeric')->translate();
|
||||
Log::debug(sprintf('IsValidPositiveAmount: "%s" is not a number.', $value));
|
||||
Log::info(sprintf('IsValidPositiveAmount: "%s" is not a number.', $value));
|
||||
return;
|
||||
}
|
||||
// must not be scientific notation:
|
||||
if($this->scientificNumber($value)) {
|
||||
$fail('validation.scientific_notation')->translate();
|
||||
Log::debug(sprintf('IsValidPositiveAmount: "%s" cannot be in the scientific notation.', $value));
|
||||
Log::info(sprintf('IsValidPositiveAmount: "%s" cannot be in the scientific notation.', $value));
|
||||
return;
|
||||
}
|
||||
// must be more than zero:
|
||||
if($this->lessOrEqualToZero($value)) {
|
||||
$fail('validation.more_than_zero')->translate();
|
||||
Log::debug(sprintf('IsValidPositiveAmount: "%s" must be more than zero.', $value));
|
||||
Log::info(sprintf('IsValidPositiveAmount: "%s" must be more than zero.', $value));
|
||||
return;
|
||||
}
|
||||
// must be less than 100 million and 1709:
|
||||
if($this->moreThanLots($value)) {
|
||||
Log::debug(sprintf('IsValidPositiveAmount: "%s" must be less than %s.', $value, self::BIG_AMOUNT));
|
||||
Log::info(sprintf('IsValidPositiveAmount: "%s" must be less than %s.', $value, self::BIG_AMOUNT));
|
||||
$fail('validation.lte.numeric')->translate(['value' => self::BIG_AMOUNT]);
|
||||
}
|
||||
Log::debug(sprintf('IsValidPositiveAmount: "%s" is a valid positive amount.', $value));
|
||||
Log::info(sprintf('IsValidPositiveAmount: "%s" is a valid positive amount.', $value));
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user