1 | <?php |
||
32 | class ContainerHydrator |
||
33 | { |
||
34 | /** |
||
35 | * Populate the container with items from config |
||
36 | * |
||
37 | * @param ContainerInterface $container |
||
38 | * @param array|Traversable $config |
||
39 | */ |
||
40 | 12 | public function populate(ContainerInterface $container, $config) |
|
54 | |||
55 | 10 | protected function populateFromTraversable($container, $traversable) |
|
61 | |||
62 | /** |
||
63 | * Create a definition from a config entry |
||
64 | * |
||
65 | * @param ContainerInterface $container |
||
66 | * @param mixed $options |
||
67 | * @param string $alias |
||
68 | * |
||
69 | */ |
||
70 | 9 | protected function createDefinition(ContainerInterface $container, $options, $alias) |
|
87 | |||
88 | 3 | protected function addDefinitionArguments(DefinitionInterface $definition, $options) |
|
89 | { |
||
90 | 3 | $arguments = []; |
|
91 | |||
92 | 3 | if (is_array($options)) { |
|
93 | 3 | $arguments = (array_key_exists('arguments', $options)) ? (array)$options['arguments'] : []; |
|
94 | 3 | } |
|
95 | |||
96 | 3 | $definition->withArguments($arguments); |
|
97 | 3 | } |
|
98 | |||
99 | 2 | protected function addDefinitionMethods(ClassDefinition $definition, $options) |
|
100 | { |
||
101 | 2 | $methods = []; |
|
102 | |||
103 | 2 | if (is_array($options)) { |
|
104 | 2 | $methods = (array_key_exists('methods', $options)) ? (array)$options['methods'] : []; |
|
105 | 2 | } |
|
106 | |||
107 | 2 | $definition->withMethodCalls($methods); |
|
108 | 2 | } |
|
109 | |||
110 | /** |
||
111 | * Resolves the concrete class |
||
112 | * |
||
113 | * @param mixed $concrete |
||
114 | * |
||
115 | * @return mixed |
||
116 | */ |
||
117 | 9 | protected function resolveConcrete($concrete) |
|
133 | } |
||
134 |