Everywhere yoda conditions are

This commit is contained in:
David Stone
2025-02-09 00:20:10 -07:00
parent d74f6d1a53
commit be0ab98895
213 changed files with 691 additions and 412 deletions

View File

@ -52,7 +52,7 @@ trait WP_Ultimo_Coupon_Deprecated {
$value = $this->get_meta('wpu_' . $key, false, true);
}
if ($value === null) {
if (null === $value) {
// translators: the placeholder is the key.
$message = sprintf(__('Discount Codes do not have a %s parameter', 'wp-ultimo'), $key);

View File

@ -183,7 +183,7 @@ trait WP_Ultimo_Plan_Deprecated {
$value = $is_unlimited ? __('Unlimited', 'wp-ultimo') : $this->get_limitations()->post_types->{$pt_slug}->number;
// Add Line
$label = $value == 1 ? $post_type->labels->singular_name : $post_type->labels->name;
$label = 1 == $value ? $post_type->labels->singular_name : $post_type->labels->name;
$pricing_table_lines[ 'wu_product_limit_post_type_' . $pt_slug ] = sprintf('%s %s', $value, $label);
}
@ -272,11 +272,11 @@ trait WP_Ultimo_Plan_Deprecated {
*/
public function get_quota($quota_name) {
if ($quota_name === 'visits') {
if ('visits' === $quota_name) {
$limit = (float) $this->get_limitations()->visits->get_limit();
} elseif ($quota_name === 'disk_space') {
} elseif ('disk_space' === $quota_name) {
$limit = (float) $this->get_limitations()->disk_space->get_limit();
} elseif ($quota_name === 'sites') {
} elseif ('sites' === $quota_name) {
$limit = (float) $this->get_limitations()->sites->get_limit();
} else {
$limit = (float) $this->get_limitations()->post_types->{$quota_name}->number;

View File

@ -45,7 +45,7 @@ trait WP_Ultimo_Settings_Deprecated {
$sections = apply_filters_deprecated('wu_settings_sections', [[]], '2.0.0', 'wu_register_settings_section()');
foreach ($sections as $section_key => $section) {
if ($section_key === 'activation') {
if ('activation' === $section_key) {
continue; // No activation stuff;
}