Add annotation for the Bridge property

[MAILPOET-4047]
This commit is contained in:
Jan Lysý
2022-02-24 19:36:51 +01:00
committed by Veljko V
parent 69769697ab
commit 9fa2f7d051
3 changed files with 7 additions and 0 deletions

View File

@@ -10,6 +10,7 @@ use MailPoet\WP\Functions as WPFunctions;
use MailPoetVendor\Carbon\Carbon;
abstract class KeyCheckWorker extends SimpleWorker {
/** @var Bridge|null */
public $bridge;
/** @var CronWorkerScheduler */

View File

@@ -25,6 +25,9 @@ class PremiumKeyCheck extends KeyCheckWorker {
}
public function checkKey() {
// for phpstan because we set bridge property in the init function
if (!$this->bridge) return;
$premiumKey = $this->settings->get(Bridge::PREMIUM_KEY_SETTING_NAME);
$result = $this->bridge->checkPremiumKey($premiumKey);
$this->bridge->storePremiumKeyAndState($premiumKey, $result);

View File

@@ -46,6 +46,9 @@ class SendingServiceKeyCheck extends KeyCheckWorker {
}
public function checkKey() {
// for phpstan because we set bridge property in the init function
if (!$this->bridge) return;
$wasPendingApproval = $this->servicesChecker->isMailPoetAPIKeyPendingApproval();
$mssKey = $this->settings->get(Mailer::MAILER_CONFIG_SETTING_NAME)['mailpoet_api_key'];