Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove irrelevant PHP version checks #11147

Merged
merged 1 commit into from
Jan 2, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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