abstract class ScssCompilerPluginBase in SCSS/Less Compiler 8
Defines base abstract class for ScssCompiler plugins.
Hierarchy
- class \Drupal\Component\Plugin\PluginBase implements DerivativeInspectionInterface, PluginInspectionInterface
- class \Drupal\scss_compiler\ScssCompilerPluginBase implements ContainerFactoryPluginInterface, ScssCompilerPluginInterface uses MessengerTrait, StringTranslationTrait
Expanded class hierarchy of ScssCompilerPluginBase
3 files declare their use of ScssCompilerPluginBase
- LessphpCompiler.php in src/
Plugin/ ScssCompiler/ LessphpCompiler.php - LibsassCompiler.php in src/
Plugin/ ScssCompiler/ LibsassCompiler.php - ScssphpCompiler.php in src/
Plugin/ ScssCompiler/ ScssphpCompiler.php
File
- src/
ScssCompilerPluginBase.php, line 17
Namespace
Drupal\scss_compilerView source
abstract class ScssCompilerPluginBase extends PluginBase implements ScssCompilerPluginInterface, ContainerFactoryPluginInterface {
use StringTranslationTrait;
use MessengerTrait;
/**
* The scss compiler service.
*
* @var \Drupal\scss_compiler\ScssCompilerInterface
*/
protected $scssCompiler;
/**
* The current request.
*
* @var \Symfony\Component\HttpFoundation\Request
*/
protected $request;
/**
* The file system service.
*
* @var \Drupal\Core\File\FileSystemInterface
*/
protected $fileSystem;
/**
* The module handler.
*
* @var \Drupal\Core\Extension\ModuleHandlerInterface
*/
protected $moduleHandler;
/**
* Constructs a SCSS Compiler base plugin.
*
* @param array $configuration
* A configuration array containing information about the plugin instance.
* @param string $plugin_id
* The plugin ID for the plugin instance.
* @param mixed $plugin_definition
* The plugin implementation definition.
* @param \Drupal\scss_compiler\ScssCompilerInterface $scss_compiler
* The scss compiler service.
* @param \Symfony\Component\HttpFoundation\RequestStack $request_stack
* The request stack.
* @param \Drupal\Core\File\FileSystemInterface $file_system
* The file system service.
* @param \Drupal\Core\Extension\ModuleHandlerInterface $module_handler
* The module handler.
*/
public function __construct(array $configuration, $plugin_id, $plugin_definition, ScssCompilerInterface $scss_compiler, RequestStack $request_stack, FileSystemInterface $file_system, ModuleHandlerInterface $module_handler) {
parent::__construct($configuration, $plugin_id, $plugin_definition);
$this->scssCompiler = $scss_compiler;
$this->request = $request_stack
->getCurrentRequest();
$this->fileSystem = $file_system;
$this->moduleHandler = $module_handler;
$this
->init();
}
/**
* Calls a code on plugin initialization.
*/
public function init() {
}
/**
* {@inheritdoc}
*/
public static function create(ContainerInterface $container, array $configuration, $plugin_id, $plugin_definition) {
return new static($configuration, $plugin_id, $plugin_definition, $container
->get('scss_compiler'), $container
->get('request_stack'), $container
->get('file_system'), $container
->get('module_handler'));
}
}
Members
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
MessengerTrait:: |
protected | property | The messenger. | 29 |
MessengerTrait:: |
public | function | Gets the messenger. | 29 |
MessengerTrait:: |
public | function | Sets the messenger. | |
PluginBase:: |
protected | property | Configuration information passed into the plugin. | 1 |
PluginBase:: |
protected | property | The plugin implementation definition. | 1 |
PluginBase:: |
protected | property | The plugin_id. | |
PluginBase:: |
constant | A string which is used to separate base plugin IDs from the derivative ID. | ||
PluginBase:: |
public | function |
Gets the base_plugin_id of the plugin instance. Overrides DerivativeInspectionInterface:: |
|
PluginBase:: |
public | function |
Gets the derivative_id of the plugin instance. Overrides DerivativeInspectionInterface:: |
|
PluginBase:: |
public | function |
Gets the definition of the plugin implementation. Overrides PluginInspectionInterface:: |
3 |
PluginBase:: |
public | function |
Gets the plugin_id of the plugin instance. Overrides PluginInspectionInterface:: |
|
PluginBase:: |
public | function | Determines if the plugin is configurable. | |
ScssCompilerPluginBase:: |
protected | property | The file system service. | |
ScssCompilerPluginBase:: |
protected | property | The module handler. | |
ScssCompilerPluginBase:: |
protected | property | The current request. | |
ScssCompilerPluginBase:: |
protected | property | The scss compiler service. | |
ScssCompilerPluginBase:: |
public static | function |
Creates an instance of the plugin. Overrides ContainerFactoryPluginInterface:: |
|
ScssCompilerPluginBase:: |
public | function | Calls a code on plugin initialization. | 3 |
ScssCompilerPluginBase:: |
public | function |
Constructs a SCSS Compiler base plugin. Overrides PluginBase:: |
|
ScssCompilerPluginInterface:: |
public | function | Checks if file was changed. | 3 |
ScssCompilerPluginInterface:: |
public | function | Compiles single source file. | 3 |
ScssCompilerPluginInterface:: |
public static | function | Returns status of compiler library. | 3 |
ScssCompilerPluginInterface:: |
public static | function | Returns compiler version. | 3 |
StringTranslationTrait:: |
protected | property | The string translation service. | 1 |
StringTranslationTrait:: |
protected | function | Formats a string containing a count of items. | |
StringTranslationTrait:: |
protected | function | Returns the number of plurals supported by a given language. | |
StringTranslationTrait:: |
protected | function | Gets the string translation service. | |
StringTranslationTrait:: |
public | function | Sets the string translation service to use. | 2 |
StringTranslationTrait:: |
protected | function | Translates a string to the current language or to a given language. |