|
static | add ($a, $b) |
| Safely add together two values.
|
|
static | isArray ($value) |
| Determine if the provided value is a JMESPath compatible array.
|
|
static | isEqual ($a, $b) |
| JSON aware value comparison function.
|
|
static | isObject ($value) |
| Determine if the provided value is a JMESPath compatible object.
|
|
static | isTruthy ($value) |
|
static | slice ($value, $start=null, $stop=null, $step=1) |
| Creates a Python-style slice of a string or array.
|
|
static | stableSort (array $data, callable $sortFn) |
| JMESPath requires a stable sorting algorithm, so here we'll implement a simple Schwartzian transform that uses array index positions as tie breakers.
|
|
static | type ($arg) |
| Gets the JMESPath type equivalent of a PHP variable.
|
|
◆ add()
static JmesPath\Utils::add |
( |
| $a, |
|
|
| $b ) |
|
static |
Safely add together two values.
- Parameters
-
mixed | $a | First value to add |
mixed | $b | Second value to add |
- Return values
-
◆ isArray()
static JmesPath\Utils::isArray |
( |
| $value | ) |
|
|
static |
Determine if the provided value is a JMESPath compatible array.
- Parameters
-
- Return values
-
◆ isEqual()
static JmesPath\Utils::isEqual |
( |
| $a, |
|
|
| $b ) |
|
static |
JSON aware value comparison function.
- Parameters
-
mixed | $a | First value to compare |
mixed | $b | Second value to compare |
- Return values
-
◆ isObject()
static JmesPath\Utils::isObject |
( |
| $value | ) |
|
|
static |
Determine if the provided value is a JMESPath compatible object.
- Parameters
-
- Return values
-
◆ slice()
static JmesPath\Utils::slice |
( |
| $value, |
|
|
| $start = null, |
|
|
| $stop = null, |
|
|
| $step = 1 ) |
|
static |
Creates a Python-style slice of a string or array.
- Parameters
-
array | string | $value | Value to slice |
int | null | $start | Starting position |
int | null | $stop | Stop position |
int | $step | Step (1, 2, -1, -2, etc.) |
- Return values
-
- Exceptions
-
◆ stableSort()
static JmesPath\Utils::stableSort |
( |
array | $data, |
|
|
callable | $sortFn ) |
|
static |
JMESPath requires a stable sorting algorithm, so here we'll implement a simple Schwartzian transform that uses array index positions as tie breakers.
- Parameters
-
array | $data | List or map of data to sort |
callable | $sortFn | Callable used to sort values |
- Return values
-
◆ type()
static JmesPath\Utils::type |
( |
| $arg | ) |
|
|
static |
Gets the JMESPath type equivalent of a PHP variable.
- Parameters
-
- Return values
-
string | Returns the JSON data type |
- Exceptions
-
InvalidArgumentException | when an unknown type is given. |
◆ $typeMap
Initial value:= [
'boolean' => 'boolean',
'string' => 'string',
'NULL' => 'null',
'double' => 'number',
'float' => 'number',
'integer' => 'number'
]
The documentation for this class was generated from the following file:
- lib/jmespath/src/Utils.php