1
0
mirror of https://github.com/halaxa/json-machine.git synced 2025-01-16 20:48:17 +01:00

Support for PHP 8.4, dropped support for PHP < 7.2

This commit is contained in:
Filip Halaxa 2024-10-07 21:49:15 +02:00
parent bd675a3ecd
commit 779d58c4f9
7 changed files with 9 additions and 36 deletions

View File

@ -5,15 +5,14 @@ LATEST_PHP := 8.0 3.1.1
COVERAGE_PHP := 7.4 3.1.1
define PHP_VERSIONS
"7.0 2.7.2"\
"7.1 2.9.8"\
"7.2 3.1.1"\
"7.3 3.1.1"\
"7.4 3.1.1"\
"8.0 3.1.1"\
"8.1 3.1.1"\
"8.2 3.2.0"\
"8.3-rc 3.3.0alpha3"
"8.3 3.3.2"\
"8.4-rc 3.4.0beta1"
endef
define DOCKER_RUN

View File

@ -37,7 +37,7 @@ printf "
&& pecl install xdebug-$XDEBUG_VERSION \
&& docker-php-ext-enable xdebug \
&& docker-php-ext-enable opcache \
&& wget https://getcomposer.org/download/2.2.18/composer.phar -O /usr/local/bin/composer \
&& wget https://getcomposer.org/download/2.8.1/composer.phar -O /usr/local/bin/composer \
&& chmod +x /usr/local/bin/composer
" | docker build --quiet --tag "$CONTAINER_NAME" - > /dev/null

View File

@ -1,20 +0,0 @@
{
"name": "halaxa/json-machine",
"config": {
"lock": false,
"sort-packages": true
},
"require": {
"php": "<7.2"
},
"require-dev": {
"ext-json": "*",
"phpunit/phpunit": "^5.0"
},
"autoload": {
"psr-4": {"JsonMachine\\": "src/"}
},
"autoload-dev": {
"psr-4": {"JsonMachineTest\\": "test/JsonMachineTest"}
}
}

View File

@ -1,10 +1,4 @@
#!/usr/bin/env sh
if [ $(php -r "echo PHP_VERSION_ID;") -lt 70200 ]
then
set -x
COMPOSER=build/composer-lt-7.2.json composer --quiet update
else
set -x
composer --quiet update
fi
set -x
composer --quiet update

View File

@ -21,7 +21,7 @@
"sort-packages": true
},
"require": {
"php": "7.0 - 8.3"
"php": "7.2 - 8.4"
},
"require-dev": {
"ext-json": "*",

View File

@ -59,7 +59,7 @@ class ItemsOptions extends \ArrayObject
return $pointer;
}
private function opt_decoder(ItemDecoder $decoder = null)
private function opt_decoder(?ItemDecoder $decoder = null)
{
return $decoder;
}

View File

@ -54,11 +54,11 @@ class Parser implements \IteratorAggregate, PositionAware
/**
* @param array|string $jsonPointer Follows json pointer RFC https://tools.ietf.org/html/rfc6901
* @param ItemDecoder $jsonDecoder
* @param ?ItemDecoder $jsonDecoder
*
* @throws InvalidArgumentException
*/
public function __construct(Traversable $tokens, $jsonPointer = '', ItemDecoder $jsonDecoder = null)
public function __construct(Traversable $tokens, $jsonPointer = '', ?ItemDecoder $jsonDecoder = null)
{
$jsonPointers = (new ValidJsonPointers((array) $jsonPointer))->toArray();