3 namespace Drupal\Core\Command;
5 use Drupal\Component\ProxyBuilder\ProxyBuilder;
6 use Symfony\Component\Console\Application;
7 use Symfony\Component\Console\Input\InputInterface;
10 * Provides a console command to generate proxy classes.
12 class GenerateProxyClassApplication extends Application {
17 * @var \Drupal\Component\ProxyBuilder\ProxyBuilder
19 protected $proxyBuilder;
22 * Constructs a new GenerateProxyClassApplication instance.
24 * @param \Drupal\Component\ProxyBuilder\ProxyBuilder $proxy_builder
27 public function __construct(ProxyBuilder $proxy_builder) {
28 $this->proxyBuilder = $proxy_builder;
30 parent::__construct();
36 protected function getCommandName(InputInterface $input) {
37 return 'generate-proxy-class';
43 protected function getDefaultCommands() {
44 // Even though this is a single command, keep the HelpCommand (--help).
45 $default_commands = parent::getDefaultCommands();
46 $default_commands[] = new GenerateProxyClassCommand($this->proxyBuilder);
47 return $default_commands;
53 * Overridden so the application doesn't expect the command name as the first
56 public function getDefinition() {
57 $definition = parent::getDefinition();
58 // Clears the normal first argument (the command name).
59 $definition->setArguments();