From 98f0b548692f4953bea791b29826dddeb629955c Mon Sep 17 00:00:00 2001 From: Larry Garfield Date: Mon, 20 Oct 2025 20:23:04 -0500 Subject: [PATCH 1/7] Add maintenence terms. --- MAINTENANCE-TERMS.md | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 MAINTENANCE-TERMS.md diff --git a/MAINTENANCE-TERMS.md b/MAINTENANCE-TERMS.md new file mode 100644 index 0000000..b498893 --- /dev/null +++ b/MAINTENANCE-TERMS.md @@ -0,0 +1,22 @@ +# Maintenance Terms + +Current as of 2025 + +The code, text and data in this repository are provided as-is under +the terms of the repository's LICENSE.md file, as a gift to the commons +and the common good. In providing this software as-is, its author(s) +admit no further obligations from anyone using the software for any reason, +particularly with respect to: + +- Response time, +- Change review and integration, +- Disclosure schedules, +- Discretionary, proprietary or otherwise secretive communications, and +- Any other non-contractual obligations or conventions, regardless of + their presumed urgency or severity. + +The author(s) hope you find it valuable on those terms. + +Terms created by Mike Hoye - mhoye, 2025 + +Original: https://github.com/mhoye/maintenance-terms From c4485aa21e3e2a14ea946bf62233079b8abf8aea Mon Sep 17 00:00:00 2001 From: Larry Garfield Date: Mon, 20 Oct 2025 20:23:18 -0500 Subject: [PATCH 2/7] Run CI on PHP 8.5. --- .github/workflows/quality-assurance.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/quality-assurance.yaml b/.github/workflows/quality-assurance.yaml index bc7aea1..39146aa 100644 --- a/.github/workflows/quality-assurance.yaml +++ b/.github/workflows/quality-assurance.yaml @@ -11,7 +11,7 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - php: [ '7.4', '8.0', '8.1', '8.2', '8.3', '8.4' ] + php: [ '7.4', '8.0', '8.1', '8.2', '8.3', '8.4', '8.5' ] composer-flags: [ '' ] phpunit-flags: [ '--coverage-text' ] steps: From 2bbab8bd334bd3384654e1f86e1ec4c304cf9fbd Mon Sep 17 00:00:00 2001 From: Larry Garfield Date: Mon, 20 Oct 2025 20:23:48 -0500 Subject: [PATCH 3/7] Update Docker syntax. --- Makefile | 6 +++--- docker-compose.yml | 1 - 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/Makefile b/Makefile index 95bb459..2a1f125 100644 --- a/Makefile +++ b/Makefile @@ -1,13 +1,13 @@ -compose_command = docker-compose run -u $(id -u ${USER}):$(id -g ${USER}) --rm php81 +compose_command = docker compose run -u $(id -u ${USER}):$(id -g ${USER}) --rm php81 build: - docker-compose build + docker compose build shell: build $(compose_command) bash destroy: - docker-compose down -v + docker compose down -v composer: build $(compose_command) composer install diff --git a/docker-compose.yml b/docker-compose.yml index 196f4fa..4fcca1d 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -5,7 +5,6 @@ # Run "docker-compose down -v" to fully wipe everything and start over. # Run "docker-compose run -u $(id -u ${USER}):$(id -g ${USER}) --rm php80 bash" to log into the container to run tests selectively. -version: "3" services: php81: build: ./docker/php/81 From b484f4ce35c7f2f4daef87cfc221400a52714f43 Mon Sep 17 00:00:00 2001 From: Larry Garfield Date: Mon, 20 Oct 2025 20:28:59 -0500 Subject: [PATCH 4/7] Update to PHPStan 2. --- composer.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/composer.json b/composer.json index ef87742..08db0a6 100644 --- a/composer.json +++ b/composer.json @@ -32,7 +32,7 @@ "phpunit/phpunit": "^7.0 || ^8.0 || ^9.0", "psr/http-factory": "^1.0", "psr/http-message": "1.*", - "phpstan/phpstan": "^1.3" + "phpstan/phpstan": "^2.1" }, "extra": { "branch-alias": { From 8cc81d334d71f51dddcf71e99a655e00e33bc472 Mon Sep 17 00:00:00 2001 From: Larry Garfield Date: Mon, 20 Oct 2025 20:30:39 -0500 Subject: [PATCH 5/7] Update scripts list. --- composer.json | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/composer.json b/composer.json index 08db0a6..f89c9fe 100644 --- a/composer.json +++ b/composer.json @@ -40,7 +40,12 @@ } }, "scripts": { - "test": "php vendor/bin/phpunit", - "test-coverage": "php vendor/bin/phpunit --coverage-html coverage" + "test": "XDEBUG_MODE=develop,debug phpunit", + "phpstan": "php -d memory_limit=256M vendor/bin/phpstan", + "coverage": "XDEBUG_MODE=coverage vendor/bin/phpunit --coverage-text", + "all-checks": [ + "@test", + "@phpstan" + ] } } From 065fbe05c8929f81d47881cf6ab8c9e5c6fd6e46 Mon Sep 17 00:00:00 2001 From: Larry Garfield Date: Mon, 20 Oct 2025 20:32:05 -0500 Subject: [PATCH 6/7] Add PHPStan to CI. --- .github/workflows/quality-assurance.yaml | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/.github/workflows/quality-assurance.yaml b/.github/workflows/quality-assurance.yaml index 39146aa..2f46d02 100644 --- a/.github/workflows/quality-assurance.yaml +++ b/.github/workflows/quality-assurance.yaml @@ -23,3 +23,18 @@ jobs: tools: composer:v2 - run: composer install --no-progress ${{ matrix.composer-flags }} - run: vendor/bin/phpunit ${{ matrix.phpunit-flags }} + phpstan: + name: PHPStan checks on ${{ matrix.php }} + runs-on: ubuntu-latest + strategy: + matrix: + php: [ '7.4', '8.0', '8.1', '8.2', '8.3', '8.4', '8.5' ] + steps: + - uses: actions/checkout@v2 + - uses: shivammathur/setup-php@v2 + with: + php-version: ${{ matrix.php }} + coverage: xdebug + tools: composer:v2 + - run: composer install --no-progress + - run: vendor/bin/phpstan From 4474dc3853d71e77a818f90ace82b48ff3f9e94a Mon Sep 17 00:00:00 2001 From: Larry Garfield Date: Mon, 20 Oct 2025 20:33:52 -0500 Subject: [PATCH 7/7] Fix implicit nullability. --- src/JsonException.php | 2 +- src/JsonParseException.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/JsonException.php b/src/JsonException.php index 701d718..6469f85 100644 --- a/src/JsonException.php +++ b/src/JsonException.php @@ -61,7 +61,7 @@ public static function fromJsonError(int $jsonError, $failedValue): self /** * @param mixed $failedValue */ - public function __construct(string $message = '', int $code = 0, \Throwable $previous = null, $failedValue = null) + public function __construct(string $message = '', int $code = 0, ?\Throwable $previous = null, $failedValue = null) { parent::__construct($message, $code, $previous); $this->setFailedValue($failedValue); diff --git a/src/JsonParseException.php b/src/JsonParseException.php index cfa93de..11d916b 100644 --- a/src/JsonParseException.php +++ b/src/JsonParseException.php @@ -12,7 +12,7 @@ class JsonParseException extends JsonException * This version forces a string for $failedValue, as that's the only thing that * could fail to parse, since that's all you can even try to parse. */ - public function __construct(string $message = '', int $code = 0, \Throwable $previous = null, string $failedValue = '') + public function __construct(string $message = '', int $code = 0, ?\Throwable $previous = null, string $failedValue = '') { parent::__construct($message, $code, $previous); $this->setFailedValue($failedValue);