@@ 32-56 (lines=25) @@ | ||
29 | /** |
|
30 | * @package Limoncello\Passport |
|
31 | */ |
|
32 | class MySqlPassportContainerConfigurator extends BasePassportContainerConfigurator implements CCI |
|
33 | { |
|
34 | /** |
|
35 | * @inheritdoc |
|
36 | */ |
|
37 | public static function configureContainer(LimoncelloContainerInterface $container): void |
|
38 | { |
|
39 | static::baseConfigureContainer($container); |
|
40 | ||
41 | $container[PassportServerIntegrationInterface::class] = function ( |
|
42 | PsrContainerInterface $container |
|
43 | ): PassportServerIntegrationInterface { |
|
44 | return new PassportServerIntegration($container); |
|
45 | }; |
|
46 | ||
47 | $container[TokenRepositoryInterface::class] = function ( |
|
48 | PsrContainerInterface $container |
|
49 | ): TokenRepositoryInterface { |
|
50 | $connection = $container->get(Connection::class); |
|
51 | $schema = $container->get(DatabaseSchemaInterface::class); |
|
52 | ||
53 | return new TokenRepository($connection, $schema); |
|
54 | }; |
|
55 | } |
|
56 | } |
|
57 |
@@ 32-56 (lines=25) @@ | ||
29 | /** |
|
30 | * @package Limoncello\Passport |
|
31 | */ |
|
32 | class PostgreSqlPassportContainerConfigurator extends BasePassportContainerConfigurator implements CCI |
|
33 | { |
|
34 | /** |
|
35 | * @inheritdoc |
|
36 | */ |
|
37 | public static function configureContainer(LimoncelloContainerInterface $container): void |
|
38 | { |
|
39 | static::baseConfigureContainer($container); |
|
40 | ||
41 | $container[PassportServerIntegrationInterface::class] = function ( |
|
42 | PsrContainerInterface $container |
|
43 | ): PassportServerIntegrationInterface { |
|
44 | return new PassportServerIntegration($container); |
|
45 | }; |
|
46 | ||
47 | $container[TokenRepositoryInterface::class] = function ( |
|
48 | PsrContainerInterface $container |
|
49 | ): TokenRepositoryInterface { |
|
50 | $connection = $container->get(Connection::class); |
|
51 | $schema = $container->get(DatabaseSchemaInterface::class); |
|
52 | ||
53 | return new TokenRepository($connection, $schema); |
|
54 | }; |
|
55 | } |
|
56 | } |
|
57 |