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('output');
$response->prepare($request);

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

dump(
    
$dataCollector->getFormat(),
    
$dataCollector->getMethod(),
    
$dataCollector->getContentType(),
    
$dataCollector->getStatusCode()
);
Result
"html"

"GET"

"text/html; charset=UTF-8"

200
Used Versions
PHP 7.2, Zend 3.0, Symfony 4.0, Laravel 5.6, PHPUnit 6.5, Doctrine 2.8