Skip to main content
Drupal API
User account menu
  • Log in

Breadcrumb

  1. Drupal Core 11.1.x

Container.php

Same filename in this branch
  1. 11.1.x vendor/lullabot/php-webdriver/lib/WebDriver/Container.php
  2. 11.1.x vendor/symfony/dependency-injection/Container.php
  3. 11.1.x core/lib/Drupal/Core/Render/Element/Container.php
  4. 11.1.x core/lib/Drupal/Component/DependencyInjection/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.

API Navigation

  • Drupal Core 11.1.x
  • Topics
  • Classes
  • Functions
  • Constants
  • Globals
  • Files
  • Namespaces
  • Deprecated
  • Services
RSS feed
Powered by Drupal