Fix PHPStan errors
This commit is contained in:
committed by
M. Shull
parent
3ff55d85a9
commit
ab097d356a
@ -20,7 +20,7 @@ class Capabilities {
|
|||||||
$wp = new WPFunctions;
|
$wp = new WPFunctions;
|
||||||
}
|
}
|
||||||
$this->wp = $wp;
|
$this->wp = $wp;
|
||||||
$this->access_control = new AccessControl($wp);
|
$this->access_control = new AccessControl;
|
||||||
}
|
}
|
||||||
|
|
||||||
function init() {
|
function init() {
|
||||||
|
@ -155,6 +155,9 @@ class Mailer {
|
|||||||
$this->settings->get('bounce.address');
|
$this->settings->get('bounce.address');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param \MailPoet\Models\Subscriber|array $subscriber
|
||||||
|
*/
|
||||||
function formatSubscriberNameAndEmailAddress($subscriber) {
|
function formatSubscriberNameAndEmailAddress($subscriber) {
|
||||||
$subscriber = (is_object($subscriber)) ? $subscriber->asArray() : $subscriber;
|
$subscriber = (is_object($subscriber)) ? $subscriber->asArray() : $subscriber;
|
||||||
if (!is_array($subscriber)) return $subscriber;
|
if (!is_array($subscriber)) return $subscriber;
|
||||||
|
@ -2,6 +2,7 @@
|
|||||||
namespace MailPoet\Models;
|
namespace MailPoet\Models;
|
||||||
|
|
||||||
use MailPoet\Form\Block\Date;
|
use MailPoet\Form\Block\Date;
|
||||||
|
use MailPoet\WP\Functions as WPFunctions;
|
||||||
|
|
||||||
if (!defined('ABSPATH')) exit;
|
if (!defined('ABSPATH')) exit;
|
||||||
|
|
||||||
@ -9,7 +10,6 @@ if (!defined('ABSPATH')) exit;
|
|||||||
* @property string $type
|
* @property string $type
|
||||||
* @property string|array $params
|
* @property string|array $params
|
||||||
*/
|
*/
|
||||||
use MailPoet\WP\Functions as WPFunctions;
|
|
||||||
|
|
||||||
class CustomField extends Model {
|
class CustomField extends Model {
|
||||||
public static $_table = MP_CUSTOM_FIELDS_TABLE;
|
public static $_table = MP_CUSTOM_FIELDS_TABLE;
|
||||||
|
@ -1,6 +1,8 @@
|
|||||||
<?php
|
<?php
|
||||||
namespace MailPoet\Models;
|
namespace MailPoet\Models;
|
||||||
|
|
||||||
|
use MailPoet\WP\Functions as WPFunctions;
|
||||||
|
|
||||||
if (!defined('ABSPATH')) exit;
|
if (!defined('ABSPATH')) exit;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -8,7 +10,6 @@ if (!defined('ABSPATH')) exit;
|
|||||||
* @property string|array $body
|
* @property string|array $body
|
||||||
* @property string $name
|
* @property string $name
|
||||||
*/
|
*/
|
||||||
use MailPoet\WP\Functions as WPFunctions;
|
|
||||||
|
|
||||||
class Form extends Model {
|
class Form extends Model {
|
||||||
public static $_table = MP_FORMS_TABLE;
|
public static $_table = MP_FORMS_TABLE;
|
||||||
|
@ -2,6 +2,8 @@
|
|||||||
|
|
||||||
namespace MailPoet\Models;
|
namespace MailPoet\Models;
|
||||||
|
|
||||||
|
use MailPoet\WP\Functions as WPFunctions;
|
||||||
|
|
||||||
if (!defined('ABSPATH')) exit;
|
if (!defined('ABSPATH')) exit;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -112,7 +114,6 @@ if (!defined('ABSPATH')) exit;
|
|||||||
* @property string|null $updated_at
|
* @property string|null $updated_at
|
||||||
* @property string|null $id
|
* @property string|null $id
|
||||||
*/
|
*/
|
||||||
use MailPoet\WP\Functions as WPFunctions;
|
|
||||||
|
|
||||||
class Model extends \Sudzy\ValidModel {
|
class Model extends \Sudzy\ValidModel {
|
||||||
const DUPLICATE_RECORD = 23000;
|
const DUPLICATE_RECORD = 23000;
|
||||||
|
@ -8,6 +8,7 @@ use MailPoet\Util\Helpers;
|
|||||||
use MailPoet\Util\Security;
|
use MailPoet\Util\Security;
|
||||||
use MailPoet\WP\Emoji;
|
use MailPoet\WP\Emoji;
|
||||||
use function MailPoet\Util\array_column;
|
use function MailPoet\Util\array_column;
|
||||||
|
use MailPoet\WP\Functions as WPFunctions;
|
||||||
|
|
||||||
if (!defined('ABSPATH')) exit;
|
if (!defined('ABSPATH')) exit;
|
||||||
|
|
||||||
@ -29,7 +30,6 @@ if (!defined('ABSPATH')) exit;
|
|||||||
* @property string $body
|
* @property string $body
|
||||||
* @property string|null $schedule
|
* @property string|null $schedule
|
||||||
*/
|
*/
|
||||||
use MailPoet\WP\Functions as WPFunctions;
|
|
||||||
|
|
||||||
class Newsletter extends Model {
|
class Newsletter extends Model {
|
||||||
public static $_table = MP_NEWSLETTERS_TABLE;
|
public static $_table = MP_NEWSLETTERS_TABLE;
|
||||||
|
@ -1,6 +1,8 @@
|
|||||||
<?php
|
<?php
|
||||||
namespace MailPoet\Models;
|
namespace MailPoet\Models;
|
||||||
|
|
||||||
|
use MailPoet\WP\Functions as WPFunctions;
|
||||||
|
|
||||||
if (!defined('ABSPATH')) exit;
|
if (!defined('ABSPATH')) exit;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -9,7 +11,6 @@ if (!defined('ABSPATH')) exit;
|
|||||||
* @property string $type
|
* @property string $type
|
||||||
* @property string $description
|
* @property string $description
|
||||||
*/
|
*/
|
||||||
use MailPoet\WP\Functions as WPFunctions;
|
|
||||||
|
|
||||||
class Segment extends Model {
|
class Segment extends Model {
|
||||||
static $_table = MP_SEGMENTS_TABLE;
|
static $_table = MP_SEGMENTS_TABLE;
|
||||||
|
@ -4,6 +4,7 @@ namespace MailPoet\Models;
|
|||||||
use MailPoet\Util\Helpers;
|
use MailPoet\Util\Helpers;
|
||||||
use MailPoet\WP\Emoji;
|
use MailPoet\WP\Emoji;
|
||||||
use MailPoet\Tasks\Subscribers as TaskSubscribers;
|
use MailPoet\Tasks\Subscribers as TaskSubscribers;
|
||||||
|
use MailPoet\WP\Functions as WPFunctions;
|
||||||
|
|
||||||
if (!defined('ABSPATH')) exit;
|
if (!defined('ABSPATH')) exit;
|
||||||
|
|
||||||
@ -19,7 +20,6 @@ if (!defined('ABSPATH')) exit;
|
|||||||
* @property string|array $subscribers
|
* @property string|array $subscribers
|
||||||
* @property string|null $deleted_at
|
* @property string|null $deleted_at
|
||||||
*/
|
*/
|
||||||
use MailPoet\WP\Functions as WPFunctions;
|
|
||||||
|
|
||||||
class SendingQueue extends Model {
|
class SendingQueue extends Model {
|
||||||
public static $_table = MP_SENDING_QUEUES_TABLE;
|
public static $_table = MP_SENDING_QUEUES_TABLE;
|
||||||
|
@ -5,6 +5,7 @@ use MailPoet\Settings\SettingsController;
|
|||||||
use MailPoet\Subscribers\ConfirmationEmailMailer;
|
use MailPoet\Subscribers\ConfirmationEmailMailer;
|
||||||
use MailPoet\Util\Helpers;
|
use MailPoet\Util\Helpers;
|
||||||
use function MailPoet\Util\array_column;
|
use function MailPoet\Util\array_column;
|
||||||
|
use MailPoet\WP\Functions as WPFunctions;
|
||||||
|
|
||||||
if (!defined('ABSPATH')) exit;
|
if (!defined('ABSPATH')) exit;
|
||||||
|
|
||||||
@ -26,7 +27,6 @@ if (!defined('ABSPATH')) exit;
|
|||||||
* @property string $unconfirmed_data
|
* @property string $unconfirmed_data
|
||||||
* @property int $is_woocommerce_user
|
* @property int $is_woocommerce_user
|
||||||
*/
|
*/
|
||||||
use MailPoet\WP\Functions as WPFunctions;
|
|
||||||
|
|
||||||
class Subscriber extends Model {
|
class Subscriber extends Model {
|
||||||
public static $_table = MP_SUBSCRIBERS_TABLE;
|
public static $_table = MP_SUBSCRIBERS_TABLE;
|
||||||
|
@ -22,6 +22,9 @@ class Renderer {
|
|||||||
const NEWSLETTER_TEMPLATE = 'Template.html';
|
const NEWSLETTER_TEMPLATE = 'Template.html';
|
||||||
const FILTER_POST_PROCESS = 'mailpoet_rendering_post_process';
|
const FILTER_POST_PROCESS = 'mailpoet_rendering_post_process';
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param \MailPoet\Models\Newsletter|array $newsletter
|
||||||
|
*/
|
||||||
function __construct($newsletter, $preview = false) {
|
function __construct($newsletter, $preview = false) {
|
||||||
$this->newsletter = ($newsletter instanceof Newsletter) ? $newsletter->asArray() : $newsletter;
|
$this->newsletter = ($newsletter instanceof Newsletter) ? $newsletter->asArray() : $newsletter;
|
||||||
$this->preview = $preview;
|
$this->preview = $preview;
|
||||||
|
@ -8,6 +8,9 @@ use MailPoet\WP\Functions as WPFunctions;
|
|||||||
if (!defined('ABSPATH')) exit;
|
if (!defined('ABSPATH')) exit;
|
||||||
|
|
||||||
class Subscriber {
|
class Subscriber {
|
||||||
|
/**
|
||||||
|
* @param \MailPoet\Models\Subscriber|false $subscriber
|
||||||
|
*/
|
||||||
static function process(
|
static function process(
|
||||||
$shortcode_details,
|
$shortcode_details,
|
||||||
$newsletter,
|
$newsletter,
|
||||||
|
@ -5,11 +5,11 @@ namespace MailPoet\Subscribers\ImportExport\Export;
|
|||||||
use MailPoet\Models\Segment;
|
use MailPoet\Models\Segment;
|
||||||
use MailPoet\Models\Subscriber;
|
use MailPoet\Models\Subscriber;
|
||||||
use MailPoet\Models\SubscriberSegment;
|
use MailPoet\Models\SubscriberSegment;
|
||||||
|
use MailPoet\WP\Functions as WPFunctions;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Gets batches of subscribers from default segments.
|
* Gets batches of subscribers from default segments.
|
||||||
*/
|
*/
|
||||||
use MailPoet\WP\Functions as WPFunctions;
|
|
||||||
|
|
||||||
class DefaultSubscribersGetter extends SubscribersGetter {
|
class DefaultSubscribersGetter extends SubscribersGetter {
|
||||||
|
|
||||||
|
@ -2,8 +2,12 @@
|
|||||||
namespace MailPoet\WP;
|
namespace MailPoet\WP;
|
||||||
|
|
||||||
class Functions {
|
class Functions {
|
||||||
|
|
||||||
static private $instance;
|
static private $instance;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @return Functions
|
||||||
|
*/
|
||||||
static function get() {
|
static function get() {
|
||||||
if (self::$instance == null) {
|
if (self::$instance == null) {
|
||||||
self::$instance = new Functions;
|
self::$instance = new Functions;
|
||||||
@ -155,6 +159,9 @@ class Functions {
|
|||||||
return call_user_func_array('current_user_can', func_get_args());
|
return call_user_func_array('current_user_can', func_get_args());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @return \WP_Role | null
|
||||||
|
*/
|
||||||
function getRole() {
|
function getRole() {
|
||||||
return call_user_func_array('get_role', func_get_args());
|
return call_user_func_array('get_role', func_get_args());
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user