From 4b556cd79fc82e95339b89d9485633fce9f63576 Mon Sep 17 00:00:00 2001 From: Alejandro Celaya Date: Tue, 26 Feb 2019 22:56:43 +0100 Subject: [PATCH 1/2] Updated to shlinkio coding standard 1.1.0 --- composer.json | 2 +- config/autoload/logger.global.php | 1 + config/autoload/url-shortener.global.php | 1 + config/config.php | 1 + config/test/bootstrap_api_tests.php | 1 + config/test/bootstrap_db_tests.php | 1 + config/test/test_config.global.php | 1 + module/CLI/src/Command/Api/DisableKeyCommand.php | 1 + module/CLI/src/Command/Api/GenerateKeyCommand.php | 1 + module/CLI/src/Command/Api/ListKeysCommand.php | 1 + module/CLI/src/Command/Config/GenerateCharsetCommand.php | 1 + module/CLI/src/Command/Config/GenerateSecretCommand.php | 1 + module/CLI/src/Command/ShortUrl/DeleteShortUrlCommand.php | 1 + module/CLI/src/Command/ShortUrl/GeneratePreviewCommand.php | 1 + module/CLI/src/Command/ShortUrl/GenerateShortUrlCommand.php | 1 + module/CLI/src/Command/ShortUrl/GetVisitsCommand.php | 1 + module/CLI/src/Command/ShortUrl/ListShortUrlsCommand.php | 1 + module/CLI/src/Command/ShortUrl/ResolveUrlCommand.php | 1 + module/CLI/src/Command/Tag/ListTagsCommand.php | 1 + module/CLI/src/Command/Tag/RenameTagCommand.php | 1 + module/CLI/src/Command/Visit/ProcessVisitsCommand.php | 1 + module/CLI/test/Command/Config/GenerateCharsetCommandTest.php | 1 + module/CLI/test/Command/ShortUrl/DeleteShortUrlCommandTest.php | 2 ++ module/CLI/test/Command/ShortUrl/GeneratePreviewCommandTest.php | 1 + module/CLI/test/Command/ShortUrl/ResolveUrlCommandTest.php | 1 + module/CLI/test/Command/Visit/ProcessVisitsCommandTest.php | 1 + module/CLI/test/Factory/ApplicationFactoryTest.php | 1 + module/Common/functions/functions.php | 1 + module/Common/src/Exception/WrongIpException.php | 1 + module/Common/src/Factory/CacheFactory.php | 1 + module/Common/src/Factory/DottedAccessConfigAbstractFactory.php | 1 + module/Common/src/Factory/LoggerFactory.php | 1 + module/Common/src/IpGeolocation/GeoLite2/DbUpdater.php | 1 + module/Common/src/IpGeolocation/GeoLite2LocationResolver.php | 1 + module/Common/src/IpGeolocation/IpApiLocationResolver.php | 1 + .../src/Logger/Processor/ExceptionWithNewLineProcessor.php | 1 + module/Common/src/Middleware/LocaleMiddleware.php | 1 + .../Common/src/Paginator/Adapter/PaginableRepositoryAdapter.php | 1 + module/Common/src/Paginator/Util/PaginatorUtilsTrait.php | 1 + module/Common/src/Response/PixelResponse.php | 1 + module/Common/src/Service/PreviewGenerator.php | 1 + module/Common/src/Util/IpAddress.php | 1 + module/Common/src/Util/ResponseUtilsTrait.php | 1 + module/Common/test-db/ApiTest/ApiTestCase.php | 1 + module/Common/test-db/TestHelper.php | 1 + module/Common/test/Factory/CacheFactoryTest.php | 1 + .../Common/test/IpGeolocation/EmptyIpLocationResolverTest.php | 1 + module/Common/test/IpGeolocation/IpApiLocationResolverTest.php | 1 + .../test/Logger/Processor/ExceptionWithNewLineProcessorTest.php | 2 ++ module/Common/test/Service/PreviewGeneratorTest.php | 1 + module/Common/test/Util/StringUtilsTraitTest.php | 1 + module/Core/src/Action/AbstractTrackingAction.php | 1 + module/Core/src/Entity/ShortUrl.php | 1 + module/Core/src/Exception/DeleteShortUrlException.php | 1 + module/Core/src/Exception/InvalidShortCodeException.php | 1 + module/Core/src/Exception/InvalidUrlException.php | 1 + module/Core/src/Exception/ValidationException.php | 2 ++ module/Core/src/Options/AppOptions.php | 1 + module/Core/src/Repository/ShortUrlRepository.php | 1 + module/Core/src/Response/NotFoundHandler.php | 1 + module/Core/src/Service/UrlShortener.php | 1 + module/Core/src/Service/VisitsTracker.php | 1 + module/Core/src/Transformer/ShortUrlDataTransformer.php | 1 + module/Core/src/Util/TagManagerTrait.php | 1 + module/Core/test-db/Repository/ShortUrlRepositoryTest.php | 1 + module/Core/test-db/Repository/VisitRepositoryTest.php | 1 + module/Core/test/Action/PreviewActionTest.php | 2 ++ module/Core/test/Exception/DeleteShortUrlExceptionTest.php | 1 + module/Core/test/Exception/IpCannotBeLocatedExceptionTest.php | 1 + module/Core/test/Service/ShortUrl/DeleteShortUrlServiceTest.php | 1 + module/Core/test/Service/ShortUrlServiceTest.php | 1 + module/Core/test/Service/VisitServiceTest.php | 1 + module/Rest/src/Action/AbstractRestAction.php | 1 + .../Rest/src/Action/ShortUrl/AbstractCreateShortUrlAction.php | 1 + module/Rest/src/Action/ShortUrl/DeleteShortUrlAction.php | 1 + module/Rest/src/Action/ShortUrl/EditShortUrlAction.php | 1 + module/Rest/src/Action/ShortUrl/EditShortUrlTagsAction.php | 1 + module/Rest/src/Action/ShortUrl/ResolveShortUrlAction.php | 1 + module/Rest/src/Action/Tag/UpdateTagAction.php | 1 + module/Rest/src/Action/Visit/GetVisitsAction.php | 1 + module/Rest/src/Authentication/JWTService.php | 1 + .../src/Authentication/Plugin/AuthorizationHeaderPlugin.php | 1 + module/Rest/src/Authentication/RequestToHttpAuthPlugin.php | 1 + module/Rest/src/ConfigProvider.php | 1 + module/Rest/src/ErrorHandler/JsonErrorResponseGenerator.php | 1 + module/Rest/src/Exception/VerifyAuthenticationException.php | 1 + module/Rest/src/Middleware/AuthenticationMiddleware.php | 1 + module/Rest/src/Middleware/BodyParserMiddleware.php | 1 + module/Rest/src/Middleware/CrossDomainMiddleware.php | 1 + module/Rest/src/Middleware/PathVersionMiddleware.php | 1 + .../ShortUrl/CreateShortUrlContentNegotiationMiddleware.php | 1 + module/Rest/src/Middleware/ShortUrl/ShortCodePathMiddleware.php | 1 + module/Rest/src/Service/ApiKeyService.php | 1 + module/Rest/test-api/Action/CreateShortUrlActionTest.php | 1 + module/Rest/test-api/Middleware/AuthenticationTest.php | 1 + module/Rest/test/Action/AuthenticateActionTest.php | 1 + module/Rest/test/Action/ShortUrl/CreateShortUrlActionTest.php | 1 + module/Rest/test/Action/ShortUrl/ResolveShortUrlActionTest.php | 1 + module/Rest/test/Action/Tag/ListTagsActionTest.php | 1 + module/Rest/test/Authentication/JWTServiceTest.php | 1 + .../Authentication/Plugin/AuthorizationHeaderPluginTest.php | 1 + module/Rest/test/Authentication/RequestToAuthPluginTest.php | 1 + .../Rest/test/ErrorHandler/JsonErrorResponseGeneratorTest.php | 1 + .../Rest/test/Exception/VerifyAuthenticationExceptionTest.php | 1 + module/Rest/test/Middleware/AuthenticationMiddlewareTest.php | 1 + module/Rest/test/Middleware/BodyParserMiddlewareTest.php | 1 + module/Rest/test/Middleware/PathVersionMiddlewareTest.php | 1 + 107 files changed, 111 insertions(+), 1 deletion(-) diff --git a/composer.json b/composer.json index ed431a24..194b8c80 100644 --- a/composer.json +++ b/composer.json @@ -58,7 +58,7 @@ "phpunit/phpcov": "^6.0@dev || ^5.0", "phpunit/phpunit": "^8.0 || ^7.5", "roave/security-advisories": "dev-master", - "shlinkio/php-coding-standard": "~1.0.0", + "shlinkio/php-coding-standard": "~1.1.0", "symfony/dotenv": "^4.2", "symfony/var-dumper": "^4.2", "zendframework/zend-component-installer": "^2.1", diff --git a/config/autoload/logger.global.php b/config/autoload/logger.global.php index c485516d..435c9ed0 100644 --- a/config/autoload/logger.global.php +++ b/config/autoload/logger.global.php @@ -7,6 +7,7 @@ use Monolog\Handler\RotatingFileHandler; use Monolog\Handler\StreamHandler; use Monolog\Logger; use Monolog\Processor; + use const PHP_EOL; return [ diff --git a/config/autoload/url-shortener.global.php b/config/autoload/url-shortener.global.php index 1e50106f..283c4813 100644 --- a/config/autoload/url-shortener.global.php +++ b/config/autoload/url-shortener.global.php @@ -2,6 +2,7 @@ declare(strict_types=1); use Shlinkio\Shlink\Core\Options\UrlShortenerOptions; + use function Shlinkio\Shlink\Common\env; return [ diff --git a/config/config.php b/config/config.php index 7821afd2..2f7839ca 100644 --- a/config/config.php +++ b/config/config.php @@ -6,6 +6,7 @@ namespace Shlinkio\Shlink; use Acelaya\ExpressiveErrorHandler; use Zend\ConfigAggregator; use Zend\Expressive; + use function Shlinkio\Shlink\Common\env; return (new ConfigAggregator\ConfigAggregator([ diff --git a/config/test/bootstrap_api_tests.php b/config/test/bootstrap_api_tests.php index 41227dba..0b2b4e16 100644 --- a/config/test/bootstrap_api_tests.php +++ b/config/test/bootstrap_api_tests.php @@ -5,6 +5,7 @@ namespace ShlinkioTest\Shlink\Common; use Doctrine\ORM\EntityManager; use Psr\Container\ContainerInterface; + use function file_exists; use function touch; diff --git a/config/test/bootstrap_db_tests.php b/config/test/bootstrap_db_tests.php index ee44849f..893e2b9a 100644 --- a/config/test/bootstrap_db_tests.php +++ b/config/test/bootstrap_db_tests.php @@ -4,6 +4,7 @@ declare(strict_types=1); namespace ShlinkioTest\Shlink\Common; use Psr\Container\ContainerInterface; + use function file_exists; use function touch; diff --git a/config/test/test_config.global.php b/config/test/test_config.global.php index a0f7bcb8..d5f27a95 100644 --- a/config/test/test_config.global.php +++ b/config/test/test_config.global.php @@ -6,6 +6,7 @@ namespace ShlinkioTest\Shlink; use GuzzleHttp\Client; use Zend\ConfigAggregator\ConfigAggregator; use Zend\ServiceManager\Factory\InvokableFactory; + use function sprintf; use function sys_get_temp_dir; diff --git a/module/CLI/src/Command/Api/DisableKeyCommand.php b/module/CLI/src/Command/Api/DisableKeyCommand.php index 4d945c48..2faea362 100644 --- a/module/CLI/src/Command/Api/DisableKeyCommand.php +++ b/module/CLI/src/Command/Api/DisableKeyCommand.php @@ -11,6 +11,7 @@ use Symfony\Component\Console\Input\InputArgument; use Symfony\Component\Console\Input\InputInterface; use Symfony\Component\Console\Output\OutputInterface; use Symfony\Component\Console\Style\SymfonyStyle; + use function sprintf; class DisableKeyCommand extends Command diff --git a/module/CLI/src/Command/Api/GenerateKeyCommand.php b/module/CLI/src/Command/Api/GenerateKeyCommand.php index bba8ace6..a8248c97 100644 --- a/module/CLI/src/Command/Api/GenerateKeyCommand.php +++ b/module/CLI/src/Command/Api/GenerateKeyCommand.php @@ -11,6 +11,7 @@ use Symfony\Component\Console\Input\InputInterface; use Symfony\Component\Console\Input\InputOption; use Symfony\Component\Console\Output\OutputInterface; use Symfony\Component\Console\Style\SymfonyStyle; + use function sprintf; class GenerateKeyCommand extends Command diff --git a/module/CLI/src/Command/Api/ListKeysCommand.php b/module/CLI/src/Command/Api/ListKeysCommand.php index 710c22c8..c49af8e2 100644 --- a/module/CLI/src/Command/Api/ListKeysCommand.php +++ b/module/CLI/src/Command/Api/ListKeysCommand.php @@ -11,6 +11,7 @@ use Symfony\Component\Console\Command\Command; use Symfony\Component\Console\Input\InputInterface; use Symfony\Component\Console\Input\InputOption; use Symfony\Component\Console\Output\OutputInterface; + use function array_filter; use function array_map; use function sprintf; diff --git a/module/CLI/src/Command/Config/GenerateCharsetCommand.php b/module/CLI/src/Command/Config/GenerateCharsetCommand.php index 0fab6336..fb7ee044 100644 --- a/module/CLI/src/Command/Config/GenerateCharsetCommand.php +++ b/module/CLI/src/Command/Config/GenerateCharsetCommand.php @@ -9,6 +9,7 @@ use Symfony\Component\Console\Command\Command; use Symfony\Component\Console\Input\InputInterface; use Symfony\Component\Console\Output\OutputInterface; use Symfony\Component\Console\Style\SymfonyStyle; + use function sprintf; use function str_shuffle; diff --git a/module/CLI/src/Command/Config/GenerateSecretCommand.php b/module/CLI/src/Command/Config/GenerateSecretCommand.php index 8a194bd7..4045e9f3 100644 --- a/module/CLI/src/Command/Config/GenerateSecretCommand.php +++ b/module/CLI/src/Command/Config/GenerateSecretCommand.php @@ -9,6 +9,7 @@ use Symfony\Component\Console\Command\Command; use Symfony\Component\Console\Input\InputInterface; use Symfony\Component\Console\Output\OutputInterface; use Symfony\Component\Console\Style\SymfonyStyle; + use function sprintf; /** @deprecated */ diff --git a/module/CLI/src/Command/ShortUrl/DeleteShortUrlCommand.php b/module/CLI/src/Command/ShortUrl/DeleteShortUrlCommand.php index 0bc2a5fb..e760185d 100644 --- a/module/CLI/src/Command/ShortUrl/DeleteShortUrlCommand.php +++ b/module/CLI/src/Command/ShortUrl/DeleteShortUrlCommand.php @@ -12,6 +12,7 @@ use Symfony\Component\Console\Input\InputInterface; use Symfony\Component\Console\Input\InputOption; use Symfony\Component\Console\Output\OutputInterface; use Symfony\Component\Console\Style\SymfonyStyle; + use function sprintf; class DeleteShortUrlCommand extends Command diff --git a/module/CLI/src/Command/ShortUrl/GeneratePreviewCommand.php b/module/CLI/src/Command/ShortUrl/GeneratePreviewCommand.php index 0a769553..fd7c0340 100644 --- a/module/CLI/src/Command/ShortUrl/GeneratePreviewCommand.php +++ b/module/CLI/src/Command/ShortUrl/GeneratePreviewCommand.php @@ -11,6 +11,7 @@ use Symfony\Component\Console\Command\Command; use Symfony\Component\Console\Input\InputInterface; use Symfony\Component\Console\Output\OutputInterface; use Symfony\Component\Console\Style\SymfonyStyle; + use function sprintf; class GeneratePreviewCommand extends Command diff --git a/module/CLI/src/Command/ShortUrl/GenerateShortUrlCommand.php b/module/CLI/src/Command/ShortUrl/GenerateShortUrlCommand.php index 192c7049..5977094f 100644 --- a/module/CLI/src/Command/ShortUrl/GenerateShortUrlCommand.php +++ b/module/CLI/src/Command/ShortUrl/GenerateShortUrlCommand.php @@ -17,6 +17,7 @@ use Symfony\Component\Console\Input\InputOption; use Symfony\Component\Console\Output\OutputInterface; use Symfony\Component\Console\Style\SymfonyStyle; use Zend\Diactoros\Uri; + use function array_map; use function Functional\curry; use function Functional\flatten; diff --git a/module/CLI/src/Command/ShortUrl/GetVisitsCommand.php b/module/CLI/src/Command/ShortUrl/GetVisitsCommand.php index 85258c16..e557757a 100644 --- a/module/CLI/src/Command/ShortUrl/GetVisitsCommand.php +++ b/module/CLI/src/Command/ShortUrl/GetVisitsCommand.php @@ -17,6 +17,7 @@ use Symfony\Component\Console\Input\InputOption; use Symfony\Component\Console\Output\OutputInterface; use Symfony\Component\Console\Style\SymfonyStyle; use Zend\Stdlib\ArrayUtils; + use function array_map; use function Functional\select_keys; diff --git a/module/CLI/src/Command/ShortUrl/ListShortUrlsCommand.php b/module/CLI/src/Command/ShortUrl/ListShortUrlsCommand.php index 47afc208..17be8628 100644 --- a/module/CLI/src/Command/ShortUrl/ListShortUrlsCommand.php +++ b/module/CLI/src/Command/ShortUrl/ListShortUrlsCommand.php @@ -16,6 +16,7 @@ use Symfony\Component\Console\Input\InputOption; use Symfony\Component\Console\Output\OutputInterface; use Symfony\Component\Console\Style\SymfonyStyle; use Zend\Paginator\Paginator; + use function array_values; use function count; use function explode; diff --git a/module/CLI/src/Command/ShortUrl/ResolveUrlCommand.php b/module/CLI/src/Command/ShortUrl/ResolveUrlCommand.php index e2d72d44..48fae0a0 100644 --- a/module/CLI/src/Command/ShortUrl/ResolveUrlCommand.php +++ b/module/CLI/src/Command/ShortUrl/ResolveUrlCommand.php @@ -12,6 +12,7 @@ use Symfony\Component\Console\Input\InputArgument; use Symfony\Component\Console\Input\InputInterface; use Symfony\Component\Console\Output\OutputInterface; use Symfony\Component\Console\Style\SymfonyStyle; + use function sprintf; class ResolveUrlCommand extends Command diff --git a/module/CLI/src/Command/Tag/ListTagsCommand.php b/module/CLI/src/Command/Tag/ListTagsCommand.php index 02a7a831..152f9d43 100644 --- a/module/CLI/src/Command/Tag/ListTagsCommand.php +++ b/module/CLI/src/Command/Tag/ListTagsCommand.php @@ -10,6 +10,7 @@ use Shlinkio\Shlink\Core\Service\Tag\TagServiceInterface; use Symfony\Component\Console\Command\Command; use Symfony\Component\Console\Input\InputInterface; use Symfony\Component\Console\Output\OutputInterface; + use function Functional\map; class ListTagsCommand extends Command diff --git a/module/CLI/src/Command/Tag/RenameTagCommand.php b/module/CLI/src/Command/Tag/RenameTagCommand.php index 2875761d..2c75905f 100644 --- a/module/CLI/src/Command/Tag/RenameTagCommand.php +++ b/module/CLI/src/Command/Tag/RenameTagCommand.php @@ -11,6 +11,7 @@ use Symfony\Component\Console\Input\InputArgument; use Symfony\Component\Console\Input\InputInterface; use Symfony\Component\Console\Output\OutputInterface; use Symfony\Component\Console\Style\SymfonyStyle; + use function sprintf; class RenameTagCommand extends Command diff --git a/module/CLI/src/Command/Visit/ProcessVisitsCommand.php b/module/CLI/src/Command/Visit/ProcessVisitsCommand.php index 8de39651..e3db15d0 100644 --- a/module/CLI/src/Command/Visit/ProcessVisitsCommand.php +++ b/module/CLI/src/Command/Visit/ProcessVisitsCommand.php @@ -17,6 +17,7 @@ use Symfony\Component\Console\Input\InputInterface; use Symfony\Component\Console\Output\OutputInterface; use Symfony\Component\Console\Style\SymfonyStyle; use Symfony\Component\Lock\Factory as Locker; + use function sprintf; class ProcessVisitsCommand extends Command diff --git a/module/CLI/test/Command/Config/GenerateCharsetCommandTest.php b/module/CLI/test/Command/Config/GenerateCharsetCommandTest.php index b0378f62..7d8ea823 100644 --- a/module/CLI/test/Command/Config/GenerateCharsetCommandTest.php +++ b/module/CLI/test/Command/Config/GenerateCharsetCommandTest.php @@ -7,6 +7,7 @@ use PHPUnit\Framework\TestCase; use Shlinkio\Shlink\CLI\Command\Config\GenerateCharsetCommand; use Symfony\Component\Console\Application; use Symfony\Component\Console\Tester\CommandTester; + use function implode; use function sort; use function str_split; diff --git a/module/CLI/test/Command/ShortUrl/DeleteShortUrlCommandTest.php b/module/CLI/test/Command/ShortUrl/DeleteShortUrlCommandTest.php index 9e81b5fc..8414ab6e 100644 --- a/module/CLI/test/Command/ShortUrl/DeleteShortUrlCommandTest.php +++ b/module/CLI/test/Command/ShortUrl/DeleteShortUrlCommandTest.php @@ -11,7 +11,9 @@ use Shlinkio\Shlink\Core\Exception; use Shlinkio\Shlink\Core\Service\ShortUrl\DeleteShortUrlServiceInterface; use Symfony\Component\Console\Application; use Symfony\Component\Console\Tester\CommandTester; + use const PHP_EOL; + use function array_pop; use function sprintf; diff --git a/module/CLI/test/Command/ShortUrl/GeneratePreviewCommandTest.php b/module/CLI/test/Command/ShortUrl/GeneratePreviewCommandTest.php index abf76e4b..da7c7795 100644 --- a/module/CLI/test/Command/ShortUrl/GeneratePreviewCommandTest.php +++ b/module/CLI/test/Command/ShortUrl/GeneratePreviewCommandTest.php @@ -15,6 +15,7 @@ use Symfony\Component\Console\Application; use Symfony\Component\Console\Tester\CommandTester; use Zend\Paginator\Adapter\ArrayAdapter; use Zend\Paginator\Paginator; + use function count; use function substr_count; diff --git a/module/CLI/test/Command/ShortUrl/ResolveUrlCommandTest.php b/module/CLI/test/Command/ShortUrl/ResolveUrlCommandTest.php index 2997352a..f41509e3 100644 --- a/module/CLI/test/Command/ShortUrl/ResolveUrlCommandTest.php +++ b/module/CLI/test/Command/ShortUrl/ResolveUrlCommandTest.php @@ -12,6 +12,7 @@ use Shlinkio\Shlink\Core\Exception\InvalidShortCodeException; use Shlinkio\Shlink\Core\Service\UrlShortener; use Symfony\Component\Console\Application; use Symfony\Component\Console\Tester\CommandTester; + use const PHP_EOL; class ResolveUrlCommandTest extends TestCase diff --git a/module/CLI/test/Command/Visit/ProcessVisitsCommandTest.php b/module/CLI/test/Command/Visit/ProcessVisitsCommandTest.php index 9c008ed3..a28a880a 100644 --- a/module/CLI/test/Command/Visit/ProcessVisitsCommandTest.php +++ b/module/CLI/test/Command/Visit/ProcessVisitsCommandTest.php @@ -20,6 +20,7 @@ use Symfony\Component\Console\Application; use Symfony\Component\Console\Output\OutputInterface; use Symfony\Component\Console\Tester\CommandTester; use Symfony\Component\Lock; + use function array_shift; use function sprintf; diff --git a/module/CLI/test/Factory/ApplicationFactoryTest.php b/module/CLI/test/Factory/ApplicationFactoryTest.php index a533ed09..8e45674c 100644 --- a/module/CLI/test/Factory/ApplicationFactoryTest.php +++ b/module/CLI/test/Factory/ApplicationFactoryTest.php @@ -11,6 +11,7 @@ use Shlinkio\Shlink\Core\Options\AppOptions; use Symfony\Component\Console\Application; use Symfony\Component\Console\Command\Command; use Zend\ServiceManager\ServiceManager; + use function array_merge; class ApplicationFactoryTest extends TestCase diff --git a/module/Common/functions/functions.php b/module/Common/functions/functions.php index b0d2b434..485df607 100644 --- a/module/Common/functions/functions.php +++ b/module/Common/functions/functions.php @@ -4,6 +4,7 @@ declare(strict_types=1); namespace Shlinkio\Shlink\Common; use const JSON_ERROR_NONE; + use function getenv; use function json_decode as spl_json_decode; use function json_last_error; diff --git a/module/Common/src/Exception/WrongIpException.php b/module/Common/src/Exception/WrongIpException.php index b4db7186..fb6589e7 100644 --- a/module/Common/src/Exception/WrongIpException.php +++ b/module/Common/src/Exception/WrongIpException.php @@ -4,6 +4,7 @@ declare(strict_types=1); namespace Shlinkio\Shlink\Common\Exception; use Throwable; + use function sprintf; class WrongIpException extends RuntimeException diff --git a/module/Common/src/Factory/CacheFactory.php b/module/Common/src/Factory/CacheFactory.php index 2efde447..590e5351 100644 --- a/module/Common/src/Factory/CacheFactory.php +++ b/module/Common/src/Factory/CacheFactory.php @@ -11,6 +11,7 @@ use Shlinkio\Shlink\Core\Options\AppOptions; use Zend\ServiceManager\Exception\ServiceNotCreatedException; use Zend\ServiceManager\Exception\ServiceNotFoundException; use Zend\ServiceManager\Factory\FactoryInterface; + use function Functional\contains; use function Shlinkio\Shlink\Common\env; use function sys_get_temp_dir; diff --git a/module/Common/src/Factory/DottedAccessConfigAbstractFactory.php b/module/Common/src/Factory/DottedAccessConfigAbstractFactory.php index 562431d8..64f1adf9 100644 --- a/module/Common/src/Factory/DottedAccessConfigAbstractFactory.php +++ b/module/Common/src/Factory/DottedAccessConfigAbstractFactory.php @@ -10,6 +10,7 @@ use Shlinkio\Shlink\Common\Exception\InvalidArgumentException; use Zend\ServiceManager\Exception\ServiceNotCreatedException; use Zend\ServiceManager\Exception\ServiceNotFoundException; use Zend\ServiceManager\Factory\AbstractFactoryInterface; + use function array_shift; use function explode; use function is_array; diff --git a/module/Common/src/Factory/LoggerFactory.php b/module/Common/src/Factory/LoggerFactory.php index 5a68ad6e..89859ace 100644 --- a/module/Common/src/Factory/LoggerFactory.php +++ b/module/Common/src/Factory/LoggerFactory.php @@ -9,6 +9,7 @@ use Interop\Container\Exception\ContainerException; use Zend\ServiceManager\Exception\ServiceNotCreatedException; use Zend\ServiceManager\Exception\ServiceNotFoundException; use Zend\ServiceManager\Factory\FactoryInterface; + use function count; use function explode; diff --git a/module/Common/src/IpGeolocation/GeoLite2/DbUpdater.php b/module/Common/src/IpGeolocation/GeoLite2/DbUpdater.php index b66dd74e..039ce477 100644 --- a/module/Common/src/IpGeolocation/GeoLite2/DbUpdater.php +++ b/module/Common/src/IpGeolocation/GeoLite2/DbUpdater.php @@ -12,6 +12,7 @@ use Shlinkio\Shlink\Common\Exception\RuntimeException; use Symfony\Component\Filesystem\Exception as FilesystemException; use Symfony\Component\Filesystem\Filesystem; use Throwable; + use function sprintf; class DbUpdater implements DbUpdaterInterface diff --git a/module/Common/src/IpGeolocation/GeoLite2LocationResolver.php b/module/Common/src/IpGeolocation/GeoLite2LocationResolver.php index 4aa4e868..b9e0e2b3 100644 --- a/module/Common/src/IpGeolocation/GeoLite2LocationResolver.php +++ b/module/Common/src/IpGeolocation/GeoLite2LocationResolver.php @@ -9,6 +9,7 @@ use GeoIp2\Model\City; use GeoIp2\Record\Subdivision; use MaxMind\Db\Reader\InvalidDatabaseException; use Shlinkio\Shlink\Common\Exception\WrongIpException; + use function Functional\first; class GeoLite2LocationResolver implements IpLocationResolverInterface diff --git a/module/Common/src/IpGeolocation/IpApiLocationResolver.php b/module/Common/src/IpGeolocation/IpApiLocationResolver.php index 0f9fc9a3..05f7b1f7 100644 --- a/module/Common/src/IpGeolocation/IpApiLocationResolver.php +++ b/module/Common/src/IpGeolocation/IpApiLocationResolver.php @@ -7,6 +7,7 @@ use GuzzleHttp\Client; use GuzzleHttp\Exception\GuzzleException; use Shlinkio\Shlink\Common\Exception\InvalidArgumentException; use Shlinkio\Shlink\Common\Exception\WrongIpException; + use function Shlinkio\Shlink\Common\json_decode; use function sprintf; diff --git a/module/Common/src/Logger/Processor/ExceptionWithNewLineProcessor.php b/module/Common/src/Logger/Processor/ExceptionWithNewLineProcessor.php index 0d48b5c4..9085150b 100644 --- a/module/Common/src/Logger/Processor/ExceptionWithNewLineProcessor.php +++ b/module/Common/src/Logger/Processor/ExceptionWithNewLineProcessor.php @@ -4,6 +4,7 @@ declare(strict_types=1); namespace Shlinkio\Shlink\Common\Logger\Processor; use const PHP_EOL; + use function str_replace; use function strpos; diff --git a/module/Common/src/Middleware/LocaleMiddleware.php b/module/Common/src/Middleware/LocaleMiddleware.php index 23ec9b75..39cde1c4 100644 --- a/module/Common/src/Middleware/LocaleMiddleware.php +++ b/module/Common/src/Middleware/LocaleMiddleware.php @@ -8,6 +8,7 @@ use Psr\Http\Message\ServerRequestInterface as Request; use Psr\Http\Server\MiddlewareInterface; use Psr\Http\Server\RequestHandlerInterface as DelegateInterface; use Zend\I18n\Translator\Translator; + use function count; use function explode; diff --git a/module/Common/src/Paginator/Adapter/PaginableRepositoryAdapter.php b/module/Common/src/Paginator/Adapter/PaginableRepositoryAdapter.php index 3e9fe2ef..32511d52 100644 --- a/module/Common/src/Paginator/Adapter/PaginableRepositoryAdapter.php +++ b/module/Common/src/Paginator/Adapter/PaginableRepositoryAdapter.php @@ -5,6 +5,7 @@ namespace Shlinkio\Shlink\Common\Paginator\Adapter; use Shlinkio\Shlink\Common\Repository\PaginableRepositoryInterface; use Zend\Paginator\Adapter\AdapterInterface; + use function strip_tags; use function trim; diff --git a/module/Common/src/Paginator/Util/PaginatorUtilsTrait.php b/module/Common/src/Paginator/Util/PaginatorUtilsTrait.php index a98568d3..7157a21d 100644 --- a/module/Common/src/Paginator/Util/PaginatorUtilsTrait.php +++ b/module/Common/src/Paginator/Util/PaginatorUtilsTrait.php @@ -6,6 +6,7 @@ namespace Shlinkio\Shlink\Common\Paginator\Util; use Shlinkio\Shlink\Common\Rest\DataTransformerInterface; use Zend\Paginator\Paginator; use Zend\Stdlib\ArrayUtils; + use function array_map; use function sprintf; diff --git a/module/Common/src/Response/PixelResponse.php b/module/Common/src/Response/PixelResponse.php index 87a10dca..94a81cfc 100644 --- a/module/Common/src/Response/PixelResponse.php +++ b/module/Common/src/Response/PixelResponse.php @@ -7,6 +7,7 @@ use Fig\Http\Message\StatusCodeInterface as StatusCode; use Psr\Http\Message\StreamInterface; use Zend\Diactoros\Response; use Zend\Diactoros\Stream; + use function base64_decode; class PixelResponse extends Response diff --git a/module/Common/src/Service/PreviewGenerator.php b/module/Common/src/Service/PreviewGenerator.php index 6b6156f8..6e1c5ede 100644 --- a/module/Common/src/Service/PreviewGenerator.php +++ b/module/Common/src/Service/PreviewGenerator.php @@ -7,6 +7,7 @@ use mikehaertl\wkhtmlto\Image; use Shlinkio\Shlink\Common\Exception\PreviewGenerationException; use Shlinkio\Shlink\Common\Image\ImageBuilderInterface; use Symfony\Component\Filesystem\Filesystem; + use function sprintf; use function urlencode; diff --git a/module/Common/src/Util/IpAddress.php b/module/Common/src/Util/IpAddress.php index e8f18fdf..8521f9be 100644 --- a/module/Common/src/Util/IpAddress.php +++ b/module/Common/src/Util/IpAddress.php @@ -4,6 +4,7 @@ declare(strict_types=1); namespace Shlinkio\Shlink\Common\Util; use Shlinkio\Shlink\Common\Exception\WrongIpException; + use function count; use function explode; use function implode; diff --git a/module/Common/src/Util/ResponseUtilsTrait.php b/module/Common/src/Util/ResponseUtilsTrait.php index 25a884f9..cc5a48a5 100644 --- a/module/Common/src/Util/ResponseUtilsTrait.php +++ b/module/Common/src/Util/ResponseUtilsTrait.php @@ -9,6 +9,7 @@ use Psr\Http\Message\ResponseInterface; use Zend\Diactoros\Response; use Zend\Diactoros\Stream; use Zend\Stdlib\ArrayUtils; + use const FILEINFO_MIME; trait ResponseUtilsTrait diff --git a/module/Common/test-db/ApiTest/ApiTestCase.php b/module/Common/test-db/ApiTest/ApiTestCase.php index 4dedab6b..1c6e3d0d 100644 --- a/module/Common/test-db/ApiTest/ApiTestCase.php +++ b/module/Common/test-db/ApiTest/ApiTestCase.php @@ -10,6 +10,7 @@ use GuzzleHttp\RequestOptions; use PHPUnit\Framework\TestCase; use Psr\Http\Message\ResponseInterface; use Shlinkio\Shlink\Rest\Authentication\Plugin\ApiKeyHeaderPlugin; + use function Shlinkio\Shlink\Common\json_decode; use function sprintf; diff --git a/module/Common/test-db/TestHelper.php b/module/Common/test-db/TestHelper.php index 89c8adca..411d2773 100644 --- a/module/Common/test-db/TestHelper.php +++ b/module/Common/test-db/TestHelper.php @@ -8,6 +8,7 @@ use Doctrine\Common\DataFixtures\Loader; use Doctrine\Common\DataFixtures\Purger\ORMPurger; use Doctrine\ORM\EntityManagerInterface; use Symfony\Component\Process\Process; + use function file_exists; use function unlink; diff --git a/module/Common/test/Factory/CacheFactoryTest.php b/module/Common/test/Factory/CacheFactoryTest.php index 614a787f..9f175221 100644 --- a/module/Common/test/Factory/CacheFactoryTest.php +++ b/module/Common/test/Factory/CacheFactoryTest.php @@ -12,6 +12,7 @@ use PHPUnit\Framework\TestCase; use Shlinkio\Shlink\Common\Factory\CacheFactory; use Shlinkio\Shlink\Core\Options\AppOptions; use Zend\ServiceManager\ServiceManager; + use function count; use function putenv; use function realpath; diff --git a/module/Common/test/IpGeolocation/EmptyIpLocationResolverTest.php b/module/Common/test/IpGeolocation/EmptyIpLocationResolverTest.php index da5e0f98..33f966b0 100644 --- a/module/Common/test/IpGeolocation/EmptyIpLocationResolverTest.php +++ b/module/Common/test/IpGeolocation/EmptyIpLocationResolverTest.php @@ -7,6 +7,7 @@ use PHPUnit\Framework\TestCase; use Shlinkio\Shlink\Common\IpGeolocation\EmptyIpLocationResolver; use Shlinkio\Shlink\Common\IpGeolocation\Model\Location; use Shlinkio\Shlink\Common\Util\StringUtilsTrait; + use function Functional\map; use function range; diff --git a/module/Common/test/IpGeolocation/IpApiLocationResolverTest.php b/module/Common/test/IpGeolocation/IpApiLocationResolverTest.php index cc0c29b3..15fe2053 100644 --- a/module/Common/test/IpGeolocation/IpApiLocationResolverTest.php +++ b/module/Common/test/IpGeolocation/IpApiLocationResolverTest.php @@ -11,6 +11,7 @@ use Prophecy\Prophecy\ObjectProphecy; use Shlinkio\Shlink\Common\Exception\WrongIpException; use Shlinkio\Shlink\Common\IpGeolocation\IpApiLocationResolver; use Shlinkio\Shlink\Common\IpGeolocation\Model\Location; + use function json_encode; class IpApiLocationResolverTest extends TestCase diff --git a/module/Common/test/Logger/Processor/ExceptionWithNewLineProcessorTest.php b/module/Common/test/Logger/Processor/ExceptionWithNewLineProcessorTest.php index 96520dcf..6fe088fb 100644 --- a/module/Common/test/Logger/Processor/ExceptionWithNewLineProcessorTest.php +++ b/module/Common/test/Logger/Processor/ExceptionWithNewLineProcessorTest.php @@ -6,7 +6,9 @@ namespace ShlinkioTest\Shlink\Common\Logger\Processor; use PHPUnit\Framework\TestCase; use Shlinkio\Shlink\Common\Logger\Processor\ExceptionWithNewLineProcessor; use Shlinkio\Shlink\Common\Util\StringUtilsTrait; + use const PHP_EOL; + use function Functional\map; use function range; diff --git a/module/Common/test/Service/PreviewGeneratorTest.php b/module/Common/test/Service/PreviewGeneratorTest.php index 470a6eae..4d6e9ea8 100644 --- a/module/Common/test/Service/PreviewGeneratorTest.php +++ b/module/Common/test/Service/PreviewGeneratorTest.php @@ -12,6 +12,7 @@ use Shlinkio\Shlink\Common\Image\ImageBuilder; use Shlinkio\Shlink\Common\Service\PreviewGenerator; use Symfony\Component\Filesystem\Filesystem; use Zend\ServiceManager\ServiceManager; + use function sprintf; use function urlencode; diff --git a/module/Common/test/Util/StringUtilsTraitTest.php b/module/Common/test/Util/StringUtilsTraitTest.php index 0d05a1fd..ad1417aa 100644 --- a/module/Common/test/Util/StringUtilsTraitTest.php +++ b/module/Common/test/Util/StringUtilsTraitTest.php @@ -5,6 +5,7 @@ namespace ShlinkioTest\Shlink\Common\Util; use PHPUnit\Framework\TestCase; use Shlinkio\Shlink\Common\Util\StringUtilsTrait; + use function Functional\map; use function range; use function strlen; diff --git a/module/Core/src/Action/AbstractTrackingAction.php b/module/Core/src/Action/AbstractTrackingAction.php index 7a6fbc0e..796fefce 100644 --- a/module/Core/src/Action/AbstractTrackingAction.php +++ b/module/Core/src/Action/AbstractTrackingAction.php @@ -15,6 +15,7 @@ use Shlinkio\Shlink\Core\Model\Visitor; use Shlinkio\Shlink\Core\Options\AppOptions; use Shlinkio\Shlink\Core\Service\UrlShortenerInterface; use Shlinkio\Shlink\Core\Service\VisitsTrackerInterface; + use function array_key_exists; abstract class AbstractTrackingAction implements MiddlewareInterface diff --git a/module/Core/src/Entity/ShortUrl.php b/module/Core/src/Entity/ShortUrl.php index 0e75ad1b..5a906de6 100644 --- a/module/Core/src/Entity/ShortUrl.php +++ b/module/Core/src/Entity/ShortUrl.php @@ -8,6 +8,7 @@ use Doctrine\Common\Collections\ArrayCollection; use Doctrine\Common\Collections\Collection; use Shlinkio\Shlink\Common\Entity\AbstractEntity; use Shlinkio\Shlink\Core\Model\ShortUrlMeta; + use function count; class ShortUrl extends AbstractEntity diff --git a/module/Core/src/Exception/DeleteShortUrlException.php b/module/Core/src/Exception/DeleteShortUrlException.php index f545ae6a..d787290c 100644 --- a/module/Core/src/Exception/DeleteShortUrlException.php +++ b/module/Core/src/Exception/DeleteShortUrlException.php @@ -4,6 +4,7 @@ declare(strict_types=1); namespace Shlinkio\Shlink\Core\Exception; use Throwable; + use function sprintf; class DeleteShortUrlException extends RuntimeException diff --git a/module/Core/src/Exception/InvalidShortCodeException.php b/module/Core/src/Exception/InvalidShortCodeException.php index 504bbc88..04e644ef 100644 --- a/module/Core/src/Exception/InvalidShortCodeException.php +++ b/module/Core/src/Exception/InvalidShortCodeException.php @@ -4,6 +4,7 @@ declare(strict_types=1); namespace Shlinkio\Shlink\Core\Exception; use Throwable; + use function sprintf; class InvalidShortCodeException extends RuntimeException diff --git a/module/Core/src/Exception/InvalidUrlException.php b/module/Core/src/Exception/InvalidUrlException.php index 1a1c2d3a..26d6cd99 100644 --- a/module/Core/src/Exception/InvalidUrlException.php +++ b/module/Core/src/Exception/InvalidUrlException.php @@ -4,6 +4,7 @@ declare(strict_types=1); namespace Shlinkio\Shlink\Core\Exception; use Throwable; + use function sprintf; class InvalidUrlException extends RuntimeException diff --git a/module/Core/src/Exception/ValidationException.php b/module/Core/src/Exception/ValidationException.php index 6ca82c40..0e0d6d9e 100644 --- a/module/Core/src/Exception/ValidationException.php +++ b/module/Core/src/Exception/ValidationException.php @@ -5,7 +5,9 @@ namespace Shlinkio\Shlink\Core\Exception; use Throwable; use Zend\InputFilter\InputFilterInterface; + use const PHP_EOL; + use function is_array; use function print_r; use function sprintf; diff --git a/module/Core/src/Options/AppOptions.php b/module/Core/src/Options/AppOptions.php index 341d5df5..659b9604 100644 --- a/module/Core/src/Options/AppOptions.php +++ b/module/Core/src/Options/AppOptions.php @@ -5,6 +5,7 @@ namespace Shlinkio\Shlink\Core\Options; use Shlinkio\Shlink\Common\Util\StringUtilsTrait; use Zend\Stdlib\AbstractOptions; + use function sprintf; class AppOptions extends AbstractOptions diff --git a/module/Core/src/Repository/ShortUrlRepository.php b/module/Core/src/Repository/ShortUrlRepository.php index 5d505fa4..33119e89 100644 --- a/module/Core/src/Repository/ShortUrlRepository.php +++ b/module/Core/src/Repository/ShortUrlRepository.php @@ -7,6 +7,7 @@ use Cake\Chronos\Chronos; use Doctrine\ORM\EntityRepository; use Doctrine\ORM\QueryBuilder; use Shlinkio\Shlink\Core\Entity\ShortUrl; + use function array_column; use function array_key_exists; use function Functional\contains; diff --git a/module/Core/src/Response/NotFoundHandler.php b/module/Core/src/Response/NotFoundHandler.php index 5696033f..8877d646 100644 --- a/module/Core/src/Response/NotFoundHandler.php +++ b/module/Core/src/Response/NotFoundHandler.php @@ -9,6 +9,7 @@ use Psr\Http\Message\ServerRequestInterface; use Psr\Http\Server\RequestHandlerInterface; use Zend\Diactoros\Response; use Zend\Expressive\Template\TemplateRendererInterface; + use function array_shift; use function explode; use function Functional\contains; diff --git a/module/Core/src/Service/UrlShortener.php b/module/Core/src/Service/UrlShortener.php index f224ab51..687a21fd 100644 --- a/module/Core/src/Service/UrlShortener.php +++ b/module/Core/src/Service/UrlShortener.php @@ -20,6 +20,7 @@ use Shlinkio\Shlink\Core\Options\UrlShortenerOptions; use Shlinkio\Shlink\Core\Repository\ShortUrlRepository; use Shlinkio\Shlink\Core\Util\TagManagerTrait; use Throwable; + use function array_reduce; use function count; use function floor; diff --git a/module/Core/src/Service/VisitsTracker.php b/module/Core/src/Service/VisitsTracker.php index 86d671e3..6b5b9873 100644 --- a/module/Core/src/Service/VisitsTracker.php +++ b/module/Core/src/Service/VisitsTracker.php @@ -12,6 +12,7 @@ use Shlinkio\Shlink\Core\Model\VisitsParams; use Shlinkio\Shlink\Core\Paginator\Adapter\VisitsPaginatorAdapter; use Shlinkio\Shlink\Core\Repository\VisitRepository; use Zend\Paginator\Paginator; + use function sprintf; class VisitsTracker implements VisitsTrackerInterface diff --git a/module/Core/src/Transformer/ShortUrlDataTransformer.php b/module/Core/src/Transformer/ShortUrlDataTransformer.php index 91d64ea7..dc9f40d5 100644 --- a/module/Core/src/Transformer/ShortUrlDataTransformer.php +++ b/module/Core/src/Transformer/ShortUrlDataTransformer.php @@ -6,6 +6,7 @@ namespace Shlinkio\Shlink\Core\Transformer; use Shlinkio\Shlink\Common\Rest\DataTransformerInterface; use Shlinkio\Shlink\Core\Entity\ShortUrl; use Shlinkio\Shlink\Core\Util\ShortUrlBuilderTrait; + use function Functional\invoke; class ShortUrlDataTransformer implements DataTransformerInterface diff --git a/module/Core/src/Util/TagManagerTrait.php b/module/Core/src/Util/TagManagerTrait.php index f19dda65..854a98b6 100644 --- a/module/Core/src/Util/TagManagerTrait.php +++ b/module/Core/src/Util/TagManagerTrait.php @@ -6,6 +6,7 @@ namespace Shlinkio\Shlink\Core\Util; use Doctrine\Common\Collections; use Doctrine\ORM\EntityManagerInterface; use Shlinkio\Shlink\Core\Entity\Tag; + use function str_replace; use function strtolower; use function trim; diff --git a/module/Core/test-db/Repository/ShortUrlRepositoryTest.php b/module/Core/test-db/Repository/ShortUrlRepositoryTest.php index b623cacd..e4db2e9b 100644 --- a/module/Core/test-db/Repository/ShortUrlRepositoryTest.php +++ b/module/Core/test-db/Repository/ShortUrlRepositoryTest.php @@ -12,6 +12,7 @@ use Shlinkio\Shlink\Core\Model\ShortUrlMeta; use Shlinkio\Shlink\Core\Model\Visitor; use Shlinkio\Shlink\Core\Repository\ShortUrlRepository; use ShlinkioTest\Shlink\Common\DbTest\DatabaseTestCase; + use function count; class ShortUrlRepositoryTest extends DatabaseTestCase diff --git a/module/Core/test-db/Repository/VisitRepositoryTest.php b/module/Core/test-db/Repository/VisitRepositoryTest.php index 46bda817..871c7aed 100644 --- a/module/Core/test-db/Repository/VisitRepositoryTest.php +++ b/module/Core/test-db/Repository/VisitRepositoryTest.php @@ -12,6 +12,7 @@ use Shlinkio\Shlink\Core\Entity\VisitLocation; use Shlinkio\Shlink\Core\Model\Visitor; use Shlinkio\Shlink\Core\Repository\VisitRepository; use ShlinkioTest\Shlink\Common\DbTest\DatabaseTestCase; + use function Functional\map; use function range; use function sprintf; diff --git a/module/Core/test/Action/PreviewActionTest.php b/module/Core/test/Action/PreviewActionTest.php index 6bf227ac..de9d9af6 100644 --- a/module/Core/test/Action/PreviewActionTest.php +++ b/module/Core/test/Action/PreviewActionTest.php @@ -17,7 +17,9 @@ use Shlinkio\Shlink\Core\Service\UrlShortener; use ShlinkioTest\Shlink\Common\Util\TestUtils; use Zend\Diactoros\Response; use Zend\Diactoros\ServerRequest; + use const FILEINFO_MIME; + use function filesize; class PreviewActionTest extends TestCase diff --git a/module/Core/test/Exception/DeleteShortUrlExceptionTest.php b/module/Core/test/Exception/DeleteShortUrlExceptionTest.php index afbfd6bc..8e961812 100644 --- a/module/Core/test/Exception/DeleteShortUrlExceptionTest.php +++ b/module/Core/test/Exception/DeleteShortUrlExceptionTest.php @@ -6,6 +6,7 @@ namespace ShlinkioTest\Shlink\Core\Exception; use PHPUnit\Framework\TestCase; use Shlinkio\Shlink\Common\Util\StringUtilsTrait; use Shlinkio\Shlink\Core\Exception\DeleteShortUrlException; + use function Functional\map; use function range; use function sprintf; diff --git a/module/Core/test/Exception/IpCannotBeLocatedExceptionTest.php b/module/Core/test/Exception/IpCannotBeLocatedExceptionTest.php index 4a00d5b9..a4425636 100644 --- a/module/Core/test/Exception/IpCannotBeLocatedExceptionTest.php +++ b/module/Core/test/Exception/IpCannotBeLocatedExceptionTest.php @@ -9,6 +9,7 @@ use PHPUnit\Framework\TestCase; use Shlinkio\Shlink\Core\Exception\IpCannotBeLocatedException; use Shlinkio\Shlink\Core\Exception\RuntimeException; use Throwable; + use function count; use function func_get_args; use function random_int; diff --git a/module/Core/test/Service/ShortUrl/DeleteShortUrlServiceTest.php b/module/Core/test/Service/ShortUrl/DeleteShortUrlServiceTest.php index 3e59f535..b46cb8db 100644 --- a/module/Core/test/Service/ShortUrl/DeleteShortUrlServiceTest.php +++ b/module/Core/test/Service/ShortUrl/DeleteShortUrlServiceTest.php @@ -15,6 +15,7 @@ use Shlinkio\Shlink\Core\Model\Visitor; use Shlinkio\Shlink\Core\Options\DeleteShortUrlsOptions; use Shlinkio\Shlink\Core\Repository\ShortUrlRepositoryInterface; use Shlinkio\Shlink\Core\Service\ShortUrl\DeleteShortUrlService; + use function Functional\map; use function range; diff --git a/module/Core/test/Service/ShortUrlServiceTest.php b/module/Core/test/Service/ShortUrlServiceTest.php index bd186bda..0ed908da 100644 --- a/module/Core/test/Service/ShortUrlServiceTest.php +++ b/module/Core/test/Service/ShortUrlServiceTest.php @@ -15,6 +15,7 @@ use Shlinkio\Shlink\Core\Exception\InvalidShortCodeException; use Shlinkio\Shlink\Core\Model\ShortUrlMeta; use Shlinkio\Shlink\Core\Repository\ShortUrlRepository; use Shlinkio\Shlink\Core\Service\ShortUrlService; + use function count; class ShortUrlServiceTest extends TestCase diff --git a/module/Core/test/Service/VisitServiceTest.php b/module/Core/test/Service/VisitServiceTest.php index a2821fa6..85f29ee4 100644 --- a/module/Core/test/Service/VisitServiceTest.php +++ b/module/Core/test/Service/VisitServiceTest.php @@ -15,6 +15,7 @@ use Shlinkio\Shlink\Core\Exception\IpCannotBeLocatedException; use Shlinkio\Shlink\Core\Model\Visitor; use Shlinkio\Shlink\Core\Repository\VisitRepository; use Shlinkio\Shlink\Core\Service\VisitService; + use function array_shift; use function count; use function floor; diff --git a/module/Rest/src/Action/AbstractRestAction.php b/module/Rest/src/Action/AbstractRestAction.php index 21e15d66..7996902d 100644 --- a/module/Rest/src/Action/AbstractRestAction.php +++ b/module/Rest/src/Action/AbstractRestAction.php @@ -8,6 +8,7 @@ use Fig\Http\Message\StatusCodeInterface; use Psr\Http\Server\RequestHandlerInterface; use Psr\Log\LoggerInterface; use Psr\Log\NullLogger; + use function array_merge; abstract class AbstractRestAction implements RequestHandlerInterface, RequestMethodInterface, StatusCodeInterface diff --git a/module/Rest/src/Action/ShortUrl/AbstractCreateShortUrlAction.php b/module/Rest/src/Action/ShortUrl/AbstractCreateShortUrlAction.php index a9d9dcfa..bd242bcc 100644 --- a/module/Rest/src/Action/ShortUrl/AbstractCreateShortUrlAction.php +++ b/module/Rest/src/Action/ShortUrl/AbstractCreateShortUrlAction.php @@ -16,6 +16,7 @@ use Shlinkio\Shlink\Rest\Action\AbstractRestAction; use Shlinkio\Shlink\Rest\Util\RestUtils; use Throwable; use Zend\Diactoros\Response\JsonResponse; + use function sprintf; abstract class AbstractCreateShortUrlAction extends AbstractRestAction diff --git a/module/Rest/src/Action/ShortUrl/DeleteShortUrlAction.php b/module/Rest/src/Action/ShortUrl/DeleteShortUrlAction.php index 4f7d8e36..df12c549 100644 --- a/module/Rest/src/Action/ShortUrl/DeleteShortUrlAction.php +++ b/module/Rest/src/Action/ShortUrl/DeleteShortUrlAction.php @@ -12,6 +12,7 @@ use Shlinkio\Shlink\Rest\Action\AbstractRestAction; use Shlinkio\Shlink\Rest\Util\RestUtils; use Zend\Diactoros\Response\EmptyResponse; use Zend\Diactoros\Response\JsonResponse; + use function sprintf; class DeleteShortUrlAction extends AbstractRestAction diff --git a/module/Rest/src/Action/ShortUrl/EditShortUrlAction.php b/module/Rest/src/Action/ShortUrl/EditShortUrlAction.php index bf1d0111..bd8a8f36 100644 --- a/module/Rest/src/Action/ShortUrl/EditShortUrlAction.php +++ b/module/Rest/src/Action/ShortUrl/EditShortUrlAction.php @@ -13,6 +13,7 @@ use Shlinkio\Shlink\Rest\Action\AbstractRestAction; use Shlinkio\Shlink\Rest\Util\RestUtils; use Zend\Diactoros\Response\EmptyResponse; use Zend\Diactoros\Response\JsonResponse; + use function sprintf; class EditShortUrlAction extends AbstractRestAction diff --git a/module/Rest/src/Action/ShortUrl/EditShortUrlTagsAction.php b/module/Rest/src/Action/ShortUrl/EditShortUrlTagsAction.php index 099bd92e..dbb8d0a0 100644 --- a/module/Rest/src/Action/ShortUrl/EditShortUrlTagsAction.php +++ b/module/Rest/src/Action/ShortUrl/EditShortUrlTagsAction.php @@ -11,6 +11,7 @@ use Shlinkio\Shlink\Core\Service\ShortUrlServiceInterface; use Shlinkio\Shlink\Rest\Action\AbstractRestAction; use Shlinkio\Shlink\Rest\Util\RestUtils; use Zend\Diactoros\Response\JsonResponse; + use function sprintf; class EditShortUrlTagsAction extends AbstractRestAction diff --git a/module/Rest/src/Action/ShortUrl/ResolveShortUrlAction.php b/module/Rest/src/Action/ShortUrl/ResolveShortUrlAction.php index 7039df0a..7fc75a58 100644 --- a/module/Rest/src/Action/ShortUrl/ResolveShortUrlAction.php +++ b/module/Rest/src/Action/ShortUrl/ResolveShortUrlAction.php @@ -14,6 +14,7 @@ use Shlinkio\Shlink\Core\Transformer\ShortUrlDataTransformer; use Shlinkio\Shlink\Rest\Action\AbstractRestAction; use Shlinkio\Shlink\Rest\Util\RestUtils; use Zend\Diactoros\Response\JsonResponse; + use function sprintf; class ResolveShortUrlAction extends AbstractRestAction diff --git a/module/Rest/src/Action/Tag/UpdateTagAction.php b/module/Rest/src/Action/Tag/UpdateTagAction.php index 2591452c..60a84831 100644 --- a/module/Rest/src/Action/Tag/UpdateTagAction.php +++ b/module/Rest/src/Action/Tag/UpdateTagAction.php @@ -12,6 +12,7 @@ use Shlinkio\Shlink\Rest\Action\AbstractRestAction; use Shlinkio\Shlink\Rest\Util\RestUtils; use Zend\Diactoros\Response\EmptyResponse; use Zend\Diactoros\Response\JsonResponse; + use function sprintf; class UpdateTagAction extends AbstractRestAction diff --git a/module/Rest/src/Action/Visit/GetVisitsAction.php b/module/Rest/src/Action/Visit/GetVisitsAction.php index 38093080..6f062325 100644 --- a/module/Rest/src/Action/Visit/GetVisitsAction.php +++ b/module/Rest/src/Action/Visit/GetVisitsAction.php @@ -13,6 +13,7 @@ use Shlinkio\Shlink\Core\Service\VisitsTrackerInterface; use Shlinkio\Shlink\Rest\Action\AbstractRestAction; use Shlinkio\Shlink\Rest\Util\RestUtils; use Zend\Diactoros\Response\JsonResponse; + use function sprintf; class GetVisitsAction extends AbstractRestAction diff --git a/module/Rest/src/Authentication/JWTService.php b/module/Rest/src/Authentication/JWTService.php index d1182f9f..f59788bc 100644 --- a/module/Rest/src/Authentication/JWTService.php +++ b/module/Rest/src/Authentication/JWTService.php @@ -8,6 +8,7 @@ use Shlinkio\Shlink\Core\Options\AppOptions; use Shlinkio\Shlink\Rest\Entity\ApiKey; use Shlinkio\Shlink\Rest\Exception\AuthenticationException; use UnexpectedValueException; + use function time; class JWTService implements JWTServiceInterface diff --git a/module/Rest/src/Authentication/Plugin/AuthorizationHeaderPlugin.php b/module/Rest/src/Authentication/Plugin/AuthorizationHeaderPlugin.php index cecb29db..da82652a 100644 --- a/module/Rest/src/Authentication/Plugin/AuthorizationHeaderPlugin.php +++ b/module/Rest/src/Authentication/Plugin/AuthorizationHeaderPlugin.php @@ -9,6 +9,7 @@ use Shlinkio\Shlink\Rest\Authentication\JWTServiceInterface; use Shlinkio\Shlink\Rest\Exception\VerifyAuthenticationException; use Shlinkio\Shlink\Rest\Util\RestUtils; use Throwable; + use function count; use function explode; use function sprintf; diff --git a/module/Rest/src/Authentication/RequestToHttpAuthPlugin.php b/module/Rest/src/Authentication/RequestToHttpAuthPlugin.php index 4466ee42..36021ff9 100644 --- a/module/Rest/src/Authentication/RequestToHttpAuthPlugin.php +++ b/module/Rest/src/Authentication/RequestToHttpAuthPlugin.php @@ -6,6 +6,7 @@ namespace Shlinkio\Shlink\Rest\Authentication; use Psr\Container; use Psr\Http\Message\ServerRequestInterface; use Shlinkio\Shlink\Rest\Exception\NoAuthenticationException; + use function array_filter; use function array_reduce; use function array_shift; diff --git a/module/Rest/src/ConfigProvider.php b/module/Rest/src/ConfigProvider.php index 56cfd740..5c9d9a1d 100644 --- a/module/Rest/src/ConfigProvider.php +++ b/module/Rest/src/ConfigProvider.php @@ -5,6 +5,7 @@ namespace Shlinkio\Shlink\Rest; use Zend\Config\Factory; use Zend\Stdlib\Glob; + use function sprintf; class ConfigProvider diff --git a/module/Rest/src/ErrorHandler/JsonErrorResponseGenerator.php b/module/Rest/src/ErrorHandler/JsonErrorResponseGenerator.php index 8b580efd..21a0e6cd 100644 --- a/module/Rest/src/ErrorHandler/JsonErrorResponseGenerator.php +++ b/module/Rest/src/ErrorHandler/JsonErrorResponseGenerator.php @@ -9,6 +9,7 @@ use Psr\Http\Message\ResponseInterface as Response; use Psr\Http\Message\ServerRequestInterface as Request; use Throwable; use Zend\Diactoros\Response\JsonResponse; + use function str_replace; use function strtoupper; diff --git a/module/Rest/src/Exception/VerifyAuthenticationException.php b/module/Rest/src/Exception/VerifyAuthenticationException.php index 71004fa3..cd6404c1 100644 --- a/module/Rest/src/Exception/VerifyAuthenticationException.php +++ b/module/Rest/src/Exception/VerifyAuthenticationException.php @@ -4,6 +4,7 @@ declare(strict_types=1); namespace Shlinkio\Shlink\Rest\Exception; use Throwable; + use function sprintf; class VerifyAuthenticationException extends RuntimeException diff --git a/module/Rest/src/Middleware/AuthenticationMiddleware.php b/module/Rest/src/Middleware/AuthenticationMiddleware.php index d92a3eb4..2687d6df 100644 --- a/module/Rest/src/Middleware/AuthenticationMiddleware.php +++ b/module/Rest/src/Middleware/AuthenticationMiddleware.php @@ -19,6 +19,7 @@ use Shlinkio\Shlink\Rest\Exception\VerifyAuthenticationException; use Shlinkio\Shlink\Rest\Util\RestUtils; use Zend\Diactoros\Response\JsonResponse; use Zend\Expressive\Router\RouteResult; + use function Functional\contains; use function implode; use function sprintf; diff --git a/module/Rest/src/Middleware/BodyParserMiddleware.php b/module/Rest/src/Middleware/BodyParserMiddleware.php index ce5f6ee7..79ae52ee 100644 --- a/module/Rest/src/Middleware/BodyParserMiddleware.php +++ b/module/Rest/src/Middleware/BodyParserMiddleware.php @@ -8,6 +8,7 @@ use Psr\Http\Message\ResponseInterface as Response; use Psr\Http\Message\ServerRequestInterface as Request; use Psr\Http\Server\MiddlewareInterface; use Psr\Http\Server\RequestHandlerInterface; + use function array_shift; use function explode; use function Functional\contains; diff --git a/module/Rest/src/Middleware/CrossDomainMiddleware.php b/module/Rest/src/Middleware/CrossDomainMiddleware.php index a5896c57..b6cead2e 100644 --- a/module/Rest/src/Middleware/CrossDomainMiddleware.php +++ b/module/Rest/src/Middleware/CrossDomainMiddleware.php @@ -9,6 +9,7 @@ use Psr\Http\Message\ServerRequestInterface as Request; use Psr\Http\Server\MiddlewareInterface; use Psr\Http\Server\RequestHandlerInterface; use Shlinkio\Shlink\Rest\Authentication; + use function implode; class CrossDomainMiddleware implements MiddlewareInterface, RequestMethodInterface diff --git a/module/Rest/src/Middleware/PathVersionMiddleware.php b/module/Rest/src/Middleware/PathVersionMiddleware.php index d39c8a2f..c1e56890 100644 --- a/module/Rest/src/Middleware/PathVersionMiddleware.php +++ b/module/Rest/src/Middleware/PathVersionMiddleware.php @@ -7,6 +7,7 @@ use Psr\Http\Message\ResponseInterface as Response; use Psr\Http\Message\ServerRequestInterface as Request; use Psr\Http\Server\MiddlewareInterface; use Psr\Http\Server\RequestHandlerInterface; + use function strpos; class PathVersionMiddleware implements MiddlewareInterface diff --git a/module/Rest/src/Middleware/ShortUrl/CreateShortUrlContentNegotiationMiddleware.php b/module/Rest/src/Middleware/ShortUrl/CreateShortUrlContentNegotiationMiddleware.php index bc182071..8046dd63 100644 --- a/module/Rest/src/Middleware/ShortUrl/CreateShortUrlContentNegotiationMiddleware.php +++ b/module/Rest/src/Middleware/ShortUrl/CreateShortUrlContentNegotiationMiddleware.php @@ -9,6 +9,7 @@ use Psr\Http\Server\MiddlewareInterface; use Psr\Http\Server\RequestHandlerInterface; use Zend\Diactoros\Response; use Zend\Diactoros\Response\JsonResponse; + use function array_shift; use function explode; use function strpos; diff --git a/module/Rest/src/Middleware/ShortUrl/ShortCodePathMiddleware.php b/module/Rest/src/Middleware/ShortUrl/ShortCodePathMiddleware.php index 64c457c9..80045097 100644 --- a/module/Rest/src/Middleware/ShortUrl/ShortCodePathMiddleware.php +++ b/module/Rest/src/Middleware/ShortUrl/ShortCodePathMiddleware.php @@ -7,6 +7,7 @@ use Psr\Http\Message\ResponseInterface; use Psr\Http\Message\ServerRequestInterface; use Psr\Http\Server\MiddlewareInterface; use Psr\Http\Server\RequestHandlerInterface; + use function str_replace; class ShortCodePathMiddleware implements MiddlewareInterface diff --git a/module/Rest/src/Service/ApiKeyService.php b/module/Rest/src/Service/ApiKeyService.php index b5c8d96e..20a4c19d 100644 --- a/module/Rest/src/Service/ApiKeyService.php +++ b/module/Rest/src/Service/ApiKeyService.php @@ -7,6 +7,7 @@ use Cake\Chronos\Chronos; use Doctrine\ORM\EntityManagerInterface; use Shlinkio\Shlink\Common\Exception\InvalidArgumentException; use Shlinkio\Shlink\Rest\Entity\ApiKey; + use function sprintf; class ApiKeyService implements ApiKeyServiceInterface diff --git a/module/Rest/test-api/Action/CreateShortUrlActionTest.php b/module/Rest/test-api/Action/CreateShortUrlActionTest.php index a04e31f5..30839ebd 100644 --- a/module/Rest/test-api/Action/CreateShortUrlActionTest.php +++ b/module/Rest/test-api/Action/CreateShortUrlActionTest.php @@ -6,6 +6,7 @@ namespace ShlinkioApiTest\Shlink\Rest\Action; use Cake\Chronos\Chronos; use GuzzleHttp\RequestOptions; use ShlinkioTest\Shlink\Common\ApiTest\ApiTestCase; + use function Functional\map; use function range; diff --git a/module/Rest/test-api/Middleware/AuthenticationTest.php b/module/Rest/test-api/Middleware/AuthenticationTest.php index 6b766614..34e67441 100644 --- a/module/Rest/test-api/Middleware/AuthenticationTest.php +++ b/module/Rest/test-api/Middleware/AuthenticationTest.php @@ -7,6 +7,7 @@ use Shlinkio\Shlink\Rest\Authentication\Plugin\ApiKeyHeaderPlugin; use Shlinkio\Shlink\Rest\Authentication\RequestToHttpAuthPlugin; use Shlinkio\Shlink\Rest\Util\RestUtils; use ShlinkioTest\Shlink\Common\ApiTest\ApiTestCase; + use function implode; use function sprintf; diff --git a/module/Rest/test/Action/AuthenticateActionTest.php b/module/Rest/test/Action/AuthenticateActionTest.php index 7a6f53cb..7cd332f2 100644 --- a/module/Rest/test/Action/AuthenticateActionTest.php +++ b/module/Rest/test/Action/AuthenticateActionTest.php @@ -11,6 +11,7 @@ use Shlinkio\Shlink\Rest\Authentication\JWTService; use Shlinkio\Shlink\Rest\Entity\ApiKey; use Shlinkio\Shlink\Rest\Service\ApiKeyService; use Zend\Diactoros\ServerRequest; + use function strpos; class AuthenticateActionTest extends TestCase diff --git a/module/Rest/test/Action/ShortUrl/CreateShortUrlActionTest.php b/module/Rest/test/Action/ShortUrl/CreateShortUrlActionTest.php index cb4ca40e..d743ffa0 100644 --- a/module/Rest/test/Action/ShortUrl/CreateShortUrlActionTest.php +++ b/module/Rest/test/Action/ShortUrl/CreateShortUrlActionTest.php @@ -16,6 +16,7 @@ use Shlinkio\Shlink\Rest\Action\ShortUrl\CreateShortUrlAction; use Shlinkio\Shlink\Rest\Util\RestUtils; use Zend\Diactoros\ServerRequest; use Zend\Diactoros\Uri; + use function strpos; class CreateShortUrlActionTest extends TestCase diff --git a/module/Rest/test/Action/ShortUrl/ResolveShortUrlActionTest.php b/module/Rest/test/Action/ShortUrl/ResolveShortUrlActionTest.php index 1d5ab309..fc8f5d01 100644 --- a/module/Rest/test/Action/ShortUrl/ResolveShortUrlActionTest.php +++ b/module/Rest/test/Action/ShortUrl/ResolveShortUrlActionTest.php @@ -13,6 +13,7 @@ use Shlinkio\Shlink\Core\Service\UrlShortener; use Shlinkio\Shlink\Rest\Action\ShortUrl\ResolveShortUrlAction; use Shlinkio\Shlink\Rest\Util\RestUtils; use Zend\Diactoros\ServerRequest; + use function strpos; class ResolveShortUrlActionTest extends TestCase diff --git a/module/Rest/test/Action/Tag/ListTagsActionTest.php b/module/Rest/test/Action/Tag/ListTagsActionTest.php index cc8dc93c..d6f86b98 100644 --- a/module/Rest/test/Action/Tag/ListTagsActionTest.php +++ b/module/Rest/test/Action/Tag/ListTagsActionTest.php @@ -9,6 +9,7 @@ use Shlinkio\Shlink\Core\Entity\Tag; use Shlinkio\Shlink\Core\Service\Tag\TagServiceInterface; use Shlinkio\Shlink\Rest\Action\Tag\ListTagsAction; use Zend\Diactoros\ServerRequest; + use function Shlinkio\Shlink\Common\json_decode; class ListTagsActionTest extends TestCase diff --git a/module/Rest/test/Authentication/JWTServiceTest.php b/module/Rest/test/Authentication/JWTServiceTest.php index bfce6c74..01f92a1c 100644 --- a/module/Rest/test/Authentication/JWTServiceTest.php +++ b/module/Rest/test/Authentication/JWTServiceTest.php @@ -9,6 +9,7 @@ use Shlinkio\Shlink\Core\Options\AppOptions; use Shlinkio\Shlink\Rest\Authentication\JWTService; use Shlinkio\Shlink\Rest\Entity\ApiKey; use Shlinkio\Shlink\Rest\Exception\AuthenticationException; + use function time; class JWTServiceTest extends TestCase diff --git a/module/Rest/test/Authentication/Plugin/AuthorizationHeaderPluginTest.php b/module/Rest/test/Authentication/Plugin/AuthorizationHeaderPluginTest.php index 461f325a..83c45e24 100644 --- a/module/Rest/test/Authentication/Plugin/AuthorizationHeaderPluginTest.php +++ b/module/Rest/test/Authentication/Plugin/AuthorizationHeaderPluginTest.php @@ -10,6 +10,7 @@ use Shlinkio\Shlink\Rest\Authentication\Plugin\AuthorizationHeaderPlugin; use Shlinkio\Shlink\Rest\Exception\VerifyAuthenticationException; use Zend\Diactoros\Response; use Zend\Diactoros\ServerRequest; + use function sprintf; class AuthorizationHeaderPluginTest extends TestCase diff --git a/module/Rest/test/Authentication/RequestToAuthPluginTest.php b/module/Rest/test/Authentication/RequestToAuthPluginTest.php index 9c3ae9b5..6e7763f9 100644 --- a/module/Rest/test/Authentication/RequestToAuthPluginTest.php +++ b/module/Rest/test/Authentication/RequestToAuthPluginTest.php @@ -12,6 +12,7 @@ use Shlinkio\Shlink\Rest\Authentication\Plugin\AuthorizationHeaderPlugin; use Shlinkio\Shlink\Rest\Authentication\RequestToHttpAuthPlugin; use Shlinkio\Shlink\Rest\Exception\NoAuthenticationException; use Zend\Diactoros\ServerRequest; + use function implode; use function sprintf; diff --git a/module/Rest/test/ErrorHandler/JsonErrorResponseGeneratorTest.php b/module/Rest/test/ErrorHandler/JsonErrorResponseGeneratorTest.php index 22821854..39d32088 100644 --- a/module/Rest/test/ErrorHandler/JsonErrorResponseGeneratorTest.php +++ b/module/Rest/test/ErrorHandler/JsonErrorResponseGeneratorTest.php @@ -7,6 +7,7 @@ use PHPUnit\Framework\TestCase; use Shlinkio\Shlink\Rest\ErrorHandler\JsonErrorResponseGenerator; use Zend\Diactoros\Response; use Zend\Diactoros\ServerRequest; + use function array_map; use function range; diff --git a/module/Rest/test/Exception/VerifyAuthenticationExceptionTest.php b/module/Rest/test/Exception/VerifyAuthenticationExceptionTest.php index 74fe9fc2..da7bee7d 100644 --- a/module/Rest/test/Exception/VerifyAuthenticationExceptionTest.php +++ b/module/Rest/test/Exception/VerifyAuthenticationExceptionTest.php @@ -8,6 +8,7 @@ use PHPUnit\Framework\TestCase; use Shlinkio\Shlink\Common\Util\StringUtilsTrait; use Shlinkio\Shlink\Rest\Exception\VerifyAuthenticationException; use Throwable; + use function array_map; use function random_int; use function range; diff --git a/module/Rest/test/Middleware/AuthenticationMiddlewareTest.php b/module/Rest/test/Middleware/AuthenticationMiddlewareTest.php index eadbd978..94e9b4d7 100644 --- a/module/Rest/test/Middleware/AuthenticationMiddlewareTest.php +++ b/module/Rest/test/Middleware/AuthenticationMiddlewareTest.php @@ -26,6 +26,7 @@ use Zend\Diactoros\Response; use Zend\Diactoros\ServerRequest; use Zend\Expressive\Router\Route; use Zend\Expressive\Router\RouteResult; + use function implode; use function sprintf; use function Zend\Stratigility\middleware; diff --git a/module/Rest/test/Middleware/BodyParserMiddlewareTest.php b/module/Rest/test/Middleware/BodyParserMiddlewareTest.php index 33c1aab2..df1216cd 100644 --- a/module/Rest/test/Middleware/BodyParserMiddlewareTest.php +++ b/module/Rest/test/Middleware/BodyParserMiddlewareTest.php @@ -11,6 +11,7 @@ use Shlinkio\Shlink\Rest\Middleware\BodyParserMiddleware; use Zend\Diactoros\Response; use Zend\Diactoros\ServerRequest; use Zend\Diactoros\Stream; + use function array_shift; class BodyParserMiddlewareTest extends TestCase diff --git a/module/Rest/test/Middleware/PathVersionMiddlewareTest.php b/module/Rest/test/Middleware/PathVersionMiddlewareTest.php index cef65b1c..5d9fbdb1 100644 --- a/module/Rest/test/Middleware/PathVersionMiddlewareTest.php +++ b/module/Rest/test/Middleware/PathVersionMiddlewareTest.php @@ -12,6 +12,7 @@ use Shlinkio\Shlink\Rest\Middleware\PathVersionMiddleware; use Zend\Diactoros\Response; use Zend\Diactoros\ServerRequest; use Zend\Diactoros\Uri; + use function array_shift; class PathVersionMiddlewareTest extends TestCase From 0c5c752ffe24ac7c4e6e5f200afcc36cbfd1311a Mon Sep 17 00:00:00 2001 From: Alejandro Celaya Date: Tue, 26 Feb 2019 22:58:03 +0100 Subject: [PATCH 2/2] Updated changelog --- CHANGELOG.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 5db6cad2..dd2b34ce 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,7 +4,7 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com), and this project adheres to [Semantic Versioning](https://semver.org). -## [Unreleased] +## 1.16.1 - 2019-02-26 #### Added @@ -12,7 +12,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com), and this #### Changed -* *Nothing* +* [#363](https://github.com/shlinkio/shlink/issues/363) Updated to `shlinkio/php-coding-standard` version 1.1.0 #### Deprecated