From 31a3fe3cfea6c20118c9ad2371761dfc44d45b2f Mon Sep 17 00:00:00 2001 From: Tim van Dijen <tvdijen@gmail.com> Date: Mon, 6 Aug 2018 12:16:18 +0200 Subject: [PATCH] Spaces / Braces / Remove dead code --- lib/SimpleSAML/Session.php | 1 - modules/cas/lib/Auth/Source/CAS.php | 2 -- modules/core/lib/Auth/Process/AttributeRealm.php | 2 -- modules/core/lib/Auth/Process/PHP.php | 2 +- modules/core/www/frontpage_federation.php | 4 ++-- modules/discopower/lib/PowerIdPDisco.php | 1 - 6 files changed, 3 insertions(+), 9 deletions(-) diff --git a/lib/SimpleSAML/Session.php b/lib/SimpleSAML/Session.php index cf4ff6e3b..cf227a737 100644 --- a/lib/SimpleSAML/Session.php +++ b/lib/SimpleSAML/Session.php @@ -251,7 +251,6 @@ class Session implements \Serializable } // check if we have stored a session stored with the session handler - $session = null; try { $session = self::getSession(); } catch (\Exception $e) { diff --git a/modules/cas/lib/Auth/Source/CAS.php b/modules/cas/lib/Auth/Source/CAS.php index e58f36f11..7b7f9a3d1 100644 --- a/modules/cas/lib/Auth/Source/CAS.php +++ b/modules/cas/lib/Auth/Source/CAS.php @@ -166,10 +166,8 @@ class CAS extends \SimpleSAML\Auth\Source { case 'validate': return $this->casValidate($ticket, $service); - break; case 'serviceValidate': return $this->casServiceValidate($ticket, $service); - break; default: throw new \Exception("validate or serviceValidate not specified"); } diff --git a/modules/core/lib/Auth/Process/AttributeRealm.php b/modules/core/lib/Auth/Process/AttributeRealm.php index c32543d8b..9b16dcd0d 100644 --- a/modules/core/lib/Auth/Process/AttributeRealm.php +++ b/modules/core/lib/Auth/Process/AttributeRealm.php @@ -41,8 +41,6 @@ class AttributeRealm extends \SimpleSAML\Auth\ProcessingFilter assert(is_array($request)); assert(array_key_exists('Attributes', $request)); - $attributes =& $request['Attributes']; - if (!array_key_exists('UserID', $request)) { throw new \Exception('core:AttributeRealm: Missing UserID for this user. Please' . ' check the \'userid.attribute\' option in the metadata against the' . diff --git a/modules/core/lib/Auth/Process/PHP.php b/modules/core/lib/Auth/Process/PHP.php index 386a59919..7a538ec1b 100644 --- a/modules/core/lib/Auth/Process/PHP.php +++ b/modules/core/lib/Auth/Process/PHP.php @@ -49,7 +49,7 @@ class PHP extends \SimpleSAML\Auth\ProcessingFilter assert(is_array($request)); assert(array_key_exists('Attributes', $request)); - $function = function(&$attributes) { eval($this->code); }; + $function = function(/** @scrutinizer ignore-unused */ &$attributes) { eval($this->code); }; $function($request['Attributes']); } } diff --git a/modules/core/www/frontpage_federation.php b/modules/core/www/frontpage_federation.php index 7aa3d617f..ec0132ac8 100644 --- a/modules/core/www/frontpage_federation.php +++ b/modules/core/www/frontpage_federation.php @@ -75,7 +75,7 @@ if ($config->getBoolean('enable.shib13-idp', false) === true) { $metaentries['remote']['shib13-sp-remote'] = $metadata->getList('shib13-sp-remote'); } } catch (Exception $e) { - \SimpleSAML\Logger::error('Federation: Error loading shib13-idp: ' . $e->getMessage()); + \SimpleSAML\Logger::error('Federation: Error loading shib13-idp: '.$e->getMessage()); } } if ($config->getBoolean('enable.adfs-idp', false) === true) { @@ -89,7 +89,7 @@ if ($config->getBoolean('enable.adfs-idp', false) === true) { $metaentries['remote']['adfs-sp-remote'] = $metadata->getList('adfs-sp-remote'); } } catch (Exception $e) { - \SimpleSAML\Logger::error('Federation: Error loading adfs-idp: ' . $e->getMessage()); + \SimpleSAML\Logger::error('Federation: Error loading adfs-idp: '.$e->getMessage()); } } diff --git a/modules/discopower/lib/PowerIdPDisco.php b/modules/discopower/lib/PowerIdPDisco.php index e44d7c244..0a448d2de 100644 --- a/modules/discopower/lib/PowerIdPDisco.php +++ b/modules/discopower/lib/PowerIdPDisco.php @@ -272,7 +272,6 @@ class PowerIdPDisco extends \SimpleSAML\XHTML\IdPDisco $idpList = $this->processMetadata($t, $idpList, $preferredIdP); $t->data['idplist'] = $idpList; - $faventry = null; foreach ($idpList as $tab => $slist) { if (!empty($preferredIdP) && array_key_exists($preferredIdP, $slist)) { $t->data['faventry'] = $slist[$preferredIdP]; -- GitLab