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

Breadcrumb

  1. Drupal Core 11.1.x
  2. MockArraySessionStorage.php

function MockArraySessionStorage::clear

Overrides SessionStorageInterface::clear

File

vendor/symfony/http-foundation/Session/Storage/MockArraySessionStorage.php, line 114

Class

MockArraySessionStorage
MockArraySessionStorage mocks the session for unit tests.

Namespace

Symfony\Component\HttpFoundation\Session\Storage

Code

public function clear() : void {
    // clear out the bags
    foreach ($this->bags as $bag) {
        $bag->clear();
    }
    // clear out the session
    $this->data = [];
    // reconnect the bags to the session
    $this->loadSession();
}

API Navigation

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