class GenerateProxyClassApplication

Same name in other branches
  1. 9 core/lib/Drupal/Core/Command/GenerateProxyClassApplication.php \Drupal\Core\Command\GenerateProxyClassApplication
  2. 8.9.x core/lib/Drupal/Core/Command/GenerateProxyClassApplication.php \Drupal\Core\Command\GenerateProxyClassApplication
  3. 10 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

See also

Lazy Services

core/scripts/generate-proxy.sh

1 file declares its use of GenerateProxyClassApplication
generate-proxy-class.php in core/scripts/generate-proxy-class.php
A script to generate proxy classes for lazy services.

File

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

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) : ?string {
        return 'generate-proxy-class';
    }
    
    /**
     * {@inheritdoc}
     */
    protected function getDefaultCommands() : array {
        // 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() : InputDefinition {
        $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.