From 7ce390d03f3141250673d7c93c71612e736b6aca Mon Sep 17 00:00:00 2001
From: Tim van Dijen <tvdijen@gmail.com>
Date: Thu, 18 Oct 2018 15:11:29 +0200
Subject: [PATCH] Spacing

---
 .../authfacebook/extlibinc/base_facebook.php   |  2 +-
 modules/core/www/frontpage_config.php          |  2 +-
 tests/Utils/ClearStateTestCase.php             |  2 +-
 tests/Utils/ReduceSpillOverTest.php            |  2 +-
 tests/bootstrap.php                            |  4 ++--
 tests/lib/SimpleSAML/ConfigurationTest.php     |  6 +++---
 tests/lib/SimpleSAML/Utils/ConfigTest.php      | 18 +++++++++---------
 tests/lib/SimpleSAML/Utils/SystemTest.php      | 18 +++++++++---------
 tests/lib/SimpleSAML/Utils/XMLTest.php         |  2 +-
 tests/lib/SimpleSAML/XML/ValidatorTest.php     |  2 +-
 .../consent/lib/Auth/Process/ConsentTest.php   | 12 +++++++++---
 .../lib/Auth/Process/AttributeCopyTest.php     |  6 +++---
 .../lib/Auth/Process/AttributeLimitTest.php    | 12 ++++++------
 .../lib/Auth/Process/AttributeValueMapTest.php |  2 +-
 .../lib/Auth/Process/ScopeAttributeTest.php    |  4 ++--
 15 files changed, 50 insertions(+), 44 deletions(-)

diff --git a/modules/authfacebook/extlibinc/base_facebook.php b/modules/authfacebook/extlibinc/base_facebook.php
index b656f350f..aa1a23efb 100644
--- a/modules/authfacebook/extlibinc/base_facebook.php
+++ b/modules/authfacebook/extlibinc/base_facebook.php
@@ -828,7 +828,7 @@ abstract class BaseFacebook
 
         $response_params = json_decode($access_token_response, true);
         if (!isset($response_params['access_token'])) {
-            self::errorLog('No access token in response. ' . $access_token_response);
+            self::errorLog('No access token in response. '.$access_token_response);
             return false;
         }
 
diff --git a/modules/core/www/frontpage_config.php b/modules/core/www/frontpage_config.php
index dbd9a87b9..d9b2d05e6 100644
--- a/modules/core/www/frontpage_config.php
+++ b/modules/core/www/frontpage_config.php
@@ -59,7 +59,7 @@ $allLinks = [
 $current = $config->getVersion();
 if ($config->getBoolean('admin.checkforupdates', true) && $current !== 'master') {
     if (!function_exists('curl_init')) {
-        $warnings[] = [ '{core:frontpage:warnings_curlmissing}' ];
+        $warnings[] = ['{core:frontpage:warnings_curlmissing}'];
     } else {
         $latest = $session->getData("core:latest_simplesamlphp_version", "version");
 
diff --git a/tests/Utils/ClearStateTestCase.php b/tests/Utils/ClearStateTestCase.php
index 2cecc16b4..d7d11c891 100644
--- a/tests/Utils/ClearStateTestCase.php
+++ b/tests/Utils/ClearStateTestCase.php
@@ -2,7 +2,7 @@
 
 namespace SimpleSAML\Test\Utils;
 
-include(dirname(__FILE__) . '/StateClearer.php');
+include(dirname(__FILE__).'/StateClearer.php');
 
 use PHPUnit\Framework\TestCase;
 
diff --git a/tests/Utils/ReduceSpillOverTest.php b/tests/Utils/ReduceSpillOverTest.php
index 82f82da39..c744e2a5f 100644
--- a/tests/Utils/ReduceSpillOverTest.php
+++ b/tests/Utils/ReduceSpillOverTest.php
@@ -17,7 +17,7 @@ class ReduceSpillOverTest extends ClearStateTestCase
         $_SERVER['QUERY_STRING'] = 'a=b';
         \SimpleSAML\Configuration::loadFromArray(['a' => 'b'], '[ARRAY]', 'simplesaml');
         $this->assertEquals('b', \SimpleSAML\Configuration::getInstance()->getString('a'));
-        putenv('SIMPLESAMLPHP_CONFIG_DIR=' . __DIR__);
+        putenv('SIMPLESAMLPHP_CONFIG_DIR='.__DIR__);
     }
 
     /**
diff --git a/tests/bootstrap.php b/tests/bootstrap.php
index 4ec9274b9..82ed397dc 100644
--- a/tests/bootstrap.php
+++ b/tests/bootstrap.php
@@ -1,7 +1,7 @@
 <?php
 
 $projectRoot = dirname(__DIR__);
-require_once($projectRoot . '/vendor/autoload.php');
+require_once($projectRoot.'/vendor/autoload.php');
 
 // Current SSP autoloader can't resolve classes from the tests folder.
-include($projectRoot . '/tests/Utils/ClearStateTestCase.php');
+include($projectRoot.'/tests/Utils/ClearStateTestCase.php');
diff --git a/tests/lib/SimpleSAML/ConfigurationTest.php b/tests/lib/SimpleSAML/ConfigurationTest.php
index 8f6901f5a..474495e84 100644
--- a/tests/lib/SimpleSAML/ConfigurationTest.php
+++ b/tests/lib/SimpleSAML/ConfigurationTest.php
@@ -210,7 +210,7 @@ class ConfigurationTest extends \SimpleSAML\Test\Utils\ClearStateTestCase
     public function testGetBaseDir()
     {
         $c = Configuration::loadFromArray([]);
-        $this->assertEquals($c->getBaseDir(), dirname(dirname(dirname(dirname(__FILE__)))) . '/');
+        $this->assertEquals($c->getBaseDir(), dirname(dirname(dirname(dirname(__FILE__)))).'/');
 
         $c = Configuration::loadFromArray([
             'basedir' => '/basedir',
@@ -487,8 +487,8 @@ class ConfigurationTest extends \SimpleSAML\Test\Utils\ClearStateTestCase
     {
         $c = Configuration::loadFromArray([
             'opts' => [
-               'a' => ['opt1' => 'value1'],
-               'b' => ['opt2' => 'value2'],
+                'a' => ['opt1' => 'value1'],
+                'b' => ['opt2' => 'value2'],
             ],
         ]);
         $this->assertEquals($c->getConfigList('missing_opt', '--missing--'), '--missing--');
diff --git a/tests/lib/SimpleSAML/Utils/ConfigTest.php b/tests/lib/SimpleSAML/Utils/ConfigTest.php
index 43525cf30..6077a6301 100644
--- a/tests/lib/SimpleSAML/Utils/ConfigTest.php
+++ b/tests/lib/SimpleSAML/Utils/ConfigTest.php
@@ -20,7 +20,7 @@ class ConfigTest extends TestCase
         putenv('SIMPLESAMLPHP_CONFIG_DIR');
         $configDir = Config::getConfigDir();
 
-        $this->assertEquals($configDir, dirname(dirname(dirname(dirname(__DIR__)))) . '/config');
+        $this->assertEquals($configDir, dirname(dirname(dirname(dirname(__DIR__)))).'/config');
     }
 
 
@@ -29,7 +29,7 @@ class ConfigTest extends TestCase
      */
     public function testEnvVariableConfigDir()
     {
-        putenv('SIMPLESAMLPHP_CONFIG_DIR=' . __DIR__);
+        putenv('SIMPLESAMLPHP_CONFIG_DIR='.__DIR__);
         $configDir = Config::getConfigDir();
 
         $this->assertEquals($configDir, __DIR__);
@@ -40,7 +40,7 @@ class ConfigTest extends TestCase
      */
     public function testEnvRedirectVariableConfigDir()
     {
-        putenv('REDIRECT_SIMPLESAMLPHP_CONFIG_DIR=' . __DIR__);
+        putenv('REDIRECT_SIMPLESAMLPHP_CONFIG_DIR='.__DIR__);
         $configDir = Config::getConfigDir();
 
         $this->assertEquals($configDir, __DIR__);
@@ -51,8 +51,8 @@ class ConfigTest extends TestCase
      */
     public function testEnvRedirectPriorityVariableConfigDir()
     {
-        putenv('SIMPLESAMLPHP_CONFIG_DIR=' . dirname(__DIR__));
-        putenv('REDIRECT_SIMPLESAMLPHP_CONFIG_DIR=' . __DIR__);
+        putenv('SIMPLESAMLPHP_CONFIG_DIR='.dirname(__DIR__));
+        putenv('REDIRECT_SIMPLESAMLPHP_CONFIG_DIR='.__DIR__);
         $configDir = Config::getConfigDir();
 
         $this->assertEquals($configDir, dirname(__DIR__));
@@ -65,13 +65,13 @@ class ConfigTest extends TestCase
     public function testInvalidEnvVariableConfigDirThrowsException()
     {
         // I used a random hash to ensure this test directory is always invalid
-        $invalidDir = __DIR__ . '/e9826ad19cbc4f5bf20c0913ffcd2ce6';
-        putenv('SIMPLESAMLPHP_CONFIG_DIR=' . $invalidDir);
+        $invalidDir = __DIR__.'/e9826ad19cbc4f5bf20c0913ffcd2ce6';
+        putenv('SIMPLESAMLPHP_CONFIG_DIR='.$invalidDir);
 
         $this->setExpectedException(
             'InvalidArgumentException',
-            'Config directory specified by environment variable SIMPLESAMLPHP_CONFIG_DIR is not a directory.  ' .
-            'Given: "' . $invalidDir . '"'
+            'Config directory specified by environment variable SIMPLESAMLPHP_CONFIG_DIR is not a directory.  '.
+            'Given: "'.$invalidDir.'"'
         );
 
         Config::getConfigDir();
diff --git a/tests/lib/SimpleSAML/Utils/SystemTest.php b/tests/lib/SimpleSAML/Utils/SystemTest.php
index 7363c34f6..99a77ebe0 100644
--- a/tests/lib/SimpleSAML/Utils/SystemTest.php
+++ b/tests/lib/SimpleSAML/Utils/SystemTest.php
@@ -115,10 +115,10 @@ class SystemTest extends TestCase
      */
     public function testWriteFileBasic()
     {
-        $tempdir = $this->root_directory . DIRECTORY_SEPARATOR . self::DEFAULTTEMPDIR;
+        $tempdir = $this->root_directory.DIRECTORY_SEPARATOR.self::DEFAULTTEMPDIR;
         $config = $this->setConfigurationTempDir($tempdir);
 
-        $filename = $this->root_directory . DIRECTORY_SEPARATOR . 'test';
+        $filename = $this->root_directory.DIRECTORY_SEPARATOR.'test';
 
         System::writeFile($filename, '');
 
@@ -133,10 +133,10 @@ class SystemTest extends TestCase
      */
     public function testWriteFileContents()
     {
-        $tempdir = $this->root_directory . DIRECTORY_SEPARATOR . self::DEFAULTTEMPDIR;
+        $tempdir = $this->root_directory.DIRECTORY_SEPARATOR.self::DEFAULTTEMPDIR;
         $config = $this->setConfigurationTempDir($tempdir);
 
-        $filename = $this->root_directory . DIRECTORY_SEPARATOR . 'test';
+        $filename = $this->root_directory.DIRECTORY_SEPARATOR.'test';
         $contents = 'TEST';
 
         System::writeFile($filename, $contents);
@@ -155,10 +155,10 @@ class SystemTest extends TestCase
      */
     public function testWriteFileMode()
     {
-        $tempdir = $this->root_directory . DIRECTORY_SEPARATOR . self::DEFAULTTEMPDIR;
+        $tempdir = $this->root_directory.DIRECTORY_SEPARATOR.self::DEFAULTTEMPDIR;
         $config = $this->setConfigurationTempDir($tempdir);
 
-        $filename = $this->root_directory . DIRECTORY_SEPARATOR . 'test';
+        $filename = $this->root_directory.DIRECTORY_SEPARATOR.'test';
         $mode = 0666;
 
         System::writeFile($filename, '', $mode);
@@ -177,7 +177,7 @@ class SystemTest extends TestCase
      */
     public function testGetTempDirBasic()
     {
-        $tempdir = $this->root_directory . DIRECTORY_SEPARATOR . self::DEFAULTTEMPDIR;
+        $tempdir = $this->root_directory.DIRECTORY_SEPARATOR.self::DEFAULTTEMPDIR;
         $config = $this->setConfigurationTempDir($tempdir);
 
         $res = System::getTempDir();
@@ -195,7 +195,7 @@ class SystemTest extends TestCase
      */
     public function testGetTempDirNonExistant()
     {
-        $tempdir = $this->root_directory . DIRECTORY_SEPARATOR . 'nonexistant';
+        $tempdir = $this->root_directory.DIRECTORY_SEPARATOR.'nonexistant';
         $config = $this->setConfigurationTempDir($tempdir);
 
         $res = System::getTempDir();
@@ -220,7 +220,7 @@ class SystemTest extends TestCase
 
         $bad_uid = posix_getuid() + 1;
 
-        $tempdir = $this->root_directory . DIRECTORY_SEPARATOR . self::DEFAULTTEMPDIR;
+        $tempdir = $this->root_directory.DIRECTORY_SEPARATOR.self::DEFAULTTEMPDIR;
         $config = $this->setConfigurationTempDir($tempdir);
 
         chown($tempdir, $bad_uid);
diff --git a/tests/lib/SimpleSAML/Utils/XMLTest.php b/tests/lib/SimpleSAML/Utils/XMLTest.php
index fe3694d13..a81e6eb4b 100644
--- a/tests/lib/SimpleSAML/Utils/XMLTest.php
+++ b/tests/lib/SimpleSAML/Utils/XMLTest.php
@@ -135,7 +135,7 @@ class XMLTest extends TestCase
         $element->appendChild(new \DOMText($data2));
 
         $res = XML::getDOMText($element);
-        $expected = $data1 . $data2 . $data1 . $data2;
+        $expected = $data1.$data2.$data1.$data2;
 
         $this->assertEquals($expected, $res);
     }
diff --git a/tests/lib/SimpleSAML/XML/ValidatorTest.php b/tests/lib/SimpleSAML/XML/ValidatorTest.php
index bc8a197a6..b274ad9a8 100644
--- a/tests/lib/SimpleSAML/XML/ValidatorTest.php
+++ b/tests/lib/SimpleSAML/XML/ValidatorTest.php
@@ -202,7 +202,7 @@ NOWDOC;
         $result = $validator->getX509Certificate();
 
         // getX509Certificate returns a certificate with a newline
-        $expected = $this->good_certificate . "\n";
+        $expected = $this->good_certificate."\n";
 
         $this->assertEquals($result, $expected);
     }
diff --git a/tests/modules/consent/lib/Auth/Process/ConsentTest.php b/tests/modules/consent/lib/Auth/Process/ConsentTest.php
index 8916ed440..1e1623147 100644
--- a/tests/modules/consent/lib/Auth/Process/ConsentTest.php
+++ b/tests/modules/consent/lib/Auth/Process/ConsentTest.php
@@ -185,9 +185,15 @@ class ConsentTest extends TestCase
     {
         $reflection = new \ReflectionClass('\SimpleSAML\Module\consent\Auth\Process\Consent');
 
-        foreach ([
-            'includeValues', 'checked', 'focus', 'hiddenAttributes', 'noconsentattributes', 'showNoConsentAboutService'
-                 ] as $v) {
+        $values = [
+            'includeValues',
+            'checked',
+            'focus',
+            'hiddenAttributes',
+            'noconsentattributes',
+            'showNoConsentAboutService'
+        ];
+        foreach ($values as $v) {
             $instanceVars[$v] = $reflection->getProperty($v);
             $instanceVars[$v]->setAccessible(true);
         }
diff --git a/tests/modules/core/lib/Auth/Process/AttributeCopyTest.php b/tests/modules/core/lib/Auth/Process/AttributeCopyTest.php
index c1d18d72f..538bd10e0 100644
--- a/tests/modules/core/lib/Auth/Process/AttributeCopyTest.php
+++ b/tests/modules/core/lib/Auth/Process/AttributeCopyTest.php
@@ -48,7 +48,7 @@ class AttributeCopyTest extends TestCase
     public function testArray()
     {
         $config = [
-            'test' => ['new1','new2'],
+            'test' => ['new1', 'new2'],
         ];
         $request = [
             'Attributes' => ['test' => ['AAP']],
@@ -97,14 +97,14 @@ class AttributeCopyTest extends TestCase
             'test2' => 'new2',
         ];
         $request = [
-            'Attributes' => ['test1' => ['val1'], 'test2' => ['val2.1','val2.2']],
+            'Attributes' => ['test1' => ['val1'], 'test2' => ['val2.1', 'val2.2']],
         ];
         $result = self::processFilter($config, $request);
         $attributes = $result['Attributes'];
         $this->assertArrayHasKey('new1', $attributes);
         $this->assertEquals($attributes['new1'], ['val1']);
         $this->assertArrayHasKey('new2', $attributes);
-        $this->assertEquals($attributes['new2'], ['val2.1','val2.2']);
+        $this->assertEquals($attributes['new2'], ['val2.1', 'val2.2']);
     }
 
     /**
diff --git a/tests/modules/core/lib/Auth/Process/AttributeLimitTest.php b/tests/modules/core/lib/Auth/Process/AttributeLimitTest.php
index f5cfd5b75..01e2a6bee 100644
--- a/tests/modules/core/lib/Auth/Process/AttributeLimitTest.php
+++ b/tests/modules/core/lib/Auth/Process/AttributeLimitTest.php
@@ -42,7 +42,7 @@ class AttributeLimitTest extends TestCase
             'Destination' => [
             ],
             'Source' => [
-                'attributes' => ['cn','mail'],
+                'attributes' => ['cn', 'mail'],
             ],
         ];
 
@@ -139,7 +139,7 @@ class AttributeLimitTest extends TestCase
                  'mail' => ['user@example.org'],
             ],
             'Destination' => [
-                'attributes' => ['cn','mail'],
+                'attributes' => ['cn', 'mail'],
             ],
             'Source' => [
             ],
@@ -242,7 +242,7 @@ class AttributeLimitTest extends TestCase
         $this->assertEquals($attributes['eduPersonAffiliation'], ['member']);
 
         $config = [
-            'eduPersonAffiliation' => ['member','staff']
+            'eduPersonAffiliation' => ['member', 'staff']
         ];
 
         $result = self::processFilter($config, self::$request);
@@ -259,7 +259,7 @@ class AttributeLimitTest extends TestCase
         $this->assertCount(0, $attributes);
 
         $config = [
-            'eduPersonAffiliation' => ['student','staff']
+            'eduPersonAffiliation' => ['student', 'staff']
         ];
         $result = self::processFilter($config, self::$request);
         $attributes = $result['Attributes'];
@@ -315,7 +315,7 @@ class AttributeLimitTest extends TestCase
         $this->assertEquals($attributes['eduPersonAffiliation'], ['member']);
 
         $config = [
-            'eduPersonAffiliation' => ['ignoreCase' => true, 'membeR','sTaff']
+            'eduPersonAffiliation' => ['ignoreCase' => true, 'membeR', 'sTaff']
         ];
 
         $result = self::processFilter($config, self::$request);
@@ -332,7 +332,7 @@ class AttributeLimitTest extends TestCase
         $this->assertCount(0, $attributes);
 
         $config = [
-            'eduPersonAffiliation' => ['ignoreCase' => true, 'studeNt','sTaff']
+            'eduPersonAffiliation' => ['ignoreCase' => true, 'studeNt', 'sTaff']
         ];
         $result = self::processFilter($config, self::$request);
         $attributes = $result['Attributes'];
diff --git a/tests/modules/core/lib/Auth/Process/AttributeValueMapTest.php b/tests/modules/core/lib/Auth/Process/AttributeValueMapTest.php
index 23904bd67..ddf074273 100644
--- a/tests/modules/core/lib/Auth/Process/AttributeValueMapTest.php
+++ b/tests/modules/core/lib/Auth/Process/AttributeValueMapTest.php
@@ -151,7 +151,7 @@ class AttributeValueMapTest extends TestCase
         $attributes = $result['Attributes'];
         $this->assertArrayHasKey('memberOf', $attributes);
         $this->assertArrayHasKey('eduPersonAffiliation', $attributes);
-        $this->assertEquals($attributes['eduPersonAffiliation'], ['someValue','member']);
+        $this->assertEquals($attributes['eduPersonAffiliation'], ['someValue', 'member']);
     }
 
 
diff --git a/tests/modules/core/lib/Auth/Process/ScopeAttributeTest.php b/tests/modules/core/lib/Auth/Process/ScopeAttributeTest.php
index aceaf5a09..52b29234c 100644
--- a/tests/modules/core/lib/Auth/Process/ScopeAttributeTest.php
+++ b/tests/modules/core/lib/Auth/Process/ScopeAttributeTest.php
@@ -169,14 +169,14 @@ class ScopeAttributeTest extends TestCase
         $request = [
             'Attributes' => [
                 'eduPersonPrincipalName' => ['jdoe@example.com'],
-                'eduPersonAffiliation' => ['member','staff','faculty'],
+                'eduPersonAffiliation' => ['member', 'staff', 'faculty'],
             ]
         ];
         $result = self::processFilter($config, $request);
         $attributes = $result['Attributes'];
         $this->assertEquals(
             $attributes['eduPersonScopedAffiliation'],
-            ['member@example.com','staff@example.com','faculty@example.com']
+            ['member@example.com', 'staff@example.com', 'faculty@example.com']
         );
     }
 
-- 
GitLab