Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PHP 8.4 support #84

Merged
merged 4 commits into from
Sep 4, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ jobs:

strategy:
matrix:
php: ['7.2', '7.3', '7.4', '8.0', '8.1', '8.2', '8.3']
php: ['7.2', '7.3', '7.4', '8.0', '8.1', '8.2', '8.3', '8.4']

steps:
- name: Checkout Code
Expand Down Expand Up @@ -43,7 +43,7 @@ jobs:

strategy:
matrix:
php: ['7.2', '7.3', '7.4', '8.0', '8.1', '8.2', '8.3']
php: ['7.2', '7.3', '7.4', '8.0', '8.1', '8.2', '8.3', '8.4']

steps:
- name: Configure Git
Expand Down
6 changes: 5 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,12 @@
# CHANGELOG

## 2.8.0 - UPCOMING

* Add support for PHP 8.4.

## 2.7.0 - 2023-08-15

* Fixed flattening in arrays starting with null
* 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.

Expand Down
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
"bin": ["bin/jp.php"],
"extra": {
"branch-alias": {
"dev-master": "2.7-dev"
"dev-master": "2.8-dev"
}
}
}
4 changes: 2 additions & 2 deletions src/AstRuntime.php
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
2 changes: 1 addition & 1 deletion src/CompilerRuntime.php
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down
8 changes: 4 additions & 4 deletions src/Parser.php
Original file line number Diff line number Diff line change
Expand Up @@ -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();
}
Expand Down Expand Up @@ -366,7 +366,7 @@ private function parseKeyValuePair()
];
}

private function parseWildcardObject(array $left = null)
private function parseWildcardObject(?array $left = null)
{
$this->next();

Expand All @@ -380,7 +380,7 @@ private function parseWildcardObject(array $left = null)
];
}

private function parseWildcardArray(array $left = null)
private function parseWildcardArray(?array $left = null)
{
static $getRbracket = [T::T_RBRACKET => true];
$this->next($getRbracket);
Expand Down Expand Up @@ -473,7 +473,7 @@ private function lookahead()
: $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;
Expand Down
2 changes: 1 addition & 1 deletion src/TreeInterpreter.php
Original file line number Diff line number Diff line change
Expand Up @@ -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();
}
Expand Down
Loading