Skip to content
This repository was archived by the owner on Jan 29, 2020. It is now read-only.

Commit 471770a

Browse files
committed
Look for resources only in additional array
1 parent 03f8c2b commit 471770a

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

src/ProblemDetailsResponseFactory.php

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -229,15 +229,15 @@ public function createResponse(
229229
];
230230

231231
if ($additional) {
232+
// ensure payload can be json_encoded
233+
array_walk_recursive($additional, function (&$value) {
234+
if (is_resource($value)) {
235+
$value = print_r($value, true) . ' of type ' . get_resource_type($value);
236+
}
237+
});
232238
$payload = array_merge($additional, $payload);
233239
}
234240

235-
// ensure payload can be json_encoded
236-
array_walk_recursive($payload, function (&$value) {
237-
if (is_resource($value)) {
238-
$value = print_r($value, true) . ' of type ' . get_resource_type($value);
239-
}
240-
});
241241

242242
return $this->getResponseGenerator($request)($payload);
243243
}

0 commit comments

Comments
 (0)