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
  • Loading branch information
greg0ire committed Feb 14, 2020
1 parent 4368848 commit 2a40ba8
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/Symfony/Bridge/Doctrine/Form/Type/DoctrineType.php
Expand Up @@ -285,3 +285,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 @@ -93,3 +93,5 @@ private function parameterToArray(Parameter $parameter)
return [$parameter->getName(), $parameter->getType(), $parameter->getValue()];
}
}

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

interface_exists(ObjectManager::class);
interface_exists(ObjectRepository::class);

0 comments on commit 2a40ba8

Please sign in to comment.