Neuron-PHP

DuplicateRouteException extends Exception

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

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
string

getFirstMethod()

Get the HTTP method of the first route.

public getFirstMethod() : string
Return values
string

getFirstPath()

Get the path of the first route.

public getFirstPath() : string
Return values
string

getRouteName()

Get the route name if this is a name-based conflict.

public getRouteName() : string|null
Return values
string|null

getSecondDefinition()

Get the second (duplicate) route definition.

public getSecondDefinition() : string
Return values
string

getSecondMethod()

Get the HTTP method of the second route.

public getSecondMethod() : string
Return values
string

getSecondPath()

Get the path of the second route.

public getSecondPath() : string
Return values
string

buildMessage()

Build a detailed error message for the duplicate route.

protected buildMessage() : string
Return values
string

        
On this page

Search results