Copied!

EndpointCollector

EndpointCollector.php : 26
Read-only
Final

Lists the endpoints an application serves as sorted `<METHOD> <path> <mime types>` lines.

Path without the trailing .{_format} and with every prefix the router applies, mime types being the operation's output formats, sorted and comma-separated. Example: GET /api/ibexa/ping application/json,application/ld+json.

Methods

public__construct()

EndpointCollector.php : 31
public __construct(ResourceNameCollectionFactoryInterface $resourceNameCollectionFactory, ResourceMetadataCollectionFactoryInterface $resourceMetadataCollectionFactory, RouterInterface $router[, array<int, class-string> $excludedResourceClasses = [] ])

Parameters

Name Type Default value Description
$resourceNameCollectionFactory ResourceNameCollectionFactoryInterface - -
$resourceMetadataCollectionFactory ResourceMetadataCollectionFactoryInterface - -
$router RouterInterface - -
$excludedResourceClasses array<int, class-string> []

resource classes extending one of these are not listed when no namespace prefix is given

publiclistEndpoints()

EndpointCollector.php : 47
public listEndpoints([array<int, string> $namespacePrefixes = [] ]) : array<int, string>

Parameters

Name Type Default value Description
$namespacePrefixes array<int, string> []

only resource classes under these prefixes are listed, a missing trailing backslash being added; an empty list means every resource class but API Platform's own (ApiPlatform\) and the ones documented by their own package (ibexa/rest's v2)

Return values

array<int, string>

sorted <METHOD> <path> <mime types> lines

Tags
Throws
LogicException

when an operation of a listed resource has no route