You are here

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

Set data by file name.

Parameters

array $values: Array with data.

string $file_path: Path to a source file from DRUPAL_ROOT. Supports tokens like @my_module.

File

src/ScssCompilerAlterStorage.php, line 61

Class

ScssCompilerAlterStorage
Collects alter data.

Namespace

Drupal\scss_compiler

Code

public function setByFile(array $values, $file_path) {
  $file_path = $this->scssCompiler
    ->replaceTokens($file_path);
  if ($file_path) {
    if (!isset($this->storage['file'][$file_path])) {
      $this->storage['file'][$file_path] = [];
    }
    $this->storage['file'][$file_path] = array_merge($this->storage['file'][$file_path], $values);
  }
}