mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-12-11 01:19:31 +00:00
Fix various phpstan issues.
This commit is contained in:
@@ -54,12 +54,12 @@ class IsDateOrTime implements ValidationRule
|
||||
// probably a date format.
|
||||
try {
|
||||
Carbon::createFromFormat('Y-m-d', $value);
|
||||
} catch (InvalidDateException $e) {
|
||||
} catch (InvalidDateException $e) { // @phpstan-ignore-line
|
||||
app('log')->error(sprintf('"%s" is not a valid date: %s', $value, $e->getMessage()));
|
||||
|
||||
$fail('validation.date_or_time')->translate();;
|
||||
return;
|
||||
} catch (InvalidFormatException $e) {
|
||||
} catch (InvalidFormatException $e) { // @phpstan-ignore-line
|
||||
app('log')->error(sprintf('"%s" is of an invalid format: %s', $value, $e->getMessage()));
|
||||
|
||||
$fail('validation.date_or_time')->translate();;
|
||||
@@ -71,7 +71,7 @@ class IsDateOrTime implements ValidationRule
|
||||
// is an atom string, I hope?
|
||||
try {
|
||||
Carbon::parse($value);
|
||||
} catch (InvalidDateException $e) {
|
||||
} catch (InvalidDateException $e) { // @phpstan-ignore-line
|
||||
app('log')->error(sprintf('"%s" is not a valid date or time: %s', $value, $e->getMessage()));
|
||||
|
||||
$fail('validation.date_or_time')->translate();;
|
||||
|
||||
@@ -129,7 +129,7 @@ class ValidRecurrenceRepetitionValue implements ValidationRule
|
||||
$dateString = substr($value, 7);
|
||||
try {
|
||||
Carbon::createFromFormat('Y-m-d', $dateString);
|
||||
} catch (InvalidArgumentException $e) {
|
||||
} catch (InvalidArgumentException $e) { // @phpstan-ignore-line
|
||||
app('log')->debug(sprintf('Could not parse date %s: %s', $dateString, $e->getMessage()));
|
||||
|
||||
return false;
|
||||
|
||||
Reference in New Issue
Block a user