function ServicesDataCollector::getData

Return value

array

Overrides DrupalDataCollectorInterface::getData

File

webprofiler/src/DataCollector/ServicesDataCollector.php, line 137

Class

ServicesDataCollector
Class ServicesDataCollector

Namespace

Drupal\webprofiler\DataCollector

Code

public function getData() {
    $data = $this->data;
    $http_middleware = array_filter($data['services'], function ($service) {
        return isset($service['value']['tags']['http_middleware']);
    });
    foreach ($http_middleware as &$service) {
        $service['value']['handle_method'] = $this->getMethodData($service['value']['class'], 'handle');
    }
    uasort($http_middleware, function ($a, $b) {
        $va = $a['value']['tags']['http_middleware'][0]['priority'];
        $vb = $b['value']['tags']['http_middleware'][0]['priority'];
        if ($va == $vb) {
            return 0;
        }
        return $va > $vb ? -1 : 1;
    });
    $data['http_middleware'] = $http_middleware;
    return $data;
}