- Fixed a bug where optional routes were badly parsed
This commit is contained in:
		
							parent
							
								
									3ffb69342b
								
							
						
					
					
						commit
						b24bbbc150
					
				@ -287,7 +287,7 @@ PATTERN;
 | 
			
		||||
                    if ($default ?? false) {
 | 
			
		||||
                        $value = $default;
 | 
			
		||||
                    }
 | 
			
		||||
                    elseif ( str_contains($route, "[{$matches[0][0]}]") === false && $this->enforceExistingArguments) {
 | 
			
		||||
                    elseif ( ! str_contains($route, "[{$matches[0][0]}]") && ! str_contains($route, "[/{$matches[0][0]}]") && $this->enforceExistingArguments) {
 | 
			
		||||
                        throw new \RuntimeException(sprintf("Error while preparing route %s : could not match variable '%s' into given arguments ( %s ) from %s::%s", $route, $variable, json_encode($arguments), $routeParam['class'], $routeParam['classMethod']));
 | 
			
		||||
                    }
 | 
			
		||||
                }
 | 
			
		||||
 | 
			
		||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user