Skip to content
Permalink
Browse files

MiddlewarePanel: show only if middlewares used

  • Loading branch information...
mabar authored and f3l1x committed Apr 16, 2019
1 parent eba81ea commit 5f8e9fe98eb0ec991f5de23363563926b9cd2e48
Showing with 10 additions and 0 deletions.
  1. +10 −0 src/Tracy/MiddlewaresPanel.php
@@ -17,6 +17,12 @@ public function __construct(DebugChainBuilder $chainBuilder)
public function getTab(): string
{
$usedCount = $this->chainBuilder->getUsedCount();
if ($usedCount === 0) {
return '';
}
ob_start();
require __DIR__ . '/templates/tab.phtml';
return (string) ob_get_clean();
@@ -27,6 +33,10 @@ public function getPanel(): string
$usedCount = $this->chainBuilder->getUsedCount();
$middlewares = $this->chainBuilder->getAll();
if ($usedCount === 0) {
return '';
}
ob_start();
require __DIR__ . '/templates/panel.phtml';
return (string) ob_get_clean();

0 comments on commit 5f8e9fe

Please sign in to comment.
You can’t perform that action at this time.