Filename
in package
implements
Stringable
Read onlyYes
FinalYes
Valid filename with a restrictive set of caracters allowed.
Table of Contents
Interfaces
- Stringable
Constants
- ALLOWED_LETTERS : string = 'abcdefghijklmnopqrstuvwxyz0123456789'
- ALLOWED_SEPS : string = '-'
Properties
Methods
- __construct() : mixed
- __toString() : string
- fromString() : self
- getFilename() : string
- isPartCorrect() : bool
- withBasename() : self
- withExt() : self
Constants
ALLOWED_LETTERS
public
string
ALLOWED_LETTERS
= 'abcdefghijklmnopqrstuvwxyz0123456789'
ALLOWED_SEPS
public
string
ALLOWED_SEPS
= '-'
Properties
$basename
public
string
$basename
$ext
public
string
$ext
Methods
__construct()
public
__construct(string $basename, string $ext) : mixed
Parameters
- $basename : string
- $ext : string
__toString()
public
__toString() : string
Attributes
- #[Override]
Return values
stringfromString()
public
static fromString(string $filename[, bool $transform = false ]) : self
Parameters
- $filename : string
- $transform : bool = false
Return values
selfgetFilename()
public
getFilename() : string
Return values
stringisPartCorrect()
public
isPartCorrect(string $part, bool $allowSep) : bool
Parameters
- $part : string
- $allowSep : bool
Return values
boolwithBasename()
public
withBasename(string $basename) : self
Parameters
- $basename : string
Return values
selfwithExt()
public
withExt(string $ext) : self
Parameters
- $ext : string