提交的内容
This commit is contained in:
4
vendor/mtdowling/jmespath.php/src/TreeInterpreter.php
vendored
Executable file → Normal file
4
vendor/mtdowling/jmespath.php/src/TreeInterpreter.php
vendored
Executable file → Normal file
@ -14,7 +14,7 @@ class TreeInterpreter
|
||||
* a function name argument and an array of
|
||||
* function arguments and returns the result.
|
||||
*/
|
||||
public function __construct(callable $fnDispatcher = null)
|
||||
public function __construct(?callable $fnDispatcher = null)
|
||||
{
|
||||
$this->fnDispatcher = $fnDispatcher ?: FnDispatcher::getInstance();
|
||||
}
|
||||
@ -107,7 +107,7 @@ class TreeInterpreter
|
||||
$merged = [];
|
||||
foreach ($value as $values) {
|
||||
// Only merge up arrays lists and not hashes
|
||||
if (is_array($values) && isset($values[0])) {
|
||||
if (is_array($values) && array_key_exists(0, $values)) {
|
||||
$merged = array_merge($merged, $values);
|
||||
} elseif ($values !== $skipElement) {
|
||||
$merged[] = $values;
|
||||
|
||||
Reference in New Issue
Block a user