From 85ebd0b39ef2675543600bd86f235921565196be Mon Sep 17 00:00:00 2001 From: James Date: Tue, 2 Apr 2024 16:13:45 +1000 Subject: [PATCH] fix: failing test for undecodable payload --- src/Recorders/JobRecorder/JobRecorder.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/Recorders/JobRecorder/JobRecorder.php b/src/Recorders/JobRecorder/JobRecorder.php index 931177f..1192e1a 100644 --- a/src/Recorders/JobRecorder/JobRecorder.php +++ b/src/Recorders/JobRecorder/JobRecorder.php @@ -75,11 +75,11 @@ protected function getJobProperties(): array } } - if (is_string($payload['data'])) { - try { + try { + if (is_string($payload['data'])) { $properties['data'] = json_decode($payload['data'], true, 512, JSON_THROW_ON_ERROR); - } catch (Exception $exception) { } + } catch (Exception $exception) { } if ($pushedAt = DateTime::createFromFormat('U.u', $payload->get('pushedAt', ''))) {