Skip to content
This repository has been archived by the owner on Jan 29, 2020. It is now read-only.

Commit

Permalink
Merge branch 'hotfix/cs-fixes'
Browse files Browse the repository at this point in the history
  • Loading branch information
weierophinney committed Jan 25, 2018
2 parents c2f2fc4 + 2467d3d commit e8aa08d
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions src/RouteMatcher/DefaultRouteMatcher.php
Original file line number Diff line number Diff line change
Expand Up @@ -442,7 +442,13 @@ protected function parseDefinition($def)
'alternatives' => $options,
'hasValue' => false,
];
} elseif (preg_match('/\G\[ *?\.\.\.(?P<name>[a-zA-Z][a-zA-Z0-9\_\-\:]*?) *?\](?: +|$)/s', $def, $m, 0, $pos)) {
} elseif (preg_match(
'/\G\[ *?\.\.\.(?P<name>[a-zA-Z][a-zA-Z0-9\_\-\:]*?) *?\](?: +|$)/s',
$def,
$m,
0,
$pos
)) {
if ($catchAllCount > 0) {
throw new Exception\InvalidArgumentException(
'Cannot define more than one catchAll parameter'
Expand All @@ -462,7 +468,7 @@ protected function parseDefinition($def)
);
}

if (!empty($item['positional']) && $catchAllCount > 0) {
if (! empty($item['positional']) && $catchAllCount > 0) {
throw new Exception\InvalidArgumentException(
'Positional parameters must come before catchAlls'
);
Expand Down

0 comments on commit e8aa08d

Please sign in to comment.