Skip to content

Commit

Permalink
Merge pull request #422 from filakhtov/doctrine-persistence-1-3-compat
Browse files Browse the repository at this point in the history
Enable compatibility with doctrine/persistence 1.3+
  • Loading branch information
eigan authored Jan 8, 2020
2 parents aabee24 + 555c809 commit deb9b76
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 3 deletions.
3 changes: 0 additions & 3 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -38,9 +38,6 @@
"illuminate/notifications": "5.5.*|5.6.*|5.7.*|5.8.*",
"illuminate/queue": "5.5.*|5.6.*|5.7.*|5.8.*"
},
"conflict": {
"doctrine/persistence": ">=1.3@dev"
},
"autoload": {
"psr-4": {
"LaravelDoctrine\\ORM\\": "src/"
Expand Down
3 changes: 3 additions & 0 deletions src/DoctrineServiceProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -160,6 +160,9 @@ protected function registerManagerRegistry()

$this->app->alias('registry', ManagerRegistry::class);
$this->app->alias('registry', IlluminateRegistry::class);

// This alias is required for compatibility with doctrine/persistence 1.3+
$this->app->alias(ManagerRegistry::class, \Doctrine\Persistence\ManagerRegistry::class);
}

/**
Expand Down
2 changes: 2 additions & 0 deletions tests/Middleware/SubstituteBindingsTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,8 @@ protected function getRouter()
return $router;
});

$container->alias(ManagerRegistry::class, \Doctrine\Persistence\ManagerRegistry::class);

$container->singleton(ManagerRegistry::class, function () {
return $this->registry;
});
Expand Down

0 comments on commit deb9b76

Please sign in to comment.