Skip to content

Commit

Permalink
Merge pull request #11147 from greg0ire/remove-php-version-id
Browse files Browse the repository at this point in the history
Remove irrelevant PHP version checks
  • Loading branch information
greg0ire authored Jan 2, 2024
2 parents 7361d3e + 64e4a21 commit 1556a1f
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 7 deletions.
4 changes: 1 addition & 3 deletions lib/Doctrine/ORM/Mapping/DefaultTypedFieldMapper.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,6 @@
use function assert;
use function enum_exists;

use const PHP_VERSION_ID;

/** @psalm-type ScalarName = 'array'|'bool'|'float'|'int'|'string' */
final class DefaultTypedFieldMapper implements TypedFieldMapper
{
Expand Down Expand Up @@ -53,7 +51,7 @@ public function validateAndComplete(array $mapping, ReflectionProperty $field):
! isset($mapping['type'])
&& ($type instanceof ReflectionNamedType)
) {
if (PHP_VERSION_ID >= 80100 && ! $type->isBuiltin() && enum_exists($type->getName())) {
if (! $type->isBuiltin() && enum_exists($type->getName())) {
$mapping['enumType'] = $type->getName();

$reflection = new ReflectionEnum($type->getName());
Expand Down
5 changes: 1 addition & 4 deletions lib/Doctrine/ORM/Tools/SchemaValidator.php
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,6 @@
use function is_a;
use function sprintf;

use const PHP_VERSION_ID;

/**
* Performs strict validation of the mapping schema
*
Expand Down Expand Up @@ -120,8 +118,7 @@ public function validateClass(ClassMetadata $class): array
}
}

// PHP 7.4 introduces the ability to type properties, so we can't validate them in previous versions
if (PHP_VERSION_ID >= 70400 && $this->validatePropertyTypes) {
if ($this->validatePropertyTypes) {
array_push($ce, ...$this->validatePropertiesTypes($class));
}

Expand Down

0 comments on commit 1556a1f

Please sign in to comment.