src/Viserio/Component/Profiler/Profiler.php
public function modifyResponse(
        ServerRequestInterface $serverRequest,
        ResponseInterface $response
    ): ResponseInterface {
        if ($this->runningInConsole() || ! $this->enabled) {
            return $response;
        }

        $token = \mb_substr(\hash('sha256', \uniqid((string) \mt_rand(), true)), 0, 6);
        $response->withHeader('x-debug-token', $token);

        try {
            $this->collectData($token, $serverRequest, $response);
        } catch (Throwable $exception) {
            if ($this->logger !== null) {
                $this->logger->error('Profiler exception: ' . $exception->getMessage());
            } else {
                throw $exception;
            }
        }

        if ($this->isHtmlResponse($response)) {
            $response = $this->injectProfiler($response, $token);
        }

        return $response;
    }
public function modifyResponse(
        ServerRequestInterface $serverRequest,
        ResponseInterface $response
    ): ResponseInterface {
        if ($this->runningInConsole() || ! $this->enabled) {
            return $response;
        }

        $token = \mb_substr(\hash('sha256', \uniqid((string) \mt_rand(), true)), 0, 6);
        $response->withHeader('x-debug-token', $token);

        try {
            $this->collectData($token, $serverRequest, $response);
        } catch (Throwable $exception) {
            if ($this->logger !== null) {
                $this->logger->error('Profiler exception: ' . $exception->getMessage());
            } else {
                throw $exception;
            }
        }

        if ($this->isHtmlResponse($response)) {
            $response = $this->injectProfiler($response, $token);
        }

        return $response;
    }
{@inheritdoc}