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 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 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;