11<?php
2-
32/*
43 * This file is part of the Symfony package.
54 *
87 * For the full copyright and license information, please view the LICENSE
98 * file that was distributed with this source code.
109 */
11-
1210namespace Propel \Bundle \PropelBundle \DependencyInjection \Security \UserProvider ;
1311
1412use Symfony \Bundle \SecurityBundle \DependencyInjection \Security \UserProvider \UserProviderFactoryInterface ;
1513use Symfony \Component \Config \Definition \Builder \NodeDefinition ;
14+ use Symfony \Component \DependencyInjection \ChildDefinition ;
1615use Symfony \Component \DependencyInjection \ContainerBuilder ;
17- use Symfony \Component \DependencyInjection \DefinitionDecorator ;
18-
1916/**
2017 * PropelFactory creates services for Propel user provider.
2118 *
@@ -25,44 +22,29 @@ class PropelFactory implements UserProviderFactoryInterface
2522{
2623 private $ key ;
2724 private $ providerId ;
28-
29- /**
30- * Constructor.
31- *
32- * @param string $key
33- * @param string $providerId
34- */
3525 public function __construct ($ key , $ providerId )
3626 {
3727 $ this ->key = $ key ;
3828 $ this ->providerId = $ providerId ;
3929 }
40-
4130 public function create (ContainerBuilder $ container , $ id , $ config )
4231 {
4332 $ container
44- ->setDefinition ($ id , new DefinitionDecorator ($ this ->providerId ))
33+ ->setDefinition ($ id , new ChildDefinition ($ this ->providerId ))
4534 ->addArgument ($ config ['class ' ])
4635 ->addArgument ($ config ['property ' ])
4736 ;
4837 }
49-
5038 public function getKey ()
5139 {
5240 return $ this ->key ;
5341 }
54-
5542 public function addConfiguration (NodeDefinition $ node )
5643 {
5744 $ node
5845 ->children ()
59- ->scalarNode ('class ' )
60- ->isRequired ()
61- ->cannotBeEmpty ()
62- ->end ()
63- ->scalarNode ('property ' )
64- ->defaultNull ()
65- ->end ()
46+ ->scalarNode ('class ' )->isRequired ()->cannotBeEmpty ()->end ()
47+ ->scalarNode ('property ' )->defaultNull ()->end ()
6648 ->end ()
6749 ;
6850 }
0 commit comments