diff --git a/.gitignore b/.gitignore index 18d4dac3..9dacef7c 100644 --- a/.gitignore +++ b/.gitignore @@ -1,6 +1,6 @@ .tmp/ /.phpcs.cache -/.phpunit.result.cache +/.phpunit.cache /.psalm-cache /doc/html/ /laminas-mkdoc-theme.tgz diff --git a/composer.json b/composer.json index e8317ec2..e4d45ae1 100644 --- a/composer.json +++ b/composer.json @@ -43,12 +43,12 @@ "ext-dom": "*", "ext-gd": "*", "ext-libxml": "*", - "http-interop/http-factory-tests": "^0.9.0", + "http-interop/http-factory-tests": "^2.2.0", "laminas/laminas-coding-standard": "~2.5.0", - "php-http/psr7-integration-tests": "^1.3", - "phpunit/phpunit": "^9.6.16", + "php-http/psr7-integration-tests": "^1.4.0", + "phpunit/phpunit": "^10.5.31", "psalm/plugin-phpunit": "^0.19.0", - "vimeo/psalm": "^5.22.1" + "vimeo/psalm": "^5.25.0" }, "provide": { "psr/http-factory-implementation": "^1.1 || ^2.0", diff --git a/composer.lock b/composer.lock index 69094a61..e2de5e46 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": "fc972e8570858a6f375606ad940948c1", + "content-hash": "dec0725e4210a2f8714e9976a18ad861", "packages": [ { "name": "psr/http-factory", @@ -687,76 +687,6 @@ }, "time": "2019-12-04T15:06:13+00:00" }, - { - "name": "doctrine/instantiator", - "version": "2.0.0", - "source": { - "type": "git", - "url": "https://github.com/doctrine/instantiator.git", - "reference": "c6222283fa3f4ac679f8b9ced9a4e23f163e80d0" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/doctrine/instantiator/zipball/c6222283fa3f4ac679f8b9ced9a4e23f163e80d0", - "reference": "c6222283fa3f4ac679f8b9ced9a4e23f163e80d0", - "shasum": "" - }, - "require": { - "php": "^8.1" - }, - "require-dev": { - "doctrine/coding-standard": "^11", - "ext-pdo": "*", - "ext-phar": "*", - "phpbench/phpbench": "^1.2", - "phpstan/phpstan": "^1.9.4", - "phpstan/phpstan-phpunit": "^1.3", - "phpunit/phpunit": "^9.5.27", - "vimeo/psalm": "^5.4" - }, - "type": "library", - "autoload": { - "psr-4": { - "Doctrine\\Instantiator\\": "src/Doctrine/Instantiator/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Marco Pivetta", - "email": "ocramius@gmail.com", - "homepage": "https://ocramius.github.io/" - } - ], - "description": "A small, lightweight utility to instantiate objects in PHP without invoking their constructors", - "homepage": "https://www.doctrine-project.org/projects/instantiator.html", - "keywords": [ - "constructor", - "instantiate" - ], - "support": { - "issues": "https://github.com/doctrine/instantiator/issues", - "source": "https://github.com/doctrine/instantiator/tree/2.0.0" - }, - "funding": [ - { - "url": "https://www.doctrine-project.org/sponsorship.html", - "type": "custom" - }, - { - "url": "https://www.patreon.com/phpdoctrine", - "type": "patreon" - }, - { - "url": "https://tidelift.com/funding/github/packagist/doctrine%2Finstantiator", - "type": "tidelift" - } - ], - "time": "2022-12-30T00:23:10+00:00" - }, { "name": "felixfbecker/advanced-json-rpc", "version": "v3.2.1", @@ -921,21 +851,21 @@ }, { "name": "http-interop/http-factory-tests", - "version": "0.9.0", + "version": "2.2.0", "source": { "type": "git", "url": "https://github.com/http-interop/http-factory-tests.git", - "reference": "642056c5360e8a74779cbf133afbc8aa2c174e15" + "reference": "e71ce6f973df53ddfc80bdfd7ccc4c6a4ce77a0e" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/http-interop/http-factory-tests/zipball/642056c5360e8a74779cbf133afbc8aa2c174e15", - "reference": "642056c5360e8a74779cbf133afbc8aa2c174e15", + "url": "https://api.github.com/repos/http-interop/http-factory-tests/zipball/e71ce6f973df53ddfc80bdfd7ccc4c6a4ce77a0e", + "reference": "e71ce6f973df53ddfc80bdfd7ccc4c6a4ce77a0e", "shasum": "" }, "require": { - "php": "^7.1 || ^8.0", - "phpunit/phpunit": "^6.5 || ^7.0 || ^8.0 || ^9.0", + "php": "^8.1", + "phpunit/phpunit": "^10.0 || ^11.0", "psr/http-factory": "^1.0" }, "type": "library", @@ -951,7 +881,11 @@ "authors": [ { "name": "PHP-FIG", - "homepage": "http://www.php-fig.org/" + "homepage": "https://www.php-fig.org/" + }, + { + "name": "Contributors", + "homepage": "https://github.com/http-interop/http-factory-tests/graphs/contributors" } ], "description": "Unit tests for HTTP factories", @@ -964,9 +898,9 @@ ], "support": { "issues": "https://github.com/http-interop/http-factory-tests/issues", - "source": "https://github.com/http-interop/http-factory-tests/tree/0.9.0" + "source": "https://github.com/http-interop/http-factory-tests/tree/2.2.0" }, - "time": "2021-03-21T14:26:06+00:00" + "time": "2024-06-10T13:00:34+00:00" }, { "name": "laminas/laminas-coding-standard", @@ -1575,16 +1509,16 @@ }, { "name": "phpunit/php-code-coverage", - "version": "9.2.32", + "version": "10.1.16", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/php-code-coverage.git", - "reference": "85402a822d1ecf1db1096959413d35e1c37cf1a5" + "reference": "7e308268858ed6baedc8704a304727d20bc07c77" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/85402a822d1ecf1db1096959413d35e1c37cf1a5", - "reference": "85402a822d1ecf1db1096959413d35e1c37cf1a5", + "url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/7e308268858ed6baedc8704a304727d20bc07c77", + "reference": "7e308268858ed6baedc8704a304727d20bc07c77", "shasum": "" }, "require": { @@ -1592,18 +1526,18 @@ "ext-libxml": "*", "ext-xmlwriter": "*", "nikic/php-parser": "^4.19.1 || ^5.1.0", - "php": ">=7.3", - "phpunit/php-file-iterator": "^3.0.6", - "phpunit/php-text-template": "^2.0.4", - "sebastian/code-unit-reverse-lookup": "^2.0.3", - "sebastian/complexity": "^2.0.3", - "sebastian/environment": "^5.1.5", - "sebastian/lines-of-code": "^1.0.4", - "sebastian/version": "^3.0.2", + "php": ">=8.1", + "phpunit/php-file-iterator": "^4.1.0", + "phpunit/php-text-template": "^3.0.1", + "sebastian/code-unit-reverse-lookup": "^3.0.0", + "sebastian/complexity": "^3.2.0", + "sebastian/environment": "^6.1.0", + "sebastian/lines-of-code": "^2.0.2", + "sebastian/version": "^4.0.1", "theseer/tokenizer": "^1.2.3" }, "require-dev": { - "phpunit/phpunit": "^9.6" + "phpunit/phpunit": "^10.1" }, "suggest": { "ext-pcov": "PHP extension that provides line coverage", @@ -1612,7 +1546,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-main": "9.2.x-dev" + "dev-main": "10.1.x-dev" } }, "autoload": { @@ -1641,7 +1575,7 @@ "support": { "issues": "https://github.com/sebastianbergmann/php-code-coverage/issues", "security": "https://github.com/sebastianbergmann/php-code-coverage/security/policy", - "source": "https://github.com/sebastianbergmann/php-code-coverage/tree/9.2.32" + "source": "https://github.com/sebastianbergmann/php-code-coverage/tree/10.1.16" }, "funding": [ { @@ -1649,32 +1583,32 @@ "type": "github" } ], - "time": "2024-08-22T04:23:01+00:00" + "time": "2024-08-22T04:31:57+00:00" }, { "name": "phpunit/php-file-iterator", - "version": "3.0.6", + "version": "4.1.0", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/php-file-iterator.git", - "reference": "cf1c2e7c203ac650e352f4cc675a7021e7d1b3cf" + "reference": "a95037b6d9e608ba092da1b23931e537cadc3c3c" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-file-iterator/zipball/cf1c2e7c203ac650e352f4cc675a7021e7d1b3cf", - "reference": "cf1c2e7c203ac650e352f4cc675a7021e7d1b3cf", + "url": "https://api.github.com/repos/sebastianbergmann/php-file-iterator/zipball/a95037b6d9e608ba092da1b23931e537cadc3c3c", + "reference": "a95037b6d9e608ba092da1b23931e537cadc3c3c", "shasum": "" }, "require": { - "php": ">=7.3" + "php": ">=8.1" }, "require-dev": { - "phpunit/phpunit": "^9.3" + "phpunit/phpunit": "^10.0" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "3.0-dev" + "dev-main": "4.0-dev" } }, "autoload": { @@ -1701,7 +1635,8 @@ ], "support": { "issues": "https://github.com/sebastianbergmann/php-file-iterator/issues", - "source": "https://github.com/sebastianbergmann/php-file-iterator/tree/3.0.6" + "security": "https://github.com/sebastianbergmann/php-file-iterator/security/policy", + "source": "https://github.com/sebastianbergmann/php-file-iterator/tree/4.1.0" }, "funding": [ { @@ -1709,28 +1644,28 @@ "type": "github" } ], - "time": "2021-12-02T12:48:52+00:00" + "time": "2023-08-31T06:24:48+00:00" }, { "name": "phpunit/php-invoker", - "version": "3.1.1", + "version": "4.0.0", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/php-invoker.git", - "reference": "5a10147d0aaf65b58940a0b72f71c9ac0423cc67" + "reference": "f5e568ba02fa5ba0ddd0f618391d5a9ea50b06d7" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-invoker/zipball/5a10147d0aaf65b58940a0b72f71c9ac0423cc67", - "reference": "5a10147d0aaf65b58940a0b72f71c9ac0423cc67", + "url": "https://api.github.com/repos/sebastianbergmann/php-invoker/zipball/f5e568ba02fa5ba0ddd0f618391d5a9ea50b06d7", + "reference": "f5e568ba02fa5ba0ddd0f618391d5a9ea50b06d7", "shasum": "" }, "require": { - "php": ">=7.3" + "php": ">=8.1" }, "require-dev": { "ext-pcntl": "*", - "phpunit/phpunit": "^9.3" + "phpunit/phpunit": "^10.0" }, "suggest": { "ext-pcntl": "*" @@ -1738,7 +1673,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "3.1-dev" + "dev-main": "4.0-dev" } }, "autoload": { @@ -1764,7 +1699,7 @@ ], "support": { "issues": "https://github.com/sebastianbergmann/php-invoker/issues", - "source": "https://github.com/sebastianbergmann/php-invoker/tree/3.1.1" + "source": "https://github.com/sebastianbergmann/php-invoker/tree/4.0.0" }, "funding": [ { @@ -1772,32 +1707,32 @@ "type": "github" } ], - "time": "2020-09-28T05:58:55+00:00" + "time": "2023-02-03T06:56:09+00:00" }, { "name": "phpunit/php-text-template", - "version": "2.0.4", + "version": "3.0.1", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/php-text-template.git", - "reference": "5da5f67fc95621df9ff4c4e5a84d6a8a2acf7c28" + "reference": "0c7b06ff49e3d5072f057eb1fa59258bf287a748" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-text-template/zipball/5da5f67fc95621df9ff4c4e5a84d6a8a2acf7c28", - "reference": "5da5f67fc95621df9ff4c4e5a84d6a8a2acf7c28", + "url": "https://api.github.com/repos/sebastianbergmann/php-text-template/zipball/0c7b06ff49e3d5072f057eb1fa59258bf287a748", + "reference": "0c7b06ff49e3d5072f057eb1fa59258bf287a748", "shasum": "" }, "require": { - "php": ">=7.3" + "php": ">=8.1" }, "require-dev": { - "phpunit/phpunit": "^9.3" + "phpunit/phpunit": "^10.0" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "2.0-dev" + "dev-main": "3.0-dev" } }, "autoload": { @@ -1823,7 +1758,8 @@ ], "support": { "issues": "https://github.com/sebastianbergmann/php-text-template/issues", - "source": "https://github.com/sebastianbergmann/php-text-template/tree/2.0.4" + "security": "https://github.com/sebastianbergmann/php-text-template/security/policy", + "source": "https://github.com/sebastianbergmann/php-text-template/tree/3.0.1" }, "funding": [ { @@ -1831,32 +1767,32 @@ "type": "github" } ], - "time": "2020-10-26T05:33:50+00:00" + "time": "2023-08-31T14:07:24+00:00" }, { "name": "phpunit/php-timer", - "version": "5.0.3", + "version": "6.0.0", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/php-timer.git", - "reference": "5a63ce20ed1b5bf577850e2c4e87f4aa902afbd2" + "reference": "e2a2d67966e740530f4a3343fe2e030ffdc1161d" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-timer/zipball/5a63ce20ed1b5bf577850e2c4e87f4aa902afbd2", - "reference": "5a63ce20ed1b5bf577850e2c4e87f4aa902afbd2", + "url": "https://api.github.com/repos/sebastianbergmann/php-timer/zipball/e2a2d67966e740530f4a3343fe2e030ffdc1161d", + "reference": "e2a2d67966e740530f4a3343fe2e030ffdc1161d", "shasum": "" }, "require": { - "php": ">=7.3" + "php": ">=8.1" }, "require-dev": { - "phpunit/phpunit": "^9.3" + "phpunit/phpunit": "^10.0" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "5.0-dev" + "dev-main": "6.0-dev" } }, "autoload": { @@ -1882,7 +1818,7 @@ ], "support": { "issues": "https://github.com/sebastianbergmann/php-timer/issues", - "source": "https://github.com/sebastianbergmann/php-timer/tree/5.0.3" + "source": "https://github.com/sebastianbergmann/php-timer/tree/6.0.0" }, "funding": [ { @@ -1890,24 +1826,23 @@ "type": "github" } ], - "time": "2020-10-26T13:16:10+00:00" + "time": "2023-02-03T06:57:52+00:00" }, { "name": "phpunit/phpunit", - "version": "9.6.20", + "version": "10.5.31", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/phpunit.git", - "reference": "49d7820565836236411f5dc002d16dd689cde42f" + "reference": "43e7c3e6a484e538453f89dfa6a6f308c32792da" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/49d7820565836236411f5dc002d16dd689cde42f", - "reference": "49d7820565836236411f5dc002d16dd689cde42f", + "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/43e7c3e6a484e538453f89dfa6a6f308c32792da", + "reference": "43e7c3e6a484e538453f89dfa6a6f308c32792da", "shasum": "" }, "require": { - "doctrine/instantiator": "^1.5.0 || ^2", "ext-dom": "*", "ext-json": "*", "ext-libxml": "*", @@ -1917,27 +1852,26 @@ "myclabs/deep-copy": "^1.12.0", "phar-io/manifest": "^2.0.4", "phar-io/version": "^3.2.1", - "php": ">=7.3", - "phpunit/php-code-coverage": "^9.2.31", - "phpunit/php-file-iterator": "^3.0.6", - "phpunit/php-invoker": "^3.1.1", - "phpunit/php-text-template": "^2.0.4", - "phpunit/php-timer": "^5.0.3", - "sebastian/cli-parser": "^1.0.2", - "sebastian/code-unit": "^1.0.8", - "sebastian/comparator": "^4.0.8", - "sebastian/diff": "^4.0.6", - "sebastian/environment": "^5.1.5", - "sebastian/exporter": "^4.0.6", - "sebastian/global-state": "^5.0.7", - "sebastian/object-enumerator": "^4.0.4", - "sebastian/resource-operations": "^3.0.4", - "sebastian/type": "^3.2.1", - "sebastian/version": "^3.0.2" + "php": ">=8.1", + "phpunit/php-code-coverage": "^10.1.16", + "phpunit/php-file-iterator": "^4.1.0", + "phpunit/php-invoker": "^4.0.0", + "phpunit/php-text-template": "^3.0.1", + "phpunit/php-timer": "^6.0.0", + "sebastian/cli-parser": "^2.0.1", + "sebastian/code-unit": "^2.0.0", + "sebastian/comparator": "^5.0.2", + "sebastian/diff": "^5.1.1", + "sebastian/environment": "^6.1.0", + "sebastian/exporter": "^5.1.2", + "sebastian/global-state": "^6.0.2", + "sebastian/object-enumerator": "^5.0.0", + "sebastian/recursion-context": "^5.0.0", + "sebastian/type": "^4.0.0", + "sebastian/version": "^4.0.1" }, "suggest": { - "ext-soap": "To be able to generate mocks based on WSDL files", - "ext-xdebug": "PHP extension that provides line coverage as well as branch and path coverage" + "ext-soap": "To be able to generate mocks based on WSDL files" }, "bin": [ "phpunit" @@ -1945,7 +1879,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "9.6-dev" + "dev-main": "10.5-dev" } }, "autoload": { @@ -1977,7 +1911,7 @@ "support": { "issues": "https://github.com/sebastianbergmann/phpunit/issues", "security": "https://github.com/sebastianbergmann/phpunit/security/policy", - "source": "https://github.com/sebastianbergmann/phpunit/tree/9.6.20" + "source": "https://github.com/sebastianbergmann/phpunit/tree/10.5.31" }, "funding": [ { @@ -1993,7 +1927,7 @@ "type": "tidelift" } ], - "time": "2024-07-10T11:45:39+00:00" + "time": "2024-09-03T11:57:55+00:00" }, { "name": "psalm/plugin-phpunit", @@ -2160,28 +2094,28 @@ }, { "name": "sebastian/cli-parser", - "version": "1.0.2", + "version": "2.0.1", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/cli-parser.git", - "reference": "2b56bea83a09de3ac06bb18b92f068e60cc6f50b" + "reference": "c34583b87e7b7a8055bf6c450c2c77ce32a24084" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/cli-parser/zipball/2b56bea83a09de3ac06bb18b92f068e60cc6f50b", - "reference": "2b56bea83a09de3ac06bb18b92f068e60cc6f50b", + "url": "https://api.github.com/repos/sebastianbergmann/cli-parser/zipball/c34583b87e7b7a8055bf6c450c2c77ce32a24084", + "reference": "c34583b87e7b7a8055bf6c450c2c77ce32a24084", "shasum": "" }, "require": { - "php": ">=7.3" + "php": ">=8.1" }, "require-dev": { - "phpunit/phpunit": "^9.3" + "phpunit/phpunit": "^10.0" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "1.0-dev" + "dev-main": "2.0-dev" } }, "autoload": { @@ -2204,7 +2138,8 @@ "homepage": "https://github.com/sebastianbergmann/cli-parser", "support": { "issues": "https://github.com/sebastianbergmann/cli-parser/issues", - "source": "https://github.com/sebastianbergmann/cli-parser/tree/1.0.2" + "security": "https://github.com/sebastianbergmann/cli-parser/security/policy", + "source": "https://github.com/sebastianbergmann/cli-parser/tree/2.0.1" }, "funding": [ { @@ -2212,32 +2147,32 @@ "type": "github" } ], - "time": "2024-03-02T06:27:43+00:00" + "time": "2024-03-02T07:12:49+00:00" }, { "name": "sebastian/code-unit", - "version": "1.0.8", + "version": "2.0.0", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/code-unit.git", - "reference": "1fc9f64c0927627ef78ba436c9b17d967e68e120" + "reference": "a81fee9eef0b7a76af11d121767abc44c104e503" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/code-unit/zipball/1fc9f64c0927627ef78ba436c9b17d967e68e120", - "reference": "1fc9f64c0927627ef78ba436c9b17d967e68e120", + "url": "https://api.github.com/repos/sebastianbergmann/code-unit/zipball/a81fee9eef0b7a76af11d121767abc44c104e503", + "reference": "a81fee9eef0b7a76af11d121767abc44c104e503", "shasum": "" }, "require": { - "php": ">=7.3" + "php": ">=8.1" }, "require-dev": { - "phpunit/phpunit": "^9.3" + "phpunit/phpunit": "^10.0" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "1.0-dev" + "dev-main": "2.0-dev" } }, "autoload": { @@ -2260,7 +2195,7 @@ "homepage": "https://github.com/sebastianbergmann/code-unit", "support": { "issues": "https://github.com/sebastianbergmann/code-unit/issues", - "source": "https://github.com/sebastianbergmann/code-unit/tree/1.0.8" + "source": "https://github.com/sebastianbergmann/code-unit/tree/2.0.0" }, "funding": [ { @@ -2268,32 +2203,32 @@ "type": "github" } ], - "time": "2020-10-26T13:08:54+00:00" + "time": "2023-02-03T06:58:43+00:00" }, { "name": "sebastian/code-unit-reverse-lookup", - "version": "2.0.3", + "version": "3.0.0", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/code-unit-reverse-lookup.git", - "reference": "ac91f01ccec49fb77bdc6fd1e548bc70f7faa3e5" + "reference": "5e3a687f7d8ae33fb362c5c0743794bbb2420a1d" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/code-unit-reverse-lookup/zipball/ac91f01ccec49fb77bdc6fd1e548bc70f7faa3e5", - "reference": "ac91f01ccec49fb77bdc6fd1e548bc70f7faa3e5", + "url": "https://api.github.com/repos/sebastianbergmann/code-unit-reverse-lookup/zipball/5e3a687f7d8ae33fb362c5c0743794bbb2420a1d", + "reference": "5e3a687f7d8ae33fb362c5c0743794bbb2420a1d", "shasum": "" }, "require": { - "php": ">=7.3" + "php": ">=8.1" }, "require-dev": { - "phpunit/phpunit": "^9.3" + "phpunit/phpunit": "^10.0" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "2.0-dev" + "dev-main": "3.0-dev" } }, "autoload": { @@ -2315,7 +2250,7 @@ "homepage": "https://github.com/sebastianbergmann/code-unit-reverse-lookup/", "support": { "issues": "https://github.com/sebastianbergmann/code-unit-reverse-lookup/issues", - "source": "https://github.com/sebastianbergmann/code-unit-reverse-lookup/tree/2.0.3" + "source": "https://github.com/sebastianbergmann/code-unit-reverse-lookup/tree/3.0.0" }, "funding": [ { @@ -2323,34 +2258,36 @@ "type": "github" } ], - "time": "2020-09-28T05:30:19+00:00" + "time": "2023-02-03T06:59:15+00:00" }, { "name": "sebastian/comparator", - "version": "4.0.8", + "version": "5.0.2", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/comparator.git", - "reference": "fa0f136dd2334583309d32b62544682ee972b51a" + "reference": "2d3e04c3b4c1e84a5e7382221ad8883c8fbc4f53" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/comparator/zipball/fa0f136dd2334583309d32b62544682ee972b51a", - "reference": "fa0f136dd2334583309d32b62544682ee972b51a", + "url": "https://api.github.com/repos/sebastianbergmann/comparator/zipball/2d3e04c3b4c1e84a5e7382221ad8883c8fbc4f53", + "reference": "2d3e04c3b4c1e84a5e7382221ad8883c8fbc4f53", "shasum": "" }, "require": { - "php": ">=7.3", - "sebastian/diff": "^4.0", - "sebastian/exporter": "^4.0" + "ext-dom": "*", + "ext-mbstring": "*", + "php": ">=8.1", + "sebastian/diff": "^5.0", + "sebastian/exporter": "^5.0" }, "require-dev": { - "phpunit/phpunit": "^9.3" + "phpunit/phpunit": "^10.4" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "4.0-dev" + "dev-main": "5.0-dev" } }, "autoload": { @@ -2389,7 +2326,8 @@ ], "support": { "issues": "https://github.com/sebastianbergmann/comparator/issues", - "source": "https://github.com/sebastianbergmann/comparator/tree/4.0.8" + "security": "https://github.com/sebastianbergmann/comparator/security/policy", + "source": "https://github.com/sebastianbergmann/comparator/tree/5.0.2" }, "funding": [ { @@ -2397,33 +2335,33 @@ "type": "github" } ], - "time": "2022-09-14T12:41:17+00:00" + "time": "2024-08-12T06:03:08+00:00" }, { "name": "sebastian/complexity", - "version": "2.0.3", + "version": "3.2.0", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/complexity.git", - "reference": "25f207c40d62b8b7aa32f5ab026c53561964053a" + "reference": "68ff824baeae169ec9f2137158ee529584553799" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/complexity/zipball/25f207c40d62b8b7aa32f5ab026c53561964053a", - "reference": "25f207c40d62b8b7aa32f5ab026c53561964053a", + "url": "https://api.github.com/repos/sebastianbergmann/complexity/zipball/68ff824baeae169ec9f2137158ee529584553799", + "reference": "68ff824baeae169ec9f2137158ee529584553799", "shasum": "" }, "require": { "nikic/php-parser": "^4.18 || ^5.0", - "php": ">=7.3" + "php": ">=8.1" }, "require-dev": { - "phpunit/phpunit": "^9.3" + "phpunit/phpunit": "^10.0" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "2.0-dev" + "dev-main": "3.2-dev" } }, "autoload": { @@ -2446,7 +2384,8 @@ "homepage": "https://github.com/sebastianbergmann/complexity", "support": { "issues": "https://github.com/sebastianbergmann/complexity/issues", - "source": "https://github.com/sebastianbergmann/complexity/tree/2.0.3" + "security": "https://github.com/sebastianbergmann/complexity/security/policy", + "source": "https://github.com/sebastianbergmann/complexity/tree/3.2.0" }, "funding": [ { @@ -2454,33 +2393,33 @@ "type": "github" } ], - "time": "2023-12-22T06:19:30+00:00" + "time": "2023-12-21T08:37:17+00:00" }, { "name": "sebastian/diff", - "version": "4.0.6", + "version": "5.1.1", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/diff.git", - "reference": "ba01945089c3a293b01ba9badc29ad55b106b0bc" + "reference": "c41e007b4b62af48218231d6c2275e4c9b975b2e" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/diff/zipball/ba01945089c3a293b01ba9badc29ad55b106b0bc", - "reference": "ba01945089c3a293b01ba9badc29ad55b106b0bc", + "url": "https://api.github.com/repos/sebastianbergmann/diff/zipball/c41e007b4b62af48218231d6c2275e4c9b975b2e", + "reference": "c41e007b4b62af48218231d6c2275e4c9b975b2e", "shasum": "" }, "require": { - "php": ">=7.3" + "php": ">=8.1" }, "require-dev": { - "phpunit/phpunit": "^9.3", - "symfony/process": "^4.2 || ^5" + "phpunit/phpunit": "^10.0", + "symfony/process": "^6.4" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "4.0-dev" + "dev-main": "5.1-dev" } }, "autoload": { @@ -2512,7 +2451,8 @@ ], "support": { "issues": "https://github.com/sebastianbergmann/diff/issues", - "source": "https://github.com/sebastianbergmann/diff/tree/4.0.6" + "security": "https://github.com/sebastianbergmann/diff/security/policy", + "source": "https://github.com/sebastianbergmann/diff/tree/5.1.1" }, "funding": [ { @@ -2520,27 +2460,27 @@ "type": "github" } ], - "time": "2024-03-02T06:30:58+00:00" + "time": "2024-03-02T07:15:17+00:00" }, { "name": "sebastian/environment", - "version": "5.1.5", + "version": "6.1.0", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/environment.git", - "reference": "830c43a844f1f8d5b7a1f6d6076b784454d8b7ed" + "reference": "8074dbcd93529b357029f5cc5058fd3e43666984" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/environment/zipball/830c43a844f1f8d5b7a1f6d6076b784454d8b7ed", - "reference": "830c43a844f1f8d5b7a1f6d6076b784454d8b7ed", + "url": "https://api.github.com/repos/sebastianbergmann/environment/zipball/8074dbcd93529b357029f5cc5058fd3e43666984", + "reference": "8074dbcd93529b357029f5cc5058fd3e43666984", "shasum": "" }, "require": { - "php": ">=7.3" + "php": ">=8.1" }, "require-dev": { - "phpunit/phpunit": "^9.3" + "phpunit/phpunit": "^10.0" }, "suggest": { "ext-posix": "*" @@ -2548,7 +2488,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "5.1-dev" + "dev-main": "6.1-dev" } }, "autoload": { @@ -2567,7 +2507,7 @@ } ], "description": "Provides functionality to handle HHVM/PHP environments", - "homepage": "http://www.github.com/sebastianbergmann/environment", + "homepage": "https://github.com/sebastianbergmann/environment", "keywords": [ "Xdebug", "environment", @@ -2575,7 +2515,8 @@ ], "support": { "issues": "https://github.com/sebastianbergmann/environment/issues", - "source": "https://github.com/sebastianbergmann/environment/tree/5.1.5" + "security": "https://github.com/sebastianbergmann/environment/security/policy", + "source": "https://github.com/sebastianbergmann/environment/tree/6.1.0" }, "funding": [ { @@ -2583,34 +2524,34 @@ "type": "github" } ], - "time": "2023-02-03T06:03:51+00:00" + "time": "2024-03-23T08:47:14+00:00" }, { "name": "sebastian/exporter", - "version": "4.0.6", + "version": "5.1.2", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/exporter.git", - "reference": "78c00df8f170e02473b682df15bfcdacc3d32d72" + "reference": "955288482d97c19a372d3f31006ab3f37da47adf" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/exporter/zipball/78c00df8f170e02473b682df15bfcdacc3d32d72", - "reference": "78c00df8f170e02473b682df15bfcdacc3d32d72", + "url": "https://api.github.com/repos/sebastianbergmann/exporter/zipball/955288482d97c19a372d3f31006ab3f37da47adf", + "reference": "955288482d97c19a372d3f31006ab3f37da47adf", "shasum": "" }, "require": { - "php": ">=7.3", - "sebastian/recursion-context": "^4.0" + "ext-mbstring": "*", + "php": ">=8.1", + "sebastian/recursion-context": "^5.0" }, "require-dev": { - "ext-mbstring": "*", - "phpunit/phpunit": "^9.3" + "phpunit/phpunit": "^10.0" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "4.0-dev" + "dev-main": "5.1-dev" } }, "autoload": { @@ -2652,7 +2593,8 @@ ], "support": { "issues": "https://github.com/sebastianbergmann/exporter/issues", - "source": "https://github.com/sebastianbergmann/exporter/tree/4.0.6" + "security": "https://github.com/sebastianbergmann/exporter/security/policy", + "source": "https://github.com/sebastianbergmann/exporter/tree/5.1.2" }, "funding": [ { @@ -2660,38 +2602,35 @@ "type": "github" } ], - "time": "2024-03-02T06:33:00+00:00" + "time": "2024-03-02T07:17:12+00:00" }, { "name": "sebastian/global-state", - "version": "5.0.7", + "version": "6.0.2", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/global-state.git", - "reference": "bca7df1f32ee6fe93b4d4a9abbf69e13a4ada2c9" + "reference": "987bafff24ecc4c9ac418cab1145b96dd6e9cbd9" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/global-state/zipball/bca7df1f32ee6fe93b4d4a9abbf69e13a4ada2c9", - "reference": "bca7df1f32ee6fe93b4d4a9abbf69e13a4ada2c9", + "url": "https://api.github.com/repos/sebastianbergmann/global-state/zipball/987bafff24ecc4c9ac418cab1145b96dd6e9cbd9", + "reference": "987bafff24ecc4c9ac418cab1145b96dd6e9cbd9", "shasum": "" }, "require": { - "php": ">=7.3", - "sebastian/object-reflector": "^2.0", - "sebastian/recursion-context": "^4.0" + "php": ">=8.1", + "sebastian/object-reflector": "^3.0", + "sebastian/recursion-context": "^5.0" }, "require-dev": { "ext-dom": "*", - "phpunit/phpunit": "^9.3" - }, - "suggest": { - "ext-uopz": "*" + "phpunit/phpunit": "^10.0" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "5.0-dev" + "dev-main": "6.0-dev" } }, "autoload": { @@ -2710,13 +2649,14 @@ } ], "description": "Snapshotting of global state", - "homepage": "http://www.github.com/sebastianbergmann/global-state", + "homepage": "https://www.github.com/sebastianbergmann/global-state", "keywords": [ "global state" ], "support": { "issues": "https://github.com/sebastianbergmann/global-state/issues", - "source": "https://github.com/sebastianbergmann/global-state/tree/5.0.7" + "security": "https://github.com/sebastianbergmann/global-state/security/policy", + "source": "https://github.com/sebastianbergmann/global-state/tree/6.0.2" }, "funding": [ { @@ -2724,33 +2664,33 @@ "type": "github" } ], - "time": "2024-03-02T06:35:11+00:00" + "time": "2024-03-02T07:19:19+00:00" }, { "name": "sebastian/lines-of-code", - "version": "1.0.4", + "version": "2.0.2", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/lines-of-code.git", - "reference": "e1e4a170560925c26d424b6a03aed157e7dcc5c5" + "reference": "856e7f6a75a84e339195d48c556f23be2ebf75d0" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/lines-of-code/zipball/e1e4a170560925c26d424b6a03aed157e7dcc5c5", - "reference": "e1e4a170560925c26d424b6a03aed157e7dcc5c5", + "url": "https://api.github.com/repos/sebastianbergmann/lines-of-code/zipball/856e7f6a75a84e339195d48c556f23be2ebf75d0", + "reference": "856e7f6a75a84e339195d48c556f23be2ebf75d0", "shasum": "" }, "require": { "nikic/php-parser": "^4.18 || ^5.0", - "php": ">=7.3" + "php": ">=8.1" }, "require-dev": { - "phpunit/phpunit": "^9.3" + "phpunit/phpunit": "^10.0" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "1.0-dev" + "dev-main": "2.0-dev" } }, "autoload": { @@ -2773,7 +2713,8 @@ "homepage": "https://github.com/sebastianbergmann/lines-of-code", "support": { "issues": "https://github.com/sebastianbergmann/lines-of-code/issues", - "source": "https://github.com/sebastianbergmann/lines-of-code/tree/1.0.4" + "security": "https://github.com/sebastianbergmann/lines-of-code/security/policy", + "source": "https://github.com/sebastianbergmann/lines-of-code/tree/2.0.2" }, "funding": [ { @@ -2781,34 +2722,34 @@ "type": "github" } ], - "time": "2023-12-22T06:20:34+00:00" + "time": "2023-12-21T08:38:20+00:00" }, { "name": "sebastian/object-enumerator", - "version": "4.0.4", + "version": "5.0.0", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/object-enumerator.git", - "reference": "5c9eeac41b290a3712d88851518825ad78f45c71" + "reference": "202d0e344a580d7f7d04b3fafce6933e59dae906" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/object-enumerator/zipball/5c9eeac41b290a3712d88851518825ad78f45c71", - "reference": "5c9eeac41b290a3712d88851518825ad78f45c71", + "url": "https://api.github.com/repos/sebastianbergmann/object-enumerator/zipball/202d0e344a580d7f7d04b3fafce6933e59dae906", + "reference": "202d0e344a580d7f7d04b3fafce6933e59dae906", "shasum": "" }, "require": { - "php": ">=7.3", - "sebastian/object-reflector": "^2.0", - "sebastian/recursion-context": "^4.0" + "php": ">=8.1", + "sebastian/object-reflector": "^3.0", + "sebastian/recursion-context": "^5.0" }, "require-dev": { - "phpunit/phpunit": "^9.3" + "phpunit/phpunit": "^10.0" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "4.0-dev" + "dev-main": "5.0-dev" } }, "autoload": { @@ -2830,7 +2771,7 @@ "homepage": "https://github.com/sebastianbergmann/object-enumerator/", "support": { "issues": "https://github.com/sebastianbergmann/object-enumerator/issues", - "source": "https://github.com/sebastianbergmann/object-enumerator/tree/4.0.4" + "source": "https://github.com/sebastianbergmann/object-enumerator/tree/5.0.0" }, "funding": [ { @@ -2838,32 +2779,32 @@ "type": "github" } ], - "time": "2020-10-26T13:12:34+00:00" + "time": "2023-02-03T07:08:32+00:00" }, { "name": "sebastian/object-reflector", - "version": "2.0.4", + "version": "3.0.0", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/object-reflector.git", - "reference": "b4f479ebdbf63ac605d183ece17d8d7fe49c15c7" + "reference": "24ed13d98130f0e7122df55d06c5c4942a577957" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/object-reflector/zipball/b4f479ebdbf63ac605d183ece17d8d7fe49c15c7", - "reference": "b4f479ebdbf63ac605d183ece17d8d7fe49c15c7", + "url": "https://api.github.com/repos/sebastianbergmann/object-reflector/zipball/24ed13d98130f0e7122df55d06c5c4942a577957", + "reference": "24ed13d98130f0e7122df55d06c5c4942a577957", "shasum": "" }, "require": { - "php": ">=7.3" + "php": ">=8.1" }, "require-dev": { - "phpunit/phpunit": "^9.3" + "phpunit/phpunit": "^10.0" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "2.0-dev" + "dev-main": "3.0-dev" } }, "autoload": { @@ -2885,7 +2826,7 @@ "homepage": "https://github.com/sebastianbergmann/object-reflector/", "support": { "issues": "https://github.com/sebastianbergmann/object-reflector/issues", - "source": "https://github.com/sebastianbergmann/object-reflector/tree/2.0.4" + "source": "https://github.com/sebastianbergmann/object-reflector/tree/3.0.0" }, "funding": [ { @@ -2893,32 +2834,32 @@ "type": "github" } ], - "time": "2020-10-26T13:14:26+00:00" + "time": "2023-02-03T07:06:18+00:00" }, { "name": "sebastian/recursion-context", - "version": "4.0.5", + "version": "5.0.0", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/recursion-context.git", - "reference": "e75bd0f07204fec2a0af9b0f3cfe97d05f92efc1" + "reference": "05909fb5bc7df4c52992396d0116aed689f93712" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/recursion-context/zipball/e75bd0f07204fec2a0af9b0f3cfe97d05f92efc1", - "reference": "e75bd0f07204fec2a0af9b0f3cfe97d05f92efc1", + "url": "https://api.github.com/repos/sebastianbergmann/recursion-context/zipball/05909fb5bc7df4c52992396d0116aed689f93712", + "reference": "05909fb5bc7df4c52992396d0116aed689f93712", "shasum": "" }, "require": { - "php": ">=7.3" + "php": ">=8.1" }, "require-dev": { - "phpunit/phpunit": "^9.3" + "phpunit/phpunit": "^10.0" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "4.0-dev" + "dev-main": "5.0-dev" } }, "autoload": { @@ -2948,61 +2889,7 @@ "homepage": "https://github.com/sebastianbergmann/recursion-context", "support": { "issues": "https://github.com/sebastianbergmann/recursion-context/issues", - "source": "https://github.com/sebastianbergmann/recursion-context/tree/4.0.5" - }, - "funding": [ - { - "url": "https://github.com/sebastianbergmann", - "type": "github" - } - ], - "time": "2023-02-03T06:07:39+00:00" - }, - { - "name": "sebastian/resource-operations", - "version": "3.0.4", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/resource-operations.git", - "reference": "05d5692a7993ecccd56a03e40cd7e5b09b1d404e" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/resource-operations/zipball/05d5692a7993ecccd56a03e40cd7e5b09b1d404e", - "reference": "05d5692a7993ecccd56a03e40cd7e5b09b1d404e", - "shasum": "" - }, - "require": { - "php": ">=7.3" - }, - "require-dev": { - "phpunit/phpunit": "^9.0" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-main": "3.0-dev" - } - }, - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de" - } - ], - "description": "Provides a list of PHP built-in functions that operate on resources", - "homepage": "https://www.github.com/sebastianbergmann/resource-operations", - "support": { - "source": "https://github.com/sebastianbergmann/resource-operations/tree/3.0.4" + "source": "https://github.com/sebastianbergmann/recursion-context/tree/5.0.0" }, "funding": [ { @@ -3010,32 +2897,32 @@ "type": "github" } ], - "time": "2024-03-14T16:00:52+00:00" + "time": "2023-02-03T07:05:40+00:00" }, { "name": "sebastian/type", - "version": "3.2.1", + "version": "4.0.0", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/type.git", - "reference": "75e2c2a32f5e0b3aef905b9ed0b179b953b3d7c7" + "reference": "462699a16464c3944eefc02ebdd77882bd3925bf" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/type/zipball/75e2c2a32f5e0b3aef905b9ed0b179b953b3d7c7", - "reference": "75e2c2a32f5e0b3aef905b9ed0b179b953b3d7c7", + "url": "https://api.github.com/repos/sebastianbergmann/type/zipball/462699a16464c3944eefc02ebdd77882bd3925bf", + "reference": "462699a16464c3944eefc02ebdd77882bd3925bf", "shasum": "" }, "require": { - "php": ">=7.3" + "php": ">=8.1" }, "require-dev": { - "phpunit/phpunit": "^9.5" + "phpunit/phpunit": "^10.0" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "3.2-dev" + "dev-main": "4.0-dev" } }, "autoload": { @@ -3058,7 +2945,7 @@ "homepage": "https://github.com/sebastianbergmann/type", "support": { "issues": "https://github.com/sebastianbergmann/type/issues", - "source": "https://github.com/sebastianbergmann/type/tree/3.2.1" + "source": "https://github.com/sebastianbergmann/type/tree/4.0.0" }, "funding": [ { @@ -3066,29 +2953,29 @@ "type": "github" } ], - "time": "2023-02-03T06:13:03+00:00" + "time": "2023-02-03T07:10:45+00:00" }, { "name": "sebastian/version", - "version": "3.0.2", + "version": "4.0.1", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/version.git", - "reference": "c6c1022351a901512170118436c764e473f6de8c" + "reference": "c51fa83a5d8f43f1402e3f32a005e6262244ef17" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/version/zipball/c6c1022351a901512170118436c764e473f6de8c", - "reference": "c6c1022351a901512170118436c764e473f6de8c", + "url": "https://api.github.com/repos/sebastianbergmann/version/zipball/c51fa83a5d8f43f1402e3f32a005e6262244ef17", + "reference": "c51fa83a5d8f43f1402e3f32a005e6262244ef17", "shasum": "" }, "require": { - "php": ">=7.3" + "php": ">=8.1" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "3.0-dev" + "dev-main": "4.0-dev" } }, "autoload": { @@ -3111,7 +2998,7 @@ "homepage": "https://github.com/sebastianbergmann/version", "support": { "issues": "https://github.com/sebastianbergmann/version/issues", - "source": "https://github.com/sebastianbergmann/version/tree/3.0.2" + "source": "https://github.com/sebastianbergmann/version/tree/4.0.1" }, "funding": [ { @@ -3119,7 +3006,7 @@ "type": "github" } ], - "time": "2020-09-28T06:39:44+00:00" + "time": "2023-02-07T11:34:05+00:00" }, { "name": "slevomat/coding-standard", diff --git a/phpunit.xml.dist b/phpunit.xml.dist index ce066ca0..19c9efa7 100644 --- a/phpunit.xml.dist +++ b/phpunit.xml.dist @@ -3,23 +3,22 @@ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" bootstrap="./vendor/autoload.php" colors="true" - xsi:noNamespaceSchemaLocation="./vendor/phpunit/phpunit/phpunit.xsd"> - - - src - - - + xsi:noNamespaceSchemaLocation="vendor/phpunit/phpunit/phpunit.xsd" + cacheDirectory=".phpunit.cache" + displayDetailsOnTestsThatTriggerDeprecations="true" + displayDetailsOnTestsThatTriggerErrors="true" + displayDetailsOnTestsThatTriggerNotices="true" + displayDetailsOnTestsThatTriggerWarnings="true" + displayDetailsOnSkippedTests="true" +> ./test - ./vendor/http-interop/http-factory-tests/test - @@ -29,4 +28,9 @@ + + + src + + diff --git a/psalm-baseline.xml b/psalm-baseline.xml index e2de9b9f..a88cc5d8 100644 --- a/psalm-baseline.xml +++ b/psalm-baseline.xml @@ -1,22 +1,22 @@ - + - ! $crFound - ! $crFound + + - null|callable + - $contents + - int - int - string + + + @@ -27,12 +27,12 @@ - forInvalidProxyArgument + - __construct + @@ -46,23 +46,23 @@ headerNames[strtolower($name)]]]> - $headerNames + - $header - $header - $header - $header + + + + - $value + - $headers + - $header - $header + + headerNames]]> @@ -71,7 +71,7 @@ - Module + @@ -81,28 +81,28 @@ - $headers - $method - $protocolVersion - $requestTarget - $uri + + + + + - $headers - $method - $protocolVersion - $requestTarget - $uri + + + + + - $body - $headers - $method - $requestTarget - $version + + + + + getHeaders()]]> @@ -110,71 +110,71 @@ - static::MAX_STATUS_CODE_VALUE - static::MIN_STATUS_CODE_VALUE + + - $headers - $protocolVersion - $reasonPhrase - $statusCode + + + + - $headers - $protocolVersion - $reasonPhrase - $statusCode + + + + - new static(204, $headers) + - is_string($html) + - $item + - $hasContentType + - json_encode + - $body - $headers - $reasonPhrase - $status - $version + + + + + getHeaders()]]> - (int) $status + - is_string($text) + - is_string($xml) + @@ -187,22 +187,22 @@ - $headers - $server + + - is_callable(self::$apacheRequestHeaders) + - getHeaderLine - getServerParams - getUri - withUri + + + + - $proxyCIDRList + ]]> @@ -210,18 +210,18 @@ - __construct + - $resource + resource]]> resource]]> resource]]> - $stream + @@ -231,16 +231,16 @@ - $key - $key - $matches[0] - $value + + + + port]]> - parseUri + @@ -256,20 +256,20 @@ is_string($key), ARRAY_FILTER_USE_KEY)]]> - $headers[$name] - $headers[$name] - $value + + + ]]> - is_string($key) + - string + @@ -287,31 +287,31 @@ - $apacheRequestHeaders + - $normalized + - UploadedFileInterface[] + - $normalized[$key] - $value - $value + + + - $cookies + ]]> @@ -319,49 +319,49 @@ - $ret - $ret + + - $value + - assertSame + - static function () use ($payload) { + - $payload[$i++] + - $i + - $i + - $headers + - $record - $record + + - $responseCode + - $value + @@ -371,45 +371,48 @@ - $parsedBody + - RequestInterfaceStaticReturnTypes + - - setMethods - + + + + + + - + - sampleCallback - sampleStaticCallback + + - HeaderStack + - $path - $streamOrFile + + - $test + - $test + - $query + @@ -433,12 +436,12 @@ - getClientFilename - getClientFilename - getClientFilename - getClientFilename - getClientFilename - getClientFilename + + + + + + diff --git a/src/Stream.php b/src/Stream.php index 2c0955de..f5cecbb5 100644 --- a/src/Stream.php +++ b/src/Stream.php @@ -318,14 +318,21 @@ public function getMetadata(?string $key = null) */ private function setStream($stream, string $mode = 'r'): void { + $error = null; $resource = $stream; if (is_string($stream)) { try { $resource = fopen($stream, $mode); } catch (Throwable $error) { + } + + if (! is_resource($resource)) { throw new Exception\RuntimeException( - sprintf('Invalid stream reference provided: %s', $error->getMessage()), + sprintf( + 'Empty or non-existent stream identifier or file path provided: "%s"', + $stream, + ), 0, $error ); diff --git a/test/CallbackStreamTest.php b/test/CallbackStreamTest.php index 358dff46..da993622 100644 --- a/test/CallbackStreamTest.php +++ b/test/CallbackStreamTest.php @@ -169,19 +169,22 @@ public function testGetMetadata(): void $this->assertNull($notExists); } - /** @return non-empty-array */ - public function phpCallbacksForStreams(): array + /** + * @link \LaminasTest\Diactoros\TestAsset\CallbacksForCallbackStream::sampleStaticCallback() + * @link \LaminasTest\Diactoros\TestAsset\CallbacksForCallbackStream::sampleCallback() + * + * @return non-empty-array + */ + public static function phpCallbacksForStreams(): array { - $class = TestAsset\CallbacksForCallbackStreamTest::class; + $class = TestAsset\CallbacksForCallbackStream::class; - // phpcs:disable Generic.Files.LineLength.TooLong - // @codingStandardsIgnoreStart + // phpcs:disable Generic.Files.LineLength return [ - 'instance-method' => [[new TestAsset\CallbacksForCallbackStreamTest(), 'sampleCallback'], $class . '::sampleCallback'], + 'instance-method' => [[new TestAsset\CallbacksForCallbackStream(), 'sampleCallback'], $class . '::sampleCallback'], 'static-method' => [[$class, 'sampleStaticCallback'], $class . '::sampleStaticCallback'], ]; - // @codingStandardsIgnoreEnd - // phpcs:enable Generic.Files.LineLength.TooLong + // phpcs:enable Generic.Files.LineLength } /** diff --git a/test/HeaderSecurityTest.php b/test/HeaderSecurityTest.php index ca7c49d9..b5d922c2 100644 --- a/test/HeaderSecurityTest.php +++ b/test/HeaderSecurityTest.php @@ -15,7 +15,7 @@ final class HeaderSecurityTest extends TestCase * * @return non-empty-list */ - public function getFilterValues(): array + public static function getFilterValues(): array { return [ ["This is a\n test", "This is a test"], @@ -45,7 +45,7 @@ public function testFiltersValuesPerRfc7230(string $value, string $expected): vo } /** @return non-empty-list */ - public function validateValues(): array + public static function validateValues(): array { return [ ["This is a\n test", false], @@ -77,7 +77,7 @@ public function testValidatesValuesPerRfc7230(string $value, bool $expected): vo } /** @return non-empty-list */ - public function assertValues(): array + public static function assertValues(): array { return [ ["This is a\n test"], @@ -107,7 +107,7 @@ public function testAssertValidRaisesExceptionForInvalidValue(string $value): vo } /** @return non-empty-list */ - public function assertNames(): array + public static function assertNames(): array { return [ ["test\n"], diff --git a/test/MessageTraitTest.php b/test/MessageTraitTest.php index 1d5626dd..972fcf05 100644 --- a/test/MessageTraitTest.php +++ b/test/MessageTraitTest.php @@ -36,7 +36,7 @@ public function testProtocolMutatorReturnsCloneWithChanges(): void } /** @return non-empty-array */ - public function invalidProtocolVersionProvider(): array + public static function invalidProtocolVersionProvider(): array { return [ '1-without-minor' => ['1'], @@ -54,7 +54,7 @@ public function testWithProtocolVersionRaisesExceptionForInvalidVersion(string $ } /** @return non-empty-array */ - public function validProtocolVersionProvider(): array + public static function validProtocolVersionProvider(): array { return [ '1.0' => ['1.0'], @@ -169,7 +169,7 @@ public function testHeaderRemovalIsCaseInsensitive(): void } /** @return non-empty-array */ - public function invalidGeneralHeaderValues(): array + public static function invalidGeneralHeaderValues(): array { return [ 'null' => [null], @@ -193,7 +193,7 @@ public function testWithHeaderRaisesExceptionForInvalidNestedHeaderValue(mixed $ } /** @return non-empty-array */ - public function invalidHeaderValues(): array + public static function invalidHeaderValues(): array { return [ 'null' => [null], @@ -260,7 +260,7 @@ public function testGetHeaderLineReturnsEmptyStringWhenHeaderDoesNotExist(): voi } /** @return non-empty-array */ - public function headersWithInjectionVectors(): array + public static function headersWithInjectionVectors(): array { return [ 'name-with-cr' => ["X-Foo\r-Bar", 'value'], @@ -321,7 +321,7 @@ public function testWithAddedHeaderAllowsHeaderContinuations(): void } /** @return non-empty-array */ - public function headersWithWhitespace(): array + public static function headersWithWhitespace(): array { return [ 'no' => ["Baz"], @@ -342,7 +342,7 @@ public function testWithHeaderTrimsWhitespace(string $value): void } /** @return non-empty-array */ - public function headersWithContinuation(): array + public static function headersWithContinuation(): array { return [ 'space' => ["foo\r\n bar"], @@ -364,7 +364,7 @@ public function testWithHeaderNormalizesContinuationToNotContainNewlines(string } /** @return non-empty-array */ - public function numericHeaderValuesProvider(): array + public static function numericHeaderValuesProvider(): array { return [ 'integer' => [123], @@ -392,7 +392,7 @@ public function testWithHeaderShouldAllowIntegersAndFloats(float $value): void } /** @return non-empty-array */ - public function invalidHeaderValueTypes(): array + public static function invalidHeaderValueTypes(): array { return [ 'null' => [null], @@ -403,9 +403,9 @@ public function invalidHeaderValueTypes(): array } /** @return non-empty-array */ - public function invalidArrayHeaderValues(): array + public static function invalidArrayHeaderValues(): array { - $values = $this->invalidHeaderValueTypes(); + $values = self::invalidHeaderValueTypes(); $values['array'] = [['INVALID']]; return $values; } diff --git a/test/Request/SerializerTest.php b/test/Request/SerializerTest.php index 2eb6f7bc..aa5a0e5d 100644 --- a/test/Request/SerializerTest.php +++ b/test/Request/SerializerTest.php @@ -30,7 +30,7 @@ public function testSerializesBasicRequest(): void $message = Serializer::toString($request); $this->assertSame( "GET /foo/bar?baz=bat HTTP/1.1\r\nHost: example.com\r\nAccept: text/html", - $message + $message, ); } @@ -66,7 +66,7 @@ public function testSerializesMultipleHeadersCorrectly(): void } /** @return non-empty-array}> */ - public function originForms(): array + public static function originForms(): array { return [ 'path-only' => [ @@ -122,7 +122,7 @@ public function testCanDeserializeRequestWithOriginForm( * } * > */ - public function absoluteForms(): array + public static function absoluteForms(): array { return [ 'path-only' => [ @@ -223,7 +223,7 @@ public function testCanDeserializeRequestWithAsteriskForm(): void } /** @return non-empty-array */ - public function invalidRequestLines(): array + public static function invalidRequestLines(): array { return [ 'missing-method' => ['/foo/bar HTTP/1.1'], @@ -260,7 +260,7 @@ public function testCanDeserializeRequestWithMultipleHeadersOfSameName(): void } /** @return non-empty-array */ - public function headersWithContinuationLines(): array + public static function headersWithContinuationLines(): array { return [ 'space' => ["POST /foo HTTP/1.0\r\nContent-Type: text/plain\r\nX-Foo-Bar: Baz;\r\n Bat\r\n\r\nContent!"], @@ -284,7 +284,7 @@ public function testCanDeserializeRequestWithHeaderContinuations(string $text): } /** @return non-empty-array */ - public function headersWithWhitespace(): array + public static function headersWithWhitespace(): array { return [ 'no' => ["POST /foo HTTP/1.0\r\nContent-Type: text/plain\r\nX-Foo-Bar:Baz\r\n\r\nContent!"], @@ -308,7 +308,7 @@ public function testDeserializationRemovesWhitespaceAroundValues(string $text): } /** @return non-empty-array */ - public function messagesWithInvalidHeaders(): array + public static function messagesWithInvalidHeaders(): array { return [ 'invalid-name' => [ @@ -347,7 +347,7 @@ public function testFromStreamThrowsExceptionWhenStreamIsNotReadable(): void $stream ->expects($this->once()) ->method('isReadable') - ->will($this->returnValue(false)); + ->willReturn(false); $this->expectException(InvalidArgumentException::class); @@ -360,11 +360,11 @@ public function testFromStreamThrowsExceptionWhenStreamIsNotSeekable(): void $stream ->expects($this->once()) ->method('isReadable') - ->will($this->returnValue(true)); + ->willReturn(true); $stream ->expects($this->once()) ->method('isSeekable') - ->will($this->returnValue(false)); + ->willReturn(false); $this->expectException(InvalidArgumentException::class); @@ -380,20 +380,20 @@ public function testFromStreamStopsReadingAfterScanningHeader(): void $stream ->expects($this->once()) ->method('isReadable') - ->will($this->returnValue(true)); + ->willReturn(true); $stream ->expects($this->once()) ->method('isSeekable') - ->will($this->returnValue(true)); + ->willReturn(true); // assert that full request body is not read, and returned as RelativeStream instead $stream->expects($this->exactly(strlen($headers))) ->method('read') ->with(1) - ->will($this->returnCallback(static function () use ($payload) { + ->willReturnCallback(static function () use ($payload) { static $i = 0; return $payload[$i++]; - })); + }); $stream = Serializer::fromStream($stream); diff --git a/test/RequestTest.php b/test/RequestTest.php index 770a1346..2b957019 100644 --- a/test/RequestTest.php +++ b/test/RequestTest.php @@ -34,7 +34,7 @@ public function testMethodMutatorReturnsCloneWithChangedMethod(): void } /** @return non-empty-list */ - public function invalidMethod() + public static function invalidMethod(): array { return [ [''], @@ -108,7 +108,7 @@ public function testDefaultStreamIsWritable(): void } /** @return non-empty-array */ - public function invalidRequestMethod(): array + public static function invalidRequestMethod(): array { return [ 'bad-string' => ['BOGUS METHOD'], @@ -128,7 +128,7 @@ public function testConstructorRaisesExceptionForInvalidMethod(string $method): } /** @return non-empty-array */ - public function customRequestMethods(): array + public static function customRequestMethods(): array { return [ /* WebDAV methods */ @@ -157,7 +157,7 @@ public function testAllowsCustomRequestMethodsThatFollowSpec(string $method): vo } /** @return non-empty-array */ - public function invalidRequestBody(): array + public static function invalidRequestBody(): array { return [ 'true' => [true], @@ -182,7 +182,7 @@ public function testConstructorRaisesExceptionForInvalidBody(mixed $body): void } /** @return non-empty-array */ - public function invalidHeaderTypes(): array + public static function invalidHeaderTypes(): array { return [ 'indexed-array' => [[['INVALID']], 'header name'], @@ -222,7 +222,7 @@ public function testRequestTargetIsSlashWhenUriHasNoPathOrQuery(): void } /** @return non-empty-array */ - public function requestsWithUri(): array + public static function requestsWithUri(): array { return [ 'absolute-uri' => [ @@ -262,7 +262,7 @@ public function testReturnsRequestTargetWhenUriIsPresent(RequestInterface $reque } /** @return non-empty-array */ - public function validRequestTargets(): array + public static function validRequestTargets(): array { return [ 'asterisk-form' => ['*'], @@ -467,7 +467,7 @@ public function testHostHeaderUpdatesToUriHostAndPortWhenPreserveHostDisabledAnd } /** @return non-empty-array */ - public function headersWithInjectionVectors(): array + public static function headersWithInjectionVectors(): array { return [ 'name-with-cr' => ["X-Foo\r-Bar", 'value'], @@ -498,7 +498,7 @@ public function testConstructorRaisesExceptionForHeadersWithCRLFVectors(string $ } /** @return non-empty-array */ - public function hostHeaderKeys(): array + public static function hostHeaderKeys(): array { return [ 'lowercase' => ['host'], diff --git a/test/Response/HtmlResponseTest.php b/test/Response/HtmlResponseTest.php index d914264e..c5f72d1e 100644 --- a/test/Response/HtmlResponseTest.php +++ b/test/Response/HtmlResponseTest.php @@ -53,7 +53,7 @@ public function testAllowsStreamsForResponseBody(): void } /** @return array */ - public function invalidHtmlContent(): array + public static function invalidHtmlContent(): array { return [ 'null' => [null], diff --git a/test/Response/JsonResponseTest.php b/test/Response/JsonResponseTest.php index aa2bdf13..dd129dcc 100644 --- a/test/Response/JsonResponseTest.php +++ b/test/Response/JsonResponseTest.php @@ -42,7 +42,7 @@ public function testConstructorAcceptsDataAndCreatesJsonEncodedMessageBody(): vo } /** @return non-empty-array */ - public function scalarValuesForJSON() + public static function scalarValuesForJSON() { return [ 'null' => [null], @@ -121,7 +121,7 @@ public function testJsonErrorHandlingOfMalformedUtf8IfExplicitlySettingThrowFlag } /** @return non-empty-array */ - public function valuesToJsonEncode(): array + public static function valuesToJsonEncode(): array { return [ 'uri' => ['https://example.com/foo?bar=baz&baz=bat', 'uri'], diff --git a/test/Response/RedirectResponseTest.php b/test/Response/RedirectResponseTest.php index f6917ccb..115d89a8 100644 --- a/test/Response/RedirectResponseTest.php +++ b/test/Response/RedirectResponseTest.php @@ -47,7 +47,7 @@ public function testConstructorAllowsSpecifyingHeaders(): void } /** @return non-empty-array */ - public function invalidUris(): array + public static function invalidUris(): array { return [ 'null' => [null], diff --git a/test/Response/SerializerTest.php b/test/Response/SerializerTest.php index f038c0da..a9a2cfcd 100644 --- a/test/Response/SerializerTest.php +++ b/test/Response/SerializerTest.php @@ -100,7 +100,7 @@ public function testCanDeserializeResponseWithMultipleHeadersOfSameName(): void } /** @return non-empty-array */ - public function headersWithContinuationLines(): array + public static function headersWithContinuationLines(): array { return [ 'space' => ["HTTP/1.0 200 A-OK\r\nContent-Type: text/plain\r\nX-Foo-Bar: Baz;\r\n Bat\r\n\r\nContent!"], @@ -124,7 +124,7 @@ public function testCanDeserializeResponseWithHeaderContinuations(string $text): } /** @return non-empty-array */ - public function headersWithWhitespace(): array + public static function headersWithWhitespace(): array { return [ 'no' => ["HTTP/1.0 200 A-OK\r\nContent-Type: text/plain\r\nX-Foo-Bar:Baz\r\n\r\nContent!"], @@ -199,7 +199,7 @@ public function testDeserializationRaisesExceptionForInvalidStatusLine(): void } /** @return non-empty-array */ - public function messagesWithInvalidHeaders(): array + public static function messagesWithInvalidHeaders(): array { return [ 'invalid-name' => [ @@ -238,7 +238,7 @@ public function testFromStreamThrowsExceptionWhenStreamIsNotReadable(): void $stream ->expects($this->once()) ->method('isReadable') - ->will($this->returnValue(false)); + ->willReturn(false); $this->expectException(InvalidArgumentException::class); @@ -251,11 +251,11 @@ public function testFromStreamThrowsExceptionWhenStreamIsNotSeekable(): void $stream ->expects($this->once()) ->method('isReadable') - ->will($this->returnValue(true)); + ->willReturn(true); $stream ->expects($this->once()) ->method('isSeekable') - ->will($this->returnValue(false)); + ->willReturn(false); $this->expectException(InvalidArgumentException::class); diff --git a/test/Response/TextResponseTest.php b/test/Response/TextResponseTest.php index f4a67dc3..ffbd5ee4 100644 --- a/test/Response/TextResponseTest.php +++ b/test/Response/TextResponseTest.php @@ -53,7 +53,7 @@ public function testAllowsStreamsForResponseBody(): void } /** @return non-empty-array */ - public function invalidContent(): array + public static function invalidContent(): array { return [ 'null' => [null], diff --git a/test/Response/XmlResponseTest.php b/test/Response/XmlResponseTest.php index bca99c12..d39c7a14 100644 --- a/test/Response/XmlResponseTest.php +++ b/test/Response/XmlResponseTest.php @@ -55,7 +55,7 @@ public function testAllowsStreamsForResponseBody(): void } /** @return non-empty-array */ - public function invalidContent(): array + public static function invalidContent(): array { return [ 'null' => [null], diff --git a/test/ResponseTest.php b/test/ResponseTest.php index 63b697a7..1ed1da1a 100644 --- a/test/ResponseTest.php +++ b/test/ResponseTest.php @@ -60,7 +60,7 @@ public function testReasonPhraseDefaultsToStandards(): void $this->assertSame('Unprocessable Content', $response->getReasonPhrase()); } - private function fetchIanaStatusCodes(): DOMDocument + private static function fetchIanaStatusCodes(): DOMDocument { $updated = null; $ianaHttpStatusCodesFile = __DIR__ . '/TestAsset/.cache/http-status-codes.xml'; @@ -123,9 +123,9 @@ private function fetchIanaStatusCodes(): DOMDocument } /** @return list */ - public function ianaCodesReasonPhrasesProvider(): array + public static function ianaCodesReasonPhrasesProvider(): array { - $ianaHttpStatusCodes = $this->fetchIanaStatusCodes(); + $ianaHttpStatusCodes = self::fetchIanaStatusCodes(); $ianaCodesReasonPhrases = []; @@ -218,7 +218,7 @@ public function testCreateWithValidStatusCodes(int $code): void } /** @return non-empty-array */ - public function validStatusCodes(): array + public static function validStatusCodes(): array { return [ 'minimum' => [100], @@ -239,7 +239,7 @@ public function testCannotSetInvalidStatusCode(mixed $code): void } /** @return non-empty-array */ - public function invalidStatusCodes(): array + public static function invalidStatusCodes(): array { return [ 'too-low' => [99], @@ -248,7 +248,7 @@ public function invalidStatusCodes(): array } /** @return non-empty-array */ - public function invalidResponseBody(): array + public static function invalidResponseBody(): array { return [ 'true' => [true], @@ -273,7 +273,7 @@ public function testConstructorRaisesExceptionForInvalidBody(mixed $body): void } /** @return non-empty-array, 1?: non-empty-string}> */ - public function invalidHeaderTypes(): array + public static function invalidHeaderTypes(): array { return [ 'indexed-array' => [[['INVALID']], 'header name'], @@ -308,7 +308,7 @@ public function testReasonPhraseCanBeEmpty(): void } /** @return non-empty-array}> */ - public function headersWithInjectionVectors(): array + public static function headersWithInjectionVectors(): array { return [ 'name-with-cr' => ["X-Foo\r-Bar", 'value'], diff --git a/test/ServerRequestFactoryTest.php b/test/ServerRequestFactoryTest.php index 73e90303..bc0c25c9 100644 --- a/test/ServerRequestFactoryTest.php +++ b/test/ServerRequestFactoryTest.php @@ -234,7 +234,7 @@ public function testFromGlobalsUsesCookieSuperGlobalWhenCookieHeaderIsNotSet(): } /** @return non-empty-array}> */ - public function cookieHeaderValues(): array + public static function cookieHeaderValues(): array { return [ 'ows-without-fold' => [ @@ -347,7 +347,7 @@ public function testMarshalProtocolVersionReturnsHttpVersions(string $protocol, } /** @return non-empty-array */ - public function marshalProtocolVersionProvider(): array + public static function marshalProtocolVersionProvider(): array { return [ 'HTTP/1.0' => ['HTTP/1.0', '1.0'], @@ -375,7 +375,7 @@ public function testServerRequestFactoryHasAWritableEmptyBody(): void * 3: string * }> */ - public function serverContentMap(): iterable + public static function serverContentMap(): iterable { yield 'content-type' => [ [ @@ -531,7 +531,7 @@ public function testHonorsHostHeaderOverServerNameWhenMarshalingUrl(): void * 0: string * }> */ - public function invalidHostHeaders(): iterable + public static function invalidHostHeaders(): iterable { return [ 'comma' => ['example.com,example.net'], diff --git a/test/ServerRequestFilter/FilterUsingXForwardedHeadersTest.php b/test/ServerRequestFilter/FilterUsingXForwardedHeadersTest.php index e4bbd4a7..b06f35fa 100644 --- a/test/ServerRequestFilter/FilterUsingXForwardedHeadersTest.php +++ b/test/ServerRequestFilter/FilterUsingXForwardedHeadersTest.php @@ -91,7 +91,7 @@ public function testFilterDoesNothingWhenAddressNotFromTrustedProxy(): void } /** @psalm-return iterable */ - public function trustedProxyList(): iterable + public static function trustedProxyList(): iterable { yield 'private-class-a-subnet' => ['10.1.1.1']; yield 'private-class-c-subnet' => ['192.168.1.1']; @@ -156,7 +156,7 @@ public function testTrustingProxyListWithSpecificTrustedHeadersTrustsOnlyThoseHe } /** @psalm-return iterable */ - public function untrustedProxyList(): iterable + public static function untrustedProxyList(): iterable { yield 'private-class-a-subnet' => ['10.0.0.1']; yield 'private-class-c-subnet' => ['192.168.168.1']; @@ -257,7 +257,7 @@ public function testListOfForwardedProtosIsConsideredUntrusted(): void } /** @psalm-return iterable */ - public function trustedReservedNetworkList(): iterable + public static function trustedReservedNetworkList(): iterable { yield 'ipv4-localhost' => ['127.0.0.1']; yield 'ipv4-class-a' => ['10.10.10.10']; @@ -297,7 +297,7 @@ public function testTrustReservedSubnetsProducesFilterThatAcceptsAddressesFromTh } /** @psalm-return iterable */ - public function unreservedNetworkAddressList(): iterable + public static function unreservedNetworkAddressList(): iterable { yield 'ipv4-no-localhost' => ['128.0.0.1']; yield 'ipv4-no-class-a' => ['19.10.10.10']; @@ -333,7 +333,7 @@ public function testTrustReservedSubnetsProducesFilterThatRejectsAddressesNotFro } /** @psalm-return iterable */ - public function xForwardedProtoValues(): iterable + public static function xForwardedProtoValues(): iterable { yield 'https-lowercase' => ['https', 'https']; yield 'https-uppercase' => ['HTTPS', 'https']; diff --git a/test/ServerRequestFilter/IPRangeTest.php b/test/ServerRequestFilter/IPRangeTest.php index 4d4436df..928e0607 100644 --- a/test/ServerRequestFilter/IPRangeTest.php +++ b/test/ServerRequestFilter/IPRangeTest.php @@ -16,7 +16,7 @@ class IPRangeTest extends TestCase * 2: string, * }> */ - public function IPv4Data(): array + public static function IPv4Data(): array { return [ 'valid - exact (no mask; /32 equiv)' => [true, '192.168.1.1', '192.168.1.1'], @@ -50,7 +50,7 @@ public function testIPv4(bool $result, string $remoteAddr, string $cidr): void * 2: string, * }> */ - public function IPv6Data(): array + public static function IPv6Data(): array { // @codingStandardsIgnoreStart return [ @@ -83,14 +83,14 @@ public function testIPv6(bool $result, string $remoteAddr, string $cidr): void * 2: string, * }> */ - public function combinedData(): iterable + public static function combinedData(): iterable { - foreach ($this->IPv4Data() as $test => $data) { + foreach (self::IPv4Data() as $test => $data) { $name = "IPv4 - {$test}"; yield $name => $data; } - foreach ($this->IPv6Data() as $test => $data) { + foreach (self::IPv6Data() as $test => $data) { $name = "IPv6 - {$test}"; yield $name => $data; } diff --git a/test/ServerRequestTest.php b/test/ServerRequestTest.php index b04f2341..26976a9c 100644 --- a/test/ServerRequestTest.php +++ b/test/ServerRequestTest.php @@ -101,7 +101,7 @@ public function testRemovingAttributeReturnsCloneWithoutAttribute(ServerRequest } /** @return non-empty-array */ - public function provideMethods(): array + public static function provideMethods(): array { return [ 'post' => ['POST', 'POST'], diff --git a/test/StreamTest.php b/test/StreamTest.php index b01918dc..e7efe2ae 100644 --- a/test/StreamTest.php +++ b/test/StreamTest.php @@ -9,6 +9,7 @@ use InvalidArgumentException; use Laminas\Diactoros\Exception\InvalidArgumentException as DiactorosInvalidArgumentException; use Laminas\Diactoros\Stream; +use PHPUnit\Framework\Attributes\DataProvider; use PHPUnit\Framework\TestCase; use ReflectionProperty; use RuntimeException; @@ -42,6 +43,9 @@ final class StreamTest extends TestCase /** @var string|null|false */ private $tmpnam; + /** @var list */ + private static $tempFiles = []; + private Stream $stream; protected function setUp(): void @@ -57,6 +61,18 @@ protected function tearDown(): void } } + public static function tearDownAfterClass(): void + { + /** @see self::invalidResources() */ + foreach (self::$tempFiles as $tempFile) { + if (! file_exists($tempFile)) { + continue; + } + + unlink($tempFile); + } + } + public function testCanInstantiateWithStreamIdentifier(): void { $this->assertInstanceOf(Stream::class, $this->stream); @@ -297,7 +313,7 @@ public function testIsWritableReturnsTrueForWritableMemoryStream(): void } /** @return non-empty-list */ - public function provideDataForIsWritable(): array + public static function provideDataForIsWritable(): array { return [ ['a', true, true], @@ -334,9 +350,9 @@ private function findNonExistentTempName(): string } /** - * @dataProvider provideDataForIsWritable * @param non-empty-string $mode */ + #[DataProvider('provideDataForIsWritable')] public function testIsWritableReturnsCorrectFlagForMode(string $mode, bool $fileShouldExist, bool $flag): void { if ($fileShouldExist) { @@ -352,7 +368,7 @@ public function testIsWritableReturnsCorrectFlagForMode(string $mode, bool $file } /** @return non-empty-list */ - public function provideDataForIsReadable(): array + public static function provideDataForIsReadable(): array { return [ ['a', true, false], @@ -380,9 +396,9 @@ public function provideDataForIsReadable(): array } /** - * @dataProvider provideDataForIsReadable * @param non-empty-string $mode */ + #[DataProvider('provideDataForIsReadable')] public function testIsReadableReturnsCorrectFlagForMode(string $mode, bool $fileShouldExist, bool $flag): void { if ($fileShouldExist) { @@ -471,23 +487,24 @@ public function testGetContentsRisesExceptionIfStreamIsNotReadable(): void } /** @return non-empty-array */ - public function invalidResources(): array + public static function invalidResources(): array { - $this->tmpnam = tempnam(sys_get_temp_dir(), 'diac'); + $file = tempnam(sys_get_temp_dir(), 'diac'); + self::assertIsString($file); + self::$tempFiles[] = $file; + return [ 'null' => [null], 'false' => [false], 'true' => [true], 'int' => [1], 'float' => [1.1], - 'array' => [[fopen($this->tmpnam, 'r+')]], - 'object' => [(object) ['resource' => fopen($this->tmpnam, 'r+')]], + 'array' => [[fopen($file, 'r+')]], + 'object' => [(object) ['resource' => fopen($file, 'r+')]], ]; } - /** - * @dataProvider invalidResources - */ + #[DataProvider('invalidResources')] public function testAttachWithNonStringNonResourceRaisesException(mixed $resource): void { $this->expectException(InvalidArgumentException::class); @@ -497,12 +514,22 @@ public function testAttachWithNonStringNonResourceRaisesException(mixed $resourc $this->stream->attach($resource); } - public function testAttachWithInvalidStringResourceRaisesException(): void + public static function invalidStringResources(): array + { + return [ + 'Empty String' => [''], + 'File path does not exist' => ['/tmp/not-a-valid-file-path'], + 'Invalid stream' => ['php://mammary'], + ]; + } + + #[DataProvider('invalidStringResources')] + public function testAttachWithInvalidStringResourceRaisesException(string $stream): void { $this->expectException(RuntimeException::class); - $this->expectExceptionMessage('Invalid stream'); + $this->expectExceptionMessage('Empty or non-existent stream identifier or file path provided'); - $this->stream->attach('foo-bar-baz'); + $this->stream->attach($stream); } public function testAttachWithResourceAttachesResource(): void @@ -663,11 +690,11 @@ public function testCanReadContentFromNotSeekableResource(): void $stream = $this ->getMockBuilder(Stream::class) ->setConstructorArgs([$resource]) - ->setMethods(['isSeekable']) + ->onlyMethods(['isSeekable']) ->getMock(); $stream->expects($this->any())->method('isSeekable') - ->will($this->returnValue(false)); + ->willReturn(false); $this->assertSame('FOO BAR', $stream->__toString()); } diff --git a/test/TestAsset/CallbacksForCallbackStreamTest.php b/test/TestAsset/CallbacksForCallbackStream.php similarity index 90% rename from test/TestAsset/CallbacksForCallbackStreamTest.php rename to test/TestAsset/CallbacksForCallbackStream.php index 004a3d7e..9fefadb0 100644 --- a/test/TestAsset/CallbacksForCallbackStreamTest.php +++ b/test/TestAsset/CallbacksForCallbackStream.php @@ -4,7 +4,7 @@ namespace LaminasTest\Diactoros\TestAsset; -class CallbacksForCallbackStreamTest +final class CallbacksForCallbackStream { /** * Sample callback to use with testing. diff --git a/test/UploadedFileTest.php b/test/UploadedFileTest.php index fdf3a570..fd4b8d18 100644 --- a/test/UploadedFileTest.php +++ b/test/UploadedFileTest.php @@ -57,7 +57,7 @@ protected function tearDown(): void } /** @return non-empty-array */ - public function invalidStreams(): array + public static function invalidStreams(): array { return [ 'null' => [null], @@ -92,7 +92,7 @@ public function testValidSize(): void } /** @return non-empty-array */ - public function invalidErrorStatuses(): array + public static function invalidErrorStatuses(): array { return [ 'negative' => [-1], @@ -168,7 +168,7 @@ public function testMovesFileToDesignatedPath(): void } /** @return non-empty-array */ - public function invalidMovePaths(): array + public static function invalidMovePaths(): array { return [ 'empty' => [''], @@ -225,7 +225,7 @@ public function testCannotRetrieveStreamAfterMove(): void } /** @return non-empty-array */ - public function nonOkErrorStatus(): array + public static function nonOkErrorStatus(): array { return [ 'UPLOAD_ERR_INI_SIZE' => [UPLOAD_ERR_INI_SIZE], @@ -296,7 +296,7 @@ public function testMoveToCreatesStreamIfOnlyAFilenameWasProvided(): void } /** @return iterable */ - public function errorConstantsAndMessages(): iterable + public static function errorConstantsAndMessages(): iterable { foreach (UploadedFile::ERROR_MESSAGES as $constant => $message) { if ($constant === UPLOAD_ERR_OK) { diff --git a/test/UriFactoryTest.php b/test/UriFactoryTest.php index 1701ca74..d6be9f8f 100644 --- a/test/UriFactoryTest.php +++ b/test/UriFactoryTest.php @@ -152,7 +152,7 @@ public function testMarshalHostAndPortWillDetectPortInIpv6StyleHost(): void } /** @return non-empty-array */ - public function httpsParamProvider(): array + public static function httpsParamProvider(): array { return [ 'lowercase' => ['https'], @@ -178,9 +178,9 @@ public function testMarshalUriDetectsHttpsSchemeFromServerValue(string $param): } /** @return iterable */ - public function httpsDisableParamProvider(): iterable + public static function httpsDisableParamProvider(): iterable { - foreach ($this->httpsParamProvider() as $key => $data) { + foreach (self::httpsParamProvider() as $key => $data) { $param = array_shift($data); foreach (['lowercase-off', 'uppercase-off'] as $type) { $key = sprintf('%s-%s', $key, $type); diff --git a/test/UriTest.php b/test/UriTest.php index 42549c6c..04df4df0 100644 --- a/test/UriTest.php +++ b/test/UriTest.php @@ -79,7 +79,7 @@ public function testWithUserInfoReturnsSameInstanceIfUserAndPasswordAreSameAsBef } /** @return non-empty-array */ - public function userInfoProvider(): array + public static function userInfoProvider(): array { // @codingStandardsIgnoreStart return [ @@ -127,7 +127,7 @@ public function testWithHostReturnsSameInstanceWithProvidedHostIsSameAsBefore(): } /** @return non-empty-array */ - public function validPorts(): array + public static function validPorts(): array { return [ 'null' => [null], @@ -161,7 +161,7 @@ public function testWithPortReturnsSameInstanceWithProvidedPortIsSameAsBefore(): } /** @return non-empty-array */ - public function invalidPorts(): array + public static function invalidPorts(): array { return [ 'zero' => [0], @@ -203,7 +203,7 @@ public function testWithPathReturnsSameInstanceWithProvidedPathSameAsBefore(): v } /** @return non-empty-array */ - public function invalidPaths(): array + public static function invalidPaths(): array { return [ 'query' => ['/bar/baz?bat=quz'], @@ -235,7 +235,7 @@ public function testWithQueryReturnsNewInstanceWithProvidedQuery(): void } /** @return non-empty-array */ - public function invalidQueryStrings(): array + public static function invalidQueryStrings(): array { return [ 'fragment' => ['baz=bat#quz'], @@ -275,7 +275,7 @@ public function testWithFragmentReturnsSameInstanceWithProvidedFragmentSameAsBef } /** @return non-empty-array */ - public function authorityInfo(): array + public static function authorityInfo(): array { return [ 'host-only' => ['http://foo.com/bar', 'foo.com'], @@ -350,7 +350,7 @@ public function testESchemeStripsOffDelimiter(): void } /** @return non-empty-array */ - public function invalidSchemes(): array + public static function invalidSchemes(): array { return [ 'mailto' => ['mailto'], @@ -416,7 +416,7 @@ public function testEncodeFragmentPrefixIfPresent(): void } /** @return non-empty-array */ - public function standardSchemePortCombinations(): array + public static function standardSchemePortCombinations(): array { return [ 'http' => ['http', 80], @@ -439,7 +439,7 @@ public function testAuthorityOmitsPortForStandardSchemePortCombinations(string $ } /** @return non-empty-array */ - public function mutations(): array + public static function mutations(): array { return [ 'scheme' => ['withScheme', 'https'], @@ -492,7 +492,7 @@ public function testPathDoesNotBecomeDoubleEncoded(): void } /** @return non-empty-array */ - public function queryStringsForEncoding(): array + public static function queryStringsForEncoding(): array { return [ 'key-only' => ['k^ey', 'k%5Eey'], @@ -565,7 +565,7 @@ public function testUtf8Path(string $url, string $result): void } /** @return non-empty-list */ - public function utf8PathsDataProvider(): array + public static function utf8PathsDataProvider(): array { return [ ['http://example.com/тестовый_путь/', '/тестовый_путь/'], @@ -588,7 +588,7 @@ public function testUtf8Query(string $url, string $result): void } /** @return non-empty-list */ - public function utf8QueryStringsDataProvider(): array + public static function utf8QueryStringsDataProvider(): array { return [ ['http://example.com/?q=тестовый_путь', 'q=тестовый_путь'],