From 2a40ba8e05e664ee8a0a94559b2f3353535d076f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gr=C3=A9goire=20Paris?= Date: Fri, 14 Feb 2020 19:15:20 +0100 Subject: [PATCH] Add missing autoload calls 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 https://github.com/doctrine/DoctrineMongoDBBundle/issues/616 --- src/Symfony/Bridge/Doctrine/Form/Type/DoctrineType.php | 2 ++ src/Symfony/Bridge/Doctrine/Form/Type/EntityType.php | 2 ++ .../Bridge/Doctrine/Security/User/EntityUserProvider.php | 3 +++ 3 files changed, 7 insertions(+) diff --git a/src/Symfony/Bridge/Doctrine/Form/Type/DoctrineType.php b/src/Symfony/Bridge/Doctrine/Form/Type/DoctrineType.php index 65a3368ba2156..0c106703da499 100644 --- a/src/Symfony/Bridge/Doctrine/Form/Type/DoctrineType.php +++ b/src/Symfony/Bridge/Doctrine/Form/Type/DoctrineType.php @@ -285,3 +285,5 @@ public function reset() $this->choiceLoaders = []; } } + +interface_exists(ObjectManager::class); diff --git a/src/Symfony/Bridge/Doctrine/Form/Type/EntityType.php b/src/Symfony/Bridge/Doctrine/Form/Type/EntityType.php index f48b7f2f0cf82..6d5443e0e3bf5 100644 --- a/src/Symfony/Bridge/Doctrine/Form/Type/EntityType.php +++ b/src/Symfony/Bridge/Doctrine/Form/Type/EntityType.php @@ -93,3 +93,5 @@ private function parameterToArray(Parameter $parameter) return [$parameter->getName(), $parameter->getType(), $parameter->getValue()]; } } + +interface_exists(ObjectManager::class); diff --git a/src/Symfony/Bridge/Doctrine/Security/User/EntityUserProvider.php b/src/Symfony/Bridge/Doctrine/Security/User/EntityUserProvider.php index 7df455abf4192..25efec6e1bfbe 100644 --- a/src/Symfony/Bridge/Doctrine/Security/User/EntityUserProvider.php +++ b/src/Symfony/Bridge/Doctrine/Security/User/EntityUserProvider.php @@ -136,3 +136,6 @@ private function getClassMetadata(): ClassMetadata return $this->getObjectManager()->getClassMetadata($this->classOrAlias); } } + +interface_exists(ObjectManager::class); +interface_exists(ObjectRepository::class);