Fix properties with trailing underscore

[MAILPOET-2715]
This commit is contained in:
Jan Jakeš
2020-02-17 14:46:11 +01:00
committed by Jack Kitterhing
parent ec6ecdb79e
commit e185121f43
29 changed files with 42 additions and 42 deletions

View File

@ -12,7 +12,7 @@ use MailPoet\WP\Functions as WPFunctions;
*/
class CustomField extends Model {
public static $_table = MP_CUSTOM_FIELDS_TABLE;
public static $_table = MP_CUSTOM_FIELDS_TABLE; // phpcs:ignore PSR2.Classes.PropertyDeclaration
const TYPE_DATE = 'date';
const TYPE_TEXT = 'text';
const TYPE_TEXTAREA = 'textarea';

View File

@ -12,7 +12,7 @@ use MailPoet\WP\Functions as WPFunctions;
*/
class DynamicSegmentFilter extends Model {
public static $_table = MP_DYNAMIC_SEGMENTS_FILTERS_TABLE;
public static $_table = MP_DYNAMIC_SEGMENTS_FILTERS_TABLE; // phpcs:ignore PSR2.Classes.PropertyDeclaration
public function save() {
if (is_null($this->filterData)) {

View File

@ -12,7 +12,7 @@ use MailPoet\WP\Functions as WPFunctions;
*/
class Form extends Model {
public static $_table = MP_FORMS_TABLE;
public static $_table = MP_FORMS_TABLE; // phpcs:ignore PSR2.Classes.PropertyDeclaration
public function getSettings() {
return WPFunctions::get()->isSerialized($this->settings) ? unserialize($this->settings) : $this->settings;

View File

@ -3,6 +3,6 @@
namespace MailPoet\Models;
class Log extends Model {
public static $_table = MP_LOG_TABLE;
public static $_table = MP_LOG_TABLE; // phpcs:ignore PSR2.Classes.PropertyDeclaration
}

View File

@ -3,7 +3,7 @@
namespace MailPoet\Models;
class MappingToExternalEntities extends Model {
public static $_table = MP_MAPPING_TO_EXTERNAL_ENTITIES_TABLE;
public static $_table = MP_MAPPING_TO_EXTERNAL_ENTITIES_TABLE; // phpcs:ignore PSR2.Classes.PropertyDeclaration
public static function create($data = []) {
$relation = parent::create();

View File

@ -133,8 +133,8 @@ use MailPoet\WP\Functions as WPFunctions;
class Model extends \MailPoetVendor\Sudzy\ValidModel {
const DUPLICATE_RECORD = 23000;
public static $_table;
protected $_errors;
public static $_table; // phpcs:ignore PSR2.Classes.PropertyDeclaration
protected $_errors; // phpcs:ignore PSR2.Classes.PropertyDeclaration
protected $newRecord;
public function __construct() {

View File

@ -45,7 +45,7 @@ use function MailPoetVendor\array_column;
*/
class Newsletter extends Model {
public static $_table = MP_NEWSLETTERS_TABLE;
public static $_table = MP_NEWSLETTERS_TABLE; // phpcs:ignore PSR2.Classes.PropertyDeclaration
const TYPE_AUTOMATIC = NewsletterEntity::TYPE_AUTOMATIC;
const TYPE_STANDARD = NewsletterEntity::TYPE_STANDARD;
const TYPE_WELCOME = NewsletterEntity::TYPE_WELCOME;

View File

@ -10,6 +10,6 @@ namespace MailPoet\Models;
* @property int|null $clicksCount
*/
class NewsletterLink extends Model {
public static $_table = MP_NEWSLETTER_LINKS_TABLE;
public static $_table = MP_NEWSLETTER_LINKS_TABLE; // phpcs:ignore PSR2.Classes.PropertyDeclaration
const UNSUBSCRIBE_LINK_SHORT_CODE = '[link:subscription_unsubscribe_url]';
}

View File

@ -9,7 +9,7 @@ namespace MailPoet\Models;
* @property string $updatedAt
*/
class NewsletterOption extends Model {
public static $_table = MP_NEWSLETTER_OPTION_TABLE;
public static $_table = MP_NEWSLETTER_OPTION_TABLE; // phpcs:ignore PSR2.Classes.PropertyDeclaration
public static function createOrUpdate($data = []) {
if (!is_array($data) || empty($data['newsletter_id']) || empty($data['option_field_id'])) {

View File

@ -10,7 +10,7 @@ use MailPoet\WP\Functions as WPFunctions;
*/
class NewsletterOptionField extends Model {
public static $_table = MP_NEWSLETTER_OPTION_FIELDS_TABLE;
public static $_table = MP_NEWSLETTER_OPTION_FIELDS_TABLE; // phpcs:ignore PSR2.Classes.PropertyDeclaration
public function __construct() {
parent::__construct();

View File

@ -8,7 +8,7 @@ namespace MailPoet\Models;
* @property string $updatedAt
*/
class NewsletterPost extends Model {
public static $_table = MP_NEWSLETTER_POSTS_TABLE;
public static $_table = MP_NEWSLETTER_POSTS_TABLE; // phpcs:ignore PSR2.Classes.PropertyDeclaration
public static function getNewestNewsletterPost($newsletterId) {
return self::where('newsletter_id', $newsletterId)

View File

@ -8,5 +8,5 @@ namespace MailPoet\Models;
* @property string $updatedAt
*/
class NewsletterSegment extends Model {
public static $_table = MP_NEWSLETTER_SEGMENT_TABLE;
public static $_table = MP_NEWSLETTER_SEGMENT_TABLE; // phpcs:ignore PSR2.Classes.PropertyDeclaration
}

View File

@ -14,7 +14,7 @@ use MailPoet\WP\Functions as WPFunctions;
* @property int|null $readonly
*/
class NewsletterTemplate extends Model {
public static $_table = MP_NEWSLETTER_TEMPLATES_TABLE;
public static $_table = MP_NEWSLETTER_TEMPLATES_TABLE; // phpcs:ignore PSR2.Classes.PropertyDeclaration
const RECENTLY_SENT_CATEGORIES = '["recent"]';
const RECENTLY_SENT_COUNT = 12;

View File

@ -20,7 +20,7 @@ use MailPoetVendor\Idiorm\ORM;
* @property string|array|null $meta
*/
class ScheduledTask extends Model {
public static $_table = MP_SCHEDULED_TASKS_TABLE;
public static $_table = MP_SCHEDULED_TASKS_TABLE; // phpcs:ignore PSR2.Classes.PropertyDeclaration
const STATUS_COMPLETED = ScheduledTaskEntity::STATUS_COMPLETED;
const STATUS_SCHEDULED = ScheduledTaskEntity::STATUS_SCHEDULED;
const STATUS_PAUSED = ScheduledTaskEntity::STATUS_PAUSED;

View File

@ -22,8 +22,8 @@ class ScheduledTaskSubscriber extends Model {
const SENDING_STATUS_FAILED = 'failed';
const SENDING_STATUS_UNPROCESSED = 'unprocessed';
public static $_table = MP_SCHEDULED_TASK_SUBSCRIBERS_TABLE;
public static $_id_column = ['task_id', 'subscriber_id']; // phpcs:ignore Squiz.NamingConventions.ValidVariableName.MemberNotCamelCaps
public static $_table = MP_SCHEDULED_TASK_SUBSCRIBERS_TABLE; // phpcs:ignore PSR2.Classes.PropertyDeclaration
public static $_id_column = ['task_id', 'subscriber_id']; // phpcs:ignore Squiz.NamingConventions.ValidVariableName.MemberNotCamelCaps,PSR2.Classes.PropertyDeclaration
public function task() {
return $this->hasOne(__NAMESPACE__ . '\ScheduledTask', 'id', 'task_id');

View File

@ -17,7 +17,7 @@ use MailPoet\WP\Functions as WPFunctions;
*/
class Segment extends Model {
public static $_table = MP_SEGMENTS_TABLE;
public static $_table = MP_SEGMENTS_TABLE; // phpcs:ignore PSR2.Classes.PropertyDeclaration
const TYPE_WP_USERS = SegmentEntity::TYPE_WP_USERS;
const TYPE_WC_USERS = SegmentEntity::TYPE_WC_USERS;
const TYPE_DEFAULT = SegmentEntity::TYPE_DEFAULT;

View File

@ -23,7 +23,7 @@ use MailPoet\WP\Functions as WPFunctions;
*/
class SendingQueue extends Model {
public static $_table = MP_SENDING_QUEUES_TABLE;
public static $_table = MP_SENDING_QUEUES_TABLE; // phpcs:ignore PSR2.Classes.PropertyDeclaration
const STATUS_COMPLETED = SendingQueueEntity::STATUS_COMPLETED;
const STATUS_SCHEDULED = SendingQueueEntity::STATUS_SCHEDULED;
const STATUS_PAUSED = SendingQueueEntity::STATUS_PAUSED;

View File

@ -12,7 +12,7 @@ use DateTimeInterface;
* @property int $count
*/
class StatisticsClicks extends Model {
public static $_table = MP_STATISTICS_CLICKS_TABLE;
public static $_table = MP_STATISTICS_CLICKS_TABLE; // phpcs:ignore PSR2.Classes.PropertyDeclaration
public static function createOrUpdateClickCount($linkId, $subscriberId, $newsletterId, $queueId) {
$statistics = self::where('link_id', $linkId)

View File

@ -3,7 +3,7 @@
namespace MailPoet\Models;
class StatisticsForms extends Model {
public static $_table = MP_STATISTICS_FORMS_TABLE;
public static $_table = MP_STATISTICS_FORMS_TABLE; // phpcs:ignore PSR2.Classes.PropertyDeclaration
public static function getTotalSignups($formId = false) {
return self::where('form_id', $formId)->count();

View File

@ -6,7 +6,7 @@ namespace MailPoet\Models;
* @property string|null $sentAt
*/
class StatisticsNewsletters extends Model {
public static $_table = MP_STATISTICS_NEWSLETTERS_TABLE;
public static $_table = MP_STATISTICS_NEWSLETTERS_TABLE; // phpcs:ignore PSR2.Classes.PropertyDeclaration
public static function createMultiple(array $data) {
$values = [];

View File

@ -8,7 +8,7 @@ namespace MailPoet\Models;
* @property int $queueId
*/
class StatisticsOpens extends Model {
public static $_table = MP_STATISTICS_OPENS_TABLE;
public static $_table = MP_STATISTICS_OPENS_TABLE; // phpcs:ignore PSR2.Classes.PropertyDeclaration
public static function getOrCreate($subscriberId, $newsletterId, $queueId) {
$statistics = self::where('subscriber_id', $subscriberId)

View File

@ -8,7 +8,7 @@ namespace MailPoet\Models;
* @property int $queueId
*/
class StatisticsUnsubscribes extends Model {
public static $_table = MP_STATISTICS_UNSUBSCRIBES_TABLE;
public static $_table = MP_STATISTICS_UNSUBSCRIBES_TABLE; // phpcs:ignore PSR2.Classes.PropertyDeclaration
public static function getOrCreate($subscriberId, $newsletterId, $queueId) {
$statistics = self::where('subscriber_id', $subscriberId)

View File

@ -14,7 +14,7 @@ use WC_Order;
* @property float $orderPriceTotal
*/
class StatisticsWooCommercePurchases extends Model {
public static $_table = MP_STATISTICS_WOOCOMMERCE_PURCHASES_TABLE;
public static $_table = MP_STATISTICS_WOOCOMMERCE_PURCHASES_TABLE; // phpcs:ignore PSR2.Classes.PropertyDeclaration
public static function createOrUpdateByClickDataAndOrder(StatisticsClicks $click, WC_Order $order) {
// search by subscriber and newsletter IDs (instead of click itself) to avoid duplicities

View File

@ -32,7 +32,7 @@ use function MailPoetVendor\array_column;
*/
class Subscriber extends Model {
public static $_table = MP_SUBSCRIBERS_TABLE;
public static $_table = MP_SUBSCRIBERS_TABLE; // phpcs:ignore PSR2.Classes.PropertyDeclaration
const STATUS_SUBSCRIBED = 'subscribed';
const STATUS_UNSUBSCRIBED = 'unsubscribed';

View File

@ -12,7 +12,7 @@ use function MailPoetVendor\array_column;
* @property string $value
*/
class SubscriberCustomField extends Model {
public static $_table = MP_SUBSCRIBER_CUSTOM_FIELD_TABLE;
public static $_table = MP_SUBSCRIBER_CUSTOM_FIELD_TABLE; // phpcs:ignore PSR2.Classes.PropertyDeclaration
public static function createOrUpdate($data = []) {
$customField = CustomField::findOne($data['custom_field_id']);

View File

@ -6,5 +6,5 @@ namespace MailPoet\Models;
* @property string $ip
*/
class SubscriberIP extends Model {
public static $_table = MP_SUBSCRIBER_IPS_TABLE;
public static $_table = MP_SUBSCRIBER_IPS_TABLE; // phpcs:ignore PSR2.Classes.PropertyDeclaration
}

View File

@ -10,7 +10,7 @@ namespace MailPoet\Models;
*/
class SubscriberSegment extends Model {
public static $_table = MP_SUBSCRIBER_SEGMENT_TABLE;
public static $_table = MP_SUBSCRIBER_SEGMENT_TABLE; // phpcs:ignore PSR2.Classes.PropertyDeclaration
public function subscriber() {
return $this->has_one(__NAMESPACE__ . '\Subscriber', 'id', 'subscriber_id');