Remove static references

This commit is contained in:
James Cole
2023-10-29 06:32:00 +01:00
parent e65d0eef6e
commit 075d459b7c
128 changed files with 391 additions and 391 deletions

View File

@@ -64,11 +64,11 @@ class IsDateOrTime implements Rule
try {
Carbon::createFromFormat('Y-m-d', $value);
} catch (InvalidDateException $e) {
Log::error(sprintf('"%s" is not a valid date: %s', $value, $e->getMessage()));
app('log')->error(sprintf('"%s" is not a valid date: %s', $value, $e->getMessage()));
return false;
} catch (InvalidFormatException $e) {
Log::error(sprintf('"%s" is of an invalid format: %s', $value, $e->getMessage()));
app('log')->error(sprintf('"%s" is of an invalid format: %s', $value, $e->getMessage()));
return false;
}
@@ -79,11 +79,11 @@ class IsDateOrTime implements Rule
try {
Carbon::parse($value);
} catch (InvalidDateException $e) {
Log::error(sprintf('"%s" is not a valid date or time: %s', $value, $e->getMessage()));
app('log')->error(sprintf('"%s" is not a valid date or time: %s', $value, $e->getMessage()));
return false;
} catch (InvalidFormatException $e) {
Log::error(sprintf('"%s" is of an invalid format: %s', $value, $e->getMessage()));
app('log')->error(sprintf('"%s" is of an invalid format: %s', $value, $e->getMessage()));
return false;
}

View File

@@ -110,7 +110,7 @@ class IsValidAttachmentModel implements Rule
TransactionJournal::class => 'validateJournal',
];
if (!array_key_exists($this->model, $methods)) {
Log::error(sprintf('Cannot validate model "%s" in %s.', substr($this->model, 0, 20), __METHOD__));
app('log')->error(sprintf('Cannot validate model "%s" in %s.', substr($this->model, 0, 20), __METHOD__));
return false;
}