Symfony RequestDataCollector for collecting request and response data

Code
<?php

use Symfony\Component\HttpKernel\DataCollector\RequestDataCollector;
use 
Symfony\Component\HttpFoundation\Request;
use 
Symfony\Component\HttpFoundation\Response;

$dataCollector = new RequestDataCollector();

$request Request::createFromGlobals();
$response = new Response('');
$response->prepare($request);

$dataCollector->collect($request$response);

dump(
    
$dataCollector->getRequestQuery(),
    
$dataCollector->getRequestHeaders(),
    
$dataCollector->getResponseHeaders(),
    
$dataCollector->getContentType(),
    
$dataCollector->getStatusCode()
);
Result
ParameterBag {#391
#parameters: array:1 [
"qngnpbyyrpgbe2" => Data {#380
-data: array:1 [
0 => array:1 [
0 => ""
]
]
-position: 0
-key: 0
-maxDepth: 20
-maxItemsPerDepth: -1
-useRefHandles: -1
}
]
}

ParameterBag {#392
#parameters: array:5 [
"if-modified-since" => Data {#382
-data: array:1 [
0 => array:1 [
0 => "Wed, 18 Oct 2017 16:37:37 GMT"
]
]
-position: 0
-key: 0
-maxDepth: 20
-maxItemsPerDepth: -1
-useRefHandles: -1
}
"accept" => Data {#383
-data: array:1 [
0 => array:1 [
0 => "text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8"
]
]
-position: 0
-key: 0
-maxDepth: 20
-maxItemsPerDepth: -1
-useRefHandles: -1
}
"user-agent" => Data {#384
-data: array:1 [
0 => array:1 [
0 => "CCBot/2.0 (http://commoncrawl.org/faq/)"
]
]
-position: 0
-key: 0
-maxDepth: 20
-maxItemsPerDepth: -1
-useRefHandles: -1
}
"accept-encoding" => Data {#385
-data: array:1 [
0 => array:1 [
0 => "x-gzip, gzip, deflate"
]
]
-position: 0
-key: 0
-maxDepth: 20
-maxItemsPerDepth: -1
-useRefHandles: -1
}
"host" => Data {#386
-data: array:1 [
0 => array:1 [
0 => "php.budgegeria.de"
]
]
-position: 0
-key: 0
-maxDepth: 20
-maxItemsPerDepth: -1
-useRefHandles: -1
}
]
}

ParameterBag {#393
#parameters: array:4 [
"cache-control" => Data {#387
-data: array:1 [
0 => array:1 [
0 => "private, must-revalidate"
]
]
-position: 0
-key: 0
-maxDepth: 20
-maxItemsPerDepth: -1
-useRefHandles: -1
}
"content-type" => Data {#388
-data: array:1 [
0 => array:1 [
0 => "text/html; charset=UTF-8"
]
]
-position: 0
-key: 0
-maxDepth: 20
-maxItemsPerDepth: -1
-useRefHandles: -1
}
"pragma" => Data {#389
-data: array:1 [
0 => array:1 [
0 => "no-cache"
]
]
-position: 0
-key: 0
-maxDepth: 20
-maxItemsPerDepth: -1
-useRefHandles: -1
}
"expires" => Data {#390
-data: array:1 [
0 => array:1 [
0 => -1
]
]
-position: 0
-key: 0
-maxDepth: 20
-maxItemsPerDepth: -1
-useRefHandles: -1
}
]
}

"text/html; charset=UTF-8"

200