Skip to content

Commit

Permalink
Fix remaining usages of deprecated ClassLoader and Inflector from doc…
Browse files Browse the repository at this point in the history
…trine/common
  • Loading branch information
Majkl578 committed Jul 13, 2018
1 parent 43d3081 commit f4b7753
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 f4b7753

Please sign in to comment.