Merge branch 'MDL-84177_upgrade-JMESPath-to-2-8-0' of https://github.com/ziegenberg/moodle

This commit is contained in:
Andrew Nicols
2025-03-09 22:37:49 +08:00
8 changed files with 23 additions and 14 deletions
+6 -2
View File
@@ -1,8 +1,12 @@
# CHANGELOG
## 2.7.0 - UPCOMING
## 2.8.0 - 2024-09-04
* Fixed flattening in arrays starting with null
* Add support for PHP 8.4.
## 2.7.0 - 2023-08-15
* 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.
+1 -1
View File
@@ -32,7 +32,7 @@
"bin": ["bin/jp.php"],
"extra": {
"branch-alias": {
"dev-master": "2.7-dev"
"dev-master": "2.8-dev"
}
}
}
+7 -2
View File
@@ -2,5 +2,10 @@ Instructions to import/update jmespath library into Moodle:
Update jmespath library
1. Download the latest jmespath.php library package from https://github.com/jmespath/jmespath.php/releases
2. Copy the src directory to lib/jmespath/src folder
3. Copy the associated files LICENCE, README.md etc. to jmespath directory
2. Remove the lib/jmespath/src folder
3. Copy the src directory to lib/jmespath/ folder
4. Copy the associated following files to the jmespath directory:
- CHANGELOG.md
- composer.json
- LICENSE
- README.md
+2 -2
View File
@@ -12,8 +12,8 @@ class AstRuntime
private $cachedCount = 0;
public function __construct(
Parser $parser = null,
callable $fnDispatcher = null
?Parser $parser = null,
?callable $fnDispatcher = null
) {
$fnDispatcher = $fnDispatcher ?: FnDispatcher::getInstance();
$this->interpreter = new TreeInterpreter($fnDispatcher);
+1 -1
View File
@@ -23,7 +23,7 @@ class CompilerRuntime
* @param Parser|null $parser JMESPath parser to utilize
* @throws \RuntimeException if the cache directory cannot be created
*/
public function __construct($dir = null, Parser $parser = null)
public function __construct($dir = null, ?Parser $parser = null)
{
$this->parser = $parser ?: new Parser();
$this->compiler = new TreeCompiler();
+4 -4
View File
@@ -57,7 +57,7 @@ class Parser
/**
* @param Lexer|null $lexer Lexer used to tokenize expressions
*/
public function __construct(Lexer $lexer = null)
public function __construct(?Lexer $lexer = null)
{
$this->lexer = $lexer ?: new Lexer();
}
@@ -366,7 +366,7 @@ class Parser
];
}
private function parseWildcardObject(array $left = null)
private function parseWildcardObject(?array $left = null)
{
$this->next();
@@ -380,7 +380,7 @@ class Parser
];
}
private function parseWildcardArray(array $left = null)
private function parseWildcardArray(?array $left = null)
{
static $getRbracket = [T::T_RBRACKET => true];
$this->next($getRbracket);
@@ -473,7 +473,7 @@ class Parser
: $this->tokens[$this->tpos + 1]['type'];
}
private function next(array $match = null)
private function next(?array $match = null)
{
if (!isset($this->tokens[$this->tpos + 1])) {
$this->token = self::$nullToken;
+1 -1
View 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();
}
+1 -1
View File
@@ -754,7 +754,7 @@ All rights reserved.</copyright>
<location>jmespath</location>
<name>JMESPath</name>
<description>The JMESPath library</description>
<version>2.7.0</version>
<version>2.8.0</version>
<license>MIT</license>
<repository>https://github.com/jmespath/jmespath.php</repository>
<copyrights>