Skip to content

Commit 0e50e9c

Browse files
committed
Remove obsolete check because PHP 7.1 or lower is not supported anymore
1 parent 14e41d8 commit 0e50e9c

File tree

1 file changed

+1
-6
lines changed

1 file changed

+1
-6
lines changed

src/JsonSchema/Constraints/FormatConstraint.php

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -133,12 +133,7 @@ public function check(&$element, $schema = null, ?JsonPointer $path = null, $i =
133133
break;
134134

135135
case 'email':
136-
$filterFlags = FILTER_NULL_ON_FAILURE;
137-
if (defined('FILTER_FLAG_EMAIL_UNICODE')) {
138-
// Only available from PHP >= 7.1.0, so ignore it for coverage checks
139-
$filterFlags |= constant('FILTER_FLAG_EMAIL_UNICODE'); // @codeCoverageIgnore
140-
}
141-
if (null === filter_var($element, FILTER_VALIDATE_EMAIL, $filterFlags)) {
136+
if (null === filter_var($element, FILTER_VALIDATE_EMAIL, FILTER_NULL_ON_FAILURE | FILTER_FLAG_EMAIL_UNICODE)) {
142137
$this->addError(ConstraintError::FORMAT_EMAIL(), $path, ['format' => $schema->format]);
143138
}
144139
break;

0 commit comments

Comments
 (0)