Formatter
Table of Contents
- SECTION_SPLIT = '/;(?=(?:[^"]*"[^"]*")*[^"]*\Z)/miu'
- Matches any ; symbol that isn't enclosed in quotes, for a "section" split.
- SYMBOL_AT = '/@(?=(?:[^"]*"[^"]*")*[^"]*\Z)/miu'
- Matches any @ symbol that isn't enclosed in quotes.
- toFormattedString() : string
- Convert a value in a pre-defined format to a PHP string.
- splitFormatComparison() : bool
- splitFormatForSectionSelection() : array<string|int, mixed>
Constants
SECTION_SPLIT
Matches any ; symbol that isn't enclosed in quotes, for a "section" split.
private
mixed
SECTION_SPLIT
= '/;(?=(?:[^"]*"[^"]*")*[^"]*\Z)/miu'
SYMBOL_AT
Matches any @ symbol that isn't enclosed in quotes.
private
mixed
SYMBOL_AT
= '/@(?=(?:[^"]*"[^"]*")*[^"]*\Z)/miu'
Methods
toFormattedString()
Convert a value in a pre-defined format to a PHP string.
public
static toFormattedString(null|bool|float|int|RichText|string $value, string $format[, array<string|int, mixed> $callBack = null ]) : string
Parameters
- $value : null|bool|float|int|RichText|string
-
Value to format
- $format : string
-
Format code: see = self::FORMAT_* for predefined values; or can be any valid MS Excel custom format string
- $callBack : array<string|int, mixed> = null
-
Callback function for additional formatting of string
Return values
string —Formatted string
splitFormatComparison()
private
static splitFormatComparison(mixed $value, string|null $condition, mixed $comparisonValue, string $defaultCondition, mixed $defaultComparisonValue) : bool
Parameters
- $value : mixed
- $condition : string|null
- $comparisonValue : mixed
- $defaultCondition : string
- $defaultComparisonValue : mixed
Return values
bool —splitFormatForSectionSelection()
private
static splitFormatForSectionSelection(array<string|int, mixed> $sections, mixed $value) : array<string|int, mixed>
Parameters
- $sections : array<string|int, mixed>
- $value : mixed