File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -22,7 +22,7 @@ public function register(Container $app)
2222 if (file_exists ($ routeCacheFile ) && (!$ app ['debug ' ])) {
2323 $ routeConfigAll = require $ routeCacheFile ;
2424 } else {
25- $ routeConfigAll = $ this ->parseAllRoutes ($ app ,$ routeConfigAll );
25+ $ routeConfigAll = $ this ->parseAllRoutes ($ app , $ routeConfigAll );
2626
2727 if (!$ app ['debug ' ]) {
2828 $ fs = new Filesystem ();
@@ -42,7 +42,7 @@ public function register(Container $app)
4242 RouterService::setParameters ($ app );
4343 }
4444
45- private function parseAllRoutes ($ app ,$ routeConfigAll = [])
45+ private function parseAllRoutes ($ app , $ routeConfigAll = [])
4646 {
4747 $ routeConfigAll = $ this ->parseRoutesConfig (__BASEDIR__ . '/config/routes.yml ' , $ routeConfigAll );
4848
@@ -62,7 +62,10 @@ private function parseRoutesConfig($routesFile, $routeConfigAll)
6262 if (is_file (__BASEDIR__ . "/src/ " . $ resource ) && file_exists (__BASEDIR__ . "/src/ " . $ resource )) {
6363 $ array = YamlService::parse (file_get_contents (__BASEDIR__ . "/src/ " . $ resource ));
6464 }
65- $ routeConfigAll = array_merge ($ routeConfigAll , $ array );
65+
66+ if (!empty ($ array )) {
67+ $ routeConfigAll = array_merge ($ routeConfigAll , $ array );
68+ }
6669 }
6770
6871 return $ routeConfigAll ;
You can’t perform that action at this time.
0 commit comments