Code Duplication    Length = 25-25 lines in 2 locations

src/Package/MySqlPassportContainerConfigurator.php 1 location

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

src/Package/PostgreSqlPassportContainerConfigurator.php 1 location

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