8000 Merge pull request #186 from jryd/main · spatie/laravel-ignition@0c864b3 · GitHub
[go: up one dir, main page]

Skip to content

Commit 0c864b3

Browse files
authored
Merge pull request #186 from jryd/main
fix: move string check/decode for data in payload
2 parents 7de9e7e + 85ebd0b commit 0c864b3

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

src/Recorders/JobRecorder/JobRecorder.php

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -72,14 +72,14 @@ protected function getJobProperties(): array
7272
foreach ($payload as $key => $value) {
7373
if (! in_array($key, ['job', 'data', 'displayName'])) {
7474
$properties[$key] = $value;
75+
}
76+
}
7577

76-
if (is_string($payload['data'])) {
77-
try {
78-
$properties['data'] = json_decode($payload['data'], true, 512, JSON_THROW_ON_ERROR);
79-
} catch (Exception $exception) {
80-
}
81-
}
78+
try {
79+
if (is_string($payload['data'])) {
80+
$properties['data'] = json_decode($payload['data'], true, 512, JSON_THROW_ON_ERROR);
8281
}
82+
} catch (Exception $exception) {
8383
}
8484

8585
if ($pushedAt = DateTime::createFromFormat('U.u', $payload->get('pushedAt', ''))) {

0 commit comments

Comments
 (0)
0