DuplicateRouteException
extends Exception
in package
Exception thrown when duplicate routes are detected during registration.
This exception helps developers identify routing conflicts early by providing detailed information about both the original and duplicate route definitions.
Table of Contents
Properties
- $firstDefinition : string
- $firstMethod : string
- $firstPath : string
- $routeName : string|null
- $secondDefinition : string
- $secondMethod : string
- $secondPath : string
Methods
- __construct() : mixed
- Create a new duplicate route exception.
- getFirstDefinition() : string
- Get the first route definition.
- getFirstMethod() : string
- Get the HTTP method of the first route.
- getFirstPath() : string
- Get the path of the first route.
- getRouteName() : string|null
- Get the route name if this is a name-based conflict.
- getSecondDefinition() : string
- Get the second (duplicate) route definition.
- getSecondMethod() : string
- Get the HTTP method of the second route.
- getSecondPath() : string
- Get the path of the second route.
- buildMessage() : string
- Build a detailed error message for the duplicate route.
Properties
$firstDefinition
private
string
$firstDefinition
$firstMethod
private
string
$firstMethod
$firstPath
private
string
$firstPath
$routeName
private
string|null
$routeName
$secondDefinition
private
string
$secondDefinition
$secondMethod
private
string
$secondMethod
$secondPath
private
string
$secondPath
Methods
__construct()
Create a new duplicate route exception.
public
__construct(string $firstMethod, string $firstPath, string $first, string $secondMethod, string $secondPath, string $second[, string|null $name = null ]) : mixed
Parameters
- $firstMethod : string
-
First route's HTTP method (GET, POST, etc.)
- $firstPath : string
-
First route's path (e.g., /users/:id)
- $first : string
-
First route definition (controller@method)
- $secondMethod : string
-
Second route's HTTP method
- $secondPath : string
-
Second route's path
- $second : string
-
Second (duplicate) route definition
- $name : string|null = null
-
Optional route name if the conflict is name-based
getFirstDefinition()
Get the first route definition.
public
getFirstDefinition() : string
Return values
stringgetFirstMethod()
Get the HTTP method of the first route.
public
getFirstMethod() : string
Return values
stringgetFirstPath()
Get the path of the first route.
public
getFirstPath() : string
Return values
stringgetRouteName()
Get the route name if this is a name-based conflict.
public
getRouteName() : string|null
Return values
string|nullgetSecondDefinition()
Get the second (duplicate) route definition.
public
getSecondDefinition() : string
Return values
stringgetSecondMethod()
Get the HTTP method of the second route.
public
getSecondMethod() : string
Return values
stringgetSecondPath()
Get the path of the second route.
public
getSecondPath() : string
Return values
stringbuildMessage()
Build a detailed error message for the duplicate route.
protected
buildMessage() : string