Skip to content

Commit

Permalink
Merge pull request #192 from symfony-cmf/fix-more-rray-merge
Browse files Browse the repository at this point in the history
Fixed passing no arguments to array_merge
  • Loading branch information
dbu authored Jan 31, 2017
2 parents 580f90e + cdc1b15 commit 63f523a
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 4 deletions.
4 changes: 4 additions & 0 deletions src/ChainRouteCollection.php
Original file line number Diff line number Diff line change
Expand Up @@ -241,6 +241,10 @@ public function setMethods($methods)
*/
public function getResources()
{
if (0 === count($this->routeCollections)) {
return [];
}

$resources = array_map(function (RouteCollection $routeCollection) {
return $routeCollection->getResources();
}, $this->routeCollections);
Expand Down
4 changes: 2 additions & 2 deletions src/ChainRouter.php
Original file line number Diff line number Diff line change
Expand Up @@ -124,12 +124,12 @@ public function all()
*/
protected function sortRouters()
{
krsort($this->routers);

if (0 === count($this->routers)) {
return [];
}

krsort($this->routers);

return call_user_func_array('array_merge', $this->routers);
}

Expand Down
4 changes: 2 additions & 2 deletions src/DynamicRouter.php
Original file line number Diff line number Diff line change
Expand Up @@ -348,12 +348,12 @@ public function getRouteEnhancers()
*/
protected function sortRouteEnhancers()
{
krsort($this->enhancers);

if (0 === count($this->enhancers)) {
return [];
}

krsort($this->enhancers);

return call_user_func_array('array_merge', $this->enhancers);
}

Expand Down
4 changes: 4 additions & 0 deletions src/NestedMatcher/NestedMatcher.php
Original file line number Diff line number Diff line change
Expand Up @@ -175,6 +175,10 @@ public function getRouteFilters()
*/
protected function sortFilters()
{
if (0 === count($this->filters)) {
return [];
}

krsort($this->filters);

return call_user_func_array('array_merge', $this->filters);
Expand Down

0 comments on commit 63f523a

Please sign in to comment.