From 0e50e9c048f7dd695fee6ed14d2cca872b2abc9f Mon Sep 17 00:00:00 2001 From: W0rma Date: Fri, 10 Jan 2025 16:17:54 +0100 Subject: [PATCH 1/3] Remove obsolete check because PHP 7.1 or lower is not supported anymore --- src/JsonSchema/Constraints/FormatConstraint.php | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/src/JsonSchema/Constraints/FormatConstraint.php b/src/JsonSchema/Constraints/FormatConstraint.php index 482ba668..dbc35475 100644 --- a/src/JsonSchema/Constraints/FormatConstraint.php +++ b/src/JsonSchema/Constraints/FormatConstraint.php @@ -133,12 +133,7 @@ public function check(&$element, $schema = null, ?JsonPointer $path = null, $i = break; case 'email': - $filterFlags = FILTER_NULL_ON_FAILURE; - if (defined('FILTER_FLAG_EMAIL_UNICODE')) { - // Only available from PHP >= 7.1.0, so ignore it for coverage checks - $filterFlags |= constant('FILTER_FLAG_EMAIL_UNICODE'); // @codeCoverageIgnore - } - if (null === filter_var($element, FILTER_VALIDATE_EMAIL, $filterFlags)) { + if (null === filter_var($element, FILTER_VALIDATE_EMAIL, FILTER_NULL_ON_FAILURE | FILTER_FLAG_EMAIL_UNICODE)) { $this->addError(ConstraintError::FORMAT_EMAIL(), $path, ['format' => $schema->format]); } break; From 7faa6ffd7efdbe28ac524d68a9727e1ba577ff09 Mon Sep 17 00:00:00 2001 From: W0rma Date: Tue, 14 Jan 2025 16:29:19 +0100 Subject: [PATCH 2/3] Refresh phpstan baseline --- phpstan-baseline.neon | 5 ----- 1 file changed, 5 deletions(-) diff --git a/phpstan-baseline.neon b/phpstan-baseline.neon index e834ca5a..c6277a6d 100644 --- a/phpstan-baseline.neon +++ b/phpstan-baseline.neon @@ -335,11 +335,6 @@ parameters: count: 1 path: src/JsonSchema/Constraints/FormatConstraint.php - - - message: "#^Strict comparison using \\=\\=\\= between null and non\\-falsy\\-string\\|false will always evaluate to false\\.$#" - count: 1 - path: src/JsonSchema/Constraints/FormatConstraint.php - - message: "#^Method JsonSchema\\\\Constraints\\\\NumberConstraint\\:\\:check\\(\\) has no return type specified\\.$#" count: 1 From 97ce45bcb3769b9ab9f2dc4abf495df5356020b1 Mon Sep 17 00:00:00 2001 From: W0rma Date: Tue, 14 Jan 2025 16:30:53 +0100 Subject: [PATCH 3/3] Add changelog --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 6025c397..b2736caa 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -30,6 +30,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - Add `strict_types=1` to all classes in ./src ([#758](https://github.com/jsonrainbow/json-schema/pull/758)) - Raise minimum level of marc-mabe/php-enum ([#766](https://github.com/jsonrainbow/json-schema/pull/766)) - Cleanup test from @param annotations ([#768](https://github.com/jsonrainbow/json-schema/pull/768)) +- Remove obsolete PHP 7.1 version check ([#772](https://github.com/jsonrainbow/json-schema/pull/772)) ## [6.0.0] - 2024-07-30 ### Added