diff --git a/composer.json b/composer.json index 921bd67ba..17fbe5899 100644 --- a/composer.json +++ b/composer.json @@ -33,14 +33,14 @@ "minimum-stability": "dev", "prefer-stable": true, "require": { - "php": "~8.1.0 || ~8.2.0 || ~8.3.0 || ~8.4.0", + "php": "8.1 - 8.4", "psr/container": "^1.0 || ^2.0", "yiisoft/arrays": "^3.1", "yiisoft/data": "dev-master", "yiisoft/friendly-exception": "^1.0", "yiisoft/html": "^3.0", "yiisoft/injector": "^1.2", - "yiisoft/router": "^3.0", + "yiisoft/router": "^4.0", "yiisoft/translator": "^3.0", "yiisoft/validator": "^2.0", "yiisoft/view": "^12.0.0", @@ -52,11 +52,11 @@ "rector/rector": "^2.0.9", "roave/infection-static-analysis-plugin": "^1.35", "spatie/phpunit-watcher": "^1.24", - "vimeo/psalm": "^5.26.1 || ^6.8.6", + "vimeo/psalm": "^5.26.1 || ^6.8.8", "yiisoft/di": "^1.3", "yiisoft/event-dispatcher": "^1.1", "yiisoft/log": "^2.1", - "yiisoft/router-fastroute": "^3.1.0", + "yiisoft/router-fastroute": "^4.0", "yiisoft/test-support": "^3.0.2", "yiisoft/translator-message-php": "^1.1.1" }, diff --git a/tests/Support/Mock.php b/tests/Support/Mock.php index 8e06c6990..699d2d1bf 100644 --- a/tests/Support/Mock.php +++ b/tests/Support/Mock.php @@ -9,7 +9,6 @@ use Psr\EventDispatcher\EventDispatcherInterface; use Yiisoft\Router\CurrentRoute; use Yiisoft\Router\FastRoute\UrlGenerator; -use Yiisoft\Router\Group; use Yiisoft\Router\Route; use Yiisoft\Router\RouteCollection; use Yiisoft\Router\RouteCollectionInterface; @@ -35,8 +34,8 @@ public static function category(string $category, string $path): CategorySource public static function translator( string $locale, - string $fallbackLocale = null, - EventDispatcherInterface $eventDispatcher = null + ?string $fallbackLocale = null, + ?EventDispatcherInterface $eventDispatcher = null ): TranslatorInterface { return new Translator($locale, $fallbackLocale, 'app', $eventDispatcher); } @@ -46,8 +45,8 @@ public static function translator( */ public static function urlGenerator( array $routes = [], - CurrentRoute $currentRoute = null, - RouteParser $parser = null + ?CurrentRoute $currentRoute = null, + ?RouteParser $parser = null ): UrlGeneratorInterface { if ($routes === []) { $routes = [ @@ -69,9 +68,8 @@ public static function urlGenerator( */ private static function routeCollection(array $routes): RouteCollectionInterface { - $rootGroup = Group::create()->routes(...$routes); $collector = new RouteCollector(); - $collector->addGroup($rootGroup); + $collector->addRoute(...$routes); return new RouteCollection($collector); }