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

@ -30,6 +30,7 @@ class SSO_Broker extends Broker {
public function is_must_redirect_call(): bool {
return $this->getVerificationCode() === 'must-redirect';
}
/**
* Get URL to attach session at SSO server.
*

View File

@ -46,6 +46,7 @@ class SSO_Session_Handler implements SessionInterface {
public function __construct(\WP_Ultimo\SSO\SSO $sso_manager = null) {
$this->sso_manager = $sso_manager;
}
/**
* Returns the session id.
*
@ -54,6 +55,7 @@ class SSO_Session_Handler implements SessionInterface {
public function getId(): string { // phpcs:ignore
return $this->sso_manager->input('broker');
}
/**
* Start a new session.
*
@ -74,6 +76,7 @@ class SSO_Session_Handler implements SessionInterface {
set_site_transient("sso-{$site_hash}-{$id}", get_current_user_id(), 180);
}
/**
* Resume an existing session.
*
@ -94,6 +97,7 @@ class SSO_Session_Handler implements SessionInterface {
$this->sso_manager->set_target_user_id($user_id);
}
}
/**
* Check if a session is active. (status PHP_SESSION_ACTIVE).
*

View File

@ -470,7 +470,7 @@ class SSO {
status_header($response_code);
exit;
} elseif ($response_type === 'redirect') {
} elseif ('redirect' === $response_type) {
$args = [
'sso_verify' => $verification_code ?: 'invalid',
];
@ -548,7 +548,7 @@ class SSO {
exit();
}
if ($response_type === 'jsonp') {
if ('jsonp' === $response_type) {
echo '// Nothing to see here.';
exit;
@ -658,6 +658,7 @@ class SSO {
* @throws NotAttachedException
*/
}
return $current_user_id;
}
@ -859,6 +860,7 @@ class SSO {
if ( ! $action) {
$action = $this->input($sso_path, 'done') !== 'done' ? $sso_path : '';
}
if ( ! $action) {
$action = $this->input("$sso_path-grant", 'done') !== 'done' ? "$sso_path-grant" : '';
}
@ -1046,6 +1048,7 @@ class SSO {
public function get_target_user_id() {
return $this->target_user_id;
}
/**
* Get the url path for SSO.
*