diff --git a/lib/SimpleSAML/Auth/AuthenticationFactory.php b/lib/SimpleSAML/Auth/AuthenticationFactory.php
index 25dc18307d22f0494d4bf7b527e88aafab6eb34e..e0569d2934a1d1e16bbe00cca644d0261224d891 100644
--- a/lib/SimpleSAML/Auth/AuthenticationFactory.php
+++ b/lib/SimpleSAML/Auth/AuthenticationFactory.php
@@ -1,5 +1,7 @@
 <?php
 
+declare(strict_types=1);
+
 namespace SimpleSAML\Auth;
 
 use SimpleSAML\Configuration;
diff --git a/lib/SimpleSAML/Auth/DefaultAuth.php b/lib/SimpleSAML/Auth/DefaultAuth.php
index 4a2a5da54915ac3a7bf70b006ac1eaca17cece4e..192868f31635dbbbb8ca0ff4cd158d233fed3388 100644
--- a/lib/SimpleSAML/Auth/DefaultAuth.php
+++ b/lib/SimpleSAML/Auth/DefaultAuth.php
@@ -1,5 +1,7 @@
 <?php
 
+declare(strict_types=1);
+
 namespace SimpleSAML\Auth;
 
 use SimpleSAML\Module\saml\Auth\Source\SP;
diff --git a/lib/SimpleSAML/Auth/LDAP.php b/lib/SimpleSAML/Auth/LDAP.php
index f8bb3de4c15326f1a5e4d46c841ba5c0a08d7fcb..3977274e94fc4fe71edc18d37750cb256897c1cc 100644
--- a/lib/SimpleSAML/Auth/LDAP.php
+++ b/lib/SimpleSAML/Auth/LDAP.php
@@ -1,5 +1,7 @@
 <?php
 
+declare(strict_types=1);
+
 namespace SimpleSAML\Auth;
 
 \SimpleSAML\Logger::warning("The class \SimpleSAML\Auth\LDAP has been moved to the ldap module, please use \SimpleSAML\Module\saml\Auth\Ldap instead.");
diff --git a/lib/SimpleSAML/Auth/ProcessingChain.php b/lib/SimpleSAML/Auth/ProcessingChain.php
index b5bb4888d79282aa357cf14b7d08f5866433c23f..3ba249ecf344123c3f921b98d42c83646c23ef19 100644
--- a/lib/SimpleSAML/Auth/ProcessingChain.php
+++ b/lib/SimpleSAML/Auth/ProcessingChain.php
@@ -1,5 +1,7 @@
 <?php
 
+declare(strict_types=1);
+
 namespace SimpleSAML\Auth;
 
 use SimpleSAML\Configuration;
diff --git a/lib/SimpleSAML/Auth/ProcessingFilter.php b/lib/SimpleSAML/Auth/ProcessingFilter.php
index baeb5834b68dc81dd8c2f3e1f35cbde829a40663..964e63e1a7884b8800b47427e12428ec9f661780 100644
--- a/lib/SimpleSAML/Auth/ProcessingFilter.php
+++ b/lib/SimpleSAML/Auth/ProcessingFilter.php
@@ -1,5 +1,7 @@
 <?php
 
+declare(strict_types=1);
+
 namespace SimpleSAML\Auth;
 
 /**
diff --git a/lib/SimpleSAML/Auth/Simple.php b/lib/SimpleSAML/Auth/Simple.php
index 5ad7ca2cac063ba32ef1bad7f1fb9e62261c4dd3..ac9e5afe8a1ba01b9273e16b3725460230bdd1ba 100644
--- a/lib/SimpleSAML/Auth/Simple.php
+++ b/lib/SimpleSAML/Auth/Simple.php
@@ -1,5 +1,7 @@
 <?php
 
+declare(strict_types=1);
+
 namespace SimpleSAML\Auth;
 
 use SimpleSAML\Configuration;
diff --git a/lib/SimpleSAML/Auth/Source.php b/lib/SimpleSAML/Auth/Source.php
index b3dfffc285f70e5d07481aa76bdc068a89585e35..b818ccc9d2c8b06c54202fd20937853c17dcee65 100644
--- a/lib/SimpleSAML/Auth/Source.php
+++ b/lib/SimpleSAML/Auth/Source.php
@@ -1,5 +1,7 @@
 <?php
 
+declare(strict_types=1);
+
 namespace SimpleSAML\Auth;
 
 use SimpleSAML\Configuration;
diff --git a/lib/SimpleSAML/Auth/SourceFactory.php b/lib/SimpleSAML/Auth/SourceFactory.php
index 9f5fdfafbeccf28ad2c37c1e18cb30844fea8055..1b3077655014e61a30dbe44880be8f165fd460f6 100644
--- a/lib/SimpleSAML/Auth/SourceFactory.php
+++ b/lib/SimpleSAML/Auth/SourceFactory.php
@@ -1,5 +1,7 @@
 <?php
 
+declare(strict_types=1);
+
 namespace SimpleSAML\Auth;
 
 interface SourceFactory
diff --git a/lib/SimpleSAML/Auth/State.php b/lib/SimpleSAML/Auth/State.php
index f938f9d572a7a0612629d34ced583f2d88ac6371..2a298356d0569a8595187a7308b122ef5451dea6 100644
--- a/lib/SimpleSAML/Auth/State.php
+++ b/lib/SimpleSAML/Auth/State.php
@@ -1,5 +1,7 @@
 <?php
 
+declare(strict_types=1);
+
 namespace SimpleSAML\Auth;
 
 use SimpleSAML\Configuration;
diff --git a/lib/SimpleSAML/Auth/TimeLimitedToken.php b/lib/SimpleSAML/Auth/TimeLimitedToken.php
index e668d73ab25a4d6ea8763037b71d52579456152a..12b2096c7c807ed29278524c070bdb77448d7f4b 100644
--- a/lib/SimpleSAML/Auth/TimeLimitedToken.php
+++ b/lib/SimpleSAML/Auth/TimeLimitedToken.php
@@ -1,5 +1,7 @@
 <?php
 
+declare(strict_types=1);
+
 namespace SimpleSAML\Auth;
 
 use SimpleSAML\Utils;
diff --git a/lib/SimpleSAML/Bindings/Shib13/Artifact.php b/lib/SimpleSAML/Bindings/Shib13/Artifact.php
index dfead878b6cab900a03204f89c786c3d53faa896..cc37699003620c0c4f675d4e92ac07bc2128f493 100644
--- a/lib/SimpleSAML/Bindings/Shib13/Artifact.php
+++ b/lib/SimpleSAML/Bindings/Shib13/Artifact.php
@@ -1,5 +1,7 @@
 <?php
 
+declare(strict_types=1);
+
 /**
  * Implementation of the Shibboleth 1.3 Artifact binding.
  *
diff --git a/lib/SimpleSAML/Bindings/Shib13/HTTPPost.php b/lib/SimpleSAML/Bindings/Shib13/HTTPPost.php
index d7c38700a9e96abb1824a7d4c726a7fcd87b6434..594c079d3d1117e6b8e4206d4a46d03e94eebf06 100644
--- a/lib/SimpleSAML/Bindings/Shib13/HTTPPost.php
+++ b/lib/SimpleSAML/Bindings/Shib13/HTTPPost.php
@@ -1,5 +1,6 @@
 <?php
 
+declare(strict_types=1);
 
 /**
  * Implementation of the Shibboleth 1.3 HTTP-POST binding.
diff --git a/lib/SimpleSAML/Configuration.php b/lib/SimpleSAML/Configuration.php
index 8949a10c4f088ed4babdfd906e54ab9ccc2ba59e..aa05a86607711b007b3ede4b9a56a87c3c702191 100644
--- a/lib/SimpleSAML/Configuration.php
+++ b/lib/SimpleSAML/Configuration.php
@@ -1,5 +1,7 @@
 <?php
 
+declare(strict_types=1);
+
 namespace SimpleSAML;
 
 use SAML2\Constants;
diff --git a/lib/SimpleSAML/Database.php b/lib/SimpleSAML/Database.php
index 5fb3779a7a5c9008f8c2e874e62e60dd7192bb64..4c815a02447c96a957cf55a788dd22d627ff02d5 100644
--- a/lib/SimpleSAML/Database.php
+++ b/lib/SimpleSAML/Database.php
@@ -1,5 +1,7 @@
 <?php
 
+declare(strict_types=1);
+
 namespace SimpleSAML;
 
 use PDO;
diff --git a/lib/SimpleSAML/Error/Assertion.php b/lib/SimpleSAML/Error/Assertion.php
index 4a26240afa30d47ef0d012893210b3aba2056ee7..30e6d786647896d3a71117747f5769a45a6c1721 100644
--- a/lib/SimpleSAML/Error/Assertion.php
+++ b/lib/SimpleSAML/Error/Assertion.php
@@ -1,5 +1,7 @@
 <?php
 
+declare(strict_types=1);
+
 namespace SimpleSAML\Error;
 
 /**
diff --git a/lib/SimpleSAML/Error/AuthSource.php b/lib/SimpleSAML/Error/AuthSource.php
index 3f53115eca3b9d7a8f6ce88b9cfecf312d127dcf..f6caaf1ade47c71b9806526a06af0afb85835e37 100644
--- a/lib/SimpleSAML/Error/AuthSource.php
+++ b/lib/SimpleSAML/Error/AuthSource.php
@@ -1,5 +1,7 @@
 <?php
 
+declare(strict_types=1);
+
 namespace SimpleSAML\Error;
 
 /**
diff --git a/lib/SimpleSAML/Error/BadRequest.php b/lib/SimpleSAML/Error/BadRequest.php
index 418f184b4ff8b89748cf42efb3202a07c075e778..d45c2ba442ec79ea30aa1058fe6bf0422db582fe 100644
--- a/lib/SimpleSAML/Error/BadRequest.php
+++ b/lib/SimpleSAML/Error/BadRequest.php
@@ -1,5 +1,7 @@
 <?php
 
+declare(strict_types=1);
+
 namespace SimpleSAML\Error;
 
 /**
diff --git a/lib/SimpleSAML/Error/BadUserInput.php b/lib/SimpleSAML/Error/BadUserInput.php
index 5f94dcc0493fc0a17a88cb4a17d9aabed17921f8..427bf85a951fcb271f73f5d01f1c9d5006fa99d2 100644
--- a/lib/SimpleSAML/Error/BadUserInput.php
+++ b/lib/SimpleSAML/Error/BadUserInput.php
@@ -1,5 +1,7 @@
 <?php
 
+declare(strict_types=1);
+
 namespace SimpleSAML\Error;
 
 /**
diff --git a/lib/SimpleSAML/Error/CannotSetCookie.php b/lib/SimpleSAML/Error/CannotSetCookie.php
index 70287404f9f7d9fb48a2d2e0e7718020b09f910a..d3b0f9d537a49b6b0c49ae48546ea80fd568ae2c 100644
--- a/lib/SimpleSAML/Error/CannotSetCookie.php
+++ b/lib/SimpleSAML/Error/CannotSetCookie.php
@@ -1,5 +1,7 @@
 <?php
 
+declare(strict_types=1);
+
 namespace SimpleSAML\Error;
 
 /**
diff --git a/lib/SimpleSAML/Error/ConfigurationError.php b/lib/SimpleSAML/Error/ConfigurationError.php
index 044771574a2e50502f2c98860ac6d7d1beb08de4..1cd98b09e5d6fad7a50c169bb1db0255ad43a505 100644
--- a/lib/SimpleSAML/Error/ConfigurationError.php
+++ b/lib/SimpleSAML/Error/ConfigurationError.php
@@ -1,5 +1,7 @@
 <?php
 
+declare(strict_types=1);
+
 namespace SimpleSAML\Error;
 
 /**
diff --git a/lib/SimpleSAML/Error/CriticalConfigurationError.php b/lib/SimpleSAML/Error/CriticalConfigurationError.php
index f078ee69579b3cf2108abc15025c72fcc28bc67b..8ddfd4f9f87fba3bd8997c4da7349150bec88ef8 100644
--- a/lib/SimpleSAML/Error/CriticalConfigurationError.php
+++ b/lib/SimpleSAML/Error/CriticalConfigurationError.php
@@ -1,5 +1,7 @@
 <?php
 
+declare(strict_types=1);
+
 namespace SimpleSAML\Error;
 
 use SimpleSAML\Configuration;
diff --git a/lib/SimpleSAML/Error/Error.php b/lib/SimpleSAML/Error/Error.php
index 11c3213f59b086bcaae1bc4a13d68e73cf613e25..563d373816971a40331a32c543477c1208eeb975 100644
--- a/lib/SimpleSAML/Error/Error.php
+++ b/lib/SimpleSAML/Error/Error.php
@@ -1,5 +1,7 @@
 <?php
 
+declare(strict_types=1);
+
 namespace SimpleSAML\Error;
 
 use SimpleSAML\Configuration;
diff --git a/lib/SimpleSAML/Error/ErrorCodes.php b/lib/SimpleSAML/Error/ErrorCodes.php
index 75e7f1b8567e211d91fd000d297de7ed50a96b04..4f90de7bfcfab022507f963883a7d4bdef3878fe 100644
--- a/lib/SimpleSAML/Error/ErrorCodes.php
+++ b/lib/SimpleSAML/Error/ErrorCodes.php
@@ -1,5 +1,7 @@
 <?php
 
+declare(strict_types=1);
+
 namespace SimpleSAML\Error;
 
 use SimpleSAML\Locale\Translate;
diff --git a/lib/SimpleSAML/Error/Exception.php b/lib/SimpleSAML/Error/Exception.php
index 3e6690942185ac63945f4e6f5b79a188a5e44f3f..b0b7b8809bd0c94ae1c213dd2abb42edf5a601b4 100644
--- a/lib/SimpleSAML/Error/Exception.php
+++ b/lib/SimpleSAML/Error/Exception.php
@@ -1,5 +1,7 @@
 <?php
 
+declare(strict_types=1);
+
 namespace SimpleSAML\Error;
 
 use SimpleSAML\Configuration;
diff --git a/lib/SimpleSAML/Error/InvalidCredential.php b/lib/SimpleSAML/Error/InvalidCredential.php
index 98d3b85d7b993e0ea9d1e0816dd3778c56548f54..35b991ef00c7e548e61c8e04d2c4adbf21186783 100644
--- a/lib/SimpleSAML/Error/InvalidCredential.php
+++ b/lib/SimpleSAML/Error/InvalidCredential.php
@@ -1,5 +1,7 @@
 <?php
 
+declare(strict_types=1);
+
 namespace SimpleSAML\Error;
 
 /**
diff --git a/lib/SimpleSAML/Error/MetadataNotFound.php b/lib/SimpleSAML/Error/MetadataNotFound.php
index 47636bc215e7029b885a330342cd31561cc56076..9eabf67af9837c6bfce51218653948b18d7e7dbd 100644
--- a/lib/SimpleSAML/Error/MetadataNotFound.php
+++ b/lib/SimpleSAML/Error/MetadataNotFound.php
@@ -1,5 +1,7 @@
 <?php
 
+declare(strict_types=1);
+
 namespace SimpleSAML\Error;
 
 /**
diff --git a/lib/SimpleSAML/Error/NoPassive.php b/lib/SimpleSAML/Error/NoPassive.php
index 43b42cf46b1110e3e4787adfdf5b36aa1e6668b0..5687adffd47abc0211f492a38d498192e440947d 100644
--- a/lib/SimpleSAML/Error/NoPassive.php
+++ b/lib/SimpleSAML/Error/NoPassive.php
@@ -1,5 +1,7 @@
 <?php
 
+declare(strict_types=1);
+
 namespace SimpleSAML\Error;
 
 /**
diff --git a/lib/SimpleSAML/Error/NoState.php b/lib/SimpleSAML/Error/NoState.php
index d0281beb01eb4d6bc0c2a8dcbb4255d042947adf..599bd1cb2d3f7e1a410b5dff9c8421d83247ea51 100644
--- a/lib/SimpleSAML/Error/NoState.php
+++ b/lib/SimpleSAML/Error/NoState.php
@@ -1,5 +1,7 @@
 <?php
 
+declare(strict_types=1);
+
 namespace SimpleSAML\Error;
 
 /**
diff --git a/lib/SimpleSAML/Error/NotFound.php b/lib/SimpleSAML/Error/NotFound.php
index ed556a38cf985333612a614384c72d70cc961554..0a5f72e0fa91ef18201f40de4330c0e14b500c4e 100644
--- a/lib/SimpleSAML/Error/NotFound.php
+++ b/lib/SimpleSAML/Error/NotFound.php
@@ -1,5 +1,7 @@
 <?php
 
+declare(strict_types=1);
+
 namespace SimpleSAML\Error;
 
 use SimpleSAML\Utils;
diff --git a/lib/SimpleSAML/Error/ProxyCountExceeded.php b/lib/SimpleSAML/Error/ProxyCountExceeded.php
index 6b325f3b61a59d4d5ae6bd064e65ae46e13ab48c..a92844f2ee691b95c7610ca7720142962f4d8896 100644
--- a/lib/SimpleSAML/Error/ProxyCountExceeded.php
+++ b/lib/SimpleSAML/Error/ProxyCountExceeded.php
@@ -1,5 +1,7 @@
 <?php
 
+declare(strict_types=1);
+
 namespace SimpleSAML\Error;
 
 /**
diff --git a/lib/SimpleSAML/Error/UnserializableException.php b/lib/SimpleSAML/Error/UnserializableException.php
index 5634c287443a8fcb76f654d2e5cf6317eba0c253..dcee7b0a55b1a5f9171988cd03324c59ce1039de 100644
--- a/lib/SimpleSAML/Error/UnserializableException.php
+++ b/lib/SimpleSAML/Error/UnserializableException.php
@@ -1,5 +1,7 @@
 <?php
 
+declare(strict_types=1);
+
 namespace SimpleSAML\Error;
 
 /**
diff --git a/lib/SimpleSAML/Error/User.php b/lib/SimpleSAML/Error/User.php
index b2da0e47e1a644ba4df559616cc44d8b8829acc7..4f90141b41f1c9026655cb21e6e3d0d1d1987e37 100644
--- a/lib/SimpleSAML/Error/User.php
+++ b/lib/SimpleSAML/Error/User.php
@@ -1,5 +1,7 @@
 <?php
 
+declare(strict_types=1);
+
 namespace SimpleSAML\Error;
 
 /**
diff --git a/lib/SimpleSAML/Error/UserAborted.php b/lib/SimpleSAML/Error/UserAborted.php
index 7be00d20ee67a3ba621b8122b749ea11e2028c0f..8d06695c6b0dfc104c450bae2fb174a653c4ea9a 100644
--- a/lib/SimpleSAML/Error/UserAborted.php
+++ b/lib/SimpleSAML/Error/UserAborted.php
@@ -1,5 +1,7 @@
 <?php
 
+declare(strict_types=1);
+
 namespace SimpleSAML\Error;
 
 /**
diff --git a/lib/SimpleSAML/Error/UserNotFound.php b/lib/SimpleSAML/Error/UserNotFound.php
index 14e55078644b47719645733fff5b70e0b2a749cb..a381beed271a5bc00873f7c8f19fa9948fb53580 100644
--- a/lib/SimpleSAML/Error/UserNotFound.php
+++ b/lib/SimpleSAML/Error/UserNotFound.php
@@ -1,5 +1,7 @@
 <?php
 
+declare(strict_types=1);
+
 namespace SimpleSAML\Error;
 
 /**
diff --git a/lib/SimpleSAML/HTTP/Router.php b/lib/SimpleSAML/HTTP/Router.php
index 48d0155e0d485510550361e3f10da8696d37e341..40497af1d71e65f2a9237b4edef86a10c76430e6 100644
--- a/lib/SimpleSAML/HTTP/Router.php
+++ b/lib/SimpleSAML/HTTP/Router.php
@@ -1,5 +1,7 @@
 <?php
 
+declare(strict_types=1);
+
 namespace SimpleSAML\HTTP;
 
 use SimpleSAML\Configuration;
diff --git a/lib/SimpleSAML/HTTP/RunnableResponse.php b/lib/SimpleSAML/HTTP/RunnableResponse.php
index ea575f3bd37ac0cfeacdc344cccd7fbc60343c99..697b3ea7b394d24c0422627f689f0914849a4cab 100644
--- a/lib/SimpleSAML/HTTP/RunnableResponse.php
+++ b/lib/SimpleSAML/HTTP/RunnableResponse.php
@@ -1,5 +1,7 @@
 <?php
 
+declare(strict_types=1);
+
 namespace SimpleSAML\HTTP;
 
 use Symfony\Component\HttpFoundation\Response;
diff --git a/lib/SimpleSAML/IdP.php b/lib/SimpleSAML/IdP.php
index b1de1602ac953dc4007db2e2afaf1c46d95fafe1..bacc8c8040279e7e784c3542f7169994ab2b8381 100644
--- a/lib/SimpleSAML/IdP.php
+++ b/lib/SimpleSAML/IdP.php
@@ -1,5 +1,7 @@
 <?php
 
+declare(strict_types=1);
+
 namespace SimpleSAML;
 
 use SAML2\Constants as SAML2;
diff --git a/lib/SimpleSAML/IdP/IFrameLogoutHandler.php b/lib/SimpleSAML/IdP/IFrameLogoutHandler.php
index 2597fdbabf62e99cbdf7277c90c69efc6d8fef9e..c315cc82f27625fc9007d7b9b8226d98f95bf705 100644
--- a/lib/SimpleSAML/IdP/IFrameLogoutHandler.php
+++ b/lib/SimpleSAML/IdP/IFrameLogoutHandler.php
@@ -1,5 +1,7 @@
 <?php
 
+declare(strict_types=1);
+
 namespace SimpleSAML\IdP;
 
 use SimpleSAML\Auth;
diff --git a/lib/SimpleSAML/IdP/LogoutHandlerInterface.php b/lib/SimpleSAML/IdP/LogoutHandlerInterface.php
index fe52c00415a614b63e8d90ed32f526ebf2bffee2..c072456c9b3ccebc5551161e7a3b7a904f05eb14 100644
--- a/lib/SimpleSAML/IdP/LogoutHandlerInterface.php
+++ b/lib/SimpleSAML/IdP/LogoutHandlerInterface.php
@@ -1,5 +1,7 @@
 <?php
 
+declare(strict_types=1);
+
 namespace SimpleSAML\IdP;
 
 use SimpleSAML\Error;
diff --git a/lib/SimpleSAML/IdP/TraditionalLogoutHandler.php b/lib/SimpleSAML/IdP/TraditionalLogoutHandler.php
index 5e1921ad0c0f2d993a88cfa9dfbbca906652c895..7ea2bfe74c88651681b6f25611a9aeedc5b4287f 100644
--- a/lib/SimpleSAML/IdP/TraditionalLogoutHandler.php
+++ b/lib/SimpleSAML/IdP/TraditionalLogoutHandler.php
@@ -1,5 +1,7 @@
 <?php
 
+declare(strict_types=1);
+
 namespace SimpleSAML\IdP;
 
 use SimpleSAML\Auth;
diff --git a/lib/SimpleSAML/Locale/Language.php b/lib/SimpleSAML/Locale/Language.php
index cf32a274b39c1059baecf4e3c79cac022b755ca8..4f6581313c7787965f278652de53336d7b88db87 100644
--- a/lib/SimpleSAML/Locale/Language.php
+++ b/lib/SimpleSAML/Locale/Language.php
@@ -8,6 +8,8 @@
  * @package SimpleSAMLphp
  */
 
+declare(strict_types=1);
+
 namespace SimpleSAML\Locale;
 
 use SimpleSAML\Configuration;
diff --git a/lib/SimpleSAML/Locale/Localization.php b/lib/SimpleSAML/Locale/Localization.php
index 5121772173eab904d43ad9264f2aca590f05c8ed..a61d37010927ccdde750b6ccd5d6ceda8cebc147 100644
--- a/lib/SimpleSAML/Locale/Localization.php
+++ b/lib/SimpleSAML/Locale/Localization.php
@@ -7,6 +7,8 @@
  * @package SimpleSAMLphp
  */
 
+declare(strict_types=1);
+
 namespace SimpleSAML\Locale;
 
 use Gettext\Translations;
diff --git a/lib/SimpleSAML/Locale/Translate.php b/lib/SimpleSAML/Locale/Translate.php
index 6d7f5446ada3b3fc7824eb0205d3cbb271809ca2..e4c84cb05538431cc9026ead1a7656c80bb511fb 100644
--- a/lib/SimpleSAML/Locale/Translate.php
+++ b/lib/SimpleSAML/Locale/Translate.php
@@ -8,6 +8,8 @@
  * @package SimpleSAMLphp
  */
 
+declare(strict_types=1);
+
 namespace SimpleSAML\Locale;
 
 use Gettext\BaseTranslator;
diff --git a/lib/SimpleSAML/Logger.php b/lib/SimpleSAML/Logger.php
index 9cbe9ee693137e2c27f4422bc0a899dd0bcd3d4a..c7a86e0f3fb3d630a3d12beb246900f761dac4f6 100644
--- a/lib/SimpleSAML/Logger.php
+++ b/lib/SimpleSAML/Logger.php
@@ -1,5 +1,7 @@
 <?php
 
+declare(strict_types=1);
+
 namespace SimpleSAML;
 
 use SimpleSAML\Logger\ErrorLogLoggingHandler;
diff --git a/lib/SimpleSAML/Logger/ErrorLogLoggingHandler.php b/lib/SimpleSAML/Logger/ErrorLogLoggingHandler.php
index 07bfea093e2e7ec3bac7e7ac2e780008c7a5a7a5..5d5f6cafe4c3feb4551e5d944b35c95fa934a0bc 100644
--- a/lib/SimpleSAML/Logger/ErrorLogLoggingHandler.php
+++ b/lib/SimpleSAML/Logger/ErrorLogLoggingHandler.php
@@ -1,5 +1,7 @@
 <?php
 
+declare(strict_types=1);
+
 namespace SimpleSAML\Logger;
 
 use SimpleSAML\Configuration;
diff --git a/lib/SimpleSAML/Logger/FileLoggingHandler.php b/lib/SimpleSAML/Logger/FileLoggingHandler.php
index b7d041a03d016fb452dde193bfb28e0fbebe89f0..745a1ed6a02db92cf6acf1b7ea284bd72bc3c93d 100644
--- a/lib/SimpleSAML/Logger/FileLoggingHandler.php
+++ b/lib/SimpleSAML/Logger/FileLoggingHandler.php
@@ -1,5 +1,7 @@
 <?php
 
+declare(strict_types=1);
+
 namespace SimpleSAML\Logger;
 
 use SimpleSAML\Configuration;
diff --git a/lib/SimpleSAML/Logger/LoggingHandlerInterface.php b/lib/SimpleSAML/Logger/LoggingHandlerInterface.php
index 3d00324e5e21b1e649f81e9eeffc6cd8d284f54a..3681c26248fc3e9b07b2b36ec62da9483d1e9bf7 100644
--- a/lib/SimpleSAML/Logger/LoggingHandlerInterface.php
+++ b/lib/SimpleSAML/Logger/LoggingHandlerInterface.php
@@ -1,5 +1,7 @@
 <?php
 
+declare(strict_types=1);
+
 namespace SimpleSAML\Logger;
 
 use SimpleSAML\Configuration;
diff --git a/lib/SimpleSAML/Logger/StandardErrorLoggingHandler.php b/lib/SimpleSAML/Logger/StandardErrorLoggingHandler.php
index ecc028bf0e0e301a13bb5f149100501c1d76403b..02b31eab87694d81acd4eae14d1dffba423b176b 100644
--- a/lib/SimpleSAML/Logger/StandardErrorLoggingHandler.php
+++ b/lib/SimpleSAML/Logger/StandardErrorLoggingHandler.php
@@ -1,5 +1,7 @@
 <?php
 
+declare(strict_types=1);
+
 namespace SimpleSAML\Logger;
 
 use SimpleSAML\Configuration;
diff --git a/lib/SimpleSAML/Logger/SyslogLoggingHandler.php b/lib/SimpleSAML/Logger/SyslogLoggingHandler.php
index a5cfa6bc0692809b46792163b52afcc8270a82ca..49da62d8296d11a9ecbb78b8326a7587113ac20f 100644
--- a/lib/SimpleSAML/Logger/SyslogLoggingHandler.php
+++ b/lib/SimpleSAML/Logger/SyslogLoggingHandler.php
@@ -1,5 +1,7 @@
 <?php
 
+declare(strict_types=1);
+
 namespace SimpleSAML\Logger;
 
 use SimpleSAML\Configuration;
diff --git a/lib/SimpleSAML/Memcache.php b/lib/SimpleSAML/Memcache.php
index d95b6c6c139881c0637f33ef53f6288bd9352cb4..98684debd6d973268df9cb2c2d03987ca573ba99 100644
--- a/lib/SimpleSAML/Memcache.php
+++ b/lib/SimpleSAML/Memcache.php
@@ -1,5 +1,7 @@
 <?php
 
+declare(strict_types=1);
+
 namespace SimpleSAML;
 
 use SimpleSAML\Utils;
diff --git a/lib/SimpleSAML/Metadata/MetaDataStorageHandler.php b/lib/SimpleSAML/Metadata/MetaDataStorageHandler.php
index db0dc2a2418bab7c365f837302ba76a7cae41bb2..98548235911f63fb266a46dfb9ff32ed8e8f0bcb 100644
--- a/lib/SimpleSAML/Metadata/MetaDataStorageHandler.php
+++ b/lib/SimpleSAML/Metadata/MetaDataStorageHandler.php
@@ -1,5 +1,7 @@
 <?php
 
+declare(strict_types=1);
+
 namespace SimpleSAML\Metadata;
 
 use SAML2\Constants;
diff --git a/lib/SimpleSAML/Metadata/MetaDataStorageHandlerFlatFile.php b/lib/SimpleSAML/Metadata/MetaDataStorageHandlerFlatFile.php
index 33c3d8ba8a12c2f3575897097b414f5ecc200528..45d8e61fae35659d3cd3d9255ce9e028857bb1b2 100644
--- a/lib/SimpleSAML/Metadata/MetaDataStorageHandlerFlatFile.php
+++ b/lib/SimpleSAML/Metadata/MetaDataStorageHandlerFlatFile.php
@@ -1,5 +1,7 @@
 <?php
 
+declare(strict_types=1);
+
 namespace SimpleSAML\Metadata;
 
 use SimpleSAML\Configuration;
diff --git a/lib/SimpleSAML/Metadata/MetaDataStorageHandlerPdo.php b/lib/SimpleSAML/Metadata/MetaDataStorageHandlerPdo.php
index ea1d5ee8b2bff7f142954ec178bc7298fbde0787..841f7282dedac466fc6cfe99c33c703123c7b2db 100644
--- a/lib/SimpleSAML/Metadata/MetaDataStorageHandlerPdo.php
+++ b/lib/SimpleSAML/Metadata/MetaDataStorageHandlerPdo.php
@@ -1,5 +1,7 @@
 <?php
 
+declare(strict_types=1);
+
 namespace SimpleSAML\Metadata;
 
 use SimpleSAML\Database;
diff --git a/lib/SimpleSAML/Metadata/MetaDataStorageHandlerSerialize.php b/lib/SimpleSAML/Metadata/MetaDataStorageHandlerSerialize.php
index f168c04aa5f664febdd48479fc1712727c3e3146..c2dd6b0f1d8caf276a100ed7ae64ae747ca9d7ce 100644
--- a/lib/SimpleSAML/Metadata/MetaDataStorageHandlerSerialize.php
+++ b/lib/SimpleSAML/Metadata/MetaDataStorageHandlerSerialize.php
@@ -1,5 +1,7 @@
 <?php
 
+declare(strict_types=1);
+
 namespace SimpleSAML\Metadata;
 
 use SimpleSAML\Configuration;
diff --git a/lib/SimpleSAML/Metadata/MetaDataStorageHandlerXML.php b/lib/SimpleSAML/Metadata/MetaDataStorageHandlerXML.php
index 913397412fad3626c8bc8f4b05177b3d75563e5d..d1ae78c84b7511a583c6b0ee7ab49c473193aecc 100644
--- a/lib/SimpleSAML/Metadata/MetaDataStorageHandlerXML.php
+++ b/lib/SimpleSAML/Metadata/MetaDataStorageHandlerXML.php
@@ -1,5 +1,7 @@
 <?php
 
+declare(strict_types=1);
+
 namespace SimpleSAML\Metadata;
 
 use SimpleSAML\Configuration;
diff --git a/lib/SimpleSAML/Metadata/MetaDataStorageSource.php b/lib/SimpleSAML/Metadata/MetaDataStorageSource.php
index 04f188435ed83a9a2103894fe1df483f9c8b7b92..7a0b4be4bff3134e9fc6da7a637c0367461c9ca2 100644
--- a/lib/SimpleSAML/Metadata/MetaDataStorageSource.php
+++ b/lib/SimpleSAML/Metadata/MetaDataStorageSource.php
@@ -1,5 +1,7 @@
 <?php
 
+declare(strict_types=1);
+
 namespace SimpleSAML\Metadata;
 
 use SimpleSAML\Error;
diff --git a/lib/SimpleSAML/Metadata/SAMLBuilder.php b/lib/SimpleSAML/Metadata/SAMLBuilder.php
index 84ccdb6fb5b16ee96101aa14b0df90cabc5aa1f7..e90df10dab41aa8987a23e63785066fc00b34bce 100644
--- a/lib/SimpleSAML/Metadata/SAMLBuilder.php
+++ b/lib/SimpleSAML/Metadata/SAMLBuilder.php
@@ -1,5 +1,7 @@
 <?php
 
+declare(strict_types=1);
+
 namespace SimpleSAML\Metadata;
 
 use SAML2\Constants;
diff --git a/lib/SimpleSAML/Metadata/SAMLParser.php b/lib/SimpleSAML/Metadata/SAMLParser.php
index 9e154c438f609d2aa3c4fdc691e4adbfb1b3ae7c..64c0f02bc6530978db882f6e5a6328c65048c575 100644
--- a/lib/SimpleSAML/Metadata/SAMLParser.php
+++ b/lib/SimpleSAML/Metadata/SAMLParser.php
@@ -1,5 +1,7 @@
 <?php
 
+declare(strict_types=1);
+
 namespace SimpleSAML\Metadata;
 
 use DOMDocument;
diff --git a/lib/SimpleSAML/Metadata/Signer.php b/lib/SimpleSAML/Metadata/Signer.php
index 37b0cc699b1ec56ec37ee14f450ffce003eec32e..eec221bc82f13f8add9a6e1d8437f4eddfc2f509 100644
--- a/lib/SimpleSAML/Metadata/Signer.php
+++ b/lib/SimpleSAML/Metadata/Signer.php
@@ -1,5 +1,7 @@
 <?php
 
+declare(strict_types=1);
+
 namespace SimpleSAML\Metadata;
 
 use RobRichards\XMLSecLibs\XMLSecurityKey;
diff --git a/lib/SimpleSAML/Metadata/Sources/MDQ.php b/lib/SimpleSAML/Metadata/Sources/MDQ.php
index 9694d102bf0270e05b9154d1233c661824d36e48..4b3a3adb7ef2ddc46da6167609e1c58570a409f5 100644
--- a/lib/SimpleSAML/Metadata/Sources/MDQ.php
+++ b/lib/SimpleSAML/Metadata/Sources/MDQ.php
@@ -1,5 +1,7 @@
 <?php
 
+declare(strict_types=1);
+
 namespace SimpleSAML\Metadata\Sources;
 
 use RobRichards\XMLSecLibs\XMLSecurityDSig;
diff --git a/lib/SimpleSAML/Module.php b/lib/SimpleSAML/Module.php
index 10ad2a437facf074a99ef2b63600d4eb71639a0e..55f16cfaa79bd31a7f79d0825d7fe66345c87d78 100644
--- a/lib/SimpleSAML/Module.php
+++ b/lib/SimpleSAML/Module.php
@@ -1,5 +1,7 @@
 <?php
 
+declare(strict_types=1);
+
 namespace SimpleSAML;
 
 use SimpleSAML\HTTP\Router;
diff --git a/lib/SimpleSAML/Module/ControllerResolver.php b/lib/SimpleSAML/Module/ControllerResolver.php
index 3e06745b1ed3a0e5ec5ac491be9ee3abbb6a5b30..21638217e2cee7097130caac4bbf119d174f7e82 100644
--- a/lib/SimpleSAML/Module/ControllerResolver.php
+++ b/lib/SimpleSAML/Module/ControllerResolver.php
@@ -1,5 +1,7 @@
 <?php
 
+declare(strict_types=1);
+
 namespace SimpleSAML\Module;
 
 use SimpleSAML\Auth\AuthenticationFactory;
diff --git a/lib/SimpleSAML/Session.php b/lib/SimpleSAML/Session.php
index 7f5228b7ca792d9b9d53c35f96daceff1a67131d..5d6b6f683bc906a2a32af0d8ddc2cf0994a1b042 100644
--- a/lib/SimpleSAML/Session.php
+++ b/lib/SimpleSAML/Session.php
@@ -1,5 +1,7 @@
 <?php
 
+declare(strict_types=1);
+
 namespace SimpleSAML;
 
 use SAML2\XML\saml\AttributeValue;
diff --git a/lib/SimpleSAML/SessionHandler.php b/lib/SimpleSAML/SessionHandler.php
index 91fc08b26df9f640200665288d395aa25a870a8a..50498dcf4783a72754a8edd3cdd6c1d4868fceff 100644
--- a/lib/SimpleSAML/SessionHandler.php
+++ b/lib/SimpleSAML/SessionHandler.php
@@ -12,6 +12,8 @@
  * @package SimpleSAMLphp
  */
 
+declare(strict_types=1);
+
 namespace SimpleSAML;
 
 abstract class SessionHandler
diff --git a/lib/SimpleSAML/SessionHandlerCookie.php b/lib/SimpleSAML/SessionHandlerCookie.php
index 4b90a69f97a6768e020d8e6ac542f8214639d305..3cef005df778c43a81c4f34c81e18ce20cc27bd9 100644
--- a/lib/SimpleSAML/SessionHandlerCookie.php
+++ b/lib/SimpleSAML/SessionHandlerCookie.php
@@ -11,6 +11,8 @@
  * @abstract
  */
 
+declare(strict_types=1);
+
 namespace SimpleSAML;
 
 use SimpleSAML\Utils;
diff --git a/lib/SimpleSAML/SessionHandlerPHP.php b/lib/SimpleSAML/SessionHandlerPHP.php
index 1a6175a1940c0ed7a3d2bd0c4144f929db9a2b83..53ba9d5132fe6059a11db8f6cd6dda5d66de23df 100644
--- a/lib/SimpleSAML/SessionHandlerPHP.php
+++ b/lib/SimpleSAML/SessionHandlerPHP.php
@@ -9,6 +9,8 @@
  * @package SimpleSAMLphp
  */
 
+declare(strict_types=1);
+
 namespace SimpleSAML;
 
 use SimpleSAML\Error;
diff --git a/lib/SimpleSAML/SessionHandlerStore.php b/lib/SimpleSAML/SessionHandlerStore.php
index 7406a5be6efee13bb8381bc6f51699ec63637fc0..1169fab11035e1bfdffac47d1a09c312e2ce1ff7 100644
--- a/lib/SimpleSAML/SessionHandlerStore.php
+++ b/lib/SimpleSAML/SessionHandlerStore.php
@@ -6,6 +6,8 @@
  * @package SimpleSAMLphp
  */
 
+declare(strict_types=1);
+
 namespace SimpleSAML;
 
 class SessionHandlerStore extends SessionHandlerCookie
diff --git a/lib/SimpleSAML/Stats.php b/lib/SimpleSAML/Stats.php
index 7a65c9b1a95bcbcd6e9a94322e5b0bb0f6036011..caa0afe699f1ae91eb3c38fa74771ddfadf6d94e 100644
--- a/lib/SimpleSAML/Stats.php
+++ b/lib/SimpleSAML/Stats.php
@@ -1,5 +1,7 @@
 <?php
 
+declare(strict_types=1);
+
 namespace SimpleSAML;
 
 /**
diff --git a/lib/SimpleSAML/Stats/Output.php b/lib/SimpleSAML/Stats/Output.php
index 0790f6ac5033b09f7054b6cfa6644dd06e26142d..7ac5a71ec741a5fc3a38350e5fcaa11bc043ee5c 100644
--- a/lib/SimpleSAML/Stats/Output.php
+++ b/lib/SimpleSAML/Stats/Output.php
@@ -1,5 +1,7 @@
 <?php
 
+declare(strict_types=1);
+
 namespace SimpleSAML\Stats;
 
 use SimpleSAML\Configuration;
diff --git a/lib/SimpleSAML/Store.php b/lib/SimpleSAML/Store.php
index 50d5b3162200812474a28dab988d95389658fb8c..4c2512851ef3c8d35809ca907100eca1279414b4 100644
--- a/lib/SimpleSAML/Store.php
+++ b/lib/SimpleSAML/Store.php
@@ -1,5 +1,7 @@
 <?php
 
+declare(strict_types=1);
+
 namespace SimpleSAML;
 
 use SimpleSAML\Error;
diff --git a/lib/SimpleSAML/Store/Memcache.php b/lib/SimpleSAML/Store/Memcache.php
index 2a8da49a79f39c3b08e43b10202f3348f7fd44ad..e674ae0fdb746b1b415b0e2ae01d53fce8d29e4e 100644
--- a/lib/SimpleSAML/Store/Memcache.php
+++ b/lib/SimpleSAML/Store/Memcache.php
@@ -1,5 +1,7 @@
 <?php
 
+declare(strict_types=1);
+
 namespace SimpleSAML\Store;
 
 use SimpleSAML\Configuration;
diff --git a/lib/SimpleSAML/Store/Redis.php b/lib/SimpleSAML/Store/Redis.php
index 51c07cd77aab23574343504f66b77ff0bbf62bae..acf766e35db88cdbcafd170e70ce9c99d8c23fba 100644
--- a/lib/SimpleSAML/Store/Redis.php
+++ b/lib/SimpleSAML/Store/Redis.php
@@ -1,5 +1,7 @@
 <?php
 
+declare(strict_types=1);
+
 namespace SimpleSAML\Store;
 
 use Predis\Client;
diff --git a/lib/SimpleSAML/Store/SQL.php b/lib/SimpleSAML/Store/SQL.php
index 0fc6c7991e7c6885cf12e35de29134aab9c2df2f..08e7d1837b6977dc9b310664eb56fab43da88202 100644
--- a/lib/SimpleSAML/Store/SQL.php
+++ b/lib/SimpleSAML/Store/SQL.php
@@ -1,5 +1,7 @@
 <?php
 
+declare(strict_types=1);
+
 namespace SimpleSAML\Store;
 
 use PDO;
diff --git a/lib/SimpleSAML/Utilities.php b/lib/SimpleSAML/Utilities.php
index 3ea08caa743099613951ffc15b783f7b99893527..ca5536a44a2dafc6d4a1762f129e1dff0e7be041 100644
--- a/lib/SimpleSAML/Utilities.php
+++ b/lib/SimpleSAML/Utilities.php
@@ -1,5 +1,7 @@
 <?php
 
+declare(strict_types=1);
+
 namespace SimpleSAML;
 
 use SimpleSAML\Error\Error;
diff --git a/lib/SimpleSAML/Utils/Arrays.php b/lib/SimpleSAML/Utils/Arrays.php
index b38d0ca5c7726c7b561e632f720f6453b9cb051f..7c081d40f7b58967d59ed5568c1e243d6ada01f9 100644
--- a/lib/SimpleSAML/Utils/Arrays.php
+++ b/lib/SimpleSAML/Utils/Arrays.php
@@ -1,5 +1,7 @@
 <?php
 
+declare(strict_types=1);
+
 namespace SimpleSAML\Utils;
 
 /**
diff --git a/lib/SimpleSAML/Utils/Attributes.php b/lib/SimpleSAML/Utils/Attributes.php
index 09e346ab6ebda4af279ed0b977477b5a04815340..6cc0fbb6a35f0b1096fbe63f0c233ee4c91a41ad 100644
--- a/lib/SimpleSAML/Utils/Attributes.php
+++ b/lib/SimpleSAML/Utils/Attributes.php
@@ -1,5 +1,7 @@
 <?php
 
+declare(strict_types=1);
+
 namespace SimpleSAML\Utils;
 
 use SimpleSAML\Error;
diff --git a/lib/SimpleSAML/Utils/Auth.php b/lib/SimpleSAML/Utils/Auth.php
index 48cfcb16fcbf48de33b1d98e6d52713bf541f191..5adf2a370f426eabbe7e396d338e66d21033b65b 100644
--- a/lib/SimpleSAML/Utils/Auth.php
+++ b/lib/SimpleSAML/Utils/Auth.php
@@ -1,5 +1,7 @@
 <?php
 
+declare(strict_types=1);
+
 namespace SimpleSAML\Utils;
 
 use SimpleSAML\Auth as Authentication;
diff --git a/lib/SimpleSAML/Utils/ClearableState.php b/lib/SimpleSAML/Utils/ClearableState.php
index b28554c6cf718c504183ada662d88495bdadca37..5c90ccfc5245b5cfcc083e2ce672c11f8de4e9b7 100644
--- a/lib/SimpleSAML/Utils/ClearableState.php
+++ b/lib/SimpleSAML/Utils/ClearableState.php
@@ -1,5 +1,7 @@
 <?php
 
+declare(strict_types=1);
+
 namespace SimpleSAML\Utils;
 
 /**
diff --git a/lib/SimpleSAML/Utils/Config.php b/lib/SimpleSAML/Utils/Config.php
index 01f5f50c1d4a1bb36309cf974947f5fd524cb637..6059ff35e6514cdce334114b395f3cc51b47a550 100644
--- a/lib/SimpleSAML/Utils/Config.php
+++ b/lib/SimpleSAML/Utils/Config.php
@@ -1,5 +1,7 @@
 <?php
 
+declare(strict_types=1);
+
 namespace SimpleSAML\Utils;
 
 use SimpleSAML\Configuration;
diff --git a/lib/SimpleSAML/Utils/Config/Metadata.php b/lib/SimpleSAML/Utils/Config/Metadata.php
index eedb4f79fc0bf8f2ddc3a7112fe1e20718e93ee9..50e8126513dc2278e86440f1708d5f11e0b50716 100644
--- a/lib/SimpleSAML/Utils/Config/Metadata.php
+++ b/lib/SimpleSAML/Utils/Config/Metadata.php
@@ -1,5 +1,7 @@
 <?php
 
+declare(strict_types=1);
+
 namespace SimpleSAML\Utils\Config;
 
 use SAML2\Constants;
diff --git a/lib/SimpleSAML/Utils/Crypto.php b/lib/SimpleSAML/Utils/Crypto.php
index ba5af37a234e339dce0dfc7ab8c088b5e05a6ec6..59c6cd2fa0507ed22ee0b1f00320a85c2714faa5 100644
--- a/lib/SimpleSAML/Utils/Crypto.php
+++ b/lib/SimpleSAML/Utils/Crypto.php
@@ -1,5 +1,7 @@
 <?php
 
+declare(strict_types=1);
+
 namespace SimpleSAML\Utils;
 
 use SimpleSAML\Configuration;
diff --git a/lib/SimpleSAML/Utils/EMail.php b/lib/SimpleSAML/Utils/EMail.php
index f1595c972b9c8eca7e7fdb46973f01999210270c..5b236def82e6b44a7a8c7d178e3c3970471c4e34 100644
--- a/lib/SimpleSAML/Utils/EMail.php
+++ b/lib/SimpleSAML/Utils/EMail.php
@@ -1,5 +1,7 @@
 <?php
 
+declare(strict_types=1);
+
 namespace SimpleSAML\Utils;
 
 use PHPMailer\PHPMailer\PHPMailer;
diff --git a/lib/SimpleSAML/Utils/HTTP.php b/lib/SimpleSAML/Utils/HTTP.php
index b5ed7d1990a27b36f6d048d174cac0480fadf669..79371893058f06f6d33c7b1ace948af47199e649 100644
--- a/lib/SimpleSAML/Utils/HTTP.php
+++ b/lib/SimpleSAML/Utils/HTTP.php
@@ -1,5 +1,7 @@
 <?php
 
+declare(strict_types=1);
+
 namespace SimpleSAML\Utils;
 
 use SimpleSAML\Configuration;
@@ -816,7 +818,7 @@ class HTTP
         // convert that relative path to an HTTP query
         $url_path = str_replace(DIRECTORY_SEPARATOR, '/', $rel_path);
         // find where the relative path starts in the current request URI
-        $uri_pos = (!empty($url_path)) ? strpos($_SERVER['REQUEST_URI'], $url_path) : false;
+        $uri_pos = (!empty($url_path)) ? strpos($_SERVER['REQUEST_URI'] ?? '', $url_path) : false;
 
         if ($cur_path == $rel_path || $uri_pos === false) {
             /*
diff --git a/lib/SimpleSAML/Utils/HttpAdapter.php b/lib/SimpleSAML/Utils/HttpAdapter.php
index b2e90b475a153a297c4cbba2627bae002fcd7fd8..8065da898514401ba2e20c44255308c0c3f98f6e 100644
--- a/lib/SimpleSAML/Utils/HttpAdapter.php
+++ b/lib/SimpleSAML/Utils/HttpAdapter.php
@@ -1,5 +1,7 @@
 <?php
 
+declare(strict_types=1);
+
 namespace SimpleSAML\Utils;
 
 /**
diff --git a/lib/SimpleSAML/Utils/Net.php b/lib/SimpleSAML/Utils/Net.php
index efff0756718b7a9a6576f7a8c64a21a98934ade6..8fe77816130f860f4fa725cec01d1fd870825fbb 100644
--- a/lib/SimpleSAML/Utils/Net.php
+++ b/lib/SimpleSAML/Utils/Net.php
@@ -1,5 +1,7 @@
 <?php
 
+declare(strict_types=1);
+
 namespace SimpleSAML\Utils;
 
 /**
diff --git a/lib/SimpleSAML/Utils/Random.php b/lib/SimpleSAML/Utils/Random.php
index 7072d76f09f4058869ed41542f545d4d5f0674d7..417e5a6dc09e1283645cd65039cacad5183cd3b8 100644
--- a/lib/SimpleSAML/Utils/Random.php
+++ b/lib/SimpleSAML/Utils/Random.php
@@ -1,5 +1,7 @@
 <?php
 
+declare(strict_types=1);
+
 namespace SimpleSAML\Utils;
 
 /**
diff --git a/lib/SimpleSAML/Utils/System.php b/lib/SimpleSAML/Utils/System.php
index 3864cf1bd3605856addea2559122971e53d3f98f..c9d8c567646859624c145f7d3fb857aa74a3475c 100644
--- a/lib/SimpleSAML/Utils/System.php
+++ b/lib/SimpleSAML/Utils/System.php
@@ -1,5 +1,7 @@
 <?php
 
+declare(strict_types=1);
+
 namespace SimpleSAML\Utils;
 
 use SimpleSAML\Configuration;
diff --git a/lib/SimpleSAML/Utils/Time.php b/lib/SimpleSAML/Utils/Time.php
index 1889423680507cfa8eed82e8323cfd74cf1b5f98..efb77faccc9676cff942db73ee3035b33cc0a153 100644
--- a/lib/SimpleSAML/Utils/Time.php
+++ b/lib/SimpleSAML/Utils/Time.php
@@ -6,6 +6,8 @@
  * @package SimpleSAMLphp
  */
 
+declare(strict_types=1);
+
 namespace SimpleSAML\Utils;
 
 use SimpleSAML\Configuration;
diff --git a/lib/SimpleSAML/Utils/XML.php b/lib/SimpleSAML/Utils/XML.php
index 28c203cd3cf083b04258aa07338b10b1b6733ef3..89db4344c40744f8619a0e0dcbef0f95da98c587 100644
--- a/lib/SimpleSAML/Utils/XML.php
+++ b/lib/SimpleSAML/Utils/XML.php
@@ -6,6 +6,8 @@
  * @package SimpleSAMLphp
  */
 
+declare(strict_types=1);
+
 namespace SimpleSAML\Utils;
 
 use DOMComment;
diff --git a/lib/SimpleSAML/XHTML/IdPDisco.php b/lib/SimpleSAML/XHTML/IdPDisco.php
index 70f2d7adfdad1fe0ae2714eab3fd41613d810eef..d5b64751346121ffb202aa2af8fc21e37c3bb5b4 100644
--- a/lib/SimpleSAML/XHTML/IdPDisco.php
+++ b/lib/SimpleSAML/XHTML/IdPDisco.php
@@ -1,5 +1,7 @@
 <?php
 
+declare(strict_types=1);
+
 namespace SimpleSAML\XHTML;
 
 use SimpleSAML\Configuration;
diff --git a/lib/SimpleSAML/XHTML/Template.php b/lib/SimpleSAML/XHTML/Template.php
index 4b14817b1d1187e180c905e19e2a4203465f6795..0a73ea26f23de5508c3da29ac08a3b4e87c73dae 100644
--- a/lib/SimpleSAML/XHTML/Template.php
+++ b/lib/SimpleSAML/XHTML/Template.php
@@ -7,6 +7,8 @@
  * @package SimpleSAMLphp
  */
 
+declare(strict_types=1);
+
 namespace SimpleSAML\XHTML;
 
 use SimpleSAML\Configuration;
diff --git a/lib/SimpleSAML/XHTML/TemplateControllerInterface.php b/lib/SimpleSAML/XHTML/TemplateControllerInterface.php
index bead9a1c69c6209b27b5805115c9d57e2c6a56ae..68e1a07f99da6ae7ebb1b8afb08bd060d96acbda 100644
--- a/lib/SimpleSAML/XHTML/TemplateControllerInterface.php
+++ b/lib/SimpleSAML/XHTML/TemplateControllerInterface.php
@@ -1,5 +1,7 @@
 <?php
 
+declare(strict_types=1);
+
 namespace SimpleSAML\XHTML;
 
 use Twig\Environment;
diff --git a/lib/SimpleSAML/XHTML/TemplateLoader.php b/lib/SimpleSAML/XHTML/TemplateLoader.php
index 8fcb45ed85d02f146a7efbd48929c5eeec9e9571..4b6034b9593f74f8ac09c9928a5f883ddb82ba23 100644
--- a/lib/SimpleSAML/XHTML/TemplateLoader.php
+++ b/lib/SimpleSAML/XHTML/TemplateLoader.php
@@ -1,5 +1,7 @@
 <?php
 
+declare(strict_types=1);
+
 namespace SimpleSAML\XHTML;
 
 use SimpleSAML\Module;
diff --git a/lib/SimpleSAML/XML/Errors.php b/lib/SimpleSAML/XML/Errors.php
index 40af03a1cc03d3ac9e69b59a76d3daf9455d86f3..7db0b0699bf1dea6df29a3bb129d343d2c320c49 100644
--- a/lib/SimpleSAML/XML/Errors.php
+++ b/lib/SimpleSAML/XML/Errors.php
@@ -10,6 +10,8 @@
  * @package SimpleSAMLphp
  */
 
+declare(strict_types=1);
+
 namespace SimpleSAML\XML;
 
 use LibXMLError;
diff --git a/lib/SimpleSAML/XML/Parser.php b/lib/SimpleSAML/XML/Parser.php
index 073faa93ee297f1e7b73701e8c4aec4829a702fc..dead1255481ca9fd5615115b128ffb518d36972a 100644
--- a/lib/SimpleSAML/XML/Parser.php
+++ b/lib/SimpleSAML/XML/Parser.php
@@ -7,6 +7,8 @@
  * @package SimpleSAMLphp
  */
 
+declare(strict_types=1);
+
 namespace SimpleSAML\XML;
 
 class Parser
diff --git a/lib/SimpleSAML/XML/Shib13/AuthnRequest.php b/lib/SimpleSAML/XML/Shib13/AuthnRequest.php
index 899e195574e16778ba3d1683702ab75c781f0b95..ee16db4c3c318a6f752839fe9ea0e48c845f52d1 100644
--- a/lib/SimpleSAML/XML/Shib13/AuthnRequest.php
+++ b/lib/SimpleSAML/XML/Shib13/AuthnRequest.php
@@ -1,5 +1,7 @@
 <?php
 
+declare(strict_types=1);
+
 /**
  * The Shibboleth 1.3 Authentication Request. Not part of SAML 1.1,
  * but an extension using query paramters no XML.
diff --git a/lib/SimpleSAML/XML/Shib13/AuthnResponse.php b/lib/SimpleSAML/XML/Shib13/AuthnResponse.php
index 9492626142a9bd96c1954bbecfc759921e4c1814..e61e369fe895876a40cb5769ae241a8905c198b0 100644
--- a/lib/SimpleSAML/XML/Shib13/AuthnResponse.php
+++ b/lib/SimpleSAML/XML/Shib13/AuthnResponse.php
@@ -1,5 +1,7 @@
 <?php
 
+declare(strict_types=1);
+
 /**
  * A Shibboleth 1.3 authentication response.
  *
diff --git a/lib/SimpleSAML/XML/Signer.php b/lib/SimpleSAML/XML/Signer.php
index bae8a0ce4f5a713ce05ed0dcd86fa571423d2ae3..e71c9079eec21cb0d34f1d0d1eaf596b859d8013 100644
--- a/lib/SimpleSAML/XML/Signer.php
+++ b/lib/SimpleSAML/XML/Signer.php
@@ -9,6 +9,8 @@
  * @package SimpleSAMLphp
  */
 
+declare(strict_types=1);
+
 namespace SimpleSAML\XML;
 
 use DOMComment;
diff --git a/lib/SimpleSAML/XML/Validator.php b/lib/SimpleSAML/XML/Validator.php
index 55ddd456aaa02690e1761369a23bb2a0c0f32245..665f20ec206ec1d412edd5943b323db4e39ed8d2 100644
--- a/lib/SimpleSAML/XML/Validator.php
+++ b/lib/SimpleSAML/XML/Validator.php
@@ -7,6 +7,8 @@
  * @package SimpleSAMLphp
  */
 
+declare(strict_types=1);
+
 namespace SimpleSAML\XML;
 
 use RobRichards\XMLSecLibs\XMLSecEnc;
diff --git a/lib/_autoload.php b/lib/_autoload.php
index e44c70f9774efcbb9815442d8d716445034592d1..6cc5a2c30264d74de9a431ce0a8b58382b54f237 100644
--- a/lib/_autoload.php
+++ b/lib/_autoload.php
@@ -1,5 +1,7 @@
 <?php
 
+declare(strict_types=1);
+
 /**
  * This file is a backwards compatible autoloader for SimpleSAMLphp.
  * Loads the Composer autoloader.
diff --git a/lib/_autoload_modules.php b/lib/_autoload_modules.php
index 6d43e555b46c2f4df59f277e056953f690a51c54..3d7ca91848c91c77f886d2e96a9db0ec7bbe3607 100644
--- a/lib/_autoload_modules.php
+++ b/lib/_autoload_modules.php
@@ -1,5 +1,7 @@
 <?php
 
+declare(strict_types=1);
+
 /**
  * This file registers an autoloader for SimpleSAMLphp modules.
  *
diff --git a/modules/admin/lib/ConfigController.php b/modules/admin/lib/ConfigController.php
index 4f9ea216a6e6ef40c68b2f99db8824c60e95bfea..c61474ab499433f8851b1e53dd5a703a8c72163d 100644
--- a/modules/admin/lib/ConfigController.php
+++ b/modules/admin/lib/ConfigController.php
@@ -1,5 +1,7 @@
 <?php
 
+declare(strict_types=1);
+
 namespace SimpleSAML\Module\admin;
 
 use SimpleSAML\Configuration;
diff --git a/modules/admin/lib/FederationController.php b/modules/admin/lib/FederationController.php
index d9ceda7291d25baae3b533c36917a4404630804c..9fa0f9651bda9b0c2043b890d4b7122933f4b7b5 100644
--- a/modules/admin/lib/FederationController.php
+++ b/modules/admin/lib/FederationController.php
@@ -1,5 +1,7 @@
 <?php
 
+declare(strict_types=1);
+
 namespace SimpleSAML\Module\admin;
 
 use SimpleSAML\Auth;
diff --git a/modules/admin/lib/Menu.php b/modules/admin/lib/Menu.php
index c1d87d9597776ca7d533b26fcf2f578072c5fbac..0384ef2e24481134114bb7bd1fa075e52009d6b1 100644
--- a/modules/admin/lib/Menu.php
+++ b/modules/admin/lib/Menu.php
@@ -1,5 +1,7 @@
 <?php
 
+declare(strict_types=1);
+
 namespace SimpleSAML\Module\admin;
 
 use SimpleSAML\Locale\Translate;
diff --git a/modules/admin/lib/TestController.php b/modules/admin/lib/TestController.php
index 62ecf008c0553f116bfb609910e6a0891fa3299a..7b9a1d49efbd24f84138c6eb749b9d715876d1ae 100644
--- a/modules/admin/lib/TestController.php
+++ b/modules/admin/lib/TestController.php
@@ -1,5 +1,7 @@
 <?php
 
+declare(strict_types=1);
+
 namespace SimpleSAML\Module\admin;
 
 use SAML2\Constants;
diff --git a/modules/core/hooks/hook_frontpage.php b/modules/core/hooks/hook_frontpage.php
index cbb1469c03a63179cd4d405d0e637b330f90e7f7..d56a7f0ed433496971e21ec1148c893e475b8f8f 100644
--- a/modules/core/hooks/hook_frontpage.php
+++ b/modules/core/hooks/hook_frontpage.php
@@ -1,5 +1,7 @@
 <?php
 
+declare(strict_types=1);
+
 /**
  * Hook to add the modinfo module to the frontpage.
  *
diff --git a/modules/core/hooks/hook_sanitycheck.php b/modules/core/hooks/hook_sanitycheck.php
index 730e91c6727a6d9316ac2ca14c78c5c856777534..9ca2283a2b77a1be4d1ac0b3a61dd339b6084cf7 100644
--- a/modules/core/hooks/hook_sanitycheck.php
+++ b/modules/core/hooks/hook_sanitycheck.php
@@ -1,5 +1,7 @@
 <?php
 
+declare(strict_types=1);
+
 /**
  * Hook to do sanitycheck
  *
diff --git a/modules/core/lib/ACL.php b/modules/core/lib/ACL.php
index e69b5ffc99cb102eb1c6262bfc741d6fc705d014..a952cbe531c80c98584782fcfa885a81201e7542 100644
--- a/modules/core/lib/ACL.php
+++ b/modules/core/lib/ACL.php
@@ -1,5 +1,7 @@
 <?php
 
+declare(strict_types=1);
+
 namespace SimpleSAML\Module\core;
 
 use SimpleSAML\Configuration;
diff --git a/modules/core/lib/Auth/Process/AttributeAdd.php b/modules/core/lib/Auth/Process/AttributeAdd.php
index 33f419cd3ded36157df74df2212e440ea00c14f1..116fd8ce4145193d8a1a4fe45e512cb9f9be2621 100644
--- a/modules/core/lib/Auth/Process/AttributeAdd.php
+++ b/modules/core/lib/Auth/Process/AttributeAdd.php
@@ -1,5 +1,7 @@
 <?php
 
+declare(strict_types=1);
+
 namespace SimpleSAML\Module\core\Auth\Process;
 
 /**
diff --git a/modules/core/lib/Auth/Process/AttributeAlter.php b/modules/core/lib/Auth/Process/AttributeAlter.php
index 710254db6303469a7d1d7c2a945703b0d854f767..2ca333dc896b517d4a0f2f9fc0ffa3f96d6ad5cd 100644
--- a/modules/core/lib/Auth/Process/AttributeAlter.php
+++ b/modules/core/lib/Auth/Process/AttributeAlter.php
@@ -1,5 +1,7 @@
 <?php
 
+declare(strict_types=1);
+
 namespace SimpleSAML\Module\core\Auth\Process;
 
 use SimpleSAML\Error;
diff --git a/modules/core/lib/Auth/Process/AttributeCopy.php b/modules/core/lib/Auth/Process/AttributeCopy.php
index f6b9a55ae074ebf4c8b8d13869d9d0a7af5aa7f1..29fdd4fe3908287782cf15114bb9fe60ebc7517e 100644
--- a/modules/core/lib/Auth/Process/AttributeCopy.php
+++ b/modules/core/lib/Auth/Process/AttributeCopy.php
@@ -1,5 +1,7 @@
 <?php
 
+declare(strict_types=1);
+
 namespace SimpleSAML\Module\core\Auth\Process;
 
 /**
diff --git a/modules/core/lib/Auth/Process/AttributeLimit.php b/modules/core/lib/Auth/Process/AttributeLimit.php
index 87db3155c348111f3babf21b9c8d87a4b5308e8a..ee4b32240154d20ed20be3de39bb6da9a3a897f1 100644
--- a/modules/core/lib/Auth/Process/AttributeLimit.php
+++ b/modules/core/lib/Auth/Process/AttributeLimit.php
@@ -1,5 +1,7 @@
 <?php
 
+declare(strict_types=1);
+
 namespace SimpleSAML\Module\core\Auth\Process;
 
 use SimpleSAML\Error;
diff --git a/modules/core/lib/Auth/Process/AttributeMap.php b/modules/core/lib/Auth/Process/AttributeMap.php
index 317a6d4cc2e685fc5082daac10706ec555bc50c2..bc21b574610f2e3db8756958d902f9bf52104041 100644
--- a/modules/core/lib/Auth/Process/AttributeMap.php
+++ b/modules/core/lib/Auth/Process/AttributeMap.php
@@ -1,5 +1,7 @@
 <?php
 
+declare(strict_types=1);
+
 namespace SimpleSAML\Module\core\Auth\Process;
 
 use SimpleSAML\Configuration;
diff --git a/modules/core/lib/Auth/Process/AttributeRealm.php b/modules/core/lib/Auth/Process/AttributeRealm.php
index 81a71235d05f2e78af050839f67ecc861e77ae6e..9ca00ffd6e7d738e2d2189a84b26fa424e987ceb 100644
--- a/modules/core/lib/Auth/Process/AttributeRealm.php
+++ b/modules/core/lib/Auth/Process/AttributeRealm.php
@@ -1,5 +1,7 @@
 <?php
 
+declare(strict_types=1);
+
 namespace SimpleSAML\Module\core\Auth\Process;
 
 /**
diff --git a/modules/core/lib/Auth/Process/AttributeValueMap.php b/modules/core/lib/Auth/Process/AttributeValueMap.php
index 7c41cf412db8e473a91b10df8ecf3853e8ab885f..86a2471113464f77b73ec35c646f537d41dc4c99 100644
--- a/modules/core/lib/Auth/Process/AttributeValueMap.php
+++ b/modules/core/lib/Auth/Process/AttributeValueMap.php
@@ -1,5 +1,7 @@
 <?php
 
+declare(strict_types=1);
+
 namespace SimpleSAML\Module\core\Auth\Process;
 
 use SimpleSAML\Error;
diff --git a/modules/core/lib/Auth/Process/Cardinality.php b/modules/core/lib/Auth/Process/Cardinality.php
index 113cc6b622773e766746b3368c8c5aa496ffd013..0ddb1ff8916144a297550e9bcdaec1c29ef75fd1 100644
--- a/modules/core/lib/Auth/Process/Cardinality.php
+++ b/modules/core/lib/Auth/Process/Cardinality.php
@@ -1,5 +1,7 @@
 <?php
 
+declare(strict_types=1);
+
 namespace SimpleSAML\Module\core\Auth\Process;
 
 use SimpleSAML\Auth;
diff --git a/modules/core/lib/Auth/Process/CardinalitySingle.php b/modules/core/lib/Auth/Process/CardinalitySingle.php
index a9f08001c7779fdb095e2eed9458f60115749d8d..36d0b8bb3631d51a1db1508e5dfefba5be896ec5 100644
--- a/modules/core/lib/Auth/Process/CardinalitySingle.php
+++ b/modules/core/lib/Auth/Process/CardinalitySingle.php
@@ -1,5 +1,7 @@
 <?php
 
+declare(strict_types=1);
+
 namespace SimpleSAML\Module\core\Auth\Process;
 
 use SimpleSAML\Auth;
diff --git a/modules/core/lib/Auth/Process/ExtendIdPSession.php b/modules/core/lib/Auth/Process/ExtendIdPSession.php
index b582561e0ea85730975ebebe56f47b35aa1b383e..ab4e2126b997260016e7200f5cbbb045d9828be2 100644
--- a/modules/core/lib/Auth/Process/ExtendIdPSession.php
+++ b/modules/core/lib/Auth/Process/ExtendIdPSession.php
@@ -1,5 +1,7 @@
 <?php
 
+declare(strict_types=1);
+
 namespace SimpleSAML\Module\core\Auth\Process;
 
 use SimpleSAML\Configuration;
diff --git a/modules/core/lib/Auth/Process/GenerateGroups.php b/modules/core/lib/Auth/Process/GenerateGroups.php
index f2f82bbe38b107e99c846fc6e4c74bed29bee24c..e04b800dfc197e63f47135c06f5a091560c0dae7 100644
--- a/modules/core/lib/Auth/Process/GenerateGroups.php
+++ b/modules/core/lib/Auth/Process/GenerateGroups.php
@@ -1,5 +1,7 @@
 <?php
 
+declare(strict_types=1);
+
 namespace SimpleSAML\Module\core\Auth\Process;
 
 use SimpleSAML\Logger;
diff --git a/modules/core/lib/Auth/Process/LanguageAdaptor.php b/modules/core/lib/Auth/Process/LanguageAdaptor.php
index 85271d1659b8b6094b6d7a8be1f00e6e8ff4baf2..45889c068d29a709e368fd5920f5989bf92c6d87 100644
--- a/modules/core/lib/Auth/Process/LanguageAdaptor.php
+++ b/modules/core/lib/Auth/Process/LanguageAdaptor.php
@@ -1,5 +1,7 @@
 <?php
 
+declare(strict_types=1);
+
 namespace SimpleSAML\Module\core\Auth\Process;
 
 use SimpleSAML\Locale\Language;
diff --git a/modules/core/lib/Auth/Process/PHP.php b/modules/core/lib/Auth/Process/PHP.php
index fcf6e738aed078620c913b05147df83c6d177a0f..9b79f0988a467c201116e8b192c04b9c8ed3c7ca 100644
--- a/modules/core/lib/Auth/Process/PHP.php
+++ b/modules/core/lib/Auth/Process/PHP.php
@@ -1,5 +1,7 @@
 <?php
 
+declare(strict_types=1);
+
 namespace SimpleSAML\Module\core\Auth\Process;
 
 use SimpleSAML\Error;
diff --git a/modules/core/lib/Auth/Process/ScopeAttribute.php b/modules/core/lib/Auth/Process/ScopeAttribute.php
index bc05f95388c74049428153b1428e9120fdc61d0a..7effc2adbbbfb2d361c9614cb01b7c1b54c9d895 100644
--- a/modules/core/lib/Auth/Process/ScopeAttribute.php
+++ b/modules/core/lib/Auth/Process/ScopeAttribute.php
@@ -1,5 +1,7 @@
 <?php
 
+declare(strict_types=1);
+
 namespace SimpleSAML\Module\core\Auth\Process;
 
 use SimpleSAML\Configuration;
diff --git a/modules/core/lib/Auth/Process/ScopeFromAttribute.php b/modules/core/lib/Auth/Process/ScopeFromAttribute.php
index cc8411e311849198510d15d1b37325392d6c1ce7..e94acfe33c1e062d06776e0483555fe36e12e6ed 100644
--- a/modules/core/lib/Auth/Process/ScopeFromAttribute.php
+++ b/modules/core/lib/Auth/Process/ScopeFromAttribute.php
@@ -1,5 +1,7 @@
 <?php
 
+declare(strict_types=1);
+
 namespace SimpleSAML\Module\core\Auth\Process;
 
 use SimpleSAML\Configuration;
diff --git a/modules/core/lib/Auth/Process/StatisticsWithAttribute.php b/modules/core/lib/Auth/Process/StatisticsWithAttribute.php
index 1e357a1296fb0557e528f4977c87538c2fe57f1d..05f5d92ed88aafc5e95010c1a4f273fbd966bcfe 100644
--- a/modules/core/lib/Auth/Process/StatisticsWithAttribute.php
+++ b/modules/core/lib/Auth/Process/StatisticsWithAttribute.php
@@ -1,5 +1,7 @@
 <?php
 
+declare(strict_types=1);
+
 namespace SimpleSAML\Module\core\Auth\Process;
 
 use SimpleSAML\Logger;
diff --git a/modules/core/lib/Auth/Process/TargetedID.php b/modules/core/lib/Auth/Process/TargetedID.php
index 0f8d07890687626abf872dd74a0d76dabaff479f..66095c0c7daa0bbbac1d40a605dbb784e860199b 100644
--- a/modules/core/lib/Auth/Process/TargetedID.php
+++ b/modules/core/lib/Auth/Process/TargetedID.php
@@ -1,5 +1,7 @@
 <?php
 
+declare(strict_types=1);
+
 namespace SimpleSAML\Module\core\Auth\Process;
 
 use SAML2\Constants;
diff --git a/modules/core/lib/Auth/Process/WarnShortSSOInterval.php b/modules/core/lib/Auth/Process/WarnShortSSOInterval.php
index 5c5352d1b1bb070837b36b29fea7ac502e1afd1a..7f2005b96ab3315d6b40ee48f9d4fe09bddcc051 100644
--- a/modules/core/lib/Auth/Process/WarnShortSSOInterval.php
+++ b/modules/core/lib/Auth/Process/WarnShortSSOInterval.php
@@ -1,5 +1,7 @@
 <?php
 
+declare(strict_types=1);
+
 namespace SimpleSAML\Module\core\Auth\Process;
 
 use SimpleSAML\Auth;
diff --git a/modules/core/lib/Auth/Source/AdminPassword.php b/modules/core/lib/Auth/Source/AdminPassword.php
index ea03893e75cb9f0a94c49f644ad0834355b1ed14..7875e1a1abe72f12d569ad759901f8ca886708db 100644
--- a/modules/core/lib/Auth/Source/AdminPassword.php
+++ b/modules/core/lib/Auth/Source/AdminPassword.php
@@ -1,5 +1,7 @@
 <?php
 
+declare(strict_types=1);
+
 namespace SimpleSAML\Module\core\Auth\Source;
 
 use SimpleSAML\Configuration;
diff --git a/modules/core/lib/Auth/UserPassBase.php b/modules/core/lib/Auth/UserPassBase.php
index a2d4d1c069f9defcebd4ac9597196ab6ae8ec49b..e29512533fb07b1f3cff7f7c447f986b65ea90d5 100644
--- a/modules/core/lib/Auth/UserPassBase.php
+++ b/modules/core/lib/Auth/UserPassBase.php
@@ -1,5 +1,7 @@
 <?php
 
+declare(strict_types=1);
+
 namespace SimpleSAML\Module\core\Auth;
 
 use SAML2\Constants;
diff --git a/modules/core/lib/Auth/UserPassOrgBase.php b/modules/core/lib/Auth/UserPassOrgBase.php
index 8271c8809b14eb5076a7dcdc7651f92b749cef3b..426eeb102c034071dc99002943208f59551da562 100644
--- a/modules/core/lib/Auth/UserPassOrgBase.php
+++ b/modules/core/lib/Auth/UserPassOrgBase.php
@@ -1,5 +1,7 @@
 <?php
 
+declare(strict_types=1);
+
 namespace SimpleSAML\Module\core\Auth;
 
 use SimpleSAML\Auth;
diff --git a/modules/core/lib/Controller/Exception.php b/modules/core/lib/Controller/Exception.php
index 9a8e4f009e1d95fba651a888d37f868300036c0c..1bb7834e70fb2fc5643b950c76c9bd289c687c6d 100644
--- a/modules/core/lib/Controller/Exception.php
+++ b/modules/core/lib/Controller/Exception.php
@@ -1,5 +1,7 @@
 <?php
 
+declare(strict_types=1);
+
 namespace SimpleSAML\Module\core\Controller;
 
 use SimpleSAML\Auth;
diff --git a/modules/core/lib/Controller/Login.php b/modules/core/lib/Controller/Login.php
index 8e5285088e7e7ecdd55e4361f0334839e11ac612..b6b5228abfd12263d76025a8bd45e4dc06fe2a19 100644
--- a/modules/core/lib/Controller/Login.php
+++ b/modules/core/lib/Controller/Login.php
@@ -1,5 +1,7 @@
 <?php
 
+declare(strict_types=1);
+
 namespace SimpleSAML\Module\core\Controller;
 
 use SimpleSAML\Auth;
diff --git a/modules/core/lib/Controller/Redirection.php b/modules/core/lib/Controller/Redirection.php
index 14b7454e64672e6c50048ed2061409726627b363..aa35589c83ba4b4ab30010646a6481f571f47ae5 100644
--- a/modules/core/lib/Controller/Redirection.php
+++ b/modules/core/lib/Controller/Redirection.php
@@ -1,5 +1,7 @@
 <?php
 
+declare(strict_types=1);
+
 namespace SimpleSAML\Module\core\Controller;
 
 use SimpleSAML\Auth;
diff --git a/modules/core/lib/Stats/Output/File.php b/modules/core/lib/Stats/Output/File.php
index 37fb79f21e12c333113b36e2603d92b692dda40a..b39b072d4833fac58ecd306fd07fd5ce6d58e83d 100644
--- a/modules/core/lib/Stats/Output/File.php
+++ b/modules/core/lib/Stats/Output/File.php
@@ -1,5 +1,7 @@
 <?php
 
+declare(strict_types=1);
+
 namespace SimpleSAML\Module\core\Stats\Output;
 
 use SimpleSAML\Configuration;
diff --git a/modules/core/lib/Stats/Output/Log.php b/modules/core/lib/Stats/Output/Log.php
index 0175c2328a9bd5a548cd5531cd4fa6328496f2d9..3886ab09f653548e5611daf7344bc7c92913f980 100644
--- a/modules/core/lib/Stats/Output/Log.php
+++ b/modules/core/lib/Stats/Output/Log.php
@@ -1,5 +1,7 @@
 <?php
 
+declare(strict_types=1);
+
 namespace SimpleSAML\Module\core\Stats\Output;
 
 use SimpleSAML\Configuration;
diff --git a/modules/core/lib/Storage/SQLPermanentStorage.php b/modules/core/lib/Storage/SQLPermanentStorage.php
index ed920dd2558cf0bce649d0a01188c70a0d5e9643..541bb711792249df973adf4b1b91cf6c49863e17 100644
--- a/modules/core/lib/Storage/SQLPermanentStorage.php
+++ b/modules/core/lib/Storage/SQLPermanentStorage.php
@@ -1,5 +1,7 @@
 <?php
 
+declare(strict_types=1);
+
 namespace SimpleSAML\Module\core\Storage;
 
 use PDO;
diff --git a/modules/cron/lib/Controller/Cron.php b/modules/cron/lib/Controller/Cron.php
index 10eb967f9a2a8e10ee793adbd8f9dfcb40c6a3ae..7654533f347fdafe6c1b4ffa0402a42b21f942d9 100644
--- a/modules/cron/lib/Controller/Cron.php
+++ b/modules/cron/lib/Controller/Cron.php
@@ -1,5 +1,7 @@
 <?php
 
+declare(strict_types=1);
+
 namespace SimpleSAML\Module\cron\Controller;
 
 use SimpleSAML\Auth;
diff --git a/modules/cron/lib/Cron.php b/modules/cron/lib/Cron.php
index 7a673ba10f753c5230fcbc02be3793854705f09f..81b3641b69837556652500ff2655e6f8c3920ebe 100644
--- a/modules/cron/lib/Cron.php
+++ b/modules/cron/lib/Cron.php
@@ -1,5 +1,7 @@
 <?php
 
+declare(strict_types=1);
+
 namespace SimpleSAML\Module\cron;
 
 use SimpleSAML\Configuration;
diff --git a/modules/exampleauth/lib/Auth/Process/RedirectTest.php b/modules/exampleauth/lib/Auth/Process/RedirectTest.php
index 2e52b99f81e3f5b28f85f2292b405b5e5e43e4de..50b5ca18142b04e6ad8a1aeef6b3fabd4dba4f71 100644
--- a/modules/exampleauth/lib/Auth/Process/RedirectTest.php
+++ b/modules/exampleauth/lib/Auth/Process/RedirectTest.php
@@ -1,5 +1,7 @@
 <?php
 
+declare(strict_types=1);
+
 namespace SimpleSAML\Module\exampleauth\Auth\Process;
 
 use SimpleSAML\Auth;
diff --git a/modules/exampleauth/lib/Auth/Source/External.php b/modules/exampleauth/lib/Auth/Source/External.php
index 60c2ebfef23544c68638c4fd2e1a426b6009db4a..f6560882719a724f6539bd51c3fd962e57824f6b 100644
--- a/modules/exampleauth/lib/Auth/Source/External.php
+++ b/modules/exampleauth/lib/Auth/Source/External.php
@@ -1,5 +1,7 @@
 <?php
 
+declare(strict_types=1);
+
 namespace SimpleSAML\Module\exampleauth\Auth\Source;
 
 use SimpleSAML\Auth;
diff --git a/modules/exampleauth/lib/Auth/Source/StaticSource.php b/modules/exampleauth/lib/Auth/Source/StaticSource.php
index 8d0dc72e141d0d93e982e2c659489fea4300f0f1..5901d9b67bf0d9217077a57dd4454fb2512e9ceb 100644
--- a/modules/exampleauth/lib/Auth/Source/StaticSource.php
+++ b/modules/exampleauth/lib/Auth/Source/StaticSource.php
@@ -1,5 +1,7 @@
 <?php
 
+declare(strict_types=1);
+
 namespace SimpleSAML\Module\exampleauth\Auth\Source;
 
 use SimpleSAML\Utils;
diff --git a/modules/exampleauth/lib/Auth/Source/UserPass.php b/modules/exampleauth/lib/Auth/Source/UserPass.php
index 30239a6c2943a327d4382199a6aeb83e0f73ebea..4a615881447cc6c5ce935212925b882241a00ec9 100644
--- a/modules/exampleauth/lib/Auth/Source/UserPass.php
+++ b/modules/exampleauth/lib/Auth/Source/UserPass.php
@@ -1,5 +1,7 @@
 <?php
 
+declare(strict_types=1);
+
 namespace SimpleSAML\Module\exampleauth\Auth\Source;
 
 use SimpleSAML\Error;
diff --git a/modules/multiauth/lib/Auth/Source/MultiAuth.php b/modules/multiauth/lib/Auth/Source/MultiAuth.php
index 3e0e453c552dc82d137e87c5d110be40d97192c5..6bc2cc0abc0c6eb15ee76bc5e7551bd6e956926c 100644
--- a/modules/multiauth/lib/Auth/Source/MultiAuth.php
+++ b/modules/multiauth/lib/Auth/Source/MultiAuth.php
@@ -1,5 +1,7 @@
 <?php
 
+declare(strict_types=1);
+
 namespace SimpleSAML\Module\multiauth\Auth\Source;
 
 use SimpleSAML\Auth;
diff --git a/modules/portal/lib/Portal.php b/modules/portal/lib/Portal.php
index e7308758f5deda9052c067511433424211a750c1..e116c6e5a5d93aaf967555029c401622f4e68833 100644
--- a/modules/portal/lib/Portal.php
+++ b/modules/portal/lib/Portal.php
@@ -1,5 +1,7 @@
 <?php
 
+declare(strict_types=1);
+
 namespace SimpleSAML\Module\portal;
 
 use SimpleSAML\Configuration;
diff --git a/modules/saml/lib/Auth/Process/AttributeNameID.php b/modules/saml/lib/Auth/Process/AttributeNameID.php
index d0b4393bf0ddf844ac1a94053a681bcdbace68d2..51e7d8739817639983396ca776c3d667aa11188e 100644
--- a/modules/saml/lib/Auth/Process/AttributeNameID.php
+++ b/modules/saml/lib/Auth/Process/AttributeNameID.php
@@ -1,5 +1,7 @@
 <?php
 
+declare(strict_types=1);
+
 namespace SimpleSAML\Module\saml\Auth\Process;
 
 use SimpleSAML\Error;
diff --git a/modules/saml/lib/Auth/Process/AuthnContextClassRef.php b/modules/saml/lib/Auth/Process/AuthnContextClassRef.php
index b2e6eb35880575b3d492bc9c79ce6fcdad94f277..407e08de35fa1f60d18436a809cecf2e2dd71024 100644
--- a/modules/saml/lib/Auth/Process/AuthnContextClassRef.php
+++ b/modules/saml/lib/Auth/Process/AuthnContextClassRef.php
@@ -1,5 +1,7 @@
 <?php
 
+declare(strict_types=1);
+
 namespace SimpleSAML\Module\saml\Auth\Process;
 
 use SimpleSAML\Error;
diff --git a/modules/saml/lib/Auth/Process/ExpectedAuthnContextClassRef.php b/modules/saml/lib/Auth/Process/ExpectedAuthnContextClassRef.php
index 7e6259c5892f769af03dd689a01371fe281b0eb1..7b0fd991cc296df664feb7bb171ca9f93d8a44f1 100644
--- a/modules/saml/lib/Auth/Process/ExpectedAuthnContextClassRef.php
+++ b/modules/saml/lib/Auth/Process/ExpectedAuthnContextClassRef.php
@@ -1,5 +1,7 @@
 <?php
 
+declare(strict_types=1);
+
 namespace SimpleSAML\Module\saml\Auth\Process;
 
 use SimpleSAML\Auth;
diff --git a/modules/saml/lib/Auth/Process/FilterScopes.php b/modules/saml/lib/Auth/Process/FilterScopes.php
index fd4089b925fba011e24b3de0010848d2b2129ba5..8965e843732e51b0da9038ca5f0bf1bced2240cd 100644
--- a/modules/saml/lib/Auth/Process/FilterScopes.php
+++ b/modules/saml/lib/Auth/Process/FilterScopes.php
@@ -1,5 +1,7 @@
 <?php
 
+declare(strict_types=1);
+
 namespace SimpleSAML\Module\saml\Auth\Process;
 
 use SimpleSAML\Logger;
diff --git a/modules/saml/lib/Auth/Process/NameIDAttribute.php b/modules/saml/lib/Auth/Process/NameIDAttribute.php
index 01c09c22b57af53df0150ee01f8db1cd5f12b569..f112f37b384c9c87eb6e94a88869637e27ba46e6 100644
--- a/modules/saml/lib/Auth/Process/NameIDAttribute.php
+++ b/modules/saml/lib/Auth/Process/NameIDAttribute.php
@@ -1,5 +1,7 @@
 <?php
 
+declare(strict_types=1);
+
 namespace SimpleSAML\Module\saml\Auth\Process;
 
 use SAML2\Constants;
diff --git a/modules/saml/lib/Auth/Process/PersistentNameID.php b/modules/saml/lib/Auth/Process/PersistentNameID.php
index a98a0212ace8789fbe4146716e0bcf9a79132fa7..f5c568e9aee55c2d484b62a93a5670c478d4aedd 100644
--- a/modules/saml/lib/Auth/Process/PersistentNameID.php
+++ b/modules/saml/lib/Auth/Process/PersistentNameID.php
@@ -1,5 +1,7 @@
 <?php
 
+declare(strict_types=1);
+
 namespace SimpleSAML\Module\saml\Auth\Process;
 
 use SAML2\Constants;
diff --git a/modules/saml/lib/Auth/Process/PersistentNameID2TargetedID.php b/modules/saml/lib/Auth/Process/PersistentNameID2TargetedID.php
index 284162462684075bf7a86533b71bd04fa15f2dd4..24399d6596c87a81332a822224ea37c5b1a6e092 100644
--- a/modules/saml/lib/Auth/Process/PersistentNameID2TargetedID.php
+++ b/modules/saml/lib/Auth/Process/PersistentNameID2TargetedID.php
@@ -1,5 +1,7 @@
 <?php
 
+declare(strict_types=1);
+
 namespace SimpleSAML\Module\saml\Auth\Process;
 
 use SAML2\Constants;
diff --git a/modules/saml/lib/Auth/Process/SQLPersistentNameID.php b/modules/saml/lib/Auth/Process/SQLPersistentNameID.php
index b6c0f48cdcbe908a3809572fcee8e4f635739225..c8550368f21fa0a4bc0676b5dec2c0f377413850 100644
--- a/modules/saml/lib/Auth/Process/SQLPersistentNameID.php
+++ b/modules/saml/lib/Auth/Process/SQLPersistentNameID.php
@@ -1,5 +1,7 @@
 <?php
 
+declare(strict_types=1);
+
 namespace SimpleSAML\Module\saml\Auth\Process;
 
 use SAML2\Constants;
diff --git a/modules/saml/lib/Auth/Process/TransientNameID.php b/modules/saml/lib/Auth/Process/TransientNameID.php
index 8b069f491435f8412cb78f5acfb2d4577d18f334..7ab4fec76ae37069590f9e76955cf61c339808bf 100644
--- a/modules/saml/lib/Auth/Process/TransientNameID.php
+++ b/modules/saml/lib/Auth/Process/TransientNameID.php
@@ -1,5 +1,7 @@
 <?php
 
+declare(strict_types=1);
+
 namespace SimpleSAML\Module\saml\Auth\Process;
 
 use SAML2\Constants;
diff --git a/modules/saml/lib/Auth/Source/SP.php b/modules/saml/lib/Auth/Source/SP.php
index 83090e3ce87fd62789c242d355b9640483ad2507..99ce51a6712d04ac921b707e1dc81820e34bfc44 100644
--- a/modules/saml/lib/Auth/Source/SP.php
+++ b/modules/saml/lib/Auth/Source/SP.php
@@ -1,5 +1,7 @@
 <?php
 
+declare(strict_types=1);
+
 namespace SimpleSAML\Module\saml\Auth\Source;
 
 use SAML2\AuthnRequest;
diff --git a/modules/saml/lib/BaseNameIDGenerator.php b/modules/saml/lib/BaseNameIDGenerator.php
index d199f28f97dd6918b5fbc73dd0995716ebd9ac61..04f4e4e22e5f54d50b981c0981e0cb90158d7438 100644
--- a/modules/saml/lib/BaseNameIDGenerator.php
+++ b/modules/saml/lib/BaseNameIDGenerator.php
@@ -1,5 +1,7 @@
 <?php
 
+declare(strict_types=1);
+
 namespace SimpleSAML\Module\saml;
 
 use SAML2\XML\saml\NameID;
diff --git a/modules/saml/lib/Error.php b/modules/saml/lib/Error.php
index 042bc6eb65e08e91538cbe9d18554c6991f1a3ad..c91c8e97d2e9d7cb3abe52807a94007f8f5c4c27 100644
--- a/modules/saml/lib/Error.php
+++ b/modules/saml/lib/Error.php
@@ -1,5 +1,7 @@
 <?php
 
+declare(strict_types=1);
+
 namespace SimpleSAML\Module\saml;
 
 use SAML2\Constants;
diff --git a/modules/saml/lib/Error/NoAuthnContext.php b/modules/saml/lib/Error/NoAuthnContext.php
index c1b47f88cc6939d7ebcf51a2ca857269b0d53040..508da8e0ca4f0f347d060fa8c1f9ba32408e8a1d 100644
--- a/modules/saml/lib/Error/NoAuthnContext.php
+++ b/modules/saml/lib/Error/NoAuthnContext.php
@@ -1,16 +1,17 @@
 <?php
 
+declare(strict_types=1);
+
+namespace SimpleSAML\Module\saml\Error;
+
+use SAML2\Constants;
+
 /**
  * A SAML error indicating that none of the requested Authentication Contexts can be used.
  *
  * @author Jaime Pérez Crespo, UNINETT AS <jaime.perez@uninett.no>
  * @package SimpleSAMLphp
  */
-
-namespace SimpleSAML\Module\saml\Error;
-
-use SAML2\Constants;
-
 class NoAuthnContext extends \SimpleSAML\Module\saml\Error
 {
     /**
diff --git a/modules/saml/lib/Error/NoAvailableIDP.php b/modules/saml/lib/Error/NoAvailableIDP.php
index 3f024c0d0ef57a1985aebfdb7c16b6e778dbb2c2..f1c66ab4bbe7493ed2056f92163f202216a61c3c 100644
--- a/modules/saml/lib/Error/NoAvailableIDP.php
+++ b/modules/saml/lib/Error/NoAvailableIDP.php
@@ -1,16 +1,17 @@
 <?php
 
+declare(strict_types=1);
+
+namespace SimpleSAML\Module\saml\Error;
+
+use SAML2\Constants;
+
 /**
  * A SAML error indicating that none of the requested IdPs can be used.
  *
  * @author Jaime Pérez Crespo, UNINETT AS <jaime.perez@uninett.no>
  * @package SimpleSAMLphp
  */
-
-namespace SimpleSAML\Module\saml\Error;
-
-use SAML2\Constants;
-
 class NoAvailableIDP extends \SimpleSAML\Module\saml\Error
 {
     /**
diff --git a/modules/saml/lib/Error/NoPassive.php b/modules/saml/lib/Error/NoPassive.php
index 1a5a8d5c18be534dc708207dbd471f604778ee2a..3fc03e0499b61f9a93c64259cd2c10f5c573fb3b 100644
--- a/modules/saml/lib/Error/NoPassive.php
+++ b/modules/saml/lib/Error/NoPassive.php
@@ -1,16 +1,17 @@
 <?php
 
+declare(strict_types=1);
+
+namespace SimpleSAML\Module\saml\Error;
+
+use SAML2\Constants;
+
 /**
  * A SAML error indicating that passive authentication cannot be used.
  *
  * @author Jaime Pérez Crespo, UNINETT AS <jaime.perez@uninett.no>
  * @package SimpleSAMLphp
  */
-
-namespace SimpleSAML\Module\saml\Error;
-
-use SAML2\Constants;
-
 class NoPassive extends \SimpleSAML\Module\saml\Error
 {
     /**
diff --git a/modules/saml/lib/Error/NoSupportedIDP.php b/modules/saml/lib/Error/NoSupportedIDP.php
index 429ddf538ca888175978eb5caa1cf5ab313b9fe0..7806fb379e925e87301aa6cfae70743c8ad47c08 100644
--- a/modules/saml/lib/Error/NoSupportedIDP.php
+++ b/modules/saml/lib/Error/NoSupportedIDP.php
@@ -1,16 +1,17 @@
 <?php
 
+declare(strict_types=1);
+
+namespace SimpleSAML\Module\saml\Error;
+
+use SAML2\Constants;
+
 /**
  * A SAML error indicating that none of the IdPs requested are supported.
  *
  * @author Jaime Pérez Crespo, UNINETT AS <jaime.perez@uninett.no>
  * @package SimpleSAMLphp
  */
-
-namespace SimpleSAML\Module\saml\Error;
-
-use SAML2\Constants;
-
 class NoSupportedIDP extends \SimpleSAML\Module\saml\Error
 {
     /**
diff --git a/modules/saml/lib/Error/ProxyCountExceeded.php b/modules/saml/lib/Error/ProxyCountExceeded.php
index 99e40182c1fc0df2de25415e47bc22682e865b92..044aded1f9dd0d3ae5d2de0c3af8cd8abfb87f72 100644
--- a/modules/saml/lib/Error/ProxyCountExceeded.php
+++ b/modules/saml/lib/Error/ProxyCountExceeded.php
@@ -1,16 +1,17 @@
 <?php
 
+declare(strict_types=1);
+
+namespace SimpleSAML\Module\saml\Error;
+
+use SAML2\Constants;
+
 /**
  * A SAML error indicating that the maximum amount of proxies traversed has been reached.
  *
  * @author Jaime Pérez Crespo, UNINETT AS <jaime.perez@uninett.no>
  * @package SimpleSAMLphp
  */
-
-namespace SimpleSAML\Module\saml\Error;
-
-use SAML2\Constants;
-
 class ProxyCountExceeded extends \SimpleSAML\Module\saml\Error
 {
     /**
diff --git a/modules/saml/lib/IdP/SAML1.php b/modules/saml/lib/IdP/SAML1.php
index d0a3d8c9ace90abc1afef4cb6c24de88c8869b55..861f9612ba964de1fe62de598d00bd78db6ab7ba 100644
--- a/modules/saml/lib/IdP/SAML1.php
+++ b/modules/saml/lib/IdP/SAML1.php
@@ -1,5 +1,7 @@
 <?php
 
+declare(strict_types=1);
+
 namespace SimpleSAML\Module\saml\IdP;
 
 use SimpleSAML\Auth;
diff --git a/modules/saml/lib/IdP/SAML2.php b/modules/saml/lib/IdP/SAML2.php
index 14cd0e6e09ab2fc38b53d9a4cc3b8218061909a8..c07cfb4f001b152ce67d9dd866d73d87563f9f02 100644
--- a/modules/saml/lib/IdP/SAML2.php
+++ b/modules/saml/lib/IdP/SAML2.php
@@ -1,5 +1,7 @@
 <?php
 
+declare(strict_types=1);
+
 namespace SimpleSAML\Module\saml\IdP;
 
 use DOMNodeList;
diff --git a/modules/saml/lib/IdP/SQLNameID.php b/modules/saml/lib/IdP/SQLNameID.php
index 8777dd02b3c73a53a3a5d9567f1bc64cb5625fe4..592ec92c05bad3e5cda8886e28a33d24ec5a61af 100644
--- a/modules/saml/lib/IdP/SQLNameID.php
+++ b/modules/saml/lib/IdP/SQLNameID.php
@@ -1,5 +1,7 @@
 <?php
 
+declare(strict_types=1);
+
 namespace SimpleSAML\Module\saml\IdP;
 
 use PDO;
diff --git a/modules/saml/lib/Message.php b/modules/saml/lib/Message.php
index 379d24065cfaa09cb59782c2b686353f6deb835b..57814ba7ddd16ea318d16cbaf43437fa8e8e0b9a 100644
--- a/modules/saml/lib/Message.php
+++ b/modules/saml/lib/Message.php
@@ -1,5 +1,7 @@
 <?php
 
+declare(strict_types=1);
+
 namespace SimpleSAML\Module\saml;
 
 use RobRichards\XMLSecLibs\XMLSecurityKey;
diff --git a/modules/saml/lib/SP/LogoutStore.php b/modules/saml/lib/SP/LogoutStore.php
index c78db758a16826bb85710794a12c3630de99c9ee..c9c1ae1385afc742abc6da1147adc02e4f792a44 100644
--- a/modules/saml/lib/SP/LogoutStore.php
+++ b/modules/saml/lib/SP/LogoutStore.php
@@ -1,5 +1,7 @@
 <?php
 
+declare(strict_types=1);
+
 namespace SimpleSAML\Module\saml\SP;
 
 use PDO;
diff --git a/tests/BuiltInServer.php b/tests/BuiltInServer.php
index 5bb7beed720336faf2105526c89708bea13076ef..31e309760bb13a04030672fe9361c0c71022478a 100644
--- a/tests/BuiltInServer.php
+++ b/tests/BuiltInServer.php
@@ -1,5 +1,7 @@
 <?php
 
+declare(strict_types=1);
+
 namespace SimpleSAML\Test;
 
 use SimpleSAML\Utils\System;
diff --git a/tests/SigningTestCase.php b/tests/SigningTestCase.php
index bbbaadfbc3f80d1f5eb49a7f25a5147055a03534..75ff8c43df1f441c34f339e0276f3896a58f0cb4 100644
--- a/tests/SigningTestCase.php
+++ b/tests/SigningTestCase.php
@@ -1,5 +1,7 @@
 <?php
 
+declare(strict_types=1);
+
 namespace SimpleSAML\Test;
 
 use org\bovigo\vfs\vfsStream;
diff --git a/tests/Utils/ClearStateTestCase.php b/tests/Utils/ClearStateTestCase.php
index 7db826e37c940e9e62d183eccbb8872bd14bd081..aeed53ab74a7aca6d5c7c122620de3f94b8db6a7 100644
--- a/tests/Utils/ClearStateTestCase.php
+++ b/tests/Utils/ClearStateTestCase.php
@@ -1,5 +1,7 @@
 <?php
 
+declare(strict_types=1);
+
 namespace SimpleSAML\Test\Utils;
 
 use PHPUnit\Framework\TestCase;
diff --git a/tests/Utils/ExitTestException.php b/tests/Utils/ExitTestException.php
index 02c0bb544d4bd20c3554e19c57bdcde578335dd0..b319ca84d03c9811880943da19bff07fd2b83408 100644
--- a/tests/Utils/ExitTestException.php
+++ b/tests/Utils/ExitTestException.php
@@ -1,5 +1,7 @@
 <?php
 
+declare(strict_types=1);
+
 namespace SimpleSAML\Test\Utils;
 
 /**
diff --git a/tests/Utils/ReduceSpillOverTest.php b/tests/Utils/ReduceSpillOverTest.php
index a84b93be5c369b18d63f85224a3843e7152e65ba..dbbbf5da490d0adb0a3f0ff60d26c50eace51b07 100644
--- a/tests/Utils/ReduceSpillOverTest.php
+++ b/tests/Utils/ReduceSpillOverTest.php
@@ -1,5 +1,7 @@
 <?php
 
+declare(strict_types=1);
+
 namespace SimpleSAML\Test\Utils;
 
 /**
diff --git a/tests/Utils/SpTester.php b/tests/Utils/SpTester.php
index a4151b75ada7e2dbcd3f57887bbe4568764b9d36..9580819c5d3575099a2bd6b7fd6a8901a1077e71 100644
--- a/tests/Utils/SpTester.php
+++ b/tests/Utils/SpTester.php
@@ -1,5 +1,7 @@
 <?php
 
+declare(strict_types=1);
+
 namespace SimpleSAML\Test\Utils;
 
 use ReflectionObject;
diff --git a/tests/Utils/StateClearer.php b/tests/Utils/StateClearer.php
index da24f1ba850618061c21f530eaf282b48671eaf1..ed9ec5cce898537487f892fb9c3bf8e64c12a03a 100644
--- a/tests/Utils/StateClearer.php
+++ b/tests/Utils/StateClearer.php
@@ -1,5 +1,7 @@
 <?php
 
+declare(strict_types=1);
+
 namespace SimpleSAML\Test\Utils;
 
 /**
diff --git a/tests/Utils/TestAuthSource.php b/tests/Utils/TestAuthSource.php
index 924c9690fed7ab33bba2d7664d3d730ad7e446df..de395181da484bb2bd75a8b2aea648a9257d1aca 100644
--- a/tests/Utils/TestAuthSource.php
+++ b/tests/Utils/TestAuthSource.php
@@ -1,5 +1,7 @@
 <?php
 
+declare(strict_types=1);
+
 namespace SimpleSAML\Test\Utils;
 
 use SimpleSAML\Auth\Source;
diff --git a/tests/Utils/TestAuthSourceFactory.php b/tests/Utils/TestAuthSourceFactory.php
index a3df2d8c3cffd3822248d016198548e867dcb741..6c42abcd2ac7caee9d045b310a10f9211349b7ae 100644
--- a/tests/Utils/TestAuthSourceFactory.php
+++ b/tests/Utils/TestAuthSourceFactory.php
@@ -1,5 +1,7 @@
 <?php
 
+declare(strict_types=1);
+
 namespace SimpleSAML\Test\Utils;
 
 use SimpleSAML\Auth\SourceFactory;
diff --git a/tests/_autoload_modules.php b/tests/_autoload_modules.php
index 172ec16243bd99dcf0c9037c9fa4887f859c8c3c..d70960f2650e67bbfe27552668de3bcf3d28ad8d 100644
--- a/tests/_autoload_modules.php
+++ b/tests/_autoload_modules.php
@@ -1,4 +1,7 @@
 <?php
+
+declare(strict_types=1);
+
 /**
  * This file registers an autoloader for test classes used by SimpleSAMLphp modules unit tests.
  */
diff --git a/tests/bootstrap.php b/tests/bootstrap.php
index 4ec9274b9b08c126d52bc3286c5b9c877eed2a4e..d95d01ca460b26e1b41646f36749fe9b387f635b 100644
--- a/tests/bootstrap.php
+++ b/tests/bootstrap.php
@@ -1,5 +1,7 @@
 <?php
 
+declare(strict_types=1);
+
 $projectRoot = dirname(__DIR__);
 require_once($projectRoot . '/vendor/autoload.php');
 
diff --git a/tests/lib/AutoloadModulesTest.php b/tests/lib/AutoloadModulesTest.php
index c136ea5ea6366904a7dfc59ec873e673a176da9c..57f26304ff1ee1131033cec7646fea8adc35578f 100644
--- a/tests/lib/AutoloadModulesTest.php
+++ b/tests/lib/AutoloadModulesTest.php
@@ -1,5 +1,7 @@
 <?php
 
+declare(strict_types=1);
+
 namespace SimpleSAML\Test;
 
 use PHPUnit\Framework\TestCase;
diff --git a/tests/lib/SimpleSAML/Auth/SimpleTest.php b/tests/lib/SimpleSAML/Auth/SimpleTest.php
index b78f24b446f04c1b63503d6d74f6abbb188f3ab5..3bdad09779e250ac3023f0ce292b735272e173e4 100644
--- a/tests/lib/SimpleSAML/Auth/SimpleTest.php
+++ b/tests/lib/SimpleSAML/Auth/SimpleTest.php
@@ -1,5 +1,7 @@
 <?php
 
+declare(strict_types=1);
+
 namespace SimpleSAML\Test\Auth;
 
 use SimpleSAML\Auth;
diff --git a/tests/lib/SimpleSAML/Auth/SourceTest.php b/tests/lib/SimpleSAML/Auth/SourceTest.php
index fe326f5d0666fe0093570b55ab3f4ed1f4729237..c243c77b615615951940f3604fbe504bcd0ec050 100644
--- a/tests/lib/SimpleSAML/Auth/SourceTest.php
+++ b/tests/lib/SimpleSAML/Auth/SourceTest.php
@@ -1,5 +1,7 @@
 <?php
 
+declare(strict_types=1);
+
 namespace SimpleSAML\Test\Auth;
 
 use SimpleSAML\Test\Utils\ClearStateTestCase;
diff --git a/tests/lib/SimpleSAML/Auth/StateTest.php b/tests/lib/SimpleSAML/Auth/StateTest.php
index 6d1c2a52ea392143bd72a1a1bb54cc451b2d4a84..3463fc2faa778b28b5bba99d6a433fba6fabefe0 100644
--- a/tests/lib/SimpleSAML/Auth/StateTest.php
+++ b/tests/lib/SimpleSAML/Auth/StateTest.php
@@ -1,5 +1,7 @@
 <?php
 
+declare(strict_types=1);
+
 namespace SimpleSAML\Test\Auth;
 
 use PHPUnit\Framework\TestCase;
diff --git a/tests/lib/SimpleSAML/Auth/TimeLimitedTokenTest.php b/tests/lib/SimpleSAML/Auth/TimeLimitedTokenTest.php
index ec7891f449c07e8bf8c3308bc56e0630ea493cf3..d955c552fa4d9c56143417b9f3834064452edc0c 100644
--- a/tests/lib/SimpleSAML/Auth/TimeLimitedTokenTest.php
+++ b/tests/lib/SimpleSAML/Auth/TimeLimitedTokenTest.php
@@ -1,5 +1,7 @@
 <?php
 
+declare(strict_types=1);
+
 namespace SimpleSAML\Test\Auth;
 
 use SimpleSAML\Auth\TimeLimitedToken;
diff --git a/tests/lib/SimpleSAML/ConfigurationTest.php b/tests/lib/SimpleSAML/ConfigurationTest.php
index 9c15f78b3f922eb3226e6d27f5344e8845162bd1..528709ccb9219fcea9db978dbee7a7d160ff0d0d 100644
--- a/tests/lib/SimpleSAML/ConfigurationTest.php
+++ b/tests/lib/SimpleSAML/ConfigurationTest.php
@@ -1,5 +1,7 @@
 <?php
 
+declare(strict_types=1);
+
 namespace SimpleSAML\Test;
 
 use SimpleSAML\Configuration;
diff --git a/tests/lib/SimpleSAML/DatabaseTest.php b/tests/lib/SimpleSAML/DatabaseTest.php
index 18cac06cc12116b68a27b290ec7d0a247404b4eb..47c253b60eb0d3ca3930d04f07e66ecdeb71aef0 100644
--- a/tests/lib/SimpleSAML/DatabaseTest.php
+++ b/tests/lib/SimpleSAML/DatabaseTest.php
@@ -1,5 +1,7 @@
 <?php
 
+declare(strict_types=1);
+
 namespace SimpleSAML\Test;
 
 use PHPUnit\Framework\TestCase;
diff --git a/tests/lib/SimpleSAML/Locale/LanguageTest.php b/tests/lib/SimpleSAML/Locale/LanguageTest.php
index 66b137b9559ab9d9ce124f26b08ee724b28fabfd..03c978a04b4012e9aa46019257e2e4c07c88a6f2 100644
--- a/tests/lib/SimpleSAML/Locale/LanguageTest.php
+++ b/tests/lib/SimpleSAML/Locale/LanguageTest.php
@@ -1,5 +1,7 @@
 <?php
 
+declare(strict_types=1);
+
 namespace SimpleSAML\Test\Locale;
 
 use PHPUnit\Framework\TestCase;
diff --git a/tests/lib/SimpleSAML/Locale/LocalizationTest.php b/tests/lib/SimpleSAML/Locale/LocalizationTest.php
index e68e1928b4728ff907bcddb4c769e634da234808..12b036eaeaf5b9ed29dbcde9ce03f8b57d6754d4 100644
--- a/tests/lib/SimpleSAML/Locale/LocalizationTest.php
+++ b/tests/lib/SimpleSAML/Locale/LocalizationTest.php
@@ -1,5 +1,7 @@
 <?php
 
+declare(strict_types=1);
+
 namespace SimpleSAML\Test\Locale;
 
 use PHPUnit\Framework\TestCase;
diff --git a/tests/lib/SimpleSAML/Locale/TranslateTest.php b/tests/lib/SimpleSAML/Locale/TranslateTest.php
index c8209f97e571c03773b462aaeecb47588e8af245..1e6cef3c3a5246fb2992bbe0a6e3d07d62ddd108 100644
--- a/tests/lib/SimpleSAML/Locale/TranslateTest.php
+++ b/tests/lib/SimpleSAML/Locale/TranslateTest.php
@@ -1,5 +1,7 @@
 <?php
 
+declare(strict_types=1);
+
 namespace SimpleSAML\Test\Locale;
 
 use PHPUnit\Framework\TestCase;
diff --git a/tests/lib/SimpleSAML/Metadata/MetaDataStorageHandlerTest.php b/tests/lib/SimpleSAML/Metadata/MetaDataStorageHandlerTest.php
index 0221b972e7e77f4acfe5235a1de2ae92a1151e2f..47e837ce4cd76e7d3a6bcfa1e14beaba46416deb 100644
--- a/tests/lib/SimpleSAML/Metadata/MetaDataStorageHandlerTest.php
+++ b/tests/lib/SimpleSAML/Metadata/MetaDataStorageHandlerTest.php
@@ -1,5 +1,7 @@
 <?php
 
+declare(strict_types=1);
+
 namespace SimpleSAML\Test\Metadata;
 
 use SimpleSAML\Configuration;
diff --git a/tests/lib/SimpleSAML/Metadata/MetaDataStorageSourceTest.php b/tests/lib/SimpleSAML/Metadata/MetaDataStorageSourceTest.php
index 323446eabefadfcd0818042b06393c96a40fd020..d7c39a3237b697aef4eb8e34bdac1638f72e02b7 100644
--- a/tests/lib/SimpleSAML/Metadata/MetaDataStorageSourceTest.php
+++ b/tests/lib/SimpleSAML/Metadata/MetaDataStorageSourceTest.php
@@ -1,5 +1,7 @@
 <?php
 
+declare(strict_types=1);
+
 namespace SimpleSAML\Test\Metadata;
 
 use SimpleSAML\Configuration;
diff --git a/tests/lib/SimpleSAML/Metadata/SAMLBuilderTest.php b/tests/lib/SimpleSAML/Metadata/SAMLBuilderTest.php
index 0e5f2d3480c69e7d47c4e93de65b60b51296bb38..fe5e3fcb39f47f191119030055f5128ae9e47171 100644
--- a/tests/lib/SimpleSAML/Metadata/SAMLBuilderTest.php
+++ b/tests/lib/SimpleSAML/Metadata/SAMLBuilderTest.php
@@ -1,5 +1,7 @@
 <?php
 
+declare(strict_types=1);
+
 namespace SimpleSAML\Test\Metadata;
 
 use PHPUnit\Framework\TestCase;
diff --git a/tests/lib/SimpleSAML/Metadata/SAMLParserTest.php b/tests/lib/SimpleSAML/Metadata/SAMLParserTest.php
index 3dd13a1c1dffc5f61c0c41f05f5bec7facd5b470..b538cafde63581e50f86d1ae8bfc1375539c794f 100644
--- a/tests/lib/SimpleSAML/Metadata/SAMLParserTest.php
+++ b/tests/lib/SimpleSAML/Metadata/SAMLParserTest.php
@@ -1,5 +1,7 @@
 <?php
 
+declare(strict_types=1);
+
 namespace SimpleSAML\Test\Metadata;
 
 use PHPUnit\Framework\TestCase;
diff --git a/tests/lib/SimpleSAML/Metadata/test-metadata/source1/saml20-sp-remote.php b/tests/lib/SimpleSAML/Metadata/test-metadata/source1/saml20-sp-remote.php
index 5be0b25f292ebfd2fff58eaa8ff188608f17da9e..b137a00b92858546678573ddf1344d9a47611d41 100644
--- a/tests/lib/SimpleSAML/Metadata/test-metadata/source1/saml20-sp-remote.php
+++ b/tests/lib/SimpleSAML/Metadata/test-metadata/source1/saml20-sp-remote.php
@@ -1,5 +1,7 @@
 <?php
 
+declare(strict_types=1);
+
 $metadata = [];
 
 $metadata['entityA'] = [
diff --git a/tests/lib/SimpleSAML/ModuleTest.php b/tests/lib/SimpleSAML/ModuleTest.php
index 3c2558d2a1318de9ea5e14c7aae016de29aa5b61..4218313eaa1900e151a1ecf0f6e1239abd3c75ae 100644
--- a/tests/lib/SimpleSAML/ModuleTest.php
+++ b/tests/lib/SimpleSAML/ModuleTest.php
@@ -1,5 +1,7 @@
 <?php
 
+declare(strict_types=1);
+
 namespace SimpleSAML\Test;
 
 use PHPUnit\Framework\TestCase;
diff --git a/tests/lib/SimpleSAML/SessionHandlerPHPTest.php b/tests/lib/SimpleSAML/SessionHandlerPHPTest.php
index 279fe0725bef72468bfc386ab263bcd6f6c4630d..c0b71a489ee7923d407736bf781fd20369837bfe 100644
--- a/tests/lib/SimpleSAML/SessionHandlerPHPTest.php
+++ b/tests/lib/SimpleSAML/SessionHandlerPHPTest.php
@@ -1,5 +1,7 @@
 <?php
 
+declare(strict_types=1);
+
 namespace SimpleSAML\Test\Utils;
 
 use PHPUnit\Framework\TestCase;
diff --git a/tests/lib/SimpleSAML/Store/RedisTest.php b/tests/lib/SimpleSAML/Store/RedisTest.php
index fb133be9c0175f4b58001a42f24e17611ac87913..44ab5215e6d58c1c63c97c3fa47ee08537c3e530 100644
--- a/tests/lib/SimpleSAML/Store/RedisTest.php
+++ b/tests/lib/SimpleSAML/Store/RedisTest.php
@@ -1,5 +1,7 @@
 <?php
 
+declare(strict_types=1);
+
 namespace SimpleSAML\Test\Store;
 
 use PHPUnit\Framework\TestCase;
diff --git a/tests/lib/SimpleSAML/Store/SQLTest.php b/tests/lib/SimpleSAML/Store/SQLTest.php
index aac6edf9a6b3526ebcfbd31e53370565c86916ee..a2ebb848e540f7136132e59d28ca0f4ebadfa4dc 100644
--- a/tests/lib/SimpleSAML/Store/SQLTest.php
+++ b/tests/lib/SimpleSAML/Store/SQLTest.php
@@ -1,5 +1,7 @@
 <?php
 
+declare(strict_types=1);
+
 namespace SimpleSAML\Test\Store;
 
 use PHPUnit\Framework\TestCase;
diff --git a/tests/lib/SimpleSAML/StoreTest.php b/tests/lib/SimpleSAML/StoreTest.php
index 09412ff482b55cfc12bf239c63f50a4fd1d85d87..672b4b20536583490cc6f51af65661dc663b0ad5 100644
--- a/tests/lib/SimpleSAML/StoreTest.php
+++ b/tests/lib/SimpleSAML/StoreTest.php
@@ -1,5 +1,7 @@
 <?php
 
+declare(strict_types=1);
+
 namespace SimpleSAML\Test;
 
 use PHPUnit\Framework\TestCase;
diff --git a/tests/lib/SimpleSAML/Utils/ArraysTest.php b/tests/lib/SimpleSAML/Utils/ArraysTest.php
index bf8b6d60ce7ba3091e71fe255aea1d7b5725f0a1..8bfe6bccc960166f284ff71c3bfd63972dae8504 100644
--- a/tests/lib/SimpleSAML/Utils/ArraysTest.php
+++ b/tests/lib/SimpleSAML/Utils/ArraysTest.php
@@ -1,5 +1,7 @@
 <?php
 
+declare(strict_types=1);
+
 namespace SimpleSAML\Test\Utils;
 
 use PHPUnit\Framework\TestCase;
diff --git a/tests/lib/SimpleSAML/Utils/AttributesTest.php b/tests/lib/SimpleSAML/Utils/AttributesTest.php
index 3cf15731b0c6c91fd68ba6547c04f356b0f5ad68..42ae15c35789ab3c12a12e7e15b881b86c5e9c22 100644
--- a/tests/lib/SimpleSAML/Utils/AttributesTest.php
+++ b/tests/lib/SimpleSAML/Utils/AttributesTest.php
@@ -1,5 +1,7 @@
 <?php
 
+declare(strict_types=1);
+
 namespace SimpleSAML\Test\Utils;
 
 use InvalidArgumentException;
diff --git a/tests/lib/SimpleSAML/Utils/Config/MetadataTest.php b/tests/lib/SimpleSAML/Utils/Config/MetadataTest.php
index df7137d3204683da60ff62c93eaa796fc8aca324..d5ef54e2ff99b5e3e894e03cf57dfa2786b57c26 100644
--- a/tests/lib/SimpleSAML/Utils/Config/MetadataTest.php
+++ b/tests/lib/SimpleSAML/Utils/Config/MetadataTest.php
@@ -1,10 +1,13 @@
 <?php
 
+declare(strict_types=1);
+
 namespace SimpleSAML\Test\Utils\Config;
 
 use DOMDocument;
 use PHPUnit\Framework\TestCase;
 use SimpleSAML\Utils\Config\Metadata;
+use TypeError;
 
 /**
  * Tests related to SAML metadata.
@@ -251,7 +254,9 @@ class MetadataTest extends TestCase
         ]));
 
         // test for failures
-        $this->assertFalse(Metadata::isHiddenFromDiscovery(['foo']));
+        $this->expectException(TypeError::class);
+        Metadata::isHiddenFromDiscovery(['foo']);
+
         $this->assertFalse(Metadata::isHiddenFromDiscovery([
             'EntityAttributes' => 'bar',
         ]));
diff --git a/tests/lib/SimpleSAML/Utils/ConfigTest.php b/tests/lib/SimpleSAML/Utils/ConfigTest.php
index af66330d0224a52da14a1bfc508562ea6ccf1fbd..ae9660548099b9091ce1a99caf34af1c9e0200f4 100644
--- a/tests/lib/SimpleSAML/Utils/ConfigTest.php
+++ b/tests/lib/SimpleSAML/Utils/ConfigTest.php
@@ -1,5 +1,7 @@
 <?php
 
+declare(strict_types=1);
+
 namespace SimpleSAML\Test\Utils;
 
 use InvalidArgumentException;
diff --git a/tests/lib/SimpleSAML/Utils/CryptoTest.php b/tests/lib/SimpleSAML/Utils/CryptoTest.php
index 9841299eb32a075a212ee15e589d5bff54936cd5..f0d28123b5606caa2cb588834c21cfd29ba869ee 100644
--- a/tests/lib/SimpleSAML/Utils/CryptoTest.php
+++ b/tests/lib/SimpleSAML/Utils/CryptoTest.php
@@ -1,5 +1,7 @@
 <?php
 
+declare(strict_types=1);
+
 namespace SimpleSAML\Test\Utils;
 
 use org\bovigo\vfs\vfsStream;
diff --git a/tests/lib/SimpleSAML/Utils/EMailTestCase.php b/tests/lib/SimpleSAML/Utils/EMailTestCase.php
index 89aa4fdd7a151b026fd1fe77d850171bda3ea0bd..122fef7b8f648ba3e9245d9d8dd674ce46d575c4 100644
--- a/tests/lib/SimpleSAML/Utils/EMailTestCase.php
+++ b/tests/lib/SimpleSAML/Utils/EMailTestCase.php
@@ -1,5 +1,7 @@
 <?php
 
+declare(strict_types=1);
+
 namespace SimpleSAML\Test\Utils;
 
 use SimpleSAML\Configuration;
diff --git a/tests/lib/SimpleSAML/Utils/HTTPTest.php b/tests/lib/SimpleSAML/Utils/HTTPTest.php
index 32cd3aac6513df6146dcc173bc719559888c2f11..977fde1caf867ffa247a70f86da54801e14ac75d 100644
--- a/tests/lib/SimpleSAML/Utils/HTTPTest.php
+++ b/tests/lib/SimpleSAML/Utils/HTTPTest.php
@@ -1,5 +1,7 @@
 <?php
 
+declare(strict_types=1);
+
 namespace SimpleSAML\Test\Utils;
 
 use PHPUnit\Framework\TestCase;
diff --git a/tests/lib/SimpleSAML/Utils/NetTest.php b/tests/lib/SimpleSAML/Utils/NetTest.php
index df25c83ffdb0d5baf1e9c0a32ae12bd6fb68b4b5..06f1b960e8bc239474b947bf2c32167c598d0aaf 100644
--- a/tests/lib/SimpleSAML/Utils/NetTest.php
+++ b/tests/lib/SimpleSAML/Utils/NetTest.php
@@ -1,5 +1,7 @@
 <?php
 
+declare(strict_types=1);
+
 namespace SimpleSAML\Test\Utils;
 
 use PHPUnit\Framework\TestCase;
diff --git a/tests/lib/SimpleSAML/Utils/RandomTest.php b/tests/lib/SimpleSAML/Utils/RandomTest.php
index d55fc95a0f6f3ed6ebb9e57a5823fd4da323ac39..38ee88fe307e5d158196e321f649aba8b322c37f 100644
--- a/tests/lib/SimpleSAML/Utils/RandomTest.php
+++ b/tests/lib/SimpleSAML/Utils/RandomTest.php
@@ -1,5 +1,7 @@
 <?php
 
+declare(strict_types=1);
+
 namespace SimpleSAML\Test\Utils;
 
 use PHPUnit\Framework\TestCase;
diff --git a/tests/lib/SimpleSAML/Utils/SystemTest.php b/tests/lib/SimpleSAML/Utils/SystemTest.php
index f2e5c854537a37619436bd1bd392724dde8dbc2f..de126d6b9106299c30c71590e90f32eb77dbf635 100644
--- a/tests/lib/SimpleSAML/Utils/SystemTest.php
+++ b/tests/lib/SimpleSAML/Utils/SystemTest.php
@@ -1,5 +1,7 @@
 <?php
 
+declare(strict_types=1);
+
 namespace SimpleSAML\Test\Utils;
 
 use InvalidArgumentException;
diff --git a/tests/lib/SimpleSAML/Utils/TimeTest.php b/tests/lib/SimpleSAML/Utils/TimeTest.php
index 52ea3bd047b419abb8eb77e325589cf794aec9e6..03f4e72a5793cb1d949b4ae3a1e1dd09d615b9d9 100644
--- a/tests/lib/SimpleSAML/Utils/TimeTest.php
+++ b/tests/lib/SimpleSAML/Utils/TimeTest.php
@@ -1,5 +1,7 @@
 <?php
 
+declare(strict_types=1);
+
 namespace SimpleSAML\Test\Utils;
 
 use PHPUnit\Framework\TestCase;
diff --git a/tests/lib/SimpleSAML/Utils/XMLTest.php b/tests/lib/SimpleSAML/Utils/XMLTest.php
index 7989d6a502f61753a82c4eb207e3e41f6f6682a5..7eb3a7919c13b895ca62da9dfda4ce4d8e88a3e6 100644
--- a/tests/lib/SimpleSAML/Utils/XMLTest.php
+++ b/tests/lib/SimpleSAML/Utils/XMLTest.php
@@ -1,5 +1,7 @@
 <?php
 
+declare(strict_types=1);
+
 namespace SimpleSAML\Test\Utils;
 
 use PHPUnit\Framework\TestCase;
diff --git a/tests/lib/SimpleSAML/XML/ErrorsTest.php b/tests/lib/SimpleSAML/XML/ErrorsTest.php
index 7332b566805ea7259890facab848d40ba256c23a..23e33c550587b7a135e1c957c1dad2eb901214b4 100644
--- a/tests/lib/SimpleSAML/XML/ErrorsTest.php
+++ b/tests/lib/SimpleSAML/XML/ErrorsTest.php
@@ -1,5 +1,7 @@
 <?php
 
+declare(strict_types=1);
+
 namespace SimpleSAML\Test\XML;
 
 use PHPUnit\Framework\TestCase;
diff --git a/tests/lib/SimpleSAML/XML/ParserTest.php b/tests/lib/SimpleSAML/XML/ParserTest.php
index 5f7837c1726357ab80f1b5882b8efd401d4c3fc6..ae5a978aef52dd170ac2600852fa395b284afe72 100644
--- a/tests/lib/SimpleSAML/XML/ParserTest.php
+++ b/tests/lib/SimpleSAML/XML/ParserTest.php
@@ -1,5 +1,7 @@
 <?php
 
+declare(strict_types=1);
+
 namespace SimpleSAML\Test\XML;
 
 use PHPUnit\Framework\TestCase;
diff --git a/tests/lib/SimpleSAML/XML/Shib13/AuthnResponseTest.php b/tests/lib/SimpleSAML/XML/Shib13/AuthnResponseTest.php
index 75f992f620c9d27e3ac6c21f7945ccfae976c824..a387c9e93e25f7b7199287c6d8c551e0b7883cea 100644
--- a/tests/lib/SimpleSAML/XML/Shib13/AuthnResponseTest.php
+++ b/tests/lib/SimpleSAML/XML/Shib13/AuthnResponseTest.php
@@ -1,4 +1,7 @@
 <?php
+
+declare(strict_types=1);
+
 /*
  * This file is part of the sgomezsimpleshibphp.
  *
diff --git a/tests/lib/SimpleSAML/XML/SignerTest.php b/tests/lib/SimpleSAML/XML/SignerTest.php
index a8396d44fe42e0e0b59436984539151e3d48e36e..a2d157659a8f7ced60645b1f3961308cbcb8d787 100644
--- a/tests/lib/SimpleSAML/XML/SignerTest.php
+++ b/tests/lib/SimpleSAML/XML/SignerTest.php
@@ -1,5 +1,7 @@
 <?php
 
+declare(strict_types=1);
+
 namespace SimpleSAML\Test\XML;
 
 use DOMDocument;
diff --git a/tests/lib/SimpleSAML/XML/ValidatorTest.php b/tests/lib/SimpleSAML/XML/ValidatorTest.php
index f6bb17f6d87695e5c8d91e67f01e0ab805340cc8..67a71d2374508349b219aba3024738cec38db742 100644
--- a/tests/lib/SimpleSAML/XML/ValidatorTest.php
+++ b/tests/lib/SimpleSAML/XML/ValidatorTest.php
@@ -1,5 +1,7 @@
 <?php
 
+declare(strict_types=1);
+
 namespace SimpleSAML\Test\XML;
 
 use DOMDocument;
diff --git a/tests/modules/core/lib/Auth/Process/AttributeAddTest.php b/tests/modules/core/lib/Auth/Process/AttributeAddTest.php
index dac7e8713e279f3a049050f7621a962638ca0e07..486f8a3da14905efee0ad1acf7a361cfdb8fe28e 100644
--- a/tests/modules/core/lib/Auth/Process/AttributeAddTest.php
+++ b/tests/modules/core/lib/Auth/Process/AttributeAddTest.php
@@ -1,5 +1,7 @@
 <?php
 
+declare(strict_types=1);
+
 namespace SimpleSAML\Test\Module\core\Auth\Process;
 
 use PHPUnit\Framework\TestCase;
diff --git a/tests/modules/core/lib/Auth/Process/AttributeAlterTest.php b/tests/modules/core/lib/Auth/Process/AttributeAlterTest.php
index 69f6a5aa1b078b4bd832de63617f76c3f6f849c8..19078037d81d35efaa98b9e57b0c082c8b76b653 100644
--- a/tests/modules/core/lib/Auth/Process/AttributeAlterTest.php
+++ b/tests/modules/core/lib/Auth/Process/AttributeAlterTest.php
@@ -1,5 +1,7 @@
 <?php
 
+declare(strict_types=1);
+
 namespace SimpleSAML\Test\Module\core\Auth\Process;
 
 use PHPUnit\Framework\TestCase;
diff --git a/tests/modules/core/lib/Auth/Process/AttributeCopyTest.php b/tests/modules/core/lib/Auth/Process/AttributeCopyTest.php
index 1b1abf9f7848868e8be063e64548aac244b27dc0..cd3ef69ec92857810fcda9a44a63a152eff8e02d 100644
--- a/tests/modules/core/lib/Auth/Process/AttributeCopyTest.php
+++ b/tests/modules/core/lib/Auth/Process/AttributeCopyTest.php
@@ -1,5 +1,7 @@
 <?php
 
+declare(strict_types=1);
+
 namespace SimpleSAML\Test\Module\core\Auth\Process;
 
 use PHPUnit\Framework\TestCase;
diff --git a/tests/modules/core/lib/Auth/Process/AttributeLimitTest.php b/tests/modules/core/lib/Auth/Process/AttributeLimitTest.php
index 4d2fed99803f8aa4bdf717d72efe9fe2079a5371..b79b7131a69a9f4e6f5f81d9e590815a474b0cde 100644
--- a/tests/modules/core/lib/Auth/Process/AttributeLimitTest.php
+++ b/tests/modules/core/lib/Auth/Process/AttributeLimitTest.php
@@ -1,5 +1,7 @@
 <?php
 
+declare(strict_types=1);
+
 namespace SimpleSAML\Test\Module\core\Auth\Process;
 
 use PHPUnit\Framework\TestCase;
diff --git a/tests/modules/core/lib/Auth/Process/AttributeMapTest.php b/tests/modules/core/lib/Auth/Process/AttributeMapTest.php
index 878014a7838504075494deb978119e6163779403..cbd33af7152a7a20db6479546a1ba717e51d059a 100644
--- a/tests/modules/core/lib/Auth/Process/AttributeMapTest.php
+++ b/tests/modules/core/lib/Auth/Process/AttributeMapTest.php
@@ -1,5 +1,7 @@
 <?php
 
+declare(strict_types=1);
+
 namespace SimpleSAML\Test\Module\core\Auth\Process;
 
 use PHPUnit\Framework\TestCase;
diff --git a/tests/modules/core/lib/Auth/Process/AttributeRealmTest.php b/tests/modules/core/lib/Auth/Process/AttributeRealmTest.php
index a89a73aa301cb44fd27c23399a5024b5230595cf..dc2c7e87073a3df6652dfd46b28d300fdcb8cd71 100644
--- a/tests/modules/core/lib/Auth/Process/AttributeRealmTest.php
+++ b/tests/modules/core/lib/Auth/Process/AttributeRealmTest.php
@@ -1,5 +1,7 @@
 <?php
 
+declare(strict_types=1);
+
 namespace SimpleSAML\Test\Module\core\Auth\Process;
 
 use PHPUnit\Framework\TestCase;
diff --git a/tests/modules/core/lib/Auth/Process/AttributeValueMapTest.php b/tests/modules/core/lib/Auth/Process/AttributeValueMapTest.php
index c3c153a4fd19616bb09497c91b59f0513e7ce4d0..d79e31ee0fbdbc2e67622341ae7ee9a3936600d0 100644
--- a/tests/modules/core/lib/Auth/Process/AttributeValueMapTest.php
+++ b/tests/modules/core/lib/Auth/Process/AttributeValueMapTest.php
@@ -1,5 +1,7 @@
 <?php
 
+declare(strict_types=1);
+
 namespace SimpleSAML\Test\Module\core\Auth\Process;
 
 use PHPUnit\Framework\TestCase;
diff --git a/tests/modules/core/lib/Auth/Process/CardinalitySingleTest.php b/tests/modules/core/lib/Auth/Process/CardinalitySingleTest.php
index 136c5813702a48e35763d8544329d295abc7e572..62de2e872976cc7006d4031d09f32c31b08f2105 100644
--- a/tests/modules/core/lib/Auth/Process/CardinalitySingleTest.php
+++ b/tests/modules/core/lib/Auth/Process/CardinalitySingleTest.php
@@ -1,5 +1,7 @@
 <?php
 
+declare(strict_types=1);
+
 namespace SimpleSAML\Test\Module\core\Auth\Process;
 
 use SimpleSAML\Utils\HttpAdapter;
diff --git a/tests/modules/core/lib/Auth/Process/CardinalityTest.php b/tests/modules/core/lib/Auth/Process/CardinalityTest.php
index edcebb727cbfa501d64e94184dec55249573c62c..03cb6aab3688b595c6358689dd59f3941c5fa936 100644
--- a/tests/modules/core/lib/Auth/Process/CardinalityTest.php
+++ b/tests/modules/core/lib/Auth/Process/CardinalityTest.php
@@ -1,5 +1,7 @@
 <?php
 
+declare(strict_types=1);
+
 namespace SimpleSAML\Test\Module\core\Auth\Process;
 
 use SimpleSAML\Error\Exception as SspException;
diff --git a/tests/modules/core/lib/Auth/Process/PHPTest.php b/tests/modules/core/lib/Auth/Process/PHPTest.php
index cba7b818fc2925575bfb4f7ef0a7c795d264fc28..78815548858b45f472a77e05eaa0b07ebfd991cf 100644
--- a/tests/modules/core/lib/Auth/Process/PHPTest.php
+++ b/tests/modules/core/lib/Auth/Process/PHPTest.php
@@ -1,5 +1,7 @@
 <?php
 
+declare(strict_types=1);
+
 namespace SimpleSAML\Test\Module\core\Auth\Process;
 
 use Exception;
diff --git a/tests/modules/core/lib/Auth/Process/ScopeAttributeTest.php b/tests/modules/core/lib/Auth/Process/ScopeAttributeTest.php
index 940542def5bf327a978f779464874edeb3eedbe8..6c2c833d629daef34422a8da086fa4a84ecc5a75 100644
--- a/tests/modules/core/lib/Auth/Process/ScopeAttributeTest.php
+++ b/tests/modules/core/lib/Auth/Process/ScopeAttributeTest.php
@@ -1,5 +1,7 @@
 <?php
 
+declare(strict_types=1);
+
 namespace SimpleSAML\Test\Module\core\Auth\Process;
 
 use PHPUnit\Framework\TestCase;
diff --git a/tests/modules/core/lib/Auth/Process/ScopeFromAttributeTest.php b/tests/modules/core/lib/Auth/Process/ScopeFromAttributeTest.php
index 365eee86a2bd351d5f49e6c7852d528af2a70d14..0e45a1ee5f6f3f95ae188f79de208fe14aa2c481 100644
--- a/tests/modules/core/lib/Auth/Process/ScopeFromAttributeTest.php
+++ b/tests/modules/core/lib/Auth/Process/ScopeFromAttributeTest.php
@@ -1,5 +1,7 @@
 <?php
 
+declare(strict_types=1);
+
 namespace SimpleSAML\Test\Module\core\Auth\Process;
 
 use PHPUnit\Framework\TestCase;
diff --git a/tests/modules/core/lib/Auth/Process/TargetedIDTest.php b/tests/modules/core/lib/Auth/Process/TargetedIDTest.php
index 4987db93062040bb574fb52e086179503145ec2c..4811bc53765a156baff99b69c8256c2de507ef12 100644
--- a/tests/modules/core/lib/Auth/Process/TargetedIDTest.php
+++ b/tests/modules/core/lib/Auth/Process/TargetedIDTest.php
@@ -1,5 +1,7 @@
 <?php
 
+declare(strict_types=1);
+
 namespace SimpleSAML\Test\Module\core\Auth\Process;
 
 use PHPUnit\Framework\TestCase;
diff --git a/tests/modules/core/lib/Auth/UserPassBaseTest.php b/tests/modules/core/lib/Auth/UserPassBaseTest.php
index bb897b9eaddf27bb855b0e774a31aa69ca7dfef9..62755411ae3ffa84dee62cc4d697f858b662c5d9 100644
--- a/tests/modules/core/lib/Auth/UserPassBaseTest.php
+++ b/tests/modules/core/lib/Auth/UserPassBaseTest.php
@@ -1,5 +1,7 @@
 <?php
 
+declare(strict_types=1);
+
 namespace SimpleSAML\Test\Module\core\Auth;
 
 use SAML2\Constants;
diff --git a/tests/modules/core/lib/Auth/UserPassOrgBaseTest.php b/tests/modules/core/lib/Auth/UserPassOrgBaseTest.php
index cabf506c6e47b9ddeedb87f692c14e3e209f1fd6..6fe765fddccf19f549092fe11b9d8396a583a8aa 100644
--- a/tests/modules/core/lib/Auth/UserPassOrgBaseTest.php
+++ b/tests/modules/core/lib/Auth/UserPassOrgBaseTest.php
@@ -1,5 +1,7 @@
 <?php
 
+declare(strict_types=1);
+
 namespace SimpleSAML\Test\Module\core\Auth;
 
 use SimpleSAML\Module\core\Auth\UserPassOrgBase;
diff --git a/tests/modules/core/lib/Controller/LoginControllerTest.php b/tests/modules/core/lib/Controller/LoginControllerTest.php
index 39a4852471828b11d477464c7033d5b815cbae89..d6dd6a3c3f28d4c58c10011126ba161d302a3eeb 100644
--- a/tests/modules/core/lib/Controller/LoginControllerTest.php
+++ b/tests/modules/core/lib/Controller/LoginControllerTest.php
@@ -1,5 +1,7 @@
 <?php
 
+declare(strict_types=1);
+
 namespace SimpleSAML\Test\Module\core\Controller;
 
 use SimpleSAML\Auth\Simple;
diff --git a/tests/modules/core/lib/Storage/SQLPermanentStorageTest.php b/tests/modules/core/lib/Storage/SQLPermanentStorageTest.php
index e629fad64b41085e4f5b3e7b1a9f51baf84979a2..1f19058f8f21d9407bf2ee09848b601358968345 100644
--- a/tests/modules/core/lib/Storage/SQLPermanentStorageTest.php
+++ b/tests/modules/core/lib/Storage/SQLPermanentStorageTest.php
@@ -1,5 +1,7 @@
 <?php
 
+declare(strict_types=1);
+
 namespace SimpleSAML\Test\Module\core\Storage;
 
 use PHPUnit\Framework\TestCase;
diff --git a/tests/modules/multiauth/lib/Auth/Source/MultiAuthTest.php b/tests/modules/multiauth/lib/Auth/Source/MultiAuthTest.php
index d3bf5b05d114b39cf7481270808e9b51e7af5892..635633037c1d86b6979d2cead36a2eb2ca37d0c1 100644
--- a/tests/modules/multiauth/lib/Auth/Source/MultiAuthTest.php
+++ b/tests/modules/multiauth/lib/Auth/Source/MultiAuthTest.php
@@ -1,5 +1,7 @@
 <?php
 
+declare(strict_types=1);
+
 namespace SimpleSAML\Test\Module\multiauth\Auth\Source;
 
 use PHPUnit\Framework\TestCase;
diff --git a/tests/modules/saml/lib/Auth/Process/FilterScopesTest.php b/tests/modules/saml/lib/Auth/Process/FilterScopesTest.php
index 561c78bbd94aea82f571bb381e209b6fe59792f1..b51b850954e09f9c228b96f443b980d2590353a9 100644
--- a/tests/modules/saml/lib/Auth/Process/FilterScopesTest.php
+++ b/tests/modules/saml/lib/Auth/Process/FilterScopesTest.php
@@ -1,5 +1,7 @@
 <?php
 
+declare(strict_types=1);
+
 namespace SimpleSAML\Test\Module\saml\Auth\Process;
 
 use PHPUnit\Framework\TestCase;
diff --git a/tests/modules/saml/lib/Auth/Process/NameIDAttributeTest.php b/tests/modules/saml/lib/Auth/Process/NameIDAttributeTest.php
index 13bd08314a128a2b3f8027376c3e366d75fd4f4c..a09455bf20610e4c1727aba582e2f750c5e5c78e 100644
--- a/tests/modules/saml/lib/Auth/Process/NameIDAttributeTest.php
+++ b/tests/modules/saml/lib/Auth/Process/NameIDAttributeTest.php
@@ -1,11 +1,6 @@
 <?php
 
-/**
- * Test for the saml:NameIDAttribute filter.
- *
- * @author Eugene Venter <eugene@catalyst.net.nz>
- * @package SimpleSAMLphp
- */
+declare(strict_types=1);
 
 namespace SimpleSAML\Test\Module\saml\Auth\Process;
 
@@ -14,6 +9,12 @@ use SimpleSAML\Module\saml\Auth\Process\NameIDAttribute;
 use SAML2\XML\saml\NameID;
 use SAML2\Constants;
 
+/**
+ * Test for the saml:NameIDAttribute filter.
+ *
+ * @author Eugene Venter <eugene@catalyst.net.nz>
+ * @package SimpleSAMLphp
+ */
 class NameIDAttributeTest extends TestCase
 {
     /**
diff --git a/tests/modules/saml/lib/Auth/Source/Auth_Source_SP_Test.php b/tests/modules/saml/lib/Auth/Source/Auth_Source_SP_Test.php
index 181f7d4ff021f6c06b4cb078e0ca3f8fd3da1bc7..f9604be608b901843a991d6402ccbdd13e090caf 100644
--- a/tests/modules/saml/lib/Auth/Source/Auth_Source_SP_Test.php
+++ b/tests/modules/saml/lib/Auth/Source/Auth_Source_SP_Test.php
@@ -1,5 +1,7 @@
 <?php
 
+declare(strict_types=1);
+
 namespace SimpleSAML\Test\Module\saml\Auth\Source;
 
 use InvalidArgumentException;
diff --git a/tests/modules/saml/lib/IdP/SAML2Test.php b/tests/modules/saml/lib/IdP/SAML2Test.php
index 94dcef988afeef1dc5dc123f52a72fcdc3feef35..b2bcd5ab558feb2d3104c3be657450d841ebc929 100644
--- a/tests/modules/saml/lib/IdP/SAML2Test.php
+++ b/tests/modules/saml/lib/IdP/SAML2Test.php
@@ -1,5 +1,7 @@
 <?php
 
+declare(strict_types=1);
+
 namespace SimpleSAML\Test\Module\saml\IdP;
 
 use SimpleSAML\Configuration;
diff --git a/tests/modules/saml/lib/IdP/SQLNameIDTest.php b/tests/modules/saml/lib/IdP/SQLNameIDTest.php
index 17ef569278af2207b411557eac592de775b5d63a..1cac60f4cca907e22cd93f475c6fab33cc109382 100644
--- a/tests/modules/saml/lib/IdP/SQLNameIDTest.php
+++ b/tests/modules/saml/lib/IdP/SQLNameIDTest.php
@@ -1,11 +1,6 @@
 <?php
 
-/**
- * Test for the SQLNameID helper class.
- *
- * @author Pavel Brousek <brousek@ics.muni.cz>
- * @package SimpleSAMLphp
- */
+declare(strict_types=1);
 
 namespace SimpleSAML\Test\Module\saml\IdP;
 
@@ -15,6 +10,12 @@ use SimpleSAML\Error;
 use SimpleSAML\Module\saml\IdP\SQLNameID;
 use SimpleSAML\Store;
 
+/**
+ * Test for the SQLNameID helper class.
+ *
+ * @author Pavel Brousek <brousek@ics.muni.cz>
+ * @package SimpleSAMLphp
+ */
 class SQLNameIDTest extends TestCase
 {
     /**
diff --git a/tests/routers/configLoader.php b/tests/routers/configLoader.php
index 9133ab10525fe4396af8b00727f235e44af15ae0..b148e80bac67ab9c3380178e28d973aa1dafb2a0 100644
--- a/tests/routers/configLoader.php
+++ b/tests/routers/configLoader.php
@@ -1,5 +1,7 @@
 <?php
 
+declare(strict_types=1);
+
 /*
  * This "router" (a script that's executed for every request received by PHP's built-in web server) will look
  * for a file in the system's temporary directory, with the PID of the current process as its name, and the
diff --git a/tests/www/IndexTest.php b/tests/www/IndexTest.php
index fbfbd75b4d9db6b08b8f5f2727a56302135b98fa..3fe984c2080f8b65a3296bcb83bc3a53bd9e88d5 100644
--- a/tests/www/IndexTest.php
+++ b/tests/www/IndexTest.php
@@ -1,5 +1,7 @@
 <?php
 
+declare(strict_types=1);
+
 namespace SimpleSAML\Test\Web;
 
 use PHPUnit\Framework\TestCase;
diff --git a/tests/www/RouterTest.php b/tests/www/RouterTest.php
index 7b59957433dfb008d017a332c4f05f35f9868b05..0d60eed6db5b50a9c84cec101d6fa033cf71c817 100644
--- a/tests/www/RouterTest.php
+++ b/tests/www/RouterTest.php
@@ -1,5 +1,7 @@
 <?php
 
+declare(strict_types=1);
+
 namespace SimpleSAML\Test\Web;
 
 use PHPUnit\Framework\TestCase;