diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 4c90d66..ef0f946 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -6,7 +6,7 @@ jobs: fail-fast: false matrix: operating-system: [ubuntu-latest] - php-versions: ["7.2", "7.3", "7.4", "8.0", "8.1", "8.2"] + php-versions: ["7.2", "7.3", "7.4", "8.0", "8.1", "8.2", "8.3"] dependency-versions: ["highest", "lowest"] runs-on: ${{ matrix.operating-system }} steps: diff --git a/composer.json b/composer.json index 9b37aba..93bff1c 100644 --- a/composer.json +++ b/composer.json @@ -14,7 +14,7 @@ ], "require": { "php": "^7.2|^8.0", - "psr/http-message": "^1.0.1", + "psr/http-message": "^1.0.1|^2.0", "psr/http-server-middleware": "^1.0", "tuupola/callable-handler": "^0.3.0|^0.4.0|^1.0", "tuupola/http-factory": "^0.4.0|^1.0.2" @@ -32,12 +32,12 @@ }, "require-dev": { "equip/dispatch": "^2.0", + "laminas/laminas-diactoros": "^1.3|^2.0|^3.0", "overtrue/phplint": "^3.0|^4.0|^5.0|^6.0", - "phpstan/phpstan": "^1.8", + "phpstan/phpstan": "^1.11", "phpunit/phpunit": "^8.5.30|^9.0", "rector/rector": "^0.14.5", - "symplify/easy-coding-standard": "^11.1", - "zendframework/zend-diactoros": "^1.3|^2.0" + "symplify/easy-coding-standard": "^11.1" }, "config": { "sort-packages": true diff --git a/src/HttpBasicAuthentication.php b/src/HttpBasicAuthentication.php index 4b2f39f..ee67707 100644 --- a/src/HttpBasicAuthentication.php +++ b/src/HttpBasicAuthentication.php @@ -259,6 +259,7 @@ private function processError(ResponseInterface $response, array $arguments): Re * Set path where middleware should bind to. * * @param string|string[] $path + * @phpstan-ignore method.unused */ private function path($path): void { @@ -269,6 +270,7 @@ private function path($path): void * Set path which middleware ignores. * * @param string[] $ignore + * @phpstan-ignore method.unused */ private function ignore($ignore): void { @@ -277,6 +279,8 @@ private function ignore($ignore): void /** * Set the authenticator. + * + * @phpstan-ignore method.unused */ private function authenticator(callable $authenticator): void { @@ -287,6 +291,7 @@ private function authenticator(callable $authenticator): void * Set the users array. * * @param string[] $users + * @phpstan-ignore method.unused */ private function users(array $users): void { @@ -295,6 +300,8 @@ private function users(array $users): void /** * Set the secure flag. + * + * @phpstan-ignore method.unused */ private function secure(bool $secure): void { @@ -305,6 +312,7 @@ private function secure(bool $secure): void * Set hosts where secure rule is relaxed. * * @param string[] $relaxed + * @phpstan-ignore method.unused */ private function relaxed(array $relaxed): void { @@ -313,6 +321,8 @@ private function relaxed(array $relaxed): void /** * Set the handler which is called before other middlewares. + * + * @phpstan-ignore method.unused */ private function before(Closure $before): void { @@ -321,6 +331,8 @@ private function before(Closure $before): void /** * Set the handler which is called after other middlewares. + * + * @phpstan-ignore method.unused */ private function after(Closure $after): void { @@ -329,6 +341,8 @@ private function after(Closure $after): void /** * Set the handler which is if authentication fails. + * + * @phpstan-ignore method.unused */ private function error(callable $error): void { @@ -339,6 +353,7 @@ private function error(callable $error): void * Set the rules * * @param RuleInterface[] $rules + * @phpstan-ignore method.unused */ private function rules(array $rules): void { diff --git a/tests/RequestMethodRuleTest.php b/tests/RequestMethodRuleTest.php index 9dae012..31e2f41 100644 --- a/tests/RequestMethodRuleTest.php +++ b/tests/RequestMethodRuleTest.php @@ -31,11 +31,11 @@ namespace Tuupola\Middleware\HttpBasicAuthentication; +use Laminas\Diactoros\Response; +use Laminas\Diactoros\ServerRequest; +use Laminas\Diactoros\ServerRequestFactory; +use Laminas\Diactoros\Uri; use PHPUnit\Framework\TestCase; -use Zend\Diactoros\Response; -use Zend\Diactoros\ServerRequest; -use Zend\Diactoros\ServerRequestFactory; -use Zend\Diactoros\Uri; class RequestMethodRuleTest extends TestCase { diff --git a/tests/RequestPathRuleTest.php b/tests/RequestPathRuleTest.php index 4dc44a4..201be99 100644 --- a/tests/RequestPathRuleTest.php +++ b/tests/RequestPathRuleTest.php @@ -31,11 +31,11 @@ namespace Tuupola\Middleware\HttpBasicAuthentication; +use Laminas\Diactoros\Response; +use Laminas\Diactoros\ServerRequest; +use Laminas\Diactoros\ServerRequestFactory; +use Laminas\Diactoros\Uri; use PHPUnit\Framework\TestCase; -use Zend\Diactoros\Response; -use Zend\Diactoros\ServerRequest; -use Zend\Diactoros\ServerRequestFactory; -use Zend\Diactoros\Uri; class RequestPathTest extends TestCase {