final class ImageUploadProfileConfig (View source)

Carries one resolved image-upload policy, including re-encoding and dimension boundaries.

Allowed extensions are the canonical allowlist; their server-detected MIME compatibility remains enforced by MimeTypeCatalog before image-specific validation runs.

Methods

__construct(string $targetDirectory, int $maxBytes, array $allowedExtensions, bool $reencode, int|null $minWidth, int|null $maxWidth, int|null $minHeight, int|null $maxHeight, UploadVisibility $visibility = UploadVisibility::Public, array $allowedRisks = [])

Records normalized image policy values consumed by UploadFactory.

string

Returns the validated relative directory configured for this profile.

string
int

Returns the maximum number of bytes accepted while staging an upload.

int
array

Returns the normalized filename extensions accepted by this profile.

array
bool

Returns whether validated image bytes are regenerated before publication.

bool
int|null

Returns the optional minimum accepted image width in pixels.

int|null
int|null

Returns the optional maximum accepted image width in pixels.

int|null
int|null

Returns the optional minimum accepted image height in pixels.

int|null
int|null

Returns the optional maximum accepted image height in pixels.

int|null
UploadVisibility

Returns whether accepted images are published to public or private storage.

UploadVisibility
array

Returns the non-passive MIME risk categories explicitly allowed for private storage.

array

Details

__construct

__construct(string $targetDirectory, int $maxBytes, array $allowedExtensions, bool $reencode, int|null $minWidth, int|null $maxWidth, int|null $minHeight, int|null $maxHeight, UploadVisibility $visibility = UploadVisibility::Public, array $allowedRisks = [])

Records normalized image policy values consumed by UploadFactory.

Parameters

string $targetDirectory
int $maxBytes
array $allowedExtensions

Explicit normalized filename suffixes permitted by this profile

bool $reencode
int|null $minWidth
int|null $maxWidth
int|null $minHeight
int|null $maxHeight
UploadVisibility $visibility
array $allowedRisks

Non-passive categories explicitly authorized for private storage

targetDirectory

string targetDirectory()

Returns the validated relative directory configured for this profile.

Return Value

string

maxBytes

int maxBytes()

Returns the maximum number of bytes accepted while staging an upload.

Return Value

int

allowedExtensions

array allowedExtensions()

Returns the normalized filename extensions accepted by this profile.

Return Value

array

reencode

bool reencode()

Returns whether validated image bytes are regenerated before publication.

Return Value

bool

minWidth

int|null minWidth()

Returns the optional minimum accepted image width in pixels.

Return Value

int|null

maxWidth

int|null maxWidth()

Returns the optional maximum accepted image width in pixels.

Return Value

int|null

minHeight

int|null minHeight()

Returns the optional minimum accepted image height in pixels.

Return Value

int|null

maxHeight

int|null maxHeight()

Returns the optional maximum accepted image height in pixels.

Return Value

int|null

visibility

UploadVisibility visibility()

Returns whether accepted images are published to public or private storage.

Return Value

UploadVisibility

allowedRisks

array allowedRisks()

Returns the non-passive MIME risk categories explicitly allowed for private storage.

Return Value

array