You are here

public function ScssCompilerAlterStorage::unset in SCSS/Less Compiler 8

Removes variable from the storage.

Parameters

string $type: Storage type, file or namespace.

string $path: Depends on the type. Module/theme name or file path.

string $key: Key to delete. If omitted, all keys from given path will be deleted.

File

src/ScssCompilerAlterStorage.php, line 128

Class

ScssCompilerAlterStorage
Collects alter data.

Namespace

Drupal\scss_compiler

Code

public function unset($type, $path, $key = NULL) {
  if (isset($this->storage[$type][$path])) {
    if ($key) {
      if (isset($this->storage[$type][$path][$key])) {
        unset($this->storage[$type][$path][$key]);
      }
    }
    else {
      unset($this->storage[$type][$path]);
    }
  }
}