protected function showRequiredPortsTable(array $ports, $host = '127.0.0.1')
    {
        $status = $this->getPortStatus($host, $ports);

        if (!empty($status)) {
            $has_warning = isset($status['state']['warning'])
            && $status['state']['warning'] !== 0
                ? true
                : false;

            if ($has_warning) {
                $this->io()
                    ->caution(
                        "Another process on your system is using the same port(s).\n" .
                        'Please review the report below for more details.'
                    );
            }
            $table = new Table($this->getOutput());
            $table
                ->setHeaders(['Port', 'Status'])
                ->setRows($this->buildPortStatusRows($status));

            $table->render();

            if ($has_warning) {
                $confirm = $this->askConfirmQuestion('Do you want to continue?');

                if (!$confirm) {
                    return false;
                }
            }
        }

        return true;
    }
protected function showRequiredPortsTable(array $ports, $host = '127.0.0.1')
    {
        $status = $this->getPortStatus($host, $ports);

        if (!empty($status)) {
            $has_warning = isset($status['state']['warning'])
            && $status['state']['warning'] !== 0
                ? true
                : false;

            if ($has_warning) {
                $this->io()
                    ->caution(
                        "Another process on your system is using the same port(s).\n" .
                        'Please review the report below for more details.'
                    );
            }
            $table = new Table($this->getOutput());
            $table
                ->setHeaders(['Port', 'Status'])
                ->setRows($this->buildPortStatusRows($status));

            $table->render();

            if ($has_warning) {
                $confirm = $this->askConfirmQuestion('Do you want to continue?');

                if (!$confirm) {
                    return false;
                }
            }
        }

        return true;
    }
protected function showRequiredPortsTable ( array $ ports , $ host = '127.0.0.1' ) { $ status = $ this -> getPortStatus ( $ host , $ ports ) ; if ( ! empty ( $ status ) ) { $ has_warning = isset ( $ status [ 'state' ] [ 'warning' ] ) && $ status [ 'state' ] [ 'warning' ] !== 0 ? true : false ; if ( $ has_warning ) { $ this -> io ( ) -> caution ( "Another process on your system is using the same port(s).\n" . 'Please review the report below for more details.' ) ; } $ table = new Table ( $ this -> getOutput ( ) ) ; $ table -> setHeaders ( [ 'Port' , 'Status' ] ) -> setRows ( $ this -> buildPortStatusRows ( $ status ) ) ; $ table -> render ( ) ; if ( $ has_warning ) { $ confirm = $ this -> askConfirmQuestion ( 'Do you want to continue?' ) ; if ( ! $ confirm ) { return false ; } } } return true ; }
Show required ports table.

@param array $ports
An array of ports to check.

@param string $host
The host IP address to check.

@return bool
Return true if it's okay to continue; otherwise false.
Show required ports table .