- Breadcrumb now shows up only if deep within at least two routes (if ignoreSoleRoute is true)

This commit is contained in:
Dave Mc Nicoll committed 2024-10-14 12:52:34 +00:00
1 parent 34a3351ed5
commit 81fa3d49c7
2 files changed
+9 -1

No files matched your search

+2
View File
@@ -99,6 +99,8 @@ class AnnotationReader
case $reflect instanceof ReflectionClass :
return $reflect->name;
}
return "#UNKNOWN#";
}
protected function getObjectNamespace(Reflector $reflect) : string
+7 -1
View File
@@ -10,6 +10,8 @@ use RuntimeException, DirectoryIterator, Generator;
class Breadcrumb extends RouteFetcher {
public bool $ignoreSoleRoute = true;
public function getRouteTree(\Notes\Route\Attribute\Method\Route $route) : array
{
$tree = [];
@@ -36,7 +38,11 @@ class Breadcrumb extends RouteFetcher {
else {
$route = null;
}
};
}
if ($this->ignoreSoleRoute && count($tree) === 1) {
return [];
}
return array_reverse($tree);
}