You are here

class GenerateProxyClassApplication in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 core/lib/Drupal/Core/Command/GenerateProxyClassApplication.php \Drupal\Core\Command\GenerateProxyClassApplication

Provides a console command to generate proxy classes.

Hierarchy

Expanded class hierarchy of GenerateProxyClassApplication

1 file declares its use of GenerateProxyClassApplication
generate-proxy-class.php in core/scripts/generate-proxy-class.php

File

core/lib/Drupal/Core/Command/GenerateProxyClassApplication.php, line 17
Contains \Drupal\Core\Command\GenerateProxyClassApplication.

Namespace

Drupal\Core\Command
View source
class GenerateProxyClassApplication extends Application {

  /**
   * The proxy builder.
   *
   * @var \Drupal\Component\ProxyBuilder\ProxyBuilder
   */
  protected $proxyBuilder;

  /**
   * Constructs a new GenerateProxyClassApplication instance.
   *
   * @param \Drupal\Component\ProxyBuilder\ProxyBuilder $proxy_builder
   *   The proxy builder.
   */
  public function __construct(ProxyBuilder $proxy_builder) {
    $this->proxyBuilder = $proxy_builder;
    parent::__construct();
  }

  /**
   * {@inheritdoc}
   */
  protected function getCommandName(InputInterface $input) {
    return 'generate-proxy-class';
  }

  /**
   * {@inheritdoc}
   */
  protected function getDefaultCommands() {

    // Even though this is a single command, keep the HelpCommand (--help).
    $default_commands = parent::getDefaultCommands();
    $default_commands[] = new GenerateProxyClassCommand($this->proxyBuilder);
    return $default_commands;
  }

  /**
   * {@inheritdoc}
   *
   * Overridden so the application doesn't expect the command name as the first
   * argument.
   */
  public function getDefinition() {
    $definition = parent::getDefinition();

    // Clears the normal first argument (the command name).
    $definition
      ->setArguments();
    return $definition;
  }

}

Members

Namesort descending Modifiers Type Description Overrides
Application::$autoExit private property
Application::$catchExceptions private property
Application::$commands private property
Application::$defaultCommand private property
Application::$definition private property
Application::$dispatcher private property
Application::$helperSet private property
Application::$name private property
Application::$runningCommand private property
Application::$terminalDimensions private property
Application::$version private property
Application::$wantHelps private property
Application::add public function Adds a command object.
Application::addCommands public function Adds an array of command objects.
Application::all public function Gets the commands (registered in the given namespace if provided).
Application::asText Deprecated public function Returns a text representation of the Application.
Application::asXml Deprecated public function Returns an XML representation of the Application.
Application::configureIO protected function Configures the input and output instances based on the user arguments and options.
Application::doRun public function Runs the current application.
Application::doRunCommand protected function Runs the current command.
Application::extractAllNamespaces private function Returns all namespaces of the command name.
Application::extractNamespace public function Returns the namespace part of the command name.
Application::find public function Finds a command by name or alias.
Application::findAlternatives private function Finds alternative of $name among $collection, if nothing is found in $collection, try in $abbrevs.
Application::findNamespace public function Finds a registered namespace by a name or an abbreviation.
Application::get public function Returns a registered command by name or alias.
Application::getAbbreviations public static function Returns an array of possible abbreviations given a set of names.
Application::getAbbreviationSuggestions private function Returns abbreviated suggestions in string format.
Application::getConsoleMode private function Runs and parses mode CON if it's available, suppressing any error output.
Application::getDefaultHelperSet protected function Gets the default helper set with the helpers that should always be available. 1
Application::getDefaultInputDefinition protected function Gets the default input definition. 1
Application::getHelp public function Gets the help message.
Application::getHelperSet public function Get the helper set associated with the command.
Application::getLongVersion public function Returns the long version of the application.
Application::getName public function Gets the name of the application.
Application::getNamespaces public function Returns an array of all unique namespaces used by currently registered commands.
Application::getSttyColumns private function Runs and parses stty -a if it's available, suppressing any error output.
Application::getTerminalDimensions public function Tries to figure out the terminal dimensions based on the current environment.
Application::getTerminalHeight protected function Tries to figure out the terminal height in which this application runs.
Application::getTerminalWidth protected function Tries to figure out the terminal width in which this application runs.
Application::getVersion public function Gets the application version.
Application::has public function Returns true if the command exists, false otherwise.
Application::register public function Registers a new command.
Application::renderException public function Renders a caught exception.
Application::run public function Runs the current application.
Application::setAutoExit public function Sets whether to automatically exit after a command execution or not.
Application::setCatchExceptions public function Sets whether to catch exceptions or not during commands execution.
Application::setDefaultCommand public function Sets the default Command name.
Application::setDefinition public function Set an input definition set to be used with this application.
Application::setDispatcher public function
Application::setHelperSet public function Set a helper set to be used with the command.
Application::setName public function Sets the application name.
Application::setTerminalDimensions public function Sets terminal dimensions.
Application::setVersion public function Sets the application version.
Application::splitStringByWidth private function
Application::stringWidth private function
GenerateProxyClassApplication::$proxyBuilder protected property The proxy builder.
GenerateProxyClassApplication::getCommandName protected function Gets the name of the command based on input. Overrides Application::getCommandName
GenerateProxyClassApplication::getDefaultCommands protected function Gets the default commands that should always be available. Overrides Application::getDefaultCommands
GenerateProxyClassApplication::getDefinition public function Overridden so the application doesn't expect the command name as the first argument. Overrides Application::getDefinition
GenerateProxyClassApplication::__construct public function Constructs a new GenerateProxyClassApplication instance. Overrides Application::__construct