File tree Expand file tree Collapse file tree 1 file changed +6
-1
lines changed
src/Symfony/Component/HttpKernel/DataCollector Expand file tree Collapse file tree 1 file changed +6
-1
lines changed Original file line number Diff line number Diff line change 2626class RequestDataCollector extends DataCollector implements EventSubscriberInterface, LateDataCollectorInterface
2727{
2828 protected $ controllers ;
29+ protected $ prettyJson ;
2930
3031 public function __construct ()
3132 {
@@ -265,11 +266,15 @@ public function getContent()
265266
266267 public function getPrettyJson ()
267268 {
269+ if ($ this ->prettyJson ) {
270+ return $ this ->prettyJson ;
271+ }
272+
268273 $ decoded = json_decode ($ this ->getContent ());
269274 $ valid = JSON_ERROR_NONE === json_last_error ();
270275 $ content = json_encode ($ decoded , JSON_PRETTY_PRINT );
271276
272- return array (
277+ return $ this -> prettyJson = array (
273278 'valid ' => $ valid ,
274279 'content ' => $ content ,
275280 );
You can’t perform that action at this time.
0 commit comments