Skip to content

FormPopulationConfig

Helper to bridge configuration storage for form population between legacy namespaced attributes and the PSR-7 attribute bag on WebRequest.

WebRequest is immutable, so seed()/merge()/setScopedValue()/store() return the (possibly new) request instance; callers must capture and propagate it. Legacy namespaced-attribute holders mutate in place and are returned unchanged for API symmetry.

final class FormPopulationConfig

SourceUtil/FormPopulationConfig.php
MethodDescription
get(mixed $request): array<string, mixed>Retrieve the current configuration map.
getScopedValue(mixed $request, string $key, mixed $default = null): mixedRetrieve a single scoped value with default fallback.
merge(mixed $request, array<string, mixed> $overrides): mixedMerge configuration overrides, allowing new values to replace existing ones.
seed(mixed $request, array<string, mixed> $defaults): mixedSeed configuration defaults without overwriting previously provided values.
setScopedValue(mixed $request, string $key, mixed $value): mixedConvenience helper to set a single scoped value.

public static function get(mixed $request): array<string, mixed>

Retrieve the current configuration map.

ParameterTypeDescription
$requestmixed

Returns array``<``string``, ``mixed``>

public static function getScopedValue(mixed $request, string $key, mixed $default = null): mixed

Retrieve a single scoped value with default fallback.

ParameterTypeDescription
$requestmixed
$keystring
$defaultmixed

Returns mixed

public static function merge(mixed $request, array<string, mixed> $overrides): mixed

Merge configuration overrides, allowing new values to replace existing ones.

ParameterTypeDescription
$requestmixed
$overridesarray``<``string``, ``mixed``>

Returns mixed

public static function seed(mixed $request, array<string, mixed> $defaults): mixed

Seed configuration defaults without overwriting previously provided values.

ParameterTypeDescription
$requestmixed
$defaultsarray``<``string``, ``mixed``>

Returns mixed

public static function setScopedValue(mixed $request, string $key, mixed $value): mixed

Convenience helper to set a single scoped value.

ParameterTypeDescription
$requestmixed
$keystring
$valuemixed

Returns mixed