Skip to content

Commit

Permalink
Merge pull request #37 from NetKnights-GmbH/34-catch-the-exceptions
Browse files Browse the repository at this point in the history
34 catch the exceptions
  • Loading branch information
lukasmatusiewicz authored Feb 13, 2023
2 parents 6b2b2cc + f149ea1 commit 1e11d50
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@ public function authenticate(&$state)
* @param string $username The username the user wrote.
* @param string $password The password the user wrote.
*/
protected function login(string $username, string $password)
protected function login($username, $password)
{
// Stub.
SimpleSAML_Logger::debug("privacyIDEA AuthSource login stub");
Expand Down
8 changes: 4 additions & 4 deletions simplesamlphp-module-privacyidea/lib/Auth/Utils.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ class sspmod_privacyidea_Auth_Utils
* @return PIResponse|null An array containing attributes and detail, or NULL.
* @throws Exception
*/
public static function authenticatePI(array &$state, array $formParams)
public static function authenticatePI(array &$state, array $formParams): ?PIResponse
{
assert('array' === gettype($state));
assert('array' === gettype($formParams));
Expand Down Expand Up @@ -229,7 +229,7 @@ public static function handleLogout()
* @param array $config
* @return PrivacyIDEA|null privacyIDEA object or null on error
*/
public static function createPrivacyIDEAInstance(array $config)
public static function createPrivacyIDEAInstance(array $config): ?PrivacyIDEA
{
if (!empty($config['privacyideaServerURL']))
{
Expand Down Expand Up @@ -414,7 +414,7 @@ public static function processPIResponse(string $stateId, PIResponse $response):
* Determine the clients IP-Address.
* @return string|null The IP-Address of the client.
*/
public static function getClientIP()
public static function getClientIP(): ?string
{
$result = @$_SERVER['HTTP_X_FORWARDED_FOR'] ?: @$_SERVER['REMOTE_ADDR'] ?: @$_SERVER['HTTP_CLIENT_IP'];
SimpleSAML_Logger::debug('privacyIDEA: client ip: ' . $result);
Expand Down Expand Up @@ -447,4 +447,4 @@ public static function checkUidKey(array $config, array $state): array
}
return $config;
}
}
}

0 comments on commit 1e11d50

Please sign in to comment.