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

@ -35,28 +35,22 @@ class State extends Rule {
*
* @param mixed $state The state value detected.
*/
public function check($state) : bool { // phpcs:ignore
public function check($state) : bool { // phpcs:ignore
$check = true;
$country = $this->parameter('country') ?? wu_request('billing_country');
if ($country && $state) {
$state = strtoupper((string) $state);
$allowed_states = array_keys(wu_get_country_states(strtoupper((string) $country), false));
if (!empty($allowed_states)) {
if (! empty($allowed_states)) {
$check = in_array($state, $allowed_states, true);
} // end if;
} // end if;
}
}
return $check;
} // end check;
} // end class State;
}
}