Compose (class)
Simple class for composing stuff from other stuff, i.e. some helpers.
Methods
bytesToHuman($bytes, $decimals = 2, $divider = 1024) static
- ⇒
int $bytesNumber of bytes - ⇒
int $decimalsDecimals to display - ⇒
int $dividerDivider, only 1000 and 1024 accepted - ⤶
stringHuman readable form of bytes to display
Bytes to human readable form. For divider 1000 postfix can be B, kB, MB and so on. For divider 1024 postfix can be B, kiB, MiB and so on.
slug($value) static
- ⇒
string $valueOriginal string value - ⤶
stringSlug string or null if unable to generate
Generate slug from a string.
unique($length = 8, $chars = false) static
- ⇒
int $lengthLength of the string to return - ⇒
mixed $charsCharacters to use, defaults to a-z, A-Z and 0-9 - ⤶
stringUnique string
Create unique string.
UUIDv4() static
- ⤶
stringUUID version 4
Create random UUID, version 4.