class GenerateProxyClassApplication

Same name and namespace in other branches
  1. 9 core/lib/Drupal/Core/Command/GenerateProxyClassApplication.php \Drupal\Core\Command\GenerateProxyClassApplication
  2. 10 core/lib/Drupal/Core/Command/GenerateProxyClassApplication.php \Drupal\Core\Command\GenerateProxyClassApplication
  3. 11.x 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
A command line application to generate proxy classes.

File

core/lib/Drupal/Core/Command/GenerateProxyClassApplication.php, line 12

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

Title Sort descending Modifiers Object type Summary
GenerateProxyClassApplication::$proxyBuilder protected property The proxy builder.
GenerateProxyClassApplication::getCommandName protected function
GenerateProxyClassApplication::getDefaultCommands protected function
GenerateProxyClassApplication::getDefinition public function Overridden so the application doesn't expect the command name as the first
argument.
GenerateProxyClassApplication::__construct public function Constructs a new GenerateProxyClassApplication instance.

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.