diff --git a/lib/SimpleSAML/AuthMemCookie.php b/lib/SimpleSAML/AuthMemCookie.php
index 33944677e48399d63c2bbc9863e5dd9e42fea77a..21e3e4485a10136028aad4dc2630914bf4f704ec 100644
--- a/lib/SimpleSAML/AuthMemCookie.php
+++ b/lib/SimpleSAML/AuthMemCookie.php
@@ -117,7 +117,7 @@ class SimpleSAML_AuthMemCookie
         $memcacheHost = $this->amcConfig->getString('memcache.host', '127.0.0.1');
         $memcachePort = $this->amcConfig->getInteger('memcache.port', 11211);
 
-        $class = class_exists('Memcache') ? 'Memcache' : (class_exists('Memcached') ? 'Memcached' : FALSE);
+        $class = class_exists('Memcache') ? 'Memcache' : (class_exists('Memcached') ? 'Memcached' : false);
         if (!$class) {
             throw new Exception('Missing Memcached implementation. You must install either the Memcache or Memcached extension.');
         }
diff --git a/lib/SimpleSAML/IdP/IFrameLogoutHandler.php b/lib/SimpleSAML/IdP/IFrameLogoutHandler.php
index 23a1daa85e8e7f506dd3f67a18ee67ff18f959f4..b08440343920f0929870efbf1729d07d79290c77 100644
--- a/lib/SimpleSAML/IdP/IFrameLogoutHandler.php
+++ b/lib/SimpleSAML/IdP/IFrameLogoutHandler.php
@@ -5,7 +5,6 @@ namespace SimpleSAML\IdP;
 use SimpleSAML\Module;
 use SimpleSAML\Utils\HTTP;
 
-
 /**
  * Class that handles iframe logout.
  *
diff --git a/lib/SimpleSAML/IdP/LogoutHandlerInterface.php b/lib/SimpleSAML/IdP/LogoutHandlerInterface.php
index 11589f3d0f56478e114f30b6fbac115fc67a13bb..011dd63c66ae2b5d6296c0888952ea3e613b9d8f 100644
--- a/lib/SimpleSAML/IdP/LogoutHandlerInterface.php
+++ b/lib/SimpleSAML/IdP/LogoutHandlerInterface.php
@@ -2,7 +2,6 @@
 
 namespace SimpleSAML\IdP;
 
-
 /**
  * Interface that all logout handlers must implement.
  *
diff --git a/lib/SimpleSAML/IdP/TraditionalLogoutHandler.php b/lib/SimpleSAML/IdP/TraditionalLogoutHandler.php
index 61756f32e55e55513b8938c9a68940653533e8d6..105ac2796ecc77d8911daddf7cc2f81295f19da5 100644
--- a/lib/SimpleSAML/IdP/TraditionalLogoutHandler.php
+++ b/lib/SimpleSAML/IdP/TraditionalLogoutHandler.php
@@ -5,7 +5,6 @@ namespace SimpleSAML\IdP;
 use SimpleSAML\Logger;
 use SimpleSAML\Utils\HTTP;
 
-
 /**
  * Class that handles traditional logout.
  *
diff --git a/lib/SimpleSAML/Locale/Localization.php b/lib/SimpleSAML/Locale/Localization.php
index cbfc42c304b4dddd03e79622f88e0f2a6f4b538d..9a023f9b4cf68bec4e170e77606c5e4d9f9001eb 100644
--- a/lib/SimpleSAML/Locale/Localization.php
+++ b/lib/SimpleSAML/Locale/Localization.php
@@ -262,5 +262,4 @@ class Localization
     {
         return $this->localeDomainMap;
     }
-
 }
diff --git a/lib/SimpleSAML/Locale/Translate.php b/lib/SimpleSAML/Locale/Translate.php
index 9cb0000bd8ebe9835a5ff2985e163a46aed44c5a..00ac6e5ee72c0aa2ff1ed671e75140e0c33fe07e 100644
--- a/lib/SimpleSAML/Locale/Translate.php
+++ b/lib/SimpleSAML/Locale/Translate.php
@@ -259,9 +259,12 @@ class Translate
     public function t(
         $tag,
         $replacements = array(),
-        $fallbackdefault = true, // TODO: remove this for 2.0. Assume true
-        $oldreplacements = array(), // TODO: remove this for 2.0
-        $striptags = false // TODO: remove this for 2.0
+        // TODO: remove this for 2.0. Assume true
+        $fallbackdefault = true,
+        // TODO: remove this for 2.0
+        $oldreplacements = array(),
+        // TODO: remove this for 2.0
+        $striptags = false
     ) {
         $backtrace = debug_backtrace();
         $where = $backtrace[0]['file'].':'.$backtrace[0]['line'];
diff --git a/lib/SimpleSAML/Logger.php b/lib/SimpleSAML/Logger.php
index a383addbd76782bde5972fc6c32ed9895d2bdd3f..dbda5c5c85903582d36bd363784ce95dddbc1c0a 100644
--- a/lib/SimpleSAML/Logger.php
+++ b/lib/SimpleSAML/Logger.php
@@ -2,7 +2,6 @@
 
 namespace SimpleSAML;
 
-
 /**
  * The main logger class for SimpleSAMLphp.
  *
diff --git a/lib/SimpleSAML/Memcache.php b/lib/SimpleSAML/Memcache.php
index 3d895755e78fd67ee18746cee4dbfa04d4698267..3f4bba004c37db9e9ef4a34a0ac6ff8da6751197 100644
--- a/lib/SimpleSAML/Memcache.php
+++ b/lib/SimpleSAML/Memcache.php
@@ -164,8 +164,7 @@ class SimpleSAML_Memcache
         foreach (self::getMemcacheServers() as $server) {
             if (self::$extension === 'memcached') {
                 $server->set($key, $savedInfoSerialized, $expire);
-            }
-            else {
+            } else {
                 $server->set($key, $savedInfoSerialized, 0, $expire);
             }
         }
@@ -310,7 +309,7 @@ class SimpleSAML_Memcache
      */
     private static function loadMemcacheServerGroup(array $group)
     {
-        $class = class_exists('Memcache') ? 'Memcache' : (class_exists('Memcached') ? 'Memcached' : FALSE);
+        $class = class_exists('Memcache') ? 'Memcache' : (class_exists('Memcached') ? 'Memcached' : false);
         if (!$class) {
             throw new Exception('Missing Memcached implementation. You must install either the Memcache or Memcached extension.');
         }
@@ -490,5 +489,4 @@ class SimpleSAML_Memcache
 
         return $ret;
     }
-
 }
diff --git a/lib/SimpleSAML/Metadata/MetaDataStorageHandler.php b/lib/SimpleSAML/Metadata/MetaDataStorageHandler.php
index 95f23244914728ffa8d9ab4ea5b801c108d0ba6f..6091470223ec016ae98580076ced9d2423815540 100644
--- a/lib/SimpleSAML/Metadata/MetaDataStorageHandler.php
+++ b/lib/SimpleSAML/Metadata/MetaDataStorageHandler.php
@@ -280,7 +280,6 @@ class SimpleSAML_Metadata_MetaDataStorageHandler
             $metadata = $source->getMetaData($index, $set);
 
             if ($metadata !== null) {
-
                 if (array_key_exists('expire', $metadata)) {
                     if ($metadata['expire'] < time()) {
                         throw new Exception(
@@ -347,7 +346,6 @@ class SimpleSAML_Metadata_MetaDataStorageHandler
             $result = array_merge($srcList, $result);
         }
         foreach ($result as $remote_provider) {
-
             if (sha1($remote_provider['entityid']) == $sha1) {
                 $remote_provider['metadata-set'] = $set;
 
diff --git a/lib/SimpleSAML/Metadata/MetaDataStorageHandlerPdo.php b/lib/SimpleSAML/Metadata/MetaDataStorageHandlerPdo.php
index 0e3720e8b0911d33962d097f2e70ff9ab5f263f5..f617c7e28ff7ec8e8f69681eb893651cd665cd01 100644
--- a/lib/SimpleSAML/Metadata/MetaDataStorageHandlerPdo.php
+++ b/lib/SimpleSAML/Metadata/MetaDataStorageHandlerPdo.php
@@ -261,5 +261,4 @@ class SimpleSAML_Metadata_MetaDataStorageHandlerPdo extends SimpleSAML_Metadata_
         }
         return $stmt;
     }
-
 }
diff --git a/lib/SimpleSAML/Metadata/MetaDataStorageHandlerSerialize.php b/lib/SimpleSAML/Metadata/MetaDataStorageHandlerSerialize.php
index a9ec6f3c41ae02382db0fcd54cd1218c7fc68b5b..686791152b54c80a592acfbacf4ab0a8cef878ae 100644
--- a/lib/SimpleSAML/Metadata/MetaDataStorageHandlerSerialize.php
+++ b/lib/SimpleSAML/Metadata/MetaDataStorageHandlerSerialize.php
@@ -84,7 +84,6 @@ class SimpleSAML_Metadata_MetaDataStorageHandlerSerialize extends SimpleSAML_Met
         }
 
         while (($entry = readdir($dh)) !== false) {
-
             if ($entry[0] === '.') {
                 // skip '..', '.' and hidden files
                 continue;
diff --git a/lib/SimpleSAML/Metadata/MetaDataStorageHandlerXML.php b/lib/SimpleSAML/Metadata/MetaDataStorageHandlerXML.php
index 44dba1fcfe357bf20979a1e7b341983e5778ecf3..7c537aa960515b08655e41c185190fd925b138b4 100644
--- a/lib/SimpleSAML/Metadata/MetaDataStorageHandlerXML.php
+++ b/lib/SimpleSAML/Metadata/MetaDataStorageHandlerXML.php
@@ -52,7 +52,6 @@ class SimpleSAML_Metadata_MetaDataStorageHandlerXML extends SimpleSAML_Metadata_
 
         $entities = SimpleSAML_Metadata_SAMLParser::parseDescriptorsFile($src);
         foreach ($entities as $entityId => $entity) {
-
             $md = $entity->getMetadata1xSP();
             if ($md !== null) {
                 $SP1x[$entityId] = $md;
diff --git a/lib/SimpleSAML/Metadata/MetaDataStorageSource.php b/lib/SimpleSAML/Metadata/MetaDataStorageSource.php
index bc96feeec691e4dd4339ea455ab0f876931064ca..c4e7161b4d840fb54d4db0fffaf0216aed2ffbd4 100644
--- a/lib/SimpleSAML/Metadata/MetaDataStorageSource.php
+++ b/lib/SimpleSAML/Metadata/MetaDataStorageSource.php
@@ -139,7 +139,6 @@ abstract class SimpleSAML_Metadata_MetaDataStorageSource
         }
 
         foreach ($metadataSet as $index => $entry) {
-
             if (!array_key_exists('host', $entry)) {
                 continue;
             }
@@ -177,7 +176,6 @@ abstract class SimpleSAML_Metadata_MetaDataStorageSource
         $metadataSet = $this->getMetadataSet($set);
 
         foreach ($metadataSet as $index => $entry) {
-
             if (!array_key_exists('hint.cidr', $entry)) {
                 continue;
             }
@@ -262,5 +260,4 @@ abstract class SimpleSAML_Metadata_MetaDataStorageSource
 
         return null;
     }
-
 }
diff --git a/lib/SimpleSAML/Metadata/SAMLBuilder.php b/lib/SimpleSAML/Metadata/SAMLBuilder.php
index c21df33a5dbfd1bcfc526cdfa6dab355cd642805..a868d5988ba4c912f2d3fa479e82cb6f64691e0a 100644
--- a/lib/SimpleSAML/Metadata/SAMLBuilder.php
+++ b/lib/SimpleSAML/Metadata/SAMLBuilder.php
@@ -299,8 +299,7 @@ class SimpleSAML_Metadata_SAMLBuilder
      */
     public function addOrganizationInfo(array $metadata)
     {
-        if (
-            empty($metadata['OrganizationName']) ||
+        if (empty($metadata['OrganizationName']) ||
             empty($metadata['OrganizationDisplayName']) ||
             empty($metadata['OrganizationURL'])
         ) {
diff --git a/lib/SimpleSAML/Metadata/SAMLParser.php b/lib/SimpleSAML/Metadata/SAMLParser.php
index 4ee7cdda0735571fae7b5b8bb0e6b6fecfeb2aac..280ca923d207149ed7b6a09c5170b8122b3d3cfd 100644
--- a/lib/SimpleSAML/Metadata/SAMLParser.php
+++ b/lib/SimpleSAML/Metadata/SAMLParser.php
@@ -211,7 +211,7 @@ class SimpleSAML_Metadata_SAMLParser
 
         try {
             $doc = \SAML2\DOMDocumentFactory::fromString($data);
-        } catch(\Exception $e) {
+        } catch (\Exception $e) {
             throw new Exception('Failed to read XML from file: '.$file);
         }
 
@@ -231,7 +231,7 @@ class SimpleSAML_Metadata_SAMLParser
     {
         try {
             $doc = \SAML2\DOMDocumentFactory::fromString($metadata);
-        } catch(\Exception $e) {
+        } catch (\Exception $e) {
             throw new Exception('Failed to parse XML string.');
         }
 
@@ -292,7 +292,7 @@ class SimpleSAML_Metadata_SAMLParser
 
         try {
             $doc = \SAML2\DOMDocumentFactory::fromString($data);
-        } catch(\Exception $e) {
+        } catch (\Exception $e) {
             throw new Exception('Failed to read XML from file: '.$file);
         }
 
@@ -319,7 +319,7 @@ class SimpleSAML_Metadata_SAMLParser
     {
         try {
             $doc = \SAML2\DOMDocumentFactory::fromString($string);
-        } catch(\Exception $e) {
+        } catch (\Exception $e) {
             throw new Exception('Failed to parse XML string.');
         }
 
@@ -1007,7 +1007,6 @@ class SimpleSAML_Metadata_SAMLParser
         }
 
         foreach ($element->Extensions as $e) {
-
             if ($e instanceof \SAML2\XML\shibmd\Scope) {
                 $ret['scope'][] = $e->scope;
                 continue;
@@ -1016,8 +1015,6 @@ class SimpleSAML_Metadata_SAMLParser
             // Entity Attributes are only allowed at entity level extensions and not at RoleDescriptor level
             if ($element instanceof \SAML2\XML\md\EntityDescriptor ||
                 $element instanceof \SAML2\XML\md\EntitiesDescriptor) {
-
-
                 if ($e instanceof \SAML2\XML\mdrpi\RegistrationInfo) {
                     // Registration Authority cannot be overridden (warn only if override attempts to change the value)
                     if (isset($ret['RegistrationInfo']['registrationAuthority'])
@@ -1059,7 +1056,6 @@ class SimpleSAML_Metadata_SAMLParser
             // UIInfo elements are only allowed at RoleDescriptor level extensions
             if ($element instanceof \SAML2\XML\md\RoleDescriptor) {
                 if ($e instanceof \SAML2\XML\mdui\UIInfo) {
-
                     $ret['UIInfo']['DisplayName'] = $e->DisplayName;
                     $ret['UIInfo']['Description'] = $e->Description;
                     $ret['UIInfo']['InformationURL'] = $e->InformationURL;
@@ -1097,7 +1093,6 @@ class SimpleSAML_Metadata_SAMLParser
 
             // DiscoHints elements are only allowed at IDPSSODescriptor level extensions
             if ($element instanceof \SAML2\XML\md\IDPSSODescriptor) {
-
                 if ($e instanceof \SAML2\XML\mdui\DiscoHints) {
                     $ret['DiscoHints']['IPHint'] = $e->IPHint;
                     $ret['DiscoHints']['DomainHint'] = $e->DomainHint;
@@ -1464,7 +1459,6 @@ class SimpleSAML_Metadata_SAMLParser
         $candidates = array();
         foreach ($this->validators as $validator) {
             foreach ($validator->getValidatingCertificates() as $cert) {
-
                 $fp = strtolower(sha1(base64_decode($cert)));
                 $candidates[] = $fp;
                 if ($fp === $fingerprint) {
diff --git a/lib/SimpleSAML/Metadata/Signer.php b/lib/SimpleSAML/Metadata/Signer.php
index 3d3f2eaf9601f7b4235029799076ac5d78afc76e..6397a75da7511da53f18966bc234ebbf7026ed29 100644
--- a/lib/SimpleSAML/Metadata/Signer.php
+++ b/lib/SimpleSAML/Metadata/Signer.php
@@ -28,11 +28,9 @@ class SimpleSAML_Metadata_Signer
         if (array_key_exists('metadata.sign.privatekey', $entityMetadata)
             || array_key_exists('metadata.sign.certificate', $entityMetadata)
         ) {
-
             if (!array_key_exists('metadata.sign.privatekey', $entityMetadata)
                 || !array_key_exists('metadata.sign.certificate', $entityMetadata)
             ) {
-
                 throw new Exception(
                     'Missing either the "metadata.sign.privatekey" or the'.
                     ' "metadata.sign.certificate" configuration option in the metadata for'.
@@ -79,7 +77,6 @@ class SimpleSAML_Metadata_Signer
         if (array_key_exists('privatekey', $entityMetadata)
             || array_key_exists('certificate', $entityMetadata)
         ) {
-
             if (!array_key_exists('privatekey', $entityMetadata)
                 || !array_key_exists('certificate', $entityMetadata)
             ) {
@@ -246,7 +243,7 @@ class SimpleSAML_Metadata_Signer
         // convert the metadata to a DOM tree
         try {
             $xml = \SAML2\DOMDocumentFactory::fromString($metadataString);
-        } catch(Exception $e) {
+        } catch (Exception $e) {
             throw new Exception('Error parsing self-generated metadata.');
         }
 
diff --git a/lib/SimpleSAML/Session.php b/lib/SimpleSAML/Session.php
index 50e6ad9e92e02954627454e1c226b7895feca260..17e035732c08600ce3dccfd0179f873c89d09a20 100644
--- a/lib/SimpleSAML/Session.php
+++ b/lib/SimpleSAML/Session.php
@@ -631,7 +631,6 @@ class SimpleSAML_Session implements Serializable
         if (!$this->transient && (!empty($data['RememberMe']) || $this->rememberMeExpire) &&
             $globalConfig->getBoolean('session.rememberme.enable', false)
         ) {
-
             $this->setRememberMeExpire();
         } else {
             try {
diff --git a/lib/SimpleSAML/Stats.php b/lib/SimpleSAML/Stats.php
index e710a373ef1c31e59a49bf3d1a8d7919e76d1712..36b6f66267a6e0d72522cdc0f7afe78d4499af11 100644
--- a/lib/SimpleSAML/Stats.php
+++ b/lib/SimpleSAML/Stats.php
@@ -97,5 +97,4 @@ class SimpleSAML_Stats
             $out->emit($data);
         }
     }
-
 }
diff --git a/lib/SimpleSAML/Utils/Attributes.php b/lib/SimpleSAML/Utils/Attributes.php
index 00e934f5e192e3332be5078cc7ce493bd8fdef02..1f49413625ec602f12d450d2964d120e8d6a7ad9 100644
--- a/lib/SimpleSAML/Utils/Attributes.php
+++ b/lib/SimpleSAML/Utils/Attributes.php
@@ -48,7 +48,6 @@ class Attributes
 
         if (count($attribute) === 0) {
             throw new \SimpleSAML_Error_Exception("Empty attribute '".$expected."'.'");
-
         } elseif (count($attribute) > 1) {
             if ($allow_multiple === false) {
                 throw new \SimpleSAML_Error_Exception(
diff --git a/lib/SimpleSAML/Utils/Auth.php b/lib/SimpleSAML/Utils/Auth.php
index 5360f74da0082e23911da5a27261a989a8892a78..cd2dbc29e38c484b05a7d05718b0380964e1bd4e 100644
--- a/lib/SimpleSAML/Utils/Auth.php
+++ b/lib/SimpleSAML/Utils/Auth.php
@@ -73,4 +73,4 @@ class Auth
             );
         }
     }
-}
\ No newline at end of file
+}
diff --git a/lib/SimpleSAML/Utils/Config/Metadata.php b/lib/SimpleSAML/Utils/Config/Metadata.php
index 632ec04cca8156bb31e1c7ee0ea452a48466d30e..d1974308f4987cfbe431bffe1e1f261a1f980f7c 100644
--- a/lib/SimpleSAML/Utils/Config/Metadata.php
+++ b/lib/SimpleSAML/Utils/Config/Metadata.php
@@ -117,8 +117,8 @@ class Metadata
 
         // check attributes is an associative array
         if (isset($contact['attributes'])) {
-            if (empty($contact['attributes']) 
-                || !is_array($contact['attributes']) 
+            if (empty($contact['attributes'])
+                || !is_array($contact['attributes'])
                 || count(array_filter(array_keys($contact['attributes']), 'is_string')) === 0
             ) {
                 throw new \InvalidArgumentException('"attributes" must be an array and cannot be empty.');
diff --git a/lib/SimpleSAML/Utils/HTTP.php b/lib/SimpleSAML/Utils/HTTP.php
index c839f4efdda71518382b60cd24e6e4b97675e889..06f4e0b37d15420febdee49f6949a746a96a6db1 100644
--- a/lib/SimpleSAML/Utils/HTTP.php
+++ b/lib/SimpleSAML/Utils/HTTP.php
@@ -599,8 +599,7 @@ class HTTP
         if (preg_match('#^https?://.*/?$#D', $baseURL, $matches)) {
             // full URL in baseurlpath, override local server values
             return rtrim($baseURL, '/').'/';
-        } elseif (
-            (preg_match('#^/?([^/]?.*/)$#D', $baseURL, $matches)) ||
+        } elseif ((preg_match('#^/?([^/]?.*/)$#D', $baseURL, $matches)) ||
             (preg_match('#^\*(.*)/$#D', $baseURL, $matches)) ||
             ($baseURL === '')
         ) {
@@ -796,7 +795,6 @@ class HTTP
                 $hostname = parse_url($appurl, PHP_URL_HOST);
                 $port = parse_url($appurl, PHP_URL_PORT);
                 $port = !empty($port) ? ':'.$port : '';
-
             } else { // no base URL specified for app, just use the current URL
                 $protocol = 'http';
                 $protocol .= (self::getServerHTTPS()) ? 's' : '';
diff --git a/lib/SimpleSAML/Utils/Random.php b/lib/SimpleSAML/Utils/Random.php
index b53ace2e5a5f40e1af4632c40db0a3a4421018ac..86937294e2b5c6ed3ca907bbc51ad5705a092fc7 100644
--- a/lib/SimpleSAML/Utils/Random.php
+++ b/lib/SimpleSAML/Utils/Random.php
@@ -27,4 +27,4 @@ class Random
     {
         return '_'.bin2hex(openssl_random_pseudo_bytes((int)((self::ID_LENGTH - 1)/2)));
     }
-}
\ No newline at end of file
+}
diff --git a/lib/SimpleSAML/Utils/Time.php b/lib/SimpleSAML/Utils/Time.php
index be8d47b2d9986a55c12d849bc490a42e59dcaef9..21c005e50784fd16bbf707e7ac80bafe3585b064 100644
--- a/lib/SimpleSAML/Utils/Time.php
+++ b/lib/SimpleSAML/Utils/Time.php
@@ -9,7 +9,6 @@ namespace SimpleSAML\Utils;
 
 use SimpleSAML\Logger;
 
-
 class Time
 {
 
diff --git a/lib/SimpleSAML/XHTML/EMail.php b/lib/SimpleSAML/XHTML/EMail.php
index 9638920e940b5f8dd1cedb190f15f49fc0fc7272..5796ec1c028f7cf6b745465a8259dd984e4a65f8 100644
--- a/lib/SimpleSAML/XHTML/EMail.php
+++ b/lib/SimpleSAML/XHTML/EMail.php
@@ -8,43 +8,44 @@
  */
 class SimpleSAML_XHTML_EMail
 {
-	private $to = null;
-	private $cc = null;
-	private $body = null;
-	private $from = null;
-	private $replyto = null;
-	private $subject = null;
-	private $headers = array();
-	
-
-	/**
-	 * Constructor
-	 */
-	public function __construct($to, $subject, $from = null, $cc = null, $replyto = null)
+    private $to = null;
+    private $cc = null;
+    private $body = null;
+    private $from = null;
+    private $replyto = null;
+    private $subject = null;
+    private $headers = array();
+
+
+    /**
+     * Constructor
+     */
+    public function __construct($to, $subject, $from = null, $cc = null, $replyto = null)
     {
-		$this->to = $to;
-		$this->cc = $cc;
-		$this->from = $from;
-		$this->replyto = $replyto;
-		$this->subject = $subject;
-	}
-
-	/*
+        $this->to = $to;
+        $this->cc = $cc;
+        $this->from = $from;
+        $this->replyto = $replyto;
+        $this->subject = $subject;
+    }
+
+    /*
      * @param string $body
      * @return void
      */
     public function setBody($body)
     {
-		$this->body = $body;
-	}
+        $this->body = $body;
+    }
 
 
-	/*
+    /*
      * @param string $body
      * @return void
      */
-	private function getHTML($body) {
-		return '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
+    private function getHTML($body)
+    {
+        return '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
         "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
 <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
 <head>
@@ -68,32 +69,34 @@ pre {
 </div>
 </body>
 </html>';
-	}
+    }
 
 
     /*
      * @return void
      */
-	public function send()
+    public function send()
     {
-		if ($this->to === null) {
+        if ($this->to === null) {
             throw new Exception('EMail field [to] is required and not set.');
         } elseif ($this->subject === null) {
             throw new Exception('EMail field [subject] is required and not set.');
         } elseif ($this->body === null) {
             throw new Exception('EMail field [body] is required and not set.');
         }
-		
-		$random_hash = bin2hex(openssl_random_pseudo_bytes(16));
-		
-		if (isset($this->from))
-			$this->headers[]= 'From: ' . $this->from;
-		if (isset($this->replyto))
-			$this->headers[]= 'Reply-To: ' . $this->replyto;
-
-		$this->headers[] = 'Content-Type: multipart/alternative; boundary="simplesamlphp-' . $random_hash . '"'; 
-		
-		$message = '
+
+        $random_hash = bin2hex(openssl_random_pseudo_bytes(16));
+
+        if (isset($this->from)) {
+            $this->headers[]= 'From: ' . $this->from;
+        }
+        if (isset($this->replyto)) {
+            $this->headers[]= 'Reply-To: ' . $this->replyto;
+        }
+
+        $this->headers[] = 'Content-Type: multipart/alternative; boundary="simplesamlphp-' . $random_hash . '"';
+
+        $message = '
 --simplesamlphp-' . $random_hash . '
 Content-Type: text/plain; charset="utf-8" 
 Content-Transfer-Encoding: 8bit
@@ -108,12 +111,12 @@ Content-Transfer-Encoding: 8bit
 
 --simplesamlphp-' . $random_hash . '--
 ';
-		$headers = implode("\n", $this->headers);
+        $headers = implode("\n", $this->headers);
 
-		$mail_sent = @mail($this->to, $this->subject, $message, $headers);
-		SimpleSAML\Logger::debug('Email: Sending e-mail to [' . $this->to . '] : ' . ($mail_sent ? 'OK' : 'Failed'));
-		if (!$mail_sent) {
+        $mail_sent = @mail($this->to, $this->subject, $message, $headers);
+        SimpleSAML\Logger::debug('Email: Sending e-mail to [' . $this->to . '] : ' . ($mail_sent ? 'OK' : 'Failed'));
+        if (!$mail_sent) {
             throw new Exception('Error when sending e-mail');
         }
-	}
+    }
 }
diff --git a/lib/SimpleSAML/XHTML/Template.php b/lib/SimpleSAML/XHTML/Template.php
index 1e5b655126540cde55f223a3863a69168d2a1630..d23c95f43e34de68d899b2b292f197a354d8c628 100644
--- a/lib/SimpleSAML/XHTML/Template.php
+++ b/lib/SimpleSAML/XHTML/Template.php
@@ -313,7 +313,6 @@ class SimpleSAML_XHTML_Template
         $templatedir = $moduledir.'/templates';
         if (!is_dir($templatedir)) {
             throw new InvalidArgumentException('The module \''.$module.'\' has no templates directory.');
-
         }
         return $templatedir;
     }
diff --git a/lib/SimpleSAML/XHTML/TemplateControllerInterface.php b/lib/SimpleSAML/XHTML/TemplateControllerInterface.php
index bd54907c48a9e5d4152062e36a19add335ad83ee..8d6f4e733ee95f3f082f8cda06fe4f631f74622e 100644
--- a/lib/SimpleSAML/XHTML/TemplateControllerInterface.php
+++ b/lib/SimpleSAML/XHTML/TemplateControllerInterface.php
@@ -7,7 +7,8 @@ namespace SimpleSAML\XHTML;
  *
  * @package SimpleSAMLphp
  */
-interface TemplateControllerInterface {
+interface TemplateControllerInterface
+{
 
     /**
      * Implement to modify the twig environment after its initialization (e.g. add filters or extensions).
diff --git a/lib/SimpleSAML/XML/Validator.php b/lib/SimpleSAML/XML/Validator.php
index becf3516e74c6ca9ffc4e19619d09a6cce597e42..6d8a4f32a6acfb65e1e5be7f0da24f909b42af2e 100644
--- a/lib/SimpleSAML/XML/Validator.php
+++ b/lib/SimpleSAML/XML/Validator.php
@@ -325,7 +325,8 @@ class Validator
         assert(is_string($caFile));
 
         // Clear openssl errors
-        while (openssl_error_string() !== false);
+        while (openssl_error_string() !== false) {
+        }
 
         $res = openssl_x509_checkpurpose($certificate, X509_PURPOSE_ANY, array($caFile));