Skip to content

UploadedFileAccessTrait

Convenience accessors returning flat lists of UploadedFileInterface instances, hiding PSR-7’s nested-array upload structure from callers.

trait UploadedFileAccessTrait

SourceRequest/UploadedFileAccessTrait.php
MethodDescription
getFile(string $name, mixed $default = null): mixedConvenience alias for getUploadedFileArray — returns PSR-7 UploadedFileInterface array.
getUploadedFile(string $name): ?UploadedFileInterfaceReturn the first uploaded file for a given field name or null if none exist.
getUploadedFileArray(string $name): array<UploadedFileInterface>

public function getFile(string $name, mixed $default = null): mixed

Convenience alias for getUploadedFileArray — returns PSR-7 UploadedFileInterface array.

ParameterTypeDescription
$namestring
$defaultmixed

Returns mixed

public function getUploadedFile(string $name): ?UploadedFileInterface

Return the first uploaded file for a given field name or null if none exist.

ParameterTypeDescription
$namestring

Returns ?UploadedFileInterface

public function getUploadedFileArray(string $name): array<UploadedFileInterface>

ParameterTypeDescription
$namestring

Returns array``<UploadedFileInterface>