diff --git a/lib/jmespath/CHANGELOG.md b/lib/jmespath/CHANGELOG.md
index f1dd6d5d4e1..4eedf742d34 100644
--- a/lib/jmespath/CHANGELOG.md
+++ b/lib/jmespath/CHANGELOG.md
@@ -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.
diff --git a/lib/jmespath/composer.json b/lib/jmespath/composer.json
index b4c37c1caad..819db12e9cc 100644
--- a/lib/jmespath/composer.json
+++ b/lib/jmespath/composer.json
@@ -32,7 +32,7 @@
"bin": ["bin/jp.php"],
"extra": {
"branch-alias": {
- "dev-master": "2.7-dev"
+ "dev-master": "2.8-dev"
}
}
}
diff --git a/lib/jmespath/readme_moodle.txt b/lib/jmespath/readme_moodle.txt
index 395c2bc4ab1..bede58aabc0 100644
--- a/lib/jmespath/readme_moodle.txt
+++ b/lib/jmespath/readme_moodle.txt
@@ -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
diff --git a/lib/jmespath/src/AstRuntime.php b/lib/jmespath/src/AstRuntime.php
index 03f5f1a1a47..f5620be0b9b 100644
--- a/lib/jmespath/src/AstRuntime.php
+++ b/lib/jmespath/src/AstRuntime.php
@@ -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);
diff --git a/lib/jmespath/src/CompilerRuntime.php b/lib/jmespath/src/CompilerRuntime.php
index c26b09cc72d..b85f68e7840 100644
--- a/lib/jmespath/src/CompilerRuntime.php
+++ b/lib/jmespath/src/CompilerRuntime.php
@@ -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();
diff --git a/lib/jmespath/src/Parser.php b/lib/jmespath/src/Parser.php
index 0733f20950c..d126de56b97 100644
--- a/lib/jmespath/src/Parser.php
+++ b/lib/jmespath/src/Parser.php
@@ -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;
diff --git a/lib/jmespath/src/TreeInterpreter.php b/lib/jmespath/src/TreeInterpreter.php
index f7eea86dd24..f4a8aeca73b 100644
--- a/lib/jmespath/src/TreeInterpreter.php
+++ b/lib/jmespath/src/TreeInterpreter.php
@@ -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();
}
diff --git a/lib/thirdpartylibs.xml b/lib/thirdpartylibs.xml
index cdd8e4bba2a..45a9e7a85c4 100644
--- a/lib/thirdpartylibs.xml
+++ b/lib/thirdpartylibs.xml
@@ -754,7 +754,7 @@ All rights reserved.
jmespath
JMESPath
The JMESPath library
- 2.7.0
+ 2.8.0
MIT
https://github.com/jmespath/jmespath.php