final class ApiConfigDefinition extends AbstractConfigDefinition (View source)

Collects typed API configuration overrides for later ordered resolution.

Properties

protected mixed[] $data from  AbstractConfigDefinition

Methods

set(string $path, mixed $value)

Replaces one configuration value at a dot-separated path.

append(string $path, mixed $value)

Appends one configuration value at a dot-separated list path.

create()

Creates an empty definition that inherits all unresolved API defaults.

static string

Returns the configuration module key consumed by the API resolver.

string
enabled(bool $enabled = true)

Overrides whether the API module registers middleware and routes.

Disables API middleware and route registration.

prefix(string $prefix)

Overrides the shared path prefix for framework and application API endpoints.

endpointProvider(string $providerClass)

Appends one application endpoint provider while preserving declaration order.

endpointProviders(array $providerClasses)

Replaces the endpoint provider list for this definition.

staticBearer(mixed $token, array $scopes = [])

Enables the built-in bearer authenticator with its token and effective scopes.

Disables the built-in bearer authenticator without removing its other overrides.

staticBearerScopes(array $scopes)

Replaces the configured scopes assigned to a valid static bearer identity.

frameworkEnabled(bool $enabled = true)

Overrides whether framework-owned API endpoints other than health are registered.

Disables framework-owned OpenAPI and documentation endpoints.

Enables the framework health endpoint.

Disables the framework health endpoint.

healthRoute(string $route)

Overrides the health path relative to the API prefix.

healthAccess(ApiAccess|string $access)

Overrides the authorization mode enforced for the health endpoint.

Enables the generated OpenAPI endpoint.

Disables the generated OpenAPI endpoint.

openApiRoute(string $route)

Overrides the OpenAPI document path relative to the API prefix.

openApiAccess(ApiAccess|string $access)

Overrides the authorization mode enforced for the OpenAPI document.

openApiScopes(array $scopes)

Replaces the scopes required by the OpenAPI document endpoint.

Enables the human-readable API documentation endpoint.

Disables the human-readable API documentation endpoint.

docsRoute(string $route)

Overrides the documentation path relative to the API prefix.

docsAccess(ApiAccess|string $access)

Overrides the authorization mode enforced for human-readable documentation.

docsScopes(array $scopes)

Replaces the scopes required by the human-readable documentation endpoint.

Details

toArray

No description

Return Value

array

fromArrayData

final static AbstractConfigDefinition fromArrayData(array $data)

No description

Parameters

array $data

Return Value

AbstractConfigDefinition

set

protected AbstractConfigDefinition set(string $path, mixed $value)

Replaces one configuration value at a dot-separated path.

Parameters

string $path
mixed $value

Return Value

AbstractConfigDefinition

append

protected AbstractConfigDefinition append(string $path, mixed $value)

Appends one configuration value at a dot-separated list path.

Parameters

string $path
mixed $value

Return Value

AbstractConfigDefinition

create

Creates an empty definition that inherits all unresolved API defaults.

Return Value

ApiConfigDefinition

moduleKey

static string moduleKey()

Returns the configuration module key consumed by the API resolver.

Return Value

string

enabled

ApiConfigDefinition enabled(bool $enabled = true)

Overrides whether the API module registers middleware and routes.

Parameters

bool $enabled

Return Value

ApiConfigDefinition

disabled

Disables API middleware and route registration.

Return Value

ApiConfigDefinition

prefix

ApiConfigDefinition prefix(string $prefix)

Overrides the shared path prefix for framework and application API endpoints.

Parameters

string $prefix

Return Value

ApiConfigDefinition

endpointProvider

ApiConfigDefinition endpointProvider(string $providerClass)

Appends one application endpoint provider while preserving declaration order.

Parameters

string $providerClass

Return Value

ApiConfigDefinition

endpointProviders

ApiConfigDefinition endpointProviders(array $providerClasses)

Replaces the endpoint provider list for this definition.

Parameters

array $providerClasses

Return Value

ApiConfigDefinition

staticBearer

ApiConfigDefinition staticBearer(mixed $token, array $scopes = [])

Enables the built-in bearer authenticator with its token and effective scopes.

An omitted scope list grants the built-in administrative scope.

Parameters

mixed $token
array $scopes

Return Value

ApiConfigDefinition

staticBearerDisabled

ApiConfigDefinition staticBearerDisabled()

Disables the built-in bearer authenticator without removing its other overrides.

Return Value

ApiConfigDefinition

staticBearerScopes

ApiConfigDefinition staticBearerScopes(array $scopes)

Replaces the configured scopes assigned to a valid static bearer identity.

Parameters

array $scopes

Return Value

ApiConfigDefinition

frameworkEnabled

ApiConfigDefinition frameworkEnabled(bool $enabled = true)

Overrides whether framework-owned API endpoints other than health are registered.

Parameters

bool $enabled

Return Value

ApiConfigDefinition

frameworkDisabled

ApiConfigDefinition frameworkDisabled()

Disables framework-owned OpenAPI and documentation endpoints.

Return Value

ApiConfigDefinition

healthEnabled

Enables the framework health endpoint.

Return Value

ApiConfigDefinition

healthDisabled

ApiConfigDefinition healthDisabled()

Disables the framework health endpoint.

Return Value

ApiConfigDefinition

healthRoute

ApiConfigDefinition healthRoute(string $route)

Overrides the health path relative to the API prefix.

Parameters

string $route

Return Value

ApiConfigDefinition

healthAccess

ApiConfigDefinition healthAccess(ApiAccess|string $access)

Overrides the authorization mode enforced for the health endpoint.

Parameters

ApiAccess|string $access

Return Value

ApiConfigDefinition

openApiEnabled

ApiConfigDefinition openApiEnabled()

Enables the generated OpenAPI endpoint.

Return Value

ApiConfigDefinition

openApiDisabled

ApiConfigDefinition openApiDisabled()

Disables the generated OpenAPI endpoint.

Return Value

ApiConfigDefinition

openApiRoute

ApiConfigDefinition openApiRoute(string $route)

Overrides the OpenAPI document path relative to the API prefix.

Parameters

string $route

Return Value

ApiConfigDefinition

openApiAccess

ApiConfigDefinition openApiAccess(ApiAccess|string $access)

Overrides the authorization mode enforced for the OpenAPI document.

Parameters

ApiAccess|string $access

Return Value

ApiConfigDefinition

openApiScopes

ApiConfigDefinition openApiScopes(array $scopes)

Replaces the scopes required by the OpenAPI document endpoint.

Parameters

array $scopes

Return Value

ApiConfigDefinition

docsEnabled

Enables the human-readable API documentation endpoint.

Return Value

ApiConfigDefinition

docsDisabled

Disables the human-readable API documentation endpoint.

Return Value

ApiConfigDefinition

docsRoute

ApiConfigDefinition docsRoute(string $route)

Overrides the documentation path relative to the API prefix.

Parameters

string $route

Return Value

ApiConfigDefinition

docsAccess

ApiConfigDefinition docsAccess(ApiAccess|string $access)

Overrides the authorization mode enforced for human-readable documentation.

Parameters

ApiAccess|string $access

Return Value

ApiConfigDefinition

docsScopes

ApiConfigDefinition docsScopes(array $scopes)

Replaces the scopes required by the human-readable documentation endpoint.

Parameters

array $scopes

Return Value

ApiConfigDefinition