for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
namespace Http\HttplugBundle\Collector;
use Exception;
use Http\Client\Common\Plugin;
use Psr\Http\Message\RequestInterface;
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\HttpFoundation\Response;
use Symfony\Component\HttpKernel\DataCollector\DataCollector;
class Collector extends DataCollector
{
/**
* @var Profile[]
*/
private $profiles;
public function __construct()
$this->profiles = [];
}
* {@inheritdoc}
public function collect(Request $request, Response $response, Exception $exception = null)
// We do not need to collect any data from the Symfony Request and Response
public function getName()
return 'httplug';
* @param Plugin $plugin
* @param RequestInterface $request
*
* @return Profile
public function getProfile(Plugin $plugin, RequestInterface $request)
$key = spl_object_hash($plugin) . '-' . spl_object_hash($request);
if (!isset($this->profiles[$key])) {
$this->profiles[$key] = new Profile($plugin, $request);
return $this->profiles[$key];