More yoda conditions
This commit is contained in:
@ -158,7 +158,7 @@ class Broadcast_Manager extends Base_Manager {
|
||||
);
|
||||
}
|
||||
|
||||
if ($args['type'] === 'broadcast_email') {
|
||||
if ('broadcast_email' === $args['type']) {
|
||||
$to = [];
|
||||
|
||||
$bcc = [];
|
||||
@ -272,7 +272,7 @@ class Broadcast_Manager extends Base_Manager {
|
||||
|
||||
$broadcast = new Broadcast($broadcast_data);
|
||||
|
||||
if ($args['type'] === 'broadcast_notice') {
|
||||
if ('broadcast_notice' === $args['type']) {
|
||||
$broadcast->set_notice_type($args['notice_type']);
|
||||
}
|
||||
|
||||
|
@ -236,7 +236,7 @@ class Event_Manager extends Base_Manager {
|
||||
'hidden' => false,
|
||||
];
|
||||
|
||||
$types = array_filter($types, fn($item) => $item['hidden'] === false);
|
||||
$types = array_filter($types, fn($item) => false === $item['hidden']);
|
||||
|
||||
return $types;
|
||||
}
|
||||
|
@ -257,7 +257,7 @@ class Field_Templates_Manager extends Base_Manager {
|
||||
|
||||
$holder_name = "instantiated_{$field_type}_templates";
|
||||
|
||||
if ( ! isset($this->holders[ $holder_name ]) || $this->holders[ $holder_name ] === null) {
|
||||
if ( ! isset($this->holders[ $holder_name ]) || null === $this->holders[ $holder_name ]) {
|
||||
$this->holders[ $holder_name ] = array_map([$this, 'instantiate_field_template'], $this->get_templates($field_type));
|
||||
}
|
||||
|
||||
|
@ -377,7 +377,7 @@ class Gateway_Manager extends Base_Manager {
|
||||
|
||||
$gateways = $this->get_registered_gateways();
|
||||
|
||||
$gateways = array_filter($gateways, fn($item) => $item['hidden'] === false);
|
||||
$gateways = array_filter($gateways, fn($item) => false === $item['hidden']);
|
||||
|
||||
return $gateways;
|
||||
}
|
||||
|
@ -313,7 +313,7 @@ class Limitation_Manager {
|
||||
],
|
||||
];
|
||||
|
||||
if ($object->model !== 'product') {
|
||||
if ('product' !== $object->model) {
|
||||
$sections['visits']['fields']['modules_visits_overwrite'] = $this->override_notice($object->get_limitations(false)->visits->has_own_enabled());
|
||||
}
|
||||
|
||||
@ -332,7 +332,7 @@ class Limitation_Manager {
|
||||
],
|
||||
];
|
||||
|
||||
if ($object->model !== 'product') {
|
||||
if ('product' !== $object->model) {
|
||||
$sections['visits']['fields']['allowed_visits_overwrite'] = $this->override_notice($object->get_limitations(false)->visits->has_own_limit(), ['limit_visits']);
|
||||
}
|
||||
|
||||
@ -374,7 +374,7 @@ class Limitation_Manager {
|
||||
],
|
||||
];
|
||||
|
||||
if ($object->model !== 'product') {
|
||||
if ('product' !== $object->model) {
|
||||
$sections['users']['fields']['modules_user_overwrite'] = $this->override_notice($object->get_limitations(false)->users->has_own_enabled());
|
||||
}
|
||||
|
||||
@ -401,7 +401,7 @@ class Limitation_Manager {
|
||||
],
|
||||
];
|
||||
|
||||
if ($object->model !== 'product') {
|
||||
if ('product' !== $object->model) {
|
||||
$sections['post_types']['fields']['post_quota_overwrite'] = $this->override_notice($object->get_limitations(false)->post_types->has_own_enabled());
|
||||
}
|
||||
|
||||
@ -437,7 +437,7 @@ class Limitation_Manager {
|
||||
],
|
||||
];
|
||||
|
||||
if ($object->model !== 'product') {
|
||||
if ('product' !== $object->model) {
|
||||
$sections['limit_disk_space']['fields']['disk_space_modules_overwrite'] = $this->override_notice($object->get_limitations(false)->disk_space->has_own_enabled());
|
||||
}
|
||||
|
||||
@ -454,7 +454,7 @@ class Limitation_Manager {
|
||||
],
|
||||
];
|
||||
|
||||
if ($object->model !== 'product') {
|
||||
if ('product' !== $object->model) {
|
||||
$sections['limit_disk_space']['fields']['disk_space_override'] = $this->override_notice($object->get_limitations(false)->disk_space->has_own_limit(), ['limit_disk_space']);
|
||||
}
|
||||
|
||||
@ -482,7 +482,7 @@ class Limitation_Manager {
|
||||
],
|
||||
];
|
||||
|
||||
if ($object->model !== 'product') {
|
||||
if ('product' !== $object->model) {
|
||||
$sections['custom_domain']['fields']['custom_domain_override'] = $this->override_notice($object->get_limitations(false)->domain_mapping->has_own_enabled(), ['allow_domain_mapping']);
|
||||
}
|
||||
|
||||
@ -620,7 +620,7 @@ class Limitation_Manager {
|
||||
/*
|
||||
* Add override notice.
|
||||
*/
|
||||
if ($object->model !== 'product') {
|
||||
if ('product' !== $object->model) {
|
||||
$sections['users']['fields'][ "override_{$user_role_slug}" ] = $this->override_notice($object->get_limitations(false)->users->exists($user_role_slug), ['limit_users']);
|
||||
}
|
||||
}
|
||||
@ -678,7 +678,7 @@ class Limitation_Manager {
|
||||
/*
|
||||
* Add override notice.
|
||||
*/
|
||||
if ($object->model !== 'product') {
|
||||
if ('product' !== $object->model) {
|
||||
$sections['post_types']['fields'][ "override_{$post_type_slug}" ] = $this->override_notice(
|
||||
$object->get_limitations(false)->post_types->exists($post_type_slug),
|
||||
[
|
||||
@ -711,7 +711,7 @@ class Limitation_Manager {
|
||||
],
|
||||
];
|
||||
|
||||
if ($object->model !== 'product') {
|
||||
if ('product' !== $object->model) {
|
||||
$fields['sites_overwrite'] = $this->override_notice($object->get_limitations(false)->sites->has_own_enabled());
|
||||
}
|
||||
|
||||
@ -741,7 +741,7 @@ class Limitation_Manager {
|
||||
],
|
||||
];
|
||||
|
||||
if ($object->model !== 'product') {
|
||||
if ('product' !== $object->model) {
|
||||
$fields['sites_overwrite_2'] = $this->override_notice($object->get_limitations(false)->sites->has_own_limit(), ["get_state_value('product_type', 'none') !== 'service' && limit_sites"]);
|
||||
}
|
||||
|
||||
|
@ -113,7 +113,7 @@ class Signup_Fields_Manager extends Base_Manager {
|
||||
*/
|
||||
public function get_instantiated_field_types() {
|
||||
|
||||
if ($this->instantiated_field_types === null) {
|
||||
if (null === $this->instantiated_field_types) {
|
||||
$this->instantiated_field_types = array_map([$this, 'instantiate_field_type'], $this->get_field_types());
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user