From c422a14c5cc8eb44d42121fe12421bfa8025ac42 Mon Sep 17 00:00:00 2001
From: Alejandro Celaya <alejandro@alejandrocelaya.com>
Date: Thu, 12 Oct 2017 10:13:20 +0200
Subject: [PATCH] Improved coding styles

---
 composer.json                                 |  1 +
 config/autoload/app_options.global.php        |  2 ++
 config/autoload/dependencies.global.php       |  2 +-
 config/autoload/entity-manager.global.php     |  2 ++
 config/autoload/logger.global.php             |  2 ++
 .../autoload/middleware-pipeline.global.php   |  2 ++
 config/autoload/phpwkhtmltopdf.global.php     |  2 ++
 config/autoload/preview-generation.global.php |  2 ++
 config/autoload/router.global.php             |  2 ++
 config/autoload/templates.global.php          |  1 +
 config/autoload/translator.global.php         |  2 ++
 config/autoload/url-shortener.global.php      |  2 ++
 config/autoload/zend-expressive.global.php    |  1 +
 config/cli-config.php                         |  2 ++
 config/config.php                             |  2 ++
 config/container.php                          |  2 ++
 data/migrations/Version20160819142757.php     |  1 +
 data/migrations/Version20160820191203.php     |  1 +
 module/CLI/config/cli.config.php              |  4 ++-
 module/CLI/config/dependencies.config.php     |  5 ++--
 module/CLI/config/translator.config.php       |  2 ++
 .../CLI/src/Command/Api/DisableKeyCommand.php |  2 ++
 .../src/Command/Api/GenerateKeyCommand.php    |  2 ++
 .../CLI/src/Command/Api/ListKeysCommand.php   |  2 ++
 .../Command/Config/GenerateCharsetCommand.php |  2 ++
 .../Command/Config/GenerateSecretCommand.php  |  2 ++
 .../src/Command/Install/InstallCommand.php    |  2 ++
 .../Shortcode/GeneratePreviewCommand.php      |  2 ++
 .../Shortcode/GenerateShortcodeCommand.php    |  2 ++
 .../Command/Shortcode/GetVisitsCommand.php    |  2 ++
 .../Shortcode/ListShortcodesCommand.php       |  2 ++
 .../Command/Shortcode/ResolveUrlCommand.php   |  2 ++
 .../CLI/src/Command/Tag/CreateTagCommand.php  |  2 ++
 .../CLI/src/Command/Tag/DeleteTagsCommand.php |  2 ++
 .../CLI/src/Command/Tag/ListTagsCommand.php   |  2 ++
 .../CLI/src/Command/Tag/RenameTagCommand.php  |  2 ++
 .../Command/Visit/ProcessVisitsCommand.php    |  2 ++
 module/CLI/src/ConfigProvider.php             |  2 ++
 module/CLI/src/Factory/ApplicationFactory.php |  2 ++
 .../src/Factory/InstallApplicationFactory.php |  2 ++
 .../Install/ConfigCustomizerPluginManager.php |  2 ++
 ...ConfigCustomizerPluginManagerInterface.php |  2 ++
 .../Plugin/AbstractConfigCustomizerPlugin.php |  2 ++
 .../ApplicationConfigCustomizerPlugin.php     |  2 ++
 .../ConfigCustomizerPluginInterface.php       |  2 ++
 .../Plugin/DatabaseConfigCustomizerPlugin.php |  2 ++
 .../DefaultConfigCustomizerPluginFactory.php  |  2 ++
 .../Plugin/LanguageConfigCustomizerPlugin.php |  2 ++
 .../UrlShortenerConfigCustomizerPlugin.php    |  4 ++-
 .../CLI/src/Model/CustomizableAppConfig.php   |  2 ++
 .../Command/Api/DisableKeyCommandTest.php     |  2 ++
 .../Command/Api/GenerateKeyCommandTest.php    |  2 ++
 .../test/Command/Api/ListKeysCommandTest.php  |  2 ++
 .../Config/GenerateCharsetCommandTest.php     |  2 ++
 .../Command/Install/InstallCommandTest.php    |  2 ++
 .../Shortcode/GeneratePreviewCommandTest.php  |  6 +++--
 .../GenerateShortcodeCommandTest.php          |  8 +++---
 .../Shortcode/GetVisitsCommandTest.php        |  2 ++
 .../Shortcode/ListShortcodesCommandTest.php   |  2 ++
 .../Shortcode/ResolveUrlCommandTest.php       |  2 ++
 .../test/Command/Tag/CreateTagCommandTest.php |  2 ++
 .../Command/Tag/DeleteTagsCommandTest.php     |  2 ++
 .../test/Command/Tag/ListTagsCommandTest.php  |  4 ++-
 .../test/Command/Tag/RenameTagCommandTest.php |  2 ++
 .../Visit/ProcessVisitsCommandTest.php        |  2 ++
 module/CLI/test/ConfigProviderTest.php        |  2 ++
 .../test/Factory/ApplicationFactoryTest.php   |  2 ++
 .../Factory/InstallApplicationFactoryTest.php |  2 ++
 .../ApplicationConfigCustomizerPluginTest.php |  2 ++
 .../DatabaseConfigCustomizerPluginTest.php    |  2 ++
 ...faultConfigCustomizerPluginFactoryTest.php |  2 ++
 .../LanguageConfigCustomizerPluginTest.php    |  2 ++
 ...UrlShortenerConfigCustomizerPluginTest.php |  2 ++
 module/Common/config/dependencies.config.php  |  1 +
 module/Common/functions/functions.php         |  2 ++
 module/Common/src/ConfigProvider.php          |  2 ++
 module/Common/src/Entity/AbstractEntity.php   |  2 ++
 .../src/Exception/ExceptionInterface.php      |  2 ++
 .../Exception/InvalidArgumentException.php    |  2 ++
 .../Exception/PreviewGenerationException.php  |  2 ++
 .../Common/src/Exception/RuntimeException.php |  2 ++
 .../Common/src/Exception/WrongIpException.php |  2 ++
 module/Common/src/Factory/CacheFactory.php    |  2 ++
 .../DottedAccessConfigAbstractFactory.php     |  2 ++
 ...sponseImplicitOptionsMiddlewareFactory.php |  2 ++
 .../src/Factory/EntityManagerFactory.php      |  2 ++
 module/Common/src/Factory/LoggerFactory.php   |  2 ++
 .../Common/src/Factory/TranslatorFactory.php  |  2 ++
 module/Common/src/Image/ImageBuilder.php      |  2 ++
 .../Common/src/Image/ImageBuilderFactory.php  |  2 ++
 .../src/Image/ImageBuilderInterface.php       |  2 ++
 module/Common/src/Image/ImageFactory.php      |  2 ++
 .../src/Middleware/LocaleMiddleware.php       |  2 ++
 .../Adapter/PaginableRepositoryAdapter.php    |  4 ++-
 .../Paginator/Util/PaginatorUtilsTrait.php    |  2 ++
 .../PaginableRepositoryInterface.php          |  2 ++
 module/Common/src/Response/QrCodeResponse.php |  2 ++
 .../Common/src/Service/IpLocationResolver.php |  4 ++-
 .../Service/IpLocationResolverInterface.php   |  2 ++
 .../Common/src/Service/PreviewGenerator.php   |  2 ++
 .../src/Service/PreviewGeneratorInterface.php |  2 ++
 .../Extension/TranslatorExtension.php         |  2 ++
 module/Common/src/Util/DateRange.php          |  2 ++
 module/Common/src/Util/ResponseUtilsTrait.php |  2 ++
 module/Common/src/Util/StringUtilsTrait.php   |  2 ++
 module/Common/test/ConfigProviderTest.php     |  2 ++
 .../Common/test/Factory/CacheFactoryTest.php  |  6 +++--
 ...seImplicitOptionsMiddlewareFactoryTest.php |  2 ++
 .../test/Factory/EntityManagerFactoryTest.php |  2 ++
 .../Common/test/Factory/LoggerFactoryTest.php |  2 ++
 .../test/Factory/TranslatorFactoryTest.php    |  2 ++
 .../test/Image/ImageBuilderFactoryTest.php    |  2 ++
 module/Common/test/Image/ImageFactoryTest.php |  2 ++
 .../test/Middleware/LocaleMiddlewareTest.php  |  2 ++
 .../PaginableRepositoryAdapterTest.php        |  2 ++
 .../test/Service/IpLocationResolverTest.php   |  2 ++
 .../test/Service/PreviewGeneratorTest.php     |  4 ++-
 .../Extension/TranslatorExtensionTest.php     |  2 ++
 module/Common/test/Util/DateRangeTest.php     |  2 ++
 module/Common/test/Util/TestUtils.php         |  2 ++
 module/Core/config/app_options.config.php     |  2 ++
 module/Core/config/dependencies.config.php    |  1 +
 module/Core/config/entity-manager.config.php  |  2 ++
 module/Core/config/routes.config.php          |  2 ++
 module/Core/config/templates.config.php       |  1 +
 module/Core/config/translator.config.php      |  2 ++
 module/Core/config/zend-expressive.config.php |  1 +
 module/Core/src/Action/PreviewAction.php      |  2 ++
 module/Core/src/Action/QrCodeAction.php       |  2 ++
 module/Core/src/Action/RedirectAction.php     |  2 ++
 module/Core/src/ConfigProvider.php            |  2 ++
 module/Core/src/Entity/ShortUrl.php           |  2 ++
 module/Core/src/Entity/Tag.php                |  2 ++
 module/Core/src/Entity/Visit.php              |  2 ++
 module/Core/src/Entity/VisitLocation.php      |  4 ++-
 .../Exception/EntityDoesNotExistException.php |  2 ++
 .../Exception/InvalidShortCodeException.php   |  2 ++
 .../src/Exception/InvalidUrlException.php     |  2 ++
 .../src/Middleware/QrCodeCacheMiddleware.php  |  2 ++
 module/Core/src/Options/AppOptions.php        |  2 ++
 module/Core/src/Options/AppOptionsFactory.php |  2 ++
 .../src/Repository/ShortUrlRepository.php     |  2 ++
 .../ShortUrlRepositoryInterface.php           |  2 ++
 module/Core/src/Repository/TagRepository.php  |  2 ++
 .../src/Repository/TagRepositoryInterface.php |  2 ++
 .../Core/src/Repository/VisitRepository.php   |  2 ++
 .../Repository/VisitRepositoryInterface.php   |  2 ++
 module/Core/src/Service/ShortUrlService.php   |  2 ++
 .../src/Service/ShortUrlServiceInterface.php  |  2 ++
 module/Core/src/Service/Tag/TagService.php    |  2 ++
 .../src/Service/Tag/TagServiceInterface.php   |  2 ++
 module/Core/src/Service/UrlShortener.php      |  4 ++-
 .../src/Service/UrlShortenerInterface.php     |  2 ++
 module/Core/src/Service/VisitService.php      |  2 ++
 .../src/Service/VisitServiceInterface.php     |  2 ++
 module/Core/src/Service/VisitsTracker.php     |  2 ++
 .../src/Service/VisitsTrackerInterface.php    |  2 ++
 module/Core/src/Util/TagManagerTrait.php      |  2 ++
 module/Core/test/Action/PreviewActionTest.php |  2 ++
 module/Core/test/Action/QrCodeActionTest.php  |  2 ++
 .../Core/test/Action/RedirectActionTest.php   |  2 ++
 module/Core/test/ConfigProviderTest.php       |  2 ++
 module/Core/test/Entity/TagTest.php           |  2 ++
 .../Middleware/QrCodeCacheMiddlewareTest.php  |  2 ++
 .../test/Options/AppOptionsFactoryTest.php    |  2 ++
 .../Core/test/Service/ShortUrlServiceTest.php |  2 ++
 .../Core/test/Service/Tag/TagServiceTest.php  |  4 ++-
 module/Core/test/Service/UrlShortenerTest.php |  2 ++
 module/Core/test/Service/VisitServiceTest.php |  2 ++
 .../Core/test/Service/VisitsTrackerTest.php   |  2 ++
 module/Rest/config/dependencies.config.php    |  3 ++-
 module/Rest/config/entity-manager.config.php  |  2 ++
 module/Rest/config/error-handler.config.php   |  2 ++
 module/Rest/config/routes.config.php          |  4 ++-
 module/Rest/config/translator.config.php      |  2 ++
 module/Rest/src/Action/AbstractRestAction.php |  2 ++
 module/Rest/src/Action/AuthenticateAction.php |  2 ++
 .../Rest/src/Action/CreateShortcodeAction.php |  2 ++
 .../src/Action/EditShortcodeTagsAction.php    |  2 ++
 module/Rest/src/Action/GetVisitsAction.php    |  8 +++---
 .../Rest/src/Action/ListShortcodesAction.php  |  2 ++
 module/Rest/src/Action/ResolveUrlAction.php   |  2 ++
 .../Rest/src/Action/Tag/CreateTagsAction.php  |  2 ++
 .../Rest/src/Action/Tag/DeleteTagsAction.php  |  2 ++
 module/Rest/src/Action/Tag/ListTagsAction.php |  2 ++
 .../Rest/src/Action/Tag/UpdateTagAction.php   |  2 ++
 module/Rest/src/Authentication/JWTService.php |  2 ++
 .../Authentication/JWTServiceInterface.php    |  2 ++
 module/Rest/src/ConfigProvider.php            |  2 ++
 module/Rest/src/Entity/ApiKey.php             |  2 ++
 .../JsonErrorResponseGenerator.php            |  3 ++-
 .../src/Exception/AuthenticationException.php |  2 ++
 .../src/Middleware/BodyParserMiddleware.php   |  4 ++-
 .../CheckAuthenticationMiddleware.php         |  2 ++
 .../src/Middleware/CrossDomainMiddleware.php  |  2 ++
 .../src/Middleware/PathVersionMiddleware.php  |  2 ++
 module/Rest/src/Service/ApiKeyService.php     |  2 ++
 .../src/Service/ApiKeyServiceInterface.php    |  2 ++
 module/Rest/src/Util/RestUtils.php            |  2 ++
 .../test/Action/AuthenticateActionTest.php    |  2 ++
 .../test/Action/CreateShortcodeActionTest.php |  2 ++
 .../Action/EditShortcodeTagsActionTest.php    |  2 ++
 .../Rest/test/Action/GetVisitsActionTest.php  |  2 ++
 .../test/Action/ListShortcodesActionTest.php  |  2 ++
 .../Rest/test/Action/ResolveUrlActionTest.php |  2 ++
 .../test/Action/Tag/CreateTagsActionTest.php  |  2 ++
 .../test/Action/Tag/DeleteTagsActionTest.php  |  2 ++
 .../test/Action/Tag/ListTagsActionTest.php    |  2 ++
 .../test/Action/Tag/UpdateTagActionTest.php   |  2 ++
 .../test/Authentication/JWTServiceTest.php    |  2 ++
 module/Rest/test/ConfigProviderTest.php       |  2 ++
 .../JsonErrorResponseGeneratorTest.php        |  2 ++
 .../Middleware/BodyParserMiddlewareTest.php   |  2 ++
 .../CheckAuthenticationMiddlewareTest.php     |  2 ++
 .../Middleware/CrossDomainMiddlewareTest.php  |  2 ++
 .../Middleware/PathVersionMiddlewareTest.php  |  2 ++
 .../Rest/test/Service/ApiKeyServiceTest.php   |  2 ++
 module/Rest/test/Util/RestUtilsTest.php       |  2 ++
 phpcs.xml                                     | 25 +++++++++++++++++++
 219 files changed, 473 insertions(+), 26 deletions(-)

diff --git a/composer.json b/composer.json
index 1f1d5303..d58a88aa 100644
--- a/composer.json
+++ b/composer.json
@@ -46,6 +46,7 @@
     "require-dev": {
         "filp/whoops": "^2.0",
         "phpunit/phpunit": "^6.0",
+        "slevomat/coding-standard": "^4.0",
         "squizlabs/php_codesniffer": "^3.1",
         "symfony/var-dumper": "^3.0",
         "vlucas/phpdotenv": "^2.2",
diff --git a/config/autoload/app_options.global.php b/config/autoload/app_options.global.php
index fd7147a1..0f8163bf 100644
--- a/config/autoload/app_options.global.php
+++ b/config/autoload/app_options.global.php
@@ -1,4 +1,6 @@
 <?php
+declare(strict_types=1);
+
 use Shlinkio\Shlink\Common;
 
 return [
diff --git a/config/autoload/dependencies.global.php b/config/autoload/dependencies.global.php
index c918544d..ad7ff750 100644
--- a/config/autoload/dependencies.global.php
+++ b/config/autoload/dependencies.global.php
@@ -4,11 +4,11 @@ declare(strict_types=1);
 use Shlinkio\Shlink\Common\Factory\EmptyResponseImplicitOptionsMiddlewareFactory;
 use Zend\Expressive;
 use Zend\Expressive\Container;
+use Zend\Expressive\Helper;
 use Zend\Expressive\Middleware;
 use Zend\Expressive\Plates;
 use Zend\Expressive\Router;
 use Zend\Expressive\Template;
-use Zend\Expressive\Helper;
 use Zend\ServiceManager\Factory\InvokableFactory;
 use Zend\Stratigility\Middleware\ErrorHandler;
 
diff --git a/config/autoload/entity-manager.global.php b/config/autoload/entity-manager.global.php
index 803eb8ff..89961f77 100644
--- a/config/autoload/entity-manager.global.php
+++ b/config/autoload/entity-manager.global.php
@@ -1,4 +1,6 @@
 <?php
+declare(strict_types=1);
+
 use Shlinkio\Shlink\Common;
 
 return [
diff --git a/config/autoload/logger.global.php b/config/autoload/logger.global.php
index 2a56bdad..89210706 100644
--- a/config/autoload/logger.global.php
+++ b/config/autoload/logger.global.php
@@ -1,4 +1,6 @@
 <?php
+declare(strict_types=1);
+
 use Monolog\Handler\RotatingFileHandler;
 use Monolog\Logger;
 
diff --git a/config/autoload/middleware-pipeline.global.php b/config/autoload/middleware-pipeline.global.php
index bf81f13e..66c22f08 100644
--- a/config/autoload/middleware-pipeline.global.php
+++ b/config/autoload/middleware-pipeline.global.php
@@ -1,4 +1,6 @@
 <?php
+declare(strict_types=1);
+
 use Shlinkio\Shlink\Common\Middleware\LocaleMiddleware;
 use Shlinkio\Shlink\Rest\Middleware\BodyParserMiddleware;
 use Shlinkio\Shlink\Rest\Middleware\CheckAuthenticationMiddleware;
diff --git a/config/autoload/phpwkhtmltopdf.global.php b/config/autoload/phpwkhtmltopdf.global.php
index f7c29f16..326b846f 100644
--- a/config/autoload/phpwkhtmltopdf.global.php
+++ b/config/autoload/phpwkhtmltopdf.global.php
@@ -1,4 +1,6 @@
 <?php
+declare(strict_types=1);
+
 return [
 
     'phpwkhtmltopdf' => [
diff --git a/config/autoload/preview-generation.global.php b/config/autoload/preview-generation.global.php
index b4f14da3..4a4fa9d1 100644
--- a/config/autoload/preview-generation.global.php
+++ b/config/autoload/preview-generation.global.php
@@ -1,4 +1,6 @@
 <?php
+declare(strict_types=1);
+
 return [
 
     'preview_generation' => [
diff --git a/config/autoload/router.global.php b/config/autoload/router.global.php
index fb026248..deb875f3 100644
--- a/config/autoload/router.global.php
+++ b/config/autoload/router.global.php
@@ -1,4 +1,6 @@
 <?php
+declare(strict_types=1);
+
 use Zend\Expressive\Router\FastRouteRouter;
 
 return [
diff --git a/config/autoload/templates.global.php b/config/autoload/templates.global.php
index 24296d41..29c0f4bc 100644
--- a/config/autoload/templates.global.php
+++ b/config/autoload/templates.global.php
@@ -1,4 +1,5 @@
 <?php
+declare(strict_types=1);
 
 return [
 
diff --git a/config/autoload/translator.global.php b/config/autoload/translator.global.php
index 2ce6bb44..2b03058c 100644
--- a/config/autoload/translator.global.php
+++ b/config/autoload/translator.global.php
@@ -1,4 +1,6 @@
 <?php
+declare(strict_types=1);
+
 use Shlinkio\Shlink\Common;
 
 return [
diff --git a/config/autoload/url-shortener.global.php b/config/autoload/url-shortener.global.php
index f17d192d..919f4d3f 100644
--- a/config/autoload/url-shortener.global.php
+++ b/config/autoload/url-shortener.global.php
@@ -1,4 +1,6 @@
 <?php
+declare(strict_types=1);
+
 use Shlinkio\Shlink\Common;
 use Shlinkio\Shlink\Core\Service\UrlShortener;
 
diff --git a/config/autoload/zend-expressive.global.php b/config/autoload/zend-expressive.global.php
index aa2e9d3b..9a6e582e 100644
--- a/config/autoload/zend-expressive.global.php
+++ b/config/autoload/zend-expressive.global.php
@@ -1,4 +1,5 @@
 <?php
+declare(strict_types=1);
 
 return [
 
diff --git a/config/cli-config.php b/config/cli-config.php
index 30e31a93..fefcca28 100644
--- a/config/cli-config.php
+++ b/config/cli-config.php
@@ -1,4 +1,6 @@
 <?php
+declare(strict_types=1);
+
 use Doctrine\ORM\EntityManager;
 use Doctrine\ORM\Tools\Console\ConsoleRunner;
 use Interop\Container\ContainerInterface;
diff --git a/config/config.php b/config/config.php
index 32644060..470aec64 100644
--- a/config/config.php
+++ b/config/config.php
@@ -1,4 +1,6 @@
 <?php
+declare(strict_types=1);
+
 use Acelaya\ExpressiveErrorHandler;
 use Shlinkio\Shlink\CLI;
 use Shlinkio\Shlink\Common;
diff --git a/config/container.php b/config/container.php
index cbc84db5..85cb0886 100644
--- a/config/container.php
+++ b/config/container.php
@@ -1,4 +1,6 @@
 <?php
+declare(strict_types=1);
+
 use Dotenv\Dotenv;
 use Zend\ServiceManager\ServiceManager;
 
diff --git a/data/migrations/Version20160819142757.php b/data/migrations/Version20160819142757.php
index 40200c53..cd6a3f5a 100644
--- a/data/migrations/Version20160819142757.php
+++ b/data/migrations/Version20160819142757.php
@@ -1,4 +1,5 @@
 <?php
+declare(strict_types=1);
 
 namespace ShlinkMigrations;
 
diff --git a/data/migrations/Version20160820191203.php b/data/migrations/Version20160820191203.php
index 29e81040..44ccf9c3 100644
--- a/data/migrations/Version20160820191203.php
+++ b/data/migrations/Version20160820191203.php
@@ -1,4 +1,5 @@
 <?php
+declare(strict_types=1);
 
 namespace ShlinkMigrations;
 
diff --git a/module/CLI/config/cli.config.php b/module/CLI/config/cli.config.php
index a1a34c16..be1bda6b 100644
--- a/module/CLI/config/cli.config.php
+++ b/module/CLI/config/cli.config.php
@@ -1,4 +1,6 @@
 <?php
+declare(strict_types=1);
+
 use Shlinkio\Shlink\CLI\Command;
 use Shlinkio\Shlink\Common;
 
@@ -22,7 +24,7 @@ return [
             Command\Tag\CreateTagCommand::class,
             Command\Tag\RenameTagCommand::class,
             Command\Tag\DeleteTagsCommand::class,
-        ]
+        ],
     ],
 
 ];
diff --git a/module/CLI/config/dependencies.config.php b/module/CLI/config/dependencies.config.php
index 641b58db..6f692af7 100644
--- a/module/CLI/config/dependencies.config.php
+++ b/module/CLI/config/dependencies.config.php
@@ -1,4 +1,5 @@
 <?php
+declare(strict_types=1);
 
 use Shlinkio\Shlink\CLI\Command;
 use Shlinkio\Shlink\CLI\Factory\ApplicationFactory;
@@ -46,12 +47,12 @@ return [
         Command\Shortcode\GeneratePreviewCommand::class => [
             Service\ShortUrlService::class,
             PreviewGenerator::class,
-            'translator'
+            'translator',
         ],
         Command\Visit\ProcessVisitsCommand::class => [
             Service\VisitService::class,
             IpLocationResolver::class,
-            'translator'
+            'translator',
         ],
         Command\Config\GenerateCharsetCommand::class => ['translator'],
         Command\Config\GenerateSecretCommand::class => ['translator'],
diff --git a/module/CLI/config/translator.config.php b/module/CLI/config/translator.config.php
index ae120db3..659d4cae 100644
--- a/module/CLI/config/translator.config.php
+++ b/module/CLI/config/translator.config.php
@@ -1,4 +1,6 @@
 <?php
+declare(strict_types=1);
+
 return [
 
     'translator' => [
diff --git a/module/CLI/src/Command/Api/DisableKeyCommand.php b/module/CLI/src/Command/Api/DisableKeyCommand.php
index fbf02992..e4390203 100644
--- a/module/CLI/src/Command/Api/DisableKeyCommand.php
+++ b/module/CLI/src/Command/Api/DisableKeyCommand.php
@@ -1,4 +1,6 @@
 <?php
+declare(strict_types=1);
+
 namespace Shlinkio\Shlink\CLI\Command\Api;
 
 use Shlinkio\Shlink\Rest\Service\ApiKeyServiceInterface;
diff --git a/module/CLI/src/Command/Api/GenerateKeyCommand.php b/module/CLI/src/Command/Api/GenerateKeyCommand.php
index 7d436669..27006ceb 100644
--- a/module/CLI/src/Command/Api/GenerateKeyCommand.php
+++ b/module/CLI/src/Command/Api/GenerateKeyCommand.php
@@ -1,4 +1,6 @@
 <?php
+declare(strict_types=1);
+
 namespace Shlinkio\Shlink\CLI\Command\Api;
 
 use Shlinkio\Shlink\Rest\Service\ApiKeyServiceInterface;
diff --git a/module/CLI/src/Command/Api/ListKeysCommand.php b/module/CLI/src/Command/Api/ListKeysCommand.php
index 8be23ec1..a32c9160 100644
--- a/module/CLI/src/Command/Api/ListKeysCommand.php
+++ b/module/CLI/src/Command/Api/ListKeysCommand.php
@@ -1,4 +1,6 @@
 <?php
+declare(strict_types=1);
+
 namespace Shlinkio\Shlink\CLI\Command\Api;
 
 use Shlinkio\Shlink\Rest\Entity\ApiKey;
diff --git a/module/CLI/src/Command/Config/GenerateCharsetCommand.php b/module/CLI/src/Command/Config/GenerateCharsetCommand.php
index bf0f2b6d..189dedf3 100644
--- a/module/CLI/src/Command/Config/GenerateCharsetCommand.php
+++ b/module/CLI/src/Command/Config/GenerateCharsetCommand.php
@@ -1,4 +1,6 @@
 <?php
+declare(strict_types=1);
+
 namespace Shlinkio\Shlink\CLI\Command\Config;
 
 use Shlinkio\Shlink\Core\Service\UrlShortener;
diff --git a/module/CLI/src/Command/Config/GenerateSecretCommand.php b/module/CLI/src/Command/Config/GenerateSecretCommand.php
index e27bf751..6bb1e232 100644
--- a/module/CLI/src/Command/Config/GenerateSecretCommand.php
+++ b/module/CLI/src/Command/Config/GenerateSecretCommand.php
@@ -1,4 +1,6 @@
 <?php
+declare(strict_types=1);
+
 namespace Shlinkio\Shlink\CLI\Command\Config;
 
 use Shlinkio\Shlink\Common\Util\StringUtilsTrait;
diff --git a/module/CLI/src/Command/Install/InstallCommand.php b/module/CLI/src/Command/Install/InstallCommand.php
index 93de4305..6658678d 100644
--- a/module/CLI/src/Command/Install/InstallCommand.php
+++ b/module/CLI/src/Command/Install/InstallCommand.php
@@ -1,4 +1,6 @@
 <?php
+declare(strict_types=1);
+
 namespace Shlinkio\Shlink\CLI\Command\Install;
 
 use Shlinkio\Shlink\CLI\Install\ConfigCustomizerPluginManagerInterface;
diff --git a/module/CLI/src/Command/Shortcode/GeneratePreviewCommand.php b/module/CLI/src/Command/Shortcode/GeneratePreviewCommand.php
index 68b7189e..23579931 100644
--- a/module/CLI/src/Command/Shortcode/GeneratePreviewCommand.php
+++ b/module/CLI/src/Command/Shortcode/GeneratePreviewCommand.php
@@ -1,4 +1,6 @@
 <?php
+declare(strict_types=1);
+
 namespace Shlinkio\Shlink\CLI\Command\Shortcode;
 
 use Shlinkio\Shlink\Common\Exception\PreviewGenerationException;
diff --git a/module/CLI/src/Command/Shortcode/GenerateShortcodeCommand.php b/module/CLI/src/Command/Shortcode/GenerateShortcodeCommand.php
index 4111d294..9677c466 100644
--- a/module/CLI/src/Command/Shortcode/GenerateShortcodeCommand.php
+++ b/module/CLI/src/Command/Shortcode/GenerateShortcodeCommand.php
@@ -1,4 +1,6 @@
 <?php
+declare(strict_types=1);
+
 namespace Shlinkio\Shlink\CLI\Command\Shortcode;
 
 use Shlinkio\Shlink\Core\Exception\InvalidUrlException;
diff --git a/module/CLI/src/Command/Shortcode/GetVisitsCommand.php b/module/CLI/src/Command/Shortcode/GetVisitsCommand.php
index fe21f1d5..40192dde 100644
--- a/module/CLI/src/Command/Shortcode/GetVisitsCommand.php
+++ b/module/CLI/src/Command/Shortcode/GetVisitsCommand.php
@@ -1,4 +1,6 @@
 <?php
+declare(strict_types=1);
+
 namespace Shlinkio\Shlink\CLI\Command\Shortcode;
 
 use Shlinkio\Shlink\Common\Util\DateRange;
diff --git a/module/CLI/src/Command/Shortcode/ListShortcodesCommand.php b/module/CLI/src/Command/Shortcode/ListShortcodesCommand.php
index 1c8e17f8..4d402522 100644
--- a/module/CLI/src/Command/Shortcode/ListShortcodesCommand.php
+++ b/module/CLI/src/Command/Shortcode/ListShortcodesCommand.php
@@ -1,4 +1,6 @@
 <?php
+declare(strict_types=1);
+
 namespace Shlinkio\Shlink\CLI\Command\Shortcode;
 
 use Shlinkio\Shlink\Common\Paginator\Adapter\PaginableRepositoryAdapter;
diff --git a/module/CLI/src/Command/Shortcode/ResolveUrlCommand.php b/module/CLI/src/Command/Shortcode/ResolveUrlCommand.php
index 3344b7af..e5b53c23 100644
--- a/module/CLI/src/Command/Shortcode/ResolveUrlCommand.php
+++ b/module/CLI/src/Command/Shortcode/ResolveUrlCommand.php
@@ -1,4 +1,6 @@
 <?php
+declare(strict_types=1);
+
 namespace Shlinkio\Shlink\CLI\Command\Shortcode;
 
 use Shlinkio\Shlink\Core\Exception\InvalidShortCodeException;
diff --git a/module/CLI/src/Command/Tag/CreateTagCommand.php b/module/CLI/src/Command/Tag/CreateTagCommand.php
index 530ee569..183dbe51 100644
--- a/module/CLI/src/Command/Tag/CreateTagCommand.php
+++ b/module/CLI/src/Command/Tag/CreateTagCommand.php
@@ -1,4 +1,6 @@
 <?php
+declare(strict_types=1);
+
 namespace Shlinkio\Shlink\CLI\Command\Tag;
 
 use Shlinkio\Shlink\Core\Service\Tag\TagServiceInterface;
diff --git a/module/CLI/src/Command/Tag/DeleteTagsCommand.php b/module/CLI/src/Command/Tag/DeleteTagsCommand.php
index 394eac40..de7cf5f4 100644
--- a/module/CLI/src/Command/Tag/DeleteTagsCommand.php
+++ b/module/CLI/src/Command/Tag/DeleteTagsCommand.php
@@ -1,4 +1,6 @@
 <?php
+declare(strict_types=1);
+
 namespace Shlinkio\Shlink\CLI\Command\Tag;
 
 use Shlinkio\Shlink\Core\Service\Tag\TagServiceInterface;
diff --git a/module/CLI/src/Command/Tag/ListTagsCommand.php b/module/CLI/src/Command/Tag/ListTagsCommand.php
index 97037406..44a3f48e 100644
--- a/module/CLI/src/Command/Tag/ListTagsCommand.php
+++ b/module/CLI/src/Command/Tag/ListTagsCommand.php
@@ -1,4 +1,6 @@
 <?php
+declare(strict_types=1);
+
 namespace Shlinkio\Shlink\CLI\Command\Tag;
 
 use Shlinkio\Shlink\Core\Entity\Tag;
diff --git a/module/CLI/src/Command/Tag/RenameTagCommand.php b/module/CLI/src/Command/Tag/RenameTagCommand.php
index 89f267d3..d5473369 100644
--- a/module/CLI/src/Command/Tag/RenameTagCommand.php
+++ b/module/CLI/src/Command/Tag/RenameTagCommand.php
@@ -1,4 +1,6 @@
 <?php
+declare(strict_types=1);
+
 namespace Shlinkio\Shlink\CLI\Command\Tag;
 
 use Shlinkio\Shlink\Core\Exception\EntityDoesNotExistException;
diff --git a/module/CLI/src/Command/Visit/ProcessVisitsCommand.php b/module/CLI/src/Command/Visit/ProcessVisitsCommand.php
index 8b4f82a8..51adc356 100644
--- a/module/CLI/src/Command/Visit/ProcessVisitsCommand.php
+++ b/module/CLI/src/Command/Visit/ProcessVisitsCommand.php
@@ -1,4 +1,6 @@
 <?php
+declare(strict_types=1);
+
 namespace Shlinkio\Shlink\CLI\Command\Visit;
 
 use Shlinkio\Shlink\Common\Exception\WrongIpException;
diff --git a/module/CLI/src/ConfigProvider.php b/module/CLI/src/ConfigProvider.php
index a35c98b6..ba3a5747 100644
--- a/module/CLI/src/ConfigProvider.php
+++ b/module/CLI/src/ConfigProvider.php
@@ -1,4 +1,6 @@
 <?php
+declare(strict_types=1);
+
 namespace Shlinkio\Shlink\CLI;
 
 use Zend\Config\Factory;
diff --git a/module/CLI/src/Factory/ApplicationFactory.php b/module/CLI/src/Factory/ApplicationFactory.php
index d13cce7c..71278dac 100644
--- a/module/CLI/src/Factory/ApplicationFactory.php
+++ b/module/CLI/src/Factory/ApplicationFactory.php
@@ -1,4 +1,6 @@
 <?php
+declare(strict_types=1);
+
 namespace Shlinkio\Shlink\CLI\Factory;
 
 use Interop\Container\ContainerInterface;
diff --git a/module/CLI/src/Factory/InstallApplicationFactory.php b/module/CLI/src/Factory/InstallApplicationFactory.php
index 387b2321..b1fc589b 100644
--- a/module/CLI/src/Factory/InstallApplicationFactory.php
+++ b/module/CLI/src/Factory/InstallApplicationFactory.php
@@ -1,4 +1,6 @@
 <?php
+declare(strict_types=1);
+
 namespace Shlinkio\Shlink\CLI\Factory;
 
 use Interop\Container\ContainerInterface;
diff --git a/module/CLI/src/Install/ConfigCustomizerPluginManager.php b/module/CLI/src/Install/ConfigCustomizerPluginManager.php
index c8f0e7cb..45f2da9a 100644
--- a/module/CLI/src/Install/ConfigCustomizerPluginManager.php
+++ b/module/CLI/src/Install/ConfigCustomizerPluginManager.php
@@ -1,4 +1,6 @@
 <?php
+declare(strict_types=1);
+
 namespace Shlinkio\Shlink\CLI\Install;
 
 use Shlinkio\Shlink\CLI\Install\Plugin\ConfigCustomizerPluginInterface;
diff --git a/module/CLI/src/Install/ConfigCustomizerPluginManagerInterface.php b/module/CLI/src/Install/ConfigCustomizerPluginManagerInterface.php
index 38ed04d1..3085a75b 100644
--- a/module/CLI/src/Install/ConfigCustomizerPluginManagerInterface.php
+++ b/module/CLI/src/Install/ConfigCustomizerPluginManagerInterface.php
@@ -1,4 +1,6 @@
 <?php
+declare(strict_types=1);
+
 namespace Shlinkio\Shlink\CLI\Install;
 
 use Psr\Container\ContainerInterface;
diff --git a/module/CLI/src/Install/Plugin/AbstractConfigCustomizerPlugin.php b/module/CLI/src/Install/Plugin/AbstractConfigCustomizerPlugin.php
index 05e3336a..224674d9 100644
--- a/module/CLI/src/Install/Plugin/AbstractConfigCustomizerPlugin.php
+++ b/module/CLI/src/Install/Plugin/AbstractConfigCustomizerPlugin.php
@@ -1,4 +1,6 @@
 <?php
+declare(strict_types=1);
+
 namespace Shlinkio\Shlink\CLI\Install\Plugin;
 
 use Symfony\Component\Console\Exception\RuntimeException;
diff --git a/module/CLI/src/Install/Plugin/ApplicationConfigCustomizerPlugin.php b/module/CLI/src/Install/Plugin/ApplicationConfigCustomizerPlugin.php
index 936381b0..b1bf6436 100644
--- a/module/CLI/src/Install/Plugin/ApplicationConfigCustomizerPlugin.php
+++ b/module/CLI/src/Install/Plugin/ApplicationConfigCustomizerPlugin.php
@@ -1,4 +1,6 @@
 <?php
+declare(strict_types=1);
+
 namespace Shlinkio\Shlink\CLI\Install\Plugin;
 
 use Shlinkio\Shlink\CLI\Model\CustomizableAppConfig;
diff --git a/module/CLI/src/Install/Plugin/ConfigCustomizerPluginInterface.php b/module/CLI/src/Install/Plugin/ConfigCustomizerPluginInterface.php
index 2f1c60e1..5ad702fb 100644
--- a/module/CLI/src/Install/Plugin/ConfigCustomizerPluginInterface.php
+++ b/module/CLI/src/Install/Plugin/ConfigCustomizerPluginInterface.php
@@ -1,4 +1,6 @@
 <?php
+declare(strict_types=1);
+
 namespace Shlinkio\Shlink\CLI\Install\Plugin;
 
 use Shlinkio\Shlink\CLI\Model\CustomizableAppConfig;
diff --git a/module/CLI/src/Install/Plugin/DatabaseConfigCustomizerPlugin.php b/module/CLI/src/Install/Plugin/DatabaseConfigCustomizerPlugin.php
index abb2e192..62c81c8f 100644
--- a/module/CLI/src/Install/Plugin/DatabaseConfigCustomizerPlugin.php
+++ b/module/CLI/src/Install/Plugin/DatabaseConfigCustomizerPlugin.php
@@ -1,4 +1,6 @@
 <?php
+declare(strict_types=1);
+
 namespace Shlinkio\Shlink\CLI\Install\Plugin;
 
 use Acelaya\ZsmAnnotatedServices\Annotation as DI;
diff --git a/module/CLI/src/Install/Plugin/Factory/DefaultConfigCustomizerPluginFactory.php b/module/CLI/src/Install/Plugin/Factory/DefaultConfigCustomizerPluginFactory.php
index 78e5a87a..6e1ea7a0 100644
--- a/module/CLI/src/Install/Plugin/Factory/DefaultConfigCustomizerPluginFactory.php
+++ b/module/CLI/src/Install/Plugin/Factory/DefaultConfigCustomizerPluginFactory.php
@@ -1,4 +1,6 @@
 <?php
+declare(strict_types=1);
+
 namespace Shlinkio\Shlink\CLI\Install\Plugin\Factory;
 
 use Interop\Container\ContainerInterface;
diff --git a/module/CLI/src/Install/Plugin/LanguageConfigCustomizerPlugin.php b/module/CLI/src/Install/Plugin/LanguageConfigCustomizerPlugin.php
index 91b5c7ec..83fbe7ad 100644
--- a/module/CLI/src/Install/Plugin/LanguageConfigCustomizerPlugin.php
+++ b/module/CLI/src/Install/Plugin/LanguageConfigCustomizerPlugin.php
@@ -1,4 +1,6 @@
 <?php
+declare(strict_types=1);
+
 namespace Shlinkio\Shlink\CLI\Install\Plugin;
 
 use Shlinkio\Shlink\CLI\Model\CustomizableAppConfig;
diff --git a/module/CLI/src/Install/Plugin/UrlShortenerConfigCustomizerPlugin.php b/module/CLI/src/Install/Plugin/UrlShortenerConfigCustomizerPlugin.php
index ac9c32e9..82c96ff3 100644
--- a/module/CLI/src/Install/Plugin/UrlShortenerConfigCustomizerPlugin.php
+++ b/module/CLI/src/Install/Plugin/UrlShortenerConfigCustomizerPlugin.php
@@ -1,4 +1,6 @@
 <?php
+declare(strict_types=1);
+
 namespace Shlinkio\Shlink\CLI\Install\Plugin;
 
 use Shlinkio\Shlink\CLI\Model\CustomizableAppConfig;
@@ -42,7 +44,7 @@ class UrlShortenerConfigCustomizerPlugin extends AbstractConfigCustomizerPlugin
                 'Character set for generated short codes (leave empty to autogenerate one)',
                 null,
                 true
-            ) ?: str_shuffle(UrlShortener::DEFAULT_CHARS)
+            ) ?: str_shuffle(UrlShortener::DEFAULT_CHARS),
         ]);
     }
 }
diff --git a/module/CLI/src/Model/CustomizableAppConfig.php b/module/CLI/src/Model/CustomizableAppConfig.php
index 03836e0f..3db3f94d 100644
--- a/module/CLI/src/Model/CustomizableAppConfig.php
+++ b/module/CLI/src/Model/CustomizableAppConfig.php
@@ -1,4 +1,6 @@
 <?php
+declare(strict_types=1);
+
 namespace Shlinkio\Shlink\CLI\Model;
 
 use Zend\Stdlib\ArraySerializableInterface;
diff --git a/module/CLI/test/Command/Api/DisableKeyCommandTest.php b/module/CLI/test/Command/Api/DisableKeyCommandTest.php
index c265b3dd..f577f298 100644
--- a/module/CLI/test/Command/Api/DisableKeyCommandTest.php
+++ b/module/CLI/test/Command/Api/DisableKeyCommandTest.php
@@ -1,4 +1,6 @@
 <?php
+declare(strict_types=1);
+
 namespace ShlinkioTest\Shlink\CLI\Command\Api;
 
 use PHPUnit\Framework\TestCase;
diff --git a/module/CLI/test/Command/Api/GenerateKeyCommandTest.php b/module/CLI/test/Command/Api/GenerateKeyCommandTest.php
index bb6aaa63..7c9482f7 100644
--- a/module/CLI/test/Command/Api/GenerateKeyCommandTest.php
+++ b/module/CLI/test/Command/Api/GenerateKeyCommandTest.php
@@ -1,4 +1,6 @@
 <?php
+declare(strict_types=1);
+
 namespace ShlinkioTest\Shlink\CLI\Command\Api;
 
 use PHPUnit\Framework\TestCase;
diff --git a/module/CLI/test/Command/Api/ListKeysCommandTest.php b/module/CLI/test/Command/Api/ListKeysCommandTest.php
index aca93019..1bceb5e5 100644
--- a/module/CLI/test/Command/Api/ListKeysCommandTest.php
+++ b/module/CLI/test/Command/Api/ListKeysCommandTest.php
@@ -1,4 +1,6 @@
 <?php
+declare(strict_types=1);
+
 namespace ShlinkioTest\Shlink\CLI\Command\Api;
 
 use PHPUnit\Framework\TestCase;
diff --git a/module/CLI/test/Command/Config/GenerateCharsetCommandTest.php b/module/CLI/test/Command/Config/GenerateCharsetCommandTest.php
index 4937f644..5e11684b 100644
--- a/module/CLI/test/Command/Config/GenerateCharsetCommandTest.php
+++ b/module/CLI/test/Command/Config/GenerateCharsetCommandTest.php
@@ -1,4 +1,6 @@
 <?php
+declare(strict_types=1);
+
 namespace ShlinkioTest\Shlink\CLI\Command\Config;
 
 use PHPUnit\Framework\TestCase;
diff --git a/module/CLI/test/Command/Install/InstallCommandTest.php b/module/CLI/test/Command/Install/InstallCommandTest.php
index 3a6657fd..afe83383 100644
--- a/module/CLI/test/Command/Install/InstallCommandTest.php
+++ b/module/CLI/test/Command/Install/InstallCommandTest.php
@@ -1,4 +1,6 @@
 <?php
+declare(strict_types=1);
+
 namespace ShlinkioTest\Shlink\CLI\Command\Install;
 
 use PHPUnit\Framework\TestCase;
diff --git a/module/CLI/test/Command/Shortcode/GeneratePreviewCommandTest.php b/module/CLI/test/Command/Shortcode/GeneratePreviewCommandTest.php
index dd33b5f3..ee63a378 100644
--- a/module/CLI/test/Command/Shortcode/GeneratePreviewCommandTest.php
+++ b/module/CLI/test/Command/Shortcode/GeneratePreviewCommandTest.php
@@ -1,4 +1,6 @@
 <?php
+declare(strict_types=1);
+
 namespace ShlinkioTest\Shlink\CLI\Command\Shortcode;
 
 use PHPUnit\Framework\TestCase;
@@ -63,7 +65,7 @@ class GeneratePreviewCommandTest extends TestCase
         $this->previewGenerator->generatePreview('http://baz.com/something')->shouldBeCalledTimes(1);
 
         $this->commandTester->execute([
-            'command' => 'shortcode:process-previews'
+            'command' => 'shortcode:process-previews',
         ]);
     }
 
@@ -83,7 +85,7 @@ class GeneratePreviewCommandTest extends TestCase
                                                                  ->shouldBeCalledTimes(count($items));
 
         $this->commandTester->execute([
-            'command' => 'shortcode:process-previews'
+            'command' => 'shortcode:process-previews',
         ]);
         $output = $this->commandTester->getDisplay();
         $this->assertEquals(count($items), substr_count($output, 'Error'));
diff --git a/module/CLI/test/Command/Shortcode/GenerateShortcodeCommandTest.php b/module/CLI/test/Command/Shortcode/GenerateShortcodeCommandTest.php
index 11a1385d..e1dc5229 100644
--- a/module/CLI/test/Command/Shortcode/GenerateShortcodeCommandTest.php
+++ b/module/CLI/test/Command/Shortcode/GenerateShortcodeCommandTest.php
@@ -1,4 +1,6 @@
 <?php
+declare(strict_types=1);
+
 namespace ShlinkioTest\Shlink\CLI\Command\Shortcode;
 
 use PHPUnit\Framework\TestCase;
@@ -27,7 +29,7 @@ class GenerateShortcodeCommandTest extends TestCase
         $this->urlShortener = $this->prophesize(UrlShortener::class);
         $command = new GenerateShortcodeCommand($this->urlShortener->reveal(), Translator::factory([]), [
             'schema' => 'http',
-            'hostname' => 'foo.com'
+            'hostname' => 'foo.com',
         ]);
         $app = new Application();
         $app->add($command);
@@ -44,7 +46,7 @@ class GenerateShortcodeCommandTest extends TestCase
 
         $this->commandTester->execute([
             'command' => 'shortcode:generate',
-            'longUrl' => 'http://domain.com/foo/bar'
+            'longUrl' => 'http://domain.com/foo/bar',
         ]);
         $output = $this->commandTester->getDisplay();
         $this->assertTrue(strpos($output, 'http://foo.com/abc123') > 0);
@@ -60,7 +62,7 @@ class GenerateShortcodeCommandTest extends TestCase
 
         $this->commandTester->execute([
             'command' => 'shortcode:generate',
-            'longUrl' => 'http://domain.com/invalid'
+            'longUrl' => 'http://domain.com/invalid',
         ]);
         $output = $this->commandTester->getDisplay();
         $this->assertTrue(
diff --git a/module/CLI/test/Command/Shortcode/GetVisitsCommandTest.php b/module/CLI/test/Command/Shortcode/GetVisitsCommandTest.php
index 4ec77e71..d80d6d4f 100644
--- a/module/CLI/test/Command/Shortcode/GetVisitsCommandTest.php
+++ b/module/CLI/test/Command/Shortcode/GetVisitsCommandTest.php
@@ -1,4 +1,6 @@
 <?php
+declare(strict_types=1);
+
 namespace ShlinkioTest\Shlink\CLI\Command\Shortcode;
 
 use PHPUnit\Framework\TestCase;
diff --git a/module/CLI/test/Command/Shortcode/ListShortcodesCommandTest.php b/module/CLI/test/Command/Shortcode/ListShortcodesCommandTest.php
index 0aac323b..a18cf217 100644
--- a/module/CLI/test/Command/Shortcode/ListShortcodesCommandTest.php
+++ b/module/CLI/test/Command/Shortcode/ListShortcodesCommandTest.php
@@ -1,4 +1,6 @@
 <?php
+declare(strict_types=1);
+
 namespace ShlinkioTest\Shlink\CLI\Command\Shortcode;
 
 use PHPUnit\Framework\TestCase;
diff --git a/module/CLI/test/Command/Shortcode/ResolveUrlCommandTest.php b/module/CLI/test/Command/Shortcode/ResolveUrlCommandTest.php
index 47841b56..c1fef098 100644
--- a/module/CLI/test/Command/Shortcode/ResolveUrlCommandTest.php
+++ b/module/CLI/test/Command/Shortcode/ResolveUrlCommandTest.php
@@ -1,4 +1,6 @@
 <?php
+declare(strict_types=1);
+
 namespace ShlinkioTest\Shlink\CLI\Command\Shortcode;
 
 use PHPUnit\Framework\TestCase;
diff --git a/module/CLI/test/Command/Tag/CreateTagCommandTest.php b/module/CLI/test/Command/Tag/CreateTagCommandTest.php
index 5042e695..6dab8d86 100644
--- a/module/CLI/test/Command/Tag/CreateTagCommandTest.php
+++ b/module/CLI/test/Command/Tag/CreateTagCommandTest.php
@@ -1,4 +1,6 @@
 <?php
+declare(strict_types=1);
+
 namespace ShlinkioTest\Shlink\CLI\Command\Tag;
 
 use PHPUnit\Framework\TestCase;
diff --git a/module/CLI/test/Command/Tag/DeleteTagsCommandTest.php b/module/CLI/test/Command/Tag/DeleteTagsCommandTest.php
index 9498a450..b8f58ff7 100644
--- a/module/CLI/test/Command/Tag/DeleteTagsCommandTest.php
+++ b/module/CLI/test/Command/Tag/DeleteTagsCommandTest.php
@@ -1,4 +1,6 @@
 <?php
+declare(strict_types=1);
+
 namespace ShlinkioTest\Shlink\CLI\Command\Tag;
 
 use PHPUnit\Framework\TestCase;
diff --git a/module/CLI/test/Command/Tag/ListTagsCommandTest.php b/module/CLI/test/Command/Tag/ListTagsCommandTest.php
index a4adc55d..584fa0a8 100644
--- a/module/CLI/test/Command/Tag/ListTagsCommandTest.php
+++ b/module/CLI/test/Command/Tag/ListTagsCommandTest.php
@@ -1,10 +1,12 @@
 <?php
+declare(strict_types=1);
+
 namespace ShlinkioTest\Shlink\CLI\Command\Tag;
 
+use PHPUnit\Framework\TestCase;
 use Prophecy\Prophecy\MethodProphecy;
 use Prophecy\Prophecy\ObjectProphecy;
 use Shlinkio\Shlink\CLI\Command\Tag\ListTagsCommand;
-use PHPUnit\Framework\TestCase;
 use Shlinkio\Shlink\Core\Entity\Tag;
 use Shlinkio\Shlink\Core\Service\Tag\TagServiceInterface;
 use Symfony\Component\Console\Application;
diff --git a/module/CLI/test/Command/Tag/RenameTagCommandTest.php b/module/CLI/test/Command/Tag/RenameTagCommandTest.php
index 5bf56f64..032bfcc7 100644
--- a/module/CLI/test/Command/Tag/RenameTagCommandTest.php
+++ b/module/CLI/test/Command/Tag/RenameTagCommandTest.php
@@ -1,4 +1,6 @@
 <?php
+declare(strict_types=1);
+
 namespace ShlinkioTest\Shlink\CLI\Command\Tag;
 
 use PHPUnit\Framework\TestCase;
diff --git a/module/CLI/test/Command/Visit/ProcessVisitsCommandTest.php b/module/CLI/test/Command/Visit/ProcessVisitsCommandTest.php
index 8c023672..c80f5223 100644
--- a/module/CLI/test/Command/Visit/ProcessVisitsCommandTest.php
+++ b/module/CLI/test/Command/Visit/ProcessVisitsCommandTest.php
@@ -1,4 +1,6 @@
 <?php
+declare(strict_types=1);
+
 namespace ShlinkioTest\Shlink\CLI\Command\Visit;
 
 use PHPUnit\Framework\TestCase;
diff --git a/module/CLI/test/ConfigProviderTest.php b/module/CLI/test/ConfigProviderTest.php
index 70c3a2ac..fe86d922 100644
--- a/module/CLI/test/ConfigProviderTest.php
+++ b/module/CLI/test/ConfigProviderTest.php
@@ -1,4 +1,6 @@
 <?php
+declare(strict_types=1);
+
 namespace ShlinkioTest\Shlink\CLI;
 
 use PHPUnit\Framework\TestCase;
diff --git a/module/CLI/test/Factory/ApplicationFactoryTest.php b/module/CLI/test/Factory/ApplicationFactoryTest.php
index 81e95980..7e765941 100644
--- a/module/CLI/test/Factory/ApplicationFactoryTest.php
+++ b/module/CLI/test/Factory/ApplicationFactoryTest.php
@@ -1,4 +1,6 @@
 <?php
+declare(strict_types=1);
+
 namespace ShlinkioTest\Shlink\CLI\Factory;
 
 use PHPUnit\Framework\TestCase;
diff --git a/module/CLI/test/Factory/InstallApplicationFactoryTest.php b/module/CLI/test/Factory/InstallApplicationFactoryTest.php
index c7e87bc7..35820bba 100644
--- a/module/CLI/test/Factory/InstallApplicationFactoryTest.php
+++ b/module/CLI/test/Factory/InstallApplicationFactoryTest.php
@@ -1,4 +1,6 @@
 <?php
+declare(strict_types=1);
+
 namespace ShlinkioTest\Shlink\CLI\Factory;
 
 use PHPUnit\Framework\TestCase;
diff --git a/module/CLI/test/Install/Plugin/ApplicationConfigCustomizerPluginTest.php b/module/CLI/test/Install/Plugin/ApplicationConfigCustomizerPluginTest.php
index 2b30a328..675dade7 100644
--- a/module/CLI/test/Install/Plugin/ApplicationConfigCustomizerPluginTest.php
+++ b/module/CLI/test/Install/Plugin/ApplicationConfigCustomizerPluginTest.php
@@ -1,4 +1,6 @@
 <?php
+declare(strict_types=1);
+
 namespace ShlinkioTest\Shlink\CLI\Install\Plugin;
 
 use PHPUnit\Framework\TestCase;
diff --git a/module/CLI/test/Install/Plugin/DatabaseConfigCustomizerPluginTest.php b/module/CLI/test/Install/Plugin/DatabaseConfigCustomizerPluginTest.php
index 85d18225..bfaf2491 100644
--- a/module/CLI/test/Install/Plugin/DatabaseConfigCustomizerPluginTest.php
+++ b/module/CLI/test/Install/Plugin/DatabaseConfigCustomizerPluginTest.php
@@ -1,4 +1,6 @@
 <?php
+declare(strict_types=1);
+
 namespace ShlinkioTest\Shlink\CLI\Install\Plugin;
 
 use PHPUnit\Framework\TestCase;
diff --git a/module/CLI/test/Install/Plugin/Factory/DefaultConfigCustomizerPluginFactoryTest.php b/module/CLI/test/Install/Plugin/Factory/DefaultConfigCustomizerPluginFactoryTest.php
index e5004dcc..509099ed 100644
--- a/module/CLI/test/Install/Plugin/Factory/DefaultConfigCustomizerPluginFactoryTest.php
+++ b/module/CLI/test/Install/Plugin/Factory/DefaultConfigCustomizerPluginFactoryTest.php
@@ -1,4 +1,6 @@
 <?php
+declare(strict_types=1);
+
 namespace ShlinkioTest\Shlink\CLI\Install\Plugin\Factory;
 
 use PHPUnit\Framework\TestCase;
diff --git a/module/CLI/test/Install/Plugin/LanguageConfigCustomizerPluginTest.php b/module/CLI/test/Install/Plugin/LanguageConfigCustomizerPluginTest.php
index 77cae092..0edc382e 100644
--- a/module/CLI/test/Install/Plugin/LanguageConfigCustomizerPluginTest.php
+++ b/module/CLI/test/Install/Plugin/LanguageConfigCustomizerPluginTest.php
@@ -1,4 +1,6 @@
 <?php
+declare(strict_types=1);
+
 namespace ShlinkioTest\Shlink\CLI\Install\Plugin;
 
 use PHPUnit\Framework\TestCase;
diff --git a/module/CLI/test/Install/Plugin/UrlShortenerConfigCustomizerPluginTest.php b/module/CLI/test/Install/Plugin/UrlShortenerConfigCustomizerPluginTest.php
index 85eaf681..dc2a9f6e 100644
--- a/module/CLI/test/Install/Plugin/UrlShortenerConfigCustomizerPluginTest.php
+++ b/module/CLI/test/Install/Plugin/UrlShortenerConfigCustomizerPluginTest.php
@@ -1,4 +1,6 @@
 <?php
+declare(strict_types=1);
+
 namespace ShlinkioTest\Shlink\CLI\Install\Plugin;
 
 use PHPUnit\Framework\TestCase;
diff --git a/module/Common/config/dependencies.config.php b/module/Common/config/dependencies.config.php
index dd89b481..19093549 100644
--- a/module/Common/config/dependencies.config.php
+++ b/module/Common/config/dependencies.config.php
@@ -1,4 +1,5 @@
 <?php
+declare(strict_types=1);
 
 use Doctrine\Common\Cache\Cache;
 use Doctrine\ORM\EntityManager;
diff --git a/module/Common/functions/functions.php b/module/Common/functions/functions.php
index 4956ddf0..ae109612 100644
--- a/module/Common/functions/functions.php
+++ b/module/Common/functions/functions.php
@@ -1,4 +1,6 @@
 <?php
+declare(strict_types=1);
+
 namespace Shlinkio\Shlink\Common;
 
 /**
diff --git a/module/Common/src/ConfigProvider.php b/module/Common/src/ConfigProvider.php
index 9af040c2..b6f3566a 100644
--- a/module/Common/src/ConfigProvider.php
+++ b/module/Common/src/ConfigProvider.php
@@ -1,4 +1,6 @@
 <?php
+declare(strict_types=1);
+
 namespace Shlinkio\Shlink\Common;
 
 use Zend\Config\Factory;
diff --git a/module/Common/src/Entity/AbstractEntity.php b/module/Common/src/Entity/AbstractEntity.php
index 67e15f60..8b71b4ec 100644
--- a/module/Common/src/Entity/AbstractEntity.php
+++ b/module/Common/src/Entity/AbstractEntity.php
@@ -1,4 +1,6 @@
 <?php
+declare(strict_types=1);
+
 namespace Shlinkio\Shlink\Common\Entity;
 
 use Doctrine\ORM\Mapping as ORM;
diff --git a/module/Common/src/Exception/ExceptionInterface.php b/module/Common/src/Exception/ExceptionInterface.php
index 81255f6a..72e53d0f 100644
--- a/module/Common/src/Exception/ExceptionInterface.php
+++ b/module/Common/src/Exception/ExceptionInterface.php
@@ -1,4 +1,6 @@
 <?php
+declare(strict_types=1);
+
 namespace Shlinkio\Shlink\Common\Exception;
 
 interface ExceptionInterface
diff --git a/module/Common/src/Exception/InvalidArgumentException.php b/module/Common/src/Exception/InvalidArgumentException.php
index 79bfc9cb..42a0c33f 100644
--- a/module/Common/src/Exception/InvalidArgumentException.php
+++ b/module/Common/src/Exception/InvalidArgumentException.php
@@ -1,4 +1,6 @@
 <?php
+declare(strict_types=1);
+
 namespace Shlinkio\Shlink\Common\Exception;
 
 class InvalidArgumentException extends \InvalidArgumentException implements ExceptionInterface
diff --git a/module/Common/src/Exception/PreviewGenerationException.php b/module/Common/src/Exception/PreviewGenerationException.php
index ac205495..3871f0c6 100644
--- a/module/Common/src/Exception/PreviewGenerationException.php
+++ b/module/Common/src/Exception/PreviewGenerationException.php
@@ -1,4 +1,6 @@
 <?php
+declare(strict_types=1);
+
 namespace Shlinkio\Shlink\Common\Exception;
 
 class PreviewGenerationException extends RuntimeException
diff --git a/module/Common/src/Exception/RuntimeException.php b/module/Common/src/Exception/RuntimeException.php
index fbed3d68..aa70777e 100644
--- a/module/Common/src/Exception/RuntimeException.php
+++ b/module/Common/src/Exception/RuntimeException.php
@@ -1,4 +1,6 @@
 <?php
+declare(strict_types=1);
+
 namespace Shlinkio\Shlink\Common\Exception;
 
 class RuntimeException extends \RuntimeException implements ExceptionInterface
diff --git a/module/Common/src/Exception/WrongIpException.php b/module/Common/src/Exception/WrongIpException.php
index 8aa3a7bf..0e70d4e2 100644
--- a/module/Common/src/Exception/WrongIpException.php
+++ b/module/Common/src/Exception/WrongIpException.php
@@ -1,4 +1,6 @@
 <?php
+declare(strict_types=1);
+
 namespace Shlinkio\Shlink\Common\Exception;
 
 class WrongIpException extends RuntimeException
diff --git a/module/Common/src/Factory/CacheFactory.php b/module/Common/src/Factory/CacheFactory.php
index 8f1b69ba..5f9d672b 100644
--- a/module/Common/src/Factory/CacheFactory.php
+++ b/module/Common/src/Factory/CacheFactory.php
@@ -1,4 +1,6 @@
 <?php
+declare(strict_types=1);
+
 namespace Shlinkio\Shlink\Common\Factory;
 
 use Doctrine\Common\Cache;
diff --git a/module/Common/src/Factory/DottedAccessConfigAbstractFactory.php b/module/Common/src/Factory/DottedAccessConfigAbstractFactory.php
index 7d0e03b6..71fd2e56 100644
--- a/module/Common/src/Factory/DottedAccessConfigAbstractFactory.php
+++ b/module/Common/src/Factory/DottedAccessConfigAbstractFactory.php
@@ -1,4 +1,6 @@
 <?php
+declare(strict_types=1);
+
 namespace Shlinkio\Shlink\Common\Factory;
 
 use Interop\Container\ContainerInterface;
diff --git a/module/Common/src/Factory/EmptyResponseImplicitOptionsMiddlewareFactory.php b/module/Common/src/Factory/EmptyResponseImplicitOptionsMiddlewareFactory.php
index 1551d8cd..2ddf4080 100644
--- a/module/Common/src/Factory/EmptyResponseImplicitOptionsMiddlewareFactory.php
+++ b/module/Common/src/Factory/EmptyResponseImplicitOptionsMiddlewareFactory.php
@@ -1,4 +1,6 @@
 <?php
+declare(strict_types=1);
+
 namespace Shlinkio\Shlink\Common\Factory;
 
 use Interop\Container\ContainerInterface;
diff --git a/module/Common/src/Factory/EntityManagerFactory.php b/module/Common/src/Factory/EntityManagerFactory.php
index 533aa322..d8622121 100644
--- a/module/Common/src/Factory/EntityManagerFactory.php
+++ b/module/Common/src/Factory/EntityManagerFactory.php
@@ -1,4 +1,6 @@
 <?php
+declare(strict_types=1);
+
 namespace Shlinkio\Shlink\Common\Factory;
 
 use Doctrine\Common\Cache\ArrayCache;
diff --git a/module/Common/src/Factory/LoggerFactory.php b/module/Common/src/Factory/LoggerFactory.php
index d42b2f01..f357c29b 100644
--- a/module/Common/src/Factory/LoggerFactory.php
+++ b/module/Common/src/Factory/LoggerFactory.php
@@ -1,4 +1,6 @@
 <?php
+declare(strict_types=1);
+
 namespace Shlinkio\Shlink\Common\Factory;
 
 use Cascade\Cascade;
diff --git a/module/Common/src/Factory/TranslatorFactory.php b/module/Common/src/Factory/TranslatorFactory.php
index e41ba2fc..a49e8116 100644
--- a/module/Common/src/Factory/TranslatorFactory.php
+++ b/module/Common/src/Factory/TranslatorFactory.php
@@ -1,4 +1,6 @@
 <?php
+declare(strict_types=1);
+
 namespace Shlinkio\Shlink\Common\Factory;
 
 use Interop\Container\ContainerInterface;
diff --git a/module/Common/src/Image/ImageBuilder.php b/module/Common/src/Image/ImageBuilder.php
index 0e4de841..2dc3b942 100644
--- a/module/Common/src/Image/ImageBuilder.php
+++ b/module/Common/src/Image/ImageBuilder.php
@@ -1,4 +1,6 @@
 <?php
+declare(strict_types=1);
+
 namespace Shlinkio\Shlink\Common\Image;
 
 use mikehaertl\wkhtmlto\Image;
diff --git a/module/Common/src/Image/ImageBuilderFactory.php b/module/Common/src/Image/ImageBuilderFactory.php
index f5c4bc13..f6119011 100644
--- a/module/Common/src/Image/ImageBuilderFactory.php
+++ b/module/Common/src/Image/ImageBuilderFactory.php
@@ -1,4 +1,6 @@
 <?php
+declare(strict_types=1);
+
 namespace Shlinkio\Shlink\Common\Image;
 
 use Interop\Container\ContainerInterface;
diff --git a/module/Common/src/Image/ImageBuilderInterface.php b/module/Common/src/Image/ImageBuilderInterface.php
index a1479a81..ff4baeeb 100644
--- a/module/Common/src/Image/ImageBuilderInterface.php
+++ b/module/Common/src/Image/ImageBuilderInterface.php
@@ -1,4 +1,6 @@
 <?php
+declare(strict_types=1);
+
 namespace Shlinkio\Shlink\Common\Image;
 
 use Zend\ServiceManager\ServiceLocatorInterface;
diff --git a/module/Common/src/Image/ImageFactory.php b/module/Common/src/Image/ImageFactory.php
index 2bdea7be..95d0e998 100644
--- a/module/Common/src/Image/ImageFactory.php
+++ b/module/Common/src/Image/ImageFactory.php
@@ -1,4 +1,6 @@
 <?php
+declare(strict_types=1);
+
 namespace Shlinkio\Shlink\Common\Image;
 
 use Interop\Container\ContainerInterface;
diff --git a/module/Common/src/Middleware/LocaleMiddleware.php b/module/Common/src/Middleware/LocaleMiddleware.php
index fe0ff2c6..1c48c863 100644
--- a/module/Common/src/Middleware/LocaleMiddleware.php
+++ b/module/Common/src/Middleware/LocaleMiddleware.php
@@ -1,4 +1,6 @@
 <?php
+declare(strict_types=1);
+
 namespace Shlinkio\Shlink\Common\Middleware;
 
 use Interop\Http\ServerMiddleware\DelegateInterface;
diff --git a/module/Common/src/Paginator/Adapter/PaginableRepositoryAdapter.php b/module/Common/src/Paginator/Adapter/PaginableRepositoryAdapter.php
index 995c7263..b57bb6e8 100644
--- a/module/Common/src/Paginator/Adapter/PaginableRepositoryAdapter.php
+++ b/module/Common/src/Paginator/Adapter/PaginableRepositoryAdapter.php
@@ -1,4 +1,6 @@
 <?php
+declare(strict_types=1);
+
 namespace Shlinkio\Shlink\Common\Paginator\Adapter;
 
 use Shlinkio\Shlink\Common\Repository\PaginableRepositoryInterface;
@@ -32,7 +34,7 @@ class PaginableRepositoryAdapter implements AdapterInterface
         $orderBy = null
     ) {
         $this->paginableRepository = $paginableRepository;
-        $this->searchTerm = trim(strip_tags($searchTerm));
+        $this->searchTerm = $searchTerm !== null ? trim(strip_tags($searchTerm)) : null;
         $this->orderBy = $orderBy;
         $this->tags = $tags;
     }
diff --git a/module/Common/src/Paginator/Util/PaginatorUtilsTrait.php b/module/Common/src/Paginator/Util/PaginatorUtilsTrait.php
index a1e0ec5c..167de806 100644
--- a/module/Common/src/Paginator/Util/PaginatorUtilsTrait.php
+++ b/module/Common/src/Paginator/Util/PaginatorUtilsTrait.php
@@ -1,4 +1,6 @@
 <?php
+declare(strict_types=1);
+
 namespace Shlinkio\Shlink\Common\Paginator\Util;
 
 use Zend\Paginator\Paginator;
diff --git a/module/Common/src/Repository/PaginableRepositoryInterface.php b/module/Common/src/Repository/PaginableRepositoryInterface.php
index 7481d186..c02e2045 100644
--- a/module/Common/src/Repository/PaginableRepositoryInterface.php
+++ b/module/Common/src/Repository/PaginableRepositoryInterface.php
@@ -1,4 +1,6 @@
 <?php
+declare(strict_types=1);
+
 namespace Shlinkio\Shlink\Common\Repository;
 
 interface PaginableRepositoryInterface
diff --git a/module/Common/src/Response/QrCodeResponse.php b/module/Common/src/Response/QrCodeResponse.php
index e19e4578..b207fa0d 100644
--- a/module/Common/src/Response/QrCodeResponse.php
+++ b/module/Common/src/Response/QrCodeResponse.php
@@ -1,4 +1,6 @@
 <?php
+declare(strict_types=1);
+
 namespace Shlinkio\Shlink\Common\Response;
 
 use Endroid\QrCode\QrCode;
diff --git a/module/Common/src/Service/IpLocationResolver.php b/module/Common/src/Service/IpLocationResolver.php
index 287760a3..218d2288 100644
--- a/module/Common/src/Service/IpLocationResolver.php
+++ b/module/Common/src/Service/IpLocationResolver.php
@@ -1,4 +1,6 @@
 <?php
+declare(strict_types=1);
+
 namespace Shlinkio\Shlink\Common\Service;
 
 use GuzzleHttp\Client;
@@ -27,7 +29,7 @@ class IpLocationResolver implements IpLocationResolverInterface
     {
         try {
             $response = $this->httpClient->get(sprintf(self::SERVICE_PATTERN, $ipAddress));
-            return json_decode($response->getBody(), true);
+            return json_decode((string) $response->getBody(), true);
         } catch (GuzzleException $e) {
             throw WrongIpException::fromIpAddress($ipAddress, $e);
         }
diff --git a/module/Common/src/Service/IpLocationResolverInterface.php b/module/Common/src/Service/IpLocationResolverInterface.php
index 350c2b9c..4f4279a2 100644
--- a/module/Common/src/Service/IpLocationResolverInterface.php
+++ b/module/Common/src/Service/IpLocationResolverInterface.php
@@ -1,4 +1,6 @@
 <?php
+declare(strict_types=1);
+
 namespace Shlinkio\Shlink\Common\Service;
 
 interface IpLocationResolverInterface
diff --git a/module/Common/src/Service/PreviewGenerator.php b/module/Common/src/Service/PreviewGenerator.php
index d85bf50b..0a7814a2 100644
--- a/module/Common/src/Service/PreviewGenerator.php
+++ b/module/Common/src/Service/PreviewGenerator.php
@@ -1,4 +1,6 @@
 <?php
+declare(strict_types=1);
+
 namespace Shlinkio\Shlink\Common\Service;
 
 use mikehaertl\wkhtmlto\Image;
diff --git a/module/Common/src/Service/PreviewGeneratorInterface.php b/module/Common/src/Service/PreviewGeneratorInterface.php
index 2e7ea0aa..f9e5dcae 100644
--- a/module/Common/src/Service/PreviewGeneratorInterface.php
+++ b/module/Common/src/Service/PreviewGeneratorInterface.php
@@ -1,4 +1,6 @@
 <?php
+declare(strict_types=1);
+
 namespace Shlinkio\Shlink\Common\Service;
 
 use Shlinkio\Shlink\Common\Exception\PreviewGenerationException;
diff --git a/module/Common/src/Template/Extension/TranslatorExtension.php b/module/Common/src/Template/Extension/TranslatorExtension.php
index 01fbeeed..1779880a 100644
--- a/module/Common/src/Template/Extension/TranslatorExtension.php
+++ b/module/Common/src/Template/Extension/TranslatorExtension.php
@@ -1,4 +1,6 @@
 <?php
+declare(strict_types=1);
+
 namespace Shlinkio\Shlink\Common\Template\Extension;
 
 use League\Plates\Engine;
diff --git a/module/Common/src/Util/DateRange.php b/module/Common/src/Util/DateRange.php
index c87f402a..215de520 100644
--- a/module/Common/src/Util/DateRange.php
+++ b/module/Common/src/Util/DateRange.php
@@ -1,4 +1,6 @@
 <?php
+declare(strict_types=1);
+
 namespace Shlinkio\Shlink\Common\Util;
 
 class DateRange
diff --git a/module/Common/src/Util/ResponseUtilsTrait.php b/module/Common/src/Util/ResponseUtilsTrait.php
index dd504d8e..7c8fc0b6 100644
--- a/module/Common/src/Util/ResponseUtilsTrait.php
+++ b/module/Common/src/Util/ResponseUtilsTrait.php
@@ -1,4 +1,6 @@
 <?php
+declare(strict_types=1);
+
 namespace Shlinkio\Shlink\Common\Util;
 
 use Zend\Diactoros\Response;
diff --git a/module/Common/src/Util/StringUtilsTrait.php b/module/Common/src/Util/StringUtilsTrait.php
index 9680aa49..1c048251 100644
--- a/module/Common/src/Util/StringUtilsTrait.php
+++ b/module/Common/src/Util/StringUtilsTrait.php
@@ -1,4 +1,6 @@
 <?php
+declare(strict_types=1);
+
 namespace Shlinkio\Shlink\Common\Util;
 
 trait StringUtilsTrait
diff --git a/module/Common/test/ConfigProviderTest.php b/module/Common/test/ConfigProviderTest.php
index 551d2137..d8d9dbd7 100644
--- a/module/Common/test/ConfigProviderTest.php
+++ b/module/Common/test/ConfigProviderTest.php
@@ -1,4 +1,6 @@
 <?php
+declare(strict_types=1);
+
 namespace ShlinkioTest\Shlink\Common;
 
 use PHPUnit\Framework\TestCase;
diff --git a/module/Common/test/Factory/CacheFactoryTest.php b/module/Common/test/Factory/CacheFactoryTest.php
index 9a095ad6..53d7291a 100644
--- a/module/Common/test/Factory/CacheFactoryTest.php
+++ b/module/Common/test/Factory/CacheFactoryTest.php
@@ -1,4 +1,6 @@
 <?php
+declare(strict_types=1);
+
 namespace ShlinkioTest\Shlink\Common\Factory;
 
 use Doctrine\Common\Cache\ApcuCache;
@@ -88,11 +90,11 @@ class CacheFactoryTest extends TestCase
         $servers = [
             [
                 'host' => '1.2.3.4',
-                'port' => 123
+                'port' => 123,
             ],
             [
                 'host' => '4.3.2.1',
-                'port' => 321
+                'port' => 321,
             ],
         ];
         /** @var MemcachedCache $instance */
diff --git a/module/Common/test/Factory/EmptyResponseImplicitOptionsMiddlewareFactoryTest.php b/module/Common/test/Factory/EmptyResponseImplicitOptionsMiddlewareFactoryTest.php
index aca35f62..dd4b6301 100644
--- a/module/Common/test/Factory/EmptyResponseImplicitOptionsMiddlewareFactoryTest.php
+++ b/module/Common/test/Factory/EmptyResponseImplicitOptionsMiddlewareFactoryTest.php
@@ -1,4 +1,6 @@
 <?php
+declare(strict_types=1);
+
 namespace ShlinkioTest\Shlink\Common\Factory;
 
 use PHPUnit\Framework\TestCase;
diff --git a/module/Common/test/Factory/EntityManagerFactoryTest.php b/module/Common/test/Factory/EntityManagerFactoryTest.php
index 6a9b5c01..ec180aad 100644
--- a/module/Common/test/Factory/EntityManagerFactoryTest.php
+++ b/module/Common/test/Factory/EntityManagerFactoryTest.php
@@ -1,4 +1,6 @@
 <?php
+declare(strict_types=1);
+
 namespace ShlinkioTest\Shlink\Common\Factory;
 
 use Doctrine\ORM\EntityManager;
diff --git a/module/Common/test/Factory/LoggerFactoryTest.php b/module/Common/test/Factory/LoggerFactoryTest.php
index 9c6acab5..e5cff954 100644
--- a/module/Common/test/Factory/LoggerFactoryTest.php
+++ b/module/Common/test/Factory/LoggerFactoryTest.php
@@ -1,4 +1,6 @@
 <?php
+declare(strict_types=1);
+
 namespace ShlinkioTest\Shlink\Common\Factory;
 
 use Monolog\Logger;
diff --git a/module/Common/test/Factory/TranslatorFactoryTest.php b/module/Common/test/Factory/TranslatorFactoryTest.php
index b227685b..7bc35f16 100644
--- a/module/Common/test/Factory/TranslatorFactoryTest.php
+++ b/module/Common/test/Factory/TranslatorFactoryTest.php
@@ -1,4 +1,6 @@
 <?php
+declare(strict_types=1);
+
 namespace ShlinkioTest\Shlink\Common\Factory;
 
 use PHPUnit\Framework\TestCase;
diff --git a/module/Common/test/Image/ImageBuilderFactoryTest.php b/module/Common/test/Image/ImageBuilderFactoryTest.php
index 48ae8c1e..5bfa7e17 100644
--- a/module/Common/test/Image/ImageBuilderFactoryTest.php
+++ b/module/Common/test/Image/ImageBuilderFactoryTest.php
@@ -1,4 +1,6 @@
 <?php
+declare(strict_types=1);
+
 namespace ShlinkioTest\Shlink\Common\Image;
 
 use PHPUnit\Framework\TestCase;
diff --git a/module/Common/test/Image/ImageFactoryTest.php b/module/Common/test/Image/ImageFactoryTest.php
index 763a3dc1..998817bc 100644
--- a/module/Common/test/Image/ImageFactoryTest.php
+++ b/module/Common/test/Image/ImageFactoryTest.php
@@ -1,4 +1,6 @@
 <?php
+declare(strict_types=1);
+
 namespace ShlinkioTest\Shlink\Common\Image;
 
 use mikehaertl\wkhtmlto\Image;
diff --git a/module/Common/test/Middleware/LocaleMiddlewareTest.php b/module/Common/test/Middleware/LocaleMiddlewareTest.php
index 762dc31f..703ef700 100644
--- a/module/Common/test/Middleware/LocaleMiddlewareTest.php
+++ b/module/Common/test/Middleware/LocaleMiddlewareTest.php
@@ -1,4 +1,6 @@
 <?php
+declare(strict_types=1);
+
 namespace ShlinkioTest\Shlink\Common\Middleware;
 
 use PHPUnit\Framework\TestCase;
diff --git a/module/Common/test/Paginator/PaginableRepositoryAdapterTest.php b/module/Common/test/Paginator/PaginableRepositoryAdapterTest.php
index 99a25bcc..70b85ef8 100644
--- a/module/Common/test/Paginator/PaginableRepositoryAdapterTest.php
+++ b/module/Common/test/Paginator/PaginableRepositoryAdapterTest.php
@@ -1,4 +1,6 @@
 <?php
+declare(strict_types=1);
+
 namespace ShlinkioTest\Shlink\Common\Paginator;
 
 use PHPUnit\Framework\TestCase;
diff --git a/module/Common/test/Service/IpLocationResolverTest.php b/module/Common/test/Service/IpLocationResolverTest.php
index 8cbc28ad..f5fb162c 100644
--- a/module/Common/test/Service/IpLocationResolverTest.php
+++ b/module/Common/test/Service/IpLocationResolverTest.php
@@ -1,4 +1,6 @@
 <?php
+declare(strict_types=1);
+
 namespace ShlinkioTest\Shlink\Common\Service;
 
 use GuzzleHttp\Client;
diff --git a/module/Common/test/Service/PreviewGeneratorTest.php b/module/Common/test/Service/PreviewGeneratorTest.php
index 89563349..20d625bd 100644
--- a/module/Common/test/Service/PreviewGeneratorTest.php
+++ b/module/Common/test/Service/PreviewGeneratorTest.php
@@ -1,4 +1,6 @@
 <?php
+declare(strict_types=1);
+
 namespace ShlinkioTest\Shlink\Common\Service;
 
 use mikehaertl\wkhtmlto\Image;
@@ -35,7 +37,7 @@ class PreviewGeneratorTest extends TestCase
                 Image::class => function () {
                     return $this->image->reveal();
                 },
-            ]
+            ],
         ]), $this->filesystem->reveal(), 'dir');
     }
 
diff --git a/module/Common/test/Template/Extension/TranslatorExtensionTest.php b/module/Common/test/Template/Extension/TranslatorExtensionTest.php
index e39e2b24..04d36188 100644
--- a/module/Common/test/Template/Extension/TranslatorExtensionTest.php
+++ b/module/Common/test/Template/Extension/TranslatorExtensionTest.php
@@ -1,4 +1,6 @@
 <?php
+declare(strict_types=1);
+
 namespace ShlinkioTest\Shlink\Common\Template\Extension;
 
 use League\Plates\Engine;
diff --git a/module/Common/test/Util/DateRangeTest.php b/module/Common/test/Util/DateRangeTest.php
index 261e047d..4cde5004 100644
--- a/module/Common/test/Util/DateRangeTest.php
+++ b/module/Common/test/Util/DateRangeTest.php
@@ -1,4 +1,6 @@
 <?php
+declare(strict_types=1);
+
 namespace ShlinkioTest\Shlink\Common\Util;
 
 use PHPUnit\Framework\TestCase;
diff --git a/module/Common/test/Util/TestUtils.php b/module/Common/test/Util/TestUtils.php
index 8bd4969d..075498d2 100644
--- a/module/Common/test/Util/TestUtils.php
+++ b/module/Common/test/Util/TestUtils.php
@@ -1,4 +1,6 @@
 <?php
+declare(strict_types=1);
+
 namespace ShlinkioTest\Shlink\Common\Util;
 
 use Interop\Http\ServerMiddleware\DelegateInterface;
diff --git a/module/Core/config/app_options.config.php b/module/Core/config/app_options.config.php
index bf224541..dac1c5cd 100644
--- a/module/Core/config/app_options.config.php
+++ b/module/Core/config/app_options.config.php
@@ -1,4 +1,6 @@
 <?php
+declare(strict_types=1);
+
 return [
 
     'app_options' => [],
diff --git a/module/Core/config/dependencies.config.php b/module/Core/config/dependencies.config.php
index a25c82fb..a21a92b8 100644
--- a/module/Core/config/dependencies.config.php
+++ b/module/Core/config/dependencies.config.php
@@ -1,4 +1,5 @@
 <?php
+declare(strict_types=1);
 
 use Doctrine\Common\Cache\Cache;
 use Shlinkio\Shlink\Common\Service\PreviewGenerator;
diff --git a/module/Core/config/entity-manager.config.php b/module/Core/config/entity-manager.config.php
index e9359519..e5008568 100644
--- a/module/Core/config/entity-manager.config.php
+++ b/module/Core/config/entity-manager.config.php
@@ -1,4 +1,6 @@
 <?php
+declare(strict_types=1);
+
 return [
 
     'entity_manager' => [
diff --git a/module/Core/config/routes.config.php b/module/Core/config/routes.config.php
index a3c70aeb..e18cb448 100644
--- a/module/Core/config/routes.config.php
+++ b/module/Core/config/routes.config.php
@@ -1,4 +1,6 @@
 <?php
+declare(strict_types=1);
+
 use Shlinkio\Shlink\Core\Action;
 use Shlinkio\Shlink\Core\Middleware;
 
diff --git a/module/Core/config/templates.config.php b/module/Core/config/templates.config.php
index d5e6677e..821ce1ea 100644
--- a/module/Core/config/templates.config.php
+++ b/module/Core/config/templates.config.php
@@ -1,4 +1,5 @@
 <?php
+declare(strict_types=1);
 
 return [
 
diff --git a/module/Core/config/translator.config.php b/module/Core/config/translator.config.php
index ae120db3..659d4cae 100644
--- a/module/Core/config/translator.config.php
+++ b/module/Core/config/translator.config.php
@@ -1,4 +1,6 @@
 <?php
+declare(strict_types=1);
+
 return [
 
     'translator' => [
diff --git a/module/Core/config/zend-expressive.config.php b/module/Core/config/zend-expressive.config.php
index 3dfd091f..81f6676f 100644
--- a/module/Core/config/zend-expressive.config.php
+++ b/module/Core/config/zend-expressive.config.php
@@ -1,4 +1,5 @@
 <?php
+declare(strict_types=1);
 
 return [
 
diff --git a/module/Core/src/Action/PreviewAction.php b/module/Core/src/Action/PreviewAction.php
index 12c57435..054da045 100644
--- a/module/Core/src/Action/PreviewAction.php
+++ b/module/Core/src/Action/PreviewAction.php
@@ -1,4 +1,6 @@
 <?php
+declare(strict_types=1);
+
 namespace Shlinkio\Shlink\Core\Action;
 
 use Interop\Http\ServerMiddleware\DelegateInterface;
diff --git a/module/Core/src/Action/QrCodeAction.php b/module/Core/src/Action/QrCodeAction.php
index efef3400..a6e20af8 100644
--- a/module/Core/src/Action/QrCodeAction.php
+++ b/module/Core/src/Action/QrCodeAction.php
@@ -1,4 +1,6 @@
 <?php
+declare(strict_types=1);
+
 namespace Shlinkio\Shlink\Core\Action;
 
 use Endroid\QrCode\QrCode;
diff --git a/module/Core/src/Action/RedirectAction.php b/module/Core/src/Action/RedirectAction.php
index 1de994f4..ae58da1b 100644
--- a/module/Core/src/Action/RedirectAction.php
+++ b/module/Core/src/Action/RedirectAction.php
@@ -1,4 +1,6 @@
 <?php
+declare(strict_types=1);
+
 namespace Shlinkio\Shlink\Core\Action;
 
 use Interop\Http\ServerMiddleware\DelegateInterface;
diff --git a/module/Core/src/ConfigProvider.php b/module/Core/src/ConfigProvider.php
index 927e126d..a58f0c55 100644
--- a/module/Core/src/ConfigProvider.php
+++ b/module/Core/src/ConfigProvider.php
@@ -1,4 +1,6 @@
 <?php
+declare(strict_types=1);
+
 namespace Shlinkio\Shlink\Core;
 
 use Zend\Config\Factory;
diff --git a/module/Core/src/Entity/ShortUrl.php b/module/Core/src/Entity/ShortUrl.php
index 44e992ce..06cb02ce 100644
--- a/module/Core/src/Entity/ShortUrl.php
+++ b/module/Core/src/Entity/ShortUrl.php
@@ -1,4 +1,6 @@
 <?php
+declare(strict_types=1);
+
 namespace Shlinkio\Shlink\Core\Entity;
 
 use Doctrine\Common\Collections\ArrayCollection;
diff --git a/module/Core/src/Entity/Tag.php b/module/Core/src/Entity/Tag.php
index 7537b8c0..cd895268 100644
--- a/module/Core/src/Entity/Tag.php
+++ b/module/Core/src/Entity/Tag.php
@@ -1,4 +1,6 @@
 <?php
+declare(strict_types=1);
+
 namespace Shlinkio\Shlink\Core\Entity;
 
 use Doctrine\ORM\Mapping as ORM;
diff --git a/module/Core/src/Entity/Visit.php b/module/Core/src/Entity/Visit.php
index c1ab7333..5f67f636 100644
--- a/module/Core/src/Entity/Visit.php
+++ b/module/Core/src/Entity/Visit.php
@@ -1,4 +1,6 @@
 <?php
+declare(strict_types=1);
+
 namespace Shlinkio\Shlink\Core\Entity;
 
 use Doctrine\ORM\Mapping as ORM;
diff --git a/module/Core/src/Entity/VisitLocation.php b/module/Core/src/Entity/VisitLocation.php
index 3b9851ac..ca30596a 100644
--- a/module/Core/src/Entity/VisitLocation.php
+++ b/module/Core/src/Entity/VisitLocation.php
@@ -1,8 +1,10 @@
 <?php
+declare(strict_types=1);
+
 namespace Shlinkio\Shlink\Core\Entity;
 
-use Shlinkio\Shlink\Common\Entity\AbstractEntity;
 use Doctrine\ORM\Mapping as ORM;
+use Shlinkio\Shlink\Common\Entity\AbstractEntity;
 use Zend\Stdlib\ArraySerializableInterface;
 
 /**
diff --git a/module/Core/src/Exception/EntityDoesNotExistException.php b/module/Core/src/Exception/EntityDoesNotExistException.php
index 27825690..732eaeba 100644
--- a/module/Core/src/Exception/EntityDoesNotExistException.php
+++ b/module/Core/src/Exception/EntityDoesNotExistException.php
@@ -1,4 +1,6 @@
 <?php
+declare(strict_types=1);
+
 namespace Shlinkio\Shlink\Core\Exception;
 
 use Shlinkio\Shlink\Common\Exception\ExceptionInterface;
diff --git a/module/Core/src/Exception/InvalidShortCodeException.php b/module/Core/src/Exception/InvalidShortCodeException.php
index 85cc3d54..03354fc0 100644
--- a/module/Core/src/Exception/InvalidShortCodeException.php
+++ b/module/Core/src/Exception/InvalidShortCodeException.php
@@ -1,4 +1,6 @@
 <?php
+declare(strict_types=1);
+
 namespace Shlinkio\Shlink\Core\Exception;
 
 use Shlinkio\Shlink\Common\Exception\RuntimeException;
diff --git a/module/Core/src/Exception/InvalidUrlException.php b/module/Core/src/Exception/InvalidUrlException.php
index ba90943e..848cd71b 100644
--- a/module/Core/src/Exception/InvalidUrlException.php
+++ b/module/Core/src/Exception/InvalidUrlException.php
@@ -1,4 +1,6 @@
 <?php
+declare(strict_types=1);
+
 namespace Shlinkio\Shlink\Core\Exception;
 
 use Shlinkio\Shlink\Common\Exception\RuntimeException;
diff --git a/module/Core/src/Middleware/QrCodeCacheMiddleware.php b/module/Core/src/Middleware/QrCodeCacheMiddleware.php
index fd894912..e91ebd5e 100644
--- a/module/Core/src/Middleware/QrCodeCacheMiddleware.php
+++ b/module/Core/src/Middleware/QrCodeCacheMiddleware.php
@@ -1,4 +1,6 @@
 <?php
+declare(strict_types=1);
+
 namespace Shlinkio\Shlink\Core\Middleware;
 
 use Doctrine\Common\Cache\Cache;
diff --git a/module/Core/src/Options/AppOptions.php b/module/Core/src/Options/AppOptions.php
index cce854a2..edb46f08 100644
--- a/module/Core/src/Options/AppOptions.php
+++ b/module/Core/src/Options/AppOptions.php
@@ -1,4 +1,6 @@
 <?php
+declare(strict_types=1);
+
 namespace Shlinkio\Shlink\Core\Options;
 
 use Shlinkio\Shlink\Common\Util\StringUtilsTrait;
diff --git a/module/Core/src/Options/AppOptionsFactory.php b/module/Core/src/Options/AppOptionsFactory.php
index b8b05858..d61d517e 100644
--- a/module/Core/src/Options/AppOptionsFactory.php
+++ b/module/Core/src/Options/AppOptionsFactory.php
@@ -1,4 +1,6 @@
 <?php
+declare(strict_types=1);
+
 namespace Shlinkio\Shlink\Core\Options;
 
 use Interop\Container\ContainerInterface;
diff --git a/module/Core/src/Repository/ShortUrlRepository.php b/module/Core/src/Repository/ShortUrlRepository.php
index 8ee743ce..a888c07c 100644
--- a/module/Core/src/Repository/ShortUrlRepository.php
+++ b/module/Core/src/Repository/ShortUrlRepository.php
@@ -1,4 +1,6 @@
 <?php
+declare(strict_types=1);
+
 namespace Shlinkio\Shlink\Core\Repository;
 
 use Doctrine\ORM\EntityRepository;
diff --git a/module/Core/src/Repository/ShortUrlRepositoryInterface.php b/module/Core/src/Repository/ShortUrlRepositoryInterface.php
index 5096e065..3ddae2d6 100644
--- a/module/Core/src/Repository/ShortUrlRepositoryInterface.php
+++ b/module/Core/src/Repository/ShortUrlRepositoryInterface.php
@@ -1,4 +1,6 @@
 <?php
+declare(strict_types=1);
+
 namespace Shlinkio\Shlink\Core\Repository;
 
 use Doctrine\Common\Persistence\ObjectRepository;
diff --git a/module/Core/src/Repository/TagRepository.php b/module/Core/src/Repository/TagRepository.php
index 46967f92..a4254cad 100644
--- a/module/Core/src/Repository/TagRepository.php
+++ b/module/Core/src/Repository/TagRepository.php
@@ -1,4 +1,6 @@
 <?php
+declare(strict_types=1);
+
 namespace Shlinkio\Shlink\Core\Repository;
 
 use Doctrine\ORM\EntityRepository;
diff --git a/module/Core/src/Repository/TagRepositoryInterface.php b/module/Core/src/Repository/TagRepositoryInterface.php
index f3e604a5..23eb8128 100644
--- a/module/Core/src/Repository/TagRepositoryInterface.php
+++ b/module/Core/src/Repository/TagRepositoryInterface.php
@@ -1,4 +1,6 @@
 <?php
+declare(strict_types=1);
+
 namespace Shlinkio\Shlink\Core\Repository;
 
 use Doctrine\Common\Persistence\ObjectRepository;
diff --git a/module/Core/src/Repository/VisitRepository.php b/module/Core/src/Repository/VisitRepository.php
index f86017a4..2e034406 100644
--- a/module/Core/src/Repository/VisitRepository.php
+++ b/module/Core/src/Repository/VisitRepository.php
@@ -1,4 +1,6 @@
 <?php
+declare(strict_types=1);
+
 namespace Shlinkio\Shlink\Core\Repository;
 
 use Doctrine\ORM\EntityRepository;
diff --git a/module/Core/src/Repository/VisitRepositoryInterface.php b/module/Core/src/Repository/VisitRepositoryInterface.php
index c65f495d..4b562d1d 100644
--- a/module/Core/src/Repository/VisitRepositoryInterface.php
+++ b/module/Core/src/Repository/VisitRepositoryInterface.php
@@ -1,4 +1,6 @@
 <?php
+declare(strict_types=1);
+
 namespace Shlinkio\Shlink\Core\Repository;
 
 use Doctrine\Common\Persistence\ObjectRepository;
diff --git a/module/Core/src/Service/ShortUrlService.php b/module/Core/src/Service/ShortUrlService.php
index c7ae94c9..2e22717b 100644
--- a/module/Core/src/Service/ShortUrlService.php
+++ b/module/Core/src/Service/ShortUrlService.php
@@ -1,4 +1,6 @@
 <?php
+declare(strict_types=1);
+
 namespace Shlinkio\Shlink\Core\Service;
 
 use Doctrine\ORM\EntityManagerInterface;
diff --git a/module/Core/src/Service/ShortUrlServiceInterface.php b/module/Core/src/Service/ShortUrlServiceInterface.php
index bc9b8daf..e299842d 100644
--- a/module/Core/src/Service/ShortUrlServiceInterface.php
+++ b/module/Core/src/Service/ShortUrlServiceInterface.php
@@ -1,4 +1,6 @@
 <?php
+declare(strict_types=1);
+
 namespace Shlinkio\Shlink\Core\Service;
 
 use Shlinkio\Shlink\Core\Entity\ShortUrl;
diff --git a/module/Core/src/Service/Tag/TagService.php b/module/Core/src/Service/Tag/TagService.php
index 97fdca2d..b9427eee 100644
--- a/module/Core/src/Service/Tag/TagService.php
+++ b/module/Core/src/Service/Tag/TagService.php
@@ -1,4 +1,6 @@
 <?php
+declare(strict_types=1);
+
 namespace Shlinkio\Shlink\Core\Service\Tag;
 
 use Doctrine\Common\Collections\Collection;
diff --git a/module/Core/src/Service/Tag/TagServiceInterface.php b/module/Core/src/Service/Tag/TagServiceInterface.php
index 48714309..7ee57bda 100644
--- a/module/Core/src/Service/Tag/TagServiceInterface.php
+++ b/module/Core/src/Service/Tag/TagServiceInterface.php
@@ -1,4 +1,6 @@
 <?php
+declare(strict_types=1);
+
 namespace Shlinkio\Shlink\Core\Service\Tag;
 
 use Doctrine\Common\Collections\Collection;
diff --git a/module/Core/src/Service/UrlShortener.php b/module/Core/src/Service/UrlShortener.php
index 67e32626..df4ee8ed 100644
--- a/module/Core/src/Service/UrlShortener.php
+++ b/module/Core/src/Service/UrlShortener.php
@@ -1,4 +1,6 @@
 <?php
+declare(strict_types=1);
+
 namespace Shlinkio\Shlink\Core\Service;
 
 use Doctrine\Common\Cache\Cache;
@@ -152,7 +154,7 @@ class UrlShortener implements UrlShortenerInterface
         }
 
         // Validate short code format
-        if (! preg_match('|[' . $this->chars . "]+|", $shortCode)) {
+        if (! preg_match('|[' . $this->chars . ']+|', $shortCode)) {
             throw InvalidShortCodeException::fromCharset($shortCode, $this->chars);
         }
 
diff --git a/module/Core/src/Service/UrlShortenerInterface.php b/module/Core/src/Service/UrlShortenerInterface.php
index 4ddf4b7b..c677ec4e 100644
--- a/module/Core/src/Service/UrlShortenerInterface.php
+++ b/module/Core/src/Service/UrlShortenerInterface.php
@@ -1,4 +1,6 @@
 <?php
+declare(strict_types=1);
+
 namespace Shlinkio\Shlink\Core\Service;
 
 use Psr\Http\Message\UriInterface;
diff --git a/module/Core/src/Service/VisitService.php b/module/Core/src/Service/VisitService.php
index 375cc57e..ab18ce1c 100644
--- a/module/Core/src/Service/VisitService.php
+++ b/module/Core/src/Service/VisitService.php
@@ -1,4 +1,6 @@
 <?php
+declare(strict_types=1);
+
 namespace Shlinkio\Shlink\Core\Service;
 
 use Doctrine\ORM\EntityManagerInterface;
diff --git a/module/Core/src/Service/VisitServiceInterface.php b/module/Core/src/Service/VisitServiceInterface.php
index 8347fdb3..46f6ceb7 100644
--- a/module/Core/src/Service/VisitServiceInterface.php
+++ b/module/Core/src/Service/VisitServiceInterface.php
@@ -1,4 +1,6 @@
 <?php
+declare(strict_types=1);
+
 namespace Shlinkio\Shlink\Core\Service;
 
 use Shlinkio\Shlink\Core\Entity\Visit;
diff --git a/module/Core/src/Service/VisitsTracker.php b/module/Core/src/Service/VisitsTracker.php
index 92bafa71..360b0d2b 100644
--- a/module/Core/src/Service/VisitsTracker.php
+++ b/module/Core/src/Service/VisitsTracker.php
@@ -1,4 +1,6 @@
 <?php
+declare(strict_types=1);
+
 namespace Shlinkio\Shlink\Core\Service;
 
 use Doctrine\ORM\EntityManagerInterface;
diff --git a/module/Core/src/Service/VisitsTrackerInterface.php b/module/Core/src/Service/VisitsTrackerInterface.php
index 6aecabe4..8dfa6145 100644
--- a/module/Core/src/Service/VisitsTrackerInterface.php
+++ b/module/Core/src/Service/VisitsTrackerInterface.php
@@ -1,4 +1,6 @@
 <?php
+declare(strict_types=1);
+
 namespace Shlinkio\Shlink\Core\Service;
 
 use Psr\Http\Message\ServerRequestInterface;
diff --git a/module/Core/src/Util/TagManagerTrait.php b/module/Core/src/Util/TagManagerTrait.php
index e20e1919..2d1b3d6c 100644
--- a/module/Core/src/Util/TagManagerTrait.php
+++ b/module/Core/src/Util/TagManagerTrait.php
@@ -1,4 +1,6 @@
 <?php
+declare(strict_types=1);
+
 namespace Shlinkio\Shlink\Core\Util;
 
 use Doctrine\Common\Collections;
diff --git a/module/Core/test/Action/PreviewActionTest.php b/module/Core/test/Action/PreviewActionTest.php
index fa7a84c0..5521e677 100644
--- a/module/Core/test/Action/PreviewActionTest.php
+++ b/module/Core/test/Action/PreviewActionTest.php
@@ -1,4 +1,6 @@
 <?php
+declare(strict_types=1);
+
 namespace ShlinkioTest\Shlink\Core\Action;
 
 use Interop\Http\ServerMiddleware\DelegateInterface;
diff --git a/module/Core/test/Action/QrCodeActionTest.php b/module/Core/test/Action/QrCodeActionTest.php
index ea71d855..85f908e2 100644
--- a/module/Core/test/Action/QrCodeActionTest.php
+++ b/module/Core/test/Action/QrCodeActionTest.php
@@ -1,4 +1,6 @@
 <?php
+declare(strict_types=1);
+
 namespace ShlinkioTest\Shlink\Core\Action;
 
 use Interop\Http\ServerMiddleware\DelegateInterface;
diff --git a/module/Core/test/Action/RedirectActionTest.php b/module/Core/test/Action/RedirectActionTest.php
index 6e629772..e2cc700a 100644
--- a/module/Core/test/Action/RedirectActionTest.php
+++ b/module/Core/test/Action/RedirectActionTest.php
@@ -1,4 +1,6 @@
 <?php
+declare(strict_types=1);
+
 namespace ShlinkioTest\Shlink\Core\Action;
 
 use Interop\Http\ServerMiddleware\DelegateInterface;
diff --git a/module/Core/test/ConfigProviderTest.php b/module/Core/test/ConfigProviderTest.php
index ce9dea72..f3633040 100644
--- a/module/Core/test/ConfigProviderTest.php
+++ b/module/Core/test/ConfigProviderTest.php
@@ -1,4 +1,6 @@
 <?php
+declare(strict_types=1);
+
 namespace ShlinkioTest\Shlink\Core;
 
 use PHPUnit\Framework\TestCase;
diff --git a/module/Core/test/Entity/TagTest.php b/module/Core/test/Entity/TagTest.php
index 84d0010e..53ba6e21 100644
--- a/module/Core/test/Entity/TagTest.php
+++ b/module/Core/test/Entity/TagTest.php
@@ -1,4 +1,6 @@
 <?php
+declare(strict_types=1);
+
 namespace ShlinkioTest\Shlink\Core\Entity;
 
 use PHPUnit\Framework\TestCase;
diff --git a/module/Core/test/Middleware/QrCodeCacheMiddlewareTest.php b/module/Core/test/Middleware/QrCodeCacheMiddlewareTest.php
index 7e1ffc65..5b173f68 100644
--- a/module/Core/test/Middleware/QrCodeCacheMiddlewareTest.php
+++ b/module/Core/test/Middleware/QrCodeCacheMiddlewareTest.php
@@ -1,4 +1,6 @@
 <?php
+declare(strict_types=1);
+
 namespace ShlinkioTest\Shlink\Core\Middleware;
 
 use Doctrine\Common\Cache\ArrayCache;
diff --git a/module/Core/test/Options/AppOptionsFactoryTest.php b/module/Core/test/Options/AppOptionsFactoryTest.php
index 7d1b503b..b9bbe498 100644
--- a/module/Core/test/Options/AppOptionsFactoryTest.php
+++ b/module/Core/test/Options/AppOptionsFactoryTest.php
@@ -1,4 +1,6 @@
 <?php
+declare(strict_types=1);
+
 namespace ShlinkioTest\Shlink\Core\Options;
 
 use PHPUnit\Framework\TestCase;
diff --git a/module/Core/test/Service/ShortUrlServiceTest.php b/module/Core/test/Service/ShortUrlServiceTest.php
index f8b9ced7..ed98a5bc 100644
--- a/module/Core/test/Service/ShortUrlServiceTest.php
+++ b/module/Core/test/Service/ShortUrlServiceTest.php
@@ -1,4 +1,6 @@
 <?php
+declare(strict_types=1);
+
 namespace ShlinkioTest\Shlink\Core\Service;
 
 use Doctrine\ORM\EntityManagerInterface;
diff --git a/module/Core/test/Service/Tag/TagServiceTest.php b/module/Core/test/Service/Tag/TagServiceTest.php
index fcae18d0..e245c17a 100644
--- a/module/Core/test/Service/Tag/TagServiceTest.php
+++ b/module/Core/test/Service/Tag/TagServiceTest.php
@@ -1,8 +1,11 @@
 <?php
+declare(strict_types=1);
+
 namespace ShlinkioTest\Shlink\Core\Service\Tag;
 
 use Doctrine\ORM\EntityManagerInterface;
 use Doctrine\ORM\EntityRepository;
+use PHPUnit\Framework\TestCase;
 use Prophecy\Argument;
 use Prophecy\Prophecy\MethodProphecy;
 use Prophecy\Prophecy\ObjectProphecy;
@@ -10,7 +13,6 @@ use Shlinkio\Shlink\Core\Entity\Tag;
 use Shlinkio\Shlink\Core\Exception\EntityDoesNotExistException;
 use Shlinkio\Shlink\Core\Repository\TagRepository;
 use Shlinkio\Shlink\Core\Service\Tag\TagService;
-use PHPUnit\Framework\TestCase;
 
 class TagServiceTest extends TestCase
 {
diff --git a/module/Core/test/Service/UrlShortenerTest.php b/module/Core/test/Service/UrlShortenerTest.php
index 5d39deb4..6b7ed22c 100644
--- a/module/Core/test/Service/UrlShortenerTest.php
+++ b/module/Core/test/Service/UrlShortenerTest.php
@@ -1,4 +1,6 @@
 <?php
+declare(strict_types=1);
+
 namespace ShlinkioTest\Shlink\Core\Service;
 
 use Doctrine\Common\Cache\ArrayCache;
diff --git a/module/Core/test/Service/VisitServiceTest.php b/module/Core/test/Service/VisitServiceTest.php
index e2cd8b23..8c226089 100644
--- a/module/Core/test/Service/VisitServiceTest.php
+++ b/module/Core/test/Service/VisitServiceTest.php
@@ -1,4 +1,6 @@
 <?php
+declare(strict_types=1);
+
 namespace ShlinkioTest\Shlink\Core\Service;
 
 use Doctrine\ORM\EntityManager;
diff --git a/module/Core/test/Service/VisitsTrackerTest.php b/module/Core/test/Service/VisitsTrackerTest.php
index 8ef41ec0..a3d475c4 100644
--- a/module/Core/test/Service/VisitsTrackerTest.php
+++ b/module/Core/test/Service/VisitsTrackerTest.php
@@ -1,4 +1,6 @@
 <?php
+declare(strict_types=1);
+
 namespace ShlinkioTest\Shlink\Core\Service;
 
 use Doctrine\ORM\EntityManager;
diff --git a/module/Rest/config/dependencies.config.php b/module/Rest/config/dependencies.config.php
index 8f2227c0..760f46c8 100644
--- a/module/Rest/config/dependencies.config.php
+++ b/module/Rest/config/dependencies.config.php
@@ -1,4 +1,5 @@
 <?php
+declare(strict_types=1);
 
 use Psr\Log\LoggerInterface;
 use Shlinkio\Shlink\Core\Options\AppOptions;
@@ -45,7 +46,7 @@ return [
             Service\UrlShortener::class,
             'translator',
             'config.url_shortener.domain',
-            'Logger_Shlink'
+            'Logger_Shlink',
         ],
         Action\ResolveUrlAction::class => [Service\UrlShortener::class, 'translator'],
         Action\GetVisitsAction::class => [Service\VisitsTracker::class, 'translator', 'Logger_Shlink'],
diff --git a/module/Rest/config/entity-manager.config.php b/module/Rest/config/entity-manager.config.php
index e9359519..e5008568 100644
--- a/module/Rest/config/entity-manager.config.php
+++ b/module/Rest/config/entity-manager.config.php
@@ -1,4 +1,6 @@
 <?php
+declare(strict_types=1);
+
 return [
 
     'entity_manager' => [
diff --git a/module/Rest/config/error-handler.config.php b/module/Rest/config/error-handler.config.php
index cb06f6bf..b3df3f7c 100644
--- a/module/Rest/config/error-handler.config.php
+++ b/module/Rest/config/error-handler.config.php
@@ -1,4 +1,6 @@
 <?php
+declare(strict_types=1);
+
 use Shlinkio\Shlink\Rest\ErrorHandler\JsonErrorResponseGenerator;
 
 return [
diff --git a/module/Rest/config/routes.config.php b/module/Rest/config/routes.config.php
index 0922e18a..742f904b 100644
--- a/module/Rest/config/routes.config.php
+++ b/module/Rest/config/routes.config.php
@@ -1,6 +1,8 @@
 <?php
-use Shlinkio\Shlink\Rest\Action;
+declare(strict_types=1);
+
 use Fig\Http\Message\RequestMethodInterface as RequestMethod;
+use Shlinkio\Shlink\Rest\Action;
 
 return [
 
diff --git a/module/Rest/config/translator.config.php b/module/Rest/config/translator.config.php
index ae120db3..659d4cae 100644
--- a/module/Rest/config/translator.config.php
+++ b/module/Rest/config/translator.config.php
@@ -1,4 +1,6 @@
 <?php
+declare(strict_types=1);
+
 return [
 
     'translator' => [
diff --git a/module/Rest/src/Action/AbstractRestAction.php b/module/Rest/src/Action/AbstractRestAction.php
index 01b8c13d..9ba1e650 100644
--- a/module/Rest/src/Action/AbstractRestAction.php
+++ b/module/Rest/src/Action/AbstractRestAction.php
@@ -1,4 +1,6 @@
 <?php
+declare(strict_types=1);
+
 namespace Shlinkio\Shlink\Rest\Action;
 
 use Fig\Http\Message\RequestMethodInterface;
diff --git a/module/Rest/src/Action/AuthenticateAction.php b/module/Rest/src/Action/AuthenticateAction.php
index 1403e88e..f4ac08b0 100644
--- a/module/Rest/src/Action/AuthenticateAction.php
+++ b/module/Rest/src/Action/AuthenticateAction.php
@@ -1,4 +1,6 @@
 <?php
+declare(strict_types=1);
+
 namespace Shlinkio\Shlink\Rest\Action;
 
 use Interop\Http\ServerMiddleware\DelegateInterface;
diff --git a/module/Rest/src/Action/CreateShortcodeAction.php b/module/Rest/src/Action/CreateShortcodeAction.php
index e140f4f7..9915a5ec 100644
--- a/module/Rest/src/Action/CreateShortcodeAction.php
+++ b/module/Rest/src/Action/CreateShortcodeAction.php
@@ -1,4 +1,6 @@
 <?php
+declare(strict_types=1);
+
 namespace Shlinkio\Shlink\Rest\Action;
 
 use Interop\Http\ServerMiddleware\DelegateInterface;
diff --git a/module/Rest/src/Action/EditShortcodeTagsAction.php b/module/Rest/src/Action/EditShortcodeTagsAction.php
index 9ad8113f..b1aa6492 100644
--- a/module/Rest/src/Action/EditShortcodeTagsAction.php
+++ b/module/Rest/src/Action/EditShortcodeTagsAction.php
@@ -1,4 +1,6 @@
 <?php
+declare(strict_types=1);
+
 namespace Shlinkio\Shlink\Rest\Action;
 
 use Interop\Http\ServerMiddleware\DelegateInterface;
diff --git a/module/Rest/src/Action/GetVisitsAction.php b/module/Rest/src/Action/GetVisitsAction.php
index df11f312..0d03acf1 100644
--- a/module/Rest/src/Action/GetVisitsAction.php
+++ b/module/Rest/src/Action/GetVisitsAction.php
@@ -1,4 +1,6 @@
 <?php
+declare(strict_types=1);
+
 namespace Shlinkio\Shlink\Rest\Action;
 
 use Interop\Http\ServerMiddleware\DelegateInterface;
@@ -51,10 +53,10 @@ class GetVisitsAction extends AbstractRestAction
             return new JsonResponse([
                 'visits' => [
                     'data' => $visits,
-                ]
+                ],
             ]);
         } catch (InvalidArgumentException $e) {
-            $this->logger->warning('Provided nonexistent shortcode'. PHP_EOL . $e);
+            $this->logger->warning('Provided nonexistent shortcode' . PHP_EOL . $e);
             return new JsonResponse([
                 'error' => RestUtils::getRestErrorCodeFromException($e),
                 'message' => sprintf(
@@ -63,7 +65,7 @@ class GetVisitsAction extends AbstractRestAction
                 ),
             ], self::STATUS_NOT_FOUND);
         } catch (\Exception $e) {
-            $this->logger->error('Unexpected error while parsing short code'. PHP_EOL . $e);
+            $this->logger->error('Unexpected error while parsing short code' . PHP_EOL . $e);
             return new JsonResponse([
                 'error' => RestUtils::UNKNOWN_ERROR,
                 'message' => $this->translator->translate('Unexpected error occurred'),
diff --git a/module/Rest/src/Action/ListShortcodesAction.php b/module/Rest/src/Action/ListShortcodesAction.php
index aa941375..83007e29 100644
--- a/module/Rest/src/Action/ListShortcodesAction.php
+++ b/module/Rest/src/Action/ListShortcodesAction.php
@@ -1,4 +1,6 @@
 <?php
+declare(strict_types=1);
+
 namespace Shlinkio\Shlink\Rest\Action;
 
 use Interop\Http\ServerMiddleware\DelegateInterface;
diff --git a/module/Rest/src/Action/ResolveUrlAction.php b/module/Rest/src/Action/ResolveUrlAction.php
index 0e7176a4..f20d4222 100644
--- a/module/Rest/src/Action/ResolveUrlAction.php
+++ b/module/Rest/src/Action/ResolveUrlAction.php
@@ -1,4 +1,6 @@
 <?php
+declare(strict_types=1);
+
 namespace Shlinkio\Shlink\Rest\Action;
 
 use Interop\Http\ServerMiddleware\DelegateInterface;
diff --git a/module/Rest/src/Action/Tag/CreateTagsAction.php b/module/Rest/src/Action/Tag/CreateTagsAction.php
index 99c5e485..da27547c 100644
--- a/module/Rest/src/Action/Tag/CreateTagsAction.php
+++ b/module/Rest/src/Action/Tag/CreateTagsAction.php
@@ -1,4 +1,6 @@
 <?php
+declare(strict_types=1);
+
 namespace Shlinkio\Shlink\Rest\Action\Tag;
 
 use Interop\Http\ServerMiddleware\DelegateInterface;
diff --git a/module/Rest/src/Action/Tag/DeleteTagsAction.php b/module/Rest/src/Action/Tag/DeleteTagsAction.php
index 84dc88c3..ce172cb5 100644
--- a/module/Rest/src/Action/Tag/DeleteTagsAction.php
+++ b/module/Rest/src/Action/Tag/DeleteTagsAction.php
@@ -1,4 +1,6 @@
 <?php
+declare(strict_types=1);
+
 namespace Shlinkio\Shlink\Rest\Action\Tag;
 
 use Interop\Http\ServerMiddleware\DelegateInterface;
diff --git a/module/Rest/src/Action/Tag/ListTagsAction.php b/module/Rest/src/Action/Tag/ListTagsAction.php
index 9d23e18e..c78f4ca4 100644
--- a/module/Rest/src/Action/Tag/ListTagsAction.php
+++ b/module/Rest/src/Action/Tag/ListTagsAction.php
@@ -1,4 +1,6 @@
 <?php
+declare(strict_types=1);
+
 namespace Shlinkio\Shlink\Rest\Action\Tag;
 
 use Interop\Http\ServerMiddleware\DelegateInterface;
diff --git a/module/Rest/src/Action/Tag/UpdateTagAction.php b/module/Rest/src/Action/Tag/UpdateTagAction.php
index b2c4e395..bb8fbbe2 100644
--- a/module/Rest/src/Action/Tag/UpdateTagAction.php
+++ b/module/Rest/src/Action/Tag/UpdateTagAction.php
@@ -1,4 +1,6 @@
 <?php
+declare(strict_types=1);
+
 namespace Shlinkio\Shlink\Rest\Action\Tag;
 
 use Interop\Http\ServerMiddleware\DelegateInterface;
diff --git a/module/Rest/src/Authentication/JWTService.php b/module/Rest/src/Authentication/JWTService.php
index b8f1be96..74130438 100644
--- a/module/Rest/src/Authentication/JWTService.php
+++ b/module/Rest/src/Authentication/JWTService.php
@@ -1,4 +1,6 @@
 <?php
+declare(strict_types=1);
+
 namespace Shlinkio\Shlink\Rest\Authentication;
 
 use Firebase\JWT\JWT;
diff --git a/module/Rest/src/Authentication/JWTServiceInterface.php b/module/Rest/src/Authentication/JWTServiceInterface.php
index 278e6c67..55c8fb36 100644
--- a/module/Rest/src/Authentication/JWTServiceInterface.php
+++ b/module/Rest/src/Authentication/JWTServiceInterface.php
@@ -1,4 +1,6 @@
 <?php
+declare(strict_types=1);
+
 namespace Shlinkio\Shlink\Rest\Authentication;
 
 use Shlinkio\Shlink\Rest\Entity\ApiKey;
diff --git a/module/Rest/src/ConfigProvider.php b/module/Rest/src/ConfigProvider.php
index 0ad10a94..3fc7a9be 100644
--- a/module/Rest/src/ConfigProvider.php
+++ b/module/Rest/src/ConfigProvider.php
@@ -1,4 +1,6 @@
 <?php
+declare(strict_types=1);
+
 namespace Shlinkio\Shlink\Rest;
 
 use Zend\Config\Factory;
diff --git a/module/Rest/src/Entity/ApiKey.php b/module/Rest/src/Entity/ApiKey.php
index 0f458c11..4ef72f92 100644
--- a/module/Rest/src/Entity/ApiKey.php
+++ b/module/Rest/src/Entity/ApiKey.php
@@ -1,4 +1,6 @@
 <?php
+declare(strict_types=1);
+
 namespace Shlinkio\Shlink\Rest\Entity;
 
 use Doctrine\ORM\Mapping as ORM;
diff --git a/module/Rest/src/ErrorHandler/JsonErrorResponseGenerator.php b/module/Rest/src/ErrorHandler/JsonErrorResponseGenerator.php
index 0f26957c..6b865e59 100644
--- a/module/Rest/src/ErrorHandler/JsonErrorResponseGenerator.php
+++ b/module/Rest/src/ErrorHandler/JsonErrorResponseGenerator.php
@@ -1,4 +1,6 @@
 <?php
+declare(strict_types=1);
+
 namespace Shlinkio\Shlink\Rest\ErrorHandler;
 
 use Acelaya\ExpressiveErrorHandler\ErrorHandler\ErrorResponseGeneratorInterface;
@@ -6,7 +8,6 @@ use Fig\Http\Message\StatusCodeInterface;
 use Psr\Http\Message\ResponseInterface as Response;
 use Psr\Http\Message\ServerRequestInterface as Request;
 use Zend\Diactoros\Response\JsonResponse;
-use Zend\Expressive\Router\RouteResult;
 
 class JsonErrorResponseGenerator implements ErrorResponseGeneratorInterface, StatusCodeInterface
 {
diff --git a/module/Rest/src/Exception/AuthenticationException.php b/module/Rest/src/Exception/AuthenticationException.php
index 3a77a5d3..36c151f3 100644
--- a/module/Rest/src/Exception/AuthenticationException.php
+++ b/module/Rest/src/Exception/AuthenticationException.php
@@ -1,4 +1,6 @@
 <?php
+declare(strict_types=1);
+
 namespace Shlinkio\Shlink\Rest\Exception;
 
 use Shlinkio\Shlink\Common\Exception\ExceptionInterface;
diff --git a/module/Rest/src/Middleware/BodyParserMiddleware.php b/module/Rest/src/Middleware/BodyParserMiddleware.php
index b12c8ef1..35bfbdfa 100644
--- a/module/Rest/src/Middleware/BodyParserMiddleware.php
+++ b/module/Rest/src/Middleware/BodyParserMiddleware.php
@@ -1,4 +1,6 @@
 <?php
+declare(strict_types=1);
+
 namespace Shlinkio\Shlink\Rest\Middleware;
 
 use Fig\Http\Message\RequestMethodInterface;
@@ -28,7 +30,7 @@ class BodyParserMiddleware implements MiddlewareInterface, RequestMethodInterfac
         if (! empty($currentParams) || in_array($method, [
             self::METHOD_GET,
             self::METHOD_HEAD,
-            self::METHOD_OPTIONS
+            self::METHOD_OPTIONS,
         ], true)) {
             return $delegate->process($request);
         }
diff --git a/module/Rest/src/Middleware/CheckAuthenticationMiddleware.php b/module/Rest/src/Middleware/CheckAuthenticationMiddleware.php
index 93537d35..b5823f4f 100644
--- a/module/Rest/src/Middleware/CheckAuthenticationMiddleware.php
+++ b/module/Rest/src/Middleware/CheckAuthenticationMiddleware.php
@@ -1,4 +1,6 @@
 <?php
+declare(strict_types=1);
+
 namespace Shlinkio\Shlink\Rest\Middleware;
 
 use Fig\Http\Message\StatusCodeInterface;
diff --git a/module/Rest/src/Middleware/CrossDomainMiddleware.php b/module/Rest/src/Middleware/CrossDomainMiddleware.php
index 213a3541..9237c743 100644
--- a/module/Rest/src/Middleware/CrossDomainMiddleware.php
+++ b/module/Rest/src/Middleware/CrossDomainMiddleware.php
@@ -1,4 +1,6 @@
 <?php
+declare(strict_types=1);
+
 namespace Shlinkio\Shlink\Rest\Middleware;
 
 use Fig\Http\Message\RequestMethodInterface;
diff --git a/module/Rest/src/Middleware/PathVersionMiddleware.php b/module/Rest/src/Middleware/PathVersionMiddleware.php
index b247f50c..f3ccdd01 100644
--- a/module/Rest/src/Middleware/PathVersionMiddleware.php
+++ b/module/Rest/src/Middleware/PathVersionMiddleware.php
@@ -1,4 +1,6 @@
 <?php
+declare(strict_types=1);
+
 namespace Shlinkio\Shlink\Rest\Middleware;
 
 use Psr\Http\Message\ResponseInterface as Response;
diff --git a/module/Rest/src/Service/ApiKeyService.php b/module/Rest/src/Service/ApiKeyService.php
index 66545912..e2473f1b 100644
--- a/module/Rest/src/Service/ApiKeyService.php
+++ b/module/Rest/src/Service/ApiKeyService.php
@@ -1,4 +1,6 @@
 <?php
+declare(strict_types=1);
+
 namespace Shlinkio\Shlink\Rest\Service;
 
 use Doctrine\ORM\EntityManagerInterface;
diff --git a/module/Rest/src/Service/ApiKeyServiceInterface.php b/module/Rest/src/Service/ApiKeyServiceInterface.php
index e1b8ce53..51dadf7a 100644
--- a/module/Rest/src/Service/ApiKeyServiceInterface.php
+++ b/module/Rest/src/Service/ApiKeyServiceInterface.php
@@ -1,4 +1,6 @@
 <?php
+declare(strict_types=1);
+
 namespace Shlinkio\Shlink\Rest\Service;
 
 use Shlinkio\Shlink\Rest\Entity\ApiKey;
diff --git a/module/Rest/src/Util/RestUtils.php b/module/Rest/src/Util/RestUtils.php
index 4f4332c4..f18ae72e 100644
--- a/module/Rest/src/Util/RestUtils.php
+++ b/module/Rest/src/Util/RestUtils.php
@@ -1,4 +1,6 @@
 <?php
+declare(strict_types=1);
+
 namespace Shlinkio\Shlink\Rest\Util;
 
 use Shlinkio\Shlink\Common\Exception as Common;
diff --git a/module/Rest/test/Action/AuthenticateActionTest.php b/module/Rest/test/Action/AuthenticateActionTest.php
index 2a929495..32079e9b 100644
--- a/module/Rest/test/Action/AuthenticateActionTest.php
+++ b/module/Rest/test/Action/AuthenticateActionTest.php
@@ -1,4 +1,6 @@
 <?php
+declare(strict_types=1);
+
 namespace ShlinkioTest\Shlink\Rest\Action;
 
 use PHPUnit\Framework\TestCase;
diff --git a/module/Rest/test/Action/CreateShortcodeActionTest.php b/module/Rest/test/Action/CreateShortcodeActionTest.php
index 3b2eec10..a5590785 100644
--- a/module/Rest/test/Action/CreateShortcodeActionTest.php
+++ b/module/Rest/test/Action/CreateShortcodeActionTest.php
@@ -1,4 +1,6 @@
 <?php
+declare(strict_types=1);
+
 namespace ShlinkioTest\Shlink\Rest\Action;
 
 use PHPUnit\Framework\TestCase;
diff --git a/module/Rest/test/Action/EditShortcodeTagsActionTest.php b/module/Rest/test/Action/EditShortcodeTagsActionTest.php
index 72f1dee9..f90c73f0 100644
--- a/module/Rest/test/Action/EditShortcodeTagsActionTest.php
+++ b/module/Rest/test/Action/EditShortcodeTagsActionTest.php
@@ -1,4 +1,6 @@
 <?php
+declare(strict_types=1);
+
 namespace ShlinkioTest\Shlink\Rest\Action;
 
 use PHPUnit\Framework\TestCase;
diff --git a/module/Rest/test/Action/GetVisitsActionTest.php b/module/Rest/test/Action/GetVisitsActionTest.php
index ee356d1e..eb892e74 100644
--- a/module/Rest/test/Action/GetVisitsActionTest.php
+++ b/module/Rest/test/Action/GetVisitsActionTest.php
@@ -1,4 +1,6 @@
 <?php
+declare(strict_types=1);
+
 namespace ShlinkioTest\Shlink\Rest\Action;
 
 use PHPUnit\Framework\TestCase;
diff --git a/module/Rest/test/Action/ListShortcodesActionTest.php b/module/Rest/test/Action/ListShortcodesActionTest.php
index 1fee9b28..1867d15a 100644
--- a/module/Rest/test/Action/ListShortcodesActionTest.php
+++ b/module/Rest/test/Action/ListShortcodesActionTest.php
@@ -1,4 +1,6 @@
 <?php
+declare(strict_types=1);
+
 namespace ShlinkioTest\Shlink\Rest\Action;
 
 use PHPUnit\Framework\TestCase;
diff --git a/module/Rest/test/Action/ResolveUrlActionTest.php b/module/Rest/test/Action/ResolveUrlActionTest.php
index 5b6a8355..48c17b20 100644
--- a/module/Rest/test/Action/ResolveUrlActionTest.php
+++ b/module/Rest/test/Action/ResolveUrlActionTest.php
@@ -1,4 +1,6 @@
 <?php
+declare(strict_types=1);
+
 namespace ShlinkioTest\Shlink\Rest\Action;
 
 use PHPUnit\Framework\TestCase;
diff --git a/module/Rest/test/Action/Tag/CreateTagsActionTest.php b/module/Rest/test/Action/Tag/CreateTagsActionTest.php
index 22592e68..795827fa 100644
--- a/module/Rest/test/Action/Tag/CreateTagsActionTest.php
+++ b/module/Rest/test/Action/Tag/CreateTagsActionTest.php
@@ -1,4 +1,6 @@
 <?php
+declare(strict_types=1);
+
 namespace ShlinkioTest\Shlink\Rest\Action\Tag;
 
 use Doctrine\Common\Collections\ArrayCollection;
diff --git a/module/Rest/test/Action/Tag/DeleteTagsActionTest.php b/module/Rest/test/Action/Tag/DeleteTagsActionTest.php
index 26c92484..0a0657bf 100644
--- a/module/Rest/test/Action/Tag/DeleteTagsActionTest.php
+++ b/module/Rest/test/Action/Tag/DeleteTagsActionTest.php
@@ -1,4 +1,6 @@
 <?php
+declare(strict_types=1);
+
 namespace ShlinkioTest\Shlink\Rest\Action\Tag;
 
 use Interop\Http\ServerMiddleware\DelegateInterface;
diff --git a/module/Rest/test/Action/Tag/ListTagsActionTest.php b/module/Rest/test/Action/Tag/ListTagsActionTest.php
index d03791c3..67e395b1 100644
--- a/module/Rest/test/Action/Tag/ListTagsActionTest.php
+++ b/module/Rest/test/Action/Tag/ListTagsActionTest.php
@@ -1,4 +1,6 @@
 <?php
+declare(strict_types=1);
+
 namespace ShlinkioTest\Shlink\Rest\Action\Tag;
 
 use Interop\Http\ServerMiddleware\DelegateInterface;
diff --git a/module/Rest/test/Action/Tag/UpdateTagActionTest.php b/module/Rest/test/Action/Tag/UpdateTagActionTest.php
index 52b2274b..fbbd7c60 100644
--- a/module/Rest/test/Action/Tag/UpdateTagActionTest.php
+++ b/module/Rest/test/Action/Tag/UpdateTagActionTest.php
@@ -1,4 +1,6 @@
 <?php
+declare(strict_types=1);
+
 namespace ShlinkioTest\Shlink\Rest\Action\Tag;
 
 use Interop\Http\ServerMiddleware\DelegateInterface;
diff --git a/module/Rest/test/Authentication/JWTServiceTest.php b/module/Rest/test/Authentication/JWTServiceTest.php
index 66f90f25..a80680f8 100644
--- a/module/Rest/test/Authentication/JWTServiceTest.php
+++ b/module/Rest/test/Authentication/JWTServiceTest.php
@@ -1,4 +1,6 @@
 <?php
+declare(strict_types=1);
+
 namespace ShlinkioTest\Shlink\Rest\Authentication;
 
 use Firebase\JWT\JWT;
diff --git a/module/Rest/test/ConfigProviderTest.php b/module/Rest/test/ConfigProviderTest.php
index a512e31a..36f95cc6 100644
--- a/module/Rest/test/ConfigProviderTest.php
+++ b/module/Rest/test/ConfigProviderTest.php
@@ -1,4 +1,6 @@
 <?php
+declare(strict_types=1);
+
 namespace ShlinkioTest\Shlink\Rest;
 
 use PHPUnit\Framework\TestCase;
diff --git a/module/Rest/test/ErrorHandler/JsonErrorResponseGeneratorTest.php b/module/Rest/test/ErrorHandler/JsonErrorResponseGeneratorTest.php
index 164ce6eb..7c0eaaff 100644
--- a/module/Rest/test/ErrorHandler/JsonErrorResponseGeneratorTest.php
+++ b/module/Rest/test/ErrorHandler/JsonErrorResponseGeneratorTest.php
@@ -1,4 +1,6 @@
 <?php
+declare(strict_types=1);
+
 namespace ShlinkioTest\Shlink\Rest\ErrorHandler;
 
 use PHPUnit\Framework\TestCase;
diff --git a/module/Rest/test/Middleware/BodyParserMiddlewareTest.php b/module/Rest/test/Middleware/BodyParserMiddlewareTest.php
index f42c99ef..1c927f4f 100644
--- a/module/Rest/test/Middleware/BodyParserMiddlewareTest.php
+++ b/module/Rest/test/Middleware/BodyParserMiddlewareTest.php
@@ -1,4 +1,6 @@
 <?php
+declare(strict_types=1);
+
 namespace ShlinkioTest\Shlink\Rest\Middleware;
 
 use Interop\Http\ServerMiddleware\DelegateInterface;
diff --git a/module/Rest/test/Middleware/CheckAuthenticationMiddlewareTest.php b/module/Rest/test/Middleware/CheckAuthenticationMiddlewareTest.php
index dcb905fe..1600f877 100644
--- a/module/Rest/test/Middleware/CheckAuthenticationMiddlewareTest.php
+++ b/module/Rest/test/Middleware/CheckAuthenticationMiddlewareTest.php
@@ -1,4 +1,6 @@
 <?php
+declare(strict_types=1);
+
 namespace ShlinkioTest\Shlink\Rest\Middleware;
 
 use Interop\Http\ServerMiddleware\DelegateInterface;
diff --git a/module/Rest/test/Middleware/CrossDomainMiddlewareTest.php b/module/Rest/test/Middleware/CrossDomainMiddlewareTest.php
index 8ca260fd..dcc7e878 100644
--- a/module/Rest/test/Middleware/CrossDomainMiddlewareTest.php
+++ b/module/Rest/test/Middleware/CrossDomainMiddlewareTest.php
@@ -1,4 +1,6 @@
 <?php
+declare(strict_types=1);
+
 namespace ShlinkioTest\Shlink\Rest\Middleware;
 
 use Interop\Http\ServerMiddleware\DelegateInterface;
diff --git a/module/Rest/test/Middleware/PathVersionMiddlewareTest.php b/module/Rest/test/Middleware/PathVersionMiddlewareTest.php
index 7957e450..688d807d 100644
--- a/module/Rest/test/Middleware/PathVersionMiddlewareTest.php
+++ b/module/Rest/test/Middleware/PathVersionMiddlewareTest.php
@@ -1,4 +1,6 @@
 <?php
+declare(strict_types=1);
+
 namespace ShlinkioTest\Shlink\Rest\Middleware;
 
 use PHPUnit\Framework\TestCase;
diff --git a/module/Rest/test/Service/ApiKeyServiceTest.php b/module/Rest/test/Service/ApiKeyServiceTest.php
index b0e8e269..fb6c8c0d 100644
--- a/module/Rest/test/Service/ApiKeyServiceTest.php
+++ b/module/Rest/test/Service/ApiKeyServiceTest.php
@@ -1,4 +1,6 @@
 <?php
+declare(strict_types=1);
+
 namespace ShlinkioTest\Shlink\Rest\Service;
 
 use Doctrine\ORM\EntityManager;
diff --git a/module/Rest/test/Util/RestUtilsTest.php b/module/Rest/test/Util/RestUtilsTest.php
index 0e90bbc0..73752e81 100644
--- a/module/Rest/test/Util/RestUtilsTest.php
+++ b/module/Rest/test/Util/RestUtilsTest.php
@@ -1,4 +1,6 @@
 <?php
+declare(strict_types=1);
+
 namespace ShlinkioTest\Shlink\Rest\Util;
 
 use PHPUnit\Framework\TestCase;
diff --git a/phpcs.xml b/phpcs.xml
index bd3ef63a..99e8af46 100644
--- a/phpcs.xml
+++ b/phpcs.xml
@@ -1,6 +1,7 @@
 <?xml version="1.0"?>
 <ruleset name="Coding standard">
     <description>Coding standard</description>
+    <config name="installed_paths" value="../../slevomat/coding-standard"/>
 
     <!-- display progress -->
     <arg value="p"/>
@@ -9,11 +10,35 @@
     <!-- inherit rules from: -->
     <rule ref="PSR2"/>
     <rule ref="Generic.Arrays.DisallowLongArraySyntax"/>
+    <!-- Make sure string concatenations use 1 space between every element -->
+    <rule ref="Squiz.Strings.ConcatenationSpacing">
+        <properties>
+            <property name="spacing" value="1"/>
+            <property name="ignoreNewlines" value="true"/>
+        </properties>
+    </rule>
     <rule ref="Squiz.WhiteSpace.SuperfluousWhitespace">
         <properties>
             <property name="ignoreBlankLines" value="false"/>
         </properties>
     </rule>
+    <rule ref="Squiz.Strings.DoubleQuoteUsage"/>
+    <rule ref="SlevomatCodingStandard.TypeHints.DeclareStrictTypes">
+        <properties>
+            <property name="newlinesCountBetweenOpenTagAndDeclare" value="1"/>
+            <property name="spacesCountAroundEqualsSign" value="0"/>
+        </properties>
+    </rule>
+    <rule ref="SlevomatCodingStandard.Namespaces.UnusedUses">
+        <properties>
+            <property name="searchAnnotations" value="true"/>
+        </properties>
+    </rule>
+    <!-- Force strict comparison with === or !== instead of == or != -->
+    <rule ref="SlevomatCodingStandard.ControlStructures.DisallowEqualOperators"/>
+    <rule ref="SlevomatCodingStandard.Arrays.TrailingArrayComma"/>
+    <rule ref="SlevomatCodingStandard.Namespaces.AlphabeticallySortedUses"/>
+    <rule ref="SlevomatCodingStandard.TypeHints.ReturnTypeHintSpacing"/>
 
     <!-- Paths to check -->
     <file>bin</file>