Neos\Flow\Cli\Request::getCommand PHP Method

getCommand() public method

Returns the command object for this request
public getCommand ( ) : Command
return Command
    public function getCommand()
    {
        if ($this->command === null) {
            $this->command = new Command($this->controllerObjectName, $this->controllerCommandName);
        }
        return $this->command;
    }

Usage Example

 /**
  * @test
  */
 public function setControllerObjectNameAndSetControllerCommandNameUnsetTheBuiltCommandObject()
 {
     $request = new Request();
     $request->setControllerObjectName(CacheCommandController::class);
     $request->setControllerCommandName('flush');
     $request->getCommand();
     $request->setControllerObjectName('Neos\\Flow\\Command\\BeerCommandController');
     $request->setControllerCommandName('drink');
     $command = $request->getCommand();
     $this->assertEquals('neos.flow:beer:drink', $command->getCommandIdentifier());
 }
All Usage Examples Of Neos\Flow\Cli\Request::getCommand