public function restart(callable $callback = null)
    {
        if ($this->isRunning()) {
            throw new RuntimeException('Process is already running');
        }

        $process = clone $this;
        $process->start($callback);

        return $process;
    }
public function restart(callable $callback = null)
    {
        if ($this->isRunning()) {
            throw new RuntimeException('Process is already running');
        }

        $process = clone $this;
        $process->start($callback);

        return $process;
    }
public function restart ( callable $ callback = null ) { if ( $ this -> isRunning ( ) ) { throw new RuntimeException ( 'Process is already running' ) ; } $ process = clone $ this ; $ process -> start ( $ callback ) ; return $ process ; }
Restarts the process.

Be warned that the process is cloned before being started.

@param callable|null $callback A PHP callback to run whenever there is some
output available on STDOUT or STDERR

@return Process The new process

@throws RuntimeException When process can't be launched
@throws RuntimeException When process is already running

@see start()
Restarts the process .