class RefineableCompilerContext in Compiler 1.0.x
A refineable compiler context used to define a compilation.
Inputs can be modified using array access functionality provided by PHP.
Copyright (C) 2021 Library Solutions, LLC (et al.).
This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.
Hierarchy
- class \Drupal\compiler\CompilerContext implements CompilerContextInterface
- class \Drupal\compiler\RefineableCompilerContext implements RefineableCompilerContextInterface
Expanded class hierarchy of RefineableCompilerContext
File
- src/
RefineableCompilerContext.php, line 17
Namespace
Drupal\compilerView source
class RefineableCompilerContext extends CompilerContext implements RefineableCompilerContextInterface {
/**
* {@inheritdoc}
*/
public function offsetExists($offset) : bool {
return isset($this->inputs[$offset]);
}
/**
* {@inheritdoc}
*/
public function &offsetGet($offset) {
if (isset($this->inputs[$offset])) {
return $this->inputs[$offset];
}
}
/**
* {@inheritdoc}
*/
public function offsetSet($offset, $value) : void {
if (!is_null($offset)) {
$this->inputs[$offset] = $value;
}
else {
$this->inputs[] = $value;
}
}
/**
* {@inheritdoc}
*/
public function offsetUnset($offset) : void {
unset($this->inputs[$offset]);
}
/**
* {@inheritdoc}
*/
public function setCompiler(string $compiler) : self {
$this->compiler = $compiler;
return $this;
}
/**
* {@inheritdoc}
*/
public function setData($data) : self {
$this->data = $data;
return $this;
}
/**
* {@inheritdoc}
*/
public function setOption(string $name, $value) : self {
$this->options[$name] = $value;
return $this;
}
/**
* {@inheritdoc}
*/
public function setOptions(array $options) : self {
$this->options = $options;
return $this;
}
}
Members
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
CompilerContext:: |
protected | property | The machine name of the compiler plugin to use. | |
CompilerContext:: |
protected | property | Arbitrary user-defined data to provide to the compiler. | |
CompilerContext:: |
protected | property | An array of compiler inputs. | |
CompilerContext:: |
protected | property | An associative array of compiler plugin configuration options. | |
CompilerContext:: |
protected | function | Create a filtered input iterator using the supplied compiler inputs. | |
CompilerContext:: |
public | function |
Get the machine name of the compiler plugin to use. Overrides CompilerContextInterface:: |
|
CompilerContext:: |
public | function |
Get arbitrary user-defined data to provide to the compiler. Overrides CompilerContextInterface:: |
|
CompilerContext:: |
public | function |
Get an interator containing the compiler inputs. Overrides CompilerContextInterface:: |
|
CompilerContext:: |
public | function |
Get a specific compiler plugin configuration option. Overrides CompilerContextInterface:: |
|
CompilerContext:: |
public | function |
Get an associative array of compiler plugin configuration options. Overrides CompilerContextInterface:: |
|
CompilerContext:: |
public | function | Constructs a CompilerContext object. | |
RefineableCompilerContext:: |
public | function | ||
RefineableCompilerContext:: |
public | function | ||
RefineableCompilerContext:: |
public | function | ||
RefineableCompilerContext:: |
public | function | ||
RefineableCompilerContext:: |
public | function |
Set the machine name of the compiler plugin to use for this context. Overrides RefineableCompilerContextInterface:: |
|
RefineableCompilerContext:: |
public | function |
Set the user-defined data to use for this context. Overrides RefineableCompilerContextInterface:: |
|
RefineableCompilerContext:: |
public | function |
Set a specific option to use for this context. Overrides RefineableCompilerContextInterface:: |
|
RefineableCompilerContext:: |
public | function |
Set the options to use for this context. Overrides RefineableCompilerContextInterface:: |