Skip to content

Commit e1bcb59

Browse files
authored
Merge pull request #13 from zonneplan/fix/route-type-parsing
fix: route type parsing using basename instead of rtrim
2 parents 91d601e + fcccce0 commit e1bcb59

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/Module.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -249,8 +249,9 @@ private function registerRoutes(): void
249249
if (file_exists($routePath) && empty(($files = glob($routeFilePattern))) === false) {
250250
foreach ($files as $file) {
251251
$fileName = basename($file);
252+
$routeType = basename($file, '.php');
252253
// Skip files that are not allowed route types
253-
if (in_array(rtrim($fileName, '.php'), static::ROUTE_FILE_TYPES) === false) {
254+
if (in_array($routeType, static::ROUTE_FILE_TYPES) === false) {
254255
continue;
255256
}
256257

0 commit comments

Comments
 (0)