Skip to content
This repository was archived by the owner on May 17, 2021. It is now read-only.

Commit 735b3e5

Browse files
authored
Merge pull request #157 from amorebietakoUdala/master
Changes to make it work in Symfony 4
2 parents 2a539a7 + 56a4184 commit 735b3e5

File tree

2 files changed

+7
-7
lines changed

2 files changed

+7
-7
lines changed

Security/Factory/FormLoginLdapFactory.php

+3-3
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@
55
use Symfony\Bundle\SecurityBundle\DependencyInjection\Security\Factory\SecurityFactoryInterface;
66
use Symfony\Component\Config\Definition\Builder\NodeDefinition;
77
use Symfony\Component\DependencyInjection\ContainerBuilder;
8-
use Symfony\Component\DependencyInjection\DefinitionDecorator;
98
use Symfony\Component\DependencyInjection\Reference;
9+
use Symfony\Component\DependencyInjection\ChildDefinition;
1010

1111
class FormLoginLdapFactory implements SecurityFactoryInterface
1212
{
@@ -42,7 +42,7 @@ protected function createAuthProvider(ContainerBuilder $container, $id, $userPro
4242
$providerId = $provider.'.'.$id;
4343

4444
$container
45-
->setDefinition($providerId, new DefinitionDecorator($provider))
45+
->setDefinition($providerId, new ChildDefinition($provider))
4646
->replaceArgument(1, $id) // Provider Key
4747
->replaceArgument(2, new Reference($userProviderId)) // User Provider
4848
;
@@ -54,7 +54,7 @@ protected function createListener(ContainerBuilder $container, $id, $config)
5454
{
5555
$listenerId = 'security.authentication.listener.form';
5656

57-
$listener = new DefinitionDecorator($listenerId);
57+
$listener = new ChildDefinition($listenerId);
5858
$listener->replaceArgument(4, $id);
5959
$listener->replaceArgument(5, $config);
6060

Security/Factory/HttpBasicLdapFactory.php

+4-4
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,9 @@
33
namespace FR3D\LdapBundle\Security\Factory;
44

55
use Symfony\Bundle\SecurityBundle\DependencyInjection\Security\Factory\SecurityFactoryInterface;
6+
use Symfony\Component\DependencyInjection\ChildDefinition;
67
use Symfony\Component\Config\Definition\Builder\NodeDefinition;
78
use Symfony\Component\DependencyInjection\ContainerBuilder;
8-
use Symfony\Component\DependencyInjection\DefinitionDecorator;
99
use Symfony\Component\DependencyInjection\Reference;
1010

1111
class HttpBasicLdapFactory implements SecurityFactoryInterface
@@ -50,7 +50,7 @@ protected function createAuthProvider(ContainerBuilder $container, $id, $userPro
5050
$providerId = $provider.'.'.$id;
5151

5252
$container
53-
->setDefinition($providerId, new DefinitionDecorator($provider))
53+
->setDefinition($providerId, new ChildDefinition($provider))
5454
->replaceArgument(1, $id) // Provider Key
5555
->replaceArgument(2, new Reference($userProviderId)) // User Provider
5656
;
@@ -62,7 +62,7 @@ protected function createListener(ContainerBuilder $container, $id, $entryPointI
6262
{
6363
// listener
6464
$listenerId = 'security.authentication.listener.basic.'.$id;
65-
$listener = $container->setDefinition($listenerId, new DefinitionDecorator('security.authentication.listener.basic'));
65+
$listener = $container->setDefinition($listenerId, new ChildDefinition('security.authentication.listener.basic'));
6666
$listener->replaceArgument(2, $id);
6767
$listener->replaceArgument(3, new Reference($entryPointId));
6868

@@ -77,7 +77,7 @@ protected function createEntryPoint(ContainerBuilder $container, $id, $config, $
7777

7878
$entryPointId = 'security.authentication.basic_entry_point.'.$id;
7979
$container
80-
->setDefinition($entryPointId, new DefinitionDecorator('security.authentication.basic_entry_point'))
80+
->setDefinition($entryPointId, new ChildDefinition('security.authentication.basic_entry_point'))
8181
->addArgument($config['realm'])
8282
;
8383

0 commit comments

Comments
 (0)