Skip to content

Commit 294b220

Browse files
committed
Class-level route can be skipped having a path.
1 parent c0c3b85 commit 294b220

1 file changed

Lines changed: 1 addition & 4 deletions

File tree

src/Framework/Routing/Routing.php

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,6 @@
2424
use Symfony\Component\Routing\Route;
2525
use Symfony\Component\Routing\RouteCollection;
2626
use function array_unique;
27-
use function assert;
2827
use function class_exists;
2928
use function explode;
3029
use function http_build_query;
@@ -87,16 +86,14 @@ public static function build(BuildContext $context): void
8786
continue;
8887
}
8988

90-
assert(is_string($classAttr->path), 'Route path must be a string');
91-
9289
foreach ($class->getMethods() as $method) {
9390
$methodAttr = ReflectionHelpers::getAttribute($method, RouteAttribute::class);
9491
if (!$methodAttr) {
9592
continue;
9693
}
9794

9895
/* titles get concatenated */
99-
$path = $classAttr->path;
96+
$path = ($classAttr->path ?? '');
10097
if (is_string($methodAttr->path)) {
10198
$path .= $methodAttr->path;
10299
}

0 commit comments

Comments
 (0)