diff --git a/lib/SimpleSAML/Auth/ProcessingFilter.php b/lib/SimpleSAML/Auth/ProcessingFilter.php index a83c348b158ac04d9ac35252bcc0ce0f6f30bf2d..65827c6dfd5491c9749534eba5a81871fe17e667 100644 --- a/lib/SimpleSAML/Auth/ProcessingFilter.php +++ b/lib/SimpleSAML/Auth/ProcessingFilter.php @@ -60,7 +60,7 @@ abstract class ProcessingFilter * * When a filter returns from this function, it is assumed to have completed its task. * - * @param array &$request The request we are currently processing. + * @param array &$state The request we are currently processing. */ - abstract public function process(array &$request): void; + abstract public function process(array &$state): void; } diff --git a/lib/SimpleSAML/Error/CriticalConfigurationError.php b/lib/SimpleSAML/Error/CriticalConfigurationError.php index 9add0d009dc3007efb1dcdfb20243b18e478cd8e..04b2a044862f45afaaa20efbcbc6135ac3995b2a 100644 --- a/lib/SimpleSAML/Error/CriticalConfigurationError.php +++ b/lib/SimpleSAML/Error/CriticalConfigurationError.php @@ -67,19 +67,19 @@ class CriticalConfigurationError extends ConfigurationError /** - * @param \Throwable $exception + * @param \Throwable $e * * @return \SimpleSAML\Error\CriticalConfigurationError */ - public static function fromException(Throwable $exception): CriticalConfigurationError + public static function fromException(Throwable $e): CriticalConfigurationError { $reason = null; $file = null; - if ($exception instanceof ConfigurationError) { - $reason = $exception->getReason(); - $file = $exception->getConfFile(); + if ($e instanceof ConfigurationError) { + $reason = $e->getReason(); + $file = $e->getConfFile(); } else { - $reason = $exception->getMessage(); + $reason = $e->getMessage(); } return new CriticalConfigurationError($reason, $file); } diff --git a/modules/core/lib/Auth/Process/AttributeAdd.php b/modules/core/lib/Auth/Process/AttributeAdd.php index d30084a8738a59201f39f8c7e14d9d92b0ccab9a..10c571fb5b761c0771372454a9daa5167e8e575b 100644 --- a/modules/core/lib/Auth/Process/AttributeAdd.php +++ b/modules/core/lib/Auth/Process/AttributeAdd.php @@ -73,13 +73,13 @@ class AttributeAdd extends Auth\ProcessingFilter * * Add or replace existing attributes with the configured values. * - * @param array &$request The current request + * @param array &$state The current request */ - public function process(array &$request): void + public function process(array &$state): void { - Assert::keyExists($request, 'Attributes'); + Assert::keyExists($state, 'Attributes'); - $attributes = &$request['Attributes']; + $attributes = &$state['Attributes']; foreach ($this->attributes as $name => $values) { if ($this->replace === true || !array_key_exists($name, $attributes)) { diff --git a/modules/core/lib/Auth/Process/AttributeAlter.php b/modules/core/lib/Auth/Process/AttributeAlter.php index 29a2c0823aa7aae0041d2c46217cf20168875147..e6db082d689f69639292666a4b0e367c33b7fc6e 100644 --- a/modules/core/lib/Auth/Process/AttributeAlter.php +++ b/modules/core/lib/Auth/Process/AttributeAlter.php @@ -99,15 +99,15 @@ class AttributeAlter extends Auth\ProcessingFilter * * Modify existing attributes with the configured values. * - * @param array &$request The current request. + * @param array &$state The current request. * @throws \SimpleSAML\Error\Exception In case of invalid configuration. */ - public function process(array &$request): void + public function process(array &$state): void { - Assert::keyExists($request, 'Attributes'); + Assert::keyExists($state, 'Attributes'); // get attributes from request - $attributes = &$request['Attributes']; + $attributes = &$state['Attributes']; // check that all required params are set in config if (empty($this->pattern) || empty($this->subject)) { diff --git a/modules/core/lib/Auth/Process/AttributeCopy.php b/modules/core/lib/Auth/Process/AttributeCopy.php index 199e4a8a24464f419878d27891bd638f4544a0eb..31c9297675b925ccb884f6d85c17d4a238320cd1 100644 --- a/modules/core/lib/Auth/Process/AttributeCopy.php +++ b/modules/core/lib/Auth/Process/AttributeCopy.php @@ -58,13 +58,13 @@ class AttributeCopy extends Auth\ProcessingFilter /** * Apply filter to rename attributes. * - * @param array &$request The current request + * @param array &$state The current request */ - public function process(array &$request): void + public function process(array &$state): void { - Assert::keyExists($request, 'Attributes'); + Assert::keyExists($state, 'Attributes'); - $attributes = &$request['Attributes']; + $attributes = &$state['Attributes']; foreach ($attributes as $name => $values) { if (array_key_exists($name, $this->map)) { diff --git a/modules/core/lib/Auth/Process/AttributeLimit.php b/modules/core/lib/Auth/Process/AttributeLimit.php index 490940f3084293df10e530658373634bac353679..e2f3c5041ae4c1b6f1c9248d19e1963d6af75db9 100644 --- a/modules/core/lib/Auth/Process/AttributeLimit.php +++ b/modules/core/lib/Auth/Process/AttributeLimit.php @@ -64,18 +64,18 @@ class AttributeLimit extends Auth\ProcessingFilter /** * Get list of allowed from the SP/IdP config. * - * @param array &$request The current request. + * @param array &$state The current request. * @return array|null Array with attribute names, or NULL if no limit is placed. */ - private static function getSPIdPAllowed(array &$request): ?array + private static function getSPIdPAllowed(array &$state): ?array { - if (array_key_exists('attributes', $request['Destination'])) { + if (array_key_exists('attributes', $state['Destination'])) { // SP Config - return $request['Destination']['attributes']; + return $state['Destination']['attributes']; } - if (array_key_exists('attributes', $request['Source'])) { + if (array_key_exists('attributes', $state['Source'])) { // IdP Config - return $request['Source']['attributes']; + return $state['Source']['attributes']; } return null; } @@ -86,29 +86,29 @@ class AttributeLimit extends Auth\ProcessingFilter * * Removes all attributes which aren't one of the allowed attributes. * - * @param array &$request The current request + * @param array &$state The current request * @throws \SimpleSAML\Error\Exception If invalid configuration is found. */ - public function process(array &$request): void + public function process(array &$state): void { - assert::keyExists($request, 'Attributes'); + assert::keyExists($state, 'Attributes'); if ($this->isDefault) { - $allowedAttributes = self::getSPIdPAllowed($request); + $allowedAttributes = self::getSPIdPAllowed($state); if ($allowedAttributes === null) { $allowedAttributes = $this->allowedAttributes; } } elseif (!empty($this->allowedAttributes)) { $allowedAttributes = $this->allowedAttributes; } else { - $allowedAttributes = self::getSPIdPAllowed($request); + $allowedAttributes = self::getSPIdPAllowed($state); if ($allowedAttributes === null) { // No limit on attributes return; } } - $attributes = &$request['Attributes']; + $attributes = &$state['Attributes']; foreach ($attributes as $name => $values) { if (!in_array($name, $allowedAttributes, true)) { diff --git a/modules/core/lib/Auth/Process/AttributeMap.php b/modules/core/lib/Auth/Process/AttributeMap.php index 3fd36bdae63c4c997d8df4d17133569052e6bccc..16cf735ddbc1285e98f175df17d298ea75079ba1 100644 --- a/modules/core/lib/Auth/Process/AttributeMap.php +++ b/modules/core/lib/Auth/Process/AttributeMap.php @@ -115,15 +115,15 @@ class AttributeMap extends Auth\ProcessingFilter /** * Apply filter to rename attributes. * - * @param array &$request The current request. + * @param array &$state The current request. */ - public function process(array &$request): void + public function process(array &$state): void { - Assert::keyExists($request, 'Attributes'); + Assert::keyExists($state, 'Attributes'); $mapped_attributes = []; - foreach ($request['Attributes'] as $name => $values) { + foreach ($state['Attributes'] as $name => $values) { if (array_key_exists($name, $this->map)) { if (!is_array($this->map[$name])) { if ($this->duplicate) { @@ -146,6 +146,6 @@ class AttributeMap extends Auth\ProcessingFilter } } - $request['Attributes'] = $mapped_attributes; + $state['Attributes'] = $mapped_attributes; } } diff --git a/modules/core/lib/Auth/Process/AttributeValueMap.php b/modules/core/lib/Auth/Process/AttributeValueMap.php index 26636d35bb4d020a40d1c76d9bc0a77e912370dd..e4457633b0fe16ece896f4762069c42add634cc5 100644 --- a/modules/core/lib/Auth/Process/AttributeValueMap.php +++ b/modules/core/lib/Auth/Process/AttributeValueMap.php @@ -107,14 +107,14 @@ class AttributeValueMap extends Auth\ProcessingFilter /** * Apply filter. * - * @param array &$request The current request + * @param array &$state The current request */ - public function process(array &$request): void + public function process(array &$state): void { Logger::debug('Processing the AttributeValueMap filter.'); - Assert::keyExists($request, 'Attributes'); - $attributes = &$request['Attributes']; + Assert::keyExists($state, 'Attributes'); + $attributes = &$state['Attributes']; if (!array_key_exists($this->sourceattribute, $attributes)) { // the source attribute does not exist, nothing to do here diff --git a/modules/core/lib/Auth/Process/Cardinality.php b/modules/core/lib/Auth/Process/Cardinality.php index 0a15500e0084f7419f8dbfa3d6c48b3ad13865f7..bbc3e4603564dc3a872dccf5fa410270c986d6b4 100644 --- a/modules/core/lib/Auth/Process/Cardinality.php +++ b/modules/core/lib/Auth/Process/Cardinality.php @@ -106,22 +106,22 @@ class Cardinality extends Auth\ProcessingFilter /** * Process this filter * - * @param array &$request The current request + * @param array &$state The current request */ - public function process(array &$request): void + public function process(array &$state): void { - Assert::keyExists($request, 'Attributes'); + Assert::keyExists($state, 'Attributes'); $entityid = false; - if (array_key_exists('Source', $request) && array_key_exists('entityid', $request['Source'])) { - $entityid = $request['Source']['entityid']; + if (array_key_exists('Source', $state) && array_key_exists('entityid', $state['Source'])) { + $entityid = $state['Source']['entityid']; } if (in_array($entityid, $this->ignoreEntities, true)) { Logger::debug('Cardinality: Ignoring assertions from ' . $entityid); return; } - foreach ($request['Attributes'] as $k => $v) { + foreach ($state['Attributes'] as $k => $v) { if (!array_key_exists($k, $this->cardinality)) { continue; } @@ -142,7 +142,7 @@ class Cardinality extends Auth\ProcessingFilter ) ); } else { - $request['core:cardinality:errorAttributes'][$k] = [ + $state['core:cardinality:errorAttributes'][$k] = [ count($v), $this->cardinality[$k]['_expr'] ]; @@ -163,7 +163,7 @@ class Cardinality extends Auth\ProcessingFilter ) ); } else { - $request['core:cardinality:errorAttributes'][$k] = [ + $state['core:cardinality:errorAttributes'][$k] = [ count($v), $this->cardinality[$k]['_expr'] ]; @@ -174,7 +174,7 @@ class Cardinality extends Auth\ProcessingFilter /* check for missing attributes with a minimum cardinality */ foreach ($this->cardinality as $k => $v) { - if (!$this->cardinality[$k]['min'] || array_key_exists($k, $request['Attributes'])) { + if (!$this->cardinality[$k]['min'] || array_key_exists($k, $state['Attributes'])) { continue; } if ($this->cardinality[$k]['warn']) { @@ -184,7 +184,7 @@ class Cardinality extends Auth\ProcessingFilter $entityid )); } else { - $request['core:cardinality:errorAttributes'][$k] = [ + $state['core:cardinality:errorAttributes'][$k] = [ 0, $this->cardinality[$k]['_expr'] ]; @@ -192,8 +192,8 @@ class Cardinality extends Auth\ProcessingFilter } /* abort if we found a problematic attribute */ - if (array_key_exists('core:cardinality:errorAttributes', $request)) { - $id = Auth\State::saveState($request, 'core:cardinality'); + if (array_key_exists('core:cardinality:errorAttributes', $state)) { + $id = Auth\State::saveState($state, 'core:cardinality'); $url = Module::getModuleURL('core/cardinality_error.php'); $this->httpUtils->redirectTrustedURL($url, ['StateId' => $id]); return; diff --git a/modules/core/lib/Auth/Process/CardinalitySingle.php b/modules/core/lib/Auth/Process/CardinalitySingle.php index 64c5e059583bd511c62c4a292e66c1da79db3ebf..4b31a2b456c8663be5ca566011a86b6aad92100a 100644 --- a/modules/core/lib/Auth/Process/CardinalitySingle.php +++ b/modules/core/lib/Auth/Process/CardinalitySingle.php @@ -81,22 +81,22 @@ class CardinalitySingle extends Auth\ProcessingFilter /** * Process this filter * - * @param array &$request The current request + * @param array &$state The current request */ - public function process(array &$request): void + public function process(array &$state): void { - Assert::keyExists($request, 'Attributes'); + Assert::keyExists($state, 'Attributes'); if ( - array_key_exists('Source', $request) - && array_key_exists('entityid', $request['Source']) - && in_array($request['Source']['entityid'], $this->ignoreEntities, true) + array_key_exists('Source', $state) + && array_key_exists('entityid', $state['Source']) + && in_array($state['Source']['entityid'], $this->ignoreEntities, true) ) { - Logger::debug('CardinalitySingle: Ignoring assertions from ' . $request['Source']['entityid']); + Logger::debug('CardinalitySingle: Ignoring assertions from ' . $state['Source']['entityid']); return; } - foreach ($request['Attributes'] as $k => $v) { + foreach ($state['Attributes'] as $k => $v) { if (!is_array($v)) { continue; } @@ -105,22 +105,22 @@ class CardinalitySingle extends Auth\ProcessingFilter } if (in_array($k, $this->singleValued)) { - $request['core:cardinality:errorAttributes'][$k] = [count($v), '0 ≤ n ≤ 1']; + $state['core:cardinality:errorAttributes'][$k] = [count($v), '0 ≤ n ≤ 1']; continue; } if (in_array($k, $this->firstValue)) { - $request['Attributes'][$k] = [array_shift($v)]; + $state['Attributes'][$k] = [array_shift($v)]; continue; } if (in_array($k, $this->flatten)) { - $request['Attributes'][$k] = [implode($this->flattenWith, $v)]; + $state['Attributes'][$k] = [implode($this->flattenWith, $v)]; continue; } } /* abort if we found a problematic attribute */ - if (array_key_exists('core:cardinality:errorAttributes', $request)) { - $id = Auth\State::saveState($request, 'core:cardinality'); + if (array_key_exists('core:cardinality:errorAttributes', $state)) { + $id = Auth\State::saveState($state, 'core:cardinality'); $url = Module::getModuleURL('core/cardinality_error.php'); $this->httpUtils->redirectTrustedURL($url, ['StateId' => $id]); return; diff --git a/modules/core/lib/Auth/Process/GenerateGroups.php b/modules/core/lib/Auth/Process/GenerateGroups.php index 2a8eadef7a1930a5e7e180ddfbd60e7954983aea..89e8b4c21cb25fde994d6c513730bb5fb6ff6956 100644 --- a/modules/core/lib/Auth/Process/GenerateGroups.php +++ b/modules/core/lib/Auth/Process/GenerateGroups.php @@ -56,14 +56,14 @@ class GenerateGroups extends Auth\ProcessingFilter /** * Apply filter to add groups attribute. * - * @param array &$request The current request + * @param array &$state The current request */ - public function process(array &$request): void + public function process(array &$state): void { - Assert::keyExists($request, 'Attributes'); + Assert::keyExists($state, 'Attributes'); $groups = []; - $attributes = &$request['Attributes']; + $attributes = &$state['Attributes']; $realm = self::getRealm($attributes); if ($realm !== null) { diff --git a/modules/core/lib/Auth/Process/LanguageAdaptor.php b/modules/core/lib/Auth/Process/LanguageAdaptor.php index c621172e6f61129548a03c457c34b3618b2c236d..d38588e2eaadce68202b9b4556128bb70eabb473 100644 --- a/modules/core/lib/Auth/Process/LanguageAdaptor.php +++ b/modules/core/lib/Auth/Process/LanguageAdaptor.php @@ -41,13 +41,13 @@ class LanguageAdaptor extends Auth\ProcessingFilter * * Add or replace existing attributes with the configured values. * - * @param array &$request The current request + * @param array &$state The current request */ - public function process(array &$request): void + public function process(array &$state): void { - Assert::keyExists($request, 'Attributes'); + Assert::keyExists($state, 'Attributes'); - $attributes = &$request['Attributes']; + $attributes = &$state['Attributes']; $attrlang = null; if (array_key_exists($this->langattr, $attributes)) { @@ -68,7 +68,7 @@ class LanguageAdaptor extends Auth\ProcessingFilter Language::setLanguageCookie($attrlang); } elseif (!isset($attrlang) && isset($lang)) { // Language set in cookie, but not in attribute. Update attribute - $request['Attributes'][$this->langattr] = [$lang]; + $state['Attributes'][$this->langattr] = [$lang]; } } } diff --git a/modules/core/lib/Auth/Process/PHP.php b/modules/core/lib/Auth/Process/PHP.php index 15428a461a4cce69e45f34cc1704fe8c58d1df7c..d2005eec3667ba21cd423fa28969e4c7146880a1 100644 --- a/modules/core/lib/Auth/Process/PHP.php +++ b/modules/core/lib/Auth/Process/PHP.php @@ -46,13 +46,11 @@ class PHP extends Auth\ProcessingFilter /** * Apply the PHP code to the attributes. * - * @param array &$request The current request - * - * @scrutinizer ignore-unused + * @param array &$state The current request */ - public function process(array &$request): void + public function process(array &$state): void { - Assert::keyExists($request, 'Attributes'); + Assert::keyExists($state, 'Attributes'); /** * @param array &$attributes @@ -64,6 +62,6 @@ class PHP extends Auth\ProcessingFilter ) { eval($this->code); }; - $function($request['Attributes'], $request); + $function($state['Attributes'], $state); } } diff --git a/modules/core/lib/Auth/Process/ScopeAttribute.php b/modules/core/lib/Auth/Process/ScopeAttribute.php index 18955f9f64fbc171c3857504f4f3cf49dca18025..aec51485d558bab25749c58de9c564abf12e0ac4 100644 --- a/modules/core/lib/Auth/Process/ScopeAttribute.php +++ b/modules/core/lib/Auth/Process/ScopeAttribute.php @@ -67,13 +67,13 @@ class ScopeAttribute extends Auth\ProcessingFilter /** * Apply this filter to the request. * - * @param array &$request The current request + * @param array &$state The current request */ - public function process(array &$request): void + public function process(array &$state): void { - Assert::keyExists($request, 'Attributes'); + Assert::keyExists($state, 'Attributes'); - $attributes = &$request['Attributes']; + $attributes = &$state['Attributes']; if (!isset($attributes[$this->scopeAttribute])) { return; diff --git a/modules/core/lib/Auth/Process/ScopeFromAttribute.php b/modules/core/lib/Auth/Process/ScopeFromAttribute.php index 7734cacb42b2ba35107cb8aff953e2dbe86ec710..be54edaea628360f2633f3bdeea64bd1e0a3896f 100644 --- a/modules/core/lib/Auth/Process/ScopeFromAttribute.php +++ b/modules/core/lib/Auth/Process/ScopeFromAttribute.php @@ -61,13 +61,13 @@ class ScopeFromAttribute extends Auth\ProcessingFilter /** * Apply this filter. * - * @param array &$request The current request + * @param array &$state The current request */ - public function process(array &$request): void + public function process(array &$state): void { - Assert::keyExists($request, 'Attributes'); + Assert::keyExists($state, 'Attributes'); - $attributes = &$request['Attributes']; + $attributes = &$state['Attributes']; if (!isset($attributes[$this->sourceAttribute])) { return; diff --git a/modules/saml/lib/Auth/Process/ExpectedAuthnContextClassRef.php b/modules/saml/lib/Auth/Process/ExpectedAuthnContextClassRef.php index 2ffd641a6695540280fa9b5c842a93311d743f61..103d618e7a76acd7d9376e5845680f0e7879241c 100644 --- a/modules/saml/lib/Auth/Process/ExpectedAuthnContextClassRef.php +++ b/modules/saml/lib/Auth/Process/ExpectedAuthnContextClassRef.php @@ -69,17 +69,16 @@ class ExpectedAuthnContextClassRef extends ProcessingFilter /** - * - * @param array &$request The current request + * @param array &$state The current request */ - public function process(array &$request): void + public function process(array &$state): void { - Assert::keyExists($request, 'Attributes'); + Assert::keyExists($state, 'Attributes'); - $this->AuthnContextClassRef = $request['saml:sp:State']['saml:sp:AuthnContext']; + $this->AuthnContextClassRef = $state['saml:sp:State']['saml:sp:AuthnContext']; if (!in_array($this->AuthnContextClassRef, $this->accepted, true)) { - $this->unauthorized($request); + $this->unauthorized($state); } } @@ -94,16 +93,16 @@ class ExpectedAuthnContextClassRef extends ProcessingFilter * thinking in case a "chained" ACL is needed, more complex * permission logic. * - * @param array $request + * @param array $state */ - protected function unauthorized(array &$request): void + protected function unauthorized(array &$state): void { Logger::error( 'ExpectedAuthnContextClassRef: Invalid authentication context: ' . strval($this->AuthnContextClassRef) . '. Accepted values are: ' . var_export($this->accepted, true) ); - $id = Auth\State::saveState($request, 'saml:ExpectedAuthnContextClassRef:unauthorized'); + $id = Auth\State::saveState($state, 'saml:ExpectedAuthnContextClassRef:unauthorized'); $url = Module::getModuleURL( 'saml/sp/wrong_authncontextclassref.php' ); diff --git a/modules/saml/lib/Auth/Process/FilterScopes.php b/modules/saml/lib/Auth/Process/FilterScopes.php index b0fb75237d7fa7e4384af1bdc89fb6ad9436b655..13b9753702c5d33f4597507b3e447e5ccb3c83cc 100644 --- a/modules/saml/lib/Auth/Process/FilterScopes.php +++ b/modules/saml/lib/Auth/Process/FilterScopes.php @@ -43,27 +43,27 @@ class FilterScopes extends ProcessingFilter /** * This method applies the filter, removing any values * - * @param array &$request the current request + * @param array &$state the current request */ - public function process(array &$request): void + public function process(array &$state): void { - $src = $request['Source']; + $src = $state['Source']; $validScopes = []; $host = ''; if (array_key_exists('scope', $src) && is_array($src['scope']) && !empty($src['scope'])) { $validScopes = $src['scope']; } else { - $ep = Utils\Config\Metadata::getDefaultEndpoint($request['Source']['SingleSignOnService']); + $ep = Utils\Config\Metadata::getDefaultEndpoint($state['Source']['SingleSignOnService']); $host = parse_url($ep['Location'], PHP_URL_HOST) ?? ''; } foreach ($this->scopedAttributes as $attribute) { - if (!isset($request['Attributes'][$attribute])) { + if (!isset($state['Attributes'][$attribute])) { continue; } - $values = $request['Attributes'][$attribute]; + $values = $state['Attributes'][$attribute]; $newValues = []; foreach ($values as $value) { @list(, $scope) = explode('@', $value, 2); @@ -83,9 +83,9 @@ class FilterScopes extends ProcessingFilter if (empty($newValues)) { Logger::warning("No suitable values for attribute '$attribute', removing it."); - unset($request['Attributes'][$attribute]); // remove empty attributes + unset($state['Attributes'][$attribute]); // remove empty attributes } else { - $request['Attributes'][$attribute] = $newValues; + $state['Attributes'][$attribute] = $newValues; } } } diff --git a/modules/saml/lib/Error.php b/modules/saml/lib/Error.php index 7a4655470615f4d24b028e88cce6310136377baa..d54d40dfe3bb65315210ca1d8710d71905fff2d3 100644 --- a/modules/saml/lib/Error.php +++ b/modules/saml/lib/Error.php @@ -108,20 +108,20 @@ class Error extends \SimpleSAML\Error\Exception * This function attempts to create a SAML2 error with the appropriate * status codes from an arbitrary exception. * - * @param \Throwable $exception The original exception. + * @param \Throwable $e The original exception. * @return \SimpleSAML\Error\Exception The new exception. */ - public static function fromException(Throwable $exception): \SimpleSAML\Error\Exception + public static function fromException(Throwable $e): \SimpleSAML\Error\Exception { - if ($exception instanceof \SimpleSAML\Module\saml\Error) { + if ($e instanceof \SimpleSAML\Module\saml\Error) { // Return the original exception unchanged - return $exception; + return $e; } else { $e = new self( \SAML2\Constants::STATUS_RESPONDER, null, - get_class($exception) . ': ' . $exception->getMessage(), - $exception + get_class($e) . ': ' . $e->getMessage(), + $e ); }