1 | <?php |
||
26 | class InMemoryApiFactory implements UserProviderFactoryInterface |
||
27 | { |
||
28 | /** |
||
29 | * Creates the userProvider. |
||
30 | * |
||
31 | * @param ContainerBuilder $container instance of container |
||
32 | * @param string $id the service id for concrete user provider |
||
33 | * @param array $config configuration of current factory |
||
34 | */ |
||
35 | 3 | public function create(ContainerBuilder $container, $id, $config) |
|
36 | { |
||
37 | 3 | $definition = $container->setDefinition($id, new DefinitionDecorator('oslab_security_api.security.user.provider')); |
|
|
|||
38 | |||
39 | 3 | foreach ($config['users'] as $username => $user) { |
|
40 | 3 | $userId = $id.'_'.$username; |
|
41 | |||
42 | $container |
||
43 | 3 | ->setDefinition($userId, new DefinitionDecorator('security.user.provider.in_memory.user')) |
|
44 | 3 | ->setArguments([$username, (string) $user['password'], $user['roles']]) |
|
45 | ; |
||
46 | |||
47 | 3 | $definition->addMethodCall('createUser', [new Reference($userId)]); |
|
48 | } |
||
49 | 3 | } |
|
50 | |||
51 | /** |
||
52 | * Returns the key of current factory. |
||
53 | * |
||
54 | * @return string |
||
55 | */ |
||
56 | 3 | public function getKey() |
|
60 | |||
61 | /** |
||
62 | * Adds configuration nodes to current user provider. |
||
63 | * |
||
64 | * @param NodeDefinition $node |
||
65 | */ |
||
66 | 3 | public function addConfiguration(NodeDefinition $node) |
|
89 | } |
||
90 |
This class, trait or interface has been deprecated. The supplier of the file has supplied an explanatory message.
The explanatory message should give you some clue as to whether and when the type will be removed from the class and what other constant to use instead.