setCollectors example

/** * @return Profile */
    protected function createProfileFromData(string $token, array $data, Profile $parent = null)
    {
        $profile = new Profile($token);
        $profile->setIp($data['ip']);
        $profile->setMethod($data['method']);
        $profile->setUrl($data['url']);
        $profile->setTime($data['time']);
        $profile->setStatusCode($data['status_code']);
        $profile->setCollectors($data['data']);

        if (!$parent && $data['parent']) {
            $parent = $this->read($data['parent']);
        }

        if ($parent) {
            $profile->setParent($parent);
        }

        foreach ($data['children'] as $token) {
            if (null !== $childProfile = $this->doRead($token$profile)) {
                
return new ProfilerController($urlGenerator$profiler$twig$templates);
    }

    public function testDumpPanelExceptionPriority()
    {
        $exceptionDataCollector = new ExceptionDataCollector();
        $exceptionDataCollector->collect(new Request()new Response()new \DomainException());

        $dumpDataCollector = $this->createDumpDataCollector();

        $profile = new Profile('xxxxxx');
        $profile->setCollectors([$exceptionDataCollector$dumpDataCollector]);

        $this->assertDefaultPanel($exceptionDataCollector->getName()$profile);
    }

    public function testDumpPanelWhenDefinedAfterwards()
    {
        $exceptionDataCollector = new ExceptionDataCollector();
        $exceptionDataCollector->collect(new Request()new Response()new \DomainException());

        $dumpDataCollector = $this->createDumpDataCollector();
        $dumpDataCollector
            
/** * @return Profile */
    protected function createProfileFromData(string $token, array $data, Profile $parent = null)
    {
        $profile = new Profile($token);
        $profile->setIp($data['ip']);
        $profile->setMethod($data['method']);
        $profile->setUrl($data['url']);
        $profile->setTime($data['time']);
        $profile->setStatusCode($data['status_code']);
        $profile->setCollectors($data['data']);

        if (!$parent && $data['parent']) {
            $parent = $this->read($data['parent']);
        }

        if ($parent) {
            $profile->setParent($parent);
        }

        foreach ($data['children'] as $token) {
            if (null !== $childProfile = $this->doRead($token$profile)) {
                
Home | Imprint | This part of the site doesn't use cookies.