Mercurial > hg > isophonics-drupal-site
comparison core/lib/Drupal/Core/DependencyInjection/Container.php @ 0:4c8ae668cc8c
Initial import (non-working)
author | Chris Cannam |
---|---|
date | Wed, 29 Nov 2017 16:09:58 +0000 |
parents | |
children |
comparison
equal
deleted
inserted
replaced
-1:000000000000 | 0:4c8ae668cc8c |
---|---|
1 <?php | |
2 | |
3 namespace Drupal\Core\DependencyInjection; | |
4 | |
5 use Drupal\Component\DependencyInjection\Container as DrupalContainer; | |
6 | |
7 /** | |
8 * Extends the Drupal container to set the service ID on the created object. | |
9 */ | |
10 class Container extends DrupalContainer { | |
11 | |
12 /** | |
13 * {@inheritdoc} | |
14 */ | |
15 public function set($id, $service) { | |
16 parent::set($id, $service); | |
17 | |
18 // Ensure that the _serviceId property is set on synthetic services as well. | |
19 if (isset($this->services[$id]) && is_object($this->services[$id]) && !isset($this->services[$id]->_serviceId)) { | |
20 $this->services[$id]->_serviceId = $id; | |
21 } | |
22 } | |
23 | |
24 /** | |
25 * {@inheritdoc} | |
26 */ | |
27 public function __sleep() { | |
28 assert(FALSE, 'The container was serialized.'); | |
29 return array_keys(get_object_vars($this)); | |
30 } | |
31 | |
32 } |