Skip to content

Commit

Permalink
feature #144 Used DoctrineOrmMappingsPass instead of the extends (max…
Browse files Browse the repository at this point in the history
…helias)

This PR was merged into the 0.4-dev branch.

Discussion
----------

Used DoctrineOrmMappingsPass instead of the extends

DoctrineOrmMappingsPass should be final in doctrine/doctrine-bundle 3

Commits
-------

985d6a3 Used DoctrineOrmMappingsPass instead of the extends
  • Loading branch information
chalasr committed Aug 7, 2023
2 parents 552d8ee + 985d6a3 commit bcffb92
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 27 deletions.

This file was deleted.

13 changes: 11 additions & 2 deletions src/LeagueOAuth2ServerBundle.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,15 @@

namespace League\Bundle\OAuth2ServerBundle;

use Doctrine\Bundle\DoctrineBundle\DependencyInjection\Compiler\DoctrineOrmMappingsPass;
use League\Bundle\OAuth2ServerBundle\DependencyInjection\CompilerPass\EncryptionKeyPass;
use League\Bundle\OAuth2ServerBundle\DependencyInjection\CompilerPass\RegisterDoctrineOrmMappingPass;
use League\Bundle\OAuth2ServerBundle\DependencyInjection\LeagueOAuth2ServerExtension;
use League\Bundle\OAuth2ServerBundle\DependencyInjection\Security\OAuth2Factory;
use League\Bundle\OAuth2ServerBundle\Persistence\Mapping\Driver;
use Symfony\Bundle\SecurityBundle\DependencyInjection\SecurityExtension;
use Symfony\Component\DependencyInjection\ContainerBuilder;
use Symfony\Component\DependencyInjection\Extension\ExtensionInterface;
use Symfony\Component\DependencyInjection\Reference;
use Symfony\Component\HttpKernel\Bundle\Bundle;

final class LeagueOAuth2ServerBundle extends Bundle
Expand Down Expand Up @@ -56,7 +58,14 @@ private function configureSecurityExtension(ContainerBuilder $container): void

private function configureDoctrineExtension(ContainerBuilder $container): void
{
$container->addCompilerPass(new RegisterDoctrineOrmMappingPass());
$container->addCompilerPass(
new DoctrineOrmMappingsPass(
new Reference(Driver::class),
['League\Bundle\OAuth2ServerBundle\Model'],
['league.oauth2_server.persistence.doctrine.manager'],
'league.oauth2_server.persistence.doctrine.enabled'
)
);
$container->addCompilerPass(new EncryptionKeyPass());
}
}

0 comments on commit bcffb92

Please sign in to comment.