From 5efe1a8524181fee9a01539f1f73e1f003ae561b Mon Sep 17 00:00:00 2001 From: Majed Al-Chatti Date: Mon, 25 Mar 2024 08:27:36 +0000 Subject: [PATCH] fix: from count to check if empty --- src/Command/Auth/AuthLoginCommand.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Command/Auth/AuthLoginCommand.php b/src/Command/Auth/AuthLoginCommand.php index 9f48c5e44..faded08b5 100644 --- a/src/Command/Auth/AuthLoginCommand.php +++ b/src/Command/Auth/AuthLoginCommand.php @@ -27,7 +27,7 @@ protected function execute(InputInterface $input, OutputInterface $output): int $keys = $this->datastoreCloud->get('keys'); $activeKey = $this->datastoreCloud->get('acli_key'); // @todo this validation should really be enforced as a schema on the datastore. - if (count($keys) != 0 && !array_key_exists($activeKey, $keys)) { + if ( is_array($keys) && !empty($keys) != 0 && !array_key_exists($activeKey, $keys)) { throw new AcquiaCliException('Invalid key in Cloud datastore; run acli auth:logout && acli auth:login to fix'); } if ($activeKey) {