File tree Expand file tree Collapse file tree 4 files changed +12
-4
lines changed Expand file tree Collapse file tree 4 files changed +12
-4
lines changed Original file line number Diff line number Diff line change @@ -241,6 +241,10 @@ public function setMethods($methods)
241241 */
242242 public function getResources ()
243243 {
244+ if (0 === count ($ this ->routeCollections )) {
245+ return [];
246+ }
247+
244248 $ resources = array_map (function (RouteCollection $ routeCollection ) {
245249 return $ routeCollection ->getResources ();
246250 }, $ this ->routeCollections );
Original file line number Diff line number Diff line change @@ -124,12 +124,12 @@ public function all()
124124 */
125125 protected function sortRouters ()
126126 {
127- krsort ($ this ->routers );
128-
129127 if (0 === count ($ this ->routers )) {
130128 return [];
131129 }
132130
131+ krsort ($ this ->routers );
132+
133133 return call_user_func_array ('array_merge ' , $ this ->routers );
134134 }
135135
Original file line number Diff line number Diff line change @@ -348,12 +348,12 @@ public function getRouteEnhancers()
348348 */
349349 protected function sortRouteEnhancers ()
350350 {
351- krsort ($ this ->enhancers );
352-
353351 if (0 === count ($ this ->enhancers )) {
354352 return [];
355353 }
356354
355+ krsort ($ this ->enhancers );
356+
357357 return call_user_func_array ('array_merge ' , $ this ->enhancers );
358358 }
359359
Original file line number Diff line number Diff line change @@ -175,6 +175,10 @@ public function getRouteFilters()
175175 */
176176 protected function sortFilters ()
177177 {
178+ if (0 === count ($ this ->filters )) {
179+ return [];
180+ }
181+
178182 krsort ($ this ->filters );
179183
180184 return call_user_func_array ('array_merge ' , $ this ->filters );
You can’t perform that action at this time.
0 commit comments