Roave / psr-container-doctrine

Doctrine Factories for PSR-11 Containers
BSD 2-Clause "Simplified" License
95 stars 32 forks source link

Fix namespace of MappingDriverChain in example #48

Closed rieschl closed 3 years ago

rieschl commented 3 years ago

Since doctrine/persistence 1.3.0 the namespace of the package was moved from Doctrine\Common\Persistence to Doctrine\Persistence. The forward compatibility classes were removed in 2.0.0.

This fix changes the namespace to the new one, which should work in doctrine/persistence >= 1.3.0

asgrim commented 3 years ago

@rieschl Do we need a class alias for this to work in both older and newer dependencies?

rieschl commented 3 years ago

@asgrim The class-aliases were added in doctrine/peristence 1.3.0, so we shouldn't need them here. But maybe we should add a dependency for doctrine/persistence in composer.json to reflect that. Implicitly, doctrine/peristence >= 1.3.0 is required anyways because the DriverFactory uses them already.

edit: composer-require-checker tells me the same 🙂

$ vendor/bin/composer-require-checker
ComposerRequireChecker 3.3.0@4063254c611acf34f1c15b29b6bcc47d2e7a9a9e
The following 19 unknown symbols were found:
+--------------------------------------------------------+--------------------+
| Unknown Symbol                                         | Guessed Dependency |
+--------------------------------------------------------+--------------------+
| Doctrine\Common\Annotations\AnnotationReader           |                    |
| Doctrine\Common\Annotations\AnnotationRegistry         |                    |
| Doctrine\Common\Annotations\CachedReader               |                    |
| Doctrine\Common\Cache\ApcuCache                        |                    |
| Doctrine\Common\Cache\ArrayCache                       |                    |
| Doctrine\Common\Cache\CacheProvider                    |                    |
| Doctrine\Common\Cache\ChainCache                       |                    |
| Doctrine\Common\Cache\FilesystemCache                  |                    |
| Doctrine\Common\Cache\MemcachedCache                   |                    |
| Doctrine\Common\Cache\PhpFileCache                     |                    |
| Doctrine\Common\Cache\PredisCache                      |                    |
| Doctrine\Common\Cache\RedisCache                       |                    |
| Doctrine\Common\Cache\WinCacheCache                    |                    |
| Doctrine\Common\Cache\ZendDataCache                    |                    |
| Doctrine\Common\EventManager                           |                    |
| Doctrine\Common\EventSubscriber                        |                    |
| Doctrine\Persistence\Mapping\Driver\AnnotationDriver   |                    |
| Doctrine\Persistence\Mapping\Driver\FileDriver         |                    |
| Doctrine\Persistence\Mapping\Driver\MappingDriverChain |                    |
+--------------------------------------------------------+--------------------+
asgrim commented 3 years ago

@rieschl yeah OK, I'm a fan of adding the dependency (given we had a similar issue in #46 too because of implicit dependencies), so lets do that please and this is good to go I think :+1:

rieschl commented 3 years ago

alright. I should rebase the PR to 3.1.x, right?

asgrim commented 3 years ago

alright. I should rebase the PR to 3.1.x, right?

ah, yes please :)

asgrim commented 3 years ago

Thanks @rieschl !