Skip to content

Commit ce5dcb9

Browse files
Require doctrine/persistence ^1.3
1 parent 80d15cd commit ce5dcb9

31 files changed

+67
-136
lines changed

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
"php": "^7.1.3",
2020
"ext-xml": "*",
2121
"doctrine/event-manager": "~1.0",
22-
"doctrine/persistence": "~1.0",
22+
"doctrine/persistence": "^1.3",
2323
"fig/link-util": "^1.0",
2424
"twig/twig": "^1.41|^2.10",
2525
"psr/cache": "~1.0",

src/Symfony/Bridge/Doctrine/CacheWarmer/ProxyCacheWarmer.php

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@
1111

1212
namespace Symfony\Bridge\Doctrine\CacheWarmer;
1313

14-
use Doctrine\Common\Persistence\ManagerRegistry as LegacyManagerRegistry;
1514
use Doctrine\Persistence\ManagerRegistry;
1615
use Symfony\Component\HttpKernel\CacheWarmer\CacheWarmerInterface;
1716

@@ -27,10 +26,7 @@ class ProxyCacheWarmer implements CacheWarmerInterface
2726
{
2827
private $registry;
2928

30-
/**
31-
* @param ManagerRegistry|LegacyManagerRegistry $registry
32-
*/
33-
public function __construct($registry)
29+
public function __construct(ManagerRegistry $registry)
3430
{
3531
$this->registry = $registry;
3632
}

src/Symfony/Bridge/Doctrine/DataCollector/DoctrineDataCollector.php

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@
1111

1212
namespace Symfony\Bridge\Doctrine\DataCollector;
1313

14-
use Doctrine\Common\Persistence\ManagerRegistry as LegacyManagerRegistry;
1514
use Doctrine\DBAL\Logging\DebugStack;
1615
use Doctrine\DBAL\Types\ConversionException;
1716
use Doctrine\DBAL\Types\Type;
@@ -36,10 +35,7 @@ class DoctrineDataCollector extends DataCollector
3635
*/
3736
private $loggers = [];
3837

39-
/**
40-
* @param ManagerRegistry|LegacyManagerRegistry $registry
41-
*/
42-
public function __construct($registry)
38+
public function __construct(ManagerRegistry $registry)
4339
{
4440
$this->registry = $registry;
4541
$this->connections = $registry->getConnectionNames();

src/Symfony/Bridge/Doctrine/Form/ChoiceList/DoctrineChoiceLoader.php

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@
1111

1212
namespace Symfony\Bridge\Doctrine\Form\ChoiceList;
1313

14-
use Doctrine\Common\Persistence\ObjectManager as LegacyObjectManager;
1514
use Doctrine\Persistence\ObjectManager;
1615
use Symfony\Component\Form\ChoiceList\ArrayChoiceList;
1716
use Symfony\Component\Form\ChoiceList\ChoiceListInterface;
@@ -41,12 +40,11 @@ class DoctrineChoiceLoader implements ChoiceLoaderInterface
4140
* passed which optimizes the object loading for one of the Doctrine
4241
* mapper implementations.
4342
*
44-
* @param ObjectManager|LegacyObjectManager $manager The object manager
45-
* @param string $class The class name of the loaded objects
46-
* @param IdReader $idReader The reader for the object IDs
47-
* @param EntityLoaderInterface|null $objectLoader The objects loader
43+
* @param string $class The class name of the loaded objects
44+
* @param IdReader $idReader The reader for the object IDs
45+
* @param EntityLoaderInterface|null $objectLoader The objects loader
4846
*/
49-
public function __construct($manager, string $class, IdReader $idReader = null, EntityLoaderInterface $objectLoader = null)
47+
public function __construct(ObjectManager $manager, string $class, IdReader $idReader = null, EntityLoaderInterface $objectLoader = null)
5048
{
5149
$classMetadata = $manager->getClassMetadata($class);
5250

src/Symfony/Bridge/Doctrine/Form/ChoiceList/IdReader.php

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,6 @@
1111

1212
namespace Symfony\Bridge\Doctrine\Form\ChoiceList;
1313

14-
use Doctrine\Common\Persistence\Mapping\ClassMetadata as LegacyClassMetadata;
15-
use Doctrine\Common\Persistence\ObjectManager as LegacyObjectManager;
1614
use Doctrine\Persistence\Mapping\ClassMetadata;
1715
use Doctrine\Persistence\ObjectManager;
1816
use Symfony\Component\Form\Exception\RuntimeException;
@@ -37,11 +35,7 @@ class IdReader
3735
*/
3836
private $associationIdReader;
3937

40-
/**
41-
* @param ObjectManager|LegacyObjectManager $om
42-
* @param ClassMetadata|LegacyClassMetadata $classMetadata
43-
*/
44-
public function __construct($om, $classMetadata)
38+
public function __construct(ObjectManager $om, ClassMetadata $classMetadata)
4539
{
4640
$ids = $classMetadata->getIdentifierFieldNames();
4741
$idType = $classMetadata->getTypeOfField(current($ids));

src/Symfony/Bridge/Doctrine/Form/DoctrineOrmExtension.php

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@
1111

1212
namespace Symfony\Bridge\Doctrine\Form;
1313

14-
use Doctrine\Common\Persistence\ManagerRegistry as LegacyManagerRegistry;
1514
use Doctrine\Persistence\ManagerRegistry;
1615
use Symfony\Bridge\Doctrine\Form\Type\EntityType;
1716
use Symfony\Component\Form\AbstractExtension;
@@ -20,10 +19,7 @@ class DoctrineOrmExtension extends AbstractExtension
2019
{
2120
protected $registry;
2221

23-
/**
24-
* @param ManagerRegistry|LegacyManagerRegistry $registry
25-
*/
26-
public function __construct($registry)
22+
public function __construct(ManagerRegistry $registry)
2723
{
2824
$this->registry = $registry;
2925
}

src/Symfony/Bridge/Doctrine/Form/DoctrineOrmTypeGuesser.php

Lines changed: 4 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -11,14 +11,12 @@
1111

1212
namespace Symfony\Bridge\Doctrine\Form;
1313

14-
use Doctrine\Common\Persistence\ManagerRegistry as LegacyManagerRegistry;
15-
use Doctrine\Common\Persistence\Mapping\MappingException as LegacyCommonMappingException;
16-
use Doctrine\Common\Persistence\Proxy;
1714
use Doctrine\DBAL\Types\Type;
1815
use Doctrine\ORM\Mapping\ClassMetadataInfo;
1916
use Doctrine\ORM\Mapping\MappingException as LegacyMappingException;
2017
use Doctrine\Persistence\ManagerRegistry;
2118
use Doctrine\Persistence\Mapping\MappingException;
19+
use Doctrine\Persistence\Proxy;
2220
use Symfony\Component\Form\FormTypeGuesserInterface;
2321
use Symfony\Component\Form\Guess\Guess;
2422
use Symfony\Component\Form\Guess\TypeGuess;
@@ -30,10 +28,7 @@ class DoctrineOrmTypeGuesser implements FormTypeGuesserInterface
3028

3129
private $cache = [];
3230

33-
/**
34-
* @param ManagerRegistry|LegacyManagerRegistry $registry
35-
*/
36-
public function __construct($registry)
31+
public function __construct(ManagerRegistry $registry)
3732
{
3833
$this->registry = $registry;
3934
}
@@ -187,8 +182,6 @@ protected function getMetadata($class)
187182
return $this->cache[$class] = [$em->getClassMetadata($class), $name];
188183
} catch (MappingException $e) {
189184
// not an entity or mapped super class
190-
} catch (LegacyCommonMappingException $e) {
191-
// not an entity or mapped super class
192185
} catch (LegacyMappingException $e) {
193186
// not an entity or mapped super class, using Doctrine ORM 2.2
194187
}
@@ -199,12 +192,10 @@ protected function getMetadata($class)
199192

200193
private static function getRealClass(string $class): string
201194
{
202-
$marker = interface_exists(Proxy::class) ? '\\'.Proxy::MARKER.'\\' : '\__CG__\\';
203-
204-
if (false === $pos = strrpos($class, $marker)) {
195+
if (false === $pos = strrpos($class, '\\'.Proxy::MARKER.'\\')) {
205196
return $class;
206197
}
207198

208-
return substr($class, $pos + \strlen($marker));
199+
return substr($class, $pos + Proxy::MARKER_LENGTH + 2);
209200
}
210201
}

src/Symfony/Bridge/Doctrine/Form/Type/DoctrineType.php

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,6 @@
1212
namespace Symfony\Bridge\Doctrine\Form\Type;
1313

1414
use Doctrine\Common\Collections\Collection;
15-
use Doctrine\Common\Persistence\ManagerRegistry as LegacyManagerRegistry;
16-
use Doctrine\Common\Persistence\ObjectManager as LegacyObjectManager;
1715
use Doctrine\Persistence\ManagerRegistry;
1816
use Doctrine\Persistence\ObjectManager;
1917
use Symfony\Bridge\Doctrine\Form\ChoiceList\DoctrineChoiceLoader;
@@ -103,10 +101,7 @@ public function getQueryBuilderPartsForCachingHash($queryBuilder)
103101
return false;
104102
}
105103

106-
/**
107-
* @param ManagerRegistry|LegacyManagerRegistry $registry
108-
*/
109-
public function __construct($registry)
104+
public function __construct(ManagerRegistry $registry)
110105
{
111106
$this->registry = $registry;
112107
}
@@ -197,7 +192,7 @@ public function configureOptions(OptionsResolver $resolver)
197192

198193
$emNormalizer = function (Options $options, $em) {
199194
if (null !== $em) {
200-
if ($em instanceof ObjectManager || $em instanceof LegacyObjectManager) {
195+
if ($em instanceof ObjectManager) {
201196
return $em;
202197
}
203198

@@ -267,7 +262,7 @@ public function configureOptions(OptionsResolver $resolver)
267262
$resolver->setNormalizer('query_builder', $queryBuilderNormalizer);
268263
$resolver->setNormalizer('id_reader', $idReaderNormalizer);
269264

270-
$resolver->setAllowedTypes('em', ['null', 'string', ObjectManager::class, LegacyObjectManager::class]);
265+
$resolver->setAllowedTypes('em', ['null', 'string', ObjectManager::class]);
271266
}
272267

273268
/**
@@ -278,7 +273,7 @@ public function configureOptions(OptionsResolver $resolver)
278273
*
279274
* @return EntityLoaderInterface
280275
*/
281-
abstract public function getLoader(LegacyObjectManager $manager, $queryBuilder, $class);
276+
abstract public function getLoader(ObjectManager $manager, $queryBuilder, $class);
282277

283278
public function getParent()
284279
{

src/Symfony/Bridge/Doctrine/Form/Type/EntityType.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,9 @@
1111

1212
namespace Symfony\Bridge\Doctrine\Form\Type;
1313

14-
use Doctrine\Common\Persistence\ObjectManager as LegacyObjectManager;
1514
use Doctrine\ORM\Query\Parameter;
1615
use Doctrine\ORM\QueryBuilder;
16+
use Doctrine\Persistence\ObjectManager;
1717
use Symfony\Bridge\Doctrine\Form\ChoiceList\ORMQueryBuilderLoader;
1818
use Symfony\Component\Form\Exception\UnexpectedTypeException;
1919
use Symfony\Component\OptionsResolver\Options;
@@ -51,7 +51,7 @@ public function configureOptions(OptionsResolver $resolver)
5151
*
5252
* @return ORMQueryBuilderLoader
5353
*/
54-
public function getLoader(LegacyObjectManager $manager, $queryBuilder, $class)
54+
public function getLoader(ObjectManager $manager, $queryBuilder, $class)
5555
{
5656
return new ORMQueryBuilderLoader($queryBuilder);
5757
}

src/Symfony/Bridge/Doctrine/ManagerRegistry.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111

1212
namespace Symfony\Bridge\Doctrine;
1313

14-
use Doctrine\Common\Persistence\AbstractManagerRegistry as LegacyAbstractManagerRegistry;
14+
use Doctrine\Persistence\AbstractManagerRegistry;
1515
use ProxyManager\Proxy\LazyLoadingInterface;
1616
use Symfony\Component\DependencyInjection\Container;
1717

@@ -20,7 +20,7 @@
2020
*
2121
* @author Lukas Kahwe Smith <smith@pooteeweet.org>
2222
*/
23-
abstract class ManagerRegistry extends LegacyAbstractManagerRegistry
23+
abstract class ManagerRegistry extends AbstractManagerRegistry
2424
{
2525
/**
2626
* @var Container

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy