@@ 123-135 (lines=13) @@ | ||
120 | * - machine_format: Whether this container definition uses the optimized |
|
121 | * machine-readable container format. |
|
122 | */ |
|
123 | public function __construct(array $container_definition = array()) { |
|
124 | if (!empty($container_definition) && (!isset($container_definition['machine_format']) || $container_definition['machine_format'] !== TRUE)) { |
|
125 | throw new InvalidArgumentException('The non-optimized format is not supported by this class. Use an optimized machine-readable format instead, e.g. as produced by \Drupal\Component\DependencyInjection\Dumper\OptimizedPhpArrayDumper.'); |
|
126 | } |
|
127 | ||
128 | $this->aliases = isset($container_definition['aliases']) ? $container_definition['aliases'] : array(); |
|
129 | $this->parameters = isset($container_definition['parameters']) ? $container_definition['parameters'] : array(); |
|
130 | $this->serviceDefinitions = isset($container_definition['services']) ? $container_definition['services'] : array(); |
|
131 | $this->frozen = isset($container_definition['frozen']) ? $container_definition['frozen'] : FALSE; |
|
132 | ||
133 | // Register the service_container with itself. |
|
134 | $this->services['service_container'] = $this; |
|
135 | } |
|
136 | ||
137 | /** |
|
138 | * {@inheritdoc} |
@@ 34-48 (lines=15) @@ | ||
31 | /** |
|
32 | * {@inheritdoc} |
|
33 | */ |
|
34 | public function __construct(array $container_definition = array()) { |
|
35 | if (isset($container_definition['machine_format']) && $container_definition['machine_format'] === TRUE) { |
|
36 | throw new InvalidArgumentException('The machine-optimized format is not supported by this class. Use a human-readable format instead, e.g. as produced by \Drupal\Component\DependencyInjection\Dumper\PhpArrayDumper.'); |
|
37 | } |
|
38 | ||
39 | // Do not call the parent's constructor as it would bail on the |
|
40 | // machine-optimized format. |
|
41 | $this->aliases = isset($container_definition['aliases']) ? $container_definition['aliases'] : array(); |
|
42 | $this->parameters = isset($container_definition['parameters']) ? $container_definition['parameters'] : array(); |
|
43 | $this->serviceDefinitions = isset($container_definition['services']) ? $container_definition['services'] : array(); |
|
44 | $this->frozen = isset($container_definition['frozen']) ? $container_definition['frozen'] : FALSE; |
|
45 | ||
46 | // Register the service_container with itself. |
|
47 | $this->services['service_container'] = $this; |
|
48 | } |
|
49 | ||
50 | /** |
|
51 | * {@inheritdoc} |