From 419f3bee1d429ddbbff46c3b692764cf791ad041 Mon Sep 17 00:00:00 2001 From: Christy Jacob Date: Tue, 28 Jan 2025 13:32:10 +0530 Subject: [PATCH] chore: fix tests --- src/Appwrite/Platform/Workers/Messaging.php | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/src/Appwrite/Platform/Workers/Messaging.php b/src/Appwrite/Platform/Workers/Messaging.php index 888e083da1..aee60a2bb5 100644 --- a/src/Appwrite/Platform/Workers/Messaging.php +++ b/src/Appwrite/Platform/Workers/Messaging.php @@ -48,8 +48,6 @@ class Messaging extends Action { private ?Local $localDevice = null; - private array $dsns = []; - private ?SMSAdapter $adapter = null; public static function getName(): string @@ -63,7 +61,7 @@ class Messaging extends Action public function __construct() { - $this->adapter = $this->createInternalSMSAdapter($this->dsns); + $this->adapter = $this->createInternalSMSAdapter(); $this ->desc('Messaging worker') @@ -674,7 +672,7 @@ class Messaging extends Action return $this->localDevice; } - private function createInternalSMSAdapter(array $dsns): ?SMSAdapter + private function createInternalSMSAdapter(): ?SMSAdapter { if (empty(System::getEnv('_APP_SMS_PROVIDER')) || empty(System::getEnv('_APP_SMS_FROM'))) { Console::warning('Skipped SMS processing. Missing "_APP_SMS_PROVIDER" or "_APP_SMS_FROM" environment variables.'); @@ -683,10 +681,11 @@ class Messaging extends Action $providers = System::getEnv('_APP_SMS_PROVIDER', ''); + $dsns = []; if (!empty($providers)) { $providers = explode(',', $providers); foreach ($providers as $provider) { - $this->dsns[] = new DSN($provider); + $dsns[] = new DSN($provider); } }