Skip to main content
Drupal API
User account menu
  • Log in

Breadcrumb

  1. Drupal Core 11.1.x
  2. TimeDataCollector.php

function TimeDataCollector::collect

Overrides DataCollectorInterface::collect

File

vendor/symfony/http-kernel/DataCollector/TimeDataCollector.php, line 34

Class

TimeDataCollector
@author Fabien Potencier <fabien@symfony.com>

Namespace

Symfony\Component\HttpKernel\DataCollector

Code

public function collect(Request $request, Response $response, ?\Throwable $exception = null) : void {
    if (null !== $this->kernel) {
        $startTime = $this->kernel
            ->getStartTime();
    }
    else {
        $startTime = $request->server
            ->get('REQUEST_TIME_FLOAT');
    }
    $this->data = [
        'token' => $request->attributes
            ->get('_stopwatch_token'),
        'start_time' => $startTime * 1000,
        'events' => [],
        'stopwatch_installed' => class_exists(Stopwatch::class, false),
    ];
}

API Navigation

  • Drupal Core 11.1.x
  • Topics
  • Classes
  • Functions
  • Constants
  • Globals
  • Files
  • Namespaces
  • Deprecated
  • Services
RSS feed
Powered by Drupal