Skip to content

Commit 7de2429

Browse files
committed
Check controllerg
1 parent 2564841 commit 7de2429

File tree

3 files changed

+7
-3
lines changed

3 files changed

+7
-3
lines changed

src/DataCollector/RequestCollector.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -253,7 +253,9 @@ protected function getRouteInformation($route)
253253
$reflector->getEndLine()
254254
);
255255

256-
$result['controller'] .= '<a href="'.$link['url'].'" class="phpdebugbar-widgets-editor-link"></a>';
256+
if (isset($result['controller'])) {
257+
$result['controller'] .= '<a href="'.$link['url'].'" class="phpdebugbar-widgets-editor-link"></a>';
258+
}
257259
} else {
258260
$result['file'] = sprintf('%s:%s-%s', $filename, $reflector->getStartLine(), $reflector->getEndLine());
259261
}

src/DataCollector/RouteCollector.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,9 @@ protected function getRouteInformation($route)
102102
$reflector->getEndLine()
103103
);
104104

105-
$result['controller'] .= '<a href="'.$link['url'].'" class="phpdebugbar-widgets-editor-link"></a>';
105+
if (isset($result['controller'])) {
106+
$result['controller'] .= '<a href="'.$link['url'].'" class="phpdebugbar-widgets-editor-link"></a>';
107+
}
106108
} else {
107109
$result['file'] = sprintf('%s:%s-%s', $filename, $reflector->getStartLine(), $reflector->getEndLine());
108110
}

tests/DataCollector/RouteCollectorTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ protected function setUp(): void
2020
protected function getEnvironmentSetUp($app)
2121
{
2222
$app['config']->set('debugbar.collectors.route', true);
23-
23+
2424
parent::getEnvironmentSetUp($app);
2525
}
2626

0 commit comments

Comments
 (0)