Skip to content

Commit

Permalink
Merge pull request #7307 from Majkl578/remaining-deprecations
Browse files Browse the repository at this point in the history
Fix remaining usages of deprecated ClassLoader and Inflector from doctrine/common
  • Loading branch information
lcobucci committed Jul 13, 2018
2 parents 43d3081 + f4b7753 commit 96f166a
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 4 deletions.
7 changes: 5 additions & 2 deletions lib/Doctrine/ORM/Mapping/ClassMetadataInfo.php
Expand Up @@ -27,7 +27,6 @@
use Doctrine\DBAL\Platforms\AbstractPlatform;
use ReflectionClass;
use Doctrine\Common\Persistence\Mapping\ClassMetadata;
use Doctrine\Common\ClassLoader;
use Doctrine\ORM\Cache\CacheException;

/**
Expand Down Expand Up @@ -1025,7 +1024,11 @@ public function validateIdentifier()
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']);
}
}
Expand Down
2 changes: 1 addition & 1 deletion lib/Doctrine/ORM/Tools/ConvertDoctrine1Schema.php
Expand Up @@ -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;

Expand Down
2 changes: 1 addition & 1 deletion lib/Doctrine/ORM/Tools/EntityGenerator.php
Expand Up @@ -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;

Expand Down

0 comments on commit 96f166a

Please sign in to comment.