You are here

private function XHProfController::getParentFunctionsRows in XHProf 8

1 call to XHProfController::getParentFunctionsRows()
XHProfController::getRunRows in src/Controller/XHProfController.php

File

src/Controller/XHProfController.php, line 351

Class

XHProfController
Displays profiling results.

Namespace

Drupal\xhprof\Controller

Code

private function getParentFunctionsRows($parents, $runId, &$rows) {
  if (!empty($parents)) {
    $columns = \current($parents);
    $rows[] = [
      [
        'data' => new FormattableMarkup('<strong>@value</strong>', [
          '@value' => $this
            ->formatPlural(\count($parents), 'Parent function', 'Parent functions (@count)'),
        ]),
        'colspan' => \count($columns),
      ],
    ];
    foreach ($parents as $parent) {
      $parent[0] = Link::fromTextAndUrl($parent[0], Url::fromRoute('xhprof.symbol', [
        'run' => $runId,
        'symbol' => $parent[0],
      ]));
      $rows[] = $parent;
    }
  }
  return $rows;
}