Replace phpstan suggestions

This commit is contained in:
James Cole
2022-10-30 14:44:49 +01:00
parent c032ffd4f9
commit 33f370359c
45 changed files with 99 additions and 87 deletions

View File

@@ -377,7 +377,7 @@ class CreateRecurringTransactions implements ShouldQueue
}
if ($journalCount > 0 && true === $this->force) {
Log::warning(sprintf('Already created %d groups for date %s but FORCED to continue.', $journalCount, $date->format('Y-m-d')));
app('log')->warning(sprintf('Already created %d groups for date %s but FORCED to continue.', $journalCount, $date->format('Y-m-d')));
}
// create transaction array and send to factory.

View File

@@ -114,13 +114,13 @@ class DownloadExchangeRates implements ShouldQueue
$res = $client->get($url);
$statusCode = $res->getStatusCode();
if (200 !== $statusCode) {
Log::warning(sprintf('Trying to grab "%s" resulted in status code %d.', $url, $statusCode));
app('log')->warning(sprintf('Trying to grab "%s" resulted in status code %d.', $url, $statusCode));
return;
}
$body = (string) $res->getBody();
$json = json_decode($body, true);
if (false === $json || null === $json) {
Log::warning(sprintf('Trying to grab "%s" resulted in bad JSON.', $url));
app('log')->warning(sprintf('Trying to grab "%s" resulted in bad JSON.', $url));
return;
}
$date = Carbon::createFromFormat('Y-m-d', $json['date']);