Skip to content

Commit

Permalink
Check controllerg
Browse files Browse the repository at this point in the history
  • Loading branch information
barryvdh committed Jan 26, 2025
1 parent 2564841 commit 7de2429
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 3 deletions.
4 changes: 3 additions & 1 deletion src/DataCollector/RequestCollector.php
Original file line number Diff line number Diff line change
Expand Up @@ -253,7 +253,9 @@ protected function getRouteInformation($route)
$reflector->getEndLine()
);

$result['controller'] .= '<a href="'.$link['url'].'" class="phpdebugbar-widgets-editor-link"></a>';
if (isset($result['controller'])) {
$result['controller'] .= '<a href="'.$link['url'].'" class="phpdebugbar-widgets-editor-link"></a>';
}
} else {
$result['file'] = sprintf('%s:%s-%s', $filename, $reflector->getStartLine(), $reflector->getEndLine());
}
Expand Down
4 changes: 3 additions & 1 deletion src/DataCollector/RouteCollector.php
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,9 @@ protected function getRouteInformation($route)
$reflector->getEndLine()
);

$result['controller'] .= '<a href="'.$link['url'].'" class="phpdebugbar-widgets-editor-link"></a>';
if (isset($result['controller'])) {
$result['controller'] .= '<a href="'.$link['url'].'" class="phpdebugbar-widgets-editor-link"></a>';
}
} else {
$result['file'] = sprintf('%s:%s-%s', $filename, $reflector->getStartLine(), $reflector->getEndLine());
}
Expand Down
2 changes: 1 addition & 1 deletion tests/DataCollector/RouteCollectorTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ protected function setUp(): void
protected function getEnvironmentSetUp($app)
{
$app['config']->set('debugbar.collectors.route', true);

parent::getEnvironmentSetUp($app);
}

Expand Down

0 comments on commit 7de2429

Please sign in to comment.