BaseFormatter
in package
Base formatter for API responses
Tags
Table of Contents
- filterArrayValues() : void
- Recursive function to filter array fields: - remove empty values - convert boolean values to 0/1 - force numerically indexed (non-associative) arrays to have numeric keys.
- resetArrayIndices() : void
- Reset numerical array indices.
Methods
filterArrayValues()
Recursive function to filter array fields: - remove empty values - convert boolean values to 0/1 - force numerically indexed (non-associative) arrays to have numeric keys.
protected
filterArrayValues(array<string|int, mixed> &$array) : void
Parameters
- $array : array<string|int, mixed>
-
Array to check
Return values
void —resetArrayIndices()
Reset numerical array indices.
protected
resetArrayIndices(array<string|int, mixed> &$array) : void
Parameters
- $array : array<string|int, mixed>
-
Array