Code Duplication    Length = 10-13 lines in 3 locations

Security/Factory/FormLoginLdapFactory.php 1 location

@@ 47-59 (lines=13) @@
44
        // Without Configuration
45
    }
46
47
    protected function createAuthProvider(ContainerBuilder $container, $id, $userProviderId)
48
    {
49
        $provider = 'dol_ldap.security.authentication.provider';
50
        $providerId = $provider.'.'.$id;
51
52
        $container
53
            ->setDefinition($providerId, new ChildDefinition($provider))
54
            ->replaceArgument(1, $id) // Provider Key
55
            ->replaceArgument(2, new Reference($userProviderId)) // User Provider
56
        ;
57
58
        return $providerId;
59
    }
60
61
    protected function createListener(ContainerBuilder $container, $id, $config)
62
    {

Security/Factory/HttpBasicLdapFactory.php 2 locations

@@ 55-67 (lines=13) @@
52
        ;
53
    }
54
55
    protected function createAuthProvider(ContainerBuilder $container, $id, $userProviderId)
56
    {
57
        $provider = 'dol_ldap.security.authentication.provider';
58
        $providerId = $provider.'.'.$id;
59
60
        $container
61
            ->setDefinition($providerId, new ChildDefinition($provider))
62
            ->replaceArgument(1, $id) // Provider Key
63
            ->replaceArgument(2, new Reference($userProviderId)) // User Provider
64
        ;
65
66
        return $providerId;
67
    }
68
69
    protected function createListener(ContainerBuilder $container, $id, $entryPointId)
70
    {
@@ 69-78 (lines=10) @@
66
        return $providerId;
67
    }
68
69
    protected function createListener(ContainerBuilder $container, $id, $entryPointId)
70
    {
71
        // listener
72
        $listenerId = 'security.authentication.listener.basic.'.$id;
73
        $listener = $container->setDefinition($listenerId, new ChildDefinition('security.authentication.listener.basic'));
74
        $listener->replaceArgument(2, $id);
75
        $listener->replaceArgument(3, new Reference($entryPointId));
76
77
        return $listenerId;
78
    }
79
80
    protected function createEntryPoint(ContainerBuilder $container, $id, $config, $defaultEntryPoint)
81
    {