Document the types of two SendingQueue properties that were undocumented

It was also necessary to add an if condition to check the type of a
variable before calling one of the methods of one of the documented
properties.

[MAILPOET-4363]
This commit is contained in:
Rodrigo Primo
2022-09-19 12:15:13 -03:00
committed by Aschepikov
parent f578f3f16a
commit 2c159b1694

View File

@ -30,7 +30,10 @@ use MailPoet\WP\Functions as WPFunctions;
use MailPoetVendor\Carbon\Carbon; use MailPoetVendor\Carbon\Carbon;
class SendingQueue { class SendingQueue {
/** @var MailerTask */
public $mailerTask; public $mailerTask;
/** @var NewsletterTask */
public $newsletterTask; public $newsletterTask;
const TASK_TYPE = 'sending'; const TASK_TYPE = 'sending';
@ -284,6 +287,10 @@ class SendingQueue {
continue; continue;
} }
if (!$newsletterEntity instanceof NewsletterEntity) {
continue;
}
// render shortcodes and replace subscriber data in tracked links // render shortcodes and replace subscriber data in tracked links
$preparedNewsletters[] = $preparedNewsletters[] =
$this->newsletterTask->prepareNewsletterForSending( $this->newsletterTask->prepareNewsletterForSending(