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 0cc1d00 commit bceef1a
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 0 deletions.
2 changes: 2 additions & 0 deletions Form/Type/DoctrineType.php
Original file line number Diff line number Diff line change
Expand Up @@ -282,3 +282,5 @@ public function reset()
$this->choiceLoaders = [];
}
}

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

interface_exists(ObjectManager::class);
3 changes: 3 additions & 0 deletions Security/User/EntityUserProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -153,3 +153,6 @@ private function getClassMetadata(): ClassMetadata
return $this->getObjectManager()->getClassMetadata($this->classOrAlias);
}
}

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

0 comments on commit bceef1a

Please sign in to comment.