MDL-80641 libaries: Upgrade JMESPath to 2.7.0
Signed-off-by: Daniel Ziegenberg <[email protected]>
This commit is contained in:
@@ -1,5 +1,11 @@
|
||||
# CHANGELOG
|
||||
|
||||
## 2.7.0 - UPCOMING
|
||||
|
||||
* Fixed flattening in arrays starting with null
|
||||
* Drop support for HHVM and PHP earlier than 7.2.5.
|
||||
* Add support for PHP 8.1, 8.2, and 8.3.
|
||||
|
||||
## 2.6.0 - 2020-07-31
|
||||
|
||||
* Support for PHP 8.0.
|
||||
|
||||
@@ -4,7 +4,7 @@ jmespath.php
|
||||
|
||||
JMESPath (pronounced "jaymz path") allows you to declaratively specify how to
|
||||
extract elements from a JSON document. *jmespath.php* allows you to use
|
||||
JMESPath in PHP applications with PHP data structures. It requires PHP 5.4 or
|
||||
JMESPath in PHP applications with PHP data structures. It requires PHP 7.2.5 or
|
||||
greater and can be installed through `Composer <http://getcomposer.org/doc/00-intro.md>`_
|
||||
using the ``mtdowling/jmespath.php`` package.
|
||||
|
||||
|
||||
+34
-35
@@ -1,39 +1,38 @@
|
||||
{
|
||||
"name": "mtdowling/jmespath.php",
|
||||
"description": "Declaratively specify how to extract elements from a JSON document",
|
||||
"keywords": ["json", "jsonpath"],
|
||||
"license": "MIT",
|
||||
|
||||
"authors": [
|
||||
{
|
||||
"name": "Michael Dowling",
|
||||
"email": "[email protected]",
|
||||
"homepage": "https://github.com/mtdowling"
|
||||
}
|
||||
],
|
||||
|
||||
"require": {
|
||||
"php": "^5.4 || ^7.0 || ^8.0",
|
||||
"symfony/polyfill-mbstring": "^1.17"
|
||||
},
|
||||
|
||||
"require-dev": {
|
||||
"composer/xdebug-handler": "^1.4 || ^2.0",
|
||||
"phpunit/phpunit": "^4.8.36 || ^7.5.15"
|
||||
},
|
||||
|
||||
"autoload": {
|
||||
"psr-4": {
|
||||
"JmesPath\\": "src/"
|
||||
"name": "mtdowling/jmespath.php",
|
||||
"description": "Declaratively specify how to extract elements from a JSON document",
|
||||
"keywords": ["json", "jsonpath"],
|
||||
"license": "MIT",
|
||||
"authors": [
|
||||
{
|
||||
"name": "Graham Campbell",
|
||||
"email": "[email protected]",
|
||||
"homepage": "https://github.com/GrahamCampbell"
|
||||
},
|
||||
{
|
||||
"name": "Michael Dowling",
|
||||
"email": "[email protected]",
|
||||
"homepage": "https://github.com/mtdowling"
|
||||
}
|
||||
],
|
||||
"require": {
|
||||
"php": "^7.2.5 || ^8.0",
|
||||
"symfony/polyfill-mbstring": "^1.17"
|
||||
},
|
||||
"files": ["src/JmesPath.php"]
|
||||
},
|
||||
|
||||
"bin": ["bin/jp.php"],
|
||||
|
||||
"extra": {
|
||||
"branch-alias": {
|
||||
"dev-master": "2.6-dev"
|
||||
"require-dev": {
|
||||
"composer/xdebug-handler": "^3.0.3",
|
||||
"phpunit/phpunit": "^8.5.33"
|
||||
},
|
||||
"autoload": {
|
||||
"psr-4": {
|
||||
"JmesPath\\": "src/"
|
||||
},
|
||||
"files": ["src/JmesPath.php"]
|
||||
},
|
||||
"bin": ["bin/jp.php"],
|
||||
"extra": {
|
||||
"branch-alias": {
|
||||
"dev-master": "2.7-dev"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -16,7 +16,7 @@ class SyntaxErrorException extends \InvalidArgumentException
|
||||
array $token,
|
||||
$expression
|
||||
) {
|
||||
$message = "Syntax error at character {$token['pos']}\n"
|
||||
$message = sprintf("Syntax error at character %d\n", max($token['pos'], 0))
|
||||
. $expression . "\n" . str_repeat(' ', max($token['pos'], 0)) . "^\n";
|
||||
$message .= !is_array($expectedTypesOrMessage)
|
||||
? $expectedTypesOrMessage
|
||||
|
||||
@@ -305,7 +305,7 @@ class TreeCompiler
|
||||
->write('%s = [];', $merged)
|
||||
->write('foreach ($value as %s) {', $val)
|
||||
->indent()
|
||||
->write('if (is_array(%s) && isset(%s[0])) {', $val, $val)
|
||||
->write('if (is_array(%s) && array_key_exists(0, %s)) {', $val, $val)
|
||||
->indent()
|
||||
->write('%s = array_merge(%s, %s);', $merged, $merged, $val)
|
||||
->outdent()
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -765,7 +765,7 @@ All rights reserved.</copyright>
|
||||
<location>jmespath</location>
|
||||
<name>JMESPath</name>
|
||||
<description>The JMESPath library</description>
|
||||
<version>2.6.1</version>
|
||||
<version>2.7.0</version>
|
||||
<license>MIT</license>
|
||||
<repository>https://github.com/jmespath/jmespath.php</repository>
|
||||
<copyrights>
|
||||
|
||||
Reference in New Issue
Block a user