8000
We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 9446deb commit 91a2b39Copy full SHA for 91a2b39
src/Symfony/Component/HttpKernel/DataCollector/RequestDataCollector.php
@@ -26,6 +26,7 @@
26
class RequestDataCollector extends DataCollector implements EventSubscriberInterface, LateDataCollectorInterface
27
{
28
protected $controllers;
29
+ protected $prettyJson;
30
31
public function __construct()
32
@@ -265,11 +266,15 @@ public function getContent()
265
266
267
public function getPrettyJson()
268
269
+ if ($this->prettyJson) {
270
+ return $this->prettyJson;
271
+ }
272
+
273
$decoded = json_decode($this->getContent());
274
$valid = JSON_ERROR_NONE === json_last_error();
275
$content = json_encode($decoded, JSON_PRETTY_PRINT);
276
- return array(
277
+ return $this->prettyJson = array(
278
'valid' => $valid,
279
'content' => $content,
280
);
0 commit comments