Files
core/src/Menu/StopwatchBackendMenuBuilder.php
2019-04-14 13:29:05 +02:00

32 lines
733 B
PHP

<?php
declare(strict_types=1);
namespace Bolt\Menu;
use Symfony\Component\Stopwatch\Stopwatch;
final class StopwatchBackendMenuBuilder implements BackendMenuBuilderInterface
{
/** @var BackendMenuBuilderInterface */
private $menuBuilder;
/** @var Stopwatch */
private $stopwatch;
public function __construct(BackendMenuBuilderInterface $menuBuilder, Stopwatch $stopwatch)
{
$this->menuBuilder = $menuBuilder;
$this->stopwatch = $stopwatch;
}
public function buildAdminMenu(): array
{
$this->stopwatch->start('bolt.backendMenu');
$menu = $this->menuBuilder->buildAdminMenu();
$this->stopwatch->stop('bolt.backendMenu');
return $menu;
}
}