Use new code style

This commit is contained in:
David Stone
2025-02-07 19:02:33 -07:00
parent 0181024ae1
commit 8433379d90
672 changed files with 37107 additions and 45249 deletions

View File

@ -44,12 +44,14 @@ class Unique extends Rule {
*
* @param mixed $value Value being checked.
*/
public function check($value) : bool {
public function check($value): bool {
$this->requireParameters(array(
'model',
'column',
));
$this->requireParameters(
array(
'model',
'column',
)
);
$column = $this->parameter('column');
$model = $this->parameter('model');
@ -76,24 +78,18 @@ class Unique extends Rule {
* Customize the error message for the customer.
*/
if (in_array($model, $user_models, true)) {
$this->message = __('A customer with the same email address or username already exists.', 'wp-ultimo');
}
} // end if;
if (!$existing) {
if ( ! $existing) {
return true;
} // end if;
}
if ( $existing instanceof \WP_User) {
$id = $existing->ID;
} else {
$id = method_exists( $existing, 'get_id' ) ? $existing->get_id() : $existing->id;
$id = method_exists($existing, 'get_id') ? $existing->get_id() : $existing->id;
}
return absint($id) === absint($self_id);
} // end check;
} // end class Unique;
}
}