RouteInventoryView
API reference › Debug Core › Panel › Request › Routing › RouteInventoryView
Immutable route inventory and provenance displayed by the Request panel.
Methods
Section titled “Methods”| Method | Description | Defined by |
|---|---|---|
__construct() | Creates a route inventory with its provenance. | RouteInventoryView |
create() static | Creates a route inventory ready for immutable enrichment. | RouteInventoryView |
getBadges() | Returns the badges derived from the inventory. | RouteInventoryView |
getError() | Returns the error generated while building the inventory. | RouteInventoryView |
getRoutes() | Returns the route definitions the inventory holds. | RouteInventoryView |
getSource() | Returns the label describing where the inventory data came from. | RouteInventoryView |
isLive() | Determines whether the inventory reflects live configuration. | RouteInventoryView |
withBadges() | Returns a copy carrying another set of badges. | RouteInventoryView |
withError() | Returns a copy carrying another inventory error. | RouteInventoryView |
withLive() | Returns a copy flagged as live configuration or as a stored capture. | RouteInventoryView |
withSource() | Returns a copy carrying another source label. | RouteInventoryView |
Method details
Section titled “Method details”__construct()
Section titled “__construct() ”public function __construct(list<PHPForge\Debug\Panel\Request\Routing\RouteDefinition> $routes)Creates a route inventory with its provenance.
Parameters
| Parameter | Type | Description |
|---|---|---|
$routes | list<RouteDefinition> | Route definitions the application declares. |
create()
Section titled “create() ”public static function create(list<PHPForge\Debug\Panel\Request\Routing\RouteDefinition> $routes): selfCreates a route inventory ready for immutable enrichment.
Parameters
| Parameter | Type | Description |
|---|---|---|
$routes | list<RouteDefinition> | Route definitions the application declares. |
Returns
self: Inventory carrying only the route definitions.
getBadges()
Section titled “getBadges() ”public function getBadges(): list<PHPForge\Debug\Panel\Request\Routing\RouteBadge>Returns the badges derived from the inventory.
Returns
list<RouteBadge>: Route badges derived from the inventory.
getError()
Section titled “getError() ”public function getError(): string|nullReturns the error generated while building the inventory.
Returns
string|null: Error message, or null when no error occurred.
getRoutes()
Section titled “getRoutes() ”public function getRoutes(): list<PHPForge\Debug\Panel\Request\Routing\RouteDefinition>Returns the route definitions the inventory holds.
Returns
list<RouteDefinition>: Route definitions the application declares.
getSource()
Section titled “getSource() ”public function getSource(): stringReturns the label describing where the inventory data came from.
Returns
string: Source label describing where the inventory data came from.
isLive()
Section titled “isLive() ”public function isLive(): boolDetermines whether the inventory reflects live configuration.
Returns
bool: true when the inventory reflects live configuration, false for a stored capture.
withBadges()
Section titled “withBadges() ”public function withBadges(list<PHPForge\Debug\Panel\Request\Routing\RouteBadge> $badges): selfReturns a copy carrying another set of badges.
Parameters
| Parameter | Type | Description |
|---|---|---|
$badges | list<RouteBadge> | Route badges derived from the inventory. |
Returns
self: Inventory with the badges applied.
withError()
Section titled “withError() ”public function withError(string|null $error): selfReturns a copy carrying another inventory error.
Parameters
| Parameter | Type | Description |
|---|---|---|
$error | string| | Error message generated while building the inventory, or null to clear it. |
Returns
self: Inventory with the error applied.
withLive()
Section titled “withLive() ”public function withLive(bool $live): selfReturns a copy flagged as live configuration or as a stored capture.
Parameters
| Parameter | Type | Description |
|---|---|---|
$live | bool | true when the inventory reflects live configuration, false for a stored capture. |
Returns
self: Inventory with the live flag applied.
withSource()
Section titled “withSource() ”public function withSource(string $source): selfReturns a copy carrying another source label.
Parameters
| Parameter | Type | Description |
|---|---|---|
$source | string | Source label describing where the inventory data came from. |
Returns
self: Inventory with the source applied.