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

Commit

Permalink
Merge pull request #157 from amorebietakoUdala/master
Browse files Browse the repository at this point in the history
Changes to make it work in Symfony 4
  • Loading branch information
Maks3w authored May 23, 2019
2 parents 2a539a7 + 56a4184 commit 735b3e5
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
6 changes: 3 additions & 3 deletions Security/Factory/FormLoginLdapFactory.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
use Symfony\Bundle\SecurityBundle\DependencyInjection\Security\Factory\SecurityFactoryInterface;
use Symfony\Component\Config\Definition\Builder\NodeDefinition;
use Symfony\Component\DependencyInjection\ContainerBuilder;
use Symfony\Component\DependencyInjection\DefinitionDecorator;
use Symfony\Component\DependencyInjection\Reference;
use Symfony\Component\DependencyInjection\ChildDefinition;

class FormLoginLdapFactory implements SecurityFactoryInterface
{
Expand Down Expand Up @@ -42,7 +42,7 @@ protected function createAuthProvider(ContainerBuilder $container, $id, $userPro
$providerId = $provider.'.'.$id;

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

$listener = new DefinitionDecorator($listenerId);
$listener = new ChildDefinition($listenerId);
$listener->replaceArgument(4, $id);
$listener->replaceArgument(5, $config);

Expand Down
8 changes: 4 additions & 4 deletions Security/Factory/HttpBasicLdapFactory.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@
namespace FR3D\LdapBundle\Security\Factory;

use Symfony\Bundle\SecurityBundle\DependencyInjection\Security\Factory\SecurityFactoryInterface;
use Symfony\Component\DependencyInjection\ChildDefinition;
use Symfony\Component\Config\Definition\Builder\NodeDefinition;
use Symfony\Component\DependencyInjection\ContainerBuilder;
use Symfony\Component\DependencyInjection\DefinitionDecorator;
use Symfony\Component\DependencyInjection\Reference;

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

$container
->setDefinition($providerId, new DefinitionDecorator($provider))
->setDefinition($providerId, new ChildDefinition($provider))
->replaceArgument(1, $id) // Provider Key
->replaceArgument(2, new Reference($userProviderId)) // User Provider
;
Expand All @@ -62,7 +62,7 @@ protected function createListener(ContainerBuilder $container, $id, $entryPointI
{
// listener
$listenerId = 'security.authentication.listener.basic.'.$id;
$listener = $container->setDefinition($listenerId, new DefinitionDecorator('security.authentication.listener.basic'));
$listener = $container->setDefinition($listenerId, new ChildDefinition('security.authentication.listener.basic'));
$listener->replaceArgument(2, $id);
$listener->replaceArgument(3, new Reference($entryPointId));

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

$entryPointId = 'security.authentication.basic_entry_point.'.$id;
$container
->setDefinition($entryPointId, new DefinitionDecorator('security.authentication.basic_entry_point'))
->setDefinition($entryPointId, new ChildDefinition('security.authentication.basic_entry_point'))
->addArgument($config['realm'])
;

Expand Down

0 comments on commit 735b3e5

Please sign in to comment.