Skip to main content
Drupal API
User account menu
  • Log in

Breadcrumb

  1. Drupal Core 11.1.x
  2. Command.php

function Command::mergeApplicationDefinition

Merges the application definition with the command definition.

This method is not part of public API and should not be used directly.

@internal

Parameters

bool $mergeArgs Whether to merge or not the Application definition arguments to Command definition arguments:

1 call to Command::mergeApplicationDefinition()
Command::run in vendor/symfony/console/Command/Command.php
Runs the command.
2 methods override Command::mergeApplicationDefinition()
LazyCommand::mergeApplicationDefinition in vendor/symfony/console/Command/LazyCommand.php
@internal
TraceableCommand::mergeApplicationDefinition in vendor/symfony/console/Command/TraceableCommand.php
@internal

File

vendor/symfony/console/Command/Command.php, line 344

Class

Command
Base class for all commands.

Namespace

Symfony\Component\Console\Command

Code

public function mergeApplicationDefinition(bool $mergeArgs = true) : void {
    if (null === $this->application) {
        return;
    }
    $this->fullDefinition = new InputDefinition();
    $this->fullDefinition
        ->setOptions($this->definition
        ->getOptions());
    $this->fullDefinition
        ->addOptions($this->application
        ->getDefinition()
        ->getOptions());
    if ($mergeArgs) {
        $this->fullDefinition
            ->setArguments($this->application
            ->getDefinition()
            ->getArguments());
        $this->fullDefinition
            ->addArguments($this->definition
            ->getArguments());
    }
    else {
        $this->fullDefinition
            ->setArguments($this->definition
            ->getArguments());
    }
}

API Navigation

  • Drupal Core 11.1.x
  • Topics
  • Classes
  • Functions
  • Constants
  • Globals
  • Files
  • Namespaces
  • Deprecated
  • Services
RSS feed
Powered by Drupal