3 namespace Drupal\Core\DependencyInjection;
5 use Drupal\Component\DependencyInjection\Container as DrupalContainer;
8 * Extends the Drupal container to set the service ID on the created object.
10 class Container extends DrupalContainer {
15 public function set($id, $service) {
16 parent::set($id, $service);
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;
27 public function __sleep() {
28 assert(FALSE, 'The container was serialized.');
29 return array_keys(get_object_vars($this));