You are here

interface CompilerContextInterface in Compiler 1.0.x

A compiler context used to define a compilation.

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

Expanded class hierarchy of CompilerContextInterface

All classes that implement CompilerContextInterface

1 file declares its use of CompilerContextInterface
CompilerPluginInterface.php in src/Plugin/CompilerPluginInterface.php

File

src/CompilerContextInterface.php, line 15

Namespace

Drupal\compiler
View source
interface CompilerContextInterface {

  /**
   * Get the machine name of the compiler plugin to use.
   *
   * @return string
   *   The machine name of the compiler plugin to use.
   */
  public function getCompiler() : string;

  /**
   * Get arbitrary user-defined data to provide to the compiler.
   *
   * @return mixed
   *   Arbitrary user-defined data to provide to the compiler.
   */
  public function getData();

  /**
   * Get an interator containing the compiler inputs.
   *
   * The resulting iterator will contain a copy of the input array at the time
   * when this method was invoked. The iterator will flatten the structure of
   * the input array and only return valid input values.
   *
   * For refineable contexts, this method should be used for retrieving inputs
   * unless the input array needs to be modified in some way.
   *
   * @return \RecursiveCallbackFilterIterator
   *   An interator containing the compiler inputs.
   */
  public function getInputs() : \RecursiveCallbackFilterIterator;

  /**
   * Get a specific compiler plugin configuration option.
   *
   * @param string $name
   *   The name of the option.
   *
   * @return mixed
   *   A specific compiler plugin configuration option.
   */
  public function getOption(string $name);

  /**
   * Get an associative array of compiler plugin configuration options.
   *
   * @return array
   *   An associative array of compiler plugin configuration options.
   */
  public function getOptions() : array;

}

Members

Namesort descending Modifiers Type Description Overrides
CompilerContextInterface::getCompiler public function Get the machine name of the compiler plugin to use. 1
CompilerContextInterface::getData public function Get arbitrary user-defined data to provide to the compiler. 1
CompilerContextInterface::getInputs public function Get an interator containing the compiler inputs. 1
CompilerContextInterface::getOption public function Get a specific compiler plugin configuration option. 1
CompilerContextInterface::getOptions public function Get an associative array of compiler plugin configuration options. 1