public function onFinishRequest(FinishRequestEvent $event) { $route = $event->getRequest()->attributes->get('_route'); if ('_' === substr($route, 0, 1)) { return; } $requestUriSlug = preg_replace('/[^a-zA-Z0-9_.]/', '', $route); $this->watcher->end($requestUriSlug); }
public function onCommandEnd(ConsoleTerminateEvent $event) { $command = $event->getCommand(); if (!in_array($command->getName(), $this->listenedCommands)) { return; } $commandSlug = preg_replace('/[^a-zA-Z0-9_.]/', '', $command->getName()); $this->watcher->end($commandSlug, $event->getOutput(), $event->getInput()->getArguments()); }