Skip to content
PHP Ecosystem
Explore

RouteInventoryView

API reference › Debug Core › Panel › Request › Routing › RouteInventoryView

final classPHPForge\Debug\Panel\Request\Routing\RouteInventoryView
Sourcesrc/Panel/Request/Routing/RouteInventoryView.php

Immutable route inventory and provenance displayed by the Request panel.

MethodDescriptionDefined by
__construct()Creates a route inventory with its provenance.RouteInventoryView
create() staticCreates 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
public function __construct(list<PHPForge\Debug\Panel\Request\Routing\RouteDefinition> $routes)

Creates a route inventory with its provenance.

Parameters

ParameterTypeDescription
$routeslist<RouteDefinition>Route definitions the application declares.
public static function create(list<PHPForge\Debug\Panel\Request\Routing\RouteDefinition> $routes): self

Creates a route inventory ready for immutable enrichment.

Parameters

ParameterTypeDescription
$routeslist<RouteDefinition>Route definitions the application declares.

Returns

self: Inventory carrying only the route definitions.

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.

public function getError(): string|null

Returns the error generated while building the inventory.

Returns

string|null: Error message, or null when no error occurred.

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.

public function getSource(): string

Returns the label describing where the inventory data came from.

Returns

string: Source label describing where the inventory data came from.

public function isLive(): bool

Determines whether the inventory reflects live configuration.

Returns

bool: true when the inventory reflects live configuration, false for a stored capture.

public function withBadges(list<PHPForge\Debug\Panel\Request\Routing\RouteBadge> $badges): self

Returns a copy carrying another set of badges.

Parameters

ParameterTypeDescription
$badgeslist<RouteBadge>Route badges derived from the inventory.

Returns

self: Inventory with the badges applied.

public function withError(string|null $error): self

Returns a copy carrying another inventory error.

Parameters

ParameterTypeDescription
$errorstring|nullError message generated while building the inventory, or null to clear it.

Returns

self: Inventory with the error applied.

public function withLive(bool $live): self

Returns a copy flagged as live configuration or as a stored capture.

Parameters

ParameterTypeDescription
$livebooltrue when the inventory reflects live configuration, false for a stored capture.

Returns

self: Inventory with the live flag applied.

public function withSource(string $source): self

Returns a copy carrying another source label.

Parameters

ParameterTypeDescription
$sourcestringSource label describing where the inventory data came from.

Returns

self: Inventory with the source applied.