From 9f7a3510b69d5c17f251d2be2a1fb2381fcfcc1b Mon Sep 17 00:00:00 2001 From: Andrey Helldar Date: Wed, 30 Apr 2025 21:31:08 +0300 Subject: [PATCH 1/5] Unsupporting older versions of Laravel --- .gitattributes | 1 - .github/workflows/phpunit.yml | 51 +++-------------------------------- composer.json | 10 +++---- phpunit.php | 30 --------------------- phpunit.xml | 26 +++++++----------- src/Helpers/Action.php | 2 +- src/Routing/Route.php | 2 +- 7 files changed, 19 insertions(+), 103 deletions(-) delete mode 100644 phpunit.php diff --git a/.gitattributes b/.gitattributes index 98d789b..a53848d 100644 --- a/.gitattributes +++ b/.gitattributes @@ -8,5 +8,4 @@ tests export-ignore .gitattributes export-ignore .gitignore export-ignore -phpunit.php export-ignore phpunit.xml export-ignore diff --git a/.github/workflows/phpunit.yml b/.github/workflows/phpunit.yml index 19a17c8..2cc5c6e 100644 --- a/.github/workflows/phpunit.yml +++ b/.github/workflows/phpunit.yml @@ -9,53 +9,8 @@ jobs: strategy: fail-fast: true matrix: - php: [ "7.4", "8.0", "8.1", "8.2", "8.3", "8.4" ] - laravel: [ "7.0", "8.0", "9.0", "10.0", "11.0", "12.0" ] - exclude: - - laravel: "7.0" - php: "8.1" - - - laravel: "7.0" - php: "8.2" - - - laravel: "7.0" - php: "8.3" - - - laravel: "7.0" - php: "8.4" - - - laravel: "9.0" - php: "7.4" - - - laravel: "9.0" - php: "8.3" - - - laravel: "9.0" - php: "8.4" - - - laravel: "10.0" - php: "7.4" - - - laravel: "10.0" - php: "8.0" - - - laravel: "11.0" - php: "7.4" - - - laravel: "11.0" - php: "8.0" - - - laravel: "11.0" - php: "8.1" - - - laravel: "12.0" - php: "7.4" - - - laravel: "12.0" - php: "8.0" - - - laravel: "12.0" - php: "8.1" + php: [ "8.2", "8.3", "8.4" ] + laravel: [ "10.0", "11.0", "12.0" ] name: PHP ${{ matrix.php }}, Laravel ${{ matrix.laravel }} @@ -74,4 +29,4 @@ jobs: run: composer require --dev laravel/framework:^${{ matrix.laravel }} - name: Execute tests - run: sudo vendor/bin/phpunit + run: sudo composer test diff --git a/composer.json b/composer.json index 0bf5024..30d5d6f 100644 --- a/composer.json +++ b/composer.json @@ -34,11 +34,11 @@ "require": { "php": "^7.4 || ^8.0", "fig/http-message-util": "^1.1", - "illuminate/routing": "^7.0 || ^8.0 || ^9.0 || ^10.0 || ^11.0 || ^12.0" + "illuminate/routing": "^10.0 || ^11.0 || ^12.0" }, "require-dev": { - "orchestra/testbench": "^5.0 || ^6.0 || ^7.0 || ^8.0 || ^9.0 || ^10.0", - "phpunit/phpunit": "^9.6 || ^10.0 || ^11.0 || ^12.0" + "orchestra/testbench": "^8.0 || ^9.0 || ^10.0", + "phpunit/phpunit": "^11.0 || ^12.0" }, "minimum-stability": "stable", "prefer-stable": true, @@ -71,7 +71,7 @@ } }, "scripts": { - "test": "@php vendor/bin/phpunit --coverage-text", - "test-coverage": "@test --coverage-html=.build/phpunit/" + "test": "@php vendor/bin/phpunit", + "test-coverage": "@test --coverage-text --coverage-html=.build/phpunit/" } } diff --git a/phpunit.php b/phpunit.php deleted file mode 100644 index 31337ad..0000000 --- a/phpunit.php +++ /dev/null @@ -1,30 +0,0 @@ - - - + - ./src + ./src - + - ./tests + ./tests diff --git a/src/Helpers/Action.php b/src/Helpers/Action.php index 721e83e..cddcc72 100644 --- a/src/Helpers/Action.php +++ b/src/Helpers/Action.php @@ -83,7 +83,7 @@ protected function show(array $methods, string $uri): ?string protected function hasMethods(array $route, array $aliases): bool { foreach ($route as $value) { - if (in_array($value, $aliases)) { + if (in_array($value, $aliases, true)) { return true; } } diff --git a/src/Routing/Route.php b/src/Routing/Route.php index 137ec45..9e53a40 100644 --- a/src/Routing/Route.php +++ b/src/Routing/Route.php @@ -42,7 +42,7 @@ protected function getProtectedRouteNames(): array /** * @return (callable(string, self): string)|string */ - protected function getRouteNamesExtender() + protected function getRouteNamesExtender(): ?callable { return config('route.names.extender') ?: static fn (string $name): string => $name; } From 7767529dd42a5005d660b2f74c0c50d3c9b88ab1 Mon Sep 17 00:00:00 2001 From: Andrey Helldar Date: Wed, 30 Apr 2025 21:31:53 +0300 Subject: [PATCH 2/5] Update phpunit.yml --- .github/workflows/phpunit.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/phpunit.yml b/.github/workflows/phpunit.yml index 2cc5c6e..e03ec1d 100644 --- a/.github/workflows/phpunit.yml +++ b/.github/workflows/phpunit.yml @@ -29,4 +29,4 @@ jobs: run: composer require --dev laravel/framework:^${{ matrix.laravel }} - name: Execute tests - run: sudo composer test + run: composer test From 57a18a305da7bd6cff45b74b2df2ad3a3cc58621 Mon Sep 17 00:00:00 2001 From: Andrey Helldar Date: Wed, 30 Apr 2025 21:33:32 +0300 Subject: [PATCH 3/5] Update composer.json --- composer.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/composer.json b/composer.json index 30d5d6f..a7d4f3b 100644 --- a/composer.json +++ b/composer.json @@ -38,7 +38,7 @@ }, "require-dev": { "orchestra/testbench": "^8.0 || ^9.0 || ^10.0", - "phpunit/phpunit": "^11.0 || ^12.0" + "phpunit/phpunit": "^10.0 || ^11.0 || ^12.0" }, "minimum-stability": "stable", "prefer-stable": true, From 92e2c1c5d6be5de17a20581a60533e3e219a52d3 Mon Sep 17 00:00:00 2001 From: Andrey Helldar Date: Wed, 30 Apr 2025 21:35:24 +0300 Subject: [PATCH 4/5] Update composer.json --- composer.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/composer.json b/composer.json index a7d4f3b..eee43d7 100644 --- a/composer.json +++ b/composer.json @@ -32,7 +32,7 @@ } ], "require": { - "php": "^7.4 || ^8.0", + "php": "^8.2", "fig/http-message-util": "^1.1", "illuminate/routing": "^10.0 || ^11.0 || ^12.0" }, From 98561a7584bf48e48d549e18d78f7242a5cd0da8 Mon Sep 17 00:00:00 2001 From: Andrey Helldar Date: Wed, 30 Apr 2025 21:35:30 +0300 Subject: [PATCH 5/5] Fixed Route.php --- src/Routing/Route.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Routing/Route.php b/src/Routing/Route.php index 9e53a40..0a3e17e 100644 --- a/src/Routing/Route.php +++ b/src/Routing/Route.php @@ -42,7 +42,7 @@ protected function getProtectedRouteNames(): array /** * @return (callable(string, self): string)|string */ - protected function getRouteNamesExtender(): ?callable + protected function getRouteNamesExtender(): callable|string|null { return config('route.names.extender') ?: static fn (string $name): string => $name; }