Fix various code.

This commit is contained in:
James Cole
2025-05-27 17:06:15 +02:00
parent d8f512ca3a
commit 2cb14f6b72
123 changed files with 581 additions and 500 deletions

View File

@@ -31,6 +31,8 @@ use GuzzleHttp\Exception\GuzzleException;
use Illuminate\Support\Facades\Log;
use JsonException;
use function Safe\json_decode;
/**
* Class UpdateRequest
*/
@@ -100,7 +102,7 @@ class UpdateRequest implements UpdateRequestInterface
$body = (string) $res->getBody();
try {
$json = \Safe\json_decode($body, true, 512, JSON_THROW_ON_ERROR);
$json = json_decode($body, true, 512, JSON_THROW_ON_ERROR);
} catch (JsonException) {
Log::error('Body is not valid JSON');
Log::error($body);
@@ -118,7 +120,7 @@ class UpdateRequest implements UpdateRequestInterface
// parse response a bit. No message yet.
$response = $json['firefly_iii'][$channel];
$date = Carbon::createFromFormat('Y-m-d', $response['date']);
if (null === $date) {
if (!$date instanceof Carbon) {
$date = today(config('app.timezone'));
}
$return['version'] = $response['version'];