AllowedFileExtensions
final readonly class \
The file extensions a file storage or file mount restricts added files to.
An empty list given by configuration means no restriction.
Internal
Table of Contents
Methods
- allowsFileExtension() : bool
- allowsFileName() : bool
- fromList() : self
- intersect() : self
- Restrictions of different levels, such as a storage and its file mounts, narrow each other: the result allows what both allow, which may be nothing.
- isRestricted() : bool
- merge() : self
- Permissions of file mounts add up: the result allows what any of both allows, which means no restriction if one of them is unrestricted.
- toList() : array<int, non-empty-string>
- toString() : string
- unrestricted() : self
Methods
allowsFileExtension()
public
allowsFileExtension(string $fileExtension) : bool
Parameters
- $fileExtension : string
Return values
boolallowsFileName()
public
allowsFileName(string $fileName) : bool
Parameters
- $fileName : string
Return values
boolfromList()
public
static fromList(string|array<int, string> $fileExtensions) : self
Parameters
- $fileExtensions : string|array<int, string>
-
A list or a comma-separated string
Return values
selfintersect()
Restrictions of different levels, such as a storage and its file mounts, narrow each other: the result allows what both allow, which may be nothing.
public
intersect(self $other) : self
Parameters
- $other : self
Return values
selfisRestricted()
public
isRestricted() : bool
Return values
boolmerge()
Permissions of file mounts add up: the result allows what any of both allows, which means no restriction if one of them is unrestricted.
public
merge(self $other) : self
Parameters
- $other : self
Return values
selftoList()
public
toList() : array<int, non-empty-string>
Return values
array<int, non-empty-string> —empty if unrestricted, or if nothing is allowed
toString()
public
toString() : string
Return values
stringunrestricted()
public
static unrestricted() : self