Webmozart\Console\Api\Config\ApplicationConfig::setIOFactory PHP Method

setIOFactory() public method

The callable receives four arguments: * {@link RawArgs}: The raw console arguments. * {@link Input}: The input. * {@link Output}: The output. * {@link Output}: The error output. The input and output instances may be null if none were passed to {@link Application::run()}.
public setIOFactory ( callable $ioFactory ) : static
$ioFactory callable The {@link IO} factory callable.
return static The current instance.
    public function setIOFactory($ioFactory)
    {
        Assert::nullOrIsCallable($ioFactory, 'The IO factory must be a callable or null. Got: %s');
        $this->ioFactory = $ioFactory;
        return $this;
    }

Usage Example

Ejemplo n.º 1
0
 /**
  * @expectedException \LogicException
  */
 public function testFailIfNoIOFactory()
 {
     $this->config->setIOFactory(null);
     $args = new StringArgs('');
     $application = new ConsoleApplication($this->config);
     $application->run($args);
 }
All Usage Examples Of Webmozart\Console\Api\Config\ApplicationConfig::setIOFactory