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 26
26
class RequestDataCollector extends DataCollector implements EventSubscriberInterface, LateDataCollectorInterface
27
27
{
28
28
protected $ controllers ;
29
+ protected $ prettyJson ;
29
30
30
31
public function __construct ()
31
32
{
@@ -265,11 +266,15 @@ public function getContent()
265
266
266
267
public function getPrettyJson ()
267
268
{
269
+ if ($ this ->prettyJson ) {
270
+ return $ this ->prettyJson ;
271
+ }
272
+
268
273
$ decoded = json_decode ($ this ->getContent ());
269
274
$ valid = JSON_ERROR_NONE === json_last_error ();
270
275
$ content = json_encode ($ decoded , JSON_PRETTY_PRINT );
271
276
272
- return array (
277
+ return $ this -> prettyJson = array (
273
278
'valid ' => $ valid ,
274
279
'content ' => $ content ,
275
280
);
You can’t perform that action at this time.
0 commit comments