Symfony\Component\Console\Command\Command::__construct PHP Метод

__construct() публичный Метод

Constructor.
public __construct ( string | null $name = null )
$name string | null The name of the command; passing null means it must be set in configure()
    public function __construct($name = null)
    {
        $this->definition = new InputDefinition();
        if (null !== $name) {
            $this->setName($name);
        }
        $this->configure();
        if (!$this->name) {
            throw new LogicException(sprintf('The command defined in "%s" cannot have an empty name.', get_class($this)));
        }
    }

Usage Example

 /**
  * @param TransferFunds $useCase
  * @param EwalletExtension $formatter
  */
 public function __construct(TransferFunds $useCase, MemberFormatter $formatter)
 {
     parent::__construct();
     $this->formatter = $formatter;
     $this->useCase = $useCase;
     $this->useCase->attach($this);
 }
All Usage Examples Of Symfony\Component\Console\Command\Command::__construct