Skip to content

Commit e502c56

Browse files
committed
Merge branch '2.3' into 2.7
* 2.3: [DomCrawler] Invalid uri created from forms if base tag present [Console] update param type phpdoc for StreamOutput [Console] fix typo in OutputInterface [HttpKernel] fix broken multiline <esi:remove> [DoctrineBridge] Fixed #14840 [FrameworkBundle] add a suggest for the serializer component [Yaml] Fix the parsing of float keys [Console] Ensure the console output is only detected as decorated when both stderr and stdout support colors Improve exception messages. Fix that two DirectoryResources with different patterns would be deduplicated Tests fix clockmock [WebProfilerBundle] Added tabindex="-1" to not interfer with normal UX missing "YAML" in the exception message. [framework-bundle] Add Test for TranslationUpdateCommand Use ObjectManager interface instead of EntityManager
2 parents 2da451d + 9f0d463 commit e502c56

File tree

2 files changed

+10
-6
lines changed

2 files changed

+10
-6
lines changed

DependencyInjection/AbstractDoctrineExtension.php

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -129,11 +129,15 @@ protected function setMappingDriverAlias($mappingConfig, $mappingName)
129129
*/
130130
protected function setMappingDriverConfig(array $mappingConfig, $mappingName)
131131
{
132-
if (!is_dir($mappingConfig['dir'])) {
132+
$mappingDirectory = $mappingConfig['dir'];
133+
if (!is_dir($mappingDirectory)) {
133134
throw new \InvalidArgumentException(sprintf('Invalid Doctrine mapping path given. Cannot load Doctrine mapping/bundle named "%s".', $mappingName));
134135
}
135136

136-
$this->drivers[$mappingConfig['type']][$mappingConfig['prefix']] = realpath($mappingConfig['dir']);
137+
if (substr($mappingDirectory, 0, 7) !== 'phar://') {
138+
$mappingDirectory = realpath($mappingDirectory);
139+
}
140+
$this->drivers[$mappingConfig['type']][$mappingConfig['prefix']] = $mappingDirectory;
137141
}
138142

139143
/**

Form/ChoiceList/ORMQueryBuilderLoader.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
use Symfony\Component\Form\Exception\UnexpectedTypeException;
1515
use Doctrine\ORM\QueryBuilder;
1616
use Doctrine\DBAL\Connection;
17-
use Doctrine\ORM\EntityManager;
17+
use Doctrine\Common\Persistence\ObjectManager;
1818

1919
/**
2020
* Loads entities using a {@link QueryBuilder} instance.
@@ -43,7 +43,7 @@ class ORMQueryBuilderLoader implements EntityLoaderInterface
4343
* deprecated and will not be
4444
* supported anymore as of
4545
* Symfony 3.0.
46-
* @param EntityManager $manager Deprecated.
46+
* @param ObjectManager $manager Deprecated.
4747
* @param string $class Deprecated.
4848
*
4949
* @throws UnexpectedTypeException
@@ -59,8 +59,8 @@ public function __construct($queryBuilder, $manager = null, $class = null)
5959
if ($queryBuilder instanceof \Closure) {
6060
@trigger_error('Passing a QueryBuilder closure to '.__CLASS__.'::__construct() is deprecated since version 2.7 and will be removed in 3.0.', E_USER_DEPRECATED);
6161

62-
if (!$manager instanceof EntityManager) {
63-
throw new UnexpectedTypeException($manager, 'Doctrine\ORM\EntityManager');
62+
if (!$manager instanceof ObjectManager) {
63+
throw new UnexpectedTypeException($manager, 'Doctrine\Common\Persistence\ObjectManager');
6464
}
6565

6666
@trigger_error('Passing an EntityManager to '.__CLASS__.'::__construct() is deprecated since version 2.7 and will be removed in 3.0.', E_USER_DEPRECATED);

0 commit comments

Comments
 (0)