Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow installing with psr/http-message ^2.0 #126

Merged
merged 3 commits into from
Sep 30, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
8 changes: 4 additions & 4 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand All @@ -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
Expand Down
15 changes: 15 additions & 0 deletions src/HttpBasicAuthentication.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
{
Expand All @@ -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
{
Expand All @@ -277,6 +279,8 @@ private function ignore($ignore): void

/**
* Set the authenticator.
*
* @phpstan-ignore method.unused
*/
private function authenticator(callable $authenticator): void
{
Expand All @@ -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
{
Expand All @@ -295,6 +300,8 @@ private function users(array $users): void

/**
* Set the secure flag.
*
* @phpstan-ignore method.unused
*/
private function secure(bool $secure): void
{
Expand All @@ -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
{
Expand All @@ -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
{
Expand All @@ -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
{
Expand All @@ -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
{
Expand All @@ -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
{
Expand Down
8 changes: 4 additions & 4 deletions tests/RequestMethodRuleTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
{
Expand Down
8 changes: 4 additions & 4 deletions tests/RequestPathRuleTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
{
Expand Down