src/Viserio/Component/WebServer/WebServer.php
public static function run(WebServerConfig $config, bool $disableOutput = true, callable $callback = null): void
    {
        if (self::isRunning()) {
            throw new RuntimeException(\sprintf('A process is already listening on http://%s.', $config->getAddress()));
        }

        $process = self::createServerProcess($config);

        if ($disableOutput) {
            $process->disableOutput();
            $callback = null;
        } else {
            try {
                $process->setTty(true);
                $callback = null;
            } catch (\RuntimeException $e) {
            }
        }

        $process->run($callback);

        if (! $process->isSuccessful()) {
            $error = 'Server terminated unexpectedly.';

            if ($process->isOutputDisabled()) {
                $error .= ' Run the command again with -v option for more details.';
            }

            throw new RuntimeException($error);
        }
    }
public static function run(WebServerConfig $config, bool $disableOutput = true, callable $callback = null): void
    {
        if (self::isRunning()) {
            throw new RuntimeException(\sprintf('A process is already listening on http://%s.', $config->getAddress()));
        }

        $process = self::createServerProcess($config);

        if ($disableOutput) {
            $process->disableOutput();
            $callback = null;
        } else {
            try {
                $process->setTty(true);
                $callback = null;
            } catch (\RuntimeException $e) {
            }
        }

        $process->run($callback);

        if (! $process->isSuccessful()) {
            $error = 'Server terminated unexpectedly.';

            if ($process->isOutputDisabled()) {
                $error .= ' Run the command again with -v option for more details.';
            }

            throw new RuntimeException($error);
        }
    }
@param \Viserio\Component\WebServer\WebServerConfig $config
@param bool                                         $disableOutput
@param null|callable                                $callback

@return void