From 7860fea42591e7b1f5bb0c2b37db77d15bcb53c1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9s=20Monta=C3=B1ez?= Date: Thu, 29 Mar 2018 18:09:11 -0300 Subject: [PATCH] Improve tests for php 7.2 --- src/Command/BuiltIn/DeployCommand.php | 3 +++ src/Command/BuiltIn/Releases/ListCommand.php | 3 +++ 2 files changed, 6 insertions(+) diff --git a/src/Command/BuiltIn/DeployCommand.php b/src/Command/BuiltIn/DeployCommand.php index 339f275..bb2cb5c 100644 --- a/src/Command/BuiltIn/DeployCommand.php +++ b/src/Command/BuiltIn/DeployCommand.php @@ -143,6 +143,9 @@ class DeployCommand extends AbstractCommand protected function runOnHosts(OutputInterface $output, $tasks) { $hosts = $this->runtime->getEnvOption('hosts'); + if (!is_array($hosts) && !$hosts instanceof \Countable) { + $hosts = []; + } if (count($hosts) == 0) { $output->writeln(sprintf(' No hosts defined, skipping %s tasks', $this->getStageName())); $output->writeln(''); diff --git a/src/Command/BuiltIn/Releases/ListCommand.php b/src/Command/BuiltIn/Releases/ListCommand.php index 4bee690..5d49ce2 100644 --- a/src/Command/BuiltIn/Releases/ListCommand.php +++ b/src/Command/BuiltIn/Releases/ListCommand.php @@ -74,6 +74,9 @@ class ListCommand extends AbstractCommand $output->writeln(''); $hosts = $this->runtime->getEnvOption('hosts'); + if (!is_array($hosts) && !$hosts instanceof \Countable) { + $hosts = []; + } if (count($hosts) == 0) { $output->writeln('No hosts defined'); $output->writeln('');