diff --git a/lib/SimpleSAML/Metadata/MetaDataStorageHandler.php b/lib/SimpleSAML/Metadata/MetaDataStorageHandler.php
index e668914ddec2617eecdfe02cf21d9ec1a2e27253..86d9446264c4b24227ba1d34b979bbb1b4173cb1 100644
--- a/lib/SimpleSAML/Metadata/MetaDataStorageHandler.php
+++ b/lib/SimpleSAML/Metadata/MetaDataStorageHandler.php
@@ -295,8 +295,8 @@ class MetaDataStorageHandler implements ClearableState
      * This function looks up the metadata for the given entity id in the given set. It will throw an
      * exception if it is unable to locate the metadata.
      *
-     * @param string|null $entityId The entity id we are looking up. This parameter may be NULL, in which case we look up
-     * the current entity id based on the current hostname/path.
+     * @param string|null $entityId The entity id we are looking up. This parameter may be NULL,
+     * in which case we look up the current entity id based on the current hostname/path.
      * @param string $set The set of metadata we are looking up the entity id in.
      *
      * @return array The metadata array describing the specified entity.
diff --git a/lib/SimpleSAML/Metadata/Sources/MDQ.php b/lib/SimpleSAML/Metadata/Sources/MDQ.php
index a972c3ef70365d7d1940c702b507b1ae0ed3cae2..a8ef2956f01d38784966d78738f8a3221329529f 100644
--- a/lib/SimpleSAML/Metadata/Sources/MDQ.php
+++ b/lib/SimpleSAML/Metadata/Sources/MDQ.php
@@ -287,7 +287,9 @@ class MDQ extends \SimpleSAML\Metadata\MetaDataStorageSource
 
         $data = self::getParsedSet($entity, $set);
         if ($data === null) {
-            throw new \Exception(__CLASS__ . ': no metadata for set "' . $set . '" available from "' . $entityId . '".');
+            throw new \Exception(
+                __CLASS__ . ': no metadata for set "' . $set . '" available from "' . $entityId . '".'
+            );
         }
 
         try {
diff --git a/modules/core/lib/Auth/Process/PHP.php b/modules/core/lib/Auth/Process/PHP.php
index a1dfab414f013ead3b1b71e3719a2f728ddd3845..45b5b465060db8eee901ffca6b7c4df85b2aec44 100644
--- a/modules/core/lib/Auth/Process/PHP.php
+++ b/modules/core/lib/Auth/Process/PHP.php
@@ -58,6 +58,7 @@ class PHP extends Auth\ProcessingFilter
          * @param array &$attributes
          * @param array &$state
          */
+        $function = function (
             /** @scrutinizer ignore-unused */ array &$attributes,
             /** @scrutinizer ignore-unused */ array &$state
         ) {
diff --git a/modules/saml/lib/Auth/Source/SP.php b/modules/saml/lib/Auth/Source/SP.php
index 4a7842d8fb844a0d07b57493d7445276856453af..4f633ccc4d58386dc634ff66a320a2298ca27e54 100644
--- a/modules/saml/lib/Auth/Source/SP.php
+++ b/modules/saml/lib/Auth/Source/SP.php
@@ -589,7 +589,7 @@ class SP extends \SimpleSAML\Auth\Source
         // Otherwise use extensions that might be defined in the local SP (only makes sense in a proxy scenario)
         if (isset($state['saml:Extensions']) && count($state['saml:Extensions']) > 0) {
             $ar->setExtensions($state['saml:Extensions']);
-        } else if ($this->metadata->getArray('saml:Extensions', null) !== null) {
+        } elseif ($this->metadata->getArray('saml:Extensions', null) !== null) {
             $ar->setExtensions($this->metadata->getArray('saml:Extensions'));
         }
 
diff --git a/tests/lib/SimpleSAML/Store/RedisTest.php b/tests/lib/SimpleSAML/Store/RedisTest.php
index ede953e3ac5e83cd45aa465e17c7f99e227f7c4e..069c2435a2760a49da43bb85da0065693e789cbf 100644
--- a/tests/lib/SimpleSAML/Store/RedisTest.php
+++ b/tests/lib/SimpleSAML/Store/RedisTest.php
@@ -54,6 +54,7 @@ class RedisTest extends TestCase
         $this->mocked_redis->method('del')
                            ->will($this->returnCallback([$this, 'delMocked']));
 
+        $nop = /** @return void */ function () {
             return;
         };