diff --git a/.laminas-ci.json b/.laminas-ci.json index bce3fa2..0967ef4 100644 --- a/.laminas-ci.json +++ b/.laminas-ci.json @@ -1,5 +1 @@ -{ - "ignore_php_platform_requirements": { - "8.1": true - } -} +{} diff --git a/composer.json b/composer.json index f97fb64..a566409 100644 --- a/composer.json +++ b/composer.json @@ -21,7 +21,7 @@ "config": { "sort-packages": true, "platform": { - "php": "7.4.99" + "php": "8.0.99" }, "allow-plugins": { "dealerdirect/phpcodesniffer-composer-installer": true @@ -29,7 +29,7 @@ }, "extra": {}, "require": { - "php": "^7.4 || ~8.0.0 || ~8.1.0", + "php": "~8.0.0 || ~8.1.0 || ~8.2.0", "fig/http-message-util": "^1.1", "laminas/laminas-escaper": "^2.10.0", "psr/http-message": "^1.0", @@ -37,10 +37,10 @@ }, "require-dev": { "laminas/laminas-coding-standard": "~2.4.0", - "laminas/laminas-diactoros": "^2.13.0", - "phpunit/phpunit": "^9.5.21", + "laminas/laminas-diactoros": "^2.18", + "phpunit/phpunit": "^9.5.25", "psalm/plugin-phpunit": "^0.17.0", - "vimeo/psalm": "^4.24.0" + "vimeo/psalm": "^4.28" }, "conflict": { "laminas/laminas-diactoros": "<1.7.1", diff --git a/composer.lock b/composer.lock index fcd91e4..828424b 100644 --- a/composer.lock +++ b/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "4b15d800bcbc9038df1b0d55c42b2ed9", + "content-hash": "95e482a41a863124fa5046b251b8bdd2", "packages": [ { "name": "fig/http-message-util", @@ -64,32 +64,32 @@ }, { "name": "laminas/laminas-escaper", - "version": "2.10.0", + "version": "2.12.0", "source": { "type": "git", "url": "https://github.com/laminas/laminas-escaper.git", - "reference": "58af67282db37d24e584a837a94ee55b9c7552be" + "reference": "ee7a4c37bf3d0e8c03635d5bddb5bb3184ead490" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/laminas/laminas-escaper/zipball/58af67282db37d24e584a837a94ee55b9c7552be", - "reference": "58af67282db37d24e584a837a94ee55b9c7552be", + "url": "https://api.github.com/repos/laminas/laminas-escaper/zipball/ee7a4c37bf3d0e8c03635d5bddb5bb3184ead490", + "reference": "ee7a4c37bf3d0e8c03635d5bddb5bb3184ead490", "shasum": "" }, "require": { "ext-ctype": "*", "ext-mbstring": "*", - "php": "^7.4 || ~8.0.0 || ~8.1.0" + "php": "^7.4 || ~8.0.0 || ~8.1.0 || ~8.2.0" }, "conflict": { "zendframework/zend-escaper": "*" }, "require-dev": { "infection/infection": "^0.26.6", - "laminas/laminas-coding-standard": "~2.3.0", + "laminas/laminas-coding-standard": "~2.4.0", "maglnet/composer-require-checker": "^3.8.0", "phpunit/phpunit": "^9.5.18", - "psalm/plugin-phpunit": "^0.16.1", + "psalm/plugin-phpunit": "^0.17.0", "vimeo/psalm": "^4.22.0" }, "type": "library", @@ -122,7 +122,7 @@ "type": "community_bridge" } ], - "time": "2022-03-08T20:15:36+00:00" + "time": "2022-10-10T10:11:09+00:00" }, { "name": "psr/http-message", @@ -1091,20 +1091,20 @@ }, { "name": "laminas/laminas-diactoros", - "version": "2.17.0", + "version": "2.18.0", "source": { "type": "git", "url": "https://github.com/laminas/laminas-diactoros.git", - "reference": "5b32597aa46b83c8b85bb1cf9a6ed4fe7dd980c5" + "reference": "c33a4e76178a3cbdc801cc364379a8c9f1bd78ec" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/laminas/laminas-diactoros/zipball/5b32597aa46b83c8b85bb1cf9a6ed4fe7dd980c5", - "reference": "5b32597aa46b83c8b85bb1cf9a6ed4fe7dd980c5", + "url": "https://api.github.com/repos/laminas/laminas-diactoros/zipball/c33a4e76178a3cbdc801cc364379a8c9f1bd78ec", + "reference": "c33a4e76178a3cbdc801cc364379a8c9f1bd78ec", "shasum": "" }, "require": { - "php": "^7.4 || ~8.0.0 || ~8.1.0", + "php": "~8.0.0 || ~8.1.0 || ~8.2.0", "psr/http-factory": "^1.0", "psr/http-message": "^1.0" }, @@ -1123,9 +1123,9 @@ "http-interop/http-factory-tests": "^0.9.0", "laminas/laminas-coding-standard": "^2.4.0", "php-http/psr7-integration-tests": "^1.1.1", - "phpunit/phpunit": "^9.5.23", + "phpunit/phpunit": "^9.5.25", "psalm/plugin-phpunit": "^0.17.0", - "vimeo/psalm": "^4.24.0" + "vimeo/psalm": "^4.28" }, "type": "library", "extra": { @@ -1184,7 +1184,7 @@ "type": "community_bridge" } ], - "time": "2022-08-30T17:01:46+00:00" + "time": "2022-10-10T18:21:32+00:00" }, { "name": "myclabs/deep-copy", @@ -2202,22 +2202,27 @@ }, { "name": "psr/container", - "version": "1.1.2", + "version": "2.0.2", "source": { "type": "git", "url": "https://github.com/php-fig/container.git", - "reference": "513e0666f7216c7459170d56df27dfcefe1689ea" + "reference": "c71ecc56dfe541dbd90c5360474fbc405f8d5963" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/php-fig/container/zipball/513e0666f7216c7459170d56df27dfcefe1689ea", - "reference": "513e0666f7216c7459170d56df27dfcefe1689ea", + "url": "https://api.github.com/repos/php-fig/container/zipball/c71ecc56dfe541dbd90c5360474fbc405f8d5963", + "reference": "c71ecc56dfe541dbd90c5360474fbc405f8d5963", "shasum": "" }, "require": { "php": ">=7.4.0" }, "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.0.x-dev" + } + }, "autoload": { "psr-4": { "Psr\\Container\\": "src/" @@ -2244,9 +2249,9 @@ ], "support": { "issues": "https://github.com/php-fig/container/issues", - "source": "https://github.com/php-fig/container/tree/1.1.2" + "source": "https://github.com/php-fig/container/tree/2.0.2" }, - "time": "2021-11-05T16:50:12+00:00" + "time": "2021-11-05T16:47:00+00:00" }, { "name": "psr/http-factory", @@ -2305,30 +2310,30 @@ }, { "name": "psr/log", - "version": "1.1.4", + "version": "3.0.0", "source": { "type": "git", "url": "https://github.com/php-fig/log.git", - "reference": "d49695b909c3b7628b6289db5479a1c204601f11" + "reference": "fe5ea303b0887d5caefd3d431c3e61ad47037001" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/php-fig/log/zipball/d49695b909c3b7628b6289db5479a1c204601f11", - "reference": "d49695b909c3b7628b6289db5479a1c204601f11", + "url": "https://api.github.com/repos/php-fig/log/zipball/fe5ea303b0887d5caefd3d431c3e61ad47037001", + "reference": "fe5ea303b0887d5caefd3d431c3e61ad47037001", "shasum": "" }, "require": { - "php": ">=5.3.0" + "php": ">=8.0.0" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "1.1.x-dev" + "dev-master": "3.x-dev" } }, "autoload": { "psr-4": { - "Psr\\Log\\": "Psr/Log/" + "Psr\\Log\\": "src" } }, "notification-url": "https://packagist.org/downloads/", @@ -2349,9 +2354,9 @@ "psr-3" ], "support": { - "source": "https://github.com/php-fig/log/tree/1.1.4" + "source": "https://github.com/php-fig/log/tree/3.0.0" }, - "time": "2021-05-03T11:20:27+00:00" + "time": "2021-07-14T16:46:02+00:00" }, { "name": "sebastian/cli-parser", @@ -3436,46 +3441,42 @@ }, { "name": "symfony/console", - "version": "v5.4.13", + "version": "v6.0.13", "source": { "type": "git", "url": "https://github.com/symfony/console.git", - "reference": "3f97f6c7b7e26848a90c0c0cfb91eeb2bb8618be" + "reference": "8f14753b865651c2aad107ef97475740a9b0730f" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/console/zipball/3f97f6c7b7e26848a90c0c0cfb91eeb2bb8618be", - "reference": "3f97f6c7b7e26848a90c0c0cfb91eeb2bb8618be", + "url": "https://api.github.com/repos/symfony/console/zipball/8f14753b865651c2aad107ef97475740a9b0730f", + "reference": "8f14753b865651c2aad107ef97475740a9b0730f", "shasum": "" }, "require": { - "php": ">=7.2.5", - "symfony/deprecation-contracts": "^2.1|^3", + "php": ">=8.0.2", "symfony/polyfill-mbstring": "~1.0", - "symfony/polyfill-php73": "^1.9", - "symfony/polyfill-php80": "^1.16", "symfony/service-contracts": "^1.1|^2|^3", - "symfony/string": "^5.1|^6.0" + "symfony/string": "^5.4|^6.0" }, "conflict": { - "psr/log": ">=3", - "symfony/dependency-injection": "<4.4", - "symfony/dotenv": "<5.1", - "symfony/event-dispatcher": "<4.4", - "symfony/lock": "<4.4", - "symfony/process": "<4.4" + "symfony/dependency-injection": "<5.4", + "symfony/dotenv": "<5.4", + "symfony/event-dispatcher": "<5.4", + "symfony/lock": "<5.4", + "symfony/process": "<5.4" }, "provide": { - "psr/log-implementation": "1.0|2.0" + "psr/log-implementation": "1.0|2.0|3.0" }, "require-dev": { - "psr/log": "^1|^2", - "symfony/config": "^4.4|^5.0|^6.0", - "symfony/dependency-injection": "^4.4|^5.0|^6.0", - "symfony/event-dispatcher": "^4.4|^5.0|^6.0", - "symfony/lock": "^4.4|^5.0|^6.0", - "symfony/process": "^4.4|^5.0|^6.0", - "symfony/var-dumper": "^4.4|^5.0|^6.0" + "psr/log": "^1|^2|^3", + "symfony/config": "^5.4|^6.0", + "symfony/dependency-injection": "^5.4|^6.0", + "symfony/event-dispatcher": "^5.4|^6.0", + "symfony/lock": "^5.4|^6.0", + "symfony/process": "^5.4|^6.0", + "symfony/var-dumper": "^5.4|^6.0" }, "suggest": { "psr/log": "For using the console logger", @@ -3515,74 +3516,7 @@ "terminal" ], "support": { - "source": "https://github.com/symfony/console/tree/v5.4.13" - }, - "funding": [ - { - "url": "https://symfony.com/sponsor", - "type": "custom" - }, - { - "url": "https://github.com/fabpot", - "type": "github" - }, - { - "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", - "type": "tidelift" - } - ], - "time": "2022-08-26T13:50:20+00:00" - }, - { - "name": "symfony/deprecation-contracts", - "version": "v2.5.2", - "source": { - "type": "git", - "url": "https://github.com/symfony/deprecation-contracts.git", - "reference": "e8b495ea28c1d97b5e0c121748d6f9b53d075c66" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/deprecation-contracts/zipball/e8b495ea28c1d97b5e0c121748d6f9b53d075c66", - "reference": "e8b495ea28c1d97b5e0c121748d6f9b53d075c66", - "shasum": "" - }, - "require": { - "php": ">=7.1" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-main": "2.5-dev" - }, - "thanks": { - "name": "symfony/contracts", - "url": "https://github.com/symfony/contracts" - } - }, - "autoload": { - "files": [ - "function.php" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Nicolas Grekas", - "email": "p@tchwork.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" - } - ], - "description": "A generic function and convention to trigger deprecation notices", - "homepage": "https://symfony.com", - "support": { - "source": "https://github.com/symfony/deprecation-contracts/tree/v2.5.2" + "source": "https://github.com/symfony/console/tree/v6.0.13" }, "funding": [ { @@ -3598,7 +3532,7 @@ "type": "tidelift" } ], - "time": "2022-01-02T09:53:40+00:00" + "time": "2022-09-03T14:23:25+00:00" }, { "name": "symfony/polyfill-ctype", @@ -3930,85 +3864,6 @@ ], "time": "2022-05-24T11:49:31+00:00" }, - { - "name": "symfony/polyfill-php73", - "version": "v1.26.0", - "source": { - "type": "git", - "url": "https://github.com/symfony/polyfill-php73.git", - "reference": "e440d35fa0286f77fb45b79a03fedbeda9307e85" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-php73/zipball/e440d35fa0286f77fb45b79a03fedbeda9307e85", - "reference": "e440d35fa0286f77fb45b79a03fedbeda9307e85", - "shasum": "" - }, - "require": { - "php": ">=7.1" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-main": "1.26-dev" - }, - "thanks": { - "name": "symfony/polyfill", - "url": "https://github.com/symfony/polyfill" - } - }, - "autoload": { - "files": [ - "bootstrap.php" - ], - "psr-4": { - "Symfony\\Polyfill\\Php73\\": "" - }, - "classmap": [ - "Resources/stubs" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Nicolas Grekas", - "email": "p@tchwork.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" - } - ], - "description": "Symfony polyfill backporting some PHP 7.3+ features to lower PHP versions", - "homepage": "https://symfony.com", - "keywords": [ - "compatibility", - "polyfill", - "portable", - "shim" - ], - "support": { - "source": "https://github.com/symfony/polyfill-php73/tree/v1.26.0" - }, - "funding": [ - { - "url": "https://symfony.com/sponsor", - "type": "custom" - }, - { - "url": "https://github.com/fabpot", - "type": "github" - }, - { - "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", - "type": "tidelift" - } - ], - "time": "2022-05-24T11:49:31+00:00" - }, { "name": "symfony/polyfill-php80", "version": "v1.26.0", @@ -4094,22 +3949,21 @@ }, { "name": "symfony/service-contracts", - "version": "v2.5.2", + "version": "v3.0.2", "source": { "type": "git", "url": "https://github.com/symfony/service-contracts.git", - "reference": "4b426aac47d6427cc1a1d0f7e2ac724627f5966c" + "reference": "d78d39c1599bd1188b8e26bb341da52c3c6d8a66" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/service-contracts/zipball/4b426aac47d6427cc1a1d0f7e2ac724627f5966c", - "reference": "4b426aac47d6427cc1a1d0f7e2ac724627f5966c", + "url": "https://api.github.com/repos/symfony/service-contracts/zipball/d78d39c1599bd1188b8e26bb341da52c3c6d8a66", + "reference": "d78d39c1599bd1188b8e26bb341da52c3c6d8a66", "shasum": "" }, "require": { - "php": ">=7.2.5", - "psr/container": "^1.1", - "symfony/deprecation-contracts": "^2.1|^3" + "php": ">=8.0.2", + "psr/container": "^2.0" }, "conflict": { "ext-psr": "<1.1|>=2" @@ -4120,7 +3974,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-main": "2.5-dev" + "dev-main": "3.0-dev" }, "thanks": { "name": "symfony/contracts", @@ -4157,7 +4011,7 @@ "standards" ], "support": { - "source": "https://github.com/symfony/service-contracts/tree/v2.5.2" + "source": "https://github.com/symfony/service-contracts/tree/v3.0.2" }, "funding": [ { @@ -4173,38 +4027,37 @@ "type": "tidelift" } ], - "time": "2022-05-30T19:17:29+00:00" + "time": "2022-05-30T19:17:58+00:00" }, { "name": "symfony/string", - "version": "v5.4.13", + "version": "v6.0.13", "source": { "type": "git", "url": "https://github.com/symfony/string.git", - "reference": "2900c668a32138a34118740de3e4d5a701801f53" + "reference": "65e99fb179e7241606377e4042cd2161f3dd1c05" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/string/zipball/2900c668a32138a34118740de3e4d5a701801f53", - "reference": "2900c668a32138a34118740de3e4d5a701801f53", + "url": "https://api.github.com/repos/symfony/string/zipball/65e99fb179e7241606377e4042cd2161f3dd1c05", + "reference": "65e99fb179e7241606377e4042cd2161f3dd1c05", "shasum": "" }, "require": { - "php": ">=7.2.5", + "php": ">=8.0.2", "symfony/polyfill-ctype": "~1.8", "symfony/polyfill-intl-grapheme": "~1.0", "symfony/polyfill-intl-normalizer": "~1.0", - "symfony/polyfill-mbstring": "~1.0", - "symfony/polyfill-php80": "~1.15" + "symfony/polyfill-mbstring": "~1.0" }, "conflict": { - "symfony/translation-contracts": ">=3.0" + "symfony/translation-contracts": "<2.0" }, "require-dev": { - "symfony/error-handler": "^4.4|^5.0|^6.0", - "symfony/http-client": "^4.4|^5.0|^6.0", - "symfony/translation-contracts": "^1.1|^2", - "symfony/var-exporter": "^4.4|^5.0|^6.0" + "symfony/error-handler": "^5.4|^6.0", + "symfony/http-client": "^5.4|^6.0", + "symfony/translation-contracts": "^2.0|^3.0", + "symfony/var-exporter": "^5.4|^6.0" }, "type": "library", "autoload": { @@ -4243,7 +4096,7 @@ "utf8" ], "support": { - "source": "https://github.com/symfony/string/tree/v5.4.13" + "source": "https://github.com/symfony/string/tree/v6.0.13" }, "funding": [ { @@ -4259,7 +4112,7 @@ "type": "tidelift" } ], - "time": "2022-09-01T01:52:16+00:00" + "time": "2022-09-02T08:05:03+00:00" }, { "name": "theseer/tokenizer", @@ -4590,11 +4443,11 @@ "prefer-stable": false, "prefer-lowest": false, "platform": { - "php": "^7.4 || ~8.0.0 || ~8.1.0" + "php": "~8.0.0 || ~8.1.0 || ~8.2.0" }, "platform-dev": [], "platform-overrides": { - "php": "7.4.99" + "php": "8.0.99" }, "plugin-api-version": "2.3.0" } diff --git a/src/Exception/MissingResponseException.php b/src/Exception/MissingResponseException.php index cb43fc4..7b3b2f6 100644 --- a/src/Exception/MissingResponseException.php +++ b/src/Exception/MissingResponseException.php @@ -6,7 +6,6 @@ use OutOfBoundsException; -use function get_class; use function gettype; use function is_object; use function sprintf; @@ -20,7 +19,7 @@ class MissingResponseException extends OutOfBoundsException implements Exception public static function forCallableMiddleware(callable $middleware): self { $type = is_object($middleware) - ? get_class($middleware) + ? $middleware::class : gettype($middleware); return new self(sprintf( diff --git a/test/MiddlewarePipeTest.php b/test/MiddlewarePipeTest.php index 518f60e..05dbd1d 100644 --- a/test/MiddlewarePipeTest.php +++ b/test/MiddlewarePipeTest.php @@ -18,7 +18,6 @@ use ReflectionMethod; use ReflectionObject; -use function get_class; use function sort; use function spl_object_hash; use function strpos; @@ -153,8 +152,8 @@ public function testReturnsResponseReturnedByQueue(): void $request = new Request([], [], 'http://local.example.com/foo', 'GET', 'php://memory'); $result = $this->pipeline->process($request, $this->createFinalHandler()); $this->assertSame($return, $result, var_export([ - spl_object_hash($return) => get_class($return), - spl_object_hash($result) => get_class($result), + spl_object_hash($return) => $return::class, + spl_object_hash($result) => $result::class, ], true)); } diff --git a/test/NextTest.php b/test/NextTest.php index 1a94361..2e6b4e6 100644 --- a/test/NextTest.php +++ b/test/NextTest.php @@ -25,11 +25,11 @@ class NextTest extends TestCase use MiddlewareTrait; private SplQueue $queue; - private Request $request; /** @var MockObject&ResponseInterface */ private $response; + private RequestHandlerInterface $fallbackHandler; protected function setUp(): void {