Skip to content

Commit

Permalink
Add missing autoload calls
Browse files Browse the repository at this point in the history
Until either php 7.4 or doctrine/persistence 2 is required, these will
be needed to make sure php recognises signatures using the old names as
compatible with signatures using the new names.
This is necessary for types defined outside Symfony that extend types
from Symfony and still use the old names in signatures of methods they
override.

More details at https://dev.to/greg0ire/how-to-deprecate-a-type-in-php-48cf

Fixes doctrine/DoctrineMongoDBBundle#616

Fix retour pr
  • Loading branch information
greg0ire authored and Benjamin committed Feb 17, 2020
1 parent a60e92a commit 0fa652f
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 5 deletions.
2 changes: 2 additions & 0 deletions src/Symfony/Bridge/Doctrine/Form/Type/DoctrineType.php
Expand Up @@ -282,3 +282,5 @@ public function reset()
$this->choiceLoaders = [];
}
}

interface_exists(ObjectManager::class);
2 changes: 2 additions & 0 deletions src/Symfony/Bridge/Doctrine/Form/Type/EntityType.php
Expand Up @@ -97,3 +97,5 @@ private function parameterToArray(Parameter $parameter): array
return [$parameter->getName(), $parameter->getType(), $parameter->getValue()];
}
}

interface_exists(ObjectManager::class);
Expand Up @@ -153,3 +153,6 @@ private function getClassMetadata(): ClassMetadata
return $this->getObjectManager()->getClassMetadata($this->classOrAlias);
}
}

interface_exists(ObjectManager::class);
interface_exists(ObjectRepository::class);
2 changes: 1 addition & 1 deletion src/Symfony/Bridge/PhpUnit/TextUI/Command.php
Expand Up @@ -13,7 +13,7 @@

if (version_compare(\PHPUnit\Runner\Version::id(), '6.0.0', '<')) {
class_alias('Symfony\Bridge\PhpUnit\Legacy\CommandForV5', 'Symfony\Bridge\PhpUnit\TextUI\Command');
} elseif (version_compare(\PHPUnit\Runner\Version::id(), '6.0.0', '>=') && version_compare(\PHPUnit\Runner\Version::id(), '9.0.0', '<')) {
} elseif (version_compare(\PHPUnit\Runner\Version::id(), '9.0.0', '<')) {
class_alias('Symfony\Bridge\PhpUnit\Legacy\CommandForV6', 'Symfony\Bridge\PhpUnit\TextUI\Command');
} else {
class_alias('Symfony\Bridge\PhpUnit\Legacy\CommandForV9', 'Symfony\Bridge\PhpUnit\TextUI\Command');
Expand Down
5 changes: 1 addition & 4 deletions src/Symfony/Bridge/PhpUnit/bin/simple-phpunit.php
Expand Up @@ -93,10 +93,7 @@
}
};

if (PHP_VERSION_ID >= 70300) {
// PHPUnit 9 requires PHP 7.3+
$PHPUNIT_VERSION = $getEnvVar('SYMFONY_PHPUNIT_VERSION', '9.0');
} elseif (PHP_VERSION_ID >= 70200) {
if (PHP_VERSION_ID >= 70200) {
// PHPUnit 8 requires PHP 7.2+
$PHPUNIT_VERSION = $getEnvVar('SYMFONY_PHPUNIT_VERSION', '8.3');
} elseif (PHP_VERSION_ID >= 70100) {
Expand Down

0 comments on commit 0fa652f

Please sign in to comment.