API docs:
https://api.drupal.org/api/drupal/core!lib!Drupal!Core!DependencyInjection!Container.php/11.3.x
Location: /core/lib/Drupal/Core/DependencyInjection/Container.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));
}
}