From 7ed6bc91f85143d0e57e023de7f42f76aba49c69 Mon Sep 17 00:00:00 2001 From: Sebastian Date: Fri, 26 Mar 2021 05:29:15 +0100 Subject: [PATCH] Avoided null error on count This commit avoids a warning when the library tries to call count() on a non-array object. The issue is avoided by checking whether the object is an array beforehand. See #51 --- src/Command/Delivery/DebugCommand.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Command/Delivery/DebugCommand.php b/src/Command/Delivery/DebugCommand.php index f4a2d1e..9982c9a 100644 --- a/src/Command/Delivery/DebugCommand.php +++ b/src/Command/Delivery/DebugCommand.php @@ -52,7 +52,7 @@ public function __construct($clients, $configurations = []) $this->setDescription('Shows information about data coming from a certain client'); $this->addArgument( 'client-name', - \count($this->clients) > 1 ? InputArgument::REQUIRED : InputArgument::OPTIONAL, + \is_array($this->clients) && \count($this->clients) > 1 ? InputArgument::REQUIRED : InputArgument::OPTIONAL, 'The name of the client to use' ); }