src/main/php/Executor.php
public function execute(string $command, callable $collect = null, string $redirect = '2>&1'): self
    {
        foreach ($this->outputOf($command, $redirect) as $line) {
            if (null !== $collect) {
                $collect($line);
            }
        }

        return $this;
    }
public function execute(string $command, callable $collect = null, string $redirect = '2>&1'): self
    {
        foreach ($this->outputOf($command, $redirect) as $line) {
            if (null !== $collect) {
                $collect($line);
            }
        }

        return $this;
    }
public function execute ( string $ command , callable $ collect = null , string $ redirect = '2>&1' ) : self { foreach ( $ this -> outputOf ( $ command , $ redirect ) as $ line ) { if ( null !== $ collect ) { $ collect ( $ line ) ; } } return $ this ; }
executes given command

@param   string    $command
@param   callable  $collect   optional  callable which will receive each line from the command output
@param   string    $redirect  optional  how to redirect error output
@return  \stubbles\console\Executor
executes given command