Container.php

Namespace

Drupal\Core\DependencyInjection

File

core/lib/Drupal/Core/DependencyInjection/Container.php

View source
<?php

namespace Drupal\Core\DependencyInjection;

use Drupal\Component\DependencyInjection\Container as DrupalContainer;

/**
 * Extends the container to prevent serialization.
 */
class Container extends DrupalContainer {
  
  /**
   * {@inheritdoc}
   */
  public function __sleep() : array {
    assert(FALSE, 'The container was serialized.');
    return array_keys(get_object_vars($this));
  }

}

Classes

Title Deprecated Summary
Container Extends the container to prevent serialization.

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.