From 929edf0d2868bdc6d23d84363f5e2c07cf08ace8 Mon Sep 17 00:00:00 2001 From: Jaime Perez Crespo <jaime.perez@uninett.no> Date: Fri, 26 Feb 2016 09:34:23 +0100 Subject: [PATCH] Move also the new AttributeValueMap filter to namespaces. --- modules/core/lib/Auth/Process/AttributeValueMap.php | 12 +++++++----- .../core/lib/Auth/Process/AttributeValueMapTest.php | 3 ++- 2 files changed, 9 insertions(+), 6 deletions(-) diff --git a/modules/core/lib/Auth/Process/AttributeValueMap.php b/modules/core/lib/Auth/Process/AttributeValueMap.php index 4f6ce0735..ea4ada12b 100644 --- a/modules/core/lib/Auth/Process/AttributeValueMap.php +++ b/modules/core/lib/Auth/Process/AttributeValueMap.php @@ -1,12 +1,14 @@ <?php +namespace SimpleSAML\Module\core\Auth\Process; + /** * Filter to create target attribute based on value(s) in source attribute * * @author Martin van Es, m7 * @package SimpleSAMLphp */ -class sspmod_core_Auth_Process_AttributeValueMap extends SimpleSAML_Auth_ProcessingFilter +class AttributeValueMap extends \SimpleSAML_Auth_ProcessingFilter { /** @@ -39,7 +41,7 @@ class sspmod_core_Auth_Process_AttributeValueMap extends SimpleSAML_Auth_Process * * @param array $config Configuration information about this filter. * @param mixed $reserved For future use. - * @throws SimpleSAML_Error_Exception If the configuration is not valid. + * @throws \SimpleSAML_Error_Exception If the configuration is not valid. */ public function __construct($config, $reserved) { @@ -56,7 +58,7 @@ class sspmod_core_Auth_Process_AttributeValueMap extends SimpleSAML_Auth_Process } elseif ($value === '%keep') { $this->keep = true; } else { - throw new SimpleSAML_Error_Exception('Unknown flag : ' . var_export($value, true)); + throw new \SimpleSAML_Error_Exception('Unknown flag : ' . var_export($value, true)); } continue; } @@ -86,7 +88,7 @@ class sspmod_core_Auth_Process_AttributeValueMap extends SimpleSAML_Auth_Process */ public function process(&$request) { - SimpleSAML_Logger::debug('AttributeValueMap - process'); + \SimpleSAML_Logger::debug('AttributeValueMap - process'); assert('is_array($request)'); assert('array_key_exists("Attributes", $request)'); @@ -103,7 +105,7 @@ class sspmod_core_Auth_Process_AttributeValueMap extends SimpleSAML_Auth_Process if (is_array($sourceattribute)) { foreach ($this->values as $value => $require) { if (count(array_intersect($require, $sourceattribute)) > 0) { - SimpleSAML_Logger::debug('AttributeValueMap - intersect match for ' . $value); + \SimpleSAML_Logger::debug('AttributeValueMap - intersect match for ' . $value); $targetvalues[] = $value; } } diff --git a/tests/modules/core/lib/Auth/Process/AttributeValueMapTest.php b/tests/modules/core/lib/Auth/Process/AttributeValueMapTest.php index bf2d01404..2117e06a1 100644 --- a/tests/modules/core/lib/Auth/Process/AttributeValueMapTest.php +++ b/tests/modules/core/lib/Auth/Process/AttributeValueMapTest.php @@ -2,6 +2,7 @@ namespace SimpleSAML\Test\Module\core\Auth\Process; +use SimpleSAML\Module\core\Auth\Process\AttributeValueMap; /** * Test for the core:AttributeValueMap filter. @@ -18,7 +19,7 @@ class AttributeValueMapTest extends \PHPUnit_Framework_TestCase */ private static function processFilter(array $config, array $request) { - $filter = new \sspmod_core_Auth_Process_AttributeValueMap($config, null); + $filter = new AttributeValueMap($config, null); $filter->process($request); return $request; } -- GitLab