protected function filterTunnels(array $tunnels, InputInterface $input)
{
if (!$input->getOption('project') && !$this->getProjectRoot()) {
return $tunnels;
}
if (!$this->hasSelectedProject()) {
$this->validateInput($input, true);
}
$project = $this->getSelectedProject();
$environment = $this->hasSelectedEnvironment() ? $this->getSelectedEnvironment() : null;
$appName = $this->selectApp($input);
foreach ($tunnels as $key => $tunnel) {
if ($tunnel['projectId'] !== $project->id || $environment !== null && $tunnel['environmentId'] !== $environment->id || $appName !== null && $tunnel['appName'] !== $appName) {
unset($tunnels[$key]);
}
}
return $tunnels;
}