- Fixed optional arguments in buildUrl()
This commit is contained in:
parent
57367968ca
commit
5182ba19bc
|
@ -249,12 +249,13 @@ PATTERN;
|
|||
if ($default ?? false) {
|
||||
$value = $default;
|
||||
}
|
||||
elseif ($this->enforceExistingArguments) {
|
||||
elseif ($this->enforceExistingArguments && ! strpos($route, sprintf('[/{%s:', $variable)) ) {
|
||||
throw new \RuntimeException(sprintf("Error while preparing route %s : could not match variable '%s' into given arguments ( %s )", $route, $variable, json_encode($arguments)));
|
||||
}
|
||||
}
|
||||
|
||||
$search[ $item[0] ] = $value;
|
||||
$search[$item[0]] = $value ?? "";
|
||||
|
||||
}
|
||||
|
||||
$route = str_replace(array_keys($search), array_values($search), $route);
|
||||
|
|
Loading…
Reference in New Issue