diff --git a/.phpstorm.meta.php b/.phpstorm.meta.php index 9ed9edd8..9e34cb7e 100644 --- a/.phpstorm.meta.php +++ b/.phpstorm.meta.php @@ -2,7 +2,7 @@ namespace PHPSTORM_META; use Psr\Container\ContainerInterface; -use Zend\ServiceManager\ServiceLocatorInterface; +use Laminas\ServiceManager\ServiceLocatorInterface; /** * PhpStorm Container Interop code completion diff --git a/README.md b/README.md index fce58d56..1853110d 100644 --- a/README.md +++ b/README.md @@ -123,7 +123,7 @@ Once Shlink is configured, you need to expose it to the web, either by using a t First you need to install the swoole PHP extension with [pecl](https://pecl.php.net/package/swoole), `pecl install swoole`. - Once installed, it's actually pretty easy to get shlink up and running with swoole. Run `./vendor/bin/zend-expressive-swoole start -d` and you will get shlink running on port 8080. + Once installed, it's actually pretty easy to get shlink up and running with swoole. Run `./vendor/bin/mezzio-swoole start -d` and you will get shlink running on port 8080. However, by doing it this way, you are loosing all the access logs, and the service won't be automatically run if the server has to be restarted. @@ -140,7 +140,7 @@ Once Shlink is configured, you need to expose it to the web, either by using a t # Description: Shlink non-blocking server with swoole ### END INIT INFO - SCRIPT=/path/to/shlink/vendor/bin/zend-expressive-swoole\ start + SCRIPT=/path/to/shlink/vendor/bin/mezzio-swoole\ start RUNAS=root PIDFILE=/var/run/shlink_swoole.pid diff --git a/UPGRADE.md b/UPGRADE.md index ff0b97a9..42b67fe9 100644 --- a/UPGRADE.md +++ b/UPGRADE.md @@ -60,3 +60,11 @@ Shlink can verify provided long URLs are valid before trying to shorten them. St The `not_found_redirect_to` config option and the `NOT_FOUND_REDIRECT_TO` env var are no longer taken into consideration for the docker image. Instead, use `invalid_short_url_redirect_to` and `INVALID_SHORT_URL_REDIRECT_TO` respectively. + +### Migrated to Laminas + +The project has been using Zend Framework components since the beginning. Since it has been re-branded as [Laminas](https://getlaminas.org/), this version updates to the new set of components. + +Updating to Laminas components has these implications: + +* If you were manually serving Shlink with swoole, the entry script has to be changed from `/path/to/shlink/vendor/bin/zend-expressive-swoole` to `/path/to/shlink/vendor/bin/mezzio-swoole` diff --git a/bin/test/run-api-tests.sh b/bin/test/run-api-tests.sh index cbc10a1a..2a14b218 100755 --- a/bin/test/run-api-tests.sh +++ b/bin/test/run-api-tests.sh @@ -3,16 +3,16 @@ export APP_ENV=test export DB_DRIVER=mysql # Try to stop server just in case it hanged in last execution -vendor/bin/zend-expressive-swoole stop +vendor/bin/mezzio-swoole stop echo 'Starting server...' -vendor/bin/zend-expressive-swoole start -d +vendor/bin/mezzio-swoole start -d sleep 2 vendor/bin/phpunit --order-by=random -c phpunit-api.xml --testdox --colors=always $* testsExitCode=$? -vendor/bin/zend-expressive-swoole stop +vendor/bin/mezzio-swoole stop # Exit this script with the same code as the tests. If tests failed, this script has to fail exit $testsExitCode diff --git a/composer.json b/composer.json index 549b6465..8a1b075f 100644 --- a/composer.json +++ b/composer.json @@ -26,8 +26,21 @@ "firebase/php-jwt": "^4.0", "geoip2/geoip2": "^2.9", "guzzlehttp/guzzle": "^6.5.1", + "laminas/laminas-config": "^3.3", + "laminas/laminas-config-aggregator": "^1.1", + "laminas/laminas-dependency-plugin": "^0.2", + "laminas/laminas-diactoros": "^2.1.3", + "laminas/laminas-inputfilter": "^2.10", + "laminas/laminas-paginator": "^2.8", + "laminas/laminas-servicemanager": "^3.4", + "laminas/laminas-stdlib": "^3.2", "lstrojny/functional-php": "^1.9", - "mikehaertl/phpwkhtmltopdf": "^2.2", + "mezzio/mezzio": "^3.2", + "mezzio/mezzio-fastroute": "^3.0", + "mezzio/mezzio-helpers": "^5.3", + "mezzio/mezzio-platesrenderer": "^2.1", + "mezzio/mezzio-problem-details": "^1.1", + "mezzio/mezzio-swoole": "^2.4", "monolog/monolog": "^2.0", "nikolaposa/monolog-factory": "^3.0", "ocramius/proxy-manager": "^2.5.1", @@ -41,20 +54,7 @@ "symfony/console": "^5.0", "symfony/filesystem": "^5.0", "symfony/lock": "^5.0", - "symfony/process": "^5.0", - "zendframework/zend-config": "^3.3", - "zendframework/zend-config-aggregator": "^1.1", - "zendframework/zend-diactoros": "^2.1.3", - "zendframework/zend-expressive": "^3.2", - "zendframework/zend-expressive-fastroute": "^3.0", - "zendframework/zend-expressive-helpers": "^5.3", - "zendframework/zend-expressive-platesrenderer": "^2.1", - "zendframework/zend-expressive-swoole": "^2.4", - "zendframework/zend-inputfilter": "^2.10", - "zendframework/zend-paginator": "^2.8", - "zendframework/zend-problem-details": "^1.1", - "zendframework/zend-servicemanager": "^3.4", - "zendframework/zend-stdlib": "^3.2" + "symfony/process": "^5.0" }, "require-dev": { "devster/ubench": "^2.0", diff --git a/config/autoload/common.global.php b/config/autoload/common.global.php index 3f06b47e..4d8c3520 100644 --- a/config/autoload/common.global.php +++ b/config/autoload/common.global.php @@ -2,7 +2,7 @@ declare(strict_types=1); -use Zend\ConfigAggregator\ConfigAggregator; +use Laminas\ConfigAggregator\ConfigAggregator; return [ diff --git a/config/autoload/common.local.php.dist b/config/autoload/common.local.php.dist index 2b149bb5..9d1276c4 100644 --- a/config/autoload/common.local.php.dist +++ b/config/autoload/common.local.php.dist @@ -1,7 +1,7 @@ [ 'delegators' => [ - Expressive\Application::class => [ + Mezzio\Application::class => [ Container\ApplicationConfigInjectionDelegator::class, ], ], diff --git a/config/autoload/error-handler.global.php b/config/autoload/error-handler.global.php index 69a54f03..b4872bfe 100644 --- a/config/autoload/error-handler.global.php +++ b/config/autoload/error-handler.global.php @@ -2,9 +2,9 @@ declare(strict_types=1); +use Laminas\Stratigility\Middleware\ErrorHandler; +use Mezzio\ProblemDetails\ProblemDetailsMiddleware; use Shlinkio\Shlink\Common\Logger; -use Zend\ProblemDetails\ProblemDetailsMiddleware; -use Zend\Stratigility\Middleware\ErrorHandler; return [ diff --git a/config/autoload/locks.global.php b/config/autoload/locks.global.php index 0294bf91..22a51e38 100644 --- a/config/autoload/locks.global.php +++ b/config/autoload/locks.global.php @@ -2,11 +2,11 @@ declare(strict_types=1); +use Laminas\ServiceManager\AbstractFactory\ConfigAbstractFactory; use Shlinkio\Shlink\Common\Cache\RedisFactory; use Shlinkio\Shlink\Common\Lock\RetryLockStoreDelegatorFactory; use Shlinkio\Shlink\Common\Logger\LoggerAwareDelegatorFactory; use Symfony\Component\Lock; -use Zend\ServiceManager\AbstractFactory\ConfigAbstractFactory; $localLockFactory = 'Shlinkio\Shlink\LocalLockFactory'; diff --git a/config/autoload/logger.global.php b/config/autoload/logger.global.php index 40aa8a2d..01cf8aab 100644 --- a/config/autoload/logger.global.php +++ b/config/autoload/logger.global.php @@ -75,7 +75,7 @@ return [ ], ], - 'zend-expressive-swoole' => [ + 'mezzio-swoole' => [ 'swoole-http-server' => [ 'logger' => [ 'logger-name' => 'Logger_Access', diff --git a/config/autoload/middleware-pipeline.global.php b/config/autoload/middleware-pipeline.global.php index 0f24a7c9..2ace0700 100644 --- a/config/autoload/middleware-pipeline.global.php +++ b/config/autoload/middleware-pipeline.global.php @@ -4,16 +4,16 @@ declare(strict_types=1); namespace Shlinkio\Shlink; -use Zend\Expressive; -use Zend\ProblemDetails; -use Zend\Stratigility\Middleware\ErrorHandler; +use Laminas\Stratigility\Middleware\ErrorHandler; +use Mezzio; +use Mezzio\ProblemDetails; return [ 'middleware_pipeline' => [ 'error-handler' => [ 'middleware' => [ - Expressive\Helper\ContentLengthMiddleware::class, + Mezzio\Helper\ContentLengthMiddleware::class, ErrorHandler::class, ], ], @@ -33,14 +33,14 @@ return [ 'routing' => [ 'middleware' => [ - Expressive\Router\Middleware\RouteMiddleware::class, + Mezzio\Router\Middleware\RouteMiddleware::class, ], ], 'rest' => [ 'path' => '/rest', 'middleware' => [ - Expressive\Router\Middleware\ImplicitOptionsMiddleware::class, + Mezzio\Router\Middleware\ImplicitOptionsMiddleware::class, Rest\Middleware\BodyParserMiddleware::class, Rest\Middleware\AuthenticationMiddleware::class, ], @@ -48,7 +48,7 @@ return [ 'dispatch' => [ 'middleware' => [ - Expressive\Router\Middleware\DispatchMiddleware::class, + Mezzio\Router\Middleware\DispatchMiddleware::class, ], ], diff --git a/config/autoload/router.global.php b/config/autoload/router.global.php index 7ab1cc82..d45ee330 100644 --- a/config/autoload/router.global.php +++ b/config/autoload/router.global.php @@ -2,7 +2,7 @@ declare(strict_types=1); -use Zend\Expressive\Router\FastRouteRouter; +use Mezzio\Router\FastRouteRouter; return [ diff --git a/config/autoload/router.local.php.dist b/config/autoload/router.local.php.dist index 3251c8ab..3fe6811a 100644 --- a/config/autoload/router.local.php.dist +++ b/config/autoload/router.local.php.dist @@ -1,5 +1,5 @@ [ + 'mezzio-swoole' => [ 'enable_coroutine' => true, 'swoole-http-server' => [ diff --git a/config/autoload/swoole.local.php.dist b/config/autoload/swoole.local.php.dist index 017d17eb..5e12a5a3 100644 --- a/config/autoload/swoole.local.php.dist +++ b/config/autoload/swoole.local.php.dist @@ -1,12 +1,12 @@ [ + 'mezzio-swoole' => [ 'hot-code-reload' => [ 'enable' => true, ], diff --git a/config/autoload/wkhtmltopdf.global.php b/config/autoload/wkhtmltopdf.global.php deleted file mode 100644 index 0059aae4..00000000 --- a/config/autoload/wkhtmltopdf.global.php +++ /dev/null @@ -1,14 +0,0 @@ - [ - 'images' => [ - 'binary' => __DIR__ . '/../../bin/wkhtmltoimage', - 'type' => 'jpg', - ], - ], - -]; diff --git a/config/cli-config.php b/config/cli-config.php index 1d96d50e..c0e80687 100644 --- a/config/cli-config.php +++ b/config/cli-config.php @@ -4,8 +4,8 @@ declare(strict_types=1); use Doctrine\ORM\EntityManager; use Doctrine\ORM\Tools\Console\ConsoleRunner; +use Laminas\ServiceManager\ServiceManager; use Psr\Container\ContainerInterface; -use Zend\ServiceManager\ServiceManager; return (function () { /** @var ContainerInterface|ServiceManager $container */ diff --git a/config/config.php b/config/config.php index 855f5d41..3fb1a3e4 100644 --- a/config/config.php +++ b/config/config.php @@ -4,18 +4,19 @@ declare(strict_types=1); namespace Shlinkio\Shlink; -use Zend\ConfigAggregator; -use Zend\Expressive; -use Zend\ProblemDetails; +use Laminas\ConfigAggregator; +use Laminas\ZendFrameworkBridge; +use Mezzio; +use Mezzio\ProblemDetails; use function Shlinkio\Shlink\Common\env; return (new ConfigAggregator\ConfigAggregator([ - Expressive\ConfigProvider::class, - Expressive\Router\ConfigProvider::class, - Expressive\Router\FastRouteRouter\ConfigProvider::class, - Expressive\Plates\ConfigProvider::class, - Expressive\Swoole\ConfigProvider::class, + Mezzio\ConfigProvider::class, + Mezzio\Router\ConfigProvider::class, + Mezzio\Router\FastRouteRouter\ConfigProvider::class, + Mezzio\Plates\ConfigProvider::class, + Mezzio\Swoole\ConfigProvider::class, ProblemDetails\ConfigProvider::class, Common\ConfigProvider::class, IpGeolocation\ConfigProvider::class, @@ -26,8 +27,9 @@ return (new ConfigAggregator\ConfigAggregator([ new ConfigAggregator\PhpFileProvider('config/autoload/{{,*.}global,{,*.}local}.php'), env('APP_ENV') === 'test' ? new ConfigAggregator\PhpFileProvider('config/test/*.global.php') - : new ConfigAggregator\ZendConfigProvider('config/params/{generated_config.php,*.config.{php,json}}'), + : new ConfigAggregator\LaminasConfigProvider('config/params/{generated_config.php,*.config.{php,json}}'), ], 'data/cache/app_config.php', [ + ZendFrameworkBridge\ConfigPostProcessor::class, Core\Config\SimplifiedConfigParser::class, Core\Config\BasePathPrefixer::class, Core\Config\DeprecatedConfigParser::class, diff --git a/config/container.php b/config/container.php index 2ea9dc06..3735e14e 100644 --- a/config/container.php +++ b/config/container.php @@ -2,8 +2,8 @@ declare(strict_types=1); +use Laminas\ServiceManager\ServiceManager; use Symfony\Component\Lock; -use Zend\ServiceManager\ServiceManager; chdir(dirname(__DIR__)); diff --git a/config/run.php b/config/run.php index 4ea61775..80116e24 100644 --- a/config/run.php +++ b/config/run.php @@ -2,9 +2,9 @@ declare(strict_types=1); +use Mezzio\Application; use Psr\Container\ContainerInterface; use Symfony\Component\Console\Application as CliApp; -use Zend\Expressive\Application; return function (bool $isCli = false): void { /** @var ContainerInterface $container */ diff --git a/config/test/test_config.global.php b/config/test/test_config.global.php index a3b297b7..c4556b8b 100644 --- a/config/test/test_config.global.php +++ b/config/test/test_config.global.php @@ -5,9 +5,9 @@ declare(strict_types=1); namespace Shlinkio\Shlink; use GuzzleHttp\Client; +use Laminas\ConfigAggregator\ConfigAggregator; +use Laminas\ServiceManager\Factory\InvokableFactory; use PDO; -use Zend\ConfigAggregator\ConfigAggregator; -use Zend\ServiceManager\Factory\InvokableFactory; use function Shlinkio\Shlink\Common\env; use function sprintf; @@ -64,7 +64,7 @@ return [ 'validate_url' => true, ], - 'zend-expressive-swoole' => [ + 'mezzio-swoole' => [ 'enable_coroutine' => false, 'swoole-http-server' => [ 'host' => $swooleTestingHost, diff --git a/data/infra/examples/shlink-daemon.sh b/data/infra/examples/shlink-daemon.sh index 86b1257d..a18ca65a 100644 --- a/data/infra/examples/shlink-daemon.sh +++ b/data/infra/examples/shlink-daemon.sh @@ -8,7 +8,7 @@ # Description: Shlink non-blocking server with swoole ### END INIT INFO -SCRIPT=/path/to/shlink/vendor/bin/zend-expressive-swoole\ start +SCRIPT=/path/to/shlink/vendor/bin/mezzio-swoole\ start RUNAS=root PIDFILE=/var/run/shlink_swoole.pid diff --git a/data/infra/swoole.Dockerfile b/data/infra/swoole.Dockerfile index 46f45e6d..8bc821d9 100644 --- a/data/infra/swoole.Dockerfile +++ b/data/infra/swoole.Dockerfile @@ -92,4 +92,4 @@ CMD \ if [[ ! -d "./vendor" ]]; then /usr/local/bin/composer install ; fi && \ # When restarting the container, swoole might think it is already in execution # This forces the app to be started every second until the exit code is 0 - until php ./vendor/bin/zend-expressive-swoole start; do sleep 1 ; done + until php ./vendor/bin/mezzio-swoole start; do sleep 1 ; done diff --git a/docker/config/shlink_in_docker.local.php b/docker/config/shlink_in_docker.local.php index 5b9d5547..0da6a9e5 100644 --- a/docker/config/shlink_in_docker.local.php +++ b/docker/config/shlink_in_docker.local.php @@ -120,7 +120,7 @@ return [ 'base_path' => env('BASE_PATH', ''), ], - 'zend-expressive-swoole' => [ + 'mezzio-swoole' => [ 'swoole-http-server' => [ 'options' => [ 'worker_num' => (int) env('WEB_WORKER_NUM', 16), diff --git a/docker/docker-entrypoint.sh b/docker/docker-entrypoint.sh index 4842522d..7f924057 100644 --- a/docker/docker-entrypoint.sh +++ b/docker/docker-entrypoint.sh @@ -14,4 +14,4 @@ php vendor/doctrine/orm/bin/doctrine.php orm:generate-proxies -n -q # When restarting the container, swoole might think it is already in execution # This forces the app to be started every second until the exit code is 0 -until php vendor/zendframework/zend-expressive-swoole/bin/zend-expressive-swoole start; do sleep 1 ; done +until php vendor/mezzio/mezzio-swoole/bin/mezzio-swoole start; do sleep 1 ; done diff --git a/module/CLI/config/dependencies.config.php b/module/CLI/config/dependencies.config.php index c7eea7b2..dfa8452f 100644 --- a/module/CLI/config/dependencies.config.php +++ b/module/CLI/config/dependencies.config.php @@ -6,6 +6,8 @@ namespace Shlinkio\Shlink\CLI; use Doctrine\DBAL\Connection; use GeoIp2\Database\Reader; +use Laminas\ServiceManager\AbstractFactory\ConfigAbstractFactory; +use Laminas\ServiceManager\Factory\InvokableFactory; use Shlinkio\Shlink\CLI\Util\GeolocationDbUpdater; use Shlinkio\Shlink\Common\Doctrine\NoDbNameConnectionFactory; use Shlinkio\Shlink\Core\Service; @@ -16,8 +18,6 @@ use Shlinkio\Shlink\Rest\Service\ApiKeyService; use Symfony\Component\Console as SymfonyCli; use Symfony\Component\Lock\LockFactory; use Symfony\Component\Process\PhpExecutableFinder; -use Zend\ServiceManager\AbstractFactory\ConfigAbstractFactory; -use Zend\ServiceManager\Factory\InvokableFactory; return [ diff --git a/module/CLI/src/Command/ShortUrl/GenerateShortUrlCommand.php b/module/CLI/src/Command/ShortUrl/GenerateShortUrlCommand.php index 9a4f4139..1e9b41ce 100644 --- a/module/CLI/src/Command/ShortUrl/GenerateShortUrlCommand.php +++ b/module/CLI/src/Command/ShortUrl/GenerateShortUrlCommand.php @@ -4,6 +4,7 @@ declare(strict_types=1); namespace Shlinkio\Shlink\CLI\Command\ShortUrl; +use Laminas\Diactoros\Uri; use Shlinkio\Shlink\CLI\Util\ExitCodes; use Shlinkio\Shlink\Core\Exception\InvalidUrlException; use Shlinkio\Shlink\Core\Exception\NonUniqueSlugException; @@ -15,7 +16,6 @@ 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 Zend\Diactoros\Uri; use function array_map; use function Functional\curry; diff --git a/module/CLI/src/Command/ShortUrl/ListShortUrlsCommand.php b/module/CLI/src/Command/ShortUrl/ListShortUrlsCommand.php index 6cb6f1b9..c4251ed9 100644 --- a/module/CLI/src/Command/ShortUrl/ListShortUrlsCommand.php +++ b/module/CLI/src/Command/ShortUrl/ListShortUrlsCommand.php @@ -5,6 +5,7 @@ declare(strict_types=1); namespace Shlinkio\Shlink\CLI\Command\ShortUrl; use Cake\Chronos\Chronos; +use Laminas\Paginator\Paginator; use Shlinkio\Shlink\CLI\Command\Util\AbstractWithDateRangeCommand; use Shlinkio\Shlink\CLI\Util\ExitCodes; use Shlinkio\Shlink\CLI\Util\ShlinkTable; @@ -17,7 +18,6 @@ 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 Zend\Paginator\Paginator; use function array_flip; use function array_intersect_key; diff --git a/module/CLI/test/Command/ShortUrl/GetVisitsCommandTest.php b/module/CLI/test/Command/ShortUrl/GetVisitsCommandTest.php index b3309772..53ba114e 100644 --- a/module/CLI/test/Command/ShortUrl/GetVisitsCommandTest.php +++ b/module/CLI/test/Command/ShortUrl/GetVisitsCommandTest.php @@ -5,6 +5,8 @@ declare(strict_types=1); namespace ShlinkioTest\Shlink\CLI\Command\ShortUrl; use Cake\Chronos\Chronos; +use Laminas\Paginator\Adapter\ArrayAdapter; +use Laminas\Paginator\Paginator; use PHPUnit\Framework\TestCase; use Prophecy\Argument; use Prophecy\Prophecy\ObjectProphecy; @@ -19,8 +21,6 @@ use Shlinkio\Shlink\Core\Service\VisitsTrackerInterface; use Shlinkio\Shlink\IpGeolocation\Model\Location; use Symfony\Component\Console\Application; use Symfony\Component\Console\Tester\CommandTester; -use Zend\Paginator\Adapter\ArrayAdapter; -use Zend\Paginator\Paginator; use function sprintf; diff --git a/module/CLI/test/Command/ShortUrl/ListShortUrlsCommandTest.php b/module/CLI/test/Command/ShortUrl/ListShortUrlsCommandTest.php index 8c90050b..d4182e27 100644 --- a/module/CLI/test/Command/ShortUrl/ListShortUrlsCommandTest.php +++ b/module/CLI/test/Command/ShortUrl/ListShortUrlsCommandTest.php @@ -5,6 +5,8 @@ declare(strict_types=1); namespace ShlinkioTest\Shlink\CLI\Command\ShortUrl; use Cake\Chronos\Chronos; +use Laminas\Paginator\Adapter\ArrayAdapter; +use Laminas\Paginator\Paginator; use PHPUnit\Framework\TestCase; use Prophecy\Argument; use Prophecy\Prophecy\ObjectProphecy; @@ -14,8 +16,6 @@ use Shlinkio\Shlink\Core\Entity\ShortUrl; use Shlinkio\Shlink\Core\Service\ShortUrlServiceInterface; use Symfony\Component\Console\Application; use Symfony\Component\Console\Tester\CommandTester; -use Zend\Paginator\Adapter\ArrayAdapter; -use Zend\Paginator\Paginator; use function explode; diff --git a/module/CLI/test/Factory/ApplicationFactoryTest.php b/module/CLI/test/Factory/ApplicationFactoryTest.php index 5e1dd472..043349ab 100644 --- a/module/CLI/test/Factory/ApplicationFactoryTest.php +++ b/module/CLI/test/Factory/ApplicationFactoryTest.php @@ -4,6 +4,7 @@ declare(strict_types=1); namespace ShlinkioTest\Shlink\CLI\Factory; +use Laminas\ServiceManager\ServiceManager; use PHPUnit\Framework\TestCase; use Prophecy\Argument; use Prophecy\Prophecy\ObjectProphecy; @@ -11,7 +12,6 @@ use Shlinkio\Shlink\CLI\Factory\ApplicationFactory; use Shlinkio\Shlink\Core\Options\AppOptions; use Symfony\Component\Console\Application; use Symfony\Component\Console\Command\Command; -use Zend\ServiceManager\ServiceManager; class ApplicationFactoryTest extends TestCase { diff --git a/module/Core/config/dependencies.config.php b/module/Core/config/dependencies.config.php index 34759868..8d053c4f 100644 --- a/module/Core/config/dependencies.config.php +++ b/module/Core/config/dependencies.config.php @@ -5,12 +5,12 @@ declare(strict_types=1); namespace Shlinkio\Shlink\Core; use Doctrine\Common\Cache\Cache; +use Laminas\ServiceManager\AbstractFactory\ConfigAbstractFactory; +use Mezzio\Router\RouterInterface; +use Mezzio\Template\TemplateRendererInterface; use Psr\EventDispatcher\EventDispatcherInterface; use Shlinkio\Shlink\Core\ErrorHandler; use Shlinkio\Shlink\Core\Options\NotFoundRedirectOptions; -use Zend\Expressive\Router\RouterInterface; -use Zend\Expressive\Template\TemplateRendererInterface; -use Zend\ServiceManager\AbstractFactory\ConfigAbstractFactory; return [ diff --git a/module/Core/config/event_dispatcher.config.php b/module/Core/config/event_dispatcher.config.php index aead1447..29dbbd11 100644 --- a/module/Core/config/event_dispatcher.config.php +++ b/module/Core/config/event_dispatcher.config.php @@ -4,10 +4,10 @@ declare(strict_types=1); namespace Shlinkio\Shlink\Core; +use Laminas\ServiceManager\AbstractFactory\ConfigAbstractFactory; use Psr\EventDispatcher\EventDispatcherInterface; use Shlinkio\Shlink\CLI\Util\GeolocationDbUpdater; use Shlinkio\Shlink\IpGeolocation\Resolver\IpLocationResolverInterface; -use Zend\ServiceManager\AbstractFactory\ConfigAbstractFactory; return [ diff --git a/module/Core/config/zend-expressive.config.php b/module/Core/config/mezzio.config.php similarity index 88% rename from module/Core/config/zend-expressive.config.php rename to module/Core/config/mezzio.config.php index c0fa05c9..5e4acb22 100644 --- a/module/Core/config/zend-expressive.config.php +++ b/module/Core/config/mezzio.config.php @@ -4,7 +4,7 @@ declare(strict_types=1); return [ - 'zend-expressive' => [ + 'mezzio' => [ 'error_handler' => [ 'template_404' => 'ShlinkCore::error/404', 'template_error' => 'ShlinkCore::error/error', diff --git a/module/Core/src/Action/AbstractTrackingAction.php b/module/Core/src/Action/AbstractTrackingAction.php index 243fc081..384b7a3e 100644 --- a/module/Core/src/Action/AbstractTrackingAction.php +++ b/module/Core/src/Action/AbstractTrackingAction.php @@ -4,6 +4,7 @@ declare(strict_types=1); namespace Shlinkio\Shlink\Core\Action; +use Laminas\Diactoros\Uri; use Psr\Http\Message\ResponseInterface; use Psr\Http\Message\ServerRequestInterface; use Psr\Http\Server\MiddlewareInterface; @@ -16,7 +17,6 @@ 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 Zend\Diactoros\Uri; use function array_key_exists; use function array_merge; diff --git a/module/Core/src/Action/QrCodeAction.php b/module/Core/src/Action/QrCodeAction.php index d9480db4..a1a58ae7 100644 --- a/module/Core/src/Action/QrCodeAction.php +++ b/module/Core/src/Action/QrCodeAction.php @@ -5,6 +5,8 @@ declare(strict_types=1); namespace Shlinkio\Shlink\Core\Action; use Endroid\QrCode\QrCode; +use Mezzio\Router\Exception\RuntimeException; +use Mezzio\Router\RouterInterface; use Psr\Http\Message\ResponseInterface as Response; use Psr\Http\Message\ServerRequestInterface as Request; use Psr\Http\Server\MiddlewareInterface; @@ -14,8 +16,6 @@ use Psr\Log\NullLogger; use Shlinkio\Shlink\Common\Response\QrCodeResponse; use Shlinkio\Shlink\Core\Exception\ShortUrlNotFoundException; use Shlinkio\Shlink\Core\Service\UrlShortenerInterface; -use Zend\Expressive\Router\Exception\RuntimeException; -use Zend\Expressive\Router\RouterInterface; class QrCodeAction implements MiddlewareInterface { diff --git a/module/Core/src/Action/RedirectAction.php b/module/Core/src/Action/RedirectAction.php index 31fdb1a3..e6e1ec4c 100644 --- a/module/Core/src/Action/RedirectAction.php +++ b/module/Core/src/Action/RedirectAction.php @@ -4,10 +4,10 @@ declare(strict_types=1); namespace Shlinkio\Shlink\Core\Action; +use Laminas\Diactoros\Response\RedirectResponse; use Psr\Http\Message\ResponseInterface as Response; use Psr\Http\Message\ServerRequestInterface; use Psr\Http\Server\RequestHandlerInterface; -use Zend\Diactoros\Response\RedirectResponse; class RedirectAction extends AbstractTrackingAction { diff --git a/module/Core/src/Config/SimplifiedConfigParser.php b/module/Core/src/Config/SimplifiedConfigParser.php index a48a34e6..651066d4 100644 --- a/module/Core/src/Config/SimplifiedConfigParser.php +++ b/module/Core/src/Config/SimplifiedConfigParser.php @@ -4,8 +4,8 @@ declare(strict_types=1); namespace Shlinkio\Shlink\Core\Config; +use Laminas\Stdlib\ArrayUtils; use Shlinkio\Shlink\Installer\Util\PathCollection; -use Zend\Stdlib\ArrayUtils; use function array_flip; use function array_intersect_key; @@ -29,8 +29,8 @@ class SimplifiedConfigParser 'delete_short_url_threshold' => ['delete_short_urls', 'visits_threshold'], 'redis_servers' => ['redis', 'servers'], 'base_path' => ['router', 'base_path'], - 'web_worker_num' => ['zend-expressive-swoole', 'swoole-http-server', 'options', 'worker_num'], - 'task_worker_num' => ['zend-expressive-swoole', 'swoole-http-server', 'options', 'task_worker_num'], + 'web_worker_num' => ['mezzio-swoole', 'swoole-http-server', 'options', 'worker_num'], + 'task_worker_num' => ['mezzio-swoole', 'swoole-http-server', 'options', 'task_worker_num'], 'visits_webhooks' => ['url_shortener', 'visits_webhooks'], ]; private const SIMPLIFIED_CONFIG_SIDE_EFFECTS = [ diff --git a/module/Core/src/Entity/ShortUrl.php b/module/Core/src/Entity/ShortUrl.php index 858568f3..a48a93fa 100644 --- a/module/Core/src/Entity/ShortUrl.php +++ b/module/Core/src/Entity/ShortUrl.php @@ -7,12 +7,12 @@ namespace Shlinkio\Shlink\Core\Entity; use Cake\Chronos\Chronos; use Doctrine\Common\Collections\ArrayCollection; use Doctrine\Common\Collections\Collection; +use Laminas\Diactoros\Uri; use Shlinkio\Shlink\Common\Entity\AbstractEntity; use Shlinkio\Shlink\Core\Domain\Resolver\DomainResolverInterface; use Shlinkio\Shlink\Core\Domain\Resolver\SimpleDomainResolver; use Shlinkio\Shlink\Core\Exception\ShortCodeCannotBeRegeneratedException; use Shlinkio\Shlink\Core\Model\ShortUrlMeta; -use Zend\Diactoros\Uri; use function array_reduce; use function count; diff --git a/module/Core/src/ErrorHandler/NotFoundRedirectHandler.php b/module/Core/src/ErrorHandler/NotFoundRedirectHandler.php index 54dc9cac..13615b7d 100644 --- a/module/Core/src/ErrorHandler/NotFoundRedirectHandler.php +++ b/module/Core/src/ErrorHandler/NotFoundRedirectHandler.php @@ -4,6 +4,8 @@ declare(strict_types=1); namespace Shlinkio\Shlink\Core\ErrorHandler; +use Laminas\Diactoros\Response; +use Mezzio\Router\RouteResult; use Psr\Http\Message\ResponseInterface; use Psr\Http\Message\ServerRequestInterface; use Psr\Http\Message\UriInterface; @@ -11,8 +13,6 @@ use Psr\Http\Server\MiddlewareInterface; use Psr\Http\Server\RequestHandlerInterface; use Shlinkio\Shlink\Core\Action\RedirectAction; use Shlinkio\Shlink\Core\Options\NotFoundRedirectOptions; -use Zend\Diactoros\Response; -use Zend\Expressive\Router\RouteResult; use function rtrim; diff --git a/module/Core/src/ErrorHandler/NotFoundTemplateHandler.php b/module/Core/src/ErrorHandler/NotFoundTemplateHandler.php index 45c8ee62..e5968a68 100644 --- a/module/Core/src/ErrorHandler/NotFoundTemplateHandler.php +++ b/module/Core/src/ErrorHandler/NotFoundTemplateHandler.php @@ -6,12 +6,12 @@ namespace Shlinkio\Shlink\Core\ErrorHandler; use Fig\Http\Message\StatusCodeInterface; use InvalidArgumentException; +use Laminas\Diactoros\Response; +use Mezzio\Router\RouteResult; +use Mezzio\Template\TemplateRendererInterface; use Psr\Http\Message\ResponseInterface; use Psr\Http\Message\ServerRequestInterface; use Psr\Http\Server\RequestHandlerInterface; -use Zend\Diactoros\Response; -use Zend\Expressive\Router\RouteResult; -use Zend\Expressive\Template\TemplateRendererInterface; class NotFoundTemplateHandler implements RequestHandlerInterface { diff --git a/module/Core/src/Exception/DeleteShortUrlException.php b/module/Core/src/Exception/DeleteShortUrlException.php index e152aa23..f98b7e14 100644 --- a/module/Core/src/Exception/DeleteShortUrlException.php +++ b/module/Core/src/Exception/DeleteShortUrlException.php @@ -5,8 +5,8 @@ declare(strict_types=1); namespace Shlinkio\Shlink\Core\Exception; use Fig\Http\Message\StatusCodeInterface; -use Zend\ProblemDetails\Exception\CommonProblemDetailsExceptionTrait; -use Zend\ProblemDetails\Exception\ProblemDetailsExceptionInterface; +use Mezzio\ProblemDetails\Exception\CommonProblemDetailsExceptionTrait; +use Mezzio\ProblemDetails\Exception\ProblemDetailsExceptionInterface; use function sprintf; diff --git a/module/Core/src/Exception/InvalidUrlException.php b/module/Core/src/Exception/InvalidUrlException.php index ffec94df..ee4caaf6 100644 --- a/module/Core/src/Exception/InvalidUrlException.php +++ b/module/Core/src/Exception/InvalidUrlException.php @@ -5,9 +5,9 @@ declare(strict_types=1); namespace Shlinkio\Shlink\Core\Exception; use Fig\Http\Message\StatusCodeInterface; +use Mezzio\ProblemDetails\Exception\CommonProblemDetailsExceptionTrait; +use Mezzio\ProblemDetails\Exception\ProblemDetailsExceptionInterface; use Throwable; -use Zend\ProblemDetails\Exception\CommonProblemDetailsExceptionTrait; -use Zend\ProblemDetails\Exception\ProblemDetailsExceptionInterface; use function sprintf; diff --git a/module/Core/src/Exception/NonUniqueSlugException.php b/module/Core/src/Exception/NonUniqueSlugException.php index 51beff82..8887f961 100644 --- a/module/Core/src/Exception/NonUniqueSlugException.php +++ b/module/Core/src/Exception/NonUniqueSlugException.php @@ -5,8 +5,8 @@ declare(strict_types=1); namespace Shlinkio\Shlink\Core\Exception; use Fig\Http\Message\StatusCodeInterface; -use Zend\ProblemDetails\Exception\CommonProblemDetailsExceptionTrait; -use Zend\ProblemDetails\Exception\ProblemDetailsExceptionInterface; +use Mezzio\ProblemDetails\Exception\CommonProblemDetailsExceptionTrait; +use Mezzio\ProblemDetails\Exception\ProblemDetailsExceptionInterface; use function sprintf; diff --git a/module/Core/src/Exception/ShortUrlNotFoundException.php b/module/Core/src/Exception/ShortUrlNotFoundException.php index aca1bce9..e68e55ed 100644 --- a/module/Core/src/Exception/ShortUrlNotFoundException.php +++ b/module/Core/src/Exception/ShortUrlNotFoundException.php @@ -5,8 +5,8 @@ declare(strict_types=1); namespace Shlinkio\Shlink\Core\Exception; use Fig\Http\Message\StatusCodeInterface; -use Zend\ProblemDetails\Exception\CommonProblemDetailsExceptionTrait; -use Zend\ProblemDetails\Exception\ProblemDetailsExceptionInterface; +use Mezzio\ProblemDetails\Exception\CommonProblemDetailsExceptionTrait; +use Mezzio\ProblemDetails\Exception\ProblemDetailsExceptionInterface; use function sprintf; diff --git a/module/Core/src/Exception/TagConflictException.php b/module/Core/src/Exception/TagConflictException.php index 5a624f8f..7362f76b 100644 --- a/module/Core/src/Exception/TagConflictException.php +++ b/module/Core/src/Exception/TagConflictException.php @@ -5,8 +5,8 @@ declare(strict_types=1); namespace Shlinkio\Shlink\Core\Exception; use Fig\Http\Message\StatusCodeInterface; -use Zend\ProblemDetails\Exception\CommonProblemDetailsExceptionTrait; -use Zend\ProblemDetails\Exception\ProblemDetailsExceptionInterface; +use Mezzio\ProblemDetails\Exception\CommonProblemDetailsExceptionTrait; +use Mezzio\ProblemDetails\Exception\ProblemDetailsExceptionInterface; use function sprintf; diff --git a/module/Core/src/Exception/TagNotFoundException.php b/module/Core/src/Exception/TagNotFoundException.php index 1924e89a..18c1554c 100644 --- a/module/Core/src/Exception/TagNotFoundException.php +++ b/module/Core/src/Exception/TagNotFoundException.php @@ -5,8 +5,8 @@ declare(strict_types=1); namespace Shlinkio\Shlink\Core\Exception; use Fig\Http\Message\StatusCodeInterface; -use Zend\ProblemDetails\Exception\CommonProblemDetailsExceptionTrait; -use Zend\ProblemDetails\Exception\ProblemDetailsExceptionInterface; +use Mezzio\ProblemDetails\Exception\CommonProblemDetailsExceptionTrait; +use Mezzio\ProblemDetails\Exception\ProblemDetailsExceptionInterface; use function sprintf; diff --git a/module/Core/src/Exception/ValidationException.php b/module/Core/src/Exception/ValidationException.php index b9d23082..fc090279 100644 --- a/module/Core/src/Exception/ValidationException.php +++ b/module/Core/src/Exception/ValidationException.php @@ -5,10 +5,10 @@ declare(strict_types=1); namespace Shlinkio\Shlink\Core\Exception; use Fig\Http\Message\StatusCodeInterface; +use Laminas\InputFilter\InputFilterInterface; +use Mezzio\ProblemDetails\Exception\CommonProblemDetailsExceptionTrait; +use Mezzio\ProblemDetails\Exception\ProblemDetailsExceptionInterface; use Throwable; -use Zend\InputFilter\InputFilterInterface; -use Zend\ProblemDetails\Exception\CommonProblemDetailsExceptionTrait; -use Zend\ProblemDetails\Exception\ProblemDetailsExceptionInterface; use function array_keys; use function Functional\reduce_left; diff --git a/module/Core/src/Middleware/QrCodeCacheMiddleware.php b/module/Core/src/Middleware/QrCodeCacheMiddleware.php index 66ed5382..79101ae5 100644 --- a/module/Core/src/Middleware/QrCodeCacheMiddleware.php +++ b/module/Core/src/Middleware/QrCodeCacheMiddleware.php @@ -5,11 +5,11 @@ declare(strict_types=1); namespace Shlinkio\Shlink\Core\Middleware; use Doctrine\Common\Cache\Cache; +use Laminas\Diactoros\Response as DiactResp; 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 Zend\Diactoros\Response as DiactResp; class QrCodeCacheMiddleware implements MiddlewareInterface { diff --git a/module/Core/src/Options/AppOptions.php b/module/Core/src/Options/AppOptions.php index 347e41b2..aa51b871 100644 --- a/module/Core/src/Options/AppOptions.php +++ b/module/Core/src/Options/AppOptions.php @@ -4,8 +4,8 @@ declare(strict_types=1); namespace Shlinkio\Shlink\Core\Options; +use Laminas\Stdlib\AbstractOptions; use Shlinkio\Shlink\Common\Util\StringUtilsTrait; -use Zend\Stdlib\AbstractOptions; use function sprintf; diff --git a/module/Core/src/Options/DeleteShortUrlsOptions.php b/module/Core/src/Options/DeleteShortUrlsOptions.php index 566ac819..ee7d9dee 100644 --- a/module/Core/src/Options/DeleteShortUrlsOptions.php +++ b/module/Core/src/Options/DeleteShortUrlsOptions.php @@ -4,7 +4,7 @@ declare(strict_types=1); namespace Shlinkio\Shlink\Core\Options; -use Zend\Stdlib\AbstractOptions; +use Laminas\Stdlib\AbstractOptions; class DeleteShortUrlsOptions extends AbstractOptions { diff --git a/module/Core/src/Options/NotFoundRedirectOptions.php b/module/Core/src/Options/NotFoundRedirectOptions.php index 611c144c..1bb3b828 100644 --- a/module/Core/src/Options/NotFoundRedirectOptions.php +++ b/module/Core/src/Options/NotFoundRedirectOptions.php @@ -4,7 +4,7 @@ declare(strict_types=1); namespace Shlinkio\Shlink\Core\Options; -use Zend\Stdlib\AbstractOptions; +use Laminas\Stdlib\AbstractOptions; class NotFoundRedirectOptions extends AbstractOptions { diff --git a/module/Core/src/Options/UrlShortenerOptions.php b/module/Core/src/Options/UrlShortenerOptions.php index d08c0483..19267ea1 100644 --- a/module/Core/src/Options/UrlShortenerOptions.php +++ b/module/Core/src/Options/UrlShortenerOptions.php @@ -4,7 +4,7 @@ declare(strict_types=1); namespace Shlinkio\Shlink\Core\Options; -use Zend\Stdlib\AbstractOptions; +use Laminas\Stdlib\AbstractOptions; class UrlShortenerOptions extends AbstractOptions { diff --git a/module/Core/src/Paginator/Adapter/ShortUrlRepositoryAdapter.php b/module/Core/src/Paginator/Adapter/ShortUrlRepositoryAdapter.php index de6c4805..d15d925c 100644 --- a/module/Core/src/Paginator/Adapter/ShortUrlRepositoryAdapter.php +++ b/module/Core/src/Paginator/Adapter/ShortUrlRepositoryAdapter.php @@ -4,9 +4,9 @@ declare(strict_types=1); namespace Shlinkio\Shlink\Core\Paginator\Adapter; +use Laminas\Paginator\Adapter\AdapterInterface; use Shlinkio\Shlink\Common\Util\DateRange; use Shlinkio\Shlink\Core\Repository\ShortUrlRepositoryInterface; -use Zend\Paginator\Adapter\AdapterInterface; use function strip_tags; use function trim; diff --git a/module/Core/src/Paginator/Adapter/VisitsPaginatorAdapter.php b/module/Core/src/Paginator/Adapter/VisitsPaginatorAdapter.php index e9646c4b..19baff73 100644 --- a/module/Core/src/Paginator/Adapter/VisitsPaginatorAdapter.php +++ b/module/Core/src/Paginator/Adapter/VisitsPaginatorAdapter.php @@ -4,9 +4,9 @@ declare(strict_types=1); namespace Shlinkio\Shlink\Core\Paginator\Adapter; +use Laminas\Paginator\Adapter\AdapterInterface; use Shlinkio\Shlink\Core\Model\VisitsParams; use Shlinkio\Shlink\Core\Repository\VisitRepositoryInterface; -use Zend\Paginator\Adapter\AdapterInterface; class VisitsPaginatorAdapter implements AdapterInterface { diff --git a/module/Core/src/Service/ShortUrlService.php b/module/Core/src/Service/ShortUrlService.php index 65dc57bd..8733cddb 100644 --- a/module/Core/src/Service/ShortUrlService.php +++ b/module/Core/src/Service/ShortUrlService.php @@ -5,6 +5,7 @@ declare(strict_types=1); namespace Shlinkio\Shlink\Core\Service; use Doctrine\ORM; +use Laminas\Paginator\Paginator; use Shlinkio\Shlink\Common\Util\DateRange; use Shlinkio\Shlink\Core\Entity\ShortUrl; use Shlinkio\Shlink\Core\Exception\ShortUrlNotFoundException; @@ -13,7 +14,6 @@ use Shlinkio\Shlink\Core\Paginator\Adapter\ShortUrlRepositoryAdapter; use Shlinkio\Shlink\Core\Repository\ShortUrlRepository; use Shlinkio\Shlink\Core\Service\ShortUrl\FindShortCodeTrait; use Shlinkio\Shlink\Core\Util\TagManagerTrait; -use Zend\Paginator\Paginator; class ShortUrlService implements ShortUrlServiceInterface { diff --git a/module/Core/src/Service/ShortUrlServiceInterface.php b/module/Core/src/Service/ShortUrlServiceInterface.php index 6e3fe199..310ba6b3 100644 --- a/module/Core/src/Service/ShortUrlServiceInterface.php +++ b/module/Core/src/Service/ShortUrlServiceInterface.php @@ -4,11 +4,11 @@ declare(strict_types=1); namespace Shlinkio\Shlink\Core\Service; +use Laminas\Paginator\Paginator; use Shlinkio\Shlink\Common\Util\DateRange; use Shlinkio\Shlink\Core\Entity\ShortUrl; use Shlinkio\Shlink\Core\Exception\ShortUrlNotFoundException; use Shlinkio\Shlink\Core\Model\ShortUrlMeta; -use Zend\Paginator\Paginator; interface ShortUrlServiceInterface { diff --git a/module/Core/src/Service/VisitsTracker.php b/module/Core/src/Service/VisitsTracker.php index f3c8c448..91c83a03 100644 --- a/module/Core/src/Service/VisitsTracker.php +++ b/module/Core/src/Service/VisitsTracker.php @@ -5,6 +5,7 @@ declare(strict_types=1); namespace Shlinkio\Shlink\Core\Service; use Doctrine\ORM; +use Laminas\Paginator\Paginator; use Psr\EventDispatcher\EventDispatcherInterface; use Shlinkio\Shlink\Core\Entity\ShortUrl; use Shlinkio\Shlink\Core\Entity\Visit; @@ -14,7 +15,6 @@ use Shlinkio\Shlink\Core\Model\Visitor; use Shlinkio\Shlink\Core\Model\VisitsParams; use Shlinkio\Shlink\Core\Paginator\Adapter\VisitsPaginatorAdapter; use Shlinkio\Shlink\Core\Repository\VisitRepository; -use Zend\Paginator\Paginator; class VisitsTracker implements VisitsTrackerInterface { diff --git a/module/Core/src/Service/VisitsTrackerInterface.php b/module/Core/src/Service/VisitsTrackerInterface.php index 2786d23b..5eddd96d 100644 --- a/module/Core/src/Service/VisitsTrackerInterface.php +++ b/module/Core/src/Service/VisitsTrackerInterface.php @@ -4,11 +4,11 @@ declare(strict_types=1); namespace Shlinkio\Shlink\Core\Service; +use Laminas\Paginator\Paginator; use Shlinkio\Shlink\Core\Entity\Visit; use Shlinkio\Shlink\Core\Exception\ShortUrlNotFoundException; use Shlinkio\Shlink\Core\Model\Visitor; use Shlinkio\Shlink\Core\Model\VisitsParams; -use Zend\Paginator\Paginator; interface VisitsTrackerInterface { diff --git a/module/Core/src/Validation/ShortUrlMetaInputFilter.php b/module/Core/src/Validation/ShortUrlMetaInputFilter.php index 068cf831..eca97a13 100644 --- a/module/Core/src/Validation/ShortUrlMetaInputFilter.php +++ b/module/Core/src/Validation/ShortUrlMetaInputFilter.php @@ -5,9 +5,9 @@ declare(strict_types=1); namespace Shlinkio\Shlink\Core\Validation; use DateTime; +use Laminas\InputFilter\InputFilter; +use Laminas\Validator; use Shlinkio\Shlink\Common\Validation; -use Zend\InputFilter\InputFilter; -use Zend\Validator; class ShortUrlMetaInputFilter extends InputFilter { diff --git a/module/Core/test/Action/PixelActionTest.php b/module/Core/test/Action/PixelActionTest.php index e527e501..fc9b85a1 100644 --- a/module/Core/test/Action/PixelActionTest.php +++ b/module/Core/test/Action/PixelActionTest.php @@ -4,6 +4,7 @@ declare(strict_types=1); namespace ShlinkioTest\Shlink\Core\Action; +use Laminas\Diactoros\ServerRequest; use PHPUnit\Framework\TestCase; use Prophecy\Argument; use Prophecy\Prophecy\ObjectProphecy; @@ -14,7 +15,6 @@ use Shlinkio\Shlink\Core\Entity\ShortUrl; use Shlinkio\Shlink\Core\Options\AppOptions; use Shlinkio\Shlink\Core\Service\UrlShortener; use Shlinkio\Shlink\Core\Service\VisitsTracker; -use Zend\Diactoros\ServerRequest; class PixelActionTest extends TestCase { diff --git a/module/Core/test/Action/QrCodeActionTest.php b/module/Core/test/Action/QrCodeActionTest.php index ace004a8..e98f0393 100644 --- a/module/Core/test/Action/QrCodeActionTest.php +++ b/module/Core/test/Action/QrCodeActionTest.php @@ -4,6 +4,9 @@ declare(strict_types=1); namespace ShlinkioTest\Shlink\Core\Action; +use Laminas\Diactoros\Response; +use Laminas\Diactoros\ServerRequest; +use Mezzio\Router\RouterInterface; use PHPUnit\Framework\TestCase; use Prophecy\Argument; use Prophecy\Prophecy\ObjectProphecy; @@ -13,9 +16,6 @@ use Shlinkio\Shlink\Core\Action\QrCodeAction; use Shlinkio\Shlink\Core\Entity\ShortUrl; use Shlinkio\Shlink\Core\Exception\ShortUrlNotFoundException; use Shlinkio\Shlink\Core\Service\UrlShortener; -use Zend\Diactoros\Response; -use Zend\Diactoros\ServerRequest; -use Zend\Expressive\Router\RouterInterface; class QrCodeActionTest extends TestCase { diff --git a/module/Core/test/Action/RedirectActionTest.php b/module/Core/test/Action/RedirectActionTest.php index a6b0dbdd..04705251 100644 --- a/module/Core/test/Action/RedirectActionTest.php +++ b/module/Core/test/Action/RedirectActionTest.php @@ -4,6 +4,8 @@ declare(strict_types=1); namespace ShlinkioTest\Shlink\Core\Action; +use Laminas\Diactoros\Response; +use Laminas\Diactoros\ServerRequest; use PHPUnit\Framework\TestCase; use Prophecy\Argument; use Prophecy\Prophecy\ObjectProphecy; @@ -14,8 +16,6 @@ use Shlinkio\Shlink\Core\Exception\ShortUrlNotFoundException; use Shlinkio\Shlink\Core\Options; use Shlinkio\Shlink\Core\Service\UrlShortener; use Shlinkio\Shlink\Core\Service\VisitsTracker; -use Zend\Diactoros\Response; -use Zend\Diactoros\ServerRequest; use function array_key_exists; diff --git a/module/Core/test/Config/SimplifiedConfigParserTest.php b/module/Core/test/Config/SimplifiedConfigParserTest.php index c608a44f..d92399cf 100644 --- a/module/Core/test/Config/SimplifiedConfigParserTest.php +++ b/module/Core/test/Config/SimplifiedConfigParserTest.php @@ -112,7 +112,7 @@ class SimplifiedConfigParserTest extends TestCase 'invalid_short_url' => 'foobar.com', ], - 'zend-expressive-swoole' => [ + 'mezzio-swoole' => [ 'swoole-http-server' => [ 'options' => [ 'task_worker_num' => 50, diff --git a/module/Core/test/ConfigProviderTest.php b/module/Core/test/ConfigProviderTest.php index df3a38e4..71cd90d1 100644 --- a/module/Core/test/ConfigProviderTest.php +++ b/module/Core/test/ConfigProviderTest.php @@ -24,6 +24,6 @@ class ConfigProviderTest extends TestCase $this->assertArrayHasKey('routes', $config); $this->assertArrayHasKey('dependencies', $config); $this->assertArrayHasKey('templates', $config); - $this->assertArrayHasKey('zend-expressive', $config); + $this->assertArrayHasKey('mezzio', $config); } } diff --git a/module/Core/test/ErrorHandler/NotFoundRedirectHandlerTest.php b/module/Core/test/ErrorHandler/NotFoundRedirectHandlerTest.php index 0dca53c4..61288e02 100644 --- a/module/Core/test/ErrorHandler/NotFoundRedirectHandlerTest.php +++ b/module/Core/test/ErrorHandler/NotFoundRedirectHandlerTest.php @@ -4,6 +4,11 @@ declare(strict_types=1); namespace ShlinkioTest\Shlink\Core\ErrorHandler; +use Laminas\Diactoros\Response; +use Laminas\Diactoros\ServerRequestFactory; +use Laminas\Diactoros\Uri; +use Mezzio\Router\Route; +use Mezzio\Router\RouteResult; use PHPUnit\Framework\TestCase; use Psr\Http\Message\ServerRequestInterface; use Psr\Http\Server\MiddlewareInterface; @@ -11,11 +16,6 @@ use Psr\Http\Server\RequestHandlerInterface; use Shlinkio\Shlink\Core\Action\RedirectAction; use Shlinkio\Shlink\Core\ErrorHandler\NotFoundRedirectHandler; use Shlinkio\Shlink\Core\Options\NotFoundRedirectOptions; -use Zend\Diactoros\Response; -use Zend\Diactoros\ServerRequestFactory; -use Zend\Diactoros\Uri; -use Zend\Expressive\Router\Route; -use Zend\Expressive\Router\RouteResult; class NotFoundRedirectHandlerTest extends TestCase { diff --git a/module/Core/test/ErrorHandler/NotFoundTemplateHandlerTest.php b/module/Core/test/ErrorHandler/NotFoundTemplateHandlerTest.php index bf978c9e..e43b3aab 100644 --- a/module/Core/test/ErrorHandler/NotFoundTemplateHandlerTest.php +++ b/module/Core/test/ErrorHandler/NotFoundTemplateHandlerTest.php @@ -4,16 +4,16 @@ declare(strict_types=1); namespace ShlinkioTest\Shlink\Core\ErrorHandler; +use Laminas\Diactoros\Response; +use Laminas\Diactoros\ServerRequestFactory; +use Mezzio\Router\Route; +use Mezzio\Router\RouteResult; +use Mezzio\Template\TemplateRendererInterface; use PHPUnit\Framework\TestCase; use Prophecy\Prophecy\ObjectProphecy; use Psr\Http\Message\ServerRequestInterface; use Psr\Http\Server\MiddlewareInterface; use Shlinkio\Shlink\Core\ErrorHandler\NotFoundTemplateHandler; -use Zend\Diactoros\Response; -use Zend\Diactoros\ServerRequestFactory; -use Zend\Expressive\Router\Route; -use Zend\Expressive\Router\RouteResult; -use Zend\Expressive\Template\TemplateRendererInterface; class NotFoundTemplateHandlerTest extends TestCase { diff --git a/module/Core/test/Exception/ValidationExceptionTest.php b/module/Core/test/Exception/ValidationExceptionTest.php index 11bb8026..780b25e3 100644 --- a/module/Core/test/Exception/ValidationExceptionTest.php +++ b/module/Core/test/Exception/ValidationExceptionTest.php @@ -5,12 +5,12 @@ declare(strict_types=1); namespace ShlinkioTest\Shlink\Core\Exception; use Fig\Http\Message\StatusCodeInterface; +use Laminas\InputFilter\InputFilterInterface; use LogicException; use PHPUnit\Framework\TestCase; use RuntimeException; use Shlinkio\Shlink\Core\Exception\ValidationException; use Throwable; -use Zend\InputFilter\InputFilterInterface; use function array_keys; use function print_r; diff --git a/module/Core/test/Middleware/QrCodeCacheMiddlewareTest.php b/module/Core/test/Middleware/QrCodeCacheMiddlewareTest.php index 10f6383e..e2d73266 100644 --- a/module/Core/test/Middleware/QrCodeCacheMiddlewareTest.php +++ b/module/Core/test/Middleware/QrCodeCacheMiddlewareTest.php @@ -6,13 +6,13 @@ namespace ShlinkioTest\Shlink\Core\Middleware; use Doctrine\Common\Cache\ArrayCache; use Doctrine\Common\Cache\Cache; +use Laminas\Diactoros\Response; +use Laminas\Diactoros\ServerRequest; +use Laminas\Diactoros\Uri; use PHPUnit\Framework\TestCase; use Prophecy\Argument; use Psr\Http\Server\RequestHandlerInterface; use Shlinkio\Shlink\Core\Middleware\QrCodeCacheMiddleware; -use Zend\Diactoros\Response; -use Zend\Diactoros\ServerRequest; -use Zend\Diactoros\Uri; class QrCodeCacheMiddlewareTest extends TestCase { diff --git a/module/Core/test/Service/UrlShortenerTest.php b/module/Core/test/Service/UrlShortenerTest.php index 73e4186a..2ec3024d 100644 --- a/module/Core/test/Service/UrlShortenerTest.php +++ b/module/Core/test/Service/UrlShortenerTest.php @@ -9,6 +9,7 @@ use Doctrine\Common\Collections\ArrayCollection; use Doctrine\DBAL\Connection; use Doctrine\ORM\EntityManagerInterface; use Doctrine\ORM\ORMException; +use Laminas\Diactoros\Uri; use PHPUnit\Framework\TestCase; use Prophecy\Argument; use Prophecy\Prophecy\ObjectProphecy; @@ -21,7 +22,6 @@ use Shlinkio\Shlink\Core\Repository\ShortUrlRepository; use Shlinkio\Shlink\Core\Repository\ShortUrlRepositoryInterface; use Shlinkio\Shlink\Core\Service\UrlShortener; use Shlinkio\Shlink\Core\Util\UrlValidatorInterface; -use Zend\Diactoros\Uri; use function array_map; diff --git a/module/Core/test/Service/VisitsTrackerTest.php b/module/Core/test/Service/VisitsTrackerTest.php index 9b9ab948..5cf78b16 100644 --- a/module/Core/test/Service/VisitsTrackerTest.php +++ b/module/Core/test/Service/VisitsTrackerTest.php @@ -6,6 +6,7 @@ namespace ShlinkioTest\Shlink\Core\Service; use Doctrine\ORM\EntityManager; use Doctrine\ORM\EntityRepository; +use Laminas\Stdlib\ArrayUtils; use PHPUnit\Framework\Assert; use PHPUnit\Framework\TestCase; use Prophecy\Argument; @@ -19,7 +20,6 @@ use Shlinkio\Shlink\Core\Model\Visitor; use Shlinkio\Shlink\Core\Model\VisitsParams; use Shlinkio\Shlink\Core\Repository\VisitRepository; use Shlinkio\Shlink\Core\Service\VisitsTracker; -use Zend\Stdlib\ArrayUtils; class VisitsTrackerTest extends TestCase { diff --git a/module/Core/test/Util/UrlValidatorTest.php b/module/Core/test/Util/UrlValidatorTest.php index b519a2bb..5f018a05 100644 --- a/module/Core/test/Util/UrlValidatorTest.php +++ b/module/Core/test/Util/UrlValidatorTest.php @@ -8,12 +8,12 @@ use Fig\Http\Message\RequestMethodInterface; use GuzzleHttp\ClientInterface; use GuzzleHttp\Exception\ClientException; use GuzzleHttp\RequestOptions; +use Laminas\Diactoros\Response; use PHPUnit\Framework\TestCase; use Prophecy\Argument; use Prophecy\Prophecy\ObjectProphecy; use Shlinkio\Shlink\Core\Exception\InvalidUrlException; use Shlinkio\Shlink\Core\Util\UrlValidator; -use Zend\Diactoros\Response; class UrlValidatorTest extends TestCase { diff --git a/module/Rest/config/auth.config.php b/module/Rest/config/auth.config.php index f04337bf..dd0d5369 100644 --- a/module/Rest/config/auth.config.php +++ b/module/Rest/config/auth.config.php @@ -4,7 +4,7 @@ declare(strict_types=1); namespace Shlinkio\Shlink\Rest; -use Zend\ServiceManager\AbstractFactory\ConfigAbstractFactory; +use Laminas\ServiceManager\AbstractFactory\ConfigAbstractFactory; return [ diff --git a/module/Rest/config/dependencies.config.php b/module/Rest/config/dependencies.config.php index 953d212a..832bf361 100644 --- a/module/Rest/config/dependencies.config.php +++ b/module/Rest/config/dependencies.config.php @@ -5,13 +5,13 @@ declare(strict_types=1); namespace Shlinkio\Shlink\Rest; use Doctrine\DBAL\Connection; +use Laminas\ServiceManager\AbstractFactory\ConfigAbstractFactory; +use Laminas\ServiceManager\Factory\InvokableFactory; +use Mezzio\Router\Middleware\ImplicitOptionsMiddleware; use Psr\Log\LoggerInterface; use Shlinkio\Shlink\Core\Options\AppOptions; use Shlinkio\Shlink\Core\Service; use Shlinkio\Shlink\Rest\Service\ApiKeyService; -use Zend\Expressive\Router\Middleware\ImplicitOptionsMiddleware; -use Zend\ServiceManager\AbstractFactory\ConfigAbstractFactory; -use Zend\ServiceManager\Factory\InvokableFactory; return [ diff --git a/module/Rest/src/Action/HealthAction.php b/module/Rest/src/Action/HealthAction.php index eeec763d..4f3b9c64 100644 --- a/module/Rest/src/Action/HealthAction.php +++ b/module/Rest/src/Action/HealthAction.php @@ -5,12 +5,12 @@ declare(strict_types=1); namespace Shlinkio\Shlink\Rest\Action; use Doctrine\DBAL\Connection; +use Laminas\Diactoros\Response\JsonResponse; use Psr\Http\Message\ResponseInterface; use Psr\Http\Message\ServerRequestInterface; use Psr\Log\LoggerInterface; use Shlinkio\Shlink\Core\Options\AppOptions; use Throwable; -use Zend\Diactoros\Response\JsonResponse; class HealthAction extends AbstractRestAction { diff --git a/module/Rest/src/Action/ShortUrl/AbstractCreateShortUrlAction.php b/module/Rest/src/Action/ShortUrl/AbstractCreateShortUrlAction.php index 1e840a7f..3335e1fa 100644 --- a/module/Rest/src/Action/ShortUrl/AbstractCreateShortUrlAction.php +++ b/module/Rest/src/Action/ShortUrl/AbstractCreateShortUrlAction.php @@ -4,6 +4,7 @@ declare(strict_types=1); namespace Shlinkio\Shlink\Rest\Action\ShortUrl; +use Laminas\Diactoros\Response\JsonResponse; use Psr\Http\Message\ResponseInterface as Response; use Psr\Http\Message\ServerRequestInterface as Request; use Psr\Log\LoggerInterface; @@ -12,7 +13,6 @@ use Shlinkio\Shlink\Core\Model\CreateShortUrlData; use Shlinkio\Shlink\Core\Service\UrlShortenerInterface; use Shlinkio\Shlink\Core\Transformer\ShortUrlDataTransformer; use Shlinkio\Shlink\Rest\Action\AbstractRestAction; -use Zend\Diactoros\Response\JsonResponse; abstract class AbstractCreateShortUrlAction extends AbstractRestAction { diff --git a/module/Rest/src/Action/ShortUrl/CreateShortUrlAction.php b/module/Rest/src/Action/ShortUrl/CreateShortUrlAction.php index 0335355f..e85d2465 100644 --- a/module/Rest/src/Action/ShortUrl/CreateShortUrlAction.php +++ b/module/Rest/src/Action/ShortUrl/CreateShortUrlAction.php @@ -4,11 +4,11 @@ declare(strict_types=1); namespace Shlinkio\Shlink\Rest\Action\ShortUrl; +use Laminas\Diactoros\Uri; use Psr\Http\Message\ServerRequestInterface as Request; use Shlinkio\Shlink\Core\Exception\ValidationException; use Shlinkio\Shlink\Core\Model\CreateShortUrlData; use Shlinkio\Shlink\Core\Model\ShortUrlMeta; -use Zend\Diactoros\Uri; class CreateShortUrlAction extends AbstractCreateShortUrlAction { diff --git a/module/Rest/src/Action/ShortUrl/DeleteShortUrlAction.php b/module/Rest/src/Action/ShortUrl/DeleteShortUrlAction.php index d7a18007..e0b269f3 100644 --- a/module/Rest/src/Action/ShortUrl/DeleteShortUrlAction.php +++ b/module/Rest/src/Action/ShortUrl/DeleteShortUrlAction.php @@ -4,12 +4,12 @@ declare(strict_types=1); namespace Shlinkio\Shlink\Rest\Action\ShortUrl; +use Laminas\Diactoros\Response\EmptyResponse; use Psr\Http\Message\ResponseInterface; use Psr\Http\Message\ServerRequestInterface; use Psr\Log\LoggerInterface; use Shlinkio\Shlink\Core\Service\ShortUrl\DeleteShortUrlServiceInterface; use Shlinkio\Shlink\Rest\Action\AbstractRestAction; -use Zend\Diactoros\Response\EmptyResponse; class DeleteShortUrlAction extends AbstractRestAction { diff --git a/module/Rest/src/Action/ShortUrl/EditShortUrlAction.php b/module/Rest/src/Action/ShortUrl/EditShortUrlAction.php index f7c87d0d..4270f326 100644 --- a/module/Rest/src/Action/ShortUrl/EditShortUrlAction.php +++ b/module/Rest/src/Action/ShortUrl/EditShortUrlAction.php @@ -4,13 +4,13 @@ declare(strict_types=1); namespace Shlinkio\Shlink\Rest\Action\ShortUrl; +use Laminas\Diactoros\Response\EmptyResponse; use Psr\Http\Message\ResponseInterface; use Psr\Http\Message\ServerRequestInterface; use Psr\Log\LoggerInterface; use Shlinkio\Shlink\Core\Model\ShortUrlMeta; use Shlinkio\Shlink\Core\Service\ShortUrlServiceInterface; use Shlinkio\Shlink\Rest\Action\AbstractRestAction; -use Zend\Diactoros\Response\EmptyResponse; class EditShortUrlAction extends AbstractRestAction { diff --git a/module/Rest/src/Action/ShortUrl/EditShortUrlTagsAction.php b/module/Rest/src/Action/ShortUrl/EditShortUrlTagsAction.php index 4fe61e4c..e30710ed 100644 --- a/module/Rest/src/Action/ShortUrl/EditShortUrlTagsAction.php +++ b/module/Rest/src/Action/ShortUrl/EditShortUrlTagsAction.php @@ -4,13 +4,13 @@ declare(strict_types=1); namespace Shlinkio\Shlink\Rest\Action\ShortUrl; +use Laminas\Diactoros\Response\JsonResponse; use Psr\Http\Message\ResponseInterface as Response; use Psr\Http\Message\ServerRequestInterface as Request; use Psr\Log\LoggerInterface; use Shlinkio\Shlink\Core\Exception\ValidationException; use Shlinkio\Shlink\Core\Service\ShortUrlServiceInterface; use Shlinkio\Shlink\Rest\Action\AbstractRestAction; -use Zend\Diactoros\Response\JsonResponse; class EditShortUrlTagsAction extends AbstractRestAction { diff --git a/module/Rest/src/Action/ShortUrl/ListShortUrlsAction.php b/module/Rest/src/Action/ShortUrl/ListShortUrlsAction.php index bd11c30d..a50493db 100644 --- a/module/Rest/src/Action/ShortUrl/ListShortUrlsAction.php +++ b/module/Rest/src/Action/ShortUrl/ListShortUrlsAction.php @@ -6,6 +6,7 @@ namespace Shlinkio\Shlink\Rest\Action\ShortUrl; use Cake\Chronos\Chronos; use InvalidArgumentException; +use Laminas\Diactoros\Response\JsonResponse; use Psr\Http\Message\ResponseInterface as Response; use Psr\Http\Message\ServerRequestInterface as Request; use Psr\Log\LoggerInterface; @@ -14,7 +15,6 @@ use Shlinkio\Shlink\Common\Util\DateRange; use Shlinkio\Shlink\Core\Service\ShortUrlServiceInterface; use Shlinkio\Shlink\Core\Transformer\ShortUrlDataTransformer; use Shlinkio\Shlink\Rest\Action\AbstractRestAction; -use Zend\Diactoros\Response\JsonResponse; class ListShortUrlsAction extends AbstractRestAction { diff --git a/module/Rest/src/Action/ShortUrl/ResolveShortUrlAction.php b/module/Rest/src/Action/ShortUrl/ResolveShortUrlAction.php index 8408db22..9260f597 100644 --- a/module/Rest/src/Action/ShortUrl/ResolveShortUrlAction.php +++ b/module/Rest/src/Action/ShortUrl/ResolveShortUrlAction.php @@ -5,13 +5,13 @@ declare(strict_types=1); namespace Shlinkio\Shlink\Rest\Action\ShortUrl; use InvalidArgumentException; +use Laminas\Diactoros\Response\JsonResponse; use Psr\Http\Message\ResponseInterface as Response; use Psr\Http\Message\ServerRequestInterface as Request; use Psr\Log\LoggerInterface; use Shlinkio\Shlink\Core\Service\UrlShortenerInterface; use Shlinkio\Shlink\Core\Transformer\ShortUrlDataTransformer; use Shlinkio\Shlink\Rest\Action\AbstractRestAction; -use Zend\Diactoros\Response\JsonResponse; class ResolveShortUrlAction extends AbstractRestAction { diff --git a/module/Rest/src/Action/ShortUrl/SingleStepCreateShortUrlAction.php b/module/Rest/src/Action/ShortUrl/SingleStepCreateShortUrlAction.php index fd8973d9..e754e3ad 100644 --- a/module/Rest/src/Action/ShortUrl/SingleStepCreateShortUrlAction.php +++ b/module/Rest/src/Action/ShortUrl/SingleStepCreateShortUrlAction.php @@ -4,13 +4,13 @@ declare(strict_types=1); namespace Shlinkio\Shlink\Rest\Action\ShortUrl; +use Laminas\Diactoros\Uri; use Psr\Http\Message\ServerRequestInterface as Request; use Psr\Log\LoggerInterface; use Shlinkio\Shlink\Core\Exception\ValidationException; use Shlinkio\Shlink\Core\Model\CreateShortUrlData; use Shlinkio\Shlink\Core\Service\UrlShortenerInterface; use Shlinkio\Shlink\Rest\Service\ApiKeyServiceInterface; -use Zend\Diactoros\Uri; class SingleStepCreateShortUrlAction extends AbstractCreateShortUrlAction { diff --git a/module/Rest/src/Action/Tag/CreateTagsAction.php b/module/Rest/src/Action/Tag/CreateTagsAction.php index f603efdc..eb4a279b 100644 --- a/module/Rest/src/Action/Tag/CreateTagsAction.php +++ b/module/Rest/src/Action/Tag/CreateTagsAction.php @@ -4,12 +4,12 @@ declare(strict_types=1); namespace Shlinkio\Shlink\Rest\Action\Tag; +use Laminas\Diactoros\Response\JsonResponse; use Psr\Http\Message\ResponseInterface; use Psr\Http\Message\ServerRequestInterface; use Psr\Log\LoggerInterface; use Shlinkio\Shlink\Core\Service\Tag\TagServiceInterface; use Shlinkio\Shlink\Rest\Action\AbstractRestAction; -use Zend\Diactoros\Response\JsonResponse; class CreateTagsAction extends AbstractRestAction { diff --git a/module/Rest/src/Action/Tag/DeleteTagsAction.php b/module/Rest/src/Action/Tag/DeleteTagsAction.php index 4a2ce881..b8bedab9 100644 --- a/module/Rest/src/Action/Tag/DeleteTagsAction.php +++ b/module/Rest/src/Action/Tag/DeleteTagsAction.php @@ -4,12 +4,12 @@ declare(strict_types=1); namespace Shlinkio\Shlink\Rest\Action\Tag; +use Laminas\Diactoros\Response\EmptyResponse; use Psr\Http\Message\ResponseInterface; use Psr\Http\Message\ServerRequestInterface; use Psr\Log\LoggerInterface; use Shlinkio\Shlink\Core\Service\Tag\TagServiceInterface; use Shlinkio\Shlink\Rest\Action\AbstractRestAction; -use Zend\Diactoros\Response\EmptyResponse; class DeleteTagsAction extends AbstractRestAction { diff --git a/module/Rest/src/Action/Tag/ListTagsAction.php b/module/Rest/src/Action/Tag/ListTagsAction.php index 53c5272e..7cc7e063 100644 --- a/module/Rest/src/Action/Tag/ListTagsAction.php +++ b/module/Rest/src/Action/Tag/ListTagsAction.php @@ -4,12 +4,12 @@ declare(strict_types=1); namespace Shlinkio\Shlink\Rest\Action\Tag; +use Laminas\Diactoros\Response\JsonResponse; use Psr\Http\Message\ResponseInterface; use Psr\Http\Message\ServerRequestInterface; use Psr\Log\LoggerInterface; use Shlinkio\Shlink\Core\Service\Tag\TagServiceInterface; use Shlinkio\Shlink\Rest\Action\AbstractRestAction; -use Zend\Diactoros\Response\JsonResponse; class ListTagsAction extends AbstractRestAction { diff --git a/module/Rest/src/Action/Tag/UpdateTagAction.php b/module/Rest/src/Action/Tag/UpdateTagAction.php index b432d29b..6fb72e01 100644 --- a/module/Rest/src/Action/Tag/UpdateTagAction.php +++ b/module/Rest/src/Action/Tag/UpdateTagAction.php @@ -4,13 +4,13 @@ declare(strict_types=1); namespace Shlinkio\Shlink\Rest\Action\Tag; +use Laminas\Diactoros\Response\EmptyResponse; use Psr\Http\Message\ResponseInterface; use Psr\Http\Message\ServerRequestInterface; use Psr\Log\LoggerInterface; use Shlinkio\Shlink\Core\Exception\ValidationException; use Shlinkio\Shlink\Core\Service\Tag\TagServiceInterface; use Shlinkio\Shlink\Rest\Action\AbstractRestAction; -use Zend\Diactoros\Response\EmptyResponse; class UpdateTagAction extends AbstractRestAction { diff --git a/module/Rest/src/Action/Visit/GetVisitsAction.php b/module/Rest/src/Action/Visit/GetVisitsAction.php index 7483f9d2..c1fa0095 100644 --- a/module/Rest/src/Action/Visit/GetVisitsAction.php +++ b/module/Rest/src/Action/Visit/GetVisitsAction.php @@ -4,6 +4,7 @@ declare(strict_types=1); namespace Shlinkio\Shlink\Rest\Action\Visit; +use Laminas\Diactoros\Response\JsonResponse; use Psr\Http\Message\ResponseInterface as Response; use Psr\Http\Message\ServerRequestInterface as Request; use Psr\Log\LoggerInterface; @@ -11,7 +12,6 @@ use Shlinkio\Shlink\Common\Paginator\Util\PaginatorUtilsTrait; use Shlinkio\Shlink\Core\Model\VisitsParams; use Shlinkio\Shlink\Core\Service\VisitsTrackerInterface; use Shlinkio\Shlink\Rest\Action\AbstractRestAction; -use Zend\Diactoros\Response\JsonResponse; class GetVisitsAction extends AbstractRestAction { diff --git a/module/Rest/src/Authentication/AuthenticationPluginManager.php b/module/Rest/src/Authentication/AuthenticationPluginManager.php index 9449c7c0..9cd8894e 100644 --- a/module/Rest/src/Authentication/AuthenticationPluginManager.php +++ b/module/Rest/src/Authentication/AuthenticationPluginManager.php @@ -4,7 +4,7 @@ declare(strict_types=1); namespace Shlinkio\Shlink\Rest\Authentication; -use Zend\ServiceManager\AbstractPluginManager; +use Laminas\ServiceManager\AbstractPluginManager; class AuthenticationPluginManager extends AbstractPluginManager implements AuthenticationPluginManagerInterface { diff --git a/module/Rest/src/Exception/MissingAuthenticationException.php b/module/Rest/src/Exception/MissingAuthenticationException.php index 60636308..9cef9a2b 100644 --- a/module/Rest/src/Exception/MissingAuthenticationException.php +++ b/module/Rest/src/Exception/MissingAuthenticationException.php @@ -5,8 +5,8 @@ declare(strict_types=1); namespace Shlinkio\Shlink\Rest\Exception; use Fig\Http\Message\StatusCodeInterface; -use Zend\ProblemDetails\Exception\CommonProblemDetailsExceptionTrait; -use Zend\ProblemDetails\Exception\ProblemDetailsExceptionInterface; +use Mezzio\ProblemDetails\Exception\CommonProblemDetailsExceptionTrait; +use Mezzio\ProblemDetails\Exception\ProblemDetailsExceptionInterface; use function implode; use function sprintf; diff --git a/module/Rest/src/Exception/VerifyAuthenticationException.php b/module/Rest/src/Exception/VerifyAuthenticationException.php index 4b7dbc9d..702230ff 100644 --- a/module/Rest/src/Exception/VerifyAuthenticationException.php +++ b/module/Rest/src/Exception/VerifyAuthenticationException.php @@ -5,8 +5,8 @@ declare(strict_types=1); namespace Shlinkio\Shlink\Rest\Exception; use Fig\Http\Message\StatusCodeInterface; -use Zend\ProblemDetails\Exception\CommonProblemDetailsExceptionTrait; -use Zend\ProblemDetails\Exception\ProblemDetailsExceptionInterface; +use Mezzio\ProblemDetails\Exception\CommonProblemDetailsExceptionTrait; +use Mezzio\ProblemDetails\Exception\ProblemDetailsExceptionInterface; class VerifyAuthenticationException extends RuntimeException implements ProblemDetailsExceptionInterface { diff --git a/module/Rest/src/Middleware/AuthenticationMiddleware.php b/module/Rest/src/Middleware/AuthenticationMiddleware.php index caa2a6f4..609ced0a 100644 --- a/module/Rest/src/Middleware/AuthenticationMiddleware.php +++ b/module/Rest/src/Middleware/AuthenticationMiddleware.php @@ -6,12 +6,12 @@ namespace Shlinkio\Shlink\Rest\Middleware; use Fig\Http\Message\RequestMethodInterface; use Fig\Http\Message\StatusCodeInterface; +use Mezzio\Router\RouteResult; 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 Shlinkio\Shlink\Rest\Authentication\RequestToHttpAuthPluginInterface; -use Zend\Expressive\Router\RouteResult; use function Functional\contains; diff --git a/module/Rest/src/Middleware/CrossDomainMiddleware.php b/module/Rest/src/Middleware/CrossDomainMiddleware.php index ef98eb92..23cd9ebe 100644 --- a/module/Rest/src/Middleware/CrossDomainMiddleware.php +++ b/module/Rest/src/Middleware/CrossDomainMiddleware.php @@ -5,12 +5,12 @@ declare(strict_types=1); namespace Shlinkio\Shlink\Rest\Middleware; use Fig\Http\Message\RequestMethodInterface; +use Mezzio\Router\RouteResult; use Psr\Http\Message\ResponseInterface; use Psr\Http\Message\ServerRequestInterface; use Psr\Http\Server\MiddlewareInterface; use Psr\Http\Server\RequestHandlerInterface; use Shlinkio\Shlink\Rest\Authentication; -use Zend\Expressive\Router\RouteResult; use function implode; diff --git a/module/Rest/src/Middleware/EmptyResponseImplicitOptionsMiddlewareFactory.php b/module/Rest/src/Middleware/EmptyResponseImplicitOptionsMiddlewareFactory.php index 19995597..b4bc1952 100644 --- a/module/Rest/src/Middleware/EmptyResponseImplicitOptionsMiddlewareFactory.php +++ b/module/Rest/src/Middleware/EmptyResponseImplicitOptionsMiddlewareFactory.php @@ -4,8 +4,8 @@ declare(strict_types=1); namespace Shlinkio\Shlink\Rest\Middleware; -use Zend\Diactoros\Response\EmptyResponse; -use Zend\Expressive\Router\Middleware\ImplicitOptionsMiddleware; +use Laminas\Diactoros\Response\EmptyResponse; +use Mezzio\Router\Middleware\ImplicitOptionsMiddleware; class EmptyResponseImplicitOptionsMiddlewareFactory { diff --git a/module/Rest/src/Middleware/ShortUrl/CreateShortUrlContentNegotiationMiddleware.php b/module/Rest/src/Middleware/ShortUrl/CreateShortUrlContentNegotiationMiddleware.php index 98b64401..a0896976 100644 --- a/module/Rest/src/Middleware/ShortUrl/CreateShortUrlContentNegotiationMiddleware.php +++ b/module/Rest/src/Middleware/ShortUrl/CreateShortUrlContentNegotiationMiddleware.php @@ -4,12 +4,12 @@ declare(strict_types=1); namespace Shlinkio\Shlink\Rest\Middleware\ShortUrl; +use Laminas\Diactoros\Response; +use Laminas\Diactoros\Response\JsonResponse; use Psr\Http\Message\ResponseInterface; use Psr\Http\Message\ServerRequestInterface; 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; diff --git a/module/Rest/test/Action/HealthActionTest.php b/module/Rest/test/Action/HealthActionTest.php index ed92edc2..813fa5cc 100644 --- a/module/Rest/test/Action/HealthActionTest.php +++ b/module/Rest/test/Action/HealthActionTest.php @@ -6,12 +6,12 @@ namespace ShlinkioTest\Shlink\Rest\Action; use Doctrine\DBAL\Connection; use Exception; +use Laminas\Diactoros\Response\JsonResponse; +use Laminas\Diactoros\ServerRequest; use PHPUnit\Framework\TestCase; use Prophecy\Prophecy\ObjectProphecy; use Shlinkio\Shlink\Core\Options\AppOptions; use Shlinkio\Shlink\Rest\Action\HealthAction; -use Zend\Diactoros\Response\JsonResponse; -use Zend\Diactoros\ServerRequest; class HealthActionTest extends TestCase { diff --git a/module/Rest/test/Action/ShortUrl/CreateShortUrlActionTest.php b/module/Rest/test/Action/ShortUrl/CreateShortUrlActionTest.php index 416fcdf6..b459765c 100644 --- a/module/Rest/test/Action/ShortUrl/CreateShortUrlActionTest.php +++ b/module/Rest/test/Action/ShortUrl/CreateShortUrlActionTest.php @@ -5,6 +5,9 @@ declare(strict_types=1); namespace ShlinkioTest\Shlink\Rest\Action\ShortUrl; use Cake\Chronos\Chronos; +use Laminas\Diactoros\ServerRequest; +use Laminas\Diactoros\ServerRequestFactory; +use Laminas\Diactoros\Uri; use PHPUnit\Framework\TestCase; use Prophecy\Argument; use Prophecy\Prophecy\ObjectProphecy; @@ -13,9 +16,6 @@ use Shlinkio\Shlink\Core\Exception\ValidationException; use Shlinkio\Shlink\Core\Model\ShortUrlMeta; use Shlinkio\Shlink\Core\Service\UrlShortener; use Shlinkio\Shlink\Rest\Action\ShortUrl\CreateShortUrlAction; -use Zend\Diactoros\ServerRequest; -use Zend\Diactoros\ServerRequestFactory; -use Zend\Diactoros\Uri; use function strpos; diff --git a/module/Rest/test/Action/ShortUrl/DeleteShortUrlActionTest.php b/module/Rest/test/Action/ShortUrl/DeleteShortUrlActionTest.php index 198909c5..cbd8e2bc 100644 --- a/module/Rest/test/Action/ShortUrl/DeleteShortUrlActionTest.php +++ b/module/Rest/test/Action/ShortUrl/DeleteShortUrlActionTest.php @@ -4,12 +4,12 @@ declare(strict_types=1); namespace ShlinkioTest\Shlink\Rest\Action\ShortUrl; +use Laminas\Diactoros\ServerRequest; use PHPUnit\Framework\TestCase; use Prophecy\Argument; use Prophecy\Prophecy\ObjectProphecy; use Shlinkio\Shlink\Core\Service\ShortUrl\DeleteShortUrlServiceInterface; use Shlinkio\Shlink\Rest\Action\ShortUrl\DeleteShortUrlAction; -use Zend\Diactoros\ServerRequest; class DeleteShortUrlActionTest extends TestCase { diff --git a/module/Rest/test/Action/ShortUrl/EditShortUrlActionTest.php b/module/Rest/test/Action/ShortUrl/EditShortUrlActionTest.php index a43b0d95..d6247d9f 100644 --- a/module/Rest/test/Action/ShortUrl/EditShortUrlActionTest.php +++ b/module/Rest/test/Action/ShortUrl/EditShortUrlActionTest.php @@ -4,6 +4,7 @@ declare(strict_types=1); namespace ShlinkioTest\Shlink\Rest\Action\ShortUrl; +use Laminas\Diactoros\ServerRequest; use PHPUnit\Framework\TestCase; use Prophecy\Argument; use Prophecy\Prophecy\ObjectProphecy; @@ -11,7 +12,6 @@ use Shlinkio\Shlink\Core\Entity\ShortUrl; use Shlinkio\Shlink\Core\Exception\ValidationException; use Shlinkio\Shlink\Core\Service\ShortUrlServiceInterface; use Shlinkio\Shlink\Rest\Action\ShortUrl\EditShortUrlAction; -use Zend\Diactoros\ServerRequest; class EditShortUrlActionTest extends TestCase { diff --git a/module/Rest/test/Action/ShortUrl/EditShortUrlTagsActionTest.php b/module/Rest/test/Action/ShortUrl/EditShortUrlTagsActionTest.php index 95421d10..83db484c 100644 --- a/module/Rest/test/Action/ShortUrl/EditShortUrlTagsActionTest.php +++ b/module/Rest/test/Action/ShortUrl/EditShortUrlTagsActionTest.php @@ -4,13 +4,13 @@ declare(strict_types=1); namespace ShlinkioTest\Shlink\Rest\Action\ShortUrl; +use Laminas\Diactoros\ServerRequest; use PHPUnit\Framework\TestCase; use Prophecy\Prophecy\ObjectProphecy; use Shlinkio\Shlink\Core\Entity\ShortUrl; use Shlinkio\Shlink\Core\Exception\ValidationException; use Shlinkio\Shlink\Core\Service\ShortUrlService; use Shlinkio\Shlink\Rest\Action\ShortUrl\EditShortUrlTagsAction; -use Zend\Diactoros\ServerRequest; class EditShortUrlTagsActionTest extends TestCase { diff --git a/module/Rest/test/Action/ShortUrl/ListShortUrlsActionTest.php b/module/Rest/test/Action/ShortUrl/ListShortUrlsActionTest.php index ce943107..52cc62de 100644 --- a/module/Rest/test/Action/ShortUrl/ListShortUrlsActionTest.php +++ b/module/Rest/test/Action/ShortUrl/ListShortUrlsActionTest.php @@ -5,16 +5,16 @@ declare(strict_types=1); namespace ShlinkioTest\Shlink\Rest\Action\ShortUrl; use Cake\Chronos\Chronos; +use Laminas\Diactoros\Response\JsonResponse; +use Laminas\Diactoros\ServerRequest; +use Laminas\Paginator\Adapter\ArrayAdapter; +use Laminas\Paginator\Paginator; use PHPUnit\Framework\TestCase; use Prophecy\Prophecy\ObjectProphecy; use Psr\Log\LoggerInterface; use Shlinkio\Shlink\Common\Util\DateRange; use Shlinkio\Shlink\Core\Service\ShortUrlService; use Shlinkio\Shlink\Rest\Action\ShortUrl\ListShortUrlsAction; -use Zend\Diactoros\Response\JsonResponse; -use Zend\Diactoros\ServerRequest; -use Zend\Paginator\Adapter\ArrayAdapter; -use Zend\Paginator\Paginator; class ListShortUrlsActionTest extends TestCase { diff --git a/module/Rest/test/Action/ShortUrl/ResolveShortUrlActionTest.php b/module/Rest/test/Action/ShortUrl/ResolveShortUrlActionTest.php index 8c3d0270..e2932513 100644 --- a/module/Rest/test/Action/ShortUrl/ResolveShortUrlActionTest.php +++ b/module/Rest/test/Action/ShortUrl/ResolveShortUrlActionTest.php @@ -4,12 +4,12 @@ declare(strict_types=1); namespace ShlinkioTest\Shlink\Rest\Action\ShortUrl; +use Laminas\Diactoros\ServerRequest; use PHPUnit\Framework\TestCase; use Prophecy\Prophecy\ObjectProphecy; use Shlinkio\Shlink\Core\Entity\ShortUrl; use Shlinkio\Shlink\Core\Service\UrlShortener; use Shlinkio\Shlink\Rest\Action\ShortUrl\ResolveShortUrlAction; -use Zend\Diactoros\ServerRequest; use function strpos; diff --git a/module/Rest/test/Action/ShortUrl/SingleStepCreateShortUrlActionTest.php b/module/Rest/test/Action/ShortUrl/SingleStepCreateShortUrlActionTest.php index ec5daf27..1af4aeba 100644 --- a/module/Rest/test/Action/ShortUrl/SingleStepCreateShortUrlActionTest.php +++ b/module/Rest/test/Action/ShortUrl/SingleStepCreateShortUrlActionTest.php @@ -4,6 +4,7 @@ declare(strict_types=1); namespace ShlinkioTest\Shlink\Rest\Action\ShortUrl; +use Laminas\Diactoros\ServerRequest; use PHPUnit\Framework\Assert; use PHPUnit\Framework\TestCase; use Prophecy\Argument; @@ -15,7 +16,6 @@ use Shlinkio\Shlink\Core\Model\ShortUrlMeta; use Shlinkio\Shlink\Core\Service\UrlShortenerInterface; use Shlinkio\Shlink\Rest\Action\ShortUrl\SingleStepCreateShortUrlAction; use Shlinkio\Shlink\Rest\Service\ApiKeyServiceInterface; -use Zend\Diactoros\ServerRequest; class SingleStepCreateShortUrlActionTest extends TestCase { diff --git a/module/Rest/test/Action/Tag/CreateTagsActionTest.php b/module/Rest/test/Action/Tag/CreateTagsActionTest.php index e87dc163..357abc5d 100644 --- a/module/Rest/test/Action/Tag/CreateTagsActionTest.php +++ b/module/Rest/test/Action/Tag/CreateTagsActionTest.php @@ -5,11 +5,11 @@ declare(strict_types=1); namespace ShlinkioTest\Shlink\Rest\Action\Tag; use Doctrine\Common\Collections\ArrayCollection; +use Laminas\Diactoros\ServerRequest; use PHPUnit\Framework\TestCase; use Prophecy\Prophecy\ObjectProphecy; use Shlinkio\Shlink\Core\Service\Tag\TagServiceInterface; use Shlinkio\Shlink\Rest\Action\Tag\CreateTagsAction; -use Zend\Diactoros\ServerRequest; class CreateTagsActionTest extends TestCase { diff --git a/module/Rest/test/Action/Tag/DeleteTagsActionTest.php b/module/Rest/test/Action/Tag/DeleteTagsActionTest.php index 98535056..484bd549 100644 --- a/module/Rest/test/Action/Tag/DeleteTagsActionTest.php +++ b/module/Rest/test/Action/Tag/DeleteTagsActionTest.php @@ -4,11 +4,11 @@ declare(strict_types=1); namespace ShlinkioTest\Shlink\Rest\Action\Tag; +use Laminas\Diactoros\ServerRequest; use PHPUnit\Framework\TestCase; use Prophecy\Prophecy\ObjectProphecy; use Shlinkio\Shlink\Core\Service\Tag\TagServiceInterface; use Shlinkio\Shlink\Rest\Action\Tag\DeleteTagsAction; -use Zend\Diactoros\ServerRequest; class DeleteTagsActionTest extends TestCase { diff --git a/module/Rest/test/Action/Tag/ListTagsActionTest.php b/module/Rest/test/Action/Tag/ListTagsActionTest.php index 66175a5a..7e9b061f 100644 --- a/module/Rest/test/Action/Tag/ListTagsActionTest.php +++ b/module/Rest/test/Action/Tag/ListTagsActionTest.php @@ -4,12 +4,12 @@ declare(strict_types=1); namespace ShlinkioTest\Shlink\Rest\Action\Tag; +use Laminas\Diactoros\ServerRequest; use PHPUnit\Framework\TestCase; use Prophecy\Prophecy\ObjectProphecy; 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; diff --git a/module/Rest/test/Action/Tag/UpdateTagActionTest.php b/module/Rest/test/Action/Tag/UpdateTagActionTest.php index 2a050c6c..ab09b4ea 100644 --- a/module/Rest/test/Action/Tag/UpdateTagActionTest.php +++ b/module/Rest/test/Action/Tag/UpdateTagActionTest.php @@ -4,13 +4,13 @@ declare(strict_types=1); namespace ShlinkioTest\Shlink\Rest\Action\Tag; +use Laminas\Diactoros\ServerRequest; use PHPUnit\Framework\TestCase; use Prophecy\Prophecy\ObjectProphecy; use Shlinkio\Shlink\Core\Entity\Tag; use Shlinkio\Shlink\Core\Exception\ValidationException; use Shlinkio\Shlink\Core\Service\Tag\TagServiceInterface; use Shlinkio\Shlink\Rest\Action\Tag\UpdateTagAction; -use Zend\Diactoros\ServerRequest; class UpdateTagActionTest extends TestCase { diff --git a/module/Rest/test/Action/Visit/GetVisitsActionTest.php b/module/Rest/test/Action/Visit/GetVisitsActionTest.php index c2c7a3c4..a445c3b2 100644 --- a/module/Rest/test/Action/Visit/GetVisitsActionTest.php +++ b/module/Rest/test/Action/Visit/GetVisitsActionTest.php @@ -5,6 +5,9 @@ declare(strict_types=1); namespace ShlinkioTest\Shlink\Rest\Action\Visit; use Cake\Chronos\Chronos; +use Laminas\Diactoros\ServerRequest; +use Laminas\Paginator\Adapter\ArrayAdapter; +use Laminas\Paginator\Paginator; use PHPUnit\Framework\TestCase; use Prophecy\Argument; use Prophecy\Prophecy\ObjectProphecy; @@ -12,9 +15,6 @@ use Shlinkio\Shlink\Common\Util\DateRange; use Shlinkio\Shlink\Core\Model\VisitsParams; use Shlinkio\Shlink\Core\Service\VisitsTracker; use Shlinkio\Shlink\Rest\Action\Visit\GetVisitsAction; -use Zend\Diactoros\ServerRequest; -use Zend\Paginator\Adapter\ArrayAdapter; -use Zend\Paginator\Paginator; class GetVisitsActionTest extends TestCase { diff --git a/module/Rest/test/Authentication/AuthenticationPluginManagerFactoryTest.php b/module/Rest/test/Authentication/AuthenticationPluginManagerFactoryTest.php index 4c24e26a..326054d7 100644 --- a/module/Rest/test/Authentication/AuthenticationPluginManagerFactoryTest.php +++ b/module/Rest/test/Authentication/AuthenticationPluginManagerFactoryTest.php @@ -4,11 +4,11 @@ declare(strict_types=1); namespace ShlinkioTest\Shlink\Rest\Authentication; +use Laminas\ServiceManager\ServiceManager; use PHPUnit\Framework\TestCase; use Shlinkio\Shlink\Rest\Authentication\AuthenticationPluginManager; use Shlinkio\Shlink\Rest\Authentication\AuthenticationPluginManagerFactory; use Shlinkio\Shlink\Rest\Authentication\Plugin\AuthenticationPluginInterface; -use Zend\ServiceManager\ServiceManager; class AuthenticationPluginManagerFactoryTest extends TestCase { diff --git a/module/Rest/test/Authentication/Plugin/ApiKeyHeaderPluginTest.php b/module/Rest/test/Authentication/Plugin/ApiKeyHeaderPluginTest.php index e27da5fb..e6a9c23d 100644 --- a/module/Rest/test/Authentication/Plugin/ApiKeyHeaderPluginTest.php +++ b/module/Rest/test/Authentication/Plugin/ApiKeyHeaderPluginTest.php @@ -4,14 +4,14 @@ declare(strict_types=1); namespace ShlinkioTest\Shlink\Rest\Authentication\Plugin; +use Laminas\Diactoros\Response; +use Laminas\Diactoros\ServerRequest; use PHPUnit\Framework\TestCase; use Prophecy\Prophecy\ObjectProphecy; use Psr\Http\Message\ServerRequestInterface; use Shlinkio\Shlink\Rest\Authentication\Plugin\ApiKeyHeaderPlugin; use Shlinkio\Shlink\Rest\Exception\VerifyAuthenticationException; use Shlinkio\Shlink\Rest\Service\ApiKeyServiceInterface; -use Zend\Diactoros\Response; -use Zend\Diactoros\ServerRequest; class ApiKeyHeaderPluginTest extends TestCase { diff --git a/module/Rest/test/Authentication/RequestToAuthPluginTest.php b/module/Rest/test/Authentication/RequestToAuthPluginTest.php index 0e7938c8..5fac50dc 100644 --- a/module/Rest/test/Authentication/RequestToAuthPluginTest.php +++ b/module/Rest/test/Authentication/RequestToAuthPluginTest.php @@ -4,6 +4,7 @@ declare(strict_types=1); namespace ShlinkioTest\Shlink\Rest\Authentication; +use Laminas\Diactoros\ServerRequest; use PHPUnit\Framework\TestCase; use Prophecy\Prophecy\ObjectProphecy; use Shlinkio\Shlink\Rest\Authentication\AuthenticationPluginManagerInterface; @@ -11,7 +12,6 @@ use Shlinkio\Shlink\Rest\Authentication\Plugin\ApiKeyHeaderPlugin; use Shlinkio\Shlink\Rest\Authentication\Plugin\AuthenticationPluginInterface; use Shlinkio\Shlink\Rest\Authentication\RequestToHttpAuthPlugin; use Shlinkio\Shlink\Rest\Exception\MissingAuthenticationException; -use Zend\Diactoros\ServerRequest; use function implode; use function sprintf; diff --git a/module/Rest/test/Middleware/AuthenticationMiddlewareTest.php b/module/Rest/test/Middleware/AuthenticationMiddlewareTest.php index 9b974140..cd002f60 100644 --- a/module/Rest/test/Middleware/AuthenticationMiddlewareTest.php +++ b/module/Rest/test/Middleware/AuthenticationMiddlewareTest.php @@ -5,6 +5,10 @@ declare(strict_types=1); namespace ShlinkioTest\Shlink\Rest\Middleware; use Fig\Http\Message\RequestMethodInterface; +use Laminas\Diactoros\Response; +use Laminas\Diactoros\ServerRequest; +use Mezzio\Router\Route; +use Mezzio\Router\RouteResult; use PHPUnit\Framework\TestCase; use Prophecy\Argument; use Prophecy\Prophecy\ObjectProphecy; @@ -17,12 +21,8 @@ use Shlinkio\Shlink\Rest\Action\HealthAction; use Shlinkio\Shlink\Rest\Authentication\Plugin\AuthenticationPluginInterface; use Shlinkio\Shlink\Rest\Authentication\RequestToHttpAuthPluginInterface; use Shlinkio\Shlink\Rest\Middleware\AuthenticationMiddleware; -use Zend\Diactoros\Response; -use Zend\Diactoros\ServerRequest; -use Zend\Expressive\Router\Route; -use Zend\Expressive\Router\RouteResult; -use function Zend\Stratigility\middleware; +use function Laminas\Stratigility\middleware; class AuthenticationMiddlewareTest extends TestCase { diff --git a/module/Rest/test/Middleware/BodyParserMiddlewareTest.php b/module/Rest/test/Middleware/BodyParserMiddlewareTest.php index abed5a29..5adae27d 100644 --- a/module/Rest/test/Middleware/BodyParserMiddlewareTest.php +++ b/module/Rest/test/Middleware/BodyParserMiddlewareTest.php @@ -4,15 +4,15 @@ declare(strict_types=1); namespace ShlinkioTest\Shlink\Rest\Middleware; +use Laminas\Diactoros\Response; +use Laminas\Diactoros\ServerRequest; +use Laminas\Diactoros\Stream; use PHPUnit\Framework\TestCase; use Prophecy\Argument; use Prophecy\Prophecy\ProphecyInterface; use Psr\Http\Message\ServerRequestInterface; use Psr\Http\Server\RequestHandlerInterface; use Shlinkio\Shlink\Rest\Middleware\BodyParserMiddleware; -use Zend\Diactoros\Response; -use Zend\Diactoros\ServerRequest; -use Zend\Diactoros\Stream; use function array_shift; diff --git a/module/Rest/test/Middleware/CrossDomainMiddlewareTest.php b/module/Rest/test/Middleware/CrossDomainMiddlewareTest.php index a6e0637f..5daa8c3d 100644 --- a/module/Rest/test/Middleware/CrossDomainMiddlewareTest.php +++ b/module/Rest/test/Middleware/CrossDomainMiddlewareTest.php @@ -4,18 +4,18 @@ declare(strict_types=1); namespace ShlinkioTest\Shlink\Rest\Middleware; +use Laminas\Diactoros\Response; +use Laminas\Diactoros\ServerRequest; +use Mezzio\Router\Route; +use Mezzio\Router\RouteResult; use PHPUnit\Framework\TestCase; use Prophecy\Argument; use Prophecy\Prophecy\ObjectProphecy; use Psr\Http\Server\RequestHandlerInterface; use Shlinkio\Shlink\Rest\Authentication; use Shlinkio\Shlink\Rest\Middleware\CrossDomainMiddleware; -use Zend\Diactoros\Response; -use Zend\Diactoros\ServerRequest; -use Zend\Expressive\Router\Route; -use Zend\Expressive\Router\RouteResult; -use function Zend\Stratigility\middleware; +use function Laminas\Stratigility\middleware; class CrossDomainMiddlewareTest extends TestCase { diff --git a/module/Rest/test/Middleware/EmptyResponseImplicitOptionsMiddlewareFactoryTest.php b/module/Rest/test/Middleware/EmptyResponseImplicitOptionsMiddlewareFactoryTest.php index fed1e1f8..73fdd07e 100644 --- a/module/Rest/test/Middleware/EmptyResponseImplicitOptionsMiddlewareFactoryTest.php +++ b/module/Rest/test/Middleware/EmptyResponseImplicitOptionsMiddlewareFactoryTest.php @@ -4,11 +4,11 @@ declare(strict_types=1); namespace ShlinkioTest\Shlink\Rest\Middleware; +use Laminas\Diactoros\Response\EmptyResponse; +use Mezzio\Router\Middleware\ImplicitOptionsMiddleware; use PHPUnit\Framework\TestCase; use ReflectionObject; use Shlinkio\Shlink\Rest\Middleware\EmptyResponseImplicitOptionsMiddlewareFactory; -use Zend\Diactoros\Response\EmptyResponse; -use Zend\Expressive\Router\Middleware\ImplicitOptionsMiddleware; class EmptyResponseImplicitOptionsMiddlewareFactoryTest extends TestCase { diff --git a/module/Rest/test/Middleware/ShortUrl/CreateShortUrlContentNegotiationMiddlewareTest.php b/module/Rest/test/Middleware/ShortUrl/CreateShortUrlContentNegotiationMiddlewareTest.php index 1ad7ef25..f70a4d4a 100644 --- a/module/Rest/test/Middleware/ShortUrl/CreateShortUrlContentNegotiationMiddlewareTest.php +++ b/module/Rest/test/Middleware/ShortUrl/CreateShortUrlContentNegotiationMiddlewareTest.php @@ -4,15 +4,15 @@ declare(strict_types=1); namespace ShlinkioTest\Shlink\Rest\Middleware\ShortUrl; +use Laminas\Diactoros\Response; +use Laminas\Diactoros\Response\JsonResponse; +use Laminas\Diactoros\ServerRequest; use PHPUnit\Framework\TestCase; use Prophecy\Argument; use Prophecy\Prophecy\ObjectProphecy; use Psr\Http\Message\ServerRequestInterface; use Psr\Http\Server\RequestHandlerInterface; use Shlinkio\Shlink\Rest\Middleware\ShortUrl\CreateShortUrlContentNegotiationMiddleware; -use Zend\Diactoros\Response; -use Zend\Diactoros\Response\JsonResponse; -use Zend\Diactoros\ServerRequest; class CreateShortUrlContentNegotiationMiddlewareTest extends TestCase {