provider = $provider; } public static function &singleton($providerParams = [], $force = FALSE) { if (isset($providerParams['provider'])) { $providers = CRM_SMS_BAO_Provider::getProviders(NULL, array('name' => $providerParams['provider'])); $provider = current($providers); $providerID = $provider['id'] ?? NULL; } else { $providerID = $providerParams['provider_id'] ?? NULL; } $skipAuth = $providerID ? FALSE : TRUE; $cacheKey = (int) $providerID; if (!isset(self::$_singleton[$cacheKey]) || $force) { $provider = []; if ($providerID) { $provider = CRM_SMS_BAO_Provider::getProviderInfo($providerID); } self::$_singleton[$cacheKey] = new CiviTestSMSProvider($provider, $skipAuth); } return self::$_singleton[$cacheKey]; } public function send($recipients, $header, $message, $dncID = NULL) { $this->sentMessage = $message; } /** * Get the message that was sent. * * @return string */ public function getSentMessage(): string { return $this->sentMessage; } }