1
0
mirror of synced 2025-02-02 13:31:45 +03:00

Merge pull request #7307 from Majkl578/remaining-deprecations

Fix remaining usages of deprecated ClassLoader and Inflector from doctrine/common
This commit is contained in:
Luís Cobucci 2018-07-13 07:27:10 +02:00 committed by GitHub
commit 96f166a7e9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 7 additions and 4 deletions

View File

@ -27,7 +27,6 @@ use Doctrine\DBAL\Types\Type;
use Doctrine\DBAL\Platforms\AbstractPlatform;
use ReflectionClass;
use Doctrine\Common\Persistence\Mapping\ClassMetadata;
use Doctrine\Common\ClassLoader;
use Doctrine\ORM\Cache\CacheException;
/**
@ -1025,7 +1024,11 @@ class ClassMetadataInfo implements ClassMetadata
public function validateAssociations()
{
foreach ($this->associationMappings as $mapping) {
if ( ! ClassLoader::classExists($mapping['targetEntity']) ) {
if (
! class_exists($mapping['targetEntity'])
&& ! interface_exists($mapping['targetEntity'])
&& ! trait_exists($mapping['targetEntity'])
) {
throw MappingException::invalidTargetEntityClass($mapping['targetEntity'], $this->name, $mapping['fieldName']);
}
}

View File

@ -20,7 +20,7 @@
namespace Doctrine\ORM\Tools;
use Doctrine\ORM\Mapping\ClassMetadataInfo;
use Doctrine\Common\Util\Inflector;
use Doctrine\Common\Inflector\Inflector;
use Doctrine\DBAL\Types\Type;
use Symfony\Component\Yaml\Yaml;

View File

@ -20,7 +20,7 @@
namespace Doctrine\ORM\Tools;
use Doctrine\Common\Collections\Collection;
use Doctrine\Common\Util\Inflector;
use Doctrine\Common\Inflector\Inflector;
use Doctrine\DBAL\Types\Type;
use Doctrine\ORM\Mapping\ClassMetadataInfo;