From 6378d6b5409d71e6d69e3630fa92dee311b9d79f Mon Sep 17 00:00:00 2001 From: Tac Tacelosky Date: Fri, 22 Nov 2024 07:30:55 -0500 Subject: [PATCH 1/3] bump to phpstan 2.0 --- composer.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/composer.json b/composer.json index f650976..088c1b4 100644 --- a/composer.json +++ b/composer.json @@ -25,7 +25,7 @@ }, "require-dev": { "mikehaertl/php-shellcommand": "^1.7.0", - "phpstan/phpstan": "^1.10.57", + "phpstan/phpstan": "^2.0", "scrutinizer/ocular": "^1.9", "squizlabs/php_codesniffer": "^3.8.1", "symfony/finder": "^6.0|^7.0", From 1148488129b1acc93a3908eec0c5c201b86e9c65 Mon Sep 17 00:00:00 2001 From: Tac Tacelosky Date: Fri, 22 Nov 2024 07:31:07 -0500 Subject: [PATCH 2/3] add 8.4, fix typo in php versions --- .github/workflows/tests.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 9400781..9de6713 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -29,7 +29,7 @@ jobs: continue-on-error: ${{ !matrix.stable }} strategy: matrix: - php: ['8.0', 8.1', '8.2', '8.3'] + php: ['8.0', '8.1', '8.2', '8.3','8.4'] stable: [true] coverage: [true] composer-flags: [''] From 84ecefd9bc2748db91ff02a60b3fbcf97fae15e7 Mon Sep 17 00:00:00 2001 From: Tac Tacelosky Date: Fri, 22 Nov 2024 07:35:09 -0500 Subject: [PATCH 3/3] bump phpstan level, cast as bool --- phpstan.neon.dist | 2 +- src/Json5Decoder.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/phpstan.neon.dist b/phpstan.neon.dist index e43e64c..c839c3f 100644 --- a/phpstan.neon.dist +++ b/phpstan.neon.dist @@ -1,4 +1,4 @@ parameters: - level: 3 + level: 5 paths: - src diff --git a/src/Json5Decoder.php b/src/Json5Decoder.php index 0d7209a..5b2da32 100644 --- a/src/Json5Decoder.php +++ b/src/Json5Decoder.php @@ -63,7 +63,7 @@ public static function decode(string $json, ?bool $associative = false, int $dep // Fall back to JSON5 if that fails $associative = $associative === true || ($associative === null && $flags & \JSON_OBJECT_AS_ARRAY); - $castBigIntToString = $flags & \JSON_BIGINT_AS_STRING; + $castBigIntToString = (bool) ($flags & \JSON_BIGINT_AS_STRING); $decoder = new self($json, $associative, $depth, $castBigIntToString);