From 0af99e2fe9fcab0ed598da9f03992b936375d071 Mon Sep 17 00:00:00 2001 From: David Grudl Date: Mon, 8 Apr 2024 11:28:50 +0200 Subject: [PATCH] RoutingPanel: show presenter class even if it doesn't exist --- src/Bridges/ApplicationTracy/RoutingPanel.php | 5 ++++- .../ApplicationTracy/templates/RoutingPanel.panel.phtml | 6 ++++-- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/src/Bridges/ApplicationTracy/RoutingPanel.php b/src/Bridges/ApplicationTracy/RoutingPanel.php index 463fb50a7..3305c6cfb 100644 --- a/src/Bridges/ApplicationTracy/RoutingPanel.php +++ b/src/Bridges/ApplicationTracy/RoutingPanel.php @@ -116,13 +116,16 @@ private function analyse(Routing\RouteList $router, ?Nette\Http\IRequest $httpRe } - private function findSource(): \ReflectionClass|\ReflectionMethod|null + private function findSource(): \ReflectionClass|\ReflectionMethod|string|null { $params = $this->matched; $presenter = $params['presenter'] ?? ''; try { $class = $this->presenterFactory->getPresenterClass($presenter); } catch (Nette\Application\InvalidPresenterException) { + if ($this->presenterFactory instanceof Nette\Application\PresenterFactory) { + return $this->presenterFactory->formatPresenterClass($presenter); + } return null; } diff --git a/src/Bridges/ApplicationTracy/templates/RoutingPanel.panel.phtml b/src/Bridges/ApplicationTracy/templates/RoutingPanel.panel.phtml index 2c62aada4..6d499b185 100644 --- a/src/Bridges/ApplicationTracy/templates/RoutingPanel.panel.phtml +++ b/src/Bridges/ApplicationTracy/templates/RoutingPanel.panel.phtml @@ -100,8 +100,10 @@ use Tracy\Helpers;

getBaseUrl()) ?>&', '?'], Helpers::escapeHtml($url->getRelativeUrl())) ?>

- -

getName() : $source->getDeclaringClass()->getName() . '::' . $source->getName() . '()' ?>

+ +

(class not found)

+ +

getName() : $source->getDeclaringClass()->getName() . '::' . $source->getName() . '()' ?>