Skip to content
Snippets Groups Projects
Commit 156e7a40 authored by Pavel Břoušek's avatar Pavel Břoušek
Browse files

style: fix PSR 12 violations

parent ae0385ac
No related branches found
No related tags found
No related merge requests found
Pipeline #400354 passed
...@@ -109,11 +109,13 @@ class PIResponse ...@@ -109,11 +109,13 @@ class PIResponse
// Check that the authentication status is one of the allowed ones // Check that the authentication status is one of the allowed ones
$r = (!empty($map['result']['authentication'])) ? $map['result']['authentication'] : null; $r = (!empty($map['result']['authentication'])) ? $map['result']['authentication'] : null;
if (in_array( if (
$r, in_array(
[AuthenticationStatus::CHALLENGE, AuthenticationStatus::ACCEPT, AuthenticationStatus::REJECT], $r,
true [AuthenticationStatus::CHALLENGE, AuthenticationStatus::ACCEPT, AuthenticationStatus::REJECT],
)) { true
)
) {
$ret->authenticationStatus = $r; $ret->authenticationStatus = $r;
} else { } else {
$privacyIDEA->debugLog('Unknown authentication status'); $privacyIDEA->debugLog('Unknown authentication status');
......
...@@ -53,17 +53,20 @@ class PrivacyIDEA ...@@ -53,17 +53,20 @@ class PrivacyIDEA
public $timeout; public $timeout;
/** /**
* @var string Account name for a service account to the privacyIDEA server. This is required to use the /validate/triggerchallenge endpoint. * @var string Account name for a service account to the privacyIDEA server.
* This is required to use the /validate/triggerchallenge endpoint.
*/ */
public $serviceAccountName = ''; public $serviceAccountName = '';
/** /**
* @var string Password for a service account to the privacyIDEA server. This is required to use the /validate/triggerchallenge endpoint. * @var string Password for a service account to the privacyIDEA server.
* This is required to use the /validate/triggerchallenge endpoint.
*/ */
public $serviceAccountPass = ''; public $serviceAccountPass = '';
/** /**
* @var string Realm for a service account to the privacyIDEA server. This is required to use the /validate/triggerchallenge endpoint. This is optional. * @var string Realm for a service account to the privacyIDEA server.
* This is required to use the /validate/triggerchallenge endpoint. This is optional.
*/ */
public $serviceAccountRealm = ''; public $serviceAccountRealm = '';
...@@ -88,8 +91,10 @@ class PrivacyIDEA ...@@ -88,8 +91,10 @@ class PrivacyIDEA
* Try to authenticate the user with the /validate/check endpoint. * Try to authenticate the user with the /validate/check endpoint.
* *
* @param string $username * @param string $username
* @param string $pass this can be the OTP, but also the PIN to trigger a token or PIN+OTP depending on the configuration of the server * @param string $pass this can be the OTP, but also the PIN to trigger
* @param null $transactionID Optional transaction ID. Used to reference a challenge that was triggered beforehand. * a token or PIN+OTP depending on the configuration of the server
* @param null $transactionID Optional transaction ID. Used to reference
* a challenge that was triggered beforehand.
* *
* @return PIResponse|null null if response was empty or malformed, or parameter missing * @return PIResponse|null null if response was empty or malformed, or parameter missing
*/ */
...@@ -198,8 +203,7 @@ class PrivacyIDEA ...@@ -198,8 +203,7 @@ class PrivacyIDEA
$genkey, $genkey,
$type, $type,
$description = '' $description = ''
) // No return type because mixed not allowed yet ) { // No return type because mixed not allowed yet
{
assert(gettype($username) === 'string'); assert(gettype($username) === 'string');
assert(gettype($type) === 'string'); assert(gettype($type) === 'string');
assert(gettype($genkey) === 'string'); assert(gettype($genkey) === 'string');
...@@ -349,7 +353,8 @@ class PrivacyIDEA ...@@ -349,7 +353,8 @@ class PrivacyIDEA
* Retrieves an auth token from the server using the service account. An auth token is required for some requests to * Retrieves an auth token from the server using the service account. An auth token is required for some requests to
* privacyIDEA. * privacyIDEA.
* *
* @return string the auth token or empty string if the response did not contain a token or no service account is configured * @return string the auth token or empty string if the response
* did not contain a token or no service account is configured
*/ */
public function getAuthToken() public function getAuthToken()
{ {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment