From 9ff5667e3e734fad63a9da031c63f6a7935c3bf4 Mon Sep 17 00:00:00 2001 From: David Grudl Date: Tue, 18 Jun 2024 21:56:08 +0200 Subject: [PATCH] support for PHP 8.4 --- .github/workflows/tests.yml | 2 +- composer.json | 2 +- readme.md | 2 +- src/Schema/Elements/Type.php | 2 +- src/Schema/Expect.php | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index fd95d74..9637f74 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -7,7 +7,7 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - php: ['8.1', '8.2', '8.3'] + php: ['8.1', '8.2', '8.3', '8.4'] fail-fast: false diff --git a/composer.json b/composer.json index 643c195..56b8452 100644 --- a/composer.json +++ b/composer.json @@ -15,7 +15,7 @@ } ], "require": { - "php": "8.1 - 8.3", + "php": "8.1 - 8.4", "nette/utils": "^4.0" }, "require-dev": { diff --git a/readme.md b/readme.md index c88f6bd..5ee1382 100644 --- a/readme.md +++ b/readme.md @@ -21,7 +21,7 @@ Installation: composer require nette/schema ``` -It requires PHP version 8.1 and supports PHP up to 8.3. +It requires PHP version 8.1 and supports PHP up to 8.4. [Support Me](https://github.com/sponsors/dg) diff --git a/src/Schema/Elements/Type.php b/src/Schema/Elements/Type.php index 4094442..69d5299 100644 --- a/src/Schema/Elements/Type.php +++ b/src/Schema/Elements/Type.php @@ -75,7 +75,7 @@ public function max(?float $max): self /** * @internal use arrayOf() or listOf() */ - public function items(string|Schema $valueType = 'mixed', string|Schema $keyType = null): self + public function items(string|Schema $valueType = 'mixed', string|Schema|null $keyType = null): self { $this->itemsValue = $valueType instanceof Schema ? $valueType diff --git a/src/Schema/Expect.php b/src/Schema/Expect.php index 38f1c81..39ea390 100644 --- a/src/Schema/Expect.php +++ b/src/Schema/Expect.php @@ -95,7 +95,7 @@ public static function from(object $object, array $items = []): Structure } - public static function arrayOf(string|Schema $valueType, string|Schema $keyType = null): Type + public static function arrayOf(string|Schema $valueType, string|Schema|null $keyType = null): Type { return (new Type('array'))->items($valueType, $keyType); }