final class UploadConfigResolver (View source)

Converts typed upload definitions into fail-fast runtime policies consumed by UploadFactory.

It normalizes target paths, visibility, risk authorization, extension families, and byte limits before a request can reach an uploader.

Methods

__construct(MimeTypeCatalog|null $catalog = null, ByteSizeParser $byteSizeParser = new ByteSizeParser(), UploadRiskPolicy $riskPolicy = new UploadRiskPolicy())

Creates a resolver using the composed MIME catalog, or the framework catalog for isolated use.

resolve(UploadConfigDefinition ...$definitions)

Merges layered definitions into profiles with normalized extensions and positive byte limits.

Details

__construct

__construct(MimeTypeCatalog|null $catalog = null, ByteSizeParser $byteSizeParser = new ByteSizeParser(), UploadRiskPolicy $riskPolicy = new UploadRiskPolicy())

Creates a resolver using the composed MIME catalog, or the framework catalog for isolated use.

The parser is shared so all supported size syntax has one binary-byte interpretation.

Parameters

MimeTypeCatalog|null $catalog
ByteSizeParser $byteSizeParser
UploadRiskPolicy $riskPolicy

resolve

Merges layered definitions into profiles with normalized extensions and positive byte limits.

Unsafe paths, unauthorized format risks, unknown extensions, legacy MIME policies, and malformed limits are rejected before upload services are used.

Parameters

UploadConfigDefinition ...$definitions

Return Value

UploadConfig

Exceptions

InvalidArgumentException