| Conditions | 5 |
| Paths | 4 |
| Total Lines | 20 |
| Code Lines | 14 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 21 | public function execute(InputInterface $input, OutputInterface $output) |
||
| 22 | { |
||
| 23 | $tunnels = $this->getClient()->getKernel()->getTunnels(); |
||
| 24 | if ($tunnels) { |
||
| 25 | $table = new Table($output); |
||
| 26 | $table->setHeaders(['Protocol', 'Server Port', 'Local Host', 'Proxy Host']); |
||
| 27 | foreach ($tunnels as $tunnel) { |
||
|
|
|||
| 28 | if ($tunnel instanceof HttpTunnel) { |
||
| 29 | foreach ($tunnel->getProxyHosts() as $proxyHost => $forwardHost) { |
||
| 30 | $table->addRow([$tunnel->getProtocol(), $tunnel->getServerPort(), $forwardHost, $proxyHost]); |
||
| 31 | } |
||
| 32 | } else { |
||
| 33 | $table->addRow([$tunnel->getProtocol(), $tunnel->getServerPort(), $tunnel->getHost(), '-']); |
||
| 34 | } |
||
| 35 | } |
||
| 36 | $table->render(); |
||
| 37 | } else { |
||
| 38 | $output->writeln("<comment>Hi, there is no proxy host, you should create a configuration file first</comment>"); |
||
| 39 | } |
||
| 40 | } |
||
| 41 | } |