diff --git a/composer.json b/composer.json index 34540bb1..8640dfd3 100644 --- a/composer.json +++ b/composer.json @@ -93,7 +93,10 @@ "config": { "preferred-install": "dist", "sort-packages": true, - "optimize-autoloader": true + "optimize-autoloader": true, + "platform": { + "php": "8.3.31" + } }, "minimum-stability": "stable", "prefer-stable": true diff --git a/composer.lock b/composer.lock index b52fd732..faffb17f 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": "ccb644aef51a9f88301c63d4bef54771", + "content-hash": "9b689efb6d29cb572794705682d6edc4", "packages": [ { "name": "akaunting/laravel-setting", @@ -577,16 +577,16 @@ }, { "name": "dflydev/dot-access-data", - "version": "v3.0.2", + "version": "v3.0.3", "source": { "type": "git", "url": "https://github.com/dflydev/dflydev-dot-access-data.git", - "reference": "f41715465d65213d644d3141a6a93081be5d3549" + "reference": "a23a2bf4f31d3518f3ecb38660c95715dfead60f" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/dflydev/dflydev-dot-access-data/zipball/f41715465d65213d644d3141a6a93081be5d3549", - "reference": "f41715465d65213d644d3141a6a93081be5d3549", + "url": "https://api.github.com/repos/dflydev/dflydev-dot-access-data/zipball/a23a2bf4f31d3518f3ecb38660c95715dfead60f", + "reference": "a23a2bf4f31d3518f3ecb38660c95715dfead60f", "shasum": "" }, "require": { @@ -646,9 +646,9 @@ ], "support": { "issues": "https://github.com/dflydev/dflydev-dot-access-data/issues", - "source": "https://github.com/dflydev/dflydev-dot-access-data/tree/v3.0.2" + "source": "https://github.com/dflydev/dflydev-dot-access-data/tree/v3.0.3" }, - "time": "2022-10-27T11:44:00+00:00" + "time": "2024-07-08T12:26:09+00:00" }, { "name": "doctrine/inflector", @@ -3133,34 +3133,39 @@ }, { "name": "nette/schema", - "version": "v1.2.3", + "version": "v1.3.5", "source": { "type": "git", "url": "https://github.com/nette/schema.git", - "reference": "abbdbb70e0245d5f3bf77874cea1dfb0c930d06f" + "reference": "f0ab1a3cda782dbc5da270d28545236aa80c4002" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/nette/schema/zipball/abbdbb70e0245d5f3bf77874cea1dfb0c930d06f", - "reference": "abbdbb70e0245d5f3bf77874cea1dfb0c930d06f", + "url": "https://api.github.com/repos/nette/schema/zipball/f0ab1a3cda782dbc5da270d28545236aa80c4002", + "reference": "f0ab1a3cda782dbc5da270d28545236aa80c4002", "shasum": "" }, "require": { - "nette/utils": "^2.5.7 || ^3.1.5 || ^4.0", - "php": ">=7.1 <8.3" + "nette/utils": "^4.0", + "php": "8.1 - 8.5" }, "require-dev": { - "nette/tester": "^2.3 || ^2.4", - "phpstan/phpstan-nette": "^1.0", - "tracy/tracy": "^2.7" + "nette/phpstan-rules": "^1.0", + "nette/tester": "^2.6", + "phpstan/extension-installer": "^1.4@stable", + "phpstan/phpstan": "^2.1.39@stable", + "tracy/tracy": "^2.8" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "1.2-dev" + "dev-master": "1.3-dev" } }, "autoload": { + "psr-4": { + "Nette\\": "src" + }, "classmap": [ "src/" ] @@ -3189,53 +3194,57 @@ ], "support": { "issues": "https://github.com/nette/schema/issues", - "source": "https://github.com/nette/schema/tree/v1.2.3" + "source": "https://github.com/nette/schema/tree/v1.3.5" }, - "time": "2022-10-13T01:24:26+00:00" + "time": "2026-02-23T03:47:12+00:00" }, { "name": "nette/utils", - "version": "v4.0.0", + "version": "v4.1.5", "source": { "type": "git", "url": "https://github.com/nette/utils.git", - "reference": "cacdbf5a91a657ede665c541eda28941d4b09c1e" + "reference": "b043439dbdf954e6c28b5ea7e34b0100f83165e0" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/nette/utils/zipball/cacdbf5a91a657ede665c541eda28941d4b09c1e", - "reference": "cacdbf5a91a657ede665c541eda28941d4b09c1e", + "url": "https://api.github.com/repos/nette/utils/zipball/b043439dbdf954e6c28b5ea7e34b0100f83165e0", + "reference": "b043439dbdf954e6c28b5ea7e34b0100f83165e0", "shasum": "" }, "require": { - "php": ">=8.0 <8.3" + "php": "8.2 - 8.5" }, "conflict": { "nette/finder": "<3", "nette/schema": "<1.2.2" }, "require-dev": { - "jetbrains/phpstorm-attributes": "dev-master", - "nette/tester": "^2.4", - "phpstan/phpstan": "^1.0", + "jetbrains/phpstorm-attributes": "^1.2", + "nette/phpstan-rules": "^1.0", + "nette/tester": "^2.5", + "phpstan/extension-installer": "^1.4@stable", + "phpstan/phpstan": "^2.1@stable", "tracy/tracy": "^2.9" }, "suggest": { "ext-gd": "to use Image", - "ext-iconv": "to use Strings::webalize(), toAscii(), chr() and reverse()", + "ext-iconv": "to use Strings::chr(), ord() and reverse()", "ext-intl": "to use Strings::webalize(), toAscii(), normalize() and compare()", "ext-json": "to use Nette\\Utils\\Json", "ext-mbstring": "to use Strings::lower() etc...", - "ext-tokenizer": "to use Nette\\Utils\\Reflection::getUseStatements()", - "ext-xml": "to use Strings::length() etc. when mbstring is not available" + "ext-tokenizer": "to use Nette\\Utils\\Reflection::getUseStatements()" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "4.0-dev" + "dev-master": "4.1-dev" } }, "autoload": { + "psr-4": { + "Nette\\": "src" + }, "classmap": [ "src/" ] @@ -3276,41 +3285,36 @@ ], "support": { "issues": "https://github.com/nette/utils/issues", - "source": "https://github.com/nette/utils/tree/v4.0.0" + "source": "https://github.com/nette/utils/tree/v4.1.5" }, - "time": "2023-02-02T10:41:53+00:00" + "time": "2026-07-17T23:02:45+00:00" }, { "name": "nikic/php-parser", - "version": "v4.15.4", + "version": "v4.19.5", "source": { "type": "git", "url": "https://github.com/nikic/PHP-Parser.git", - "reference": "6bb5176bc4af8bcb7d926f88718db9b96a2d4290" + "reference": "51bd93cc741b7fc3d63d20b6bdcd99fdaa359837" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/nikic/PHP-Parser/zipball/6bb5176bc4af8bcb7d926f88718db9b96a2d4290", - "reference": "6bb5176bc4af8bcb7d926f88718db9b96a2d4290", + "url": "https://api.github.com/repos/nikic/PHP-Parser/zipball/51bd93cc741b7fc3d63d20b6bdcd99fdaa359837", + "reference": "51bd93cc741b7fc3d63d20b6bdcd99fdaa359837", "shasum": "" }, "require": { "ext-tokenizer": "*", - "php": ">=7.0" + "php": ">=7.1" }, "require-dev": { "ircmaxell/php-yacc": "^0.0.7", - "phpunit/phpunit": "^6.5 || ^7.0 || ^8.0 || ^9.0" + "phpunit/phpunit": "^7.0 || ^8.0 || ^9.0" }, "bin": [ "bin/php-parse" ], "type": "library", - "extra": { - "branch-alias": { - "dev-master": "4.9-dev" - } - }, "autoload": { "psr-4": { "PhpParser\\": "lib/PhpParser" @@ -3332,9 +3336,9 @@ ], "support": { "issues": "https://github.com/nikic/PHP-Parser/issues", - "source": "https://github.com/nikic/PHP-Parser/tree/v4.15.4" + "source": "https://github.com/nikic/PHP-Parser/tree/v4.19.5" }, - "time": "2023-03-05T19:49:14+00:00" + "time": "2025-12-06T11:45:25+00:00" }, { "name": "nunomaduro/termwind", @@ -3976,16 +3980,16 @@ }, { "name": "psr/log", - "version": "3.0.0", + "version": "3.0.2", "source": { "type": "git", "url": "https://github.com/php-fig/log.git", - "reference": "fe5ea303b0887d5caefd3d431c3e61ad47037001" + "reference": "f16e1d5863e37f8d8c2a01719f5b34baa2b714d3" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/php-fig/log/zipball/fe5ea303b0887d5caefd3d431c3e61ad47037001", - "reference": "fe5ea303b0887d5caefd3d431c3e61ad47037001", + "url": "https://api.github.com/repos/php-fig/log/zipball/f16e1d5863e37f8d8c2a01719f5b34baa2b714d3", + "reference": "f16e1d5863e37f8d8c2a01719f5b34baa2b714d3", "shasum": "" }, "require": { @@ -4020,9 +4024,9 @@ "psr-3" ], "support": { - "source": "https://github.com/php-fig/log/tree/3.0.0" + "source": "https://github.com/php-fig/log/tree/3.0.2" }, - "time": "2021-07-14T16:46:02+00:00" + "time": "2024-09-11T13:17:53+00:00" }, { "name": "psr/simple-cache", @@ -4676,24 +4680,24 @@ }, { "name": "symfony/console", - "version": "v6.2.7", + "version": "v6.4.43", "source": { "type": "git", "url": "https://github.com/symfony/console.git", - "reference": "cbad09eb8925b6ad4fb721c7a179344dc4a19d45" + "reference": "3b643aa587acbc42f967a429af088a56ed8f046d" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/console/zipball/cbad09eb8925b6ad4fb721c7a179344dc4a19d45", - "reference": "cbad09eb8925b6ad4fb721c7a179344dc4a19d45", + "url": "https://api.github.com/repos/symfony/console/zipball/3b643aa587acbc42f967a429af088a56ed8f046d", + "reference": "3b643aa587acbc42f967a429af088a56ed8f046d", "shasum": "" }, "require": { "php": ">=8.1", - "symfony/deprecation-contracts": "^2.1|^3", + "symfony/deprecation-contracts": "^2.5|^3", "symfony/polyfill-mbstring": "~1.0", - "symfony/service-contracts": "^1.1|^2|^3", - "symfony/string": "^5.4|^6.0" + "symfony/service-contracts": "^2.5|^3", + "symfony/string": "^5.4|^6.0|^7.0" }, "conflict": { "symfony/dependency-injection": "<5.4", @@ -4707,18 +4711,16 @@ }, "require-dev": { "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", - "symfony/event-dispatcher": "", - "symfony/lock": "", - "symfony/process": "" + "symfony/config": "^5.4|^6.0|^7.0", + "symfony/dependency-injection": "^5.4|^6.0|^7.0", + "symfony/event-dispatcher": "^5.4|^6.0|^7.0", + "symfony/http-foundation": "^6.4|^7.0", + "symfony/http-kernel": "^6.4|^7.0", + "symfony/lock": "^5.4|^6.0|^7.0", + "symfony/messenger": "^5.4|^6.0|^7.0", + "symfony/process": "^5.4|^6.0|^7.0", + "symfony/stopwatch": "^5.4|^6.0|^7.0", + "symfony/var-dumper": "^5.4|^6.0|^7.0" }, "type": "library", "autoload": { @@ -4747,12 +4749,12 @@ "homepage": "https://symfony.com", "keywords": [ "cli", - "command line", + "command-line", "console", "terminal" ], "support": { - "source": "https://github.com/symfony/console/tree/v6.2.7" + "source": "https://github.com/symfony/console/tree/v6.4.43" }, "funding": [ { @@ -4763,12 +4765,16 @@ "url": "https://github.com/fabpot", "type": "github" }, + { + "url": "https://github.com/nicolas-grekas", + "type": "github" + }, { "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", "type": "tidelift" } ], - "time": "2023-02-25T17:00:03+00:00" + "time": "2026-07-26T14:44:19+00:00" }, { "name": "symfony/css-selector", @@ -4837,16 +4843,16 @@ }, { "name": "symfony/deprecation-contracts", - "version": "v3.2.1", + "version": "v3.7.1", "source": { "type": "git", "url": "https://github.com/symfony/deprecation-contracts.git", - "reference": "e2d1534420bd723d0ef5aec58a22c5fe60ce6f5e" + "reference": "f3202fa1b5097b0af062dc978b32ecf63404e31d" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/deprecation-contracts/zipball/e2d1534420bd723d0ef5aec58a22c5fe60ce6f5e", - "reference": "e2d1534420bd723d0ef5aec58a22c5fe60ce6f5e", + "url": "https://api.github.com/repos/symfony/deprecation-contracts/zipball/f3202fa1b5097b0af062dc978b32ecf63404e31d", + "reference": "f3202fa1b5097b0af062dc978b32ecf63404e31d", "shasum": "" }, "require": { @@ -4854,12 +4860,12 @@ }, "type": "library", "extra": { - "branch-alias": { - "dev-main": "3.3-dev" - }, "thanks": { - "name": "symfony/contracts", - "url": "https://github.com/symfony/contracts" + "url": "https://github.com/symfony/contracts", + "name": "symfony/contracts" + }, + "branch-alias": { + "dev-main": "3.7-dev" } }, "autoload": { @@ -4884,7 +4890,7 @@ "description": "A generic function and convention to trigger deprecation notices", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/deprecation-contracts/tree/v3.2.1" + "source": "https://github.com/symfony/deprecation-contracts/tree/v3.7.1" }, "funding": [ { @@ -4895,12 +4901,16 @@ "url": "https://github.com/fabpot", "type": "github" }, + { + "url": "https://github.com/nicolas-grekas", + "type": "github" + }, { "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", "type": "tidelift" } ], - "time": "2023-03-01T10:25:55+00:00" + "time": "2026-06-05T06:23:12+00:00" }, { "name": "symfony/error-handler", @@ -5058,33 +5068,30 @@ }, { "name": "symfony/event-dispatcher-contracts", - "version": "v3.2.1", + "version": "v3.7.1", "source": { "type": "git", "url": "https://github.com/symfony/event-dispatcher-contracts.git", - "reference": "0ad3b6f1e4e2da5690fefe075cd53a238646d8dd" + "reference": "c7de7a00ffb67842132da02ea92988a39ccd9f4e" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/event-dispatcher-contracts/zipball/0ad3b6f1e4e2da5690fefe075cd53a238646d8dd", - "reference": "0ad3b6f1e4e2da5690fefe075cd53a238646d8dd", + "url": "https://api.github.com/repos/symfony/event-dispatcher-contracts/zipball/c7de7a00ffb67842132da02ea92988a39ccd9f4e", + "reference": "c7de7a00ffb67842132da02ea92988a39ccd9f4e", "shasum": "" }, "require": { "php": ">=8.1", "psr/event-dispatcher": "^1" }, - "suggest": { - "symfony/event-dispatcher-implementation": "" - }, "type": "library", "extra": { - "branch-alias": { - "dev-main": "3.3-dev" - }, "thanks": { - "name": "symfony/contracts", - "url": "https://github.com/symfony/contracts" + "url": "https://github.com/symfony/contracts", + "name": "symfony/contracts" + }, + "branch-alias": { + "dev-main": "3.7-dev" } }, "autoload": { @@ -5117,7 +5124,7 @@ "standards" ], "support": { - "source": "https://github.com/symfony/event-dispatcher-contracts/tree/v3.2.1" + "source": "https://github.com/symfony/event-dispatcher-contracts/tree/v3.7.1" }, "funding": [ { @@ -5128,12 +5135,16 @@ "url": "https://github.com/fabpot", "type": "github" }, + { + "url": "https://github.com/nicolas-grekas", + "type": "github" + }, { "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", "type": "tidelift" } ], - "time": "2023-03-01T10:32:47+00:00" + "time": "2026-06-05T06:23:12+00:00" }, { "name": "symfony/filesystem", @@ -5622,20 +5633,20 @@ }, { "name": "symfony/polyfill-ctype", - "version": "v1.27.0", + "version": "v1.37.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-ctype.git", - "reference": "5bbc823adecdae860bb64756d639ecfec17b050a" + "reference": "141046a8f9477948ff284fa65be2095baafb94f2" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-ctype/zipball/5bbc823adecdae860bb64756d639ecfec17b050a", - "reference": "5bbc823adecdae860bb64756d639ecfec17b050a", + "url": "https://api.github.com/repos/symfony/polyfill-ctype/zipball/141046a8f9477948ff284fa65be2095baafb94f2", + "reference": "141046a8f9477948ff284fa65be2095baafb94f2", "shasum": "" }, "require": { - "php": ">=7.1" + "php": ">=7.2" }, "provide": { "ext-ctype": "*" @@ -5645,12 +5656,9 @@ }, "type": "library", "extra": { - "branch-alias": { - "dev-main": "1.27-dev" - }, "thanks": { - "name": "symfony/polyfill", - "url": "https://github.com/symfony/polyfill" + "url": "https://github.com/symfony/polyfill", + "name": "symfony/polyfill" } }, "autoload": { @@ -5684,7 +5692,7 @@ "portable" ], "support": { - "source": "https://github.com/symfony/polyfill-ctype/tree/v1.27.0" + "source": "https://github.com/symfony/polyfill-ctype/tree/v1.37.0" }, "funding": [ { @@ -5695,41 +5703,42 @@ "url": "https://github.com/fabpot", "type": "github" }, + { + "url": "https://github.com/nicolas-grekas", + "type": "github" + }, { "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", "type": "tidelift" } ], - "time": "2022-11-03T14:55:06+00:00" + "time": "2026-04-10T16:19:22+00:00" }, { "name": "symfony/polyfill-intl-grapheme", - "version": "v1.27.0", + "version": "v1.41.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-intl-grapheme.git", - "reference": "511a08c03c1960e08a883f4cffcacd219b758354" + "reference": "bb899c1db0aa8127dc3afe8cda4a67eb24915f8d" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-intl-grapheme/zipball/511a08c03c1960e08a883f4cffcacd219b758354", - "reference": "511a08c03c1960e08a883f4cffcacd219b758354", + "url": "https://api.github.com/repos/symfony/polyfill-intl-grapheme/zipball/bb899c1db0aa8127dc3afe8cda4a67eb24915f8d", + "reference": "bb899c1db0aa8127dc3afe8cda4a67eb24915f8d", "shasum": "" }, "require": { - "php": ">=7.1" + "php": ">=7.2" }, "suggest": { "ext-intl": "For best performance" }, "type": "library", "extra": { - "branch-alias": { - "dev-main": "1.27-dev" - }, "thanks": { - "name": "symfony/polyfill", - "url": "https://github.com/symfony/polyfill" + "url": "https://github.com/symfony/polyfill", + "name": "symfony/polyfill" } }, "autoload": { @@ -5765,7 +5774,7 @@ "shim" ], "support": { - "source": "https://github.com/symfony/polyfill-intl-grapheme/tree/v1.27.0" + "source": "https://github.com/symfony/polyfill-intl-grapheme/tree/v1.41.0" }, "funding": [ { @@ -5776,12 +5785,16 @@ "url": "https://github.com/fabpot", "type": "github" }, + { + "url": "https://github.com/nicolas-grekas", + "type": "github" + }, { "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", "type": "tidelift" } ], - "time": "2022-11-03T14:55:06+00:00" + "time": "2026-07-28T08:25:59+00:00" }, { "name": "symfony/polyfill-intl-idn", @@ -5872,32 +5885,29 @@ }, { "name": "symfony/polyfill-intl-normalizer", - "version": "v1.27.0", + "version": "v1.38.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-intl-normalizer.git", - "reference": "19bd1e4fcd5b91116f14d8533c57831ed00571b6" + "reference": "2d446c214bdbe5b71bde5011b060a05fece3ae6b" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-intl-normalizer/zipball/19bd1e4fcd5b91116f14d8533c57831ed00571b6", - "reference": "19bd1e4fcd5b91116f14d8533c57831ed00571b6", + "url": "https://api.github.com/repos/symfony/polyfill-intl-normalizer/zipball/2d446c214bdbe5b71bde5011b060a05fece3ae6b", + "reference": "2d446c214bdbe5b71bde5011b060a05fece3ae6b", "shasum": "" }, "require": { - "php": ">=7.1" + "php": ">=7.2" }, "suggest": { "ext-intl": "For best performance" }, "type": "library", "extra": { - "branch-alias": { - "dev-main": "1.27-dev" - }, "thanks": { - "name": "symfony/polyfill", - "url": "https://github.com/symfony/polyfill" + "url": "https://github.com/symfony/polyfill", + "name": "symfony/polyfill" } }, "autoload": { @@ -5936,7 +5946,7 @@ "shim" ], "support": { - "source": "https://github.com/symfony/polyfill-intl-normalizer/tree/v1.27.0" + "source": "https://github.com/symfony/polyfill-intl-normalizer/tree/v1.38.0" }, "funding": [ { @@ -5947,29 +5957,34 @@ "url": "https://github.com/fabpot", "type": "github" }, + { + "url": "https://github.com/nicolas-grekas", + "type": "github" + }, { "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", "type": "tidelift" } ], - "time": "2022-11-03T14:55:06+00:00" + "time": "2026-05-25T13:48:31+00:00" }, { "name": "symfony/polyfill-mbstring", - "version": "v1.27.0", + "version": "v1.38.2", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-mbstring.git", - "reference": "8ad114f6b39e2c98a8b0e3bd907732c207c2b534" + "reference": "d3d318bad5e7a1bfbd026009c8bfb8d8f99ae6b6" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/8ad114f6b39e2c98a8b0e3bd907732c207c2b534", - "reference": "8ad114f6b39e2c98a8b0e3bd907732c207c2b534", + "url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/d3d318bad5e7a1bfbd026009c8bfb8d8f99ae6b6", + "reference": "d3d318bad5e7a1bfbd026009c8bfb8d8f99ae6b6", "shasum": "" }, "require": { - "php": ">=7.1" + "ext-iconv": "*", + "php": ">=7.2" }, "provide": { "ext-mbstring": "*" @@ -5979,12 +5994,9 @@ }, "type": "library", "extra": { - "branch-alias": { - "dev-main": "1.27-dev" - }, "thanks": { - "name": "symfony/polyfill", - "url": "https://github.com/symfony/polyfill" + "url": "https://github.com/symfony/polyfill", + "name": "symfony/polyfill" } }, "autoload": { @@ -6019,7 +6031,7 @@ "shim" ], "support": { - "source": "https://github.com/symfony/polyfill-mbstring/tree/v1.27.0" + "source": "https://github.com/symfony/polyfill-mbstring/tree/v1.38.2" }, "funding": [ { @@ -6030,12 +6042,16 @@ "url": "https://github.com/fabpot", "type": "github" }, + { + "url": "https://github.com/nicolas-grekas", + "type": "github" + }, { "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", "type": "tidelift" } ], - "time": "2022-11-03T14:55:06+00:00" + "time": "2026-05-27T06:59:30+00:00" }, { "name": "symfony/polyfill-php72", @@ -6115,29 +6131,26 @@ }, { "name": "symfony/polyfill-php80", - "version": "v1.27.0", + "version": "v1.37.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-php80.git", - "reference": "7a6ff3f1959bb01aefccb463a0f2cd3d3d2fd936" + "reference": "dfb55726c3a76ea3b6459fcfda1ec2d80a682411" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-php80/zipball/7a6ff3f1959bb01aefccb463a0f2cd3d3d2fd936", - "reference": "7a6ff3f1959bb01aefccb463a0f2cd3d3d2fd936", + "url": "https://api.github.com/repos/symfony/polyfill-php80/zipball/dfb55726c3a76ea3b6459fcfda1ec2d80a682411", + "reference": "dfb55726c3a76ea3b6459fcfda1ec2d80a682411", "shasum": "" }, "require": { - "php": ">=7.1" + "php": ">=7.2" }, "type": "library", "extra": { - "branch-alias": { - "dev-main": "1.27-dev" - }, "thanks": { - "name": "symfony/polyfill", - "url": "https://github.com/symfony/polyfill" + "url": "https://github.com/symfony/polyfill", + "name": "symfony/polyfill" } }, "autoload": { @@ -6178,7 +6191,7 @@ "shim" ], "support": { - "source": "https://github.com/symfony/polyfill-php80/tree/v1.27.0" + "source": "https://github.com/symfony/polyfill-php80/tree/v1.37.0" }, "funding": [ { @@ -6189,12 +6202,16 @@ "url": "https://github.com/fabpot", "type": "github" }, + { + "url": "https://github.com/nicolas-grekas", + "type": "github" + }, { "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", "type": "tidelift" } ], - "time": "2022-11-03T14:55:06+00:00" + "time": "2026-04-10T16:19:22+00:00" }, { "name": "symfony/polyfill-uuid", @@ -6280,16 +6297,16 @@ }, { "name": "symfony/process", - "version": "v6.2.7", + "version": "v6.4.41", "source": { "type": "git", "url": "https://github.com/symfony/process.git", - "reference": "680e8a2ea6b3f87aecc07a6a65a203ae573d1902" + "reference": "c8fc09bdfe9fde9aaa89b415a4477feaccec16a7" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/process/zipball/680e8a2ea6b3f87aecc07a6a65a203ae573d1902", - "reference": "680e8a2ea6b3f87aecc07a6a65a203ae573d1902", + "url": "https://api.github.com/repos/symfony/process/zipball/c8fc09bdfe9fde9aaa89b415a4477feaccec16a7", + "reference": "c8fc09bdfe9fde9aaa89b415a4477feaccec16a7", "shasum": "" }, "require": { @@ -6321,7 +6338,7 @@ "description": "Executes commands in sub-processes", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/process/tree/v6.2.7" + "source": "https://github.com/symfony/process/tree/v6.4.41" }, "funding": [ { @@ -6332,12 +6349,16 @@ "url": "https://github.com/fabpot", "type": "github" }, + { + "url": "https://github.com/nicolas-grekas", + "type": "github" + }, { "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", "type": "tidelift" } ], - "time": "2023-02-24T10:42:00+00:00" + "time": "2026-05-23T13:47:21+00:00" }, { "name": "symfony/routing", @@ -6429,36 +6450,34 @@ }, { "name": "symfony/service-contracts", - "version": "v3.2.1", + "version": "v3.7.1", "source": { "type": "git", "url": "https://github.com/symfony/service-contracts.git", - "reference": "a8c9cedf55f314f3a186041d19537303766df09a" + "reference": "c0a284bab1ed8aa0417e3d69250ab437739563a0" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/service-contracts/zipball/a8c9cedf55f314f3a186041d19537303766df09a", - "reference": "a8c9cedf55f314f3a186041d19537303766df09a", + "url": "https://api.github.com/repos/symfony/service-contracts/zipball/c0a284bab1ed8aa0417e3d69250ab437739563a0", + "reference": "c0a284bab1ed8aa0417e3d69250ab437739563a0", "shasum": "" }, "require": { "php": ">=8.1", - "psr/container": "^2.0" + "psr/container": "^1.1|^2.0", + "symfony/deprecation-contracts": "^2.5|^3" }, "conflict": { "ext-psr": "<1.1|>=2" }, - "suggest": { - "symfony/service-implementation": "" - }, "type": "library", "extra": { - "branch-alias": { - "dev-main": "3.3-dev" - }, "thanks": { - "name": "symfony/contracts", - "url": "https://github.com/symfony/contracts" + "url": "https://github.com/symfony/contracts", + "name": "symfony/contracts" + }, + "branch-alias": { + "dev-main": "3.7-dev" } }, "autoload": { @@ -6494,7 +6513,7 @@ "standards" ], "support": { - "source": "https://github.com/symfony/service-contracts/tree/v3.2.1" + "source": "https://github.com/symfony/service-contracts/tree/v3.7.1" }, "funding": [ { @@ -6505,43 +6524,48 @@ "url": "https://github.com/fabpot", "type": "github" }, + { + "url": "https://github.com/nicolas-grekas", + "type": "github" + }, { "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", "type": "tidelift" } ], - "time": "2023-03-01T10:32:47+00:00" + "time": "2026-06-16T09:55:08+00:00" }, { "name": "symfony/string", - "version": "v6.2.7", + "version": "v7.4.15", "source": { "type": "git", "url": "https://github.com/symfony/string.git", - "reference": "67b8c1eec78296b85dc1c7d9743830160218993d" + "reference": "e394af32256bf9e7bf80849d95e589167c10097b" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/string/zipball/67b8c1eec78296b85dc1c7d9743830160218993d", - "reference": "67b8c1eec78296b85dc1c7d9743830160218993d", + "url": "https://api.github.com/repos/symfony/string/zipball/e394af32256bf9e7bf80849d95e589167c10097b", + "reference": "e394af32256bf9e7bf80849d95e589167c10097b", "shasum": "" }, "require": { - "php": ">=8.1", + "php": ">=8.2", + "symfony/deprecation-contracts": "^2.5|^3.0", "symfony/polyfill-ctype": "~1.8", - "symfony/polyfill-intl-grapheme": "~1.0", + "symfony/polyfill-intl-grapheme": "~1.33", "symfony/polyfill-intl-normalizer": "~1.0", "symfony/polyfill-mbstring": "~1.0" }, "conflict": { - "symfony/translation-contracts": "<2.0" + "symfony/translation-contracts": "<2.5" }, "require-dev": { - "symfony/error-handler": "^5.4|^6.0", - "symfony/http-client": "^5.4|^6.0", - "symfony/intl": "^6.2", - "symfony/translation-contracts": "^2.0|^3.0", - "symfony/var-exporter": "^5.4|^6.0" + "symfony/emoji": "^7.1|^8.0", + "symfony/http-client": "^6.4|^7.0|^8.0", + "symfony/intl": "^6.4|^7.0|^8.0", + "symfony/translation-contracts": "^2.5|^3.0", + "symfony/var-exporter": "^6.4|^7.0|^8.0" }, "type": "library", "autoload": { @@ -6580,7 +6604,7 @@ "utf8" ], "support": { - "source": "https://github.com/symfony/string/tree/v6.2.7" + "source": "https://github.com/symfony/string/tree/v7.4.15" }, "funding": [ { @@ -6591,12 +6615,16 @@ "url": "https://github.com/fabpot", "type": "github" }, + { + "url": "https://github.com/nicolas-grekas", + "type": "github" + }, { "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", "type": "tidelift" } ], - "time": "2023-02-24T10:42:00+00:00" + "time": "2026-07-28T07:33:02+00:00" }, { "name": "symfony/translation", @@ -6698,32 +6726,29 @@ }, { "name": "symfony/translation-contracts", - "version": "v3.2.1", + "version": "v3.7.1", "source": { "type": "git", "url": "https://github.com/symfony/translation-contracts.git", - "reference": "dfec258b9dd17a6b24420d464c43bffe347441c8" + "reference": "ccb206b98faccc511ebae8e5fad50f2dc0b30621" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/translation-contracts/zipball/dfec258b9dd17a6b24420d464c43bffe347441c8", - "reference": "dfec258b9dd17a6b24420d464c43bffe347441c8", + "url": "https://api.github.com/repos/symfony/translation-contracts/zipball/ccb206b98faccc511ebae8e5fad50f2dc0b30621", + "reference": "ccb206b98faccc511ebae8e5fad50f2dc0b30621", "shasum": "" }, "require": { "php": ">=8.1" }, - "suggest": { - "symfony/translation-implementation": "" - }, "type": "library", "extra": { - "branch-alias": { - "dev-main": "3.3-dev" - }, "thanks": { - "name": "symfony/contracts", - "url": "https://github.com/symfony/contracts" + "url": "https://github.com/symfony/contracts", + "name": "symfony/contracts" + }, + "branch-alias": { + "dev-main": "3.7-dev" } }, "autoload": { @@ -6759,7 +6784,7 @@ "standards" ], "support": { - "source": "https://github.com/symfony/translation-contracts/tree/v3.2.1" + "source": "https://github.com/symfony/translation-contracts/tree/v3.7.1" }, "funding": [ { @@ -6770,12 +6795,16 @@ "url": "https://github.com/fabpot", "type": "github" }, + { + "url": "https://github.com/nicolas-grekas", + "type": "github" + }, { "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", "type": "tidelift" } ], - "time": "2023-03-01T10:32:47+00:00" + "time": "2026-06-05T06:23:12+00:00" }, { "name": "symfony/uid", @@ -7672,16 +7701,16 @@ }, { "name": "brianium/paratest", - "version": "v7.1.1", + "version": "v7.4.9", "source": { "type": "git", "url": "https://github.com/paratestphp/paratest.git", - "reference": "abc123183e90f33ce1312b5bfaa49d80d8c646b2" + "reference": "633c0987ecf6d9b057431225da37b088aa9274a5" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/paratestphp/paratest/zipball/abc123183e90f33ce1312b5bfaa49d80d8c646b2", - "reference": "abc123183e90f33ce1312b5bfaa49d80d8c646b2", + "url": "https://api.github.com/repos/paratestphp/paratest/zipball/633c0987ecf6d9b057431225da37b088aa9274a5", + "reference": "633c0987ecf6d9b057431225da37b088aa9274a5", "shasum": "" }, "require": { @@ -7689,32 +7718,30 @@ "ext-pcre": "*", "ext-reflection": "*", "ext-simplexml": "*", - "fidry/cpu-core-counter": "^0.4.1 || ^0.5.1", - "jean85/pretty-package-versions": "^2.0.5", - "php": "~8.1.0 || ~8.2.0", - "phpunit/php-code-coverage": "^10.0.2", - "phpunit/php-file-iterator": "^4.0.1", - "phpunit/php-timer": "^6.0", - "phpunit/phpunit": "^10.0.16", - "sebastian/environment": "^6.0", - "symfony/console": "^6.2.7", - "symfony/process": "^6.2.7" + "fidry/cpu-core-counter": "^1.2.0", + "jean85/pretty-package-versions": "^2.0.6", + "php": "~8.2.0 || ~8.3.0 || ~8.4.0", + "phpunit/php-code-coverage": "^10.1.16", + "phpunit/php-file-iterator": "^4.1.0", + "phpunit/php-timer": "^6.0.0", + "phpunit/phpunit": "^10.5.47", + "sebastian/environment": "^6.1.0", + "symfony/console": "^6.4.7 || ^7.1.5", + "symfony/process": "^6.4.7 || ^7.1.5" }, "require-dev": { - "doctrine/coding-standard": "^11.1.0", + "doctrine/coding-standard": "^12.0.0", "ext-pcov": "*", "ext-posix": "*", - "infection/infection": "^0.26.19", - "phpstan/phpstan": "^1.10.6", - "phpstan/phpstan-deprecation-rules": "^1.1.2", - "phpstan/phpstan-phpunit": "^1.3.10", - "phpstan/phpstan-strict-rules": "^1.5", - "squizlabs/php_codesniffer": "^3.7.2", - "symfony/filesystem": "^6.2.7" + "phpstan/phpstan": "^1.12.6", + "phpstan/phpstan-deprecation-rules": "^1.2.1", + "phpstan/phpstan-phpunit": "^1.4.0", + "phpstan/phpstan-strict-rules": "^1.6.1", + "squizlabs/php_codesniffer": "^3.10.3", + "symfony/filesystem": "^6.4.3 || ^7.1.5" }, "bin": [ "bin/paratest", - "bin/paratest.bat", "bin/paratest_for_phpstorm" ], "type": "library", @@ -7751,7 +7778,7 @@ ], "support": { "issues": "https://github.com/paratestphp/paratest/issues", - "source": "https://github.com/paratestphp/paratest/tree/v7.1.1" + "source": "https://github.com/paratestphp/paratest/tree/v7.4.9" }, "funding": [ { @@ -7763,7 +7790,7 @@ "type": "paypal" } ], - "time": "2023-03-13T10:11:07+00:00" + "time": "2025-06-25T06:09:59+00:00" }, { "name": "composer/class-map-generator", @@ -8318,16 +8345,16 @@ }, { "name": "fidry/cpu-core-counter", - "version": "0.5.1", + "version": "1.3.0", "source": { "type": "git", "url": "https://github.com/theofidry/cpu-core-counter.git", - "reference": "b58e5a3933e541dc286cc91fc4f3898bbc6f1623" + "reference": "db9508f7b1474469d9d3c53b86f817e344732678" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/theofidry/cpu-core-counter/zipball/b58e5a3933e541dc286cc91fc4f3898bbc6f1623", - "reference": "b58e5a3933e541dc286cc91fc4f3898bbc6f1623", + "url": "https://api.github.com/repos/theofidry/cpu-core-counter/zipball/db9508f7b1474469d9d3c53b86f817e344732678", + "reference": "db9508f7b1474469d9d3c53b86f817e344732678", "shasum": "" }, "require": { @@ -8335,13 +8362,13 @@ }, "require-dev": { "fidry/makefile": "^0.2.0", + "fidry/php-cs-fixer-config": "^1.1.2", "phpstan/extension-installer": "^1.2.0", - "phpstan/phpstan": "^1.9.2", - "phpstan/phpstan-deprecation-rules": "^1.0.0", - "phpstan/phpstan-phpunit": "^1.2.2", - "phpstan/phpstan-strict-rules": "^1.4.4", - "phpunit/phpunit": "^9.5.26 || ^8.5.31", - "theofidry/php-cs-fixer-config": "^1.0", + "phpstan/phpstan": "^2.0", + "phpstan/phpstan-deprecation-rules": "^2.0.0", + "phpstan/phpstan-phpunit": "^2.0", + "phpstan/phpstan-strict-rules": "^2.0", + "phpunit/phpunit": "^8.5.31 || ^9.5.26", "webmozarts/strict-phpunit": "^7.5" }, "type": "library", @@ -8367,7 +8394,7 @@ ], "support": { "issues": "https://github.com/theofidry/cpu-core-counter/issues", - "source": "https://github.com/theofidry/cpu-core-counter/tree/0.5.1" + "source": "https://github.com/theofidry/cpu-core-counter/tree/1.3.0" }, "funding": [ { @@ -8375,7 +8402,7 @@ "type": "github" } ], - "time": "2022-12-24T12:35:10+00:00" + "time": "2025-08-14T07:29:31+00:00" }, { "name": "filp/whoops", @@ -8501,28 +8528,29 @@ }, { "name": "jean85/pretty-package-versions", - "version": "2.0.5", + "version": "2.1.1", "source": { "type": "git", "url": "https://github.com/Jean85/pretty-package-versions.git", - "reference": "ae547e455a3d8babd07b96966b17d7fd21d9c6af" + "reference": "4d7aa5dab42e2a76d99559706022885de0e18e1a" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/Jean85/pretty-package-versions/zipball/ae547e455a3d8babd07b96966b17d7fd21d9c6af", - "reference": "ae547e455a3d8babd07b96966b17d7fd21d9c6af", + "url": "https://api.github.com/repos/Jean85/pretty-package-versions/zipball/4d7aa5dab42e2a76d99559706022885de0e18e1a", + "reference": "4d7aa5dab42e2a76d99559706022885de0e18e1a", "shasum": "" }, "require": { - "composer-runtime-api": "^2.0.0", - "php": "^7.1|^8.0" + "composer-runtime-api": "^2.1.0", + "php": "^7.4|^8.0" }, "require-dev": { - "friendsofphp/php-cs-fixer": "^2.17", + "friendsofphp/php-cs-fixer": "^3.2", "jean85/composer-provided-replaced-stub-package": "^1.0", - "phpstan/phpstan": "^0.12.66", - "phpunit/phpunit": "^7.5|^8.5|^9.4", - "vimeo/psalm": "^4.3" + "phpstan/phpstan": "^2.0", + "phpunit/phpunit": "^7.5|^8.5|^9.6", + "rector/rector": "^2.0", + "vimeo/psalm": "^4.3 || ^5.0" }, "type": "library", "extra": { @@ -8554,9 +8582,9 @@ ], "support": { "issues": "https://github.com/Jean85/pretty-package-versions/issues", - "source": "https://github.com/Jean85/pretty-package-versions/tree/2.0.5" + "source": "https://github.com/Jean85/pretty-package-versions/tree/2.1.1" }, - "time": "2021-10-08T21:21:46+00:00" + "time": "2025-03-19T14:43:43+00:00" }, { "name": "laravel/sail", @@ -8763,16 +8791,16 @@ }, { "name": "myclabs/deep-copy", - "version": "1.11.1", + "version": "1.13.4", "source": { "type": "git", "url": "https://github.com/myclabs/DeepCopy.git", - "reference": "7284c22080590fb39f2ffa3e9057f10a4ddd0e0c" + "reference": "07d290f0c47959fd5eed98c95ee5602db07e0b6a" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/myclabs/DeepCopy/zipball/7284c22080590fb39f2ffa3e9057f10a4ddd0e0c", - "reference": "7284c22080590fb39f2ffa3e9057f10a4ddd0e0c", + "url": "https://api.github.com/repos/myclabs/DeepCopy/zipball/07d290f0c47959fd5eed98c95ee5602db07e0b6a", + "reference": "07d290f0c47959fd5eed98c95ee5602db07e0b6a", "shasum": "" }, "require": { @@ -8780,11 +8808,12 @@ }, "conflict": { "doctrine/collections": "<1.6.8", - "doctrine/common": "<2.13.3 || >=3,<3.2.2" + "doctrine/common": "<2.13.3 || >=3 <3.2.2" }, "require-dev": { "doctrine/collections": "^1.6.8", "doctrine/common": "^2.13.3 || ^3.2.2", + "phpspec/prophecy": "^1.10", "phpunit/phpunit": "^7.5.20 || ^8.5.23 || ^9.5.13" }, "type": "library", @@ -8810,7 +8839,7 @@ ], "support": { "issues": "https://github.com/myclabs/DeepCopy/issues", - "source": "https://github.com/myclabs/DeepCopy/tree/1.11.1" + "source": "https://github.com/myclabs/DeepCopy/tree/1.13.4" }, "funding": [ { @@ -8818,7 +8847,7 @@ "type": "tidelift" } ], - "time": "2023-03-08T13:26:56+00:00" + "time": "2025-08-01T08:46:24+00:00" }, { "name": "nunomaduro/collision", @@ -8918,20 +8947,21 @@ }, { "name": "phar-io/manifest", - "version": "2.0.3", + "version": "2.0.4", "source": { "type": "git", "url": "https://github.com/phar-io/manifest.git", - "reference": "97803eca37d319dfa7826cc2437fc020857acb53" + "reference": "54750ef60c58e43759730615a392c31c80e23176" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phar-io/manifest/zipball/97803eca37d319dfa7826cc2437fc020857acb53", - "reference": "97803eca37d319dfa7826cc2437fc020857acb53", + "url": "https://api.github.com/repos/phar-io/manifest/zipball/54750ef60c58e43759730615a392c31c80e23176", + "reference": "54750ef60c58e43759730615a392c31c80e23176", "shasum": "" }, "require": { "ext-dom": "*", + "ext-libxml": "*", "ext-phar": "*", "ext-xmlwriter": "*", "phar-io/version": "^3.0.1", @@ -8972,9 +9002,15 @@ "description": "Component for reading phar.io manifest information from a PHP Archive (PHAR)", "support": { "issues": "https://github.com/phar-io/manifest/issues", - "source": "https://github.com/phar-io/manifest/tree/2.0.3" + "source": "https://github.com/phar-io/manifest/tree/2.0.4" }, - "time": "2021-07-20T11:28:43+00:00" + "funding": [ + { + "url": "https://github.com/theseer", + "type": "github" + } + ], + "time": "2024-03-03T12:33:53+00:00" }, { "name": "phar-io/version", @@ -9137,35 +9173,35 @@ }, { "name": "phpunit/php-code-coverage", - "version": "10.0.2", + "version": "10.1.16", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/php-code-coverage.git", - "reference": "20800e84296ea4732f9a125e08ce86b4004ae3e4" + "reference": "7e308268858ed6baedc8704a304727d20bc07c77" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/20800e84296ea4732f9a125e08ce86b4004ae3e4", - "reference": "20800e84296ea4732f9a125e08ce86b4004ae3e4", + "url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/7e308268858ed6baedc8704a304727d20bc07c77", + "reference": "7e308268858ed6baedc8704a304727d20bc07c77", "shasum": "" }, "require": { "ext-dom": "*", "ext-libxml": "*", "ext-xmlwriter": "*", - "nikic/php-parser": "^4.15", + "nikic/php-parser": "^4.19.1 || ^5.1.0", "php": ">=8.1", - "phpunit/php-file-iterator": "^4.0", - "phpunit/php-text-template": "^3.0", - "sebastian/code-unit-reverse-lookup": "^3.0", - "sebastian/complexity": "^3.0", - "sebastian/environment": "^6.0", - "sebastian/lines-of-code": "^2.0", - "sebastian/version": "^4.0", - "theseer/tokenizer": "^1.2.0" + "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": "^10.0" + "phpunit/phpunit": "^10.1" }, "suggest": { "ext-pcov": "PHP extension that provides line coverage", @@ -9174,7 +9210,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-main": "10.0-dev" + "dev-main": "10.1.x-dev" } }, "autoload": { @@ -9202,7 +9238,8 @@ ], "support": { "issues": "https://github.com/sebastianbergmann/php-code-coverage/issues", - "source": "https://github.com/sebastianbergmann/php-code-coverage/tree/10.0.2" + "security": "https://github.com/sebastianbergmann/php-code-coverage/security/policy", + "source": "https://github.com/sebastianbergmann/php-code-coverage/tree/10.1.16" }, "funding": [ { @@ -9210,20 +9247,20 @@ "type": "github" } ], - "time": "2023-03-06T13:00:19+00:00" + "time": "2024-08-22T04:31:57+00:00" }, { "name": "phpunit/php-file-iterator", - "version": "4.0.1", + "version": "4.1.0", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/php-file-iterator.git", - "reference": "fd9329ab3368f59fe1fe808a189c51086bd4b6bd" + "reference": "a95037b6d9e608ba092da1b23931e537cadc3c3c" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-file-iterator/zipball/fd9329ab3368f59fe1fe808a189c51086bd4b6bd", - "reference": "fd9329ab3368f59fe1fe808a189c51086bd4b6bd", + "url": "https://api.github.com/repos/sebastianbergmann/php-file-iterator/zipball/a95037b6d9e608ba092da1b23931e537cadc3c3c", + "reference": "a95037b6d9e608ba092da1b23931e537cadc3c3c", "shasum": "" }, "require": { @@ -9262,7 +9299,8 @@ ], "support": { "issues": "https://github.com/sebastianbergmann/php-file-iterator/issues", - "source": "https://github.com/sebastianbergmann/php-file-iterator/tree/4.0.1" + "security": "https://github.com/sebastianbergmann/php-file-iterator/security/policy", + "source": "https://github.com/sebastianbergmann/php-file-iterator/tree/4.1.0" }, "funding": [ { @@ -9270,7 +9308,7 @@ "type": "github" } ], - "time": "2023-02-10T16:53:14+00:00" + "time": "2023-08-31T06:24:48+00:00" }, { "name": "phpunit/php-invoker", @@ -9337,16 +9375,16 @@ }, { "name": "phpunit/php-text-template", - "version": "3.0.0", + "version": "3.0.1", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/php-text-template.git", - "reference": "9f3d3709577a527025f55bcf0f7ab8052c8bb37d" + "reference": "0c7b06ff49e3d5072f057eb1fa59258bf287a748" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-text-template/zipball/9f3d3709577a527025f55bcf0f7ab8052c8bb37d", - "reference": "9f3d3709577a527025f55bcf0f7ab8052c8bb37d", + "url": "https://api.github.com/repos/sebastianbergmann/php-text-template/zipball/0c7b06ff49e3d5072f057eb1fa59258bf287a748", + "reference": "0c7b06ff49e3d5072f057eb1fa59258bf287a748", "shasum": "" }, "require": { @@ -9384,7 +9422,8 @@ ], "support": { "issues": "https://github.com/sebastianbergmann/php-text-template/issues", - "source": "https://github.com/sebastianbergmann/php-text-template/tree/3.0.0" + "security": "https://github.com/sebastianbergmann/php-text-template/security/policy", + "source": "https://github.com/sebastianbergmann/php-text-template/tree/3.0.1" }, "funding": [ { @@ -9392,7 +9431,7 @@ "type": "github" } ], - "time": "2023-02-03T06:56:46+00:00" + "time": "2023-08-31T14:07:24+00:00" }, { "name": "phpunit/php-timer", @@ -9455,45 +9494,45 @@ }, { "name": "phpunit/phpunit", - "version": "10.0.16", + "version": "10.5.64", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/phpunit.git", - "reference": "07d386a11ac7094032900f07cada1c8975d16607" + "reference": "0e8c1d19cea35ad97d4887f363d07c78e30fbf06" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/07d386a11ac7094032900f07cada1c8975d16607", - "reference": "07d386a11ac7094032900f07cada1c8975d16607", + "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/0e8c1d19cea35ad97d4887f363d07c78e30fbf06", + "reference": "0e8c1d19cea35ad97d4887f363d07c78e30fbf06", "shasum": "" }, "require": { "ext-dom": "*", + "ext-filter": "*", "ext-json": "*", "ext-libxml": "*", "ext-mbstring": "*", - "ext-xml": "*", "ext-xmlwriter": "*", - "myclabs/deep-copy": "^1.10.1", - "phar-io/manifest": "^2.0.3", - "phar-io/version": "^3.0.2", + "myclabs/deep-copy": "^1.13.4", + "phar-io/manifest": "^2.0.4", + "phar-io/version": "^3.2.1", "php": ">=8.1", - "phpunit/php-code-coverage": "^10.0", - "phpunit/php-file-iterator": "^4.0", - "phpunit/php-invoker": "^4.0", - "phpunit/php-text-template": "^3.0", - "phpunit/php-timer": "^6.0", - "sebastian/cli-parser": "^2.0", - "sebastian/code-unit": "^2.0", - "sebastian/comparator": "^5.0", - "sebastian/diff": "^5.0", - "sebastian/environment": "^6.0", - "sebastian/exporter": "^5.0", - "sebastian/global-state": "^6.0", - "sebastian/object-enumerator": "^5.0", - "sebastian/recursion-context": "^5.0", - "sebastian/type": "^4.0", - "sebastian/version": "^4.0" + "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.5", + "sebastian/diff": "^5.1.1", + "sebastian/environment": "^6.1.0", + "sebastian/exporter": "^5.1.4", + "sebastian/global-state": "^6.0.2", + "sebastian/object-enumerator": "^5.0.0", + "sebastian/recursion-context": "^5.0.1", + "sebastian/type": "^4.0.0", + "sebastian/version": "^4.0.1" }, "suggest": { "ext-soap": "To be able to generate mocks based on WSDL files" @@ -9504,7 +9543,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-main": "10.0-dev" + "dev-main": "10.5-dev" } }, "autoload": { @@ -9535,23 +9574,16 @@ ], "support": { "issues": "https://github.com/sebastianbergmann/phpunit/issues", - "source": "https://github.com/sebastianbergmann/phpunit/tree/10.0.16" + "security": "https://github.com/sebastianbergmann/phpunit/security/policy", + "source": "https://github.com/sebastianbergmann/phpunit/tree/10.5.64" }, "funding": [ { - "url": "https://phpunit.de/sponsors.html", - "type": "custom" - }, - { - "url": "https://github.com/sebastianbergmann", - "type": "github" - }, - { - "url": "https://tidelift.com/funding/github/packagist/phpunit/phpunit", - "type": "tidelift" + "url": "https://phpunit.de/sponsoring.html", + "type": "other" } ], - "time": "2023-03-13T09:02:40+00:00" + "time": "2026-07-06T14:50:35+00:00" }, { "name": "psr/cache", @@ -9604,16 +9636,16 @@ }, { "name": "sebastian/cli-parser", - "version": "2.0.0", + "version": "2.0.1", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/cli-parser.git", - "reference": "efdc130dbbbb8ef0b545a994fd811725c5282cae" + "reference": "c34583b87e7b7a8055bf6c450c2c77ce32a24084" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/cli-parser/zipball/efdc130dbbbb8ef0b545a994fd811725c5282cae", - "reference": "efdc130dbbbb8ef0b545a994fd811725c5282cae", + "url": "https://api.github.com/repos/sebastianbergmann/cli-parser/zipball/c34583b87e7b7a8055bf6c450c2c77ce32a24084", + "reference": "c34583b87e7b7a8055bf6c450c2c77ce32a24084", "shasum": "" }, "require": { @@ -9648,7 +9680,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/2.0.0" + "security": "https://github.com/sebastianbergmann/cli-parser/security/policy", + "source": "https://github.com/sebastianbergmann/cli-parser/tree/2.0.1" }, "funding": [ { @@ -9656,7 +9689,7 @@ "type": "github" } ], - "time": "2023-02-03T06:58:15+00:00" + "time": "2024-03-02T07:12:49+00:00" }, { "name": "sebastian/code-unit", @@ -9771,16 +9804,16 @@ }, { "name": "sebastian/comparator", - "version": "5.0.0", + "version": "5.0.5", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/comparator.git", - "reference": "72f01e6586e0caf6af81297897bd112eb7e9627c" + "reference": "55dfef806eb7dfeb6e7a6935601fef866f8ca48d" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/comparator/zipball/72f01e6586e0caf6af81297897bd112eb7e9627c", - "reference": "72f01e6586e0caf6af81297897bd112eb7e9627c", + "url": "https://api.github.com/repos/sebastianbergmann/comparator/zipball/55dfef806eb7dfeb6e7a6935601fef866f8ca48d", + "reference": "55dfef806eb7dfeb6e7a6935601fef866f8ca48d", "shasum": "" }, "require": { @@ -9791,7 +9824,7 @@ "sebastian/exporter": "^5.0" }, "require-dev": { - "phpunit/phpunit": "^10.0" + "phpunit/phpunit": "^10.5" }, "type": "library", "extra": { @@ -9835,32 +9868,45 @@ ], "support": { "issues": "https://github.com/sebastianbergmann/comparator/issues", - "source": "https://github.com/sebastianbergmann/comparator/tree/5.0.0" + "security": "https://github.com/sebastianbergmann/comparator/security/policy", + "source": "https://github.com/sebastianbergmann/comparator/tree/5.0.5" }, "funding": [ { "url": "https://github.com/sebastianbergmann", "type": "github" + }, + { + "url": "https://liberapay.com/sebastianbergmann", + "type": "liberapay" + }, + { + "url": "https://thanks.dev/u/gh/sebastianbergmann", + "type": "thanks_dev" + }, + { + "url": "https://tidelift.com/funding/github/packagist/sebastian/comparator", + "type": "tidelift" } ], - "time": "2023-02-03T07:07:16+00:00" + "time": "2026-01-24T09:25:16+00:00" }, { "name": "sebastian/complexity", - "version": "3.0.0", + "version": "3.2.0", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/complexity.git", - "reference": "e67d240970c9dc7ea7b2123a6d520e334dd61dc6" + "reference": "68ff824baeae169ec9f2137158ee529584553799" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/complexity/zipball/e67d240970c9dc7ea7b2123a6d520e334dd61dc6", - "reference": "e67d240970c9dc7ea7b2123a6d520e334dd61dc6", + "url": "https://api.github.com/repos/sebastianbergmann/complexity/zipball/68ff824baeae169ec9f2137158ee529584553799", + "reference": "68ff824baeae169ec9f2137158ee529584553799", "shasum": "" }, "require": { - "nikic/php-parser": "^4.10", + "nikic/php-parser": "^4.18 || ^5.0", "php": ">=8.1" }, "require-dev": { @@ -9869,7 +9915,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-main": "3.0-dev" + "dev-main": "3.2-dev" } }, "autoload": { @@ -9892,7 +9938,8 @@ "homepage": "https://github.com/sebastianbergmann/complexity", "support": { "issues": "https://github.com/sebastianbergmann/complexity/issues", - "source": "https://github.com/sebastianbergmann/complexity/tree/3.0.0" + "security": "https://github.com/sebastianbergmann/complexity/security/policy", + "source": "https://github.com/sebastianbergmann/complexity/tree/3.2.0" }, "funding": [ { @@ -9900,20 +9947,20 @@ "type": "github" } ], - "time": "2023-02-03T06:59:47+00:00" + "time": "2023-12-21T08:37:17+00:00" }, { "name": "sebastian/diff", - "version": "5.0.0", + "version": "5.1.1", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/diff.git", - "reference": "70dd1b20bc198da394ad542e988381b44e64e39f" + "reference": "c41e007b4b62af48218231d6c2275e4c9b975b2e" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/diff/zipball/70dd1b20bc198da394ad542e988381b44e64e39f", - "reference": "70dd1b20bc198da394ad542e988381b44e64e39f", + "url": "https://api.github.com/repos/sebastianbergmann/diff/zipball/c41e007b4b62af48218231d6c2275e4c9b975b2e", + "reference": "c41e007b4b62af48218231d6c2275e4c9b975b2e", "shasum": "" }, "require": { @@ -9921,12 +9968,12 @@ }, "require-dev": { "phpunit/phpunit": "^10.0", - "symfony/process": "^4.2 || ^5" + "symfony/process": "^6.4" }, "type": "library", "extra": { "branch-alias": { - "dev-main": "5.0-dev" + "dev-main": "5.1-dev" } }, "autoload": { @@ -9958,7 +10005,8 @@ ], "support": { "issues": "https://github.com/sebastianbergmann/diff/issues", - "source": "https://github.com/sebastianbergmann/diff/tree/5.0.0" + "security": "https://github.com/sebastianbergmann/diff/security/policy", + "source": "https://github.com/sebastianbergmann/diff/tree/5.1.1" }, "funding": [ { @@ -9966,20 +10014,20 @@ "type": "github" } ], - "time": "2023-02-03T07:00:31+00:00" + "time": "2024-03-02T07:15:17+00:00" }, { "name": "sebastian/environment", - "version": "6.0.0", + "version": "6.1.0", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/environment.git", - "reference": "b6f3694c6386c7959915a0037652e0c40f6f69cc" + "reference": "8074dbcd93529b357029f5cc5058fd3e43666984" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/environment/zipball/b6f3694c6386c7959915a0037652e0c40f6f69cc", - "reference": "b6f3694c6386c7959915a0037652e0c40f6f69cc", + "url": "https://api.github.com/repos/sebastianbergmann/environment/zipball/8074dbcd93529b357029f5cc5058fd3e43666984", + "reference": "8074dbcd93529b357029f5cc5058fd3e43666984", "shasum": "" }, "require": { @@ -9994,7 +10042,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-main": "6.0-dev" + "dev-main": "6.1-dev" } }, "autoload": { @@ -10021,7 +10069,8 @@ ], "support": { "issues": "https://github.com/sebastianbergmann/environment/issues", - "source": "https://github.com/sebastianbergmann/environment/tree/6.0.0" + "security": "https://github.com/sebastianbergmann/environment/security/policy", + "source": "https://github.com/sebastianbergmann/environment/tree/6.1.0" }, "funding": [ { @@ -10029,20 +10078,20 @@ "type": "github" } ], - "time": "2023-02-03T07:03:04+00:00" + "time": "2024-03-23T08:47:14+00:00" }, { "name": "sebastian/exporter", - "version": "5.0.0", + "version": "5.1.4", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/exporter.git", - "reference": "f3ec4bf931c0b31e5b413f5b4fc970a7d03338c0" + "reference": "0735b90f4da94969541dac1da743446e276defa6" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/exporter/zipball/f3ec4bf931c0b31e5b413f5b4fc970a7d03338c0", - "reference": "f3ec4bf931c0b31e5b413f5b4fc970a7d03338c0", + "url": "https://api.github.com/repos/sebastianbergmann/exporter/zipball/0735b90f4da94969541dac1da743446e276defa6", + "reference": "0735b90f4da94969541dac1da743446e276defa6", "shasum": "" }, "require": { @@ -10051,12 +10100,12 @@ "sebastian/recursion-context": "^5.0" }, "require-dev": { - "phpunit/phpunit": "^10.0" + "phpunit/phpunit": "^10.5" }, "type": "library", "extra": { "branch-alias": { - "dev-main": "5.0-dev" + "dev-main": "5.1-dev" } }, "autoload": { @@ -10098,28 +10147,41 @@ ], "support": { "issues": "https://github.com/sebastianbergmann/exporter/issues", - "source": "https://github.com/sebastianbergmann/exporter/tree/5.0.0" + "security": "https://github.com/sebastianbergmann/exporter/security/policy", + "source": "https://github.com/sebastianbergmann/exporter/tree/5.1.4" }, "funding": [ { "url": "https://github.com/sebastianbergmann", "type": "github" + }, + { + "url": "https://liberapay.com/sebastianbergmann", + "type": "liberapay" + }, + { + "url": "https://thanks.dev/u/gh/sebastianbergmann", + "type": "thanks_dev" + }, + { + "url": "https://tidelift.com/funding/github/packagist/sebastian/exporter", + "type": "tidelift" } ], - "time": "2023-02-03T07:06:49+00:00" + "time": "2025-09-24T06:09:11+00:00" }, { "name": "sebastian/global-state", - "version": "6.0.0", + "version": "6.0.2", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/global-state.git", - "reference": "aab257c712de87b90194febd52e4d184551c2d44" + "reference": "987bafff24ecc4c9ac418cab1145b96dd6e9cbd9" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/global-state/zipball/aab257c712de87b90194febd52e4d184551c2d44", - "reference": "aab257c712de87b90194febd52e4d184551c2d44", + "url": "https://api.github.com/repos/sebastianbergmann/global-state/zipball/987bafff24ecc4c9ac418cab1145b96dd6e9cbd9", + "reference": "987bafff24ecc4c9ac418cab1145b96dd6e9cbd9", "shasum": "" }, "require": { @@ -10153,13 +10215,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/6.0.0" + "security": "https://github.com/sebastianbergmann/global-state/security/policy", + "source": "https://github.com/sebastianbergmann/global-state/tree/6.0.2" }, "funding": [ { @@ -10167,24 +10230,24 @@ "type": "github" } ], - "time": "2023-02-03T07:07:38+00:00" + "time": "2024-03-02T07:19:19+00:00" }, { "name": "sebastian/lines-of-code", - "version": "2.0.0", + "version": "2.0.2", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/lines-of-code.git", - "reference": "17c4d940ecafb3d15d2cf916f4108f664e28b130" + "reference": "856e7f6a75a84e339195d48c556f23be2ebf75d0" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/lines-of-code/zipball/17c4d940ecafb3d15d2cf916f4108f664e28b130", - "reference": "17c4d940ecafb3d15d2cf916f4108f664e28b130", + "url": "https://api.github.com/repos/sebastianbergmann/lines-of-code/zipball/856e7f6a75a84e339195d48c556f23be2ebf75d0", + "reference": "856e7f6a75a84e339195d48c556f23be2ebf75d0", "shasum": "" }, "require": { - "nikic/php-parser": "^4.10", + "nikic/php-parser": "^4.18 || ^5.0", "php": ">=8.1" }, "require-dev": { @@ -10216,7 +10279,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/2.0.0" + "security": "https://github.com/sebastianbergmann/lines-of-code/security/policy", + "source": "https://github.com/sebastianbergmann/lines-of-code/tree/2.0.2" }, "funding": [ { @@ -10224,7 +10288,7 @@ "type": "github" } ], - "time": "2023-02-03T07:08:02+00:00" + "time": "2023-12-21T08:38:20+00:00" }, { "name": "sebastian/object-enumerator", @@ -10340,23 +10404,23 @@ }, { "name": "sebastian/recursion-context", - "version": "5.0.0", + "version": "5.0.1", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/recursion-context.git", - "reference": "05909fb5bc7df4c52992396d0116aed689f93712" + "reference": "47e34210757a2f37a97dcd207d032e1b01e64c7a" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/recursion-context/zipball/05909fb5bc7df4c52992396d0116aed689f93712", - "reference": "05909fb5bc7df4c52992396d0116aed689f93712", + "url": "https://api.github.com/repos/sebastianbergmann/recursion-context/zipball/47e34210757a2f37a97dcd207d032e1b01e64c7a", + "reference": "47e34210757a2f37a97dcd207d032e1b01e64c7a", "shasum": "" }, "require": { "php": ">=8.1" }, "require-dev": { - "phpunit/phpunit": "^10.0" + "phpunit/phpunit": "^10.5" }, "type": "library", "extra": { @@ -10391,15 +10455,28 @@ "homepage": "https://github.com/sebastianbergmann/recursion-context", "support": { "issues": "https://github.com/sebastianbergmann/recursion-context/issues", - "source": "https://github.com/sebastianbergmann/recursion-context/tree/5.0.0" + "security": "https://github.com/sebastianbergmann/recursion-context/security/policy", + "source": "https://github.com/sebastianbergmann/recursion-context/tree/5.0.1" }, "funding": [ { "url": "https://github.com/sebastianbergmann", "type": "github" + }, + { + "url": "https://liberapay.com/sebastianbergmann", + "type": "liberapay" + }, + { + "url": "https://thanks.dev/u/gh/sebastianbergmann", + "type": "thanks_dev" + }, + { + "url": "https://tidelift.com/funding/github/packagist/sebastian/recursion-context", + "type": "tidelift" } ], - "time": "2023-02-03T07:05:40+00:00" + "time": "2025-08-10T07:50:56+00:00" }, { "name": "sebastian/type", @@ -10880,16 +10957,16 @@ }, { "name": "theseer/tokenizer", - "version": "1.2.1", + "version": "1.3.1", "source": { "type": "git", "url": "https://github.com/theseer/tokenizer.git", - "reference": "34a41e998c2183e22995f158c581e7b5e755ab9e" + "reference": "b7489ce515e168639d17feec34b8847c326b0b3c" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/theseer/tokenizer/zipball/34a41e998c2183e22995f158c581e7b5e755ab9e", - "reference": "34a41e998c2183e22995f158c581e7b5e755ab9e", + "url": "https://api.github.com/repos/theseer/tokenizer/zipball/b7489ce515e168639d17feec34b8847c326b0b3c", + "reference": "b7489ce515e168639d17feec34b8847c326b0b3c", "shasum": "" }, "require": { @@ -10918,7 +10995,7 @@ "description": "A small library for converting tokenized PHP source code into XML and potentially other formats", "support": { "issues": "https://github.com/theseer/tokenizer/issues", - "source": "https://github.com/theseer/tokenizer/tree/1.2.1" + "source": "https://github.com/theseer/tokenizer/tree/1.3.1" }, "funding": [ { @@ -10926,7 +11003,7 @@ "type": "github" } ], - "time": "2021-07-28T10:34:58+00:00" + "time": "2025-11-17T20:03:58+00:00" } ], "aliases": [], @@ -10941,5 +11018,8 @@ "ext-json": "*" }, "platform-dev": {}, + "platform-overrides": { + "php": "8.3.31" + }, "plugin-api-version": "2.6.0" } diff --git a/vendor/bin/paratest b/vendor/bin/paratest index 53828848..78d13c24 100644 --- a/vendor/bin/paratest +++ b/vendor/bin/paratest @@ -112,9 +112,8 @@ if (PHP_VERSION_ID < 80000) { (function_exists('stream_get_wrappers') && in_array('phpvfscomposer', stream_get_wrappers(), true)) || (function_exists('stream_wrapper_register') && stream_wrapper_register('phpvfscomposer', 'Composer\BinProxyWrapper')) ) { - include("phpvfscomposer://" . __DIR__ . '/..'.'/brianium/paratest/bin/paratest'); - exit(0); + return include("phpvfscomposer://" . __DIR__ . '/..'.'/brianium/paratest/bin/paratest'); } } -include __DIR__ . '/..'.'/brianium/paratest/bin/paratest'; +return include __DIR__ . '/..'.'/brianium/paratest/bin/paratest'; diff --git a/vendor/bin/paratest.bat b/vendor/bin/paratest.bat index f3961912..2867575c 100644 --- a/vendor/bin/paratest.bat +++ b/vendor/bin/paratest.bat @@ -1,37 +1,5 @@ -#!/usr/bin/env sh - -# Support bash to support `source` with fallback on $0 if this does not run with bash -# https://stackoverflow.com/a/35006505/6512 -selfArg="$BASH_SOURCE" -if [ -z "$selfArg" ]; then - selfArg="$0" -fi - -self=$(realpath $selfArg 2> /dev/null) -if [ -z "$self" ]; then - self="$selfArg" -fi - -dir=$(cd "${self%[/\\]*}" > /dev/null; cd '../brianium/paratest/bin' && pwd) - -if [ -d /proc/cygdrive ]; then - case $(which php) in - $(readlink -n /proc/cygdrive)/*) - # We are in Cygwin using Windows php, so the path must be translated - dir=$(cygpath -m "$dir"); - ;; - esac -fi - -export COMPOSER_RUNTIME_BIN_DIR=$(cd "${self%[/\\]*}" > /dev/null; pwd) - -# If bash is sourcing this file, we have to source the target as well -bashSource="$BASH_SOURCE" -if [ -n "$bashSource" ]; then - if [ "$bashSource" != "$0" ]; then - source "${dir}/paratest.bat" "$@" - return - fi -fi - -"${dir}/paratest.bat" "$@" +@ECHO OFF +setlocal DISABLEDELAYEDEXPANSION +SET BIN_TARGET=%~dp0/paratest +SET COMPOSER_RUNTIME_BIN_DIR=%~dp0 +php "%BIN_TARGET%" %* diff --git a/vendor/bin/paratest_for_phpstorm b/vendor/bin/paratest_for_phpstorm index 5cd70b54..526fa8bc 100644 --- a/vendor/bin/paratest_for_phpstorm +++ b/vendor/bin/paratest_for_phpstorm @@ -112,9 +112,8 @@ if (PHP_VERSION_ID < 80000) { (function_exists('stream_get_wrappers') && in_array('phpvfscomposer', stream_get_wrappers(), true)) || (function_exists('stream_wrapper_register') && stream_wrapper_register('phpvfscomposer', 'Composer\BinProxyWrapper')) ) { - include("phpvfscomposer://" . __DIR__ . '/..'.'/brianium/paratest/bin/paratest_for_phpstorm'); - exit(0); + return include("phpvfscomposer://" . __DIR__ . '/..'.'/brianium/paratest/bin/paratest_for_phpstorm'); } } -include __DIR__ . '/..'.'/brianium/paratest/bin/paratest_for_phpstorm'; +return include __DIR__ . '/..'.'/brianium/paratest/bin/paratest_for_phpstorm'; diff --git a/vendor/bin/php-parse b/vendor/bin/php-parse index 1bd2c838..61566e60 100644 --- a/vendor/bin/php-parse +++ b/vendor/bin/php-parse @@ -112,9 +112,8 @@ if (PHP_VERSION_ID < 80000) { (function_exists('stream_get_wrappers') && in_array('phpvfscomposer', stream_get_wrappers(), true)) || (function_exists('stream_wrapper_register') && stream_wrapper_register('phpvfscomposer', 'Composer\BinProxyWrapper')) ) { - include("phpvfscomposer://" . __DIR__ . '/..'.'/nikic/php-parser/bin/php-parse'); - exit(0); + return include("phpvfscomposer://" . __DIR__ . '/..'.'/nikic/php-parser/bin/php-parse'); } } -include __DIR__ . '/..'.'/nikic/php-parser/bin/php-parse'; +return include __DIR__ . '/..'.'/nikic/php-parser/bin/php-parse'; diff --git a/vendor/bin/phpunit b/vendor/bin/phpunit index e92cddc5..b5b530a8 100644 --- a/vendor/bin/phpunit +++ b/vendor/bin/phpunit @@ -115,9 +115,8 @@ if (PHP_VERSION_ID < 80000) { (function_exists('stream_get_wrappers') && in_array('phpvfscomposer', stream_get_wrappers(), true)) || (function_exists('stream_wrapper_register') && stream_wrapper_register('phpvfscomposer', 'Composer\BinProxyWrapper')) ) { - include("phpvfscomposer://" . __DIR__ . '/..'.'/phpunit/phpunit/phpunit'); - exit(0); + return include("phpvfscomposer://" . __DIR__ . '/..'.'/phpunit/phpunit/phpunit'); } } -include __DIR__ . '/..'.'/phpunit/phpunit/phpunit'; +return include __DIR__ . '/..'.'/phpunit/phpunit/phpunit'; diff --git a/vendor/brianium/paratest/README.md b/vendor/brianium/paratest/README.md index aaa7ac25..5dd6f1d3 100644 --- a/vendor/brianium/paratest/README.md +++ b/vendor/brianium/paratest/README.md @@ -4,14 +4,14 @@ ParaTest [![Latest Stable Version](https://img.shields.io/packagist/v/brianium/paratest.svg)](https://packagist.org/packages/brianium/paratest) [![Downloads](https://img.shields.io/packagist/dt/brianium/paratest.svg)](https://packagist.org/packages/brianium/paratest) [![Integrate](https://github.com/paratestphp/paratest/workflows/CI/badge.svg)](https://github.com/paratestphp/paratest/actions) -[![Infection MSI](https://badge.stryker-mutator.io/github.com/paratestphp/paratest/7.x)](https://dashboard.stryker-mutator.io/reports/github.com/paratestphp/paratest/7.x) +[![Infection MSI](https://img.shields.io/endpoint?style=flat&url=https%3A%2F%2Fbadge-api.stryker-mutator.io%2Fgithub.com%2Fparatestphp%2Fparatest%2F7.x)](https://dashboard.stryker-mutator.io/reports/github.com/paratestphp/paratest/7.x) The objective of ParaTest is to support parallel testing in PHPUnit. Provided you have well-written PHPUnit tests, you can drop `paratest` in your project and start using it with no additional bootstrap or configurations! Benefits: -* Zero configuration. After the installation, run with `vendor/bin/paratest`. That's it! +* Zero configuration. After the installation, run with `vendor/bin/paratest` to parallelize by TestCase or `vendor/bin/paratest --functional` to parallelize by Test. That's it! * Code Coverage report combining. Run your tests in N parallel processes and all the code coverage output will be combined into one report. # Installation @@ -72,14 +72,6 @@ If you have `xDebug` installed, activating it by the environment variable is eno XDEBUG_MODE=coverage vendor/bin/paratest ``` -### PHPDBG - -`PHPDBG` is automatically detected and used in the subprocesses if it's the running binary of the main process: - -``` -phpdbg vendor/bin/paratest -``` - ## Initial setup for all tests Because ParaTest runs multiple processes in parallel, each with their own instance of the PHP interpreter, @@ -136,19 +128,6 @@ When a sub-process fails, the originating command is given in the output and can to be run and debugged. All internal commands run with `--printer [...]\NullPhpunitPrinter` which silence the original PHPUnit output: during a debugging run remove that option to restore the output and see what PHPUnit is doing. -## Windows - -Windows users be sure to use the appropriate batch files. - -An example being: - -`vendor\bin\paratest.bat ...` - -ParaTest assumes [PSR-0](https://github.com/php-fig/fig-standards/blob/master/accepted/PSR-0.md) for loading tests. - -For convenience, ParaTest for Windows uses 79 columns mode to prevent blank lines in the standard -80x25 windows console. - ## Caveats 1. Constants, static methods, static variables and everything exposed by test classes consumed by other test classes diff --git a/vendor/brianium/paratest/bin/paratest.bat b/vendor/brianium/paratest/bin/paratest.bat deleted file mode 100644 index 15c8a5a0..00000000 --- a/vendor/brianium/paratest/bin/paratest.bat +++ /dev/null @@ -1,3 +0,0 @@ -@ECHO OFF -SET BIN_TARGET=%~dp0\"../bin"\paratest -php "%BIN_TARGET%" %* \ No newline at end of file diff --git a/vendor/brianium/paratest/bin/phpunit-wrapper.php b/vendor/brianium/paratest/bin/phpunit-wrapper.php index 4ad81509..aa3d3bf4 100644 --- a/vendor/brianium/paratest/bin/phpunit-wrapper.php +++ b/vendor/brianium/paratest/bin/phpunit-wrapper.php @@ -9,10 +9,12 @@ use ParaTest\WrapperRunner\WrapperWorker; $getopt = getopt('', [ 'status-file:', 'progress-file:', + 'unexpected-output-file:', 'testresult-file:', 'teamcity-file:', 'testdox-file:', 'testdox-color', + 'testdox-columns:', 'phpunit-argv:', ]); @@ -24,8 +26,8 @@ use ParaTest\WrapperRunner\WrapperWorker; foreach ($composerAutoloadFiles as $file) { if (file_exists($file)) { - require_once $file; define('PHPUNIT_COMPOSER_INSTALL', $file); + require_once $file; break; } @@ -36,9 +38,11 @@ use ParaTest\WrapperRunner\WrapperWorker; assert(is_resource($statusFile)); assert(isset($getopt['progress-file']) && is_string($getopt['progress-file'])); + assert(isset($getopt['unexpected-output-file']) && is_string($getopt['unexpected-output-file'])); assert(isset($getopt['testresult-file']) && is_string($getopt['testresult-file'])); assert(!isset($getopt['teamcity-file']) || is_string($getopt['teamcity-file'])); assert(!isset($getopt['testdox-file']) || is_string($getopt['testdox-file'])); + assert(!isset($getopt['testdox-columns']) || $getopt['testdox-columns'] === (string) (int) $getopt['testdox-columns']); assert(isset($getopt['phpunit-argv']) && is_string($getopt['phpunit-argv'])); $phpunitArgv = unserialize($getopt['phpunit-argv'], ['allowed_classes' => false]); @@ -47,10 +51,12 @@ use ParaTest\WrapperRunner\WrapperWorker; $application = new ApplicationForWrapperWorker( $phpunitArgv, $getopt['progress-file'], + $getopt['unexpected-output-file'], $getopt['testresult-file'], $getopt['teamcity-file'] ?? null, $getopt['testdox-file'] ?? null, isset($getopt['testdox-color']), + isset($getopt['testdox-columns']) ? (int) $getopt['testdox-columns'] : null, ); while (true) { @@ -66,7 +72,7 @@ use ParaTest\WrapperRunner\WrapperWorker; } // It must be a 1 byte string to ensure filesize() is equal to the number of tests executed - $exitCode = $application->runTest(trim($testPath)); + $exitCode = $application->runTest(trim($testPath, "\n")); fwrite($statusFile, (string) $exitCode); fflush($statusFile); diff --git a/vendor/brianium/paratest/composer.json b/vendor/brianium/paratest/composer.json index ea61867d..1dd2cb2f 100644 --- a/vendor/brianium/paratest/composer.json +++ b/vendor/brianium/paratest/composer.json @@ -33,32 +33,31 @@ } ], "require": { - "php": "~8.1.0 || ~8.2.0", + "php": "~8.2.0 || ~8.3.0 || ~8.4.0", "ext-dom": "*", "ext-pcre": "*", "ext-reflection": "*", "ext-simplexml": "*", - "fidry/cpu-core-counter": "^0.4.1 || ^0.5.1", - "jean85/pretty-package-versions": "^2.0.5", - "phpunit/php-code-coverage": "^10.0.2", - "phpunit/php-file-iterator": "^4.0.1", - "phpunit/php-timer": "^6.0", - "phpunit/phpunit": "^10.0.16", - "sebastian/environment": "^6.0", - "symfony/console": "^6.2.7", - "symfony/process": "^6.2.7" + "fidry/cpu-core-counter": "^1.2.0", + "jean85/pretty-package-versions": "^2.0.6", + "phpunit/php-code-coverage": "^10.1.16", + "phpunit/php-file-iterator": "^4.1.0", + "phpunit/php-timer": "^6.0.0", + "phpunit/phpunit": "^10.5.47", + "sebastian/environment": "^6.1.0", + "symfony/console": "^6.4.7 || ^7.1.5", + "symfony/process": "^6.4.7 || ^7.1.5" }, "require-dev": { "ext-pcov": "*", "ext-posix": "*", - "doctrine/coding-standard": "^11.1.0", - "infection/infection": "^0.26.19", - "phpstan/phpstan": "^1.10.6", - "phpstan/phpstan-deprecation-rules": "^1.1.2", - "phpstan/phpstan-phpunit": "^1.3.10", - "phpstan/phpstan-strict-rules": "^1.5", - "squizlabs/php_codesniffer": "^3.7.2", - "symfony/filesystem": "^6.2.7" + "doctrine/coding-standard": "^12.0.0", + "phpstan/phpstan": "^1.12.6", + "phpstan/phpstan-deprecation-rules": "^1.2.1", + "phpstan/phpstan-phpunit": "^1.4.0", + "phpstan/phpstan-strict-rules": "^1.6.1", + "squizlabs/php_codesniffer": "^3.10.3", + "symfony/filesystem": "^6.4.3 || ^7.1.5" }, "autoload": { "psr-4": { @@ -74,7 +73,6 @@ }, "bin": [ "bin/paratest", - "bin/paratest.bat", "bin/paratest_for_phpstorm" ], "config": { diff --git a/vendor/brianium/paratest/src/JUnit/LogMerger.php b/vendor/brianium/paratest/src/JUnit/LogMerger.php index ddf2f4f1..7b28df37 100644 --- a/vendor/brianium/paratest/src/JUnit/LogMerger.php +++ b/vendor/brianium/paratest/src/JUnit/LogMerger.php @@ -18,7 +18,7 @@ use function ksort; final class LogMerger { /** @param list $junitFiles */ - public function merge(array $junitFiles): TestSuite + public function merge(array $junitFiles): ?TestSuite { $mainSuite = null; foreach ($junitFiles as $junitFile) { @@ -67,8 +67,6 @@ final class LogMerger $mainSuite = $this->mergeSuites($mainSuite, $otherSuite); } - assert($mainSuite !== null); - return $mainSuite; } diff --git a/vendor/brianium/paratest/src/JUnit/Writer.php b/vendor/brianium/paratest/src/JUnit/Writer.php index 8ffe5515..3e09b69c 100644 --- a/vendor/brianium/paratest/src/JUnit/Writer.php +++ b/vendor/brianium/paratest/src/JUnit/Writer.php @@ -23,6 +23,7 @@ use const ENT_XML1; /** @internal */ final class Writer { + private const TESTSUITES_NAME = 'PHPUnit tests'; private readonly DOMDocument $document; public function __construct() @@ -47,6 +48,7 @@ final class Writer { $xmlTestsuites = $this->document->createElement('testsuites'); $xmlTestsuites->appendChild($this->createSuiteNode($testSuite)); + $xmlTestsuites->setAttribute('name', self::TESTSUITES_NAME); $this->document->appendChild($xmlTestsuites); $xml = $this->document->saveXML(); @@ -58,7 +60,7 @@ final class Writer private function createSuiteNode(TestSuite $parentSuite): DOMElement { $suiteNode = $this->document->createElement('testsuite'); - $suiteNode->setAttribute('name', $parentSuite->name); + $suiteNode->setAttribute('name', $parentSuite->name !== self::TESTSUITES_NAME ? $parentSuite->name : ''); if ($parentSuite->file !== '') { $suiteNode->setAttribute('file', $parentSuite->file); } diff --git a/vendor/brianium/paratest/src/Options.php b/vendor/brianium/paratest/src/Options.php index 76ff4672..d88679ed 100644 --- a/vendor/brianium/paratest/src/Options.php +++ b/vendor/brianium/paratest/src/Options.php @@ -99,6 +99,7 @@ final class Options public readonly string $runner, public readonly string $tmpDir, public readonly bool $verbose, + public readonly bool $functional, ) { $this->needsTeamcity = $configuration->outputIsTeamCity() || $configuration->hasLogfileTeamcity(); } @@ -137,6 +138,10 @@ final class Options $verbose = $options['verbose']; unset($options['verbose']); + assert(is_bool($options['functional'])); + $functional = $options['functional']; + unset($options['functional']); + assert(array_key_exists('colors', $options)); if ($options['colors'] === Configuration::COLOR_DEFAULT) { unset($options['colors']); @@ -192,6 +197,7 @@ final class Options $runner, $tmpDir, $verbose, + $functional, ); } @@ -206,6 +212,12 @@ final class Options ), // ParaTest options + new InputOption( + 'functional', + null, + InputOption::VALUE_NONE, + 'Whether to enable functional testing, for unit and dataset parallelization', + ), new InputOption( 'max-batch-size', 'm', diff --git a/vendor/brianium/paratest/src/ParaTestCommand.php b/vendor/brianium/paratest/src/ParaTestCommand.php index 14f42dab..53250d11 100644 --- a/vendor/brianium/paratest/src/ParaTestCommand.php +++ b/vendor/brianium/paratest/src/ParaTestCommand.php @@ -80,7 +80,7 @@ final class ParaTestCommand extends Command $input, $this->cwd, ); - if (! $options->configuration->hasConfigurationFile() && ! $options->configuration->hasCliArgument()) { + if (! $options->configuration->hasConfigurationFile() && ! $options->configuration->hasCliArguments()) { return $this->displayHelp($output); } diff --git a/vendor/brianium/paratest/src/WrapperRunner/ApplicationForWrapperWorker.php b/vendor/brianium/paratest/src/WrapperRunner/ApplicationForWrapperWorker.php index cdf501a4..7bfab508 100644 --- a/vendor/brianium/paratest/src/WrapperRunner/ApplicationForWrapperWorker.php +++ b/vendor/brianium/paratest/src/WrapperRunner/ApplicationForWrapperWorker.php @@ -11,10 +11,12 @@ use PHPUnit\Framework\TestSuite; use PHPUnit\Logging\JUnit\JunitXmlLogger; use PHPUnit\Logging\TeamCity\TeamCityLogger; use PHPUnit\Logging\TestDox\TestResultCollector; +use PHPUnit\Metadata\Api\CodeCoverage as CodeCoverageMetadataApi; use PHPUnit\Runner\CodeCoverage; use PHPUnit\Runner\Extension\ExtensionBootstrapper; use PHPUnit\Runner\Extension\Facade as ExtensionFacade; use PHPUnit\Runner\Extension\PharLoader; +use PHPUnit\Runner\Filter\Factory; use PHPUnit\Runner\TestSuiteLoader; use PHPUnit\Runner\TestSuiteSorter; use PHPUnit\TestRunner\TestResult\Facade as TestResultFacade; @@ -23,6 +25,7 @@ use PHPUnit\TextUI\Configuration\CodeCoverageFilterRegistry; use PHPUnit\TextUI\Configuration\Configuration; use PHPUnit\TextUI\Configuration\PhpHandler; use PHPUnit\TextUI\Output\Default\ProgressPrinter\ProgressPrinter; +use PHPUnit\TextUI\Output\Default\UnexpectedOutputPrinter; use PHPUnit\TextUI\Output\DefaultPrinter; use PHPUnit\TextUI\Output\NullPrinter; use PHPUnit\TextUI\Output\TestDox\ResultPrinter as TestDoxResultPrinter; @@ -31,8 +34,12 @@ use PHPUnit\Util\ExcludeList; use function assert; use function file_put_contents; +use function is_file; use function mt_srand; use function serialize; +use function str_ends_with; +use function strpos; +use function substr; /** * @internal @@ -49,29 +56,61 @@ final class ApplicationForWrapperWorker public function __construct( private readonly array $argv, private readonly string $progressFile, + private readonly string $unexpectedOutputFile, private readonly string $testresultFile, private readonly ?string $teamcityFile, private readonly ?string $testdoxFile, private readonly bool $testdoxColor, + private readonly ?int $testdoxColumns, ) { } public function runTest(string $testPath): int { + $null = strpos($testPath, "\0"); + $filter = null; + if ($null !== false) { + $filter = new Factory(); + $name = substr($testPath, $null + 1); + assert($name !== ''); + $filter->addNameFilter($name); + + $testPath = substr($testPath, 0, $null); + } + $this->bootstrap(); - $testSuiteRefl = (new TestSuiteLoader())->load($testPath); - $testSuite = TestSuite::fromClassReflector($testSuiteRefl); + if (is_file($testPath) && str_ends_with($testPath, '.phpt')) { + $testSuite = TestSuite::empty($testPath); + $testSuite->addTestFile($testPath); + } else { + $testSuiteRefl = (new TestSuiteLoader())->load($testPath); + $testSuite = TestSuite::fromClassReflector($testSuiteRefl); + } + + if (CodeCoverage::instance()->isActive()) { + CodeCoverage::instance()->ignoreLines( + (new CodeCoverageMetadataApi())->linesToBeIgnored($testSuite), + ); + } (new TestSuiteFilterProcessor())->process($this->configuration, $testSuite); + if ($filter !== null) { + $testSuite->injectFilter($filter); + + EventFacade::emitter()->testSuiteFiltered( + TestSuiteBuilder::from($testSuite), + ); + } + EventFacade::emitter()->testRunnerExecutionStarted( TestSuiteBuilder::from($testSuite), ); $testSuite->run(); - return TestResultFacade::result()->wasSuccessfulIgnoringPhpunitWarnings() + return TestResultFacade::result()->wasSuccessful() ? RunnerInterface::SUCCESS_EXIT : RunnerInterface::FAILURE_EXIT; } @@ -95,6 +134,7 @@ final class ApplicationForWrapperWorker EventFacade::emitter()->testRunnerBootstrapFinished($bootstrapFilename); } + $extensionRequiresCodeCoverageCollection = false; if (! $this->configuration->noExtensions()) { if ($this->configuration->hasPharExtensionDirectory()) { (new PharLoader())->loadPharExtensionsInDirectory( @@ -102,9 +142,10 @@ final class ApplicationForWrapperWorker ); } + $extensionFacade = new ExtensionFacade(); $extensionBootstrapper = new ExtensionBootstrapper( $this->configuration, - new ExtensionFacade(), + $extensionFacade, ); foreach ($this->configuration->extensionBootstrappers() as $bootstrapper) { @@ -113,30 +154,53 @@ final class ApplicationForWrapperWorker $bootstrapper['parameters'], ); } + + $extensionRequiresCodeCoverageCollection = $extensionFacade->requiresCodeCoverageCollection(); } - CodeCoverage::instance()->init($this->configuration, CodeCoverageFilterRegistry::instance()); + CodeCoverage::instance()->init( + $this->configuration, + CodeCoverageFilterRegistry::instance(), + $extensionRequiresCodeCoverageCollection, + ); if ($this->configuration->hasLogfileJunit()) { - new JunitXmlLogger(DefaultPrinter::from($this->configuration->logfileJunit())); + new JunitXmlLogger( + DefaultPrinter::from($this->configuration->logfileJunit()), + EventFacade::instance(), + ); } - new ProgressPrinter( + $printer = new ProgressPrinterOutput( DefaultPrinter::from($this->progressFile), + DefaultPrinter::from($this->unexpectedOutputFile), + ); + + new UnexpectedOutputPrinter($printer, EventFacade::instance()); + new ProgressPrinter( + $printer, + EventFacade::instance(), false, - 120, + 99999, + $this->configuration->source(), ); if (isset($this->teamcityFile)) { - new TeamCityLogger(DefaultPrinter::from($this->teamcityFile)); + new TeamCityLogger( + DefaultPrinter::from($this->teamcityFile), + EventFacade::instance(), + ); } if (isset($this->testdoxFile)) { - $this->testdoxResultCollector = new TestResultCollector(); + $this->testdoxResultCollector = new TestResultCollector( + EventFacade::instance(), + $this->configuration->source(), + ); } TestResultFacade::init(); - EventFacade::seal(); + EventFacade::instance()->seal(); EventFacade::emitter()->testRunnerStarted(); if ($this->configuration->executionOrder() === TestSuiteSorter::ORDER_RANDOMIZED) { @@ -148,6 +212,10 @@ final class ApplicationForWrapperWorker public function end(): void { + if (! $this->hasBeenBootstrapped) { + return; + } + EventFacade::emitter()->testRunnerExecutionFinished(); EventFacade::emitter()->testRunnerFinished(); @@ -156,6 +224,7 @@ final class ApplicationForWrapperWorker $result = TestResultFacade::result(); if (isset($this->testdoxResultCollector)) { assert(isset($this->testdoxFile)); + assert(isset($this->testdoxColumns)); (new TestDoxResultPrinter(DefaultPrinter::from($this->testdoxFile), $this->testdoxColor))->print( $this->testdoxResultCollector->testMethodsGroupedByClass(), diff --git a/vendor/brianium/paratest/src/WrapperRunner/ResultPrinter.php b/vendor/brianium/paratest/src/WrapperRunner/ResultPrinter.php index 3bc3ca1a..fceaba66 100644 --- a/vendor/brianium/paratest/src/WrapperRunner/ResultPrinter.php +++ b/vendor/brianium/paratest/src/WrapperRunner/ResultPrinter.php @@ -27,7 +27,6 @@ use function fread; use function fseek; use function ftell; use function fwrite; -use function preg_replace; use function sprintf; use function str_repeat; use function strlen; @@ -41,12 +40,12 @@ final class ResultPrinter { public readonly Printer $printer; - private int $numTestsWidth = 0; - private int $maxColumn = 0; - private int $totalCases = 0; - private int $column = 0; - private int $casesProcessed = 0; - private int $numberOfColumns = 80; + private int $numTestsWidth = 0; + private int $maxColumn = 0; + private int $totalCases = 0; + private int $column = 0; + private int $casesProcessed = 0; + private int $numberOfColumns; /** @var resource|null */ private $teamcityLogFileHandle; /** @var array */ @@ -72,6 +71,8 @@ final class ResultPrinter } }; + $this->numberOfColumns = $this->options->configuration->columns(); + if (! $this->options->configuration->hasLogfileTeamcity()) { return; } @@ -128,11 +129,13 @@ final class ResultPrinter $output->write("\n"); } - /** @param list $teamcityFiles */ - public function printFeedback(SplFileInfo $progressFile, array $teamcityFiles): void - { - if ($this->options->needsTeamcity) { - $teamcityProgress = $this->tailMultiple($teamcityFiles); + public function printFeedback( + SplFileInfo $progressFile, + SplFileInfo $outputFile, + SplFileInfo|null $teamcityFile + ): void { + if ($this->options->needsTeamcity && $teamcityFile !== null) { + $teamcityProgress = $this->tailMultiple([$teamcityFile]); if ($this->teamcityLogFileHandle !== null) { fwrite($this->teamcityLogFileHandle, $teamcityProgress); @@ -150,14 +153,16 @@ final class ResultPrinter return; } + $unexpectedOutput = $this->tail($outputFile); + if ($unexpectedOutput !== '') { + $this->output->write($unexpectedOutput); + } + $feedbackItems = $this->tail($progressFile); if ($feedbackItems === '') { return; } - $feedbackItems = preg_replace('/ +\\d+ \\/ \\d+ \\( *\\d+%\\)\\s*/', '', $feedbackItems); - assert($feedbackItems !== null); - $actualTestCount = strlen($feedbackItems); for ($index = 0; $index < $actualTestCount; ++$index) { $this->printFeedbackItem($feedbackItems[$index]); @@ -188,17 +193,13 @@ final class ResultPrinter return; } - if ($this->options->configuration->outputIsTestDox()) { - $this->output->write($this->tailMultiple($testdoxFiles)); + $this->printer->print(PHP_EOL . (new ResourceUsageFormatter())->resourceUsageSinceStartOfRequest() . PHP_EOL . PHP_EOL); - return; - } - - $resultPrinter = new DefaultResultPrinter( + $defaultResultPrinter = new DefaultResultPrinter( $this->printer, true, true, - true, + $this->options->configuration->displayDetailsOnPhpunitDeprecations(), true, true, true, @@ -210,15 +211,34 @@ final class ResultPrinter $this->options->configuration->displayDetailsOnTestsThatTriggerWarnings(), false, ); - $summaryPrinter = new SummaryPrinter( + + if ($this->options->configuration->outputIsTestDox()) { + $this->output->write($this->tailMultiple($testdoxFiles)); + + $defaultResultPrinter = new DefaultResultPrinter( + $this->printer, + true, + true, + $this->options->configuration->displayDetailsOnPhpunitDeprecations(), + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + ); + } + + $defaultResultPrinter->print($testResult); + + (new SummaryPrinter( $this->printer, $this->options->configuration->colors(), - ); - - $this->printer->print(PHP_EOL . (new ResourceUsageFormatter())->resourceUsageSinceStartOfRequest() . PHP_EOL . PHP_EOL); - - $resultPrinter->print($testResult); - $summaryPrinter->print($testResult); + ))->print($testResult); } private function printFeedbackItem(string $item): void @@ -249,7 +269,7 @@ final class ResultPrinter 'F' => $this->colorizeTextBox('bg-red, fg-white', $item), 'I', 'N', 'D', 'R', 'W' => $this->colorizeTextBox('fg-yellow, bold', $item), 'S' => $this->colorizeTextBox('fg-cyan, bold', $item), - default => $item, + '.' => $item, }; $this->output->write($buffer); } diff --git a/vendor/brianium/paratest/src/WrapperRunner/SuiteLoader.php b/vendor/brianium/paratest/src/WrapperRunner/SuiteLoader.php index aad7c316..c20ef612 100644 --- a/vendor/brianium/paratest/src/WrapperRunner/SuiteLoader.php +++ b/vendor/brianium/paratest/src/WrapperRunner/SuiteLoader.php @@ -4,6 +4,7 @@ declare(strict_types=1); namespace ParaTest\WrapperRunner; +use Generator; use ParaTest\Options; use PHPUnit\Framework\TestCase; use PHPUnit\Framework\TestSuite; @@ -23,10 +24,12 @@ use Symfony\Component\Console\Output\OutputInterface; use function array_keys; use function assert; use function count; +use function is_int; use function is_string; use function mt_srand; use function ob_get_clean; use function ob_start; +use function sprintf; use function str_starts_with; use function strlen; use function substr; @@ -36,7 +39,7 @@ final class SuiteLoader { public readonly int $testCount; /** @var list */ - public readonly array $files; + public readonly array $tests; public function __construct( private readonly Options $options, @@ -73,8 +76,36 @@ final class SuiteLoader $this->testCount = count($testSuite); $files = []; - $this->loadFiles($testSuite, $files); - $this->files = array_keys($files); + $tests = []; + foreach ($this->loadFiles($testSuite) as $file => $test) { + $files[$file] = null; + + if ($test instanceof PhptTestCase) { + $tests[] = $file; + } else { + $name = $test->name(); + if ($test->providedData() !== []) { + $dataName = $test->dataName(); + if ($this->options->functional) { + $name = sprintf('/%s\s.*%s.*$/', $name, $dataName); + } else { + if (is_int($dataName)) { + $name .= '#' . $dataName; + } else { + $name .= '@' . $dataName; + } + } + } else { + $name = sprintf('/%s$/', $name); + } + + $tests[] = "$file\0$name"; + } + } + + $this->tests = $this->options->functional + ? $tests + : array_keys($files); if (! $this->options->configuration->hasCoverageReport()) { return; @@ -94,12 +125,13 @@ final class SuiteLoader } } - /** @param array $files */ - private function loadFiles(TestSuite $testSuite, array &$files): void + /** @return Generator */ + private function loadFiles(TestSuite $testSuite): Generator { foreach ($testSuite as $test) { if ($test instanceof TestSuite) { - $this->loadFiles($test, $files); + yield from $this->loadFiles($test); + continue; } @@ -107,8 +139,9 @@ final class SuiteLoader $refProperty = new ReflectionProperty(PhptTestCase::class, 'filename'); $filename = $refProperty->getValue($test); assert(is_string($filename) && $filename !== ''); - $filename = $this->stripCwd($filename); - $files[$filename] = true; + $filename = $this->stripCwd($filename); + + yield $filename => $test; continue; } @@ -116,9 +149,10 @@ final class SuiteLoader if ($test instanceof TestCase) { $refClass = new ReflectionClass($test); $filename = $refClass->getFileName(); - assert(is_string($filename) && $filename !== ''); - $filename = $this->stripCwd($filename); - $files[$filename] = true; + assert(is_string($filename)); + $filename = $this->stripCwd($filename); + + yield $filename => $test; continue; } diff --git a/vendor/brianium/paratest/src/WrapperRunner/WrapperRunner.php b/vendor/brianium/paratest/src/WrapperRunner/WrapperRunner.php index 6982d818..a001846e 100644 --- a/vendor/brianium/paratest/src/WrapperRunner/WrapperRunner.php +++ b/vendor/brianium/paratest/src/WrapperRunner/WrapperRunner.php @@ -54,6 +54,8 @@ final class WrapperRunner implements RunnerInterface /** @var list */ private array $progressFiles = []; /** @var list */ + private array $unexpectedOutputFiles = []; + /** @var list */ private array $testresultFiles = []; /** @var list */ private array $coverageFiles = []; @@ -80,8 +82,11 @@ final class WrapperRunner implements RunnerInterface $phpFinder = new PhpExecutableFinder(); $phpBin = $phpFinder->find(false); assert($phpBin !== false); + assert($phpBin !== ''); $parameters = [$phpBin]; - $parameters = array_merge($parameters, $phpFinder->findArguments()); + /** @var array $arguments */ + $arguments = $phpFinder->findArguments(); + $parameters = array_merge($parameters, $arguments); if ($options->passthruPhp !== null) { $parameters = array_merge($parameters, $options->passthruPhp); @@ -99,7 +104,7 @@ final class WrapperRunner implements RunnerInterface assert($directory !== ''); ExcludeList::addDirectory($directory); TestResultFacade::init(); - EventFacade::seal(); + EventFacade::instance()->seal(); $suiteLoader = new SuiteLoader( $this->options, $this->output, @@ -107,7 +112,7 @@ final class WrapperRunner implements RunnerInterface ); $result = TestResultFacade::result(); - $this->pending = $suiteLoader->files; + $this->pending = $suiteLoader->tests; $this->printer->setTestCount($suiteLoader->testCount); $this->printer->start(); $this->startWorkers(); @@ -165,7 +170,8 @@ final class WrapperRunner implements RunnerInterface $this->exitcode = max($this->exitcode, $worker->getExitCode()); $this->printer->printFeedback( $worker->progressFile, - $this->teamcityFiles, + $worker->unexpectedOutputFile, + $worker->teamcityFile ?? null, ); $worker->reset(); } @@ -208,9 +214,10 @@ final class WrapperRunner implements RunnerInterface $worker->start(); $this->batches[$token] = 0; - $this->statusFiles[] = $worker->statusFile; - $this->progressFiles[] = $worker->progressFile; - $this->testresultFiles[] = $worker->testresultFile; + $this->statusFiles[] = $worker->statusFile; + $this->progressFiles[] = $worker->progressFile; + $this->unexpectedOutputFiles[] = $worker->unexpectedOutputFile; + $this->testresultFiles[] = $worker->testresultFile; if (isset($worker->junitFile)) { $this->junitFiles[] = $worker->junitFile; @@ -233,11 +240,11 @@ final class WrapperRunner implements RunnerInterface private function destroyWorker(int $token): void { - // Mutation Testing tells us that the following `unset()` already destroys - // the `WrapperWorker`, which destroys the Symfony's `Process`, which - // automatically calls `Process::stop` within `Process::__destruct()`. - // But we prefer to have an explicit stops. $this->workers[$token]->stop(); + // We need to wait for ApplicationForWrapperWorker::end to end + while ($this->workers[$token]->isRunning()) { + usleep(self::CYCLE_SLEEP); + } unset($this->workers[$token]); } @@ -255,7 +262,7 @@ final class WrapperRunner implements RunnerInterface assert($testResult instanceof TestResult); $testResultSum = new TestResult( - $testResultSum->numberOfTests() + $testResult->numberOfTests(), + (int) $testResultSum->hasTests() + (int) $testResult->hasTests(), $testResultSum->numberOfTestsRun() + $testResult->numberOfTestsRun(), $testResultSum->numberOfAssertions() + $testResult->numberOfAssertions(), array_merge_recursive($testResultSum->testErroredEvents(), $testResult->testErroredEvents()), @@ -264,18 +271,19 @@ final class WrapperRunner implements RunnerInterface array_merge_recursive($testResultSum->testSuiteSkippedEvents(), $testResult->testSuiteSkippedEvents()), array_merge_recursive($testResultSum->testSkippedEvents(), $testResult->testSkippedEvents()), array_merge_recursive($testResultSum->testMarkedIncompleteEvents(), $testResult->testMarkedIncompleteEvents()), - array_merge_recursive($testResultSum->testTriggeredDeprecationEvents(), $testResult->testTriggeredDeprecationEvents()), - array_merge_recursive($testResultSum->testTriggeredPhpDeprecationEvents(), $testResult->testTriggeredPhpDeprecationEvents()), array_merge_recursive($testResultSum->testTriggeredPhpunitDeprecationEvents(), $testResult->testTriggeredPhpunitDeprecationEvents()), - array_merge_recursive($testResultSum->testTriggeredErrorEvents(), $testResult->testTriggeredErrorEvents()), - array_merge_recursive($testResultSum->testTriggeredNoticeEvents(), $testResult->testTriggeredNoticeEvents()), - array_merge_recursive($testResultSum->testTriggeredPhpNoticeEvents(), $testResult->testTriggeredPhpNoticeEvents()), - array_merge_recursive($testResultSum->testTriggeredWarningEvents(), $testResult->testTriggeredWarningEvents()), - array_merge_recursive($testResultSum->testTriggeredPhpWarningEvents(), $testResult->testTriggeredPhpWarningEvents()), array_merge_recursive($testResultSum->testTriggeredPhpunitErrorEvents(), $testResult->testTriggeredPhpunitErrorEvents()), array_merge_recursive($testResultSum->testTriggeredPhpunitWarningEvents(), $testResult->testTriggeredPhpunitWarningEvents()), array_merge_recursive($testResultSum->testRunnerTriggeredDeprecationEvents(), $testResult->testRunnerTriggeredDeprecationEvents()), array_merge_recursive($testResultSum->testRunnerTriggeredWarningEvents(), $testResult->testRunnerTriggeredWarningEvents()), + array_merge_recursive($testResultSum->errors(), $testResult->errors()), + array_merge_recursive($testResultSum->deprecations(), $testResult->deprecations()), + array_merge_recursive($testResultSum->notices(), $testResult->notices()), + array_merge_recursive($testResultSum->warnings(), $testResult->warnings()), + array_merge_recursive($testResultSum->phpDeprecations(), $testResult->phpDeprecations()), + array_merge_recursive($testResultSum->phpNotices(), $testResult->phpNotices()), + array_merge_recursive($testResultSum->phpWarnings(), $testResult->phpWarnings()), + $testResultSum->numberOfIssuesIgnoredByBaseline() + $testResult->numberOfIssuesIgnoredByBaseline(), ); } @@ -288,16 +296,13 @@ final class WrapperRunner implements RunnerInterface $this->generateLogs(); $exitcode = (new ShellExitCodeCalculator())->calculate( - $this->options->configuration->failOnEmptyTestSuite(), - $this->options->configuration->failOnRisky(), - $this->options->configuration->failOnWarning(), - $this->options->configuration->failOnIncomplete(), - $this->options->configuration->failOnSkipped(), + $this->options->configuration, $testResultSum, ); $this->clearFiles($this->statusFiles); $this->clearFiles($this->progressFiles); + $this->clearFiles($this->unexpectedOutputFiles); $this->clearFiles($this->testresultFiles); $this->clearFiles($this->coverageFiles); $this->clearFiles($this->junitFiles); @@ -314,7 +319,11 @@ final class WrapperRunner implements RunnerInterface } $coverageManager = new CodeCoverage(); - $coverageManager->init($this->options->configuration, $this->codeCoverageFilterRegistry); + $coverageManager->init( + $this->options->configuration, + $this->codeCoverageFilterRegistry, + false, + ); $coverageMerger = new CoverageMerger($coverageManager->codeCoverage()); foreach ($this->coverageFiles as $coverageFile) { $coverageMerger->addCoverageFromFile($coverageFile); @@ -333,6 +342,10 @@ final class WrapperRunner implements RunnerInterface } $testSuite = (new LogMerger())->merge($this->junitFiles); + if ($testSuite === null) { + return; + } + (new Writer())->write( $testSuite, $this->options->configuration->logfileJunit(), diff --git a/vendor/brianium/paratest/src/WrapperRunner/WrapperWorker.php b/vendor/brianium/paratest/src/WrapperRunner/WrapperWorker.php index a6d9c5f5..25120406 100644 --- a/vendor/brianium/paratest/src/WrapperRunner/WrapperWorker.php +++ b/vendor/brianium/paratest/src/WrapperRunner/WrapperWorker.php @@ -32,6 +32,7 @@ final class WrapperWorker public readonly SplFileInfo $statusFile; public readonly SplFileInfo $progressFile; + public readonly SplFileInfo $unexpectedOutputFile; public readonly SplFileInfo $testresultFile; public readonly SplFileInfo $junitFile; public readonly SplFileInfo $coverageFile; @@ -62,6 +63,8 @@ final class WrapperWorker touch($this->statusFile->getPathname()); $this->progressFile = new SplFileInfo($commonTmpFilePath . 'progress'); touch($this->progressFile->getPathname()); + $this->unexpectedOutputFile = new SplFileInfo($commonTmpFilePath . 'unexpected_output'); + touch($this->unexpectedOutputFile->getPathname()); $this->testresultFile = new SplFileInfo($commonTmpFilePath . 'testresult'); if ($options->configuration->hasLogfileJunit()) { $this->junitFile = new SplFileInfo($commonTmpFilePath . 'junit'); @@ -83,6 +86,8 @@ final class WrapperWorker $parameters[] = $this->statusFile->getPathname(); $parameters[] = '--progress-file'; $parameters[] = $this->progressFile->getPathname(); + $parameters[] = '--unexpected-output-file'; + $parameters[] = $this->unexpectedOutputFile->getPathname(); $parameters[] = '--testresult-file'; $parameters[] = $this->testresultFile->getPathname(); if (isset($this->teamcityFile)) { @@ -96,10 +101,17 @@ final class WrapperWorker if ($options->configuration->colors()) { $parameters[] = '--testdox-color'; } + + $parameters[] = '--testdox-columns'; + $parameters[] = (string) $options->configuration->columns(); } $phpunitArguments = [$options->phpunit]; foreach ($options->phpunitOptions as $key => $value) { + if ($options->functional && $key === 'filter') { + continue; + } + $phpunitArguments[] = "--{$key}"; if ($value === true) { continue; diff --git a/vendor/composer/autoload_classmap.php b/vendor/composer/autoload_classmap.php index 81384d9b..7b6504a9 100644 --- a/vendor/composer/autoload_classmap.php +++ b/vendor/composer/autoload_classmap.php @@ -535,6 +535,7 @@ return array( 'DeepCopy\\Matcher\\PropertyTypeMatcher' => $vendorDir . '/myclabs/deep-copy/src/DeepCopy/Matcher/PropertyTypeMatcher.php', 'DeepCopy\\Reflection\\ReflectionHelper' => $vendorDir . '/myclabs/deep-copy/src/DeepCopy/Reflection/ReflectionHelper.php', 'DeepCopy\\TypeFilter\\Date\\DateIntervalFilter' => $vendorDir . '/myclabs/deep-copy/src/DeepCopy/TypeFilter/Date/DateIntervalFilter.php', + 'DeepCopy\\TypeFilter\\Date\\DatePeriodFilter' => $vendorDir . '/myclabs/deep-copy/src/DeepCopy/TypeFilter/Date/DatePeriodFilter.php', 'DeepCopy\\TypeFilter\\ReplaceFilter' => $vendorDir . '/myclabs/deep-copy/src/DeepCopy/TypeFilter/ReplaceFilter.php', 'DeepCopy\\TypeFilter\\ShallowCopyFilter' => $vendorDir . '/myclabs/deep-copy/src/DeepCopy/TypeFilter/ShallowCopyFilter.php', 'DeepCopy\\TypeFilter\\Spl\\ArrayObjectFilter' => $vendorDir . '/myclabs/deep-copy/src/DeepCopy/TypeFilter/Spl/ArrayObjectFilter.php', @@ -1571,9 +1572,12 @@ return array( 'Fidry\\CpuCoreCounter\\Diagnoser' => $vendorDir . '/fidry/cpu-core-counter/src/Diagnoser.php', 'Fidry\\CpuCoreCounter\\Executor\\ProcOpenExecutor' => $vendorDir . '/fidry/cpu-core-counter/src/Executor/ProcOpenExecutor.php', 'Fidry\\CpuCoreCounter\\Executor\\ProcessExecutor' => $vendorDir . '/fidry/cpu-core-counter/src/Executor/ProcessExecutor.php', + 'Fidry\\CpuCoreCounter\\Finder\\CmiCmdletLogicalFinder' => $vendorDir . '/fidry/cpu-core-counter/src/Finder/CmiCmdletLogicalFinder.php', + 'Fidry\\CpuCoreCounter\\Finder\\CmiCmdletPhysicalFinder' => $vendorDir . '/fidry/cpu-core-counter/src/Finder/CmiCmdletPhysicalFinder.php', 'Fidry\\CpuCoreCounter\\Finder\\CpuCoreFinder' => $vendorDir . '/fidry/cpu-core-counter/src/Finder/CpuCoreFinder.php', 'Fidry\\CpuCoreCounter\\Finder\\CpuInfoFinder' => $vendorDir . '/fidry/cpu-core-counter/src/Finder/CpuInfoFinder.php', 'Fidry\\CpuCoreCounter\\Finder\\DummyCpuCoreFinder' => $vendorDir . '/fidry/cpu-core-counter/src/Finder/DummyCpuCoreFinder.php', + 'Fidry\\CpuCoreCounter\\Finder\\EnvVariableFinder' => $vendorDir . '/fidry/cpu-core-counter/src/Finder/EnvVariableFinder.php', 'Fidry\\CpuCoreCounter\\Finder\\FinderRegistry' => $vendorDir . '/fidry/cpu-core-counter/src/Finder/FinderRegistry.php', 'Fidry\\CpuCoreCounter\\Finder\\HwLogicalFinder' => $vendorDir . '/fidry/cpu-core-counter/src/Finder/HwLogicalFinder.php', 'Fidry\\CpuCoreCounter\\Finder\\HwPhysicalFinder' => $vendorDir . '/fidry/cpu-core-counter/src/Finder/HwPhysicalFinder.php', @@ -1582,13 +1586,16 @@ return array( 'Fidry\\CpuCoreCounter\\Finder\\NProcFinder' => $vendorDir . '/fidry/cpu-core-counter/src/Finder/NProcFinder.php', 'Fidry\\CpuCoreCounter\\Finder\\NProcessorFinder' => $vendorDir . '/fidry/cpu-core-counter/src/Finder/NProcessorFinder.php', 'Fidry\\CpuCoreCounter\\Finder\\NullCpuCoreFinder' => $vendorDir . '/fidry/cpu-core-counter/src/Finder/NullCpuCoreFinder.php', + 'Fidry\\CpuCoreCounter\\Finder\\OnlyInPowerShellFinder' => $vendorDir . '/fidry/cpu-core-counter/src/Finder/OnlyInPowerShellFinder.php', 'Fidry\\CpuCoreCounter\\Finder\\OnlyOnOSFamilyFinder' => $vendorDir . '/fidry/cpu-core-counter/src/Finder/OnlyOnOSFamilyFinder.php', 'Fidry\\CpuCoreCounter\\Finder\\ProcOpenBasedFinder' => $vendorDir . '/fidry/cpu-core-counter/src/Finder/ProcOpenBasedFinder.php', 'Fidry\\CpuCoreCounter\\Finder\\SkipOnOSFamilyFinder' => $vendorDir . '/fidry/cpu-core-counter/src/Finder/SkipOnOSFamilyFinder.php', + 'Fidry\\CpuCoreCounter\\Finder\\WindowsRegistryLogicalFinder' => $vendorDir . '/fidry/cpu-core-counter/src/Finder/WindowsRegistryLogicalFinder.php', 'Fidry\\CpuCoreCounter\\Finder\\WmicLogicalFinder' => $vendorDir . '/fidry/cpu-core-counter/src/Finder/WmicLogicalFinder.php', 'Fidry\\CpuCoreCounter\\Finder\\WmicPhysicalFinder' => $vendorDir . '/fidry/cpu-core-counter/src/Finder/WmicPhysicalFinder.php', 'Fidry\\CpuCoreCounter\\Finder\\_NProcessorFinder' => $vendorDir . '/fidry/cpu-core-counter/src/Finder/_NProcessorFinder.php', 'Fidry\\CpuCoreCounter\\NumberOfCpuCoreNotFound' => $vendorDir . '/fidry/cpu-core-counter/src/NumberOfCpuCoreNotFound.php', + 'Fidry\\CpuCoreCounter\\ParallelisationResult' => $vendorDir . '/fidry/cpu-core-counter/src/ParallelisationResult.php', 'Fruitcake\\Cors\\CorsService' => $vendorDir . '/fruitcake/php-cors/src/CorsService.php', 'Fruitcake\\Cors\\Exceptions\\InvalidOptionException' => $vendorDir . '/fruitcake/php-cors/src/Exceptions/InvalidOptionException.php', 'GrahamCampbell\\ResultType\\Error' => $vendorDir . '/graham-campbell/result-type/src/Error.php', @@ -3829,6 +3836,7 @@ return array( 'Nette\\Schema\\Processor' => $vendorDir . '/nette/schema/src/Schema/Processor.php', 'Nette\\Schema\\Schema' => $vendorDir . '/nette/schema/src/Schema/Schema.php', 'Nette\\Schema\\ValidationException' => $vendorDir . '/nette/schema/src/Schema/ValidationException.php', + 'Nette\\ShouldNotHappenException' => $vendorDir . '/nette/utils/src/exceptions.php', 'Nette\\SmartObject' => $vendorDir . '/nette/utils/src/SmartObject.php', 'Nette\\StaticClass' => $vendorDir . '/nette/utils/src/StaticClass.php', 'Nette\\UnexpectedValueException' => $vendorDir . '/nette/utils/src/exceptions.php', @@ -3838,6 +3846,7 @@ return array( 'Nette\\Utils\\AssertionException' => $vendorDir . '/nette/utils/src/Utils/exceptions.php', 'Nette\\Utils\\Callback' => $vendorDir . '/nette/utils/src/Utils/Callback.php', 'Nette\\Utils\\DateTime' => $vendorDir . '/nette/utils/src/Utils/DateTime.php', + 'Nette\\Utils\\DateTimeImmutable' => $vendorDir . '/nette/utils/src/Utils/DateTimeImmutable.php', 'Nette\\Utils\\FileInfo' => $vendorDir . '/nette/utils/src/Utils/FileInfo.php', 'Nette\\Utils\\FileSystem' => $vendorDir . '/nette/utils/src/Utils/FileSystem.php', 'Nette\\Utils\\Finder' => $vendorDir . '/nette/utils/src/Utils/Finder.php', @@ -3846,13 +3855,20 @@ return array( 'Nette\\Utils\\Html' => $vendorDir . '/nette/utils/src/Utils/Html.php', 'Nette\\Utils\\IHtmlString' => $vendorDir . '/nette/utils/src/compatibility.php', 'Nette\\Utils\\Image' => $vendorDir . '/nette/utils/src/Utils/Image.php', + 'Nette\\Utils\\ImageColor' => $vendorDir . '/nette/utils/src/Utils/ImageColor.php', 'Nette\\Utils\\ImageException' => $vendorDir . '/nette/utils/src/Utils/exceptions.php', + 'Nette\\Utils\\ImageType' => $vendorDir . '/nette/utils/src/Utils/ImageType.php', + 'Nette\\Utils\\Iterables' => $vendorDir . '/nette/utils/src/Utils/Iterables.php', 'Nette\\Utils\\Json' => $vendorDir . '/nette/utils/src/Utils/Json.php', 'Nette\\Utils\\JsonException' => $vendorDir . '/nette/utils/src/Utils/exceptions.php', 'Nette\\Utils\\ObjectHelpers' => $vendorDir . '/nette/utils/src/Utils/ObjectHelpers.php', 'Nette\\Utils\\Paginator' => $vendorDir . '/nette/utils/src/Utils/Paginator.php', + 'Nette\\Utils\\Process' => $vendorDir . '/nette/utils/src/Utils/Process.php', + 'Nette\\Utils\\ProcessFailedException' => $vendorDir . '/nette/utils/src/Utils/exceptions.php', + 'Nette\\Utils\\ProcessTimeoutException' => $vendorDir . '/nette/utils/src/Utils/exceptions.php', 'Nette\\Utils\\Random' => $vendorDir . '/nette/utils/src/Utils/Random.php', 'Nette\\Utils\\Reflection' => $vendorDir . '/nette/utils/src/Utils/Reflection.php', + 'Nette\\Utils\\ReflectionMethod' => $vendorDir . '/nette/utils/src/Utils/ReflectionMethod.php', 'Nette\\Utils\\RegexpException' => $vendorDir . '/nette/utils/src/Utils/exceptions.php', 'Nette\\Utils\\Strings' => $vendorDir . '/nette/utils/src/Utils/Strings.php', 'Nette\\Utils\\Type' => $vendorDir . '/nette/utils/src/Utils/Type.php', @@ -3904,6 +3920,7 @@ return array( 'PHPUnit\\Event\\Code\\ClassMethod' => $vendorDir . '/phpunit/phpunit/src/Event/Value/ClassMethod.php', 'PHPUnit\\Event\\Code\\ComparisonFailure' => $vendorDir . '/phpunit/phpunit/src/Event/Value/ComparisonFailure.php', 'PHPUnit\\Event\\Code\\ComparisonFailureBuilder' => $vendorDir . '/phpunit/phpunit/src/Event/Value/ComparisonFailureBuilder.php', + 'PHPUnit\\Event\\Code\\NoTestCaseObjectOnCallStackException' => $vendorDir . '/phpunit/phpunit/src/Event/Exception/NoTestCaseObjectOnCallStackException.php', 'PHPUnit\\Event\\Code\\Phpt' => $vendorDir . '/phpunit/phpunit/src/Event/Value/Test/Phpt.php', 'PHPUnit\\Event\\Code\\Test' => $vendorDir . '/phpunit/phpunit/src/Event/Value/Test/Test.php', 'PHPUnit\\Event\\Code\\TestCollection' => $vendorDir . '/phpunit/phpunit/src/Event/Value/Test/TestCollection.php', @@ -3941,10 +3958,14 @@ return array( 'PHPUnit\\Event\\Subscriber' => $vendorDir . '/phpunit/phpunit/src/Event/Subscriber.php', 'PHPUnit\\Event\\SubscriberTypeAlreadyRegisteredException' => $vendorDir . '/phpunit/phpunit/src/Event/Exception/SubscriberTypeAlreadyRegisteredException.php', 'PHPUnit\\Event\\Telemetry\\Duration' => $vendorDir . '/phpunit/phpunit/src/Event/Value/Telemetry/Duration.php', + 'PHPUnit\\Event\\Telemetry\\GarbageCollectorStatus' => $vendorDir . '/phpunit/phpunit/src/Event/Value/Telemetry/GarbageCollectorStatus.php', + 'PHPUnit\\Event\\Telemetry\\GarbageCollectorStatusProvider' => $vendorDir . '/phpunit/phpunit/src/Event/Value/Telemetry/GarbageCollectorStatusProvider.php', 'PHPUnit\\Event\\Telemetry\\HRTime' => $vendorDir . '/phpunit/phpunit/src/Event/Value/Telemetry/HRTime.php', 'PHPUnit\\Event\\Telemetry\\Info' => $vendorDir . '/phpunit/phpunit/src/Event/Value/Telemetry/Info.php', 'PHPUnit\\Event\\Telemetry\\MemoryMeter' => $vendorDir . '/phpunit/phpunit/src/Event/Value/Telemetry/MemoryMeter.php', 'PHPUnit\\Event\\Telemetry\\MemoryUsage' => $vendorDir . '/phpunit/phpunit/src/Event/Value/Telemetry/MemoryUsage.php', + 'PHPUnit\\Event\\Telemetry\\Php81GarbageCollectorStatusProvider' => $vendorDir . '/phpunit/phpunit/src/Event/Value/Telemetry/Php81GarbageCollectorStatusProvider.php', + 'PHPUnit\\Event\\Telemetry\\Php83GarbageCollectorStatusProvider' => $vendorDir . '/phpunit/phpunit/src/Event/Value/Telemetry/Php83GarbageCollectorStatusProvider.php', 'PHPUnit\\Event\\Telemetry\\Snapshot' => $vendorDir . '/phpunit/phpunit/src/Event/Value/Telemetry/Snapshot.php', 'PHPUnit\\Event\\Telemetry\\StopWatch' => $vendorDir . '/phpunit/phpunit/src/Event/Value/Telemetry/StopWatch.php', 'PHPUnit\\Event\\Telemetry\\System' => $vendorDir . '/phpunit/phpunit/src/Event/Value/Telemetry/System.php', @@ -3966,6 +3987,8 @@ return array( 'PHPUnit\\Event\\TestRunner\\DeprecationTriggeredSubscriber' => $vendorDir . '/phpunit/phpunit/src/Event/Events/TestRunner/DeprecationTriggeredSubscriber.php', 'PHPUnit\\Event\\TestRunner\\EventFacadeSealed' => $vendorDir . '/phpunit/phpunit/src/Event/Events/TestRunner/EventFacadeSealed.php', 'PHPUnit\\Event\\TestRunner\\EventFacadeSealedSubscriber' => $vendorDir . '/phpunit/phpunit/src/Event/Events/TestRunner/EventFacadeSealedSubscriber.php', + 'PHPUnit\\Event\\TestRunner\\ExecutionAborted' => $vendorDir . '/phpunit/phpunit/src/Event/Events/TestRunner/ExecutionAborted.php', + 'PHPUnit\\Event\\TestRunner\\ExecutionAbortedSubscriber' => $vendorDir . '/phpunit/phpunit/src/Event/Events/TestRunner/ExecutionAbortedSubscriber.php', 'PHPUnit\\Event\\TestRunner\\ExecutionFinished' => $vendorDir . '/phpunit/phpunit/src/Event/Events/TestRunner/ExecutionFinished.php', 'PHPUnit\\Event\\TestRunner\\ExecutionFinishedSubscriber' => $vendorDir . '/phpunit/phpunit/src/Event/Events/TestRunner/ExecutionFinishedSubscriber.php', 'PHPUnit\\Event\\TestRunner\\ExecutionStarted' => $vendorDir . '/phpunit/phpunit/src/Event/Events/TestRunner/ExecutionStarted.php', @@ -3976,6 +3999,12 @@ return array( 'PHPUnit\\Event\\TestRunner\\ExtensionLoadedFromPharSubscriber' => $vendorDir . '/phpunit/phpunit/src/Event/Events/TestRunner/ExtensionLoadedFromPharSubscriber.php', 'PHPUnit\\Event\\TestRunner\\Finished' => $vendorDir . '/phpunit/phpunit/src/Event/Events/TestRunner/Finished.php', 'PHPUnit\\Event\\TestRunner\\FinishedSubscriber' => $vendorDir . '/phpunit/phpunit/src/Event/Events/TestRunner/FinishedSubscriber.php', + 'PHPUnit\\Event\\TestRunner\\GarbageCollectionDisabled' => $vendorDir . '/phpunit/phpunit/src/Event/Events/TestRunner/GarbageCollectionDisabled.php', + 'PHPUnit\\Event\\TestRunner\\GarbageCollectionDisabledSubscriber' => $vendorDir . '/phpunit/phpunit/src/Event/Events/TestRunner/GarbageCollectionDisabledSubscriber.php', + 'PHPUnit\\Event\\TestRunner\\GarbageCollectionEnabled' => $vendorDir . '/phpunit/phpunit/src/Event/Events/TestRunner/GarbageCollectionEnabled.php', + 'PHPUnit\\Event\\TestRunner\\GarbageCollectionEnabledSubscriber' => $vendorDir . '/phpunit/phpunit/src/Event/Events/TestRunner/GarbageCollectionEnabledSubscriber.php', + 'PHPUnit\\Event\\TestRunner\\GarbageCollectionTriggered' => $vendorDir . '/phpunit/phpunit/src/Event/Events/TestRunner/GarbageCollectionTriggered.php', + 'PHPUnit\\Event\\TestRunner\\GarbageCollectionTriggeredSubscriber' => $vendorDir . '/phpunit/phpunit/src/Event/Events/TestRunner/GarbageCollectionTriggeredSubscriber.php', 'PHPUnit\\Event\\TestRunner\\Started' => $vendorDir . '/phpunit/phpunit/src/Event/Events/TestRunner/Started.php', 'PHPUnit\\Event\\TestRunner\\StartedSubscriber' => $vendorDir . '/phpunit/phpunit/src/Event/Events/TestRunner/StartedSubscriber.php', 'PHPUnit\\Event\\TestRunner\\WarningTriggered' => $vendorDir . '/phpunit/phpunit/src/Event/Events/TestRunner/WarningTriggered.php', @@ -3999,10 +4028,14 @@ return array( 'PHPUnit\\Event\\TestSuite\\TestSuiteWithName' => $vendorDir . '/phpunit/phpunit/src/Event/Value/TestSuite/TestSuiteWithName.php', 'PHPUnit\\Event\\Test\\AfterLastTestMethodCalled' => $vendorDir . '/phpunit/phpunit/src/Event/Events/Test/HookMethod/AfterLastTestMethodCalled.php', 'PHPUnit\\Event\\Test\\AfterLastTestMethodCalledSubscriber' => $vendorDir . '/phpunit/phpunit/src/Event/Events/Test/HookMethod/AfterLastTestMethodCalledSubscriber.php', + 'PHPUnit\\Event\\Test\\AfterLastTestMethodErrored' => $vendorDir . '/phpunit/phpunit/src/Event/Events/Test/HookMethod/AfterLastTestMethodErrored.php', + 'PHPUnit\\Event\\Test\\AfterLastTestMethodErroredSubscriber' => $vendorDir . '/phpunit/phpunit/src/Event/Events/Test/HookMethod/AfterLastTestMethodErroredSubscriber.php', 'PHPUnit\\Event\\Test\\AfterLastTestMethodFinished' => $vendorDir . '/phpunit/phpunit/src/Event/Events/Test/HookMethod/AfterLastTestMethodFinished.php', 'PHPUnit\\Event\\Test\\AfterLastTestMethodFinishedSubscriber' => $vendorDir . '/phpunit/phpunit/src/Event/Events/Test/HookMethod/AfterLastTestMethodFinishedSubscriber.php', 'PHPUnit\\Event\\Test\\AfterTestMethodCalled' => $vendorDir . '/phpunit/phpunit/src/Event/Events/Test/HookMethod/AfterTestMethodCalled.php', 'PHPUnit\\Event\\Test\\AfterTestMethodCalledSubscriber' => $vendorDir . '/phpunit/phpunit/src/Event/Events/Test/HookMethod/AfterTestMethodCalledSubscriber.php', + 'PHPUnit\\Event\\Test\\AfterTestMethodErrored' => $vendorDir . '/phpunit/phpunit/src/Event/Events/Test/HookMethod/AfterTestMethodErrored.php', + 'PHPUnit\\Event\\Test\\AfterTestMethodErroredSubscriber' => $vendorDir . '/phpunit/phpunit/src/Event/Events/Test/HookMethod/AfterTestMethodErroredSubscriber.php', 'PHPUnit\\Event\\Test\\AfterTestMethodFinished' => $vendorDir . '/phpunit/phpunit/src/Event/Events/Test/HookMethod/AfterTestMethodFinished.php', 'PHPUnit\\Event\\Test\\AfterTestMethodFinishedSubscriber' => $vendorDir . '/phpunit/phpunit/src/Event/Events/Test/HookMethod/AfterTestMethodFinishedSubscriber.php', 'PHPUnit\\Event\\Test\\AssertionFailed' => $vendorDir . '/phpunit/phpunit/src/Event/Events/Test/Assertion/AssertionFailed.php', @@ -4017,12 +4050,18 @@ return array( 'PHPUnit\\Event\\Test\\BeforeFirstTestMethodFinishedSubscriber' => $vendorDir . '/phpunit/phpunit/src/Event/Events/Test/HookMethod/BeforeFirstTestMethodFinishedSubscriber.php', 'PHPUnit\\Event\\Test\\BeforeTestMethodCalled' => $vendorDir . '/phpunit/phpunit/src/Event/Events/Test/HookMethod/BeforeTestMethodCalled.php', 'PHPUnit\\Event\\Test\\BeforeTestMethodCalledSubscriber' => $vendorDir . '/phpunit/phpunit/src/Event/Events/Test/HookMethod/BeforeTestMethodCalledSubscriber.php', + 'PHPUnit\\Event\\Test\\BeforeTestMethodErrored' => $vendorDir . '/phpunit/phpunit/src/Event/Events/Test/HookMethod/BeforeTestMethodErrored.php', + 'PHPUnit\\Event\\Test\\BeforeTestMethodErroredSubscriber' => $vendorDir . '/phpunit/phpunit/src/Event/Events/Test/HookMethod/BeforeTestMethodErroredSubscriber.php', 'PHPUnit\\Event\\Test\\BeforeTestMethodFinished' => $vendorDir . '/phpunit/phpunit/src/Event/Events/Test/HookMethod/BeforeTestMethodFinished.php', 'PHPUnit\\Event\\Test\\BeforeTestMethodFinishedSubscriber' => $vendorDir . '/phpunit/phpunit/src/Event/Events/Test/HookMethod/BeforeTestMethodFinishedSubscriber.php', 'PHPUnit\\Event\\Test\\ComparatorRegistered' => $vendorDir . '/phpunit/phpunit/src/Event/Events/Test/ComparatorRegistered.php', 'PHPUnit\\Event\\Test\\ComparatorRegisteredSubscriber' => $vendorDir . '/phpunit/phpunit/src/Event/Events/Test/ComparatorRegisteredSubscriber.php', 'PHPUnit\\Event\\Test\\ConsideredRisky' => $vendorDir . '/phpunit/phpunit/src/Event/Events/Test/Issue/ConsideredRisky.php', 'PHPUnit\\Event\\Test\\ConsideredRiskySubscriber' => $vendorDir . '/phpunit/phpunit/src/Event/Events/Test/Issue/ConsideredRiskySubscriber.php', + 'PHPUnit\\Event\\Test\\DataProviderMethodCalled' => $vendorDir . '/phpunit/phpunit/src/Event/Events/Test/Lifecycle/DataProviderMethodCalled.php', + 'PHPUnit\\Event\\Test\\DataProviderMethodCalledSubscriber' => $vendorDir . '/phpunit/phpunit/src/Event/Events/Test/Lifecycle/DataProviderMethodCalledSubscriber.php', + 'PHPUnit\\Event\\Test\\DataProviderMethodFinished' => $vendorDir . '/phpunit/phpunit/src/Event/Events/Test/Lifecycle/DataProviderMethodFinished.php', + 'PHPUnit\\Event\\Test\\DataProviderMethodFinishedSubscriber' => $vendorDir . '/phpunit/phpunit/src/Event/Events/Test/Lifecycle/DataProviderMethodFinishedSubscriber.php', 'PHPUnit\\Event\\Test\\DeprecationTriggered' => $vendorDir . '/phpunit/phpunit/src/Event/Events/Test/Issue/DeprecationTriggered.php', 'PHPUnit\\Event\\Test\\DeprecationTriggeredSubscriber' => $vendorDir . '/phpunit/phpunit/src/Event/Events/Test/Issue/DeprecationTriggeredSubscriber.php', 'PHPUnit\\Event\\Test\\ErrorTriggered' => $vendorDir . '/phpunit/phpunit/src/Event/Events/Test/Issue/ErrorTriggered.php', @@ -4066,12 +4105,18 @@ return array( 'PHPUnit\\Event\\Test\\PhpunitWarningTriggeredSubscriber' => $vendorDir . '/phpunit/phpunit/src/Event/Events/Test/Issue/PhpunitWarningTriggeredSubscriber.php', 'PHPUnit\\Event\\Test\\PostConditionCalled' => $vendorDir . '/phpunit/phpunit/src/Event/Events/Test/HookMethod/PostConditionCalled.php', 'PHPUnit\\Event\\Test\\PostConditionCalledSubscriber' => $vendorDir . '/phpunit/phpunit/src/Event/Events/Test/HookMethod/PostConditionCalledSubscriber.php', + 'PHPUnit\\Event\\Test\\PostConditionErrored' => $vendorDir . '/phpunit/phpunit/src/Event/Events/Test/HookMethod/PostConditionErrored.php', + 'PHPUnit\\Event\\Test\\PostConditionErroredSubscriber' => $vendorDir . '/phpunit/phpunit/src/Event/Events/Test/HookMethod/PostConditionErroredSubscriber.php', 'PHPUnit\\Event\\Test\\PostConditionFinished' => $vendorDir . '/phpunit/phpunit/src/Event/Events/Test/HookMethod/PostConditionFinished.php', 'PHPUnit\\Event\\Test\\PostConditionFinishedSubscriber' => $vendorDir . '/phpunit/phpunit/src/Event/Events/Test/HookMethod/PostConditionFinishedSubscriber.php', 'PHPUnit\\Event\\Test\\PreConditionCalled' => $vendorDir . '/phpunit/phpunit/src/Event/Events/Test/HookMethod/PreConditionCalled.php', 'PHPUnit\\Event\\Test\\PreConditionCalledSubscriber' => $vendorDir . '/phpunit/phpunit/src/Event/Events/Test/HookMethod/PreConditionCalledSubscriber.php', + 'PHPUnit\\Event\\Test\\PreConditionErrored' => $vendorDir . '/phpunit/phpunit/src/Event/Events/Test/HookMethod/PreConditionErrored.php', + 'PHPUnit\\Event\\Test\\PreConditionErroredSubscriber' => $vendorDir . '/phpunit/phpunit/src/Event/Events/Test/HookMethod/PreConditionErroredSubscriber.php', 'PHPUnit\\Event\\Test\\PreConditionFinished' => $vendorDir . '/phpunit/phpunit/src/Event/Events/Test/HookMethod/PreConditionFinished.php', 'PHPUnit\\Event\\Test\\PreConditionFinishedSubscriber' => $vendorDir . '/phpunit/phpunit/src/Event/Events/Test/HookMethod/PreConditionFinishedSubscriber.php', + 'PHPUnit\\Event\\Test\\PreparationFailed' => $vendorDir . '/phpunit/phpunit/src/Event/Events/Test/Lifecycle/PreparationFailed.php', + 'PHPUnit\\Event\\Test\\PreparationFailedSubscriber' => $vendorDir . '/phpunit/phpunit/src/Event/Events/Test/Lifecycle/PreparationFailedSubscriber.php', 'PHPUnit\\Event\\Test\\PreparationStarted' => $vendorDir . '/phpunit/phpunit/src/Event/Events/Test/Lifecycle/PreparationStarted.php', 'PHPUnit\\Event\\Test\\PreparationStartedSubscriber' => $vendorDir . '/phpunit/phpunit/src/Event/Events/Test/Lifecycle/PreparationStartedSubscriber.php', 'PHPUnit\\Event\\Test\\Prepared' => $vendorDir . '/phpunit/phpunit/src/Event/Events/Test/Lifecycle/Prepared.php', @@ -4123,6 +4168,10 @@ return array( 'PHPUnit\\Framework\\Attributes\\ExcludeGlobalVariableFromBackup' => $vendorDir . '/phpunit/phpunit/src/Framework/Attributes/ExcludeGlobalVariableFromBackup.php', 'PHPUnit\\Framework\\Attributes\\ExcludeStaticPropertyFromBackup' => $vendorDir . '/phpunit/phpunit/src/Framework/Attributes/ExcludeStaticPropertyFromBackup.php', 'PHPUnit\\Framework\\Attributes\\Group' => $vendorDir . '/phpunit/phpunit/src/Framework/Attributes/Group.php', + 'PHPUnit\\Framework\\Attributes\\IgnoreClassForCodeCoverage' => $vendorDir . '/phpunit/phpunit/src/Framework/Attributes/IgnoreClassForCodeCoverage.php', + 'PHPUnit\\Framework\\Attributes\\IgnoreDeprecations' => $vendorDir . '/phpunit/phpunit/src/Framework/Attributes/IgnoreDeprecations.php', + 'PHPUnit\\Framework\\Attributes\\IgnoreFunctionForCodeCoverage' => $vendorDir . '/phpunit/phpunit/src/Framework/Attributes/IgnoreFunctionForCodeCoverage.php', + 'PHPUnit\\Framework\\Attributes\\IgnoreMethodForCodeCoverage' => $vendorDir . '/phpunit/phpunit/src/Framework/Attributes/IgnoreMethodForCodeCoverage.php', 'PHPUnit\\Framework\\Attributes\\Large' => $vendorDir . '/phpunit/phpunit/src/Framework/Attributes/Large.php', 'PHPUnit\\Framework\\Attributes\\Medium' => $vendorDir . '/phpunit/phpunit/src/Framework/Attributes/Medium.php', 'PHPUnit\\Framework\\Attributes\\PostCondition' => $vendorDir . '/phpunit/phpunit/src/Framework/Attributes/PostCondition.php', @@ -4147,6 +4196,7 @@ return array( 'PHPUnit\\Framework\\Attributes\\Ticket' => $vendorDir . '/phpunit/phpunit/src/Framework/Attributes/Ticket.php', 'PHPUnit\\Framework\\Attributes\\UsesClass' => $vendorDir . '/phpunit/phpunit/src/Framework/Attributes/UsesClass.php', 'PHPUnit\\Framework\\Attributes\\UsesFunction' => $vendorDir . '/phpunit/phpunit/src/Framework/Attributes/UsesFunction.php', + 'PHPUnit\\Framework\\Attributes\\WithoutErrorHandler' => $vendorDir . '/phpunit/phpunit/src/Framework/Attributes/WithoutErrorHandler.php', 'PHPUnit\\Framework\\CodeCoverageException' => $vendorDir . '/phpunit/phpunit/src/Framework/Exception/CodeCoverageException.php', 'PHPUnit\\Framework\\ComparisonMethodDoesNotAcceptParameterTypeException' => $vendorDir . '/phpunit/phpunit/src/Framework/Exception/ObjectEquals/ComparisonMethodDoesNotAcceptParameterTypeException.php', 'PHPUnit\\Framework\\ComparisonMethodDoesNotDeclareBoolReturnTypeException' => $vendorDir . '/phpunit/phpunit/src/Framework/Exception/ObjectEquals/ComparisonMethodDoesNotDeclareBoolReturnTypeException.php', @@ -4190,7 +4240,8 @@ return array( 'PHPUnit\\Framework\\Constraint\\LogicalNot' => $vendorDir . '/phpunit/phpunit/src/Framework/Constraint/Operator/LogicalNot.php', 'PHPUnit\\Framework\\Constraint\\LogicalOr' => $vendorDir . '/phpunit/phpunit/src/Framework/Constraint/Operator/LogicalOr.php', 'PHPUnit\\Framework\\Constraint\\LogicalXor' => $vendorDir . '/phpunit/phpunit/src/Framework/Constraint/Operator/LogicalXor.php', - 'PHPUnit\\Framework\\Constraint\\ObjectEquals' => $vendorDir . '/phpunit/phpunit/src/Framework/Constraint/ObjectEquals.php', + 'PHPUnit\\Framework\\Constraint\\ObjectEquals' => $vendorDir . '/phpunit/phpunit/src/Framework/Constraint/Object/ObjectEquals.php', + 'PHPUnit\\Framework\\Constraint\\ObjectHasProperty' => $vendorDir . '/phpunit/phpunit/src/Framework/Constraint/Object/ObjectHasProperty.php', 'PHPUnit\\Framework\\Constraint\\Operator' => $vendorDir . '/phpunit/phpunit/src/Framework/Constraint/Operator/Operator.php', 'PHPUnit\\Framework\\Constraint\\RegularExpression' => $vendorDir . '/phpunit/phpunit/src/Framework/Constraint/String/RegularExpression.php', 'PHPUnit\\Framework\\Constraint\\SameSize' => $vendorDir . '/phpunit/phpunit/src/Framework/Constraint/Cardinality/SameSize.php', @@ -4206,7 +4257,6 @@ return array( 'PHPUnit\\Framework\\Constraint\\UnaryOperator' => $vendorDir . '/phpunit/phpunit/src/Framework/Constraint/Operator/UnaryOperator.php', 'PHPUnit\\Framework\\DataProviderTestSuite' => $vendorDir . '/phpunit/phpunit/src/Framework/DataProviderTestSuite.php', 'PHPUnit\\Framework\\EmptyStringException' => $vendorDir . '/phpunit/phpunit/src/Framework/Exception/EmptyStringException.php', - 'PHPUnit\\Framework\\Error' => $vendorDir . '/phpunit/phpunit/src/Framework/Exception/Error.php', 'PHPUnit\\Framework\\Exception' => $vendorDir . '/phpunit/phpunit/src/Framework/Exception/Exception.php', 'PHPUnit\\Framework\\ExecutionOrderDependency' => $vendorDir . '/phpunit/phpunit/src/Framework/ExecutionOrderDependency.php', 'PHPUnit\\Framework\\ExpectationFailedException' => $vendorDir . '/phpunit/phpunit/src/Framework/Exception/ExpectationFailedException.php', @@ -4217,77 +4267,83 @@ return array( 'PHPUnit\\Framework\\InvalidCoversTargetException' => $vendorDir . '/phpunit/phpunit/src/Framework/Exception/InvalidCoversTargetException.php', 'PHPUnit\\Framework\\InvalidDataProviderException' => $vendorDir . '/phpunit/phpunit/src/Framework/Exception/InvalidDataProviderException.php', 'PHPUnit\\Framework\\InvalidDependencyException' => $vendorDir . '/phpunit/phpunit/src/Framework/Exception/InvalidDependencyException.php', - 'PHPUnit\\Framework\\MockObject\\Api' => $vendorDir . '/phpunit/phpunit/src/Framework/MockObject/Api/Api.php', 'PHPUnit\\Framework\\MockObject\\BadMethodCallException' => $vendorDir . '/phpunit/phpunit/src/Framework/MockObject/Exception/BadMethodCallException.php', - 'PHPUnit\\Framework\\MockObject\\Builder\\Identity' => $vendorDir . '/phpunit/phpunit/src/Framework/MockObject/Builder/Identity.php', - 'PHPUnit\\Framework\\MockObject\\Builder\\InvocationMocker' => $vendorDir . '/phpunit/phpunit/src/Framework/MockObject/Builder/InvocationMocker.php', - 'PHPUnit\\Framework\\MockObject\\Builder\\InvocationStubber' => $vendorDir . '/phpunit/phpunit/src/Framework/MockObject/Builder/InvocationStubber.php', - 'PHPUnit\\Framework\\MockObject\\Builder\\MethodNameMatch' => $vendorDir . '/phpunit/phpunit/src/Framework/MockObject/Builder/MethodNameMatch.php', - 'PHPUnit\\Framework\\MockObject\\Builder\\ParametersMatch' => $vendorDir . '/phpunit/phpunit/src/Framework/MockObject/Builder/ParametersMatch.php', - 'PHPUnit\\Framework\\MockObject\\Builder\\Stub' => $vendorDir . '/phpunit/phpunit/src/Framework/MockObject/Builder/Stub.php', - 'PHPUnit\\Framework\\MockObject\\CannotUseAddMethodsException' => $vendorDir . '/phpunit/phpunit/src/Framework/MockObject/Exception/CannotUseAddMethodsException.php', + 'PHPUnit\\Framework\\MockObject\\Builder\\Identity' => $vendorDir . '/phpunit/phpunit/src/Framework/MockObject/Runtime/Builder/Identity.php', + 'PHPUnit\\Framework\\MockObject\\Builder\\InvocationMocker' => $vendorDir . '/phpunit/phpunit/src/Framework/MockObject/Runtime/Builder/InvocationMocker.php', + 'PHPUnit\\Framework\\MockObject\\Builder\\InvocationStubber' => $vendorDir . '/phpunit/phpunit/src/Framework/MockObject/Runtime/Builder/InvocationStubber.php', + 'PHPUnit\\Framework\\MockObject\\Builder\\MethodNameMatch' => $vendorDir . '/phpunit/phpunit/src/Framework/MockObject/Runtime/Builder/MethodNameMatch.php', + 'PHPUnit\\Framework\\MockObject\\Builder\\ParametersMatch' => $vendorDir . '/phpunit/phpunit/src/Framework/MockObject/Runtime/Builder/ParametersMatch.php', + 'PHPUnit\\Framework\\MockObject\\Builder\\Stub' => $vendorDir . '/phpunit/phpunit/src/Framework/MockObject/Runtime/Builder/Stub.php', 'PHPUnit\\Framework\\MockObject\\CannotUseOnlyMethodsException' => $vendorDir . '/phpunit/phpunit/src/Framework/MockObject/Exception/CannotUseOnlyMethodsException.php', - 'PHPUnit\\Framework\\MockObject\\ClassAlreadyExistsException' => $vendorDir . '/phpunit/phpunit/src/Framework/MockObject/Exception/ClassAlreadyExistsException.php', - 'PHPUnit\\Framework\\MockObject\\ClassIsEnumerationException' => $vendorDir . '/phpunit/phpunit/src/Framework/MockObject/Exception/ClassIsEnumerationException.php', - 'PHPUnit\\Framework\\MockObject\\ClassIsFinalException' => $vendorDir . '/phpunit/phpunit/src/Framework/MockObject/Exception/ClassIsFinalException.php', - 'PHPUnit\\Framework\\MockObject\\ClassIsReadonlyException' => $vendorDir . '/phpunit/phpunit/src/Framework/MockObject/Exception/ClassIsReadonlyException.php', 'PHPUnit\\Framework\\MockObject\\ConfigurableMethod' => $vendorDir . '/phpunit/phpunit/src/Framework/MockObject/ConfigurableMethod.php', - 'PHPUnit\\Framework\\MockObject\\ConfigurableMethodsAlreadyInitializedException' => $vendorDir . '/phpunit/phpunit/src/Framework/MockObject/Exception/ConfigurableMethodsAlreadyInitializedException.php', - 'PHPUnit\\Framework\\MockObject\\DuplicateMethodException' => $vendorDir . '/phpunit/phpunit/src/Framework/MockObject/Exception/DuplicateMethodException.php', + 'PHPUnit\\Framework\\MockObject\\DoubledCloneMethod' => $vendorDir . '/phpunit/phpunit/src/Framework/MockObject/Runtime/Api/DoubledCloneMethod.php', 'PHPUnit\\Framework\\MockObject\\Exception' => $vendorDir . '/phpunit/phpunit/src/Framework/MockObject/Exception/Exception.php', - 'PHPUnit\\Framework\\MockObject\\Generator' => $vendorDir . '/phpunit/phpunit/src/Framework/MockObject/Generator.php', + 'PHPUnit\\Framework\\MockObject\\Generator\\CannotUseAddMethodsException' => $vendorDir . '/phpunit/phpunit/src/Framework/MockObject/Generator/Exception/CannotUseAddMethodsException.php', + 'PHPUnit\\Framework\\MockObject\\Generator\\ClassIsEnumerationException' => $vendorDir . '/phpunit/phpunit/src/Framework/MockObject/Generator/Exception/ClassIsEnumerationException.php', + 'PHPUnit\\Framework\\MockObject\\Generator\\ClassIsFinalException' => $vendorDir . '/phpunit/phpunit/src/Framework/MockObject/Generator/Exception/ClassIsFinalException.php', + 'PHPUnit\\Framework\\MockObject\\Generator\\ClassIsReadonlyException' => $vendorDir . '/phpunit/phpunit/src/Framework/MockObject/Generator/Exception/ClassIsReadonlyException.php', + 'PHPUnit\\Framework\\MockObject\\Generator\\DuplicateMethodException' => $vendorDir . '/phpunit/phpunit/src/Framework/MockObject/Generator/Exception/DuplicateMethodException.php', + 'PHPUnit\\Framework\\MockObject\\Generator\\Exception' => $vendorDir . '/phpunit/phpunit/src/Framework/MockObject/Generator/Exception/Exception.php', + 'PHPUnit\\Framework\\MockObject\\Generator\\Generator' => $vendorDir . '/phpunit/phpunit/src/Framework/MockObject/Generator/Generator.php', + 'PHPUnit\\Framework\\MockObject\\Generator\\InvalidMethodNameException' => $vendorDir . '/phpunit/phpunit/src/Framework/MockObject/Generator/Exception/InvalidMethodNameException.php', + 'PHPUnit\\Framework\\MockObject\\Generator\\MockClass' => $vendorDir . '/phpunit/phpunit/src/Framework/MockObject/Generator/MockClass.php', + 'PHPUnit\\Framework\\MockObject\\Generator\\MockMethod' => $vendorDir . '/phpunit/phpunit/src/Framework/MockObject/Generator/MockMethod.php', + 'PHPUnit\\Framework\\MockObject\\Generator\\MockMethodSet' => $vendorDir . '/phpunit/phpunit/src/Framework/MockObject/Generator/MockMethodSet.php', + 'PHPUnit\\Framework\\MockObject\\Generator\\MockTrait' => $vendorDir . '/phpunit/phpunit/src/Framework/MockObject/Generator/MockTrait.php', + 'PHPUnit\\Framework\\MockObject\\Generator\\MockType' => $vendorDir . '/phpunit/phpunit/src/Framework/MockObject/Generator/MockType.php', + 'PHPUnit\\Framework\\MockObject\\Generator\\NameAlreadyInUseException' => $vendorDir . '/phpunit/phpunit/src/Framework/MockObject/Generator/Exception/NameAlreadyInUseException.php', + 'PHPUnit\\Framework\\MockObject\\Generator\\OriginalConstructorInvocationRequiredException' => $vendorDir . '/phpunit/phpunit/src/Framework/MockObject/Generator/Exception/OriginalConstructorInvocationRequiredException.php', + 'PHPUnit\\Framework\\MockObject\\Generator\\ReflectionException' => $vendorDir . '/phpunit/phpunit/src/Framework/MockObject/Generator/Exception/ReflectionException.php', + 'PHPUnit\\Framework\\MockObject\\Generator\\RuntimeException' => $vendorDir . '/phpunit/phpunit/src/Framework/MockObject/Generator/Exception/RuntimeException.php', + 'PHPUnit\\Framework\\MockObject\\Generator\\SoapExtensionNotAvailableException' => $vendorDir . '/phpunit/phpunit/src/Framework/MockObject/Generator/Exception/SoapExtensionNotAvailableException.php', + 'PHPUnit\\Framework\\MockObject\\Generator\\TemplateLoader' => $vendorDir . '/phpunit/phpunit/src/Framework/MockObject/Generator/TemplateLoader.php', + 'PHPUnit\\Framework\\MockObject\\Generator\\UnknownClassException' => $vendorDir . '/phpunit/phpunit/src/Framework/MockObject/Generator/Exception/UnknownClassException.php', + 'PHPUnit\\Framework\\MockObject\\Generator\\UnknownTraitException' => $vendorDir . '/phpunit/phpunit/src/Framework/MockObject/Generator/Exception/UnknownTraitException.php', + 'PHPUnit\\Framework\\MockObject\\Generator\\UnknownTypeException' => $vendorDir . '/phpunit/phpunit/src/Framework/MockObject/Generator/Exception/UnknownTypeException.php', 'PHPUnit\\Framework\\MockObject\\IncompatibleReturnValueException' => $vendorDir . '/phpunit/phpunit/src/Framework/MockObject/Exception/IncompatibleReturnValueException.php', - 'PHPUnit\\Framework\\MockObject\\InvalidMethodNameException' => $vendorDir . '/phpunit/phpunit/src/Framework/MockObject/Exception/InvalidMethodNameException.php', - 'PHPUnit\\Framework\\MockObject\\Invocation' => $vendorDir . '/phpunit/phpunit/src/Framework/MockObject/Invocation.php', - 'PHPUnit\\Framework\\MockObject\\InvocationHandler' => $vendorDir . '/phpunit/phpunit/src/Framework/MockObject/InvocationHandler.php', + 'PHPUnit\\Framework\\MockObject\\Invocation' => $vendorDir . '/phpunit/phpunit/src/Framework/MockObject/Runtime/Invocation.php', + 'PHPUnit\\Framework\\MockObject\\InvocationHandler' => $vendorDir . '/phpunit/phpunit/src/Framework/MockObject/Runtime/InvocationHandler.php', 'PHPUnit\\Framework\\MockObject\\MatchBuilderNotFoundException' => $vendorDir . '/phpunit/phpunit/src/Framework/MockObject/Exception/MatchBuilderNotFoundException.php', - 'PHPUnit\\Framework\\MockObject\\Matcher' => $vendorDir . '/phpunit/phpunit/src/Framework/MockObject/Matcher.php', + 'PHPUnit\\Framework\\MockObject\\Matcher' => $vendorDir . '/phpunit/phpunit/src/Framework/MockObject/Runtime/Matcher.php', 'PHPUnit\\Framework\\MockObject\\MatcherAlreadyRegisteredException' => $vendorDir . '/phpunit/phpunit/src/Framework/MockObject/Exception/MatcherAlreadyRegisteredException.php', - 'PHPUnit\\Framework\\MockObject\\Method' => $vendorDir . '/phpunit/phpunit/src/Framework/MockObject/Api/Method.php', + 'PHPUnit\\Framework\\MockObject\\Method' => $vendorDir . '/phpunit/phpunit/src/Framework/MockObject/Runtime/Api/Method.php', 'PHPUnit\\Framework\\MockObject\\MethodCannotBeConfiguredException' => $vendorDir . '/phpunit/phpunit/src/Framework/MockObject/Exception/MethodCannotBeConfiguredException.php', 'PHPUnit\\Framework\\MockObject\\MethodNameAlreadyConfiguredException' => $vendorDir . '/phpunit/phpunit/src/Framework/MockObject/Exception/MethodNameAlreadyConfiguredException.php', - 'PHPUnit\\Framework\\MockObject\\MethodNameConstraint' => $vendorDir . '/phpunit/phpunit/src/Framework/MockObject/MethodNameConstraint.php', + 'PHPUnit\\Framework\\MockObject\\MethodNameConstraint' => $vendorDir . '/phpunit/phpunit/src/Framework/MockObject/Runtime/MethodNameConstraint.php', 'PHPUnit\\Framework\\MockObject\\MethodNameNotConfiguredException' => $vendorDir . '/phpunit/phpunit/src/Framework/MockObject/Exception/MethodNameNotConfiguredException.php', 'PHPUnit\\Framework\\MockObject\\MethodParametersAlreadyConfiguredException' => $vendorDir . '/phpunit/phpunit/src/Framework/MockObject/Exception/MethodParametersAlreadyConfiguredException.php', 'PHPUnit\\Framework\\MockObject\\MockBuilder' => $vendorDir . '/phpunit/phpunit/src/Framework/MockObject/MockBuilder.php', - 'PHPUnit\\Framework\\MockObject\\MockClass' => $vendorDir . '/phpunit/phpunit/src/Framework/MockObject/MockClass.php', - 'PHPUnit\\Framework\\MockObject\\MockMethod' => $vendorDir . '/phpunit/phpunit/src/Framework/MockObject/MockMethod.php', - 'PHPUnit\\Framework\\MockObject\\MockMethodSet' => $vendorDir . '/phpunit/phpunit/src/Framework/MockObject/MockMethodSet.php', - 'PHPUnit\\Framework\\MockObject\\MockObject' => $vendorDir . '/phpunit/phpunit/src/Framework/MockObject/MockObject.php', - 'PHPUnit\\Framework\\MockObject\\MockTrait' => $vendorDir . '/phpunit/phpunit/src/Framework/MockObject/MockTrait.php', - 'PHPUnit\\Framework\\MockObject\\MockType' => $vendorDir . '/phpunit/phpunit/src/Framework/MockObject/MockType.php', - 'PHPUnit\\Framework\\MockObject\\MockedCloneMethod' => $vendorDir . '/phpunit/phpunit/src/Framework/MockObject/Api/MockedCloneMethod.php', - 'PHPUnit\\Framework\\MockObject\\OriginalConstructorInvocationRequiredException' => $vendorDir . '/phpunit/phpunit/src/Framework/MockObject/Exception/OriginalConstructorInvocationRequiredException.php', - 'PHPUnit\\Framework\\MockObject\\ReflectionException' => $vendorDir . '/phpunit/phpunit/src/Framework/MockObject/Exception/ReflectionException.php', + 'PHPUnit\\Framework\\MockObject\\MockObject' => $vendorDir . '/phpunit/phpunit/src/Framework/MockObject/Runtime/Interface/MockObject.php', + 'PHPUnit\\Framework\\MockObject\\MockObjectApi' => $vendorDir . '/phpunit/phpunit/src/Framework/MockObject/Runtime/Api/MockObjectApi.php', + 'PHPUnit\\Framework\\MockObject\\MockObjectInternal' => $vendorDir . '/phpunit/phpunit/src/Framework/MockObject/Runtime/Interface/MockObjectInternal.php', + 'PHPUnit\\Framework\\MockObject\\NeverReturningMethodException' => $vendorDir . '/phpunit/phpunit/src/Framework/MockObject/Exception/NeverReturningMethodException.php', + 'PHPUnit\\Framework\\MockObject\\NoMoreReturnValuesConfiguredException' => $vendorDir . '/phpunit/phpunit/src/Framework/MockObject/Exception/NoMoreReturnValuesConfiguredException.php', + 'PHPUnit\\Framework\\MockObject\\ProxiedCloneMethod' => $vendorDir . '/phpunit/phpunit/src/Framework/MockObject/Runtime/Api/ProxiedCloneMethod.php', + 'PHPUnit\\Framework\\MockObject\\ReturnValueGenerator' => $vendorDir . '/phpunit/phpunit/src/Framework/MockObject/Runtime/ReturnValueGenerator.php', 'PHPUnit\\Framework\\MockObject\\ReturnValueNotConfiguredException' => $vendorDir . '/phpunit/phpunit/src/Framework/MockObject/Exception/ReturnValueNotConfiguredException.php', - 'PHPUnit\\Framework\\MockObject\\Rule\\AnyInvokedCount' => $vendorDir . '/phpunit/phpunit/src/Framework/MockObject/Rule/AnyInvokedCount.php', - 'PHPUnit\\Framework\\MockObject\\Rule\\AnyParameters' => $vendorDir . '/phpunit/phpunit/src/Framework/MockObject/Rule/AnyParameters.php', - 'PHPUnit\\Framework\\MockObject\\Rule\\InvocationOrder' => $vendorDir . '/phpunit/phpunit/src/Framework/MockObject/Rule/InvocationOrder.php', - 'PHPUnit\\Framework\\MockObject\\Rule\\InvokedAtLeastCount' => $vendorDir . '/phpunit/phpunit/src/Framework/MockObject/Rule/InvokedAtLeastCount.php', - 'PHPUnit\\Framework\\MockObject\\Rule\\InvokedAtLeastOnce' => $vendorDir . '/phpunit/phpunit/src/Framework/MockObject/Rule/InvokedAtLeastOnce.php', - 'PHPUnit\\Framework\\MockObject\\Rule\\InvokedAtMostCount' => $vendorDir . '/phpunit/phpunit/src/Framework/MockObject/Rule/InvokedAtMostCount.php', - 'PHPUnit\\Framework\\MockObject\\Rule\\InvokedCount' => $vendorDir . '/phpunit/phpunit/src/Framework/MockObject/Rule/InvokedCount.php', - 'PHPUnit\\Framework\\MockObject\\Rule\\MethodName' => $vendorDir . '/phpunit/phpunit/src/Framework/MockObject/Rule/MethodName.php', - 'PHPUnit\\Framework\\MockObject\\Rule\\Parameters' => $vendorDir . '/phpunit/phpunit/src/Framework/MockObject/Rule/Parameters.php', - 'PHPUnit\\Framework\\MockObject\\Rule\\ParametersRule' => $vendorDir . '/phpunit/phpunit/src/Framework/MockObject/Rule/ParametersRule.php', + 'PHPUnit\\Framework\\MockObject\\Rule\\AnyInvokedCount' => $vendorDir . '/phpunit/phpunit/src/Framework/MockObject/Runtime/Rule/AnyInvokedCount.php', + 'PHPUnit\\Framework\\MockObject\\Rule\\AnyParameters' => $vendorDir . '/phpunit/phpunit/src/Framework/MockObject/Runtime/Rule/AnyParameters.php', + 'PHPUnit\\Framework\\MockObject\\Rule\\InvocationOrder' => $vendorDir . '/phpunit/phpunit/src/Framework/MockObject/Runtime/Rule/InvocationOrder.php', + 'PHPUnit\\Framework\\MockObject\\Rule\\InvokedAtLeastCount' => $vendorDir . '/phpunit/phpunit/src/Framework/MockObject/Runtime/Rule/InvokedAtLeastCount.php', + 'PHPUnit\\Framework\\MockObject\\Rule\\InvokedAtLeastOnce' => $vendorDir . '/phpunit/phpunit/src/Framework/MockObject/Runtime/Rule/InvokedAtLeastOnce.php', + 'PHPUnit\\Framework\\MockObject\\Rule\\InvokedAtMostCount' => $vendorDir . '/phpunit/phpunit/src/Framework/MockObject/Runtime/Rule/InvokedAtMostCount.php', + 'PHPUnit\\Framework\\MockObject\\Rule\\InvokedCount' => $vendorDir . '/phpunit/phpunit/src/Framework/MockObject/Runtime/Rule/InvokedCount.php', + 'PHPUnit\\Framework\\MockObject\\Rule\\MethodName' => $vendorDir . '/phpunit/phpunit/src/Framework/MockObject/Runtime/Rule/MethodName.php', + 'PHPUnit\\Framework\\MockObject\\Rule\\Parameters' => $vendorDir . '/phpunit/phpunit/src/Framework/MockObject/Runtime/Rule/Parameters.php', + 'PHPUnit\\Framework\\MockObject\\Rule\\ParametersRule' => $vendorDir . '/phpunit/phpunit/src/Framework/MockObject/Runtime/Rule/ParametersRule.php', 'PHPUnit\\Framework\\MockObject\\RuntimeException' => $vendorDir . '/phpunit/phpunit/src/Framework/MockObject/Exception/RuntimeException.php', - 'PHPUnit\\Framework\\MockObject\\SoapExtensionNotAvailableException' => $vendorDir . '/phpunit/phpunit/src/Framework/MockObject/Exception/SoapExtensionNotAvailableException.php', - 'PHPUnit\\Framework\\MockObject\\Stub' => $vendorDir . '/phpunit/phpunit/src/Framework/MockObject/Stub.php', - 'PHPUnit\\Framework\\MockObject\\Stub\\ConsecutiveCalls' => $vendorDir . '/phpunit/phpunit/src/Framework/MockObject/Stub/ConsecutiveCalls.php', - 'PHPUnit\\Framework\\MockObject\\Stub\\Exception' => $vendorDir . '/phpunit/phpunit/src/Framework/MockObject/Stub/Exception.php', - 'PHPUnit\\Framework\\MockObject\\Stub\\ReturnArgument' => $vendorDir . '/phpunit/phpunit/src/Framework/MockObject/Stub/ReturnArgument.php', - 'PHPUnit\\Framework\\MockObject\\Stub\\ReturnCallback' => $vendorDir . '/phpunit/phpunit/src/Framework/MockObject/Stub/ReturnCallback.php', - 'PHPUnit\\Framework\\MockObject\\Stub\\ReturnReference' => $vendorDir . '/phpunit/phpunit/src/Framework/MockObject/Stub/ReturnReference.php', - 'PHPUnit\\Framework\\MockObject\\Stub\\ReturnSelf' => $vendorDir . '/phpunit/phpunit/src/Framework/MockObject/Stub/ReturnSelf.php', - 'PHPUnit\\Framework\\MockObject\\Stub\\ReturnStub' => $vendorDir . '/phpunit/phpunit/src/Framework/MockObject/Stub/ReturnStub.php', - 'PHPUnit\\Framework\\MockObject\\Stub\\ReturnValueMap' => $vendorDir . '/phpunit/phpunit/src/Framework/MockObject/Stub/ReturnValueMap.php', - 'PHPUnit\\Framework\\MockObject\\Stub\\Stub' => $vendorDir . '/phpunit/phpunit/src/Framework/MockObject/Stub/Stub.php', - 'PHPUnit\\Framework\\MockObject\\TemplateLoader' => $vendorDir . '/phpunit/phpunit/src/Framework/MockObject/TemplateLoader.php', - 'PHPUnit\\Framework\\MockObject\\UnknownClassException' => $vendorDir . '/phpunit/phpunit/src/Framework/MockObject/Exception/UnknownClassException.php', - 'PHPUnit\\Framework\\MockObject\\UnknownTraitException' => $vendorDir . '/phpunit/phpunit/src/Framework/MockObject/Exception/UnknownTraitException.php', - 'PHPUnit\\Framework\\MockObject\\UnknownTypeException' => $vendorDir . '/phpunit/phpunit/src/Framework/MockObject/Exception/UnknownTypeException.php', - 'PHPUnit\\Framework\\MockObject\\UnmockedCloneMethod' => $vendorDir . '/phpunit/phpunit/src/Framework/MockObject/Api/UnmockedCloneMethod.php', - 'PHPUnit\\Framework\\MockObject\\Verifiable' => $vendorDir . '/phpunit/phpunit/src/Framework/MockObject/Verifiable.php', + 'PHPUnit\\Framework\\MockObject\\Stub' => $vendorDir . '/phpunit/phpunit/src/Framework/MockObject/Runtime/Interface/Stub.php', + 'PHPUnit\\Framework\\MockObject\\StubApi' => $vendorDir . '/phpunit/phpunit/src/Framework/MockObject/Runtime/Api/StubApi.php', + 'PHPUnit\\Framework\\MockObject\\StubInternal' => $vendorDir . '/phpunit/phpunit/src/Framework/MockObject/Runtime/Interface/StubInternal.php', + 'PHPUnit\\Framework\\MockObject\\Stub\\ConsecutiveCalls' => $vendorDir . '/phpunit/phpunit/src/Framework/MockObject/Runtime/Stub/ConsecutiveCalls.php', + 'PHPUnit\\Framework\\MockObject\\Stub\\Exception' => $vendorDir . '/phpunit/phpunit/src/Framework/MockObject/Runtime/Stub/Exception.php', + 'PHPUnit\\Framework\\MockObject\\Stub\\ReturnArgument' => $vendorDir . '/phpunit/phpunit/src/Framework/MockObject/Runtime/Stub/ReturnArgument.php', + 'PHPUnit\\Framework\\MockObject\\Stub\\ReturnCallback' => $vendorDir . '/phpunit/phpunit/src/Framework/MockObject/Runtime/Stub/ReturnCallback.php', + 'PHPUnit\\Framework\\MockObject\\Stub\\ReturnReference' => $vendorDir . '/phpunit/phpunit/src/Framework/MockObject/Runtime/Stub/ReturnReference.php', + 'PHPUnit\\Framework\\MockObject\\Stub\\ReturnSelf' => $vendorDir . '/phpunit/phpunit/src/Framework/MockObject/Runtime/Stub/ReturnSelf.php', + 'PHPUnit\\Framework\\MockObject\\Stub\\ReturnStub' => $vendorDir . '/phpunit/phpunit/src/Framework/MockObject/Runtime/Stub/ReturnStub.php', + 'PHPUnit\\Framework\\MockObject\\Stub\\ReturnValueMap' => $vendorDir . '/phpunit/phpunit/src/Framework/MockObject/Runtime/Stub/ReturnValueMap.php', + 'PHPUnit\\Framework\\MockObject\\Stub\\Stub' => $vendorDir . '/phpunit/phpunit/src/Framework/MockObject/Runtime/Stub/Stub.php', 'PHPUnit\\Framework\\NoChildTestSuiteException' => $vendorDir . '/phpunit/phpunit/src/Framework/Exception/NoChildTestSuiteException.php', 'PHPUnit\\Framework\\PhptAssertionFailedError' => $vendorDir . '/phpunit/phpunit/src/Framework/Exception/PhptAssertionFailedError.php', 'PHPUnit\\Framework\\ProcessIsolationException' => $vendorDir . '/phpunit/phpunit/src/Framework/Exception/ProcessIsolationException.php', @@ -4320,18 +4376,19 @@ return array( 'PHPUnit\\Framework\\TestStatus\\Warning' => $vendorDir . '/phpunit/phpunit/src/Framework/TestStatus/Warning.php', 'PHPUnit\\Framework\\TestSuite' => $vendorDir . '/phpunit/phpunit/src/Framework/TestSuite.php', 'PHPUnit\\Framework\\TestSuiteIterator' => $vendorDir . '/phpunit/phpunit/src/Framework/TestSuiteIterator.php', - 'PHPUnit\\Framework\\UnknownClassException' => $vendorDir . '/phpunit/phpunit/src/Framework/Exception/UnknownClassException.php', 'PHPUnit\\Framework\\UnknownClassOrInterfaceException' => $vendorDir . '/phpunit/phpunit/src/Framework/Exception/UnknownClassOrInterfaceException.php', 'PHPUnit\\Framework\\UnknownTypeException' => $vendorDir . '/phpunit/phpunit/src/Framework/Exception/UnknownTypeException.php', 'PHPUnit\\Logging\\EventLogger' => $vendorDir . '/phpunit/phpunit/src/Logging/EventLogger.php', - 'PHPUnit\\Logging\\Exception' => $vendorDir . '/phpunit/phpunit/src/Logging/Exception.php', 'PHPUnit\\Logging\\JUnit\\JunitXmlLogger' => $vendorDir . '/phpunit/phpunit/src/Logging/JUnit/JunitXmlLogger.php', 'PHPUnit\\Logging\\JUnit\\Subscriber' => $vendorDir . '/phpunit/phpunit/src/Logging/JUnit/Subscriber/Subscriber.php', 'PHPUnit\\Logging\\JUnit\\TestErroredSubscriber' => $vendorDir . '/phpunit/phpunit/src/Logging/JUnit/Subscriber/TestErroredSubscriber.php', 'PHPUnit\\Logging\\JUnit\\TestFailedSubscriber' => $vendorDir . '/phpunit/phpunit/src/Logging/JUnit/Subscriber/TestFailedSubscriber.php', 'PHPUnit\\Logging\\JUnit\\TestFinishedSubscriber' => $vendorDir . '/phpunit/phpunit/src/Logging/JUnit/Subscriber/TestFinishedSubscriber.php', 'PHPUnit\\Logging\\JUnit\\TestMarkedIncompleteSubscriber' => $vendorDir . '/phpunit/phpunit/src/Logging/JUnit/Subscriber/TestMarkedIncompleteSubscriber.php', + 'PHPUnit\\Logging\\JUnit\\TestPreparationFailedSubscriber' => $vendorDir . '/phpunit/phpunit/src/Logging/JUnit/Subscriber/TestPreparationFailedSubscriber.php', + 'PHPUnit\\Logging\\JUnit\\TestPreparationStartedSubscriber' => $vendorDir . '/phpunit/phpunit/src/Logging/JUnit/Subscriber/TestPreparationStartedSubscriber.php', 'PHPUnit\\Logging\\JUnit\\TestPreparedSubscriber' => $vendorDir . '/phpunit/phpunit/src/Logging/JUnit/Subscriber/TestPreparedSubscriber.php', + 'PHPUnit\\Logging\\JUnit\\TestPrintedUnexpectedOutputSubscriber' => $vendorDir . '/phpunit/phpunit/src/Logging/JUnit/Subscriber/TestPrintedUnexpectedOutputSubscriber.php', 'PHPUnit\\Logging\\JUnit\\TestRunnerExecutionFinishedSubscriber' => $vendorDir . '/phpunit/phpunit/src/Logging/JUnit/Subscriber/TestRunnerExecutionFinishedSubscriber.php', 'PHPUnit\\Logging\\JUnit\\TestSkippedSubscriber' => $vendorDir . '/phpunit/phpunit/src/Logging/JUnit/Subscriber/TestSkippedSubscriber.php', 'PHPUnit\\Logging\\JUnit\\TestSuiteFinishedSubscriber' => $vendorDir . '/phpunit/phpunit/src/Logging/JUnit/Subscriber/TestSuiteFinishedSubscriber.php', @@ -4346,31 +4403,35 @@ return array( 'PHPUnit\\Logging\\TeamCity\\TestPreparedSubscriber' => $vendorDir . '/phpunit/phpunit/src/Logging/TeamCity/Subscriber/TestPreparedSubscriber.php', 'PHPUnit\\Logging\\TeamCity\\TestRunnerExecutionFinishedSubscriber' => $vendorDir . '/phpunit/phpunit/src/Logging/TeamCity/Subscriber/TestRunnerExecutionFinishedSubscriber.php', 'PHPUnit\\Logging\\TeamCity\\TestSkippedSubscriber' => $vendorDir . '/phpunit/phpunit/src/Logging/TeamCity/Subscriber/TestSkippedSubscriber.php', + 'PHPUnit\\Logging\\TeamCity\\TestSuiteBeforeFirstTestMethodErroredSubscriber' => $vendorDir . '/phpunit/phpunit/src/Logging/TeamCity/Subscriber/TestSuiteBeforeFirstTestMethodErroredSubscriber.php', 'PHPUnit\\Logging\\TeamCity\\TestSuiteFinishedSubscriber' => $vendorDir . '/phpunit/phpunit/src/Logging/TeamCity/Subscriber/TestSuiteFinishedSubscriber.php', + 'PHPUnit\\Logging\\TeamCity\\TestSuiteSkippedSubscriber' => $vendorDir . '/phpunit/phpunit/src/Logging/TeamCity/Subscriber/TestSuiteSkippedSubscriber.php', 'PHPUnit\\Logging\\TeamCity\\TestSuiteStartedSubscriber' => $vendorDir . '/phpunit/phpunit/src/Logging/TeamCity/Subscriber/TestSuiteStartedSubscriber.php', 'PHPUnit\\Logging\\TestDox\\HtmlRenderer' => $vendorDir . '/phpunit/phpunit/src/Logging/TestDox/HtmlRenderer.php', 'PHPUnit\\Logging\\TestDox\\NamePrettifier' => $vendorDir . '/phpunit/phpunit/src/Logging/TestDox/NamePrettifier.php', 'PHPUnit\\Logging\\TestDox\\PlainTextRenderer' => $vendorDir . '/phpunit/phpunit/src/Logging/TestDox/PlainTextRenderer.php', - 'PHPUnit\\Logging\\TestDox\\Subscriber' => $vendorDir . '/phpunit/phpunit/src/Logging/TestDox/TestMethod/Subscriber/Subscriber.php', - 'PHPUnit\\Logging\\TestDox\\TestConsideredRiskySubscriber' => $vendorDir . '/phpunit/phpunit/src/Logging/TestDox/TestMethod/Subscriber/TestConsideredRiskySubscriber.php', - 'PHPUnit\\Logging\\TestDox\\TestCreatedMockObjectForAbstractClassSubscriber' => $vendorDir . '/phpunit/phpunit/src/Logging/TestDox/TestMethod/Subscriber/TestCreatedMockObjectForAbstractClassSubscriber.php', - 'PHPUnit\\Logging\\TestDox\\TestCreatedMockObjectForTraitSubscriber' => $vendorDir . '/phpunit/phpunit/src/Logging/TestDox/TestMethod/Subscriber/TestCreatedMockObjectForTraitSubscriber.php', - 'PHPUnit\\Logging\\TestDox\\TestCreatedMockObjectFromWsdlSubscriber' => $vendorDir . '/phpunit/phpunit/src/Logging/TestDox/TestMethod/Subscriber/TestCreatedMockObjectFromWsdlSubscriber.php', - 'PHPUnit\\Logging\\TestDox\\TestCreatedMockObjectSubscriber' => $vendorDir . '/phpunit/phpunit/src/Logging/TestDox/TestMethod/Subscriber/TestCreatedMockObjectSubscriber.php', - 'PHPUnit\\Logging\\TestDox\\TestCreatedPartialMockObjectSubscriber' => $vendorDir . '/phpunit/phpunit/src/Logging/TestDox/TestMethod/Subscriber/TestCreatedPartialMockObjectSubscriber.php', - 'PHPUnit\\Logging\\TestDox\\TestCreatedTestProxySubscriber' => $vendorDir . '/phpunit/phpunit/src/Logging/TestDox/TestMethod/Subscriber/TestCreatedTestProxySubscriber.php', - 'PHPUnit\\Logging\\TestDox\\TestCreatedTestStubSubscriber' => $vendorDir . '/phpunit/phpunit/src/Logging/TestDox/TestMethod/Subscriber/TestCreatedTestStubSubscriber.php', - 'PHPUnit\\Logging\\TestDox\\TestErroredSubscriber' => $vendorDir . '/phpunit/phpunit/src/Logging/TestDox/TestMethod/Subscriber/TestErroredSubscriber.php', - 'PHPUnit\\Logging\\TestDox\\TestFailedSubscriber' => $vendorDir . '/phpunit/phpunit/src/Logging/TestDox/TestMethod/Subscriber/TestFailedSubscriber.php', - 'PHPUnit\\Logging\\TestDox\\TestFinishedSubscriber' => $vendorDir . '/phpunit/phpunit/src/Logging/TestDox/TestMethod/Subscriber/TestFinishedSubscriber.php', - 'PHPUnit\\Logging\\TestDox\\TestMarkedIncompleteSubscriber' => $vendorDir . '/phpunit/phpunit/src/Logging/TestDox/TestMethod/Subscriber/TestMarkedIncompleteSubscriber.php', - 'PHPUnit\\Logging\\TestDox\\TestPassedSubscriber' => $vendorDir . '/phpunit/phpunit/src/Logging/TestDox/TestMethod/Subscriber/TestPassedSubscriber.php', - 'PHPUnit\\Logging\\TestDox\\TestPreparedSubscriber' => $vendorDir . '/phpunit/phpunit/src/Logging/TestDox/TestMethod/Subscriber/TestPreparedSubscriber.php', - 'PHPUnit\\Logging\\TestDox\\TestResult' => $vendorDir . '/phpunit/phpunit/src/Logging/TestDox/TestMethod/TestResult.php', - 'PHPUnit\\Logging\\TestDox\\TestResultCollection' => $vendorDir . '/phpunit/phpunit/src/Logging/TestDox/TestMethod/TestResultCollection.php', - 'PHPUnit\\Logging\\TestDox\\TestResultCollectionIterator' => $vendorDir . '/phpunit/phpunit/src/Logging/TestDox/TestMethod/TestResultCollectionIterator.php', - 'PHPUnit\\Logging\\TestDox\\TestResultCollector' => $vendorDir . '/phpunit/phpunit/src/Logging/TestDox/TestMethod/TestResultCollector.php', - 'PHPUnit\\Logging\\TestDox\\TestSkippedSubscriber' => $vendorDir . '/phpunit/phpunit/src/Logging/TestDox/TestMethod/Subscriber/TestSkippedSubscriber.php', + 'PHPUnit\\Logging\\TestDox\\Subscriber' => $vendorDir . '/phpunit/phpunit/src/Logging/TestDox/TestResult/Subscriber/Subscriber.php', + 'PHPUnit\\Logging\\TestDox\\TestConsideredRiskySubscriber' => $vendorDir . '/phpunit/phpunit/src/Logging/TestDox/TestResult/Subscriber/TestConsideredRiskySubscriber.php', + 'PHPUnit\\Logging\\TestDox\\TestErroredSubscriber' => $vendorDir . '/phpunit/phpunit/src/Logging/TestDox/TestResult/Subscriber/TestErroredSubscriber.php', + 'PHPUnit\\Logging\\TestDox\\TestFailedSubscriber' => $vendorDir . '/phpunit/phpunit/src/Logging/TestDox/TestResult/Subscriber/TestFailedSubscriber.php', + 'PHPUnit\\Logging\\TestDox\\TestFinishedSubscriber' => $vendorDir . '/phpunit/phpunit/src/Logging/TestDox/TestResult/Subscriber/TestFinishedSubscriber.php', + 'PHPUnit\\Logging\\TestDox\\TestMarkedIncompleteSubscriber' => $vendorDir . '/phpunit/phpunit/src/Logging/TestDox/TestResult/Subscriber/TestMarkedIncompleteSubscriber.php', + 'PHPUnit\\Logging\\TestDox\\TestPassedSubscriber' => $vendorDir . '/phpunit/phpunit/src/Logging/TestDox/TestResult/Subscriber/TestPassedSubscriber.php', + 'PHPUnit\\Logging\\TestDox\\TestPreparedSubscriber' => $vendorDir . '/phpunit/phpunit/src/Logging/TestDox/TestResult/Subscriber/TestPreparedSubscriber.php', + 'PHPUnit\\Logging\\TestDox\\TestResult' => $vendorDir . '/phpunit/phpunit/src/Logging/TestDox/TestResult/TestResult.php', + 'PHPUnit\\Logging\\TestDox\\TestResultCollection' => $vendorDir . '/phpunit/phpunit/src/Logging/TestDox/TestResult/TestResultCollection.php', + 'PHPUnit\\Logging\\TestDox\\TestResultCollectionIterator' => $vendorDir . '/phpunit/phpunit/src/Logging/TestDox/TestResult/TestResultCollectionIterator.php', + 'PHPUnit\\Logging\\TestDox\\TestResultCollector' => $vendorDir . '/phpunit/phpunit/src/Logging/TestDox/TestResult/TestResultCollector.php', + 'PHPUnit\\Logging\\TestDox\\TestSkippedSubscriber' => $vendorDir . '/phpunit/phpunit/src/Logging/TestDox/TestResult/Subscriber/TestSkippedSubscriber.php', + 'PHPUnit\\Logging\\TestDox\\TestTriggeredDeprecationSubscriber' => $vendorDir . '/phpunit/phpunit/src/Logging/TestDox/TestResult/Subscriber/TestTriggeredDeprecationSubscriber.php', + 'PHPUnit\\Logging\\TestDox\\TestTriggeredNoticeSubscriber' => $vendorDir . '/phpunit/phpunit/src/Logging/TestDox/TestResult/Subscriber/TestTriggeredNoticeSubscriber.php', + 'PHPUnit\\Logging\\TestDox\\TestTriggeredPhpDeprecationSubscriber' => $vendorDir . '/phpunit/phpunit/src/Logging/TestDox/TestResult/Subscriber/TestTriggeredPhpDeprecationSubscriber.php', + 'PHPUnit\\Logging\\TestDox\\TestTriggeredPhpNoticeSubscriber' => $vendorDir . '/phpunit/phpunit/src/Logging/TestDox/TestResult/Subscriber/TestTriggeredPhpNoticeSubscriber.php', + 'PHPUnit\\Logging\\TestDox\\TestTriggeredPhpWarningSubscriber' => $vendorDir . '/phpunit/phpunit/src/Logging/TestDox/TestResult/Subscriber/TestTriggeredPhpWarningSubscriber.php', + 'PHPUnit\\Logging\\TestDox\\TestTriggeredPhpunitDeprecationSubscriber' => $vendorDir . '/phpunit/phpunit/src/Logging/TestDox/TestResult/Subscriber/TestTriggeredPhpunitDeprecationSubscriber.php', + 'PHPUnit\\Logging\\TestDox\\TestTriggeredPhpunitErrorSubscriber' => $vendorDir . '/phpunit/phpunit/src/Logging/TestDox/TestResult/Subscriber/TestTriggeredPhpunitErrorSubscriber.php', + 'PHPUnit\\Logging\\TestDox\\TestTriggeredPhpunitWarningSubscriber' => $vendorDir . '/phpunit/phpunit/src/Logging/TestDox/TestResult/Subscriber/TestTriggeredPhpunitWarningSubscriber.php', + 'PHPUnit\\Logging\\TestDox\\TestTriggeredWarningSubscriber' => $vendorDir . '/phpunit/phpunit/src/Logging/TestDox/TestResult/Subscriber/TestTriggeredWarningSubscriber.php', 'PHPUnit\\Metadata\\After' => $vendorDir . '/phpunit/phpunit/src/Metadata/After.php', 'PHPUnit\\Metadata\\AfterClass' => $vendorDir . '/phpunit/phpunit/src/Metadata/AfterClass.php', 'PHPUnit\\Metadata\\Annotation\\Parser\\DocBlock' => $vendorDir . '/phpunit/phpunit/src/Metadata/Parser/Annotation/DocBlock.php', @@ -4399,6 +4460,11 @@ return array( 'PHPUnit\\Metadata\\ExcludeGlobalVariableFromBackup' => $vendorDir . '/phpunit/phpunit/src/Metadata/ExcludeGlobalVariableFromBackup.php', 'PHPUnit\\Metadata\\ExcludeStaticPropertyFromBackup' => $vendorDir . '/phpunit/phpunit/src/Metadata/ExcludeStaticPropertyFromBackup.php', 'PHPUnit\\Metadata\\Group' => $vendorDir . '/phpunit/phpunit/src/Metadata/Group.php', + 'PHPUnit\\Metadata\\IgnoreClassForCodeCoverage' => $vendorDir . '/phpunit/phpunit/src/Metadata/IgnoreClassForCodeCoverage.php', + 'PHPUnit\\Metadata\\IgnoreDeprecations' => $vendorDir . '/phpunit/phpunit/src/Metadata/IgnoreDeprecations.php', + 'PHPUnit\\Metadata\\IgnoreFunctionForCodeCoverage' => $vendorDir . '/phpunit/phpunit/src/Metadata/IgnoreFunctionForCodeCoverage.php', + 'PHPUnit\\Metadata\\IgnoreMethodForCodeCoverage' => $vendorDir . '/phpunit/phpunit/src/Metadata/IgnoreMethodForCodeCoverage.php', + 'PHPUnit\\Metadata\\InvalidAttributeException' => $vendorDir . '/phpunit/phpunit/src/Metadata/Exception/InvalidAttributeException.php', 'PHPUnit\\Metadata\\InvalidVersionRequirementException' => $vendorDir . '/phpunit/phpunit/src/Metadata/Exception/InvalidVersionRequirementException.php', 'PHPUnit\\Metadata\\Metadata' => $vendorDir . '/phpunit/phpunit/src/Metadata/Metadata.php', 'PHPUnit\\Metadata\\MetadataCollection' => $vendorDir . '/phpunit/phpunit/src/Metadata/MetadataCollection.php', @@ -4435,13 +4501,30 @@ return array( 'PHPUnit\\Metadata\\Version\\ComparisonRequirement' => $vendorDir . '/phpunit/phpunit/src/Metadata/Version/ComparisonRequirement.php', 'PHPUnit\\Metadata\\Version\\ConstraintRequirement' => $vendorDir . '/phpunit/phpunit/src/Metadata/Version/ConstraintRequirement.php', 'PHPUnit\\Metadata\\Version\\Requirement' => $vendorDir . '/phpunit/phpunit/src/Metadata/Version/Requirement.php', + 'PHPUnit\\Metadata\\WithoutErrorHandler' => $vendorDir . '/phpunit/phpunit/src/Metadata/WithoutErrorHandler.php', + 'PHPUnit\\Runner\\Baseline\\Baseline' => $vendorDir . '/phpunit/phpunit/src/Runner/Baseline/Baseline.php', + 'PHPUnit\\Runner\\Baseline\\CannotLoadBaselineException' => $vendorDir . '/phpunit/phpunit/src/Runner/Baseline/Exception/CannotLoadBaselineException.php', + 'PHPUnit\\Runner\\Baseline\\FileDoesNotHaveLineException' => $vendorDir . '/phpunit/phpunit/src/Runner/Baseline/Exception/FileDoesNotHaveLineException.php', + 'PHPUnit\\Runner\\Baseline\\Generator' => $vendorDir . '/phpunit/phpunit/src/Runner/Baseline/Generator.php', + 'PHPUnit\\Runner\\Baseline\\Issue' => $vendorDir . '/phpunit/phpunit/src/Runner/Baseline/Issue.php', + 'PHPUnit\\Runner\\Baseline\\Reader' => $vendorDir . '/phpunit/phpunit/src/Runner/Baseline/Reader.php', + 'PHPUnit\\Runner\\Baseline\\RelativePathCalculator' => $vendorDir . '/phpunit/phpunit/src/Runner/Baseline/RelativePathCalculator.php', + 'PHPUnit\\Runner\\Baseline\\Subscriber' => $vendorDir . '/phpunit/phpunit/src/Runner/Baseline/Subscriber/Subscriber.php', + 'PHPUnit\\Runner\\Baseline\\TestTriggeredDeprecationSubscriber' => $vendorDir . '/phpunit/phpunit/src/Runner/Baseline/Subscriber/TestTriggeredDeprecationSubscriber.php', + 'PHPUnit\\Runner\\Baseline\\TestTriggeredNoticeSubscriber' => $vendorDir . '/phpunit/phpunit/src/Runner/Baseline/Subscriber/TestTriggeredNoticeSubscriber.php', + 'PHPUnit\\Runner\\Baseline\\TestTriggeredPhpDeprecationSubscriber' => $vendorDir . '/phpunit/phpunit/src/Runner/Baseline/Subscriber/TestTriggeredPhpDeprecationSubscriber.php', + 'PHPUnit\\Runner\\Baseline\\TestTriggeredPhpNoticeSubscriber' => $vendorDir . '/phpunit/phpunit/src/Runner/Baseline/Subscriber/TestTriggeredPhpNoticeSubscriber.php', + 'PHPUnit\\Runner\\Baseline\\TestTriggeredPhpWarningSubscriber' => $vendorDir . '/phpunit/phpunit/src/Runner/Baseline/Subscriber/TestTriggeredPhpWarningSubscriber.php', + 'PHPUnit\\Runner\\Baseline\\TestTriggeredWarningSubscriber' => $vendorDir . '/phpunit/phpunit/src/Runner/Baseline/Subscriber/TestTriggeredWarningSubscriber.php', + 'PHPUnit\\Runner\\Baseline\\Writer' => $vendorDir . '/phpunit/phpunit/src/Runner/Baseline/Writer.php', 'PHPUnit\\Runner\\ClassCannotBeFoundException' => $vendorDir . '/phpunit/phpunit/src/Runner/Exception/ClassCannotBeFoundException.php', - 'PHPUnit\\Runner\\ClassCannotBeInstantiatedException' => $vendorDir . '/phpunit/phpunit/src/Runner/Exception/ClassCannotBeInstantiatedException.php', - 'PHPUnit\\Runner\\ClassDoesNotExistException' => $vendorDir . '/phpunit/phpunit/src/Runner/Exception/ClassDoesNotExistException.php', - 'PHPUnit\\Runner\\ClassDoesNotImplementExtensionInterfaceException' => $vendorDir . '/phpunit/phpunit/src/Runner/Exception/ClassDoesNotImplementExtensionInterfaceException.php', + 'PHPUnit\\Runner\\ClassDoesNotExtendTestCaseException' => $vendorDir . '/phpunit/phpunit/src/Runner/Exception/ClassDoesNotExtendTestCaseException.php', 'PHPUnit\\Runner\\ClassIsAbstractException' => $vendorDir . '/phpunit/phpunit/src/Runner/Exception/ClassIsAbstractException.php', 'PHPUnit\\Runner\\CodeCoverage' => $vendorDir . '/phpunit/phpunit/src/Runner/CodeCoverage.php', - 'PHPUnit\\Runner\\DirectoryCannotBeCreatedException' => $vendorDir . '/phpunit/phpunit/src/Runner/Exception/DirectoryCannotBeCreatedException.php', + 'PHPUnit\\Runner\\CodeCoverageFileExistsException' => $vendorDir . '/phpunit/phpunit/src/Runner/Exception/CodeCoverageFileExistsException.php', + 'PHPUnit\\Runner\\DirectoryDoesNotExistException' => $vendorDir . '/phpunit/phpunit/src/Runner/Exception/DirectoryDoesNotExistException.php', + 'PHPUnit\\Runner\\ErrorException' => $vendorDir . '/phpunit/phpunit/src/Runner/Exception/ErrorException.php', + 'PHPUnit\\Runner\\ErrorHandler' => $vendorDir . '/phpunit/phpunit/src/Runner/ErrorHandler.php', 'PHPUnit\\Runner\\Exception' => $vendorDir . '/phpunit/phpunit/src/Runner/Exception/Exception.php', 'PHPUnit\\Runner\\Extension\\Extension' => $vendorDir . '/phpunit/phpunit/src/Runner/Extension/Extension.php', 'PHPUnit\\Runner\\Extension\\ExtensionBootstrapper' => $vendorDir . '/phpunit/phpunit/src/Runner/Extension/ExtensionBootstrapper.php', @@ -4454,13 +4537,17 @@ return array( 'PHPUnit\\Runner\\Filter\\GroupFilterIterator' => $vendorDir . '/phpunit/phpunit/src/Runner/Filter/GroupFilterIterator.php', 'PHPUnit\\Runner\\Filter\\IncludeGroupFilterIterator' => $vendorDir . '/phpunit/phpunit/src/Runner/Filter/IncludeGroupFilterIterator.php', 'PHPUnit\\Runner\\Filter\\NameFilterIterator' => $vendorDir . '/phpunit/phpunit/src/Runner/Filter/NameFilterIterator.php', + 'PHPUnit\\Runner\\Filter\\TestIdFilterIterator' => $vendorDir . '/phpunit/phpunit/src/Runner/Filter/TestIdFilterIterator.php', + 'PHPUnit\\Runner\\GarbageCollection\\ExecutionFinishedSubscriber' => $vendorDir . '/phpunit/phpunit/src/Runner/GarbageCollection/Subscriber/ExecutionFinishedSubscriber.php', + 'PHPUnit\\Runner\\GarbageCollection\\ExecutionStartedSubscriber' => $vendorDir . '/phpunit/phpunit/src/Runner/GarbageCollection/Subscriber/ExecutionStartedSubscriber.php', + 'PHPUnit\\Runner\\GarbageCollection\\GarbageCollectionHandler' => $vendorDir . '/phpunit/phpunit/src/Runner/GarbageCollection/GarbageCollectionHandler.php', + 'PHPUnit\\Runner\\GarbageCollection\\Subscriber' => $vendorDir . '/phpunit/phpunit/src/Runner/GarbageCollection/Subscriber/Subscriber.php', + 'PHPUnit\\Runner\\GarbageCollection\\TestFinishedSubscriber' => $vendorDir . '/phpunit/phpunit/src/Runner/GarbageCollection/Subscriber/TestFinishedSubscriber.php', 'PHPUnit\\Runner\\InvalidOrderException' => $vendorDir . '/phpunit/phpunit/src/Runner/Exception/InvalidOrderException.php', 'PHPUnit\\Runner\\InvalidPhptFileException' => $vendorDir . '/phpunit/phpunit/src/Runner/Exception/InvalidPhptFileException.php', - 'PHPUnit\\Runner\\NoIgnoredEventException' => $vendorDir . '/phpunit/phpunit/src/Runner/Exception/NoIgnoredEventException.php', 'PHPUnit\\Runner\\ParameterDoesNotExistException' => $vendorDir . '/phpunit/phpunit/src/Runner/Exception/ParameterDoesNotExistException.php', 'PHPUnit\\Runner\\PhptExternalFileCannotBeLoadedException' => $vendorDir . '/phpunit/phpunit/src/Runner/Exception/PhptExternalFileCannotBeLoadedException.php', 'PHPUnit\\Runner\\PhptTestCase' => $vendorDir . '/phpunit/phpunit/src/Runner/PhptTestCase.php', - 'PHPUnit\\Runner\\ReflectionException' => $vendorDir . '/phpunit/phpunit/src/Runner/Exception/ReflectionException.php', 'PHPUnit\\Runner\\ResultCache\\DefaultResultCache' => $vendorDir . '/phpunit/phpunit/src/Runner/ResultCache/DefaultResultCache.php', 'PHPUnit\\Runner\\ResultCache\\NullResultCache' => $vendorDir . '/phpunit/phpunit/src/Runner/ResultCache/NullResultCache.php', 'PHPUnit\\Runner\\ResultCache\\ResultCache' => $vendorDir . '/phpunit/phpunit/src/Runner/ResultCache/ResultCache.php', @@ -4479,10 +4566,12 @@ return array( 'PHPUnit\\Runner\\TestSuiteSorter' => $vendorDir . '/phpunit/phpunit/src/Runner/TestSuiteSorter.php', 'PHPUnit\\Runner\\UnsupportedPhptSectionException' => $vendorDir . '/phpunit/phpunit/src/Runner/Exception/UnsupportedPhptSectionException.php', 'PHPUnit\\Runner\\Version' => $vendorDir . '/phpunit/phpunit/src/Runner/Version.php', + 'PHPUnit\\TestRunner\\TestResult\\AfterTestClassMethodErroredSubscriber' => $vendorDir . '/phpunit/phpunit/src/Runner/TestResult/Subscriber/AfterTestClassMethodErroredSubscriber.php', 'PHPUnit\\TestRunner\\TestResult\\BeforeTestClassMethodErroredSubscriber' => $vendorDir . '/phpunit/phpunit/src/Runner/TestResult/Subscriber/BeforeTestClassMethodErroredSubscriber.php', 'PHPUnit\\TestRunner\\TestResult\\Collector' => $vendorDir . '/phpunit/phpunit/src/Runner/TestResult/Collector.php', 'PHPUnit\\TestRunner\\TestResult\\ExecutionStartedSubscriber' => $vendorDir . '/phpunit/phpunit/src/Runner/TestResult/Subscriber/ExecutionStartedSubscriber.php', 'PHPUnit\\TestRunner\\TestResult\\Facade' => $vendorDir . '/phpunit/phpunit/src/Runner/TestResult/Facade.php', + 'PHPUnit\\TestRunner\\TestResult\\Issues\\Issue' => $vendorDir . '/phpunit/phpunit/src/Runner/TestResult/Issue.php', 'PHPUnit\\TestRunner\\TestResult\\PassedTests' => $vendorDir . '/phpunit/phpunit/src/Runner/TestResult/PassedTests.php', 'PHPUnit\\TestRunner\\TestResult\\Subscriber' => $vendorDir . '/phpunit/phpunit/src/Runner/TestResult/Subscriber/Subscriber.php', 'PHPUnit\\TestRunner\\TestResult\\TestConsideredRiskySubscriber' => $vendorDir . '/phpunit/phpunit/src/Runner/TestResult/Subscriber/TestConsideredRiskySubscriber.php', @@ -4509,11 +4598,13 @@ return array( 'PHPUnit\\TestRunner\\TestResult\\TestTriggeredPhpunitWarningSubscriber' => $vendorDir . '/phpunit/phpunit/src/Runner/TestResult/Subscriber/TestTriggeredPhpunitWarningSubscriber.php', 'PHPUnit\\TestRunner\\TestResult\\TestTriggeredWarningSubscriber' => $vendorDir . '/phpunit/phpunit/src/Runner/TestResult/Subscriber/TestTriggeredWarningSubscriber.php', 'PHPUnit\\TextUI\\Application' => $vendorDir . '/phpunit/phpunit/src/TextUI/Application.php', + 'PHPUnit\\TextUI\\CannotOpenSocketException' => $vendorDir . '/phpunit/phpunit/src/TextUI/Exception/CannotOpenSocketException.php', 'PHPUnit\\TextUI\\CliArguments\\Builder' => $vendorDir . '/phpunit/phpunit/src/TextUI/Configuration/Cli/Builder.php', 'PHPUnit\\TextUI\\CliArguments\\Configuration' => $vendorDir . '/phpunit/phpunit/src/TextUI/Configuration/Cli/Configuration.php', 'PHPUnit\\TextUI\\CliArguments\\Exception' => $vendorDir . '/phpunit/phpunit/src/TextUI/Configuration/Cli/Exception.php', 'PHPUnit\\TextUI\\CliArguments\\XmlConfigurationFileFinder' => $vendorDir . '/phpunit/phpunit/src/TextUI/Configuration/Cli/XmlConfigurationFileFinder.php', 'PHPUnit\\TextUI\\Command\\AtLeastVersionCommand' => $vendorDir . '/phpunit/phpunit/src/TextUI/Command/Commands/AtLeastVersionCommand.php', + 'PHPUnit\\TextUI\\Command\\CheckPhpConfigurationCommand' => $vendorDir . '/phpunit/phpunit/src/TextUI/Command/Commands/CheckPhpConfigurationCommand.php', 'PHPUnit\\TextUI\\Command\\Command' => $vendorDir . '/phpunit/phpunit/src/TextUI/Command/Command.php', 'PHPUnit\\TextUI\\Command\\GenerateConfigurationCommand' => $vendorDir . '/phpunit/phpunit/src/TextUI/Command/Commands/GenerateConfigurationCommand.php', 'PHPUnit\\TextUI\\Command\\ListGroupsCommand' => $vendorDir . '/phpunit/phpunit/src/TextUI/Command/Commands/ListGroupsCommand.php', @@ -4551,12 +4642,12 @@ return array( 'PHPUnit\\TextUI\\Configuration\\Group' => $vendorDir . '/phpunit/phpunit/src/TextUI/Configuration/Value/Group.php', 'PHPUnit\\TextUI\\Configuration\\GroupCollection' => $vendorDir . '/phpunit/phpunit/src/TextUI/Configuration/Value/GroupCollection.php', 'PHPUnit\\TextUI\\Configuration\\GroupCollectionIterator' => $vendorDir . '/phpunit/phpunit/src/TextUI/Configuration/Value/GroupCollectionIterator.php', - 'PHPUnit\\TextUI\\Configuration\\IncludePathNotConfiguredException' => $vendorDir . '/phpunit/phpunit/src/TextUI/Configuration/Exception/IncludePathNotConfiguredException.php', 'PHPUnit\\TextUI\\Configuration\\IniSetting' => $vendorDir . '/phpunit/phpunit/src/TextUI/Configuration/Value/IniSetting.php', 'PHPUnit\\TextUI\\Configuration\\IniSettingCollection' => $vendorDir . '/phpunit/phpunit/src/TextUI/Configuration/Value/IniSettingCollection.php', 'PHPUnit\\TextUI\\Configuration\\IniSettingCollectionIterator' => $vendorDir . '/phpunit/phpunit/src/TextUI/Configuration/Value/IniSettingCollectionIterator.php', 'PHPUnit\\TextUI\\Configuration\\LoggingNotConfiguredException' => $vendorDir . '/phpunit/phpunit/src/TextUI/Configuration/Exception/LoggingNotConfiguredException.php', 'PHPUnit\\TextUI\\Configuration\\Merger' => $vendorDir . '/phpunit/phpunit/src/TextUI/Configuration/Merger.php', + 'PHPUnit\\TextUI\\Configuration\\NoBaselineException' => $vendorDir . '/phpunit/phpunit/src/TextUI/Configuration/Exception/NoBaselineException.php', 'PHPUnit\\TextUI\\Configuration\\NoBootstrapException' => $vendorDir . '/phpunit/phpunit/src/TextUI/Configuration/Exception/NoBootstrapException.php', 'PHPUnit\\TextUI\\Configuration\\NoCacheDirectoryException' => $vendorDir . '/phpunit/phpunit/src/TextUI/Configuration/Exception/NoCacheDirectoryException.php', 'PHPUnit\\TextUI\\Configuration\\NoCliArgumentException' => $vendorDir . '/phpunit/phpunit/src/TextUI/Configuration/Exception/NoCliArgumentException.php', @@ -4568,6 +4659,9 @@ return array( 'PHPUnit\\TextUI\\Configuration\\Php' => $vendorDir . '/phpunit/phpunit/src/TextUI/Configuration/Value/Php.php', 'PHPUnit\\TextUI\\Configuration\\PhpHandler' => $vendorDir . '/phpunit/phpunit/src/TextUI/Configuration/PhpHandler.php', 'PHPUnit\\TextUI\\Configuration\\Registry' => $vendorDir . '/phpunit/phpunit/src/TextUI/Configuration/Registry.php', + 'PHPUnit\\TextUI\\Configuration\\Source' => $vendorDir . '/phpunit/phpunit/src/TextUI/Configuration/Value/Source.php', + 'PHPUnit\\TextUI\\Configuration\\SourceFilter' => $vendorDir . '/phpunit/phpunit/src/TextUI/Configuration/SourceFilter.php', + 'PHPUnit\\TextUI\\Configuration\\SourceMapper' => $vendorDir . '/phpunit/phpunit/src/TextUI/Configuration/SourceMapper.php', 'PHPUnit\\TextUI\\Configuration\\TestDirectory' => $vendorDir . '/phpunit/phpunit/src/TextUI/Configuration/Value/TestDirectory.php', 'PHPUnit\\TextUI\\Configuration\\TestDirectoryCollection' => $vendorDir . '/phpunit/phpunit/src/TextUI/Configuration/Value/TestDirectoryCollection.php', 'PHPUnit\\TextUI\\Configuration\\TestDirectoryCollectionIterator' => $vendorDir . '/phpunit/phpunit/src/TextUI/Configuration/Value/TestDirectoryCollectionIterator.php', @@ -4582,8 +4676,8 @@ return array( 'PHPUnit\\TextUI\\Configuration\\VariableCollection' => $vendorDir . '/phpunit/phpunit/src/TextUI/Configuration/Value/VariableCollection.php', 'PHPUnit\\TextUI\\Configuration\\VariableCollectionIterator' => $vendorDir . '/phpunit/phpunit/src/TextUI/Configuration/Value/VariableCollectionIterator.php', 'PHPUnit\\TextUI\\Exception' => $vendorDir . '/phpunit/phpunit/src/TextUI/Exception/Exception.php', - 'PHPUnit\\TextUI\\ExtensionsNotConfiguredException' => $vendorDir . '/phpunit/phpunit/src/TextUI/Exception/ExtensionsNotConfiguredException.php', 'PHPUnit\\TextUI\\Help' => $vendorDir . '/phpunit/phpunit/src/TextUI/Help.php', + 'PHPUnit\\TextUI\\InvalidSocketException' => $vendorDir . '/phpunit/phpunit/src/TextUI/Exception/InvalidSocketException.php', 'PHPUnit\\TextUI\\Output\\DefaultPrinter' => $vendorDir . '/phpunit/phpunit/src/TextUI/Output/Printer/DefaultPrinter.php', 'PHPUnit\\TextUI\\Output\\Default\\ProgressPrinter\\BeforeTestClassMethodErroredSubscriber' => $vendorDir . '/phpunit/phpunit/src/TextUI/Output/Default/ProgressPrinter/Subscriber/BeforeTestClassMethodErroredSubscriber.php', 'PHPUnit\\TextUI\\Output\\Default\\ProgressPrinter\\ProgressPrinter' => $vendorDir . '/phpunit/phpunit/src/TextUI/Output/Default/ProgressPrinter/ProgressPrinter.php', @@ -4594,10 +4688,10 @@ return array( 'PHPUnit\\TextUI\\Output\\Default\\ProgressPrinter\\TestFinishedSubscriber' => $vendorDir . '/phpunit/phpunit/src/TextUI/Output/Default/ProgressPrinter/Subscriber/TestFinishedSubscriber.php', 'PHPUnit\\TextUI\\Output\\Default\\ProgressPrinter\\TestMarkedIncompleteSubscriber' => $vendorDir . '/phpunit/phpunit/src/TextUI/Output/Default/ProgressPrinter/Subscriber/TestMarkedIncompleteSubscriber.php', 'PHPUnit\\TextUI\\Output\\Default\\ProgressPrinter\\TestPreparedSubscriber' => $vendorDir . '/phpunit/phpunit/src/TextUI/Output/Default/ProgressPrinter/Subscriber/TestPreparedSubscriber.php', - 'PHPUnit\\TextUI\\Output\\Default\\ProgressPrinter\\TestPrintedUnexpectedOutputSubscriber' => $vendorDir . '/phpunit/phpunit/src/TextUI/Output/Default/ProgressPrinter/Subscriber/TestPrintedUnexpectedOutputSubscriber.php', 'PHPUnit\\TextUI\\Output\\Default\\ProgressPrinter\\TestRunnerExecutionStartedSubscriber' => $vendorDir . '/phpunit/phpunit/src/TextUI/Output/Default/ProgressPrinter/Subscriber/TestRunnerExecutionStartedSubscriber.php', 'PHPUnit\\TextUI\\Output\\Default\\ProgressPrinter\\TestSkippedSubscriber' => $vendorDir . '/phpunit/phpunit/src/TextUI/Output/Default/ProgressPrinter/Subscriber/TestSkippedSubscriber.php', 'PHPUnit\\TextUI\\Output\\Default\\ProgressPrinter\\TestTriggeredDeprecationSubscriber' => $vendorDir . '/phpunit/phpunit/src/TextUI/Output/Default/ProgressPrinter/Subscriber/TestTriggeredDeprecationSubscriber.php', + 'PHPUnit\\TextUI\\Output\\Default\\ProgressPrinter\\TestTriggeredErrorSubscriber' => $vendorDir . '/phpunit/phpunit/src/TextUI/Output/Default/ProgressPrinter/Subscriber/TestTriggeredErrorSubscriber.php', 'PHPUnit\\TextUI\\Output\\Default\\ProgressPrinter\\TestTriggeredNoticeSubscriber' => $vendorDir . '/phpunit/phpunit/src/TextUI/Output/Default/ProgressPrinter/Subscriber/TestTriggeredNoticeSubscriber.php', 'PHPUnit\\TextUI\\Output\\Default\\ProgressPrinter\\TestTriggeredPhpDeprecationSubscriber' => $vendorDir . '/phpunit/phpunit/src/TextUI/Output/Default/ProgressPrinter/Subscriber/TestTriggeredPhpDeprecationSubscriber.php', 'PHPUnit\\TextUI\\Output\\Default\\ProgressPrinter\\TestTriggeredPhpNoticeSubscriber' => $vendorDir . '/phpunit/phpunit/src/TextUI/Output/Default/ProgressPrinter/Subscriber/TestTriggeredPhpNoticeSubscriber.php', @@ -4606,18 +4700,19 @@ return array( 'PHPUnit\\TextUI\\Output\\Default\\ProgressPrinter\\TestTriggeredPhpunitWarningSubscriber' => $vendorDir . '/phpunit/phpunit/src/TextUI/Output/Default/ProgressPrinter/Subscriber/TestTriggeredPhpunitWarningSubscriber.php', 'PHPUnit\\TextUI\\Output\\Default\\ProgressPrinter\\TestTriggeredWarningSubscriber' => $vendorDir . '/phpunit/phpunit/src/TextUI/Output/Default/ProgressPrinter/Subscriber/TestTriggeredWarningSubscriber.php', 'PHPUnit\\TextUI\\Output\\Default\\ResultPrinter' => $vendorDir . '/phpunit/phpunit/src/TextUI/Output/Default/ResultPrinter.php', + 'PHPUnit\\TextUI\\Output\\Default\\UnexpectedOutputPrinter' => $vendorDir . '/phpunit/phpunit/src/TextUI/Output/Default/UnexpectedOutputPrinter.php', 'PHPUnit\\TextUI\\Output\\Facade' => $vendorDir . '/phpunit/phpunit/src/TextUI/Output/Facade.php', 'PHPUnit\\TextUI\\Output\\NullPrinter' => $vendorDir . '/phpunit/phpunit/src/TextUI/Output/Printer/NullPrinter.php', 'PHPUnit\\TextUI\\Output\\Printer' => $vendorDir . '/phpunit/phpunit/src/TextUI/Output/Printer/Printer.php', 'PHPUnit\\TextUI\\Output\\SummaryPrinter' => $vendorDir . '/phpunit/phpunit/src/TextUI/Output/SummaryPrinter.php', 'PHPUnit\\TextUI\\Output\\TestDox\\ResultPrinter' => $vendorDir . '/phpunit/phpunit/src/TextUI/Output/TestDox/ResultPrinter.php', - 'PHPUnit\\TextUI\\ReflectionException' => $vendorDir . '/phpunit/phpunit/src/TextUI/Exception/ReflectionException.php', 'PHPUnit\\TextUI\\RuntimeException' => $vendorDir . '/phpunit/phpunit/src/TextUI/Exception/RuntimeException.php', 'PHPUnit\\TextUI\\ShellExitCodeCalculator' => $vendorDir . '/phpunit/phpunit/src/TextUI/ShellExitCodeCalculator.php', 'PHPUnit\\TextUI\\TestDirectoryNotFoundException' => $vendorDir . '/phpunit/phpunit/src/TextUI/Exception/TestDirectoryNotFoundException.php', 'PHPUnit\\TextUI\\TestFileNotFoundException' => $vendorDir . '/phpunit/phpunit/src/TextUI/Exception/TestFileNotFoundException.php', 'PHPUnit\\TextUI\\TestRunner' => $vendorDir . '/phpunit/phpunit/src/TextUI/TestRunner.php', 'PHPUnit\\TextUI\\TestSuiteFilterProcessor' => $vendorDir . '/phpunit/phpunit/src/TextUI/TestSuiteFilterProcessor.php', + 'PHPUnit\\TextUI\\XmlConfiguration\\CannotFindSchemaException' => $vendorDir . '/phpunit/phpunit/src/TextUI/Configuration/Exception/CannotFindSchemaException.php', 'PHPUnit\\TextUI\\XmlConfiguration\\CodeCoverage\\CodeCoverage' => $vendorDir . '/phpunit/phpunit/src/TextUI/Configuration/Xml/CodeCoverage/CodeCoverage.php', 'PHPUnit\\TextUI\\XmlConfiguration\\CodeCoverage\\Report\\Clover' => $vendorDir . '/phpunit/phpunit/src/TextUI/Configuration/Xml/CodeCoverage/Report/Clover.php', 'PHPUnit\\TextUI\\XmlConfiguration\\CodeCoverage\\Report\\Cobertura' => $vendorDir . '/phpunit/phpunit/src/TextUI/Configuration/Xml/CodeCoverage/Report/Cobertura.php', @@ -4636,6 +4731,7 @@ return array( 'PHPUnit\\TextUI\\XmlConfiguration\\CoverageXmlToReport' => $vendorDir . '/phpunit/phpunit/src/TextUI/Configuration/Xml/Migration/Migrations/CoverageXmlToReport.php', 'PHPUnit\\TextUI\\XmlConfiguration\\DefaultConfiguration' => $vendorDir . '/phpunit/phpunit/src/TextUI/Configuration/Xml/DefaultConfiguration.php', 'PHPUnit\\TextUI\\XmlConfiguration\\Exception' => $vendorDir . '/phpunit/phpunit/src/TextUI/Configuration/Xml/Exception.php', + 'PHPUnit\\TextUI\\XmlConfiguration\\FailedSchemaDetectionResult' => $vendorDir . '/phpunit/phpunit/src/TextUI/Configuration/Xml/SchemaDetector/FailedSchemaDetectionResult.php', 'PHPUnit\\TextUI\\XmlConfiguration\\Generator' => $vendorDir . '/phpunit/phpunit/src/TextUI/Configuration/Xml/Generator.php', 'PHPUnit\\TextUI\\XmlConfiguration\\Groups' => $vendorDir . '/phpunit/phpunit/src/TextUI/Configuration/Xml/Groups.php', 'PHPUnit\\TextUI\\XmlConfiguration\\IntroduceCacheDirectoryAttribute' => $vendorDir . '/phpunit/phpunit/src/TextUI/Configuration/Xml/Migration/Migrations/IntroduceCacheDirectoryAttribute.php', @@ -4650,13 +4746,13 @@ return array( 'PHPUnit\\TextUI\\XmlConfiguration\\Logging\\TestDox\\Text' => $vendorDir . '/phpunit/phpunit/src/TextUI/Configuration/Xml/Logging/TestDox/Text.php', 'PHPUnit\\TextUI\\XmlConfiguration\\Migration' => $vendorDir . '/phpunit/phpunit/src/TextUI/Configuration/Xml/Migration/Migrations/Migration.php', 'PHPUnit\\TextUI\\XmlConfiguration\\MigrationBuilder' => $vendorDir . '/phpunit/phpunit/src/TextUI/Configuration/Xml/Migration/MigrationBuilder.php', - 'PHPUnit\\TextUI\\XmlConfiguration\\MigrationBuilderException' => $vendorDir . '/phpunit/phpunit/src/TextUI/Configuration/Xml/Migration/MigrationBuilderException.php', 'PHPUnit\\TextUI\\XmlConfiguration\\MigrationException' => $vendorDir . '/phpunit/phpunit/src/TextUI/Configuration/Xml/Migration/MigrationException.php', 'PHPUnit\\TextUI\\XmlConfiguration\\Migrator' => $vendorDir . '/phpunit/phpunit/src/TextUI/Configuration/Xml/Migration/Migrator.php', 'PHPUnit\\TextUI\\XmlConfiguration\\MoveAttributesFromFilterWhitelistToCoverage' => $vendorDir . '/phpunit/phpunit/src/TextUI/Configuration/Xml/Migration/Migrations/MoveAttributesFromFilterWhitelistToCoverage.php', 'PHPUnit\\TextUI\\XmlConfiguration\\MoveAttributesFromRootToCoverage' => $vendorDir . '/phpunit/phpunit/src/TextUI/Configuration/Xml/Migration/Migrations/MoveAttributesFromRootToCoverage.php', - 'PHPUnit\\TextUI\\XmlConfiguration\\MoveWhitelistDirectoriesToCoverage' => $vendorDir . '/phpunit/phpunit/src/TextUI/Configuration/Xml/Migration/Migrations/MoveWhitelistDirectoriesToCoverage.php', + 'PHPUnit\\TextUI\\XmlConfiguration\\MoveCoverageDirectoriesToSource' => $vendorDir . '/phpunit/phpunit/src/TextUI/Configuration/Xml/Migration/Migrations/MoveCoverageDirectoriesToSource.php', 'PHPUnit\\TextUI\\XmlConfiguration\\MoveWhitelistExcludesToCoverage' => $vendorDir . '/phpunit/phpunit/src/TextUI/Configuration/Xml/Migration/Migrations/MoveWhitelistExcludesToCoverage.php', + 'PHPUnit\\TextUI\\XmlConfiguration\\MoveWhitelistIncludesToCoverage' => $vendorDir . '/phpunit/phpunit/src/TextUI/Configuration/Xml/Migration/Migrations/MoveWhitelistIncludesToCoverage.php', 'PHPUnit\\TextUI\\XmlConfiguration\\PHPUnit' => $vendorDir . '/phpunit/phpunit/src/TextUI/Configuration/Xml/PHPUnit.php', 'PHPUnit\\TextUI\\XmlConfiguration\\RemoveBeStrictAboutResourceUsageDuringSmallTestsAttribute' => $vendorDir . '/phpunit/phpunit/src/TextUI/Configuration/Xml/Migration/Migrations/RemoveBeStrictAboutResourceUsageDuringSmallTestsAttribute.php', 'PHPUnit\\TextUI\\XmlConfiguration\\RemoveBeStrictAboutTodoAnnotatedTestsAttribute' => $vendorDir . '/phpunit/phpunit/src/TextUI/Configuration/Xml/Migration/Migrations/RemoveBeStrictAboutTodoAnnotatedTestsAttribute.php', @@ -4677,42 +4773,38 @@ return array( 'PHPUnit\\TextUI\\XmlConfiguration\\RenameBackupStaticAttributesAttribute' => $vendorDir . '/phpunit/phpunit/src/TextUI/Configuration/Xml/Migration/Migrations/RenameBackupStaticAttributesAttribute.php', 'PHPUnit\\TextUI\\XmlConfiguration\\RenameBeStrictAboutCoversAnnotationAttribute' => $vendorDir . '/phpunit/phpunit/src/TextUI/Configuration/Xml/Migration/Migrations/RenameBeStrictAboutCoversAnnotationAttribute.php', 'PHPUnit\\TextUI\\XmlConfiguration\\RenameForceCoversAnnotationAttribute' => $vendorDir . '/phpunit/phpunit/src/TextUI/Configuration/Xml/Migration/Migrations/RenameForceCoversAnnotationAttribute.php', + 'PHPUnit\\TextUI\\XmlConfiguration\\SchemaDetectionResult' => $vendorDir . '/phpunit/phpunit/src/TextUI/Configuration/Xml/SchemaDetector/SchemaDetectionResult.php', + 'PHPUnit\\TextUI\\XmlConfiguration\\SchemaDetector' => $vendorDir . '/phpunit/phpunit/src/TextUI/Configuration/Xml/SchemaDetector/SchemaDetector.php', + 'PHPUnit\\TextUI\\XmlConfiguration\\SchemaFinder' => $vendorDir . '/phpunit/phpunit/src/TextUI/Configuration/Xml/SchemaFinder.php', + 'PHPUnit\\TextUI\\XmlConfiguration\\SnapshotNodeList' => $vendorDir . '/phpunit/phpunit/src/TextUI/Configuration/Xml/Migration/SnapshotNodeList.php', + 'PHPUnit\\TextUI\\XmlConfiguration\\SuccessfulSchemaDetectionResult' => $vendorDir . '/phpunit/phpunit/src/TextUI/Configuration/Xml/SchemaDetector/SuccessfulSchemaDetectionResult.php', 'PHPUnit\\TextUI\\XmlConfiguration\\TestSuiteMapper' => $vendorDir . '/phpunit/phpunit/src/TextUI/Configuration/Xml/TestSuiteMapper.php', 'PHPUnit\\TextUI\\XmlConfiguration\\UpdateSchemaLocation' => $vendorDir . '/phpunit/phpunit/src/TextUI/Configuration/Xml/Migration/Migrations/UpdateSchemaLocation.php', + 'PHPUnit\\TextUI\\XmlConfiguration\\ValidationResult' => $vendorDir . '/phpunit/phpunit/src/TextUI/Configuration/Xml/Validator/ValidationResult.php', + 'PHPUnit\\TextUI\\XmlConfiguration\\Validator' => $vendorDir . '/phpunit/phpunit/src/TextUI/Configuration/Xml/Validator/Validator.php', 'PHPUnit\\Util\\Cloner' => $vendorDir . '/phpunit/phpunit/src/Util/Cloner.php', 'PHPUnit\\Util\\Color' => $vendorDir . '/phpunit/phpunit/src/Util/Color.php', - 'PHPUnit\\Util\\DirectoryDoesNotExistException' => $vendorDir . '/phpunit/phpunit/src/Util/Exception/DirectoryDoesNotExistException.php', - 'PHPUnit\\Util\\ErrorHandler' => $vendorDir . '/phpunit/phpunit/src/Util/ErrorHandler.php', 'PHPUnit\\Util\\Exception' => $vendorDir . '/phpunit/phpunit/src/Util/Exception/Exception.php', 'PHPUnit\\Util\\ExcludeList' => $vendorDir . '/phpunit/phpunit/src/Util/ExcludeList.php', + 'PHPUnit\\Util\\Exporter' => $vendorDir . '/phpunit/phpunit/src/Util/Exporter.php', 'PHPUnit\\Util\\Filesystem' => $vendorDir . '/phpunit/phpunit/src/Util/Filesystem.php', 'PHPUnit\\Util\\Filter' => $vendorDir . '/phpunit/phpunit/src/Util/Filter.php', 'PHPUnit\\Util\\GlobalState' => $vendorDir . '/phpunit/phpunit/src/Util/GlobalState.php', + 'PHPUnit\\Util\\Http\\Downloader' => $vendorDir . '/phpunit/phpunit/src/Util/Http/Downloader.php', + 'PHPUnit\\Util\\Http\\PhpDownloader' => $vendorDir . '/phpunit/phpunit/src/Util/Http/PhpDownloader.php', 'PHPUnit\\Util\\InvalidDirectoryException' => $vendorDir . '/phpunit/phpunit/src/Util/Exception/InvalidDirectoryException.php', 'PHPUnit\\Util\\InvalidJsonException' => $vendorDir . '/phpunit/phpunit/src/Util/Exception/InvalidJsonException.php', - 'PHPUnit\\Util\\InvalidSocketException' => $vendorDir . '/phpunit/phpunit/src/Util/Exception/InvalidSocketException.php', 'PHPUnit\\Util\\InvalidVersionOperatorException' => $vendorDir . '/phpunit/phpunit/src/Util/Exception/InvalidVersionOperatorException.php', 'PHPUnit\\Util\\Json' => $vendorDir . '/phpunit/phpunit/src/Util/Json.php', - 'PHPUnit\\Util\\NoTestCaseObjectOnCallStackException' => $vendorDir . '/phpunit/phpunit/src/Util/Exception/NoTestCaseObjectOnCallStackException.php', 'PHPUnit\\Util\\PHP\\AbstractPhpProcess' => $vendorDir . '/phpunit/phpunit/src/Util/PHP/AbstractPhpProcess.php', 'PHPUnit\\Util\\PHP\\DefaultPhpProcess' => $vendorDir . '/phpunit/phpunit/src/Util/PHP/DefaultPhpProcess.php', 'PHPUnit\\Util\\PHP\\PhpProcessException' => $vendorDir . '/phpunit/phpunit/src/Util/Exception/PhpProcessException.php', - 'PHPUnit\\Util\\PHP\\WindowsPhpProcess' => $vendorDir . '/phpunit/phpunit/src/Util/PHP/WindowsPhpProcess.php', 'PHPUnit\\Util\\Reflection' => $vendorDir . '/phpunit/phpunit/src/Util/Reflection.php', 'PHPUnit\\Util\\Test' => $vendorDir . '/phpunit/phpunit/src/Util/Test.php', 'PHPUnit\\Util\\ThrowableToStringMapper' => $vendorDir . '/phpunit/phpunit/src/Util/ThrowableToStringMapper.php', 'PHPUnit\\Util\\VersionComparisonOperator' => $vendorDir . '/phpunit/phpunit/src/Util/VersionComparisonOperator.php', - 'PHPUnit\\Util\\Xml' => $vendorDir . '/phpunit/phpunit/src/Util/Xml.php', - 'PHPUnit\\Util\\Xml\\Exception' => $vendorDir . '/phpunit/phpunit/src/Util/Xml/Exception.php', - 'PHPUnit\\Util\\Xml\\FailedSchemaDetectionResult' => $vendorDir . '/phpunit/phpunit/src/Util/Xml/FailedSchemaDetectionResult.php', + 'PHPUnit\\Util\\Xml' => $vendorDir . '/phpunit/phpunit/src/Util/Xml/Xml.php', 'PHPUnit\\Util\\Xml\\Loader' => $vendorDir . '/phpunit/phpunit/src/Util/Xml/Loader.php', - 'PHPUnit\\Util\\Xml\\SchemaDetectionResult' => $vendorDir . '/phpunit/phpunit/src/Util/Xml/SchemaDetectionResult.php', - 'PHPUnit\\Util\\Xml\\SchemaDetector' => $vendorDir . '/phpunit/phpunit/src/Util/Xml/SchemaDetector.php', - 'PHPUnit\\Util\\Xml\\SchemaFinder' => $vendorDir . '/phpunit/phpunit/src/Util/Xml/SchemaFinder.php', - 'PHPUnit\\Util\\Xml\\SnapshotNodeList' => $vendorDir . '/phpunit/phpunit/src/Util/Xml/SnapshotNodeList.php', - 'PHPUnit\\Util\\Xml\\SuccessfulSchemaDetectionResult' => $vendorDir . '/phpunit/phpunit/src/Util/Xml/SuccessfulSchemaDetectionResult.php', - 'PHPUnit\\Util\\Xml\\ValidationResult' => $vendorDir . '/phpunit/phpunit/src/Util/Xml/ValidationResult.php', - 'PHPUnit\\Util\\Xml\\Validator' => $vendorDir . '/phpunit/phpunit/src/Util/Xml/Validator.php', 'PHPUnit\\Util\\Xml\\XmlException' => $vendorDir . '/phpunit/phpunit/src/Util/Exception/XmlException.php', 'ParaTest\\Coverage\\CoverageMerger' => $vendorDir . '/brianium/paratest/src/Coverage/CoverageMerger.php', 'ParaTest\\JUnit\\LogMerger' => $vendorDir . '/brianium/paratest/src/JUnit/LogMerger.php', @@ -4726,6 +4818,7 @@ return array( 'ParaTest\\RunnerInterface' => $vendorDir . '/brianium/paratest/src/RunnerInterface.php', 'ParaTest\\Util\\PhpstormHelper' => $vendorDir . '/brianium/paratest/src/Util/PhpstormHelper.php', 'ParaTest\\WrapperRunner\\ApplicationForWrapperWorker' => $vendorDir . '/brianium/paratest/src/WrapperRunner/ApplicationForWrapperWorker.php', + 'ParaTest\\WrapperRunner\\ProgressPrinterOutput' => $vendorDir . '/brianium/paratest/src/WrapperRunner/ProgressPrinterOutput.php', 'ParaTest\\WrapperRunner\\ResultPrinter' => $vendorDir . '/brianium/paratest/src/WrapperRunner/ResultPrinter.php', 'ParaTest\\WrapperRunner\\SuiteLoader' => $vendorDir . '/brianium/paratest/src/WrapperRunner/SuiteLoader.php', 'ParaTest\\WrapperRunner\\WorkerCrashedException' => $vendorDir . '/brianium/paratest/src/WrapperRunner/WorkerCrashedException.php', @@ -4772,6 +4865,7 @@ return array( 'PharIo\\Manifest\\ManifestLoader' => $vendorDir . '/phar-io/manifest/src/ManifestLoader.php', 'PharIo\\Manifest\\ManifestLoaderException' => $vendorDir . '/phar-io/manifest/src/exceptions/ManifestLoaderException.php', 'PharIo\\Manifest\\ManifestSerializer' => $vendorDir . '/phar-io/manifest/src/ManifestSerializer.php', + 'PharIo\\Manifest\\NoEmailAddressException' => $vendorDir . '/phar-io/manifest/src/exceptions/NoEmailAddressException.php', 'PharIo\\Manifest\\PhpElement' => $vendorDir . '/phar-io/manifest/src/xml/PhpElement.php', 'PharIo\\Manifest\\PhpExtensionRequirement' => $vendorDir . '/phar-io/manifest/src/values/PhpExtensionRequirement.php', 'PharIo\\Manifest\\PhpVersionRequirement' => $vendorDir . '/phar-io/manifest/src/values/PhpVersionRequirement.php', @@ -5552,6 +5646,7 @@ return array( 'SebastianBergmann\\CodeCoverage\\Driver\\XdebugNotAvailableException' => $vendorDir . '/phpunit/php-code-coverage/src/Exception/XdebugNotAvailableException.php', 'SebastianBergmann\\CodeCoverage\\Driver\\XdebugNotEnabledException' => $vendorDir . '/phpunit/php-code-coverage/src/Exception/XdebugNotEnabledException.php', 'SebastianBergmann\\CodeCoverage\\Exception' => $vendorDir . '/phpunit/php-code-coverage/src/Exception/Exception.php', + 'SebastianBergmann\\CodeCoverage\\FileCouldNotBeWrittenException' => $vendorDir . '/phpunit/php-code-coverage/src/Exception/FileCouldNotBeWrittenException.php', 'SebastianBergmann\\CodeCoverage\\Filter' => $vendorDir . '/phpunit/php-code-coverage/src/Filter.php', 'SebastianBergmann\\CodeCoverage\\InvalidArgumentException' => $vendorDir . '/phpunit/php-code-coverage/src/Exception/InvalidArgumentException.php', 'SebastianBergmann\\CodeCoverage\\NoCodeCoverageDriverAvailableException' => $vendorDir . '/phpunit/php-code-coverage/src/Exception/NoCodeCoverageDriverAvailableException.php', @@ -6021,6 +6116,7 @@ return array( 'Symfony\\Component\\Console\\Command\\ListCommand' => $vendorDir . '/symfony/console/Command/ListCommand.php', 'Symfony\\Component\\Console\\Command\\LockableTrait' => $vendorDir . '/symfony/console/Command/LockableTrait.php', 'Symfony\\Component\\Console\\Command\\SignalableCommandInterface' => $vendorDir . '/symfony/console/Command/SignalableCommandInterface.php', + 'Symfony\\Component\\Console\\Command\\TraceableCommand' => $vendorDir . '/symfony/console/Command/TraceableCommand.php', 'Symfony\\Component\\Console\\Completion\\CompletionInput' => $vendorDir . '/symfony/console/Completion/CompletionInput.php', 'Symfony\\Component\\Console\\Completion\\CompletionSuggestions' => $vendorDir . '/symfony/console/Completion/CompletionSuggestions.php', 'Symfony\\Component\\Console\\Completion\\Output\\BashCompletionOutput' => $vendorDir . '/symfony/console/Completion/Output/BashCompletionOutput.php', @@ -6030,12 +6126,15 @@ return array( 'Symfony\\Component\\Console\\Completion\\Suggestion' => $vendorDir . '/symfony/console/Completion/Suggestion.php', 'Symfony\\Component\\Console\\ConsoleEvents' => $vendorDir . '/symfony/console/ConsoleEvents.php', 'Symfony\\Component\\Console\\Cursor' => $vendorDir . '/symfony/console/Cursor.php', + 'Symfony\\Component\\Console\\DataCollector\\CommandDataCollector' => $vendorDir . '/symfony/console/DataCollector/CommandDataCollector.php', + 'Symfony\\Component\\Console\\Debug\\CliRequest' => $vendorDir . '/symfony/console/Debug/CliRequest.php', 'Symfony\\Component\\Console\\DependencyInjection\\AddConsoleCommandPass' => $vendorDir . '/symfony/console/DependencyInjection/AddConsoleCommandPass.php', 'Symfony\\Component\\Console\\Descriptor\\ApplicationDescription' => $vendorDir . '/symfony/console/Descriptor/ApplicationDescription.php', 'Symfony\\Component\\Console\\Descriptor\\Descriptor' => $vendorDir . '/symfony/console/Descriptor/Descriptor.php', 'Symfony\\Component\\Console\\Descriptor\\DescriptorInterface' => $vendorDir . '/symfony/console/Descriptor/DescriptorInterface.php', 'Symfony\\Component\\Console\\Descriptor\\JsonDescriptor' => $vendorDir . '/symfony/console/Descriptor/JsonDescriptor.php', 'Symfony\\Component\\Console\\Descriptor\\MarkdownDescriptor' => $vendorDir . '/symfony/console/Descriptor/MarkdownDescriptor.php', + 'Symfony\\Component\\Console\\Descriptor\\ReStructuredTextDescriptor' => $vendorDir . '/symfony/console/Descriptor/ReStructuredTextDescriptor.php', 'Symfony\\Component\\Console\\Descriptor\\TextDescriptor' => $vendorDir . '/symfony/console/Descriptor/TextDescriptor.php', 'Symfony\\Component\\Console\\Descriptor\\XmlDescriptor' => $vendorDir . '/symfony/console/Descriptor/XmlDescriptor.php', 'Symfony\\Component\\Console\\EventListener\\ErrorListener' => $vendorDir . '/symfony/console/EventListener/ErrorListener.php', @@ -6051,6 +6150,7 @@ return array( 'Symfony\\Component\\Console\\Exception\\LogicException' => $vendorDir . '/symfony/console/Exception/LogicException.php', 'Symfony\\Component\\Console\\Exception\\MissingInputException' => $vendorDir . '/symfony/console/Exception/MissingInputException.php', 'Symfony\\Component\\Console\\Exception\\NamespaceNotFoundException' => $vendorDir . '/symfony/console/Exception/NamespaceNotFoundException.php', + 'Symfony\\Component\\Console\\Exception\\RunCommandFailedException' => $vendorDir . '/symfony/console/Exception/RunCommandFailedException.php', 'Symfony\\Component\\Console\\Exception\\RuntimeException' => $vendorDir . '/symfony/console/Exception/RuntimeException.php', 'Symfony\\Component\\Console\\Formatter\\NullOutputFormatter' => $vendorDir . '/symfony/console/Formatter/NullOutputFormatter.php', 'Symfony\\Component\\Console\\Formatter\\NullOutputFormatterStyle' => $vendorDir . '/symfony/console/Formatter/NullOutputFormatterStyle.php', @@ -6080,6 +6180,7 @@ return array( 'Symfony\\Component\\Console\\Helper\\TableRows' => $vendorDir . '/symfony/console/Helper/TableRows.php', 'Symfony\\Component\\Console\\Helper\\TableSeparator' => $vendorDir . '/symfony/console/Helper/TableSeparator.php', 'Symfony\\Component\\Console\\Helper\\TableStyle' => $vendorDir . '/symfony/console/Helper/TableStyle.php', + 'Symfony\\Component\\Console\\Helper\\TerminalInputHelper' => $vendorDir . '/symfony/console/Helper/TerminalInputHelper.php', 'Symfony\\Component\\Console\\Input\\ArgvInput' => $vendorDir . '/symfony/console/Input/ArgvInput.php', 'Symfony\\Component\\Console\\Input\\ArrayInput' => $vendorDir . '/symfony/console/Input/ArrayInput.php', 'Symfony\\Component\\Console\\Input\\Input' => $vendorDir . '/symfony/console/Input/Input.php', @@ -6091,6 +6192,9 @@ return array( 'Symfony\\Component\\Console\\Input\\StreamableInputInterface' => $vendorDir . '/symfony/console/Input/StreamableInputInterface.php', 'Symfony\\Component\\Console\\Input\\StringInput' => $vendorDir . '/symfony/console/Input/StringInput.php', 'Symfony\\Component\\Console\\Logger\\ConsoleLogger' => $vendorDir . '/symfony/console/Logger/ConsoleLogger.php', + 'Symfony\\Component\\Console\\Messenger\\RunCommandContext' => $vendorDir . '/symfony/console/Messenger/RunCommandContext.php', + 'Symfony\\Component\\Console\\Messenger\\RunCommandMessage' => $vendorDir . '/symfony/console/Messenger/RunCommandMessage.php', + 'Symfony\\Component\\Console\\Messenger\\RunCommandMessageHandler' => $vendorDir . '/symfony/console/Messenger/RunCommandMessageHandler.php', 'Symfony\\Component\\Console\\Output\\AnsiColorMode' => $vendorDir . '/symfony/console/Output/AnsiColorMode.php', 'Symfony\\Component\\Console\\Output\\BufferedOutput' => $vendorDir . '/symfony/console/Output/BufferedOutput.php', 'Symfony\\Component\\Console\\Output\\ConsoleOutput' => $vendorDir . '/symfony/console/Output/ConsoleOutput.php', @@ -6104,6 +6208,7 @@ return array( 'Symfony\\Component\\Console\\Question\\ChoiceQuestion' => $vendorDir . '/symfony/console/Question/ChoiceQuestion.php', 'Symfony\\Component\\Console\\Question\\ConfirmationQuestion' => $vendorDir . '/symfony/console/Question/ConfirmationQuestion.php', 'Symfony\\Component\\Console\\Question\\Question' => $vendorDir . '/symfony/console/Question/Question.php', + 'Symfony\\Component\\Console\\SignalRegistry\\SignalMap' => $vendorDir . '/symfony/console/SignalRegistry/SignalMap.php', 'Symfony\\Component\\Console\\SignalRegistry\\SignalRegistry' => $vendorDir . '/symfony/console/SignalRegistry/SignalRegistry.php', 'Symfony\\Component\\Console\\SingleCommandApplication' => $vendorDir . '/symfony/console/SingleCommandApplication.php', 'Symfony\\Component\\Console\\Style\\OutputStyle' => $vendorDir . '/symfony/console/Style/OutputStyle.php', @@ -6612,11 +6717,16 @@ return array( 'Symfony\\Component\\Process\\Exception\\ProcessFailedException' => $vendorDir . '/symfony/process/Exception/ProcessFailedException.php', 'Symfony\\Component\\Process\\Exception\\ProcessSignaledException' => $vendorDir . '/symfony/process/Exception/ProcessSignaledException.php', 'Symfony\\Component\\Process\\Exception\\ProcessTimedOutException' => $vendorDir . '/symfony/process/Exception/ProcessTimedOutException.php', + 'Symfony\\Component\\Process\\Exception\\RunProcessFailedException' => $vendorDir . '/symfony/process/Exception/RunProcessFailedException.php', 'Symfony\\Component\\Process\\Exception\\RuntimeException' => $vendorDir . '/symfony/process/Exception/RuntimeException.php', 'Symfony\\Component\\Process\\ExecutableFinder' => $vendorDir . '/symfony/process/ExecutableFinder.php', 'Symfony\\Component\\Process\\InputStream' => $vendorDir . '/symfony/process/InputStream.php', + 'Symfony\\Component\\Process\\Messenger\\RunProcessContext' => $vendorDir . '/symfony/process/Messenger/RunProcessContext.php', + 'Symfony\\Component\\Process\\Messenger\\RunProcessMessage' => $vendorDir . '/symfony/process/Messenger/RunProcessMessage.php', + 'Symfony\\Component\\Process\\Messenger\\RunProcessMessageHandler' => $vendorDir . '/symfony/process/Messenger/RunProcessMessageHandler.php', 'Symfony\\Component\\Process\\PhpExecutableFinder' => $vendorDir . '/symfony/process/PhpExecutableFinder.php', 'Symfony\\Component\\Process\\PhpProcess' => $vendorDir . '/symfony/process/PhpProcess.php', + 'Symfony\\Component\\Process\\PhpSubprocess' => $vendorDir . '/symfony/process/PhpSubprocess.php', 'Symfony\\Component\\Process\\Pipes\\AbstractPipes' => $vendorDir . '/symfony/process/Pipes/AbstractPipes.php', 'Symfony\\Component\\Process\\Pipes\\PipesInterface' => $vendorDir . '/symfony/process/Pipes/PipesInterface.php', 'Symfony\\Component\\Process\\Pipes\\UnixPipes' => $vendorDir . '/symfony/process/Pipes/UnixPipes.php', @@ -6699,9 +6809,11 @@ return array( 'Symfony\\Component\\String\\Inflector\\EnglishInflector' => $vendorDir . '/symfony/string/Inflector/EnglishInflector.php', 'Symfony\\Component\\String\\Inflector\\FrenchInflector' => $vendorDir . '/symfony/string/Inflector/FrenchInflector.php', 'Symfony\\Component\\String\\Inflector\\InflectorInterface' => $vendorDir . '/symfony/string/Inflector/InflectorInterface.php', + 'Symfony\\Component\\String\\Inflector\\SpanishInflector' => $vendorDir . '/symfony/string/Inflector/SpanishInflector.php', 'Symfony\\Component\\String\\LazyString' => $vendorDir . '/symfony/string/LazyString.php', 'Symfony\\Component\\String\\Slugger\\AsciiSlugger' => $vendorDir . '/symfony/string/Slugger/AsciiSlugger.php', 'Symfony\\Component\\String\\Slugger\\SluggerInterface' => $vendorDir . '/symfony/string/Slugger/SluggerInterface.php', + 'Symfony\\Component\\String\\TruncateMode' => $vendorDir . '/symfony/string/TruncateMode.php', 'Symfony\\Component\\String\\UnicodeString' => $vendorDir . '/symfony/string/UnicodeString.php', 'Symfony\\Component\\Translation\\CatalogueMetadataAwareInterface' => $vendorDir . '/symfony/translation/CatalogueMetadataAwareInterface.php', 'Symfony\\Component\\Translation\\Catalogue\\AbstractOperation' => $vendorDir . '/symfony/translation/Catalogue/AbstractOperation.php', @@ -6902,8 +7014,12 @@ return array( 'Symfony\\Contracts\\EventDispatcher\\EventDispatcherInterface' => $vendorDir . '/symfony/event-dispatcher-contracts/EventDispatcherInterface.php', 'Symfony\\Contracts\\Service\\Attribute\\Required' => $vendorDir . '/symfony/service-contracts/Attribute/Required.php', 'Symfony\\Contracts\\Service\\Attribute\\SubscribedService' => $vendorDir . '/symfony/service-contracts/Attribute/SubscribedService.php', + 'Symfony\\Contracts\\Service\\ContainerAwareInterface' => $vendorDir . '/symfony/service-contracts/ContainerAwareInterface.php', + 'Symfony\\Contracts\\Service\\ContainerProviderInterface' => $vendorDir . '/symfony/service-contracts/ContainerProviderInterface.php', 'Symfony\\Contracts\\Service\\ResetInterface' => $vendorDir . '/symfony/service-contracts/ResetInterface.php', + 'Symfony\\Contracts\\Service\\ServiceCollectionInterface' => $vendorDir . '/symfony/service-contracts/ServiceCollectionInterface.php', 'Symfony\\Contracts\\Service\\ServiceLocatorTrait' => $vendorDir . '/symfony/service-contracts/ServiceLocatorTrait.php', + 'Symfony\\Contracts\\Service\\ServiceMethodsSubscriberTrait' => $vendorDir . '/symfony/service-contracts/ServiceMethodsSubscriberTrait.php', 'Symfony\\Contracts\\Service\\ServiceProviderInterface' => $vendorDir . '/symfony/service-contracts/ServiceProviderInterface.php', 'Symfony\\Contracts\\Service\\ServiceSubscriberInterface' => $vendorDir . '/symfony/service-contracts/ServiceSubscriberInterface.php', 'Symfony\\Contracts\\Service\\ServiceSubscriberTrait' => $vendorDir . '/symfony/service-contracts/ServiceSubscriberTrait.php', diff --git a/vendor/composer/autoload_psr4.php b/vendor/composer/autoload_psr4.php index 90cbc0d8..86e5a1d4 100644 --- a/vendor/composer/autoload_psr4.php +++ b/vendor/composer/autoload_psr4.php @@ -75,6 +75,7 @@ return array( 'ParaTest\\' => array($vendorDir . '/brianium/paratest/src'), 'PHPMailer\\PHPMailer\\' => array($vendorDir . '/phpmailer/phpmailer/src'), 'NunoMaduro\\Collision\\' => array($vendorDir . '/nunomaduro/collision/src'), + 'Nette\\' => array($vendorDir . '/nette/schema/src', $vendorDir . '/nette/utils/src'), 'Monolog\\' => array($vendorDir . '/monolog/monolog/src/Monolog'), 'League\\OAuth1\\Client\\' => array($vendorDir . '/league/oauth1-client/src'), 'League\\MimeTypeDetection\\' => array($vendorDir . '/league/mime-type-detection/src'), diff --git a/vendor/composer/autoload_static.php b/vendor/composer/autoload_static.php index 371e1335..f61a3a59 100644 --- a/vendor/composer/autoload_static.php +++ b/vendor/composer/autoload_static.php @@ -138,6 +138,7 @@ class ComposerStaticInit0a39803e5364a51c44275cdfc5d8af8d 'N' => array ( 'NunoMaduro\\Collision\\' => 21, + 'Nette\\' => 6, ), 'M' => array ( @@ -511,6 +512,11 @@ class ComposerStaticInit0a39803e5364a51c44275cdfc5d8af8d array ( 0 => __DIR__ . '/..' . '/nunomaduro/collision/src', ), + 'Nette\\' => + array ( + 0 => __DIR__ . '/..' . '/nette/schema/src', + 1 => __DIR__ . '/..' . '/nette/utils/src', + ), 'Monolog\\' => array ( 0 => __DIR__ . '/..' . '/monolog/monolog/src/Monolog', @@ -1308,6 +1314,7 @@ class ComposerStaticInit0a39803e5364a51c44275cdfc5d8af8d 'DeepCopy\\Matcher\\PropertyTypeMatcher' => __DIR__ . '/..' . '/myclabs/deep-copy/src/DeepCopy/Matcher/PropertyTypeMatcher.php', 'DeepCopy\\Reflection\\ReflectionHelper' => __DIR__ . '/..' . '/myclabs/deep-copy/src/DeepCopy/Reflection/ReflectionHelper.php', 'DeepCopy\\TypeFilter\\Date\\DateIntervalFilter' => __DIR__ . '/..' . '/myclabs/deep-copy/src/DeepCopy/TypeFilter/Date/DateIntervalFilter.php', + 'DeepCopy\\TypeFilter\\Date\\DatePeriodFilter' => __DIR__ . '/..' . '/myclabs/deep-copy/src/DeepCopy/TypeFilter/Date/DatePeriodFilter.php', 'DeepCopy\\TypeFilter\\ReplaceFilter' => __DIR__ . '/..' . '/myclabs/deep-copy/src/DeepCopy/TypeFilter/ReplaceFilter.php', 'DeepCopy\\TypeFilter\\ShallowCopyFilter' => __DIR__ . '/..' . '/myclabs/deep-copy/src/DeepCopy/TypeFilter/ShallowCopyFilter.php', 'DeepCopy\\TypeFilter\\Spl\\ArrayObjectFilter' => __DIR__ . '/..' . '/myclabs/deep-copy/src/DeepCopy/TypeFilter/Spl/ArrayObjectFilter.php', @@ -2344,9 +2351,12 @@ class ComposerStaticInit0a39803e5364a51c44275cdfc5d8af8d 'Fidry\\CpuCoreCounter\\Diagnoser' => __DIR__ . '/..' . '/fidry/cpu-core-counter/src/Diagnoser.php', 'Fidry\\CpuCoreCounter\\Executor\\ProcOpenExecutor' => __DIR__ . '/..' . '/fidry/cpu-core-counter/src/Executor/ProcOpenExecutor.php', 'Fidry\\CpuCoreCounter\\Executor\\ProcessExecutor' => __DIR__ . '/..' . '/fidry/cpu-core-counter/src/Executor/ProcessExecutor.php', + 'Fidry\\CpuCoreCounter\\Finder\\CmiCmdletLogicalFinder' => __DIR__ . '/..' . '/fidry/cpu-core-counter/src/Finder/CmiCmdletLogicalFinder.php', + 'Fidry\\CpuCoreCounter\\Finder\\CmiCmdletPhysicalFinder' => __DIR__ . '/..' . '/fidry/cpu-core-counter/src/Finder/CmiCmdletPhysicalFinder.php', 'Fidry\\CpuCoreCounter\\Finder\\CpuCoreFinder' => __DIR__ . '/..' . '/fidry/cpu-core-counter/src/Finder/CpuCoreFinder.php', 'Fidry\\CpuCoreCounter\\Finder\\CpuInfoFinder' => __DIR__ . '/..' . '/fidry/cpu-core-counter/src/Finder/CpuInfoFinder.php', 'Fidry\\CpuCoreCounter\\Finder\\DummyCpuCoreFinder' => __DIR__ . '/..' . '/fidry/cpu-core-counter/src/Finder/DummyCpuCoreFinder.php', + 'Fidry\\CpuCoreCounter\\Finder\\EnvVariableFinder' => __DIR__ . '/..' . '/fidry/cpu-core-counter/src/Finder/EnvVariableFinder.php', 'Fidry\\CpuCoreCounter\\Finder\\FinderRegistry' => __DIR__ . '/..' . '/fidry/cpu-core-counter/src/Finder/FinderRegistry.php', 'Fidry\\CpuCoreCounter\\Finder\\HwLogicalFinder' => __DIR__ . '/..' . '/fidry/cpu-core-counter/src/Finder/HwLogicalFinder.php', 'Fidry\\CpuCoreCounter\\Finder\\HwPhysicalFinder' => __DIR__ . '/..' . '/fidry/cpu-core-counter/src/Finder/HwPhysicalFinder.php', @@ -2355,13 +2365,16 @@ class ComposerStaticInit0a39803e5364a51c44275cdfc5d8af8d 'Fidry\\CpuCoreCounter\\Finder\\NProcFinder' => __DIR__ . '/..' . '/fidry/cpu-core-counter/src/Finder/NProcFinder.php', 'Fidry\\CpuCoreCounter\\Finder\\NProcessorFinder' => __DIR__ . '/..' . '/fidry/cpu-core-counter/src/Finder/NProcessorFinder.php', 'Fidry\\CpuCoreCounter\\Finder\\NullCpuCoreFinder' => __DIR__ . '/..' . '/fidry/cpu-core-counter/src/Finder/NullCpuCoreFinder.php', + 'Fidry\\CpuCoreCounter\\Finder\\OnlyInPowerShellFinder' => __DIR__ . '/..' . '/fidry/cpu-core-counter/src/Finder/OnlyInPowerShellFinder.php', 'Fidry\\CpuCoreCounter\\Finder\\OnlyOnOSFamilyFinder' => __DIR__ . '/..' . '/fidry/cpu-core-counter/src/Finder/OnlyOnOSFamilyFinder.php', 'Fidry\\CpuCoreCounter\\Finder\\ProcOpenBasedFinder' => __DIR__ . '/..' . '/fidry/cpu-core-counter/src/Finder/ProcOpenBasedFinder.php', 'Fidry\\CpuCoreCounter\\Finder\\SkipOnOSFamilyFinder' => __DIR__ . '/..' . '/fidry/cpu-core-counter/src/Finder/SkipOnOSFamilyFinder.php', + 'Fidry\\CpuCoreCounter\\Finder\\WindowsRegistryLogicalFinder' => __DIR__ . '/..' . '/fidry/cpu-core-counter/src/Finder/WindowsRegistryLogicalFinder.php', 'Fidry\\CpuCoreCounter\\Finder\\WmicLogicalFinder' => __DIR__ . '/..' . '/fidry/cpu-core-counter/src/Finder/WmicLogicalFinder.php', 'Fidry\\CpuCoreCounter\\Finder\\WmicPhysicalFinder' => __DIR__ . '/..' . '/fidry/cpu-core-counter/src/Finder/WmicPhysicalFinder.php', 'Fidry\\CpuCoreCounter\\Finder\\_NProcessorFinder' => __DIR__ . '/..' . '/fidry/cpu-core-counter/src/Finder/_NProcessorFinder.php', 'Fidry\\CpuCoreCounter\\NumberOfCpuCoreNotFound' => __DIR__ . '/..' . '/fidry/cpu-core-counter/src/NumberOfCpuCoreNotFound.php', + 'Fidry\\CpuCoreCounter\\ParallelisationResult' => __DIR__ . '/..' . '/fidry/cpu-core-counter/src/ParallelisationResult.php', 'Fruitcake\\Cors\\CorsService' => __DIR__ . '/..' . '/fruitcake/php-cors/src/CorsService.php', 'Fruitcake\\Cors\\Exceptions\\InvalidOptionException' => __DIR__ . '/..' . '/fruitcake/php-cors/src/Exceptions/InvalidOptionException.php', 'GrahamCampbell\\ResultType\\Error' => __DIR__ . '/..' . '/graham-campbell/result-type/src/Error.php', @@ -4602,6 +4615,7 @@ class ComposerStaticInit0a39803e5364a51c44275cdfc5d8af8d 'Nette\\Schema\\Processor' => __DIR__ . '/..' . '/nette/schema/src/Schema/Processor.php', 'Nette\\Schema\\Schema' => __DIR__ . '/..' . '/nette/schema/src/Schema/Schema.php', 'Nette\\Schema\\ValidationException' => __DIR__ . '/..' . '/nette/schema/src/Schema/ValidationException.php', + 'Nette\\ShouldNotHappenException' => __DIR__ . '/..' . '/nette/utils/src/exceptions.php', 'Nette\\SmartObject' => __DIR__ . '/..' . '/nette/utils/src/SmartObject.php', 'Nette\\StaticClass' => __DIR__ . '/..' . '/nette/utils/src/StaticClass.php', 'Nette\\UnexpectedValueException' => __DIR__ . '/..' . '/nette/utils/src/exceptions.php', @@ -4611,6 +4625,7 @@ class ComposerStaticInit0a39803e5364a51c44275cdfc5d8af8d 'Nette\\Utils\\AssertionException' => __DIR__ . '/..' . '/nette/utils/src/Utils/exceptions.php', 'Nette\\Utils\\Callback' => __DIR__ . '/..' . '/nette/utils/src/Utils/Callback.php', 'Nette\\Utils\\DateTime' => __DIR__ . '/..' . '/nette/utils/src/Utils/DateTime.php', + 'Nette\\Utils\\DateTimeImmutable' => __DIR__ . '/..' . '/nette/utils/src/Utils/DateTimeImmutable.php', 'Nette\\Utils\\FileInfo' => __DIR__ . '/..' . '/nette/utils/src/Utils/FileInfo.php', 'Nette\\Utils\\FileSystem' => __DIR__ . '/..' . '/nette/utils/src/Utils/FileSystem.php', 'Nette\\Utils\\Finder' => __DIR__ . '/..' . '/nette/utils/src/Utils/Finder.php', @@ -4619,13 +4634,20 @@ class ComposerStaticInit0a39803e5364a51c44275cdfc5d8af8d 'Nette\\Utils\\Html' => __DIR__ . '/..' . '/nette/utils/src/Utils/Html.php', 'Nette\\Utils\\IHtmlString' => __DIR__ . '/..' . '/nette/utils/src/compatibility.php', 'Nette\\Utils\\Image' => __DIR__ . '/..' . '/nette/utils/src/Utils/Image.php', + 'Nette\\Utils\\ImageColor' => __DIR__ . '/..' . '/nette/utils/src/Utils/ImageColor.php', 'Nette\\Utils\\ImageException' => __DIR__ . '/..' . '/nette/utils/src/Utils/exceptions.php', + 'Nette\\Utils\\ImageType' => __DIR__ . '/..' . '/nette/utils/src/Utils/ImageType.php', + 'Nette\\Utils\\Iterables' => __DIR__ . '/..' . '/nette/utils/src/Utils/Iterables.php', 'Nette\\Utils\\Json' => __DIR__ . '/..' . '/nette/utils/src/Utils/Json.php', 'Nette\\Utils\\JsonException' => __DIR__ . '/..' . '/nette/utils/src/Utils/exceptions.php', 'Nette\\Utils\\ObjectHelpers' => __DIR__ . '/..' . '/nette/utils/src/Utils/ObjectHelpers.php', 'Nette\\Utils\\Paginator' => __DIR__ . '/..' . '/nette/utils/src/Utils/Paginator.php', + 'Nette\\Utils\\Process' => __DIR__ . '/..' . '/nette/utils/src/Utils/Process.php', + 'Nette\\Utils\\ProcessFailedException' => __DIR__ . '/..' . '/nette/utils/src/Utils/exceptions.php', + 'Nette\\Utils\\ProcessTimeoutException' => __DIR__ . '/..' . '/nette/utils/src/Utils/exceptions.php', 'Nette\\Utils\\Random' => __DIR__ . '/..' . '/nette/utils/src/Utils/Random.php', 'Nette\\Utils\\Reflection' => __DIR__ . '/..' . '/nette/utils/src/Utils/Reflection.php', + 'Nette\\Utils\\ReflectionMethod' => __DIR__ . '/..' . '/nette/utils/src/Utils/ReflectionMethod.php', 'Nette\\Utils\\RegexpException' => __DIR__ . '/..' . '/nette/utils/src/Utils/exceptions.php', 'Nette\\Utils\\Strings' => __DIR__ . '/..' . '/nette/utils/src/Utils/Strings.php', 'Nette\\Utils\\Type' => __DIR__ . '/..' . '/nette/utils/src/Utils/Type.php', @@ -4677,6 +4699,7 @@ class ComposerStaticInit0a39803e5364a51c44275cdfc5d8af8d 'PHPUnit\\Event\\Code\\ClassMethod' => __DIR__ . '/..' . '/phpunit/phpunit/src/Event/Value/ClassMethod.php', 'PHPUnit\\Event\\Code\\ComparisonFailure' => __DIR__ . '/..' . '/phpunit/phpunit/src/Event/Value/ComparisonFailure.php', 'PHPUnit\\Event\\Code\\ComparisonFailureBuilder' => __DIR__ . '/..' . '/phpunit/phpunit/src/Event/Value/ComparisonFailureBuilder.php', + 'PHPUnit\\Event\\Code\\NoTestCaseObjectOnCallStackException' => __DIR__ . '/..' . '/phpunit/phpunit/src/Event/Exception/NoTestCaseObjectOnCallStackException.php', 'PHPUnit\\Event\\Code\\Phpt' => __DIR__ . '/..' . '/phpunit/phpunit/src/Event/Value/Test/Phpt.php', 'PHPUnit\\Event\\Code\\Test' => __DIR__ . '/..' . '/phpunit/phpunit/src/Event/Value/Test/Test.php', 'PHPUnit\\Event\\Code\\TestCollection' => __DIR__ . '/..' . '/phpunit/phpunit/src/Event/Value/Test/TestCollection.php', @@ -4714,10 +4737,14 @@ class ComposerStaticInit0a39803e5364a51c44275cdfc5d8af8d 'PHPUnit\\Event\\Subscriber' => __DIR__ . '/..' . '/phpunit/phpunit/src/Event/Subscriber.php', 'PHPUnit\\Event\\SubscriberTypeAlreadyRegisteredException' => __DIR__ . '/..' . '/phpunit/phpunit/src/Event/Exception/SubscriberTypeAlreadyRegisteredException.php', 'PHPUnit\\Event\\Telemetry\\Duration' => __DIR__ . '/..' . '/phpunit/phpunit/src/Event/Value/Telemetry/Duration.php', + 'PHPUnit\\Event\\Telemetry\\GarbageCollectorStatus' => __DIR__ . '/..' . '/phpunit/phpunit/src/Event/Value/Telemetry/GarbageCollectorStatus.php', + 'PHPUnit\\Event\\Telemetry\\GarbageCollectorStatusProvider' => __DIR__ . '/..' . '/phpunit/phpunit/src/Event/Value/Telemetry/GarbageCollectorStatusProvider.php', 'PHPUnit\\Event\\Telemetry\\HRTime' => __DIR__ . '/..' . '/phpunit/phpunit/src/Event/Value/Telemetry/HRTime.php', 'PHPUnit\\Event\\Telemetry\\Info' => __DIR__ . '/..' . '/phpunit/phpunit/src/Event/Value/Telemetry/Info.php', 'PHPUnit\\Event\\Telemetry\\MemoryMeter' => __DIR__ . '/..' . '/phpunit/phpunit/src/Event/Value/Telemetry/MemoryMeter.php', 'PHPUnit\\Event\\Telemetry\\MemoryUsage' => __DIR__ . '/..' . '/phpunit/phpunit/src/Event/Value/Telemetry/MemoryUsage.php', + 'PHPUnit\\Event\\Telemetry\\Php81GarbageCollectorStatusProvider' => __DIR__ . '/..' . '/phpunit/phpunit/src/Event/Value/Telemetry/Php81GarbageCollectorStatusProvider.php', + 'PHPUnit\\Event\\Telemetry\\Php83GarbageCollectorStatusProvider' => __DIR__ . '/..' . '/phpunit/phpunit/src/Event/Value/Telemetry/Php83GarbageCollectorStatusProvider.php', 'PHPUnit\\Event\\Telemetry\\Snapshot' => __DIR__ . '/..' . '/phpunit/phpunit/src/Event/Value/Telemetry/Snapshot.php', 'PHPUnit\\Event\\Telemetry\\StopWatch' => __DIR__ . '/..' . '/phpunit/phpunit/src/Event/Value/Telemetry/StopWatch.php', 'PHPUnit\\Event\\Telemetry\\System' => __DIR__ . '/..' . '/phpunit/phpunit/src/Event/Value/Telemetry/System.php', @@ -4739,6 +4766,8 @@ class ComposerStaticInit0a39803e5364a51c44275cdfc5d8af8d 'PHPUnit\\Event\\TestRunner\\DeprecationTriggeredSubscriber' => __DIR__ . '/..' . '/phpunit/phpunit/src/Event/Events/TestRunner/DeprecationTriggeredSubscriber.php', 'PHPUnit\\Event\\TestRunner\\EventFacadeSealed' => __DIR__ . '/..' . '/phpunit/phpunit/src/Event/Events/TestRunner/EventFacadeSealed.php', 'PHPUnit\\Event\\TestRunner\\EventFacadeSealedSubscriber' => __DIR__ . '/..' . '/phpunit/phpunit/src/Event/Events/TestRunner/EventFacadeSealedSubscriber.php', + 'PHPUnit\\Event\\TestRunner\\ExecutionAborted' => __DIR__ . '/..' . '/phpunit/phpunit/src/Event/Events/TestRunner/ExecutionAborted.php', + 'PHPUnit\\Event\\TestRunner\\ExecutionAbortedSubscriber' => __DIR__ . '/..' . '/phpunit/phpunit/src/Event/Events/TestRunner/ExecutionAbortedSubscriber.php', 'PHPUnit\\Event\\TestRunner\\ExecutionFinished' => __DIR__ . '/..' . '/phpunit/phpunit/src/Event/Events/TestRunner/ExecutionFinished.php', 'PHPUnit\\Event\\TestRunner\\ExecutionFinishedSubscriber' => __DIR__ . '/..' . '/phpunit/phpunit/src/Event/Events/TestRunner/ExecutionFinishedSubscriber.php', 'PHPUnit\\Event\\TestRunner\\ExecutionStarted' => __DIR__ . '/..' . '/phpunit/phpunit/src/Event/Events/TestRunner/ExecutionStarted.php', @@ -4749,6 +4778,12 @@ class ComposerStaticInit0a39803e5364a51c44275cdfc5d8af8d 'PHPUnit\\Event\\TestRunner\\ExtensionLoadedFromPharSubscriber' => __DIR__ . '/..' . '/phpunit/phpunit/src/Event/Events/TestRunner/ExtensionLoadedFromPharSubscriber.php', 'PHPUnit\\Event\\TestRunner\\Finished' => __DIR__ . '/..' . '/phpunit/phpunit/src/Event/Events/TestRunner/Finished.php', 'PHPUnit\\Event\\TestRunner\\FinishedSubscriber' => __DIR__ . '/..' . '/phpunit/phpunit/src/Event/Events/TestRunner/FinishedSubscriber.php', + 'PHPUnit\\Event\\TestRunner\\GarbageCollectionDisabled' => __DIR__ . '/..' . '/phpunit/phpunit/src/Event/Events/TestRunner/GarbageCollectionDisabled.php', + 'PHPUnit\\Event\\TestRunner\\GarbageCollectionDisabledSubscriber' => __DIR__ . '/..' . '/phpunit/phpunit/src/Event/Events/TestRunner/GarbageCollectionDisabledSubscriber.php', + 'PHPUnit\\Event\\TestRunner\\GarbageCollectionEnabled' => __DIR__ . '/..' . '/phpunit/phpunit/src/Event/Events/TestRunner/GarbageCollectionEnabled.php', + 'PHPUnit\\Event\\TestRunner\\GarbageCollectionEnabledSubscriber' => __DIR__ . '/..' . '/phpunit/phpunit/src/Event/Events/TestRunner/GarbageCollectionEnabledSubscriber.php', + 'PHPUnit\\Event\\TestRunner\\GarbageCollectionTriggered' => __DIR__ . '/..' . '/phpunit/phpunit/src/Event/Events/TestRunner/GarbageCollectionTriggered.php', + 'PHPUnit\\Event\\TestRunner\\GarbageCollectionTriggeredSubscriber' => __DIR__ . '/..' . '/phpunit/phpunit/src/Event/Events/TestRunner/GarbageCollectionTriggeredSubscriber.php', 'PHPUnit\\Event\\TestRunner\\Started' => __DIR__ . '/..' . '/phpunit/phpunit/src/Event/Events/TestRunner/Started.php', 'PHPUnit\\Event\\TestRunner\\StartedSubscriber' => __DIR__ . '/..' . '/phpunit/phpunit/src/Event/Events/TestRunner/StartedSubscriber.php', 'PHPUnit\\Event\\TestRunner\\WarningTriggered' => __DIR__ . '/..' . '/phpunit/phpunit/src/Event/Events/TestRunner/WarningTriggered.php', @@ -4772,10 +4807,14 @@ class ComposerStaticInit0a39803e5364a51c44275cdfc5d8af8d 'PHPUnit\\Event\\TestSuite\\TestSuiteWithName' => __DIR__ . '/..' . '/phpunit/phpunit/src/Event/Value/TestSuite/TestSuiteWithName.php', 'PHPUnit\\Event\\Test\\AfterLastTestMethodCalled' => __DIR__ . '/..' . '/phpunit/phpunit/src/Event/Events/Test/HookMethod/AfterLastTestMethodCalled.php', 'PHPUnit\\Event\\Test\\AfterLastTestMethodCalledSubscriber' => __DIR__ . '/..' . '/phpunit/phpunit/src/Event/Events/Test/HookMethod/AfterLastTestMethodCalledSubscriber.php', + 'PHPUnit\\Event\\Test\\AfterLastTestMethodErrored' => __DIR__ . '/..' . '/phpunit/phpunit/src/Event/Events/Test/HookMethod/AfterLastTestMethodErrored.php', + 'PHPUnit\\Event\\Test\\AfterLastTestMethodErroredSubscriber' => __DIR__ . '/..' . '/phpunit/phpunit/src/Event/Events/Test/HookMethod/AfterLastTestMethodErroredSubscriber.php', 'PHPUnit\\Event\\Test\\AfterLastTestMethodFinished' => __DIR__ . '/..' . '/phpunit/phpunit/src/Event/Events/Test/HookMethod/AfterLastTestMethodFinished.php', 'PHPUnit\\Event\\Test\\AfterLastTestMethodFinishedSubscriber' => __DIR__ . '/..' . '/phpunit/phpunit/src/Event/Events/Test/HookMethod/AfterLastTestMethodFinishedSubscriber.php', 'PHPUnit\\Event\\Test\\AfterTestMethodCalled' => __DIR__ . '/..' . '/phpunit/phpunit/src/Event/Events/Test/HookMethod/AfterTestMethodCalled.php', 'PHPUnit\\Event\\Test\\AfterTestMethodCalledSubscriber' => __DIR__ . '/..' . '/phpunit/phpunit/src/Event/Events/Test/HookMethod/AfterTestMethodCalledSubscriber.php', + 'PHPUnit\\Event\\Test\\AfterTestMethodErrored' => __DIR__ . '/..' . '/phpunit/phpunit/src/Event/Events/Test/HookMethod/AfterTestMethodErrored.php', + 'PHPUnit\\Event\\Test\\AfterTestMethodErroredSubscriber' => __DIR__ . '/..' . '/phpunit/phpunit/src/Event/Events/Test/HookMethod/AfterTestMethodErroredSubscriber.php', 'PHPUnit\\Event\\Test\\AfterTestMethodFinished' => __DIR__ . '/..' . '/phpunit/phpunit/src/Event/Events/Test/HookMethod/AfterTestMethodFinished.php', 'PHPUnit\\Event\\Test\\AfterTestMethodFinishedSubscriber' => __DIR__ . '/..' . '/phpunit/phpunit/src/Event/Events/Test/HookMethod/AfterTestMethodFinishedSubscriber.php', 'PHPUnit\\Event\\Test\\AssertionFailed' => __DIR__ . '/..' . '/phpunit/phpunit/src/Event/Events/Test/Assertion/AssertionFailed.php', @@ -4790,12 +4829,18 @@ class ComposerStaticInit0a39803e5364a51c44275cdfc5d8af8d 'PHPUnit\\Event\\Test\\BeforeFirstTestMethodFinishedSubscriber' => __DIR__ . '/..' . '/phpunit/phpunit/src/Event/Events/Test/HookMethod/BeforeFirstTestMethodFinishedSubscriber.php', 'PHPUnit\\Event\\Test\\BeforeTestMethodCalled' => __DIR__ . '/..' . '/phpunit/phpunit/src/Event/Events/Test/HookMethod/BeforeTestMethodCalled.php', 'PHPUnit\\Event\\Test\\BeforeTestMethodCalledSubscriber' => __DIR__ . '/..' . '/phpunit/phpunit/src/Event/Events/Test/HookMethod/BeforeTestMethodCalledSubscriber.php', + 'PHPUnit\\Event\\Test\\BeforeTestMethodErrored' => __DIR__ . '/..' . '/phpunit/phpunit/src/Event/Events/Test/HookMethod/BeforeTestMethodErrored.php', + 'PHPUnit\\Event\\Test\\BeforeTestMethodErroredSubscriber' => __DIR__ . '/..' . '/phpunit/phpunit/src/Event/Events/Test/HookMethod/BeforeTestMethodErroredSubscriber.php', 'PHPUnit\\Event\\Test\\BeforeTestMethodFinished' => __DIR__ . '/..' . '/phpunit/phpunit/src/Event/Events/Test/HookMethod/BeforeTestMethodFinished.php', 'PHPUnit\\Event\\Test\\BeforeTestMethodFinishedSubscriber' => __DIR__ . '/..' . '/phpunit/phpunit/src/Event/Events/Test/HookMethod/BeforeTestMethodFinishedSubscriber.php', 'PHPUnit\\Event\\Test\\ComparatorRegistered' => __DIR__ . '/..' . '/phpunit/phpunit/src/Event/Events/Test/ComparatorRegistered.php', 'PHPUnit\\Event\\Test\\ComparatorRegisteredSubscriber' => __DIR__ . '/..' . '/phpunit/phpunit/src/Event/Events/Test/ComparatorRegisteredSubscriber.php', 'PHPUnit\\Event\\Test\\ConsideredRisky' => __DIR__ . '/..' . '/phpunit/phpunit/src/Event/Events/Test/Issue/ConsideredRisky.php', 'PHPUnit\\Event\\Test\\ConsideredRiskySubscriber' => __DIR__ . '/..' . '/phpunit/phpunit/src/Event/Events/Test/Issue/ConsideredRiskySubscriber.php', + 'PHPUnit\\Event\\Test\\DataProviderMethodCalled' => __DIR__ . '/..' . '/phpunit/phpunit/src/Event/Events/Test/Lifecycle/DataProviderMethodCalled.php', + 'PHPUnit\\Event\\Test\\DataProviderMethodCalledSubscriber' => __DIR__ . '/..' . '/phpunit/phpunit/src/Event/Events/Test/Lifecycle/DataProviderMethodCalledSubscriber.php', + 'PHPUnit\\Event\\Test\\DataProviderMethodFinished' => __DIR__ . '/..' . '/phpunit/phpunit/src/Event/Events/Test/Lifecycle/DataProviderMethodFinished.php', + 'PHPUnit\\Event\\Test\\DataProviderMethodFinishedSubscriber' => __DIR__ . '/..' . '/phpunit/phpunit/src/Event/Events/Test/Lifecycle/DataProviderMethodFinishedSubscriber.php', 'PHPUnit\\Event\\Test\\DeprecationTriggered' => __DIR__ . '/..' . '/phpunit/phpunit/src/Event/Events/Test/Issue/DeprecationTriggered.php', 'PHPUnit\\Event\\Test\\DeprecationTriggeredSubscriber' => __DIR__ . '/..' . '/phpunit/phpunit/src/Event/Events/Test/Issue/DeprecationTriggeredSubscriber.php', 'PHPUnit\\Event\\Test\\ErrorTriggered' => __DIR__ . '/..' . '/phpunit/phpunit/src/Event/Events/Test/Issue/ErrorTriggered.php', @@ -4839,12 +4884,18 @@ class ComposerStaticInit0a39803e5364a51c44275cdfc5d8af8d 'PHPUnit\\Event\\Test\\PhpunitWarningTriggeredSubscriber' => __DIR__ . '/..' . '/phpunit/phpunit/src/Event/Events/Test/Issue/PhpunitWarningTriggeredSubscriber.php', 'PHPUnit\\Event\\Test\\PostConditionCalled' => __DIR__ . '/..' . '/phpunit/phpunit/src/Event/Events/Test/HookMethod/PostConditionCalled.php', 'PHPUnit\\Event\\Test\\PostConditionCalledSubscriber' => __DIR__ . '/..' . '/phpunit/phpunit/src/Event/Events/Test/HookMethod/PostConditionCalledSubscriber.php', + 'PHPUnit\\Event\\Test\\PostConditionErrored' => __DIR__ . '/..' . '/phpunit/phpunit/src/Event/Events/Test/HookMethod/PostConditionErrored.php', + 'PHPUnit\\Event\\Test\\PostConditionErroredSubscriber' => __DIR__ . '/..' . '/phpunit/phpunit/src/Event/Events/Test/HookMethod/PostConditionErroredSubscriber.php', 'PHPUnit\\Event\\Test\\PostConditionFinished' => __DIR__ . '/..' . '/phpunit/phpunit/src/Event/Events/Test/HookMethod/PostConditionFinished.php', 'PHPUnit\\Event\\Test\\PostConditionFinishedSubscriber' => __DIR__ . '/..' . '/phpunit/phpunit/src/Event/Events/Test/HookMethod/PostConditionFinishedSubscriber.php', 'PHPUnit\\Event\\Test\\PreConditionCalled' => __DIR__ . '/..' . '/phpunit/phpunit/src/Event/Events/Test/HookMethod/PreConditionCalled.php', 'PHPUnit\\Event\\Test\\PreConditionCalledSubscriber' => __DIR__ . '/..' . '/phpunit/phpunit/src/Event/Events/Test/HookMethod/PreConditionCalledSubscriber.php', + 'PHPUnit\\Event\\Test\\PreConditionErrored' => __DIR__ . '/..' . '/phpunit/phpunit/src/Event/Events/Test/HookMethod/PreConditionErrored.php', + 'PHPUnit\\Event\\Test\\PreConditionErroredSubscriber' => __DIR__ . '/..' . '/phpunit/phpunit/src/Event/Events/Test/HookMethod/PreConditionErroredSubscriber.php', 'PHPUnit\\Event\\Test\\PreConditionFinished' => __DIR__ . '/..' . '/phpunit/phpunit/src/Event/Events/Test/HookMethod/PreConditionFinished.php', 'PHPUnit\\Event\\Test\\PreConditionFinishedSubscriber' => __DIR__ . '/..' . '/phpunit/phpunit/src/Event/Events/Test/HookMethod/PreConditionFinishedSubscriber.php', + 'PHPUnit\\Event\\Test\\PreparationFailed' => __DIR__ . '/..' . '/phpunit/phpunit/src/Event/Events/Test/Lifecycle/PreparationFailed.php', + 'PHPUnit\\Event\\Test\\PreparationFailedSubscriber' => __DIR__ . '/..' . '/phpunit/phpunit/src/Event/Events/Test/Lifecycle/PreparationFailedSubscriber.php', 'PHPUnit\\Event\\Test\\PreparationStarted' => __DIR__ . '/..' . '/phpunit/phpunit/src/Event/Events/Test/Lifecycle/PreparationStarted.php', 'PHPUnit\\Event\\Test\\PreparationStartedSubscriber' => __DIR__ . '/..' . '/phpunit/phpunit/src/Event/Events/Test/Lifecycle/PreparationStartedSubscriber.php', 'PHPUnit\\Event\\Test\\Prepared' => __DIR__ . '/..' . '/phpunit/phpunit/src/Event/Events/Test/Lifecycle/Prepared.php', @@ -4896,6 +4947,10 @@ class ComposerStaticInit0a39803e5364a51c44275cdfc5d8af8d 'PHPUnit\\Framework\\Attributes\\ExcludeGlobalVariableFromBackup' => __DIR__ . '/..' . '/phpunit/phpunit/src/Framework/Attributes/ExcludeGlobalVariableFromBackup.php', 'PHPUnit\\Framework\\Attributes\\ExcludeStaticPropertyFromBackup' => __DIR__ . '/..' . '/phpunit/phpunit/src/Framework/Attributes/ExcludeStaticPropertyFromBackup.php', 'PHPUnit\\Framework\\Attributes\\Group' => __DIR__ . '/..' . '/phpunit/phpunit/src/Framework/Attributes/Group.php', + 'PHPUnit\\Framework\\Attributes\\IgnoreClassForCodeCoverage' => __DIR__ . '/..' . '/phpunit/phpunit/src/Framework/Attributes/IgnoreClassForCodeCoverage.php', + 'PHPUnit\\Framework\\Attributes\\IgnoreDeprecations' => __DIR__ . '/..' . '/phpunit/phpunit/src/Framework/Attributes/IgnoreDeprecations.php', + 'PHPUnit\\Framework\\Attributes\\IgnoreFunctionForCodeCoverage' => __DIR__ . '/..' . '/phpunit/phpunit/src/Framework/Attributes/IgnoreFunctionForCodeCoverage.php', + 'PHPUnit\\Framework\\Attributes\\IgnoreMethodForCodeCoverage' => __DIR__ . '/..' . '/phpunit/phpunit/src/Framework/Attributes/IgnoreMethodForCodeCoverage.php', 'PHPUnit\\Framework\\Attributes\\Large' => __DIR__ . '/..' . '/phpunit/phpunit/src/Framework/Attributes/Large.php', 'PHPUnit\\Framework\\Attributes\\Medium' => __DIR__ . '/..' . '/phpunit/phpunit/src/Framework/Attributes/Medium.php', 'PHPUnit\\Framework\\Attributes\\PostCondition' => __DIR__ . '/..' . '/phpunit/phpunit/src/Framework/Attributes/PostCondition.php', @@ -4920,6 +4975,7 @@ class ComposerStaticInit0a39803e5364a51c44275cdfc5d8af8d 'PHPUnit\\Framework\\Attributes\\Ticket' => __DIR__ . '/..' . '/phpunit/phpunit/src/Framework/Attributes/Ticket.php', 'PHPUnit\\Framework\\Attributes\\UsesClass' => __DIR__ . '/..' . '/phpunit/phpunit/src/Framework/Attributes/UsesClass.php', 'PHPUnit\\Framework\\Attributes\\UsesFunction' => __DIR__ . '/..' . '/phpunit/phpunit/src/Framework/Attributes/UsesFunction.php', + 'PHPUnit\\Framework\\Attributes\\WithoutErrorHandler' => __DIR__ . '/..' . '/phpunit/phpunit/src/Framework/Attributes/WithoutErrorHandler.php', 'PHPUnit\\Framework\\CodeCoverageException' => __DIR__ . '/..' . '/phpunit/phpunit/src/Framework/Exception/CodeCoverageException.php', 'PHPUnit\\Framework\\ComparisonMethodDoesNotAcceptParameterTypeException' => __DIR__ . '/..' . '/phpunit/phpunit/src/Framework/Exception/ObjectEquals/ComparisonMethodDoesNotAcceptParameterTypeException.php', 'PHPUnit\\Framework\\ComparisonMethodDoesNotDeclareBoolReturnTypeException' => __DIR__ . '/..' . '/phpunit/phpunit/src/Framework/Exception/ObjectEquals/ComparisonMethodDoesNotDeclareBoolReturnTypeException.php', @@ -4963,7 +5019,8 @@ class ComposerStaticInit0a39803e5364a51c44275cdfc5d8af8d 'PHPUnit\\Framework\\Constraint\\LogicalNot' => __DIR__ . '/..' . '/phpunit/phpunit/src/Framework/Constraint/Operator/LogicalNot.php', 'PHPUnit\\Framework\\Constraint\\LogicalOr' => __DIR__ . '/..' . '/phpunit/phpunit/src/Framework/Constraint/Operator/LogicalOr.php', 'PHPUnit\\Framework\\Constraint\\LogicalXor' => __DIR__ . '/..' . '/phpunit/phpunit/src/Framework/Constraint/Operator/LogicalXor.php', - 'PHPUnit\\Framework\\Constraint\\ObjectEquals' => __DIR__ . '/..' . '/phpunit/phpunit/src/Framework/Constraint/ObjectEquals.php', + 'PHPUnit\\Framework\\Constraint\\ObjectEquals' => __DIR__ . '/..' . '/phpunit/phpunit/src/Framework/Constraint/Object/ObjectEquals.php', + 'PHPUnit\\Framework\\Constraint\\ObjectHasProperty' => __DIR__ . '/..' . '/phpunit/phpunit/src/Framework/Constraint/Object/ObjectHasProperty.php', 'PHPUnit\\Framework\\Constraint\\Operator' => __DIR__ . '/..' . '/phpunit/phpunit/src/Framework/Constraint/Operator/Operator.php', 'PHPUnit\\Framework\\Constraint\\RegularExpression' => __DIR__ . '/..' . '/phpunit/phpunit/src/Framework/Constraint/String/RegularExpression.php', 'PHPUnit\\Framework\\Constraint\\SameSize' => __DIR__ . '/..' . '/phpunit/phpunit/src/Framework/Constraint/Cardinality/SameSize.php', @@ -4979,7 +5036,6 @@ class ComposerStaticInit0a39803e5364a51c44275cdfc5d8af8d 'PHPUnit\\Framework\\Constraint\\UnaryOperator' => __DIR__ . '/..' . '/phpunit/phpunit/src/Framework/Constraint/Operator/UnaryOperator.php', 'PHPUnit\\Framework\\DataProviderTestSuite' => __DIR__ . '/..' . '/phpunit/phpunit/src/Framework/DataProviderTestSuite.php', 'PHPUnit\\Framework\\EmptyStringException' => __DIR__ . '/..' . '/phpunit/phpunit/src/Framework/Exception/EmptyStringException.php', - 'PHPUnit\\Framework\\Error' => __DIR__ . '/..' . '/phpunit/phpunit/src/Framework/Exception/Error.php', 'PHPUnit\\Framework\\Exception' => __DIR__ . '/..' . '/phpunit/phpunit/src/Framework/Exception/Exception.php', 'PHPUnit\\Framework\\ExecutionOrderDependency' => __DIR__ . '/..' . '/phpunit/phpunit/src/Framework/ExecutionOrderDependency.php', 'PHPUnit\\Framework\\ExpectationFailedException' => __DIR__ . '/..' . '/phpunit/phpunit/src/Framework/Exception/ExpectationFailedException.php', @@ -4990,77 +5046,83 @@ class ComposerStaticInit0a39803e5364a51c44275cdfc5d8af8d 'PHPUnit\\Framework\\InvalidCoversTargetException' => __DIR__ . '/..' . '/phpunit/phpunit/src/Framework/Exception/InvalidCoversTargetException.php', 'PHPUnit\\Framework\\InvalidDataProviderException' => __DIR__ . '/..' . '/phpunit/phpunit/src/Framework/Exception/InvalidDataProviderException.php', 'PHPUnit\\Framework\\InvalidDependencyException' => __DIR__ . '/..' . '/phpunit/phpunit/src/Framework/Exception/InvalidDependencyException.php', - 'PHPUnit\\Framework\\MockObject\\Api' => __DIR__ . '/..' . '/phpunit/phpunit/src/Framework/MockObject/Api/Api.php', 'PHPUnit\\Framework\\MockObject\\BadMethodCallException' => __DIR__ . '/..' . '/phpunit/phpunit/src/Framework/MockObject/Exception/BadMethodCallException.php', - 'PHPUnit\\Framework\\MockObject\\Builder\\Identity' => __DIR__ . '/..' . '/phpunit/phpunit/src/Framework/MockObject/Builder/Identity.php', - 'PHPUnit\\Framework\\MockObject\\Builder\\InvocationMocker' => __DIR__ . '/..' . '/phpunit/phpunit/src/Framework/MockObject/Builder/InvocationMocker.php', - 'PHPUnit\\Framework\\MockObject\\Builder\\InvocationStubber' => __DIR__ . '/..' . '/phpunit/phpunit/src/Framework/MockObject/Builder/InvocationStubber.php', - 'PHPUnit\\Framework\\MockObject\\Builder\\MethodNameMatch' => __DIR__ . '/..' . '/phpunit/phpunit/src/Framework/MockObject/Builder/MethodNameMatch.php', - 'PHPUnit\\Framework\\MockObject\\Builder\\ParametersMatch' => __DIR__ . '/..' . '/phpunit/phpunit/src/Framework/MockObject/Builder/ParametersMatch.php', - 'PHPUnit\\Framework\\MockObject\\Builder\\Stub' => __DIR__ . '/..' . '/phpunit/phpunit/src/Framework/MockObject/Builder/Stub.php', - 'PHPUnit\\Framework\\MockObject\\CannotUseAddMethodsException' => __DIR__ . '/..' . '/phpunit/phpunit/src/Framework/MockObject/Exception/CannotUseAddMethodsException.php', + 'PHPUnit\\Framework\\MockObject\\Builder\\Identity' => __DIR__ . '/..' . '/phpunit/phpunit/src/Framework/MockObject/Runtime/Builder/Identity.php', + 'PHPUnit\\Framework\\MockObject\\Builder\\InvocationMocker' => __DIR__ . '/..' . '/phpunit/phpunit/src/Framework/MockObject/Runtime/Builder/InvocationMocker.php', + 'PHPUnit\\Framework\\MockObject\\Builder\\InvocationStubber' => __DIR__ . '/..' . '/phpunit/phpunit/src/Framework/MockObject/Runtime/Builder/InvocationStubber.php', + 'PHPUnit\\Framework\\MockObject\\Builder\\MethodNameMatch' => __DIR__ . '/..' . '/phpunit/phpunit/src/Framework/MockObject/Runtime/Builder/MethodNameMatch.php', + 'PHPUnit\\Framework\\MockObject\\Builder\\ParametersMatch' => __DIR__ . '/..' . '/phpunit/phpunit/src/Framework/MockObject/Runtime/Builder/ParametersMatch.php', + 'PHPUnit\\Framework\\MockObject\\Builder\\Stub' => __DIR__ . '/..' . '/phpunit/phpunit/src/Framework/MockObject/Runtime/Builder/Stub.php', 'PHPUnit\\Framework\\MockObject\\CannotUseOnlyMethodsException' => __DIR__ . '/..' . '/phpunit/phpunit/src/Framework/MockObject/Exception/CannotUseOnlyMethodsException.php', - 'PHPUnit\\Framework\\MockObject\\ClassAlreadyExistsException' => __DIR__ . '/..' . '/phpunit/phpunit/src/Framework/MockObject/Exception/ClassAlreadyExistsException.php', - 'PHPUnit\\Framework\\MockObject\\ClassIsEnumerationException' => __DIR__ . '/..' . '/phpunit/phpunit/src/Framework/MockObject/Exception/ClassIsEnumerationException.php', - 'PHPUnit\\Framework\\MockObject\\ClassIsFinalException' => __DIR__ . '/..' . '/phpunit/phpunit/src/Framework/MockObject/Exception/ClassIsFinalException.php', - 'PHPUnit\\Framework\\MockObject\\ClassIsReadonlyException' => __DIR__ . '/..' . '/phpunit/phpunit/src/Framework/MockObject/Exception/ClassIsReadonlyException.php', 'PHPUnit\\Framework\\MockObject\\ConfigurableMethod' => __DIR__ . '/..' . '/phpunit/phpunit/src/Framework/MockObject/ConfigurableMethod.php', - 'PHPUnit\\Framework\\MockObject\\ConfigurableMethodsAlreadyInitializedException' => __DIR__ . '/..' . '/phpunit/phpunit/src/Framework/MockObject/Exception/ConfigurableMethodsAlreadyInitializedException.php', - 'PHPUnit\\Framework\\MockObject\\DuplicateMethodException' => __DIR__ . '/..' . '/phpunit/phpunit/src/Framework/MockObject/Exception/DuplicateMethodException.php', + 'PHPUnit\\Framework\\MockObject\\DoubledCloneMethod' => __DIR__ . '/..' . '/phpunit/phpunit/src/Framework/MockObject/Runtime/Api/DoubledCloneMethod.php', 'PHPUnit\\Framework\\MockObject\\Exception' => __DIR__ . '/..' . '/phpunit/phpunit/src/Framework/MockObject/Exception/Exception.php', - 'PHPUnit\\Framework\\MockObject\\Generator' => __DIR__ . '/..' . '/phpunit/phpunit/src/Framework/MockObject/Generator.php', + 'PHPUnit\\Framework\\MockObject\\Generator\\CannotUseAddMethodsException' => __DIR__ . '/..' . '/phpunit/phpunit/src/Framework/MockObject/Generator/Exception/CannotUseAddMethodsException.php', + 'PHPUnit\\Framework\\MockObject\\Generator\\ClassIsEnumerationException' => __DIR__ . '/..' . '/phpunit/phpunit/src/Framework/MockObject/Generator/Exception/ClassIsEnumerationException.php', + 'PHPUnit\\Framework\\MockObject\\Generator\\ClassIsFinalException' => __DIR__ . '/..' . '/phpunit/phpunit/src/Framework/MockObject/Generator/Exception/ClassIsFinalException.php', + 'PHPUnit\\Framework\\MockObject\\Generator\\ClassIsReadonlyException' => __DIR__ . '/..' . '/phpunit/phpunit/src/Framework/MockObject/Generator/Exception/ClassIsReadonlyException.php', + 'PHPUnit\\Framework\\MockObject\\Generator\\DuplicateMethodException' => __DIR__ . '/..' . '/phpunit/phpunit/src/Framework/MockObject/Generator/Exception/DuplicateMethodException.php', + 'PHPUnit\\Framework\\MockObject\\Generator\\Exception' => __DIR__ . '/..' . '/phpunit/phpunit/src/Framework/MockObject/Generator/Exception/Exception.php', + 'PHPUnit\\Framework\\MockObject\\Generator\\Generator' => __DIR__ . '/..' . '/phpunit/phpunit/src/Framework/MockObject/Generator/Generator.php', + 'PHPUnit\\Framework\\MockObject\\Generator\\InvalidMethodNameException' => __DIR__ . '/..' . '/phpunit/phpunit/src/Framework/MockObject/Generator/Exception/InvalidMethodNameException.php', + 'PHPUnit\\Framework\\MockObject\\Generator\\MockClass' => __DIR__ . '/..' . '/phpunit/phpunit/src/Framework/MockObject/Generator/MockClass.php', + 'PHPUnit\\Framework\\MockObject\\Generator\\MockMethod' => __DIR__ . '/..' . '/phpunit/phpunit/src/Framework/MockObject/Generator/MockMethod.php', + 'PHPUnit\\Framework\\MockObject\\Generator\\MockMethodSet' => __DIR__ . '/..' . '/phpunit/phpunit/src/Framework/MockObject/Generator/MockMethodSet.php', + 'PHPUnit\\Framework\\MockObject\\Generator\\MockTrait' => __DIR__ . '/..' . '/phpunit/phpunit/src/Framework/MockObject/Generator/MockTrait.php', + 'PHPUnit\\Framework\\MockObject\\Generator\\MockType' => __DIR__ . '/..' . '/phpunit/phpunit/src/Framework/MockObject/Generator/MockType.php', + 'PHPUnit\\Framework\\MockObject\\Generator\\NameAlreadyInUseException' => __DIR__ . '/..' . '/phpunit/phpunit/src/Framework/MockObject/Generator/Exception/NameAlreadyInUseException.php', + 'PHPUnit\\Framework\\MockObject\\Generator\\OriginalConstructorInvocationRequiredException' => __DIR__ . '/..' . '/phpunit/phpunit/src/Framework/MockObject/Generator/Exception/OriginalConstructorInvocationRequiredException.php', + 'PHPUnit\\Framework\\MockObject\\Generator\\ReflectionException' => __DIR__ . '/..' . '/phpunit/phpunit/src/Framework/MockObject/Generator/Exception/ReflectionException.php', + 'PHPUnit\\Framework\\MockObject\\Generator\\RuntimeException' => __DIR__ . '/..' . '/phpunit/phpunit/src/Framework/MockObject/Generator/Exception/RuntimeException.php', + 'PHPUnit\\Framework\\MockObject\\Generator\\SoapExtensionNotAvailableException' => __DIR__ . '/..' . '/phpunit/phpunit/src/Framework/MockObject/Generator/Exception/SoapExtensionNotAvailableException.php', + 'PHPUnit\\Framework\\MockObject\\Generator\\TemplateLoader' => __DIR__ . '/..' . '/phpunit/phpunit/src/Framework/MockObject/Generator/TemplateLoader.php', + 'PHPUnit\\Framework\\MockObject\\Generator\\UnknownClassException' => __DIR__ . '/..' . '/phpunit/phpunit/src/Framework/MockObject/Generator/Exception/UnknownClassException.php', + 'PHPUnit\\Framework\\MockObject\\Generator\\UnknownTraitException' => __DIR__ . '/..' . '/phpunit/phpunit/src/Framework/MockObject/Generator/Exception/UnknownTraitException.php', + 'PHPUnit\\Framework\\MockObject\\Generator\\UnknownTypeException' => __DIR__ . '/..' . '/phpunit/phpunit/src/Framework/MockObject/Generator/Exception/UnknownTypeException.php', 'PHPUnit\\Framework\\MockObject\\IncompatibleReturnValueException' => __DIR__ . '/..' . '/phpunit/phpunit/src/Framework/MockObject/Exception/IncompatibleReturnValueException.php', - 'PHPUnit\\Framework\\MockObject\\InvalidMethodNameException' => __DIR__ . '/..' . '/phpunit/phpunit/src/Framework/MockObject/Exception/InvalidMethodNameException.php', - 'PHPUnit\\Framework\\MockObject\\Invocation' => __DIR__ . '/..' . '/phpunit/phpunit/src/Framework/MockObject/Invocation.php', - 'PHPUnit\\Framework\\MockObject\\InvocationHandler' => __DIR__ . '/..' . '/phpunit/phpunit/src/Framework/MockObject/InvocationHandler.php', + 'PHPUnit\\Framework\\MockObject\\Invocation' => __DIR__ . '/..' . '/phpunit/phpunit/src/Framework/MockObject/Runtime/Invocation.php', + 'PHPUnit\\Framework\\MockObject\\InvocationHandler' => __DIR__ . '/..' . '/phpunit/phpunit/src/Framework/MockObject/Runtime/InvocationHandler.php', 'PHPUnit\\Framework\\MockObject\\MatchBuilderNotFoundException' => __DIR__ . '/..' . '/phpunit/phpunit/src/Framework/MockObject/Exception/MatchBuilderNotFoundException.php', - 'PHPUnit\\Framework\\MockObject\\Matcher' => __DIR__ . '/..' . '/phpunit/phpunit/src/Framework/MockObject/Matcher.php', + 'PHPUnit\\Framework\\MockObject\\Matcher' => __DIR__ . '/..' . '/phpunit/phpunit/src/Framework/MockObject/Runtime/Matcher.php', 'PHPUnit\\Framework\\MockObject\\MatcherAlreadyRegisteredException' => __DIR__ . '/..' . '/phpunit/phpunit/src/Framework/MockObject/Exception/MatcherAlreadyRegisteredException.php', - 'PHPUnit\\Framework\\MockObject\\Method' => __DIR__ . '/..' . '/phpunit/phpunit/src/Framework/MockObject/Api/Method.php', + 'PHPUnit\\Framework\\MockObject\\Method' => __DIR__ . '/..' . '/phpunit/phpunit/src/Framework/MockObject/Runtime/Api/Method.php', 'PHPUnit\\Framework\\MockObject\\MethodCannotBeConfiguredException' => __DIR__ . '/..' . '/phpunit/phpunit/src/Framework/MockObject/Exception/MethodCannotBeConfiguredException.php', 'PHPUnit\\Framework\\MockObject\\MethodNameAlreadyConfiguredException' => __DIR__ . '/..' . '/phpunit/phpunit/src/Framework/MockObject/Exception/MethodNameAlreadyConfiguredException.php', - 'PHPUnit\\Framework\\MockObject\\MethodNameConstraint' => __DIR__ . '/..' . '/phpunit/phpunit/src/Framework/MockObject/MethodNameConstraint.php', + 'PHPUnit\\Framework\\MockObject\\MethodNameConstraint' => __DIR__ . '/..' . '/phpunit/phpunit/src/Framework/MockObject/Runtime/MethodNameConstraint.php', 'PHPUnit\\Framework\\MockObject\\MethodNameNotConfiguredException' => __DIR__ . '/..' . '/phpunit/phpunit/src/Framework/MockObject/Exception/MethodNameNotConfiguredException.php', 'PHPUnit\\Framework\\MockObject\\MethodParametersAlreadyConfiguredException' => __DIR__ . '/..' . '/phpunit/phpunit/src/Framework/MockObject/Exception/MethodParametersAlreadyConfiguredException.php', 'PHPUnit\\Framework\\MockObject\\MockBuilder' => __DIR__ . '/..' . '/phpunit/phpunit/src/Framework/MockObject/MockBuilder.php', - 'PHPUnit\\Framework\\MockObject\\MockClass' => __DIR__ . '/..' . '/phpunit/phpunit/src/Framework/MockObject/MockClass.php', - 'PHPUnit\\Framework\\MockObject\\MockMethod' => __DIR__ . '/..' . '/phpunit/phpunit/src/Framework/MockObject/MockMethod.php', - 'PHPUnit\\Framework\\MockObject\\MockMethodSet' => __DIR__ . '/..' . '/phpunit/phpunit/src/Framework/MockObject/MockMethodSet.php', - 'PHPUnit\\Framework\\MockObject\\MockObject' => __DIR__ . '/..' . '/phpunit/phpunit/src/Framework/MockObject/MockObject.php', - 'PHPUnit\\Framework\\MockObject\\MockTrait' => __DIR__ . '/..' . '/phpunit/phpunit/src/Framework/MockObject/MockTrait.php', - 'PHPUnit\\Framework\\MockObject\\MockType' => __DIR__ . '/..' . '/phpunit/phpunit/src/Framework/MockObject/MockType.php', - 'PHPUnit\\Framework\\MockObject\\MockedCloneMethod' => __DIR__ . '/..' . '/phpunit/phpunit/src/Framework/MockObject/Api/MockedCloneMethod.php', - 'PHPUnit\\Framework\\MockObject\\OriginalConstructorInvocationRequiredException' => __DIR__ . '/..' . '/phpunit/phpunit/src/Framework/MockObject/Exception/OriginalConstructorInvocationRequiredException.php', - 'PHPUnit\\Framework\\MockObject\\ReflectionException' => __DIR__ . '/..' . '/phpunit/phpunit/src/Framework/MockObject/Exception/ReflectionException.php', + 'PHPUnit\\Framework\\MockObject\\MockObject' => __DIR__ . '/..' . '/phpunit/phpunit/src/Framework/MockObject/Runtime/Interface/MockObject.php', + 'PHPUnit\\Framework\\MockObject\\MockObjectApi' => __DIR__ . '/..' . '/phpunit/phpunit/src/Framework/MockObject/Runtime/Api/MockObjectApi.php', + 'PHPUnit\\Framework\\MockObject\\MockObjectInternal' => __DIR__ . '/..' . '/phpunit/phpunit/src/Framework/MockObject/Runtime/Interface/MockObjectInternal.php', + 'PHPUnit\\Framework\\MockObject\\NeverReturningMethodException' => __DIR__ . '/..' . '/phpunit/phpunit/src/Framework/MockObject/Exception/NeverReturningMethodException.php', + 'PHPUnit\\Framework\\MockObject\\NoMoreReturnValuesConfiguredException' => __DIR__ . '/..' . '/phpunit/phpunit/src/Framework/MockObject/Exception/NoMoreReturnValuesConfiguredException.php', + 'PHPUnit\\Framework\\MockObject\\ProxiedCloneMethod' => __DIR__ . '/..' . '/phpunit/phpunit/src/Framework/MockObject/Runtime/Api/ProxiedCloneMethod.php', + 'PHPUnit\\Framework\\MockObject\\ReturnValueGenerator' => __DIR__ . '/..' . '/phpunit/phpunit/src/Framework/MockObject/Runtime/ReturnValueGenerator.php', 'PHPUnit\\Framework\\MockObject\\ReturnValueNotConfiguredException' => __DIR__ . '/..' . '/phpunit/phpunit/src/Framework/MockObject/Exception/ReturnValueNotConfiguredException.php', - 'PHPUnit\\Framework\\MockObject\\Rule\\AnyInvokedCount' => __DIR__ . '/..' . '/phpunit/phpunit/src/Framework/MockObject/Rule/AnyInvokedCount.php', - 'PHPUnit\\Framework\\MockObject\\Rule\\AnyParameters' => __DIR__ . '/..' . '/phpunit/phpunit/src/Framework/MockObject/Rule/AnyParameters.php', - 'PHPUnit\\Framework\\MockObject\\Rule\\InvocationOrder' => __DIR__ . '/..' . '/phpunit/phpunit/src/Framework/MockObject/Rule/InvocationOrder.php', - 'PHPUnit\\Framework\\MockObject\\Rule\\InvokedAtLeastCount' => __DIR__ . '/..' . '/phpunit/phpunit/src/Framework/MockObject/Rule/InvokedAtLeastCount.php', - 'PHPUnit\\Framework\\MockObject\\Rule\\InvokedAtLeastOnce' => __DIR__ . '/..' . '/phpunit/phpunit/src/Framework/MockObject/Rule/InvokedAtLeastOnce.php', - 'PHPUnit\\Framework\\MockObject\\Rule\\InvokedAtMostCount' => __DIR__ . '/..' . '/phpunit/phpunit/src/Framework/MockObject/Rule/InvokedAtMostCount.php', - 'PHPUnit\\Framework\\MockObject\\Rule\\InvokedCount' => __DIR__ . '/..' . '/phpunit/phpunit/src/Framework/MockObject/Rule/InvokedCount.php', - 'PHPUnit\\Framework\\MockObject\\Rule\\MethodName' => __DIR__ . '/..' . '/phpunit/phpunit/src/Framework/MockObject/Rule/MethodName.php', - 'PHPUnit\\Framework\\MockObject\\Rule\\Parameters' => __DIR__ . '/..' . '/phpunit/phpunit/src/Framework/MockObject/Rule/Parameters.php', - 'PHPUnit\\Framework\\MockObject\\Rule\\ParametersRule' => __DIR__ . '/..' . '/phpunit/phpunit/src/Framework/MockObject/Rule/ParametersRule.php', + 'PHPUnit\\Framework\\MockObject\\Rule\\AnyInvokedCount' => __DIR__ . '/..' . '/phpunit/phpunit/src/Framework/MockObject/Runtime/Rule/AnyInvokedCount.php', + 'PHPUnit\\Framework\\MockObject\\Rule\\AnyParameters' => __DIR__ . '/..' . '/phpunit/phpunit/src/Framework/MockObject/Runtime/Rule/AnyParameters.php', + 'PHPUnit\\Framework\\MockObject\\Rule\\InvocationOrder' => __DIR__ . '/..' . '/phpunit/phpunit/src/Framework/MockObject/Runtime/Rule/InvocationOrder.php', + 'PHPUnit\\Framework\\MockObject\\Rule\\InvokedAtLeastCount' => __DIR__ . '/..' . '/phpunit/phpunit/src/Framework/MockObject/Runtime/Rule/InvokedAtLeastCount.php', + 'PHPUnit\\Framework\\MockObject\\Rule\\InvokedAtLeastOnce' => __DIR__ . '/..' . '/phpunit/phpunit/src/Framework/MockObject/Runtime/Rule/InvokedAtLeastOnce.php', + 'PHPUnit\\Framework\\MockObject\\Rule\\InvokedAtMostCount' => __DIR__ . '/..' . '/phpunit/phpunit/src/Framework/MockObject/Runtime/Rule/InvokedAtMostCount.php', + 'PHPUnit\\Framework\\MockObject\\Rule\\InvokedCount' => __DIR__ . '/..' . '/phpunit/phpunit/src/Framework/MockObject/Runtime/Rule/InvokedCount.php', + 'PHPUnit\\Framework\\MockObject\\Rule\\MethodName' => __DIR__ . '/..' . '/phpunit/phpunit/src/Framework/MockObject/Runtime/Rule/MethodName.php', + 'PHPUnit\\Framework\\MockObject\\Rule\\Parameters' => __DIR__ . '/..' . '/phpunit/phpunit/src/Framework/MockObject/Runtime/Rule/Parameters.php', + 'PHPUnit\\Framework\\MockObject\\Rule\\ParametersRule' => __DIR__ . '/..' . '/phpunit/phpunit/src/Framework/MockObject/Runtime/Rule/ParametersRule.php', 'PHPUnit\\Framework\\MockObject\\RuntimeException' => __DIR__ . '/..' . '/phpunit/phpunit/src/Framework/MockObject/Exception/RuntimeException.php', - 'PHPUnit\\Framework\\MockObject\\SoapExtensionNotAvailableException' => __DIR__ . '/..' . '/phpunit/phpunit/src/Framework/MockObject/Exception/SoapExtensionNotAvailableException.php', - 'PHPUnit\\Framework\\MockObject\\Stub' => __DIR__ . '/..' . '/phpunit/phpunit/src/Framework/MockObject/Stub.php', - 'PHPUnit\\Framework\\MockObject\\Stub\\ConsecutiveCalls' => __DIR__ . '/..' . '/phpunit/phpunit/src/Framework/MockObject/Stub/ConsecutiveCalls.php', - 'PHPUnit\\Framework\\MockObject\\Stub\\Exception' => __DIR__ . '/..' . '/phpunit/phpunit/src/Framework/MockObject/Stub/Exception.php', - 'PHPUnit\\Framework\\MockObject\\Stub\\ReturnArgument' => __DIR__ . '/..' . '/phpunit/phpunit/src/Framework/MockObject/Stub/ReturnArgument.php', - 'PHPUnit\\Framework\\MockObject\\Stub\\ReturnCallback' => __DIR__ . '/..' . '/phpunit/phpunit/src/Framework/MockObject/Stub/ReturnCallback.php', - 'PHPUnit\\Framework\\MockObject\\Stub\\ReturnReference' => __DIR__ . '/..' . '/phpunit/phpunit/src/Framework/MockObject/Stub/ReturnReference.php', - 'PHPUnit\\Framework\\MockObject\\Stub\\ReturnSelf' => __DIR__ . '/..' . '/phpunit/phpunit/src/Framework/MockObject/Stub/ReturnSelf.php', - 'PHPUnit\\Framework\\MockObject\\Stub\\ReturnStub' => __DIR__ . '/..' . '/phpunit/phpunit/src/Framework/MockObject/Stub/ReturnStub.php', - 'PHPUnit\\Framework\\MockObject\\Stub\\ReturnValueMap' => __DIR__ . '/..' . '/phpunit/phpunit/src/Framework/MockObject/Stub/ReturnValueMap.php', - 'PHPUnit\\Framework\\MockObject\\Stub\\Stub' => __DIR__ . '/..' . '/phpunit/phpunit/src/Framework/MockObject/Stub/Stub.php', - 'PHPUnit\\Framework\\MockObject\\TemplateLoader' => __DIR__ . '/..' . '/phpunit/phpunit/src/Framework/MockObject/TemplateLoader.php', - 'PHPUnit\\Framework\\MockObject\\UnknownClassException' => __DIR__ . '/..' . '/phpunit/phpunit/src/Framework/MockObject/Exception/UnknownClassException.php', - 'PHPUnit\\Framework\\MockObject\\UnknownTraitException' => __DIR__ . '/..' . '/phpunit/phpunit/src/Framework/MockObject/Exception/UnknownTraitException.php', - 'PHPUnit\\Framework\\MockObject\\UnknownTypeException' => __DIR__ . '/..' . '/phpunit/phpunit/src/Framework/MockObject/Exception/UnknownTypeException.php', - 'PHPUnit\\Framework\\MockObject\\UnmockedCloneMethod' => __DIR__ . '/..' . '/phpunit/phpunit/src/Framework/MockObject/Api/UnmockedCloneMethod.php', - 'PHPUnit\\Framework\\MockObject\\Verifiable' => __DIR__ . '/..' . '/phpunit/phpunit/src/Framework/MockObject/Verifiable.php', + 'PHPUnit\\Framework\\MockObject\\Stub' => __DIR__ . '/..' . '/phpunit/phpunit/src/Framework/MockObject/Runtime/Interface/Stub.php', + 'PHPUnit\\Framework\\MockObject\\StubApi' => __DIR__ . '/..' . '/phpunit/phpunit/src/Framework/MockObject/Runtime/Api/StubApi.php', + 'PHPUnit\\Framework\\MockObject\\StubInternal' => __DIR__ . '/..' . '/phpunit/phpunit/src/Framework/MockObject/Runtime/Interface/StubInternal.php', + 'PHPUnit\\Framework\\MockObject\\Stub\\ConsecutiveCalls' => __DIR__ . '/..' . '/phpunit/phpunit/src/Framework/MockObject/Runtime/Stub/ConsecutiveCalls.php', + 'PHPUnit\\Framework\\MockObject\\Stub\\Exception' => __DIR__ . '/..' . '/phpunit/phpunit/src/Framework/MockObject/Runtime/Stub/Exception.php', + 'PHPUnit\\Framework\\MockObject\\Stub\\ReturnArgument' => __DIR__ . '/..' . '/phpunit/phpunit/src/Framework/MockObject/Runtime/Stub/ReturnArgument.php', + 'PHPUnit\\Framework\\MockObject\\Stub\\ReturnCallback' => __DIR__ . '/..' . '/phpunit/phpunit/src/Framework/MockObject/Runtime/Stub/ReturnCallback.php', + 'PHPUnit\\Framework\\MockObject\\Stub\\ReturnReference' => __DIR__ . '/..' . '/phpunit/phpunit/src/Framework/MockObject/Runtime/Stub/ReturnReference.php', + 'PHPUnit\\Framework\\MockObject\\Stub\\ReturnSelf' => __DIR__ . '/..' . '/phpunit/phpunit/src/Framework/MockObject/Runtime/Stub/ReturnSelf.php', + 'PHPUnit\\Framework\\MockObject\\Stub\\ReturnStub' => __DIR__ . '/..' . '/phpunit/phpunit/src/Framework/MockObject/Runtime/Stub/ReturnStub.php', + 'PHPUnit\\Framework\\MockObject\\Stub\\ReturnValueMap' => __DIR__ . '/..' . '/phpunit/phpunit/src/Framework/MockObject/Runtime/Stub/ReturnValueMap.php', + 'PHPUnit\\Framework\\MockObject\\Stub\\Stub' => __DIR__ . '/..' . '/phpunit/phpunit/src/Framework/MockObject/Runtime/Stub/Stub.php', 'PHPUnit\\Framework\\NoChildTestSuiteException' => __DIR__ . '/..' . '/phpunit/phpunit/src/Framework/Exception/NoChildTestSuiteException.php', 'PHPUnit\\Framework\\PhptAssertionFailedError' => __DIR__ . '/..' . '/phpunit/phpunit/src/Framework/Exception/PhptAssertionFailedError.php', 'PHPUnit\\Framework\\ProcessIsolationException' => __DIR__ . '/..' . '/phpunit/phpunit/src/Framework/Exception/ProcessIsolationException.php', @@ -5093,18 +5155,19 @@ class ComposerStaticInit0a39803e5364a51c44275cdfc5d8af8d 'PHPUnit\\Framework\\TestStatus\\Warning' => __DIR__ . '/..' . '/phpunit/phpunit/src/Framework/TestStatus/Warning.php', 'PHPUnit\\Framework\\TestSuite' => __DIR__ . '/..' . '/phpunit/phpunit/src/Framework/TestSuite.php', 'PHPUnit\\Framework\\TestSuiteIterator' => __DIR__ . '/..' . '/phpunit/phpunit/src/Framework/TestSuiteIterator.php', - 'PHPUnit\\Framework\\UnknownClassException' => __DIR__ . '/..' . '/phpunit/phpunit/src/Framework/Exception/UnknownClassException.php', 'PHPUnit\\Framework\\UnknownClassOrInterfaceException' => __DIR__ . '/..' . '/phpunit/phpunit/src/Framework/Exception/UnknownClassOrInterfaceException.php', 'PHPUnit\\Framework\\UnknownTypeException' => __DIR__ . '/..' . '/phpunit/phpunit/src/Framework/Exception/UnknownTypeException.php', 'PHPUnit\\Logging\\EventLogger' => __DIR__ . '/..' . '/phpunit/phpunit/src/Logging/EventLogger.php', - 'PHPUnit\\Logging\\Exception' => __DIR__ . '/..' . '/phpunit/phpunit/src/Logging/Exception.php', 'PHPUnit\\Logging\\JUnit\\JunitXmlLogger' => __DIR__ . '/..' . '/phpunit/phpunit/src/Logging/JUnit/JunitXmlLogger.php', 'PHPUnit\\Logging\\JUnit\\Subscriber' => __DIR__ . '/..' . '/phpunit/phpunit/src/Logging/JUnit/Subscriber/Subscriber.php', 'PHPUnit\\Logging\\JUnit\\TestErroredSubscriber' => __DIR__ . '/..' . '/phpunit/phpunit/src/Logging/JUnit/Subscriber/TestErroredSubscriber.php', 'PHPUnit\\Logging\\JUnit\\TestFailedSubscriber' => __DIR__ . '/..' . '/phpunit/phpunit/src/Logging/JUnit/Subscriber/TestFailedSubscriber.php', 'PHPUnit\\Logging\\JUnit\\TestFinishedSubscriber' => __DIR__ . '/..' . '/phpunit/phpunit/src/Logging/JUnit/Subscriber/TestFinishedSubscriber.php', 'PHPUnit\\Logging\\JUnit\\TestMarkedIncompleteSubscriber' => __DIR__ . '/..' . '/phpunit/phpunit/src/Logging/JUnit/Subscriber/TestMarkedIncompleteSubscriber.php', + 'PHPUnit\\Logging\\JUnit\\TestPreparationFailedSubscriber' => __DIR__ . '/..' . '/phpunit/phpunit/src/Logging/JUnit/Subscriber/TestPreparationFailedSubscriber.php', + 'PHPUnit\\Logging\\JUnit\\TestPreparationStartedSubscriber' => __DIR__ . '/..' . '/phpunit/phpunit/src/Logging/JUnit/Subscriber/TestPreparationStartedSubscriber.php', 'PHPUnit\\Logging\\JUnit\\TestPreparedSubscriber' => __DIR__ . '/..' . '/phpunit/phpunit/src/Logging/JUnit/Subscriber/TestPreparedSubscriber.php', + 'PHPUnit\\Logging\\JUnit\\TestPrintedUnexpectedOutputSubscriber' => __DIR__ . '/..' . '/phpunit/phpunit/src/Logging/JUnit/Subscriber/TestPrintedUnexpectedOutputSubscriber.php', 'PHPUnit\\Logging\\JUnit\\TestRunnerExecutionFinishedSubscriber' => __DIR__ . '/..' . '/phpunit/phpunit/src/Logging/JUnit/Subscriber/TestRunnerExecutionFinishedSubscriber.php', 'PHPUnit\\Logging\\JUnit\\TestSkippedSubscriber' => __DIR__ . '/..' . '/phpunit/phpunit/src/Logging/JUnit/Subscriber/TestSkippedSubscriber.php', 'PHPUnit\\Logging\\JUnit\\TestSuiteFinishedSubscriber' => __DIR__ . '/..' . '/phpunit/phpunit/src/Logging/JUnit/Subscriber/TestSuiteFinishedSubscriber.php', @@ -5119,31 +5182,35 @@ class ComposerStaticInit0a39803e5364a51c44275cdfc5d8af8d 'PHPUnit\\Logging\\TeamCity\\TestPreparedSubscriber' => __DIR__ . '/..' . '/phpunit/phpunit/src/Logging/TeamCity/Subscriber/TestPreparedSubscriber.php', 'PHPUnit\\Logging\\TeamCity\\TestRunnerExecutionFinishedSubscriber' => __DIR__ . '/..' . '/phpunit/phpunit/src/Logging/TeamCity/Subscriber/TestRunnerExecutionFinishedSubscriber.php', 'PHPUnit\\Logging\\TeamCity\\TestSkippedSubscriber' => __DIR__ . '/..' . '/phpunit/phpunit/src/Logging/TeamCity/Subscriber/TestSkippedSubscriber.php', + 'PHPUnit\\Logging\\TeamCity\\TestSuiteBeforeFirstTestMethodErroredSubscriber' => __DIR__ . '/..' . '/phpunit/phpunit/src/Logging/TeamCity/Subscriber/TestSuiteBeforeFirstTestMethodErroredSubscriber.php', 'PHPUnit\\Logging\\TeamCity\\TestSuiteFinishedSubscriber' => __DIR__ . '/..' . '/phpunit/phpunit/src/Logging/TeamCity/Subscriber/TestSuiteFinishedSubscriber.php', + 'PHPUnit\\Logging\\TeamCity\\TestSuiteSkippedSubscriber' => __DIR__ . '/..' . '/phpunit/phpunit/src/Logging/TeamCity/Subscriber/TestSuiteSkippedSubscriber.php', 'PHPUnit\\Logging\\TeamCity\\TestSuiteStartedSubscriber' => __DIR__ . '/..' . '/phpunit/phpunit/src/Logging/TeamCity/Subscriber/TestSuiteStartedSubscriber.php', 'PHPUnit\\Logging\\TestDox\\HtmlRenderer' => __DIR__ . '/..' . '/phpunit/phpunit/src/Logging/TestDox/HtmlRenderer.php', 'PHPUnit\\Logging\\TestDox\\NamePrettifier' => __DIR__ . '/..' . '/phpunit/phpunit/src/Logging/TestDox/NamePrettifier.php', 'PHPUnit\\Logging\\TestDox\\PlainTextRenderer' => __DIR__ . '/..' . '/phpunit/phpunit/src/Logging/TestDox/PlainTextRenderer.php', - 'PHPUnit\\Logging\\TestDox\\Subscriber' => __DIR__ . '/..' . '/phpunit/phpunit/src/Logging/TestDox/TestMethod/Subscriber/Subscriber.php', - 'PHPUnit\\Logging\\TestDox\\TestConsideredRiskySubscriber' => __DIR__ . '/..' . '/phpunit/phpunit/src/Logging/TestDox/TestMethod/Subscriber/TestConsideredRiskySubscriber.php', - 'PHPUnit\\Logging\\TestDox\\TestCreatedMockObjectForAbstractClassSubscriber' => __DIR__ . '/..' . '/phpunit/phpunit/src/Logging/TestDox/TestMethod/Subscriber/TestCreatedMockObjectForAbstractClassSubscriber.php', - 'PHPUnit\\Logging\\TestDox\\TestCreatedMockObjectForTraitSubscriber' => __DIR__ . '/..' . '/phpunit/phpunit/src/Logging/TestDox/TestMethod/Subscriber/TestCreatedMockObjectForTraitSubscriber.php', - 'PHPUnit\\Logging\\TestDox\\TestCreatedMockObjectFromWsdlSubscriber' => __DIR__ . '/..' . '/phpunit/phpunit/src/Logging/TestDox/TestMethod/Subscriber/TestCreatedMockObjectFromWsdlSubscriber.php', - 'PHPUnit\\Logging\\TestDox\\TestCreatedMockObjectSubscriber' => __DIR__ . '/..' . '/phpunit/phpunit/src/Logging/TestDox/TestMethod/Subscriber/TestCreatedMockObjectSubscriber.php', - 'PHPUnit\\Logging\\TestDox\\TestCreatedPartialMockObjectSubscriber' => __DIR__ . '/..' . '/phpunit/phpunit/src/Logging/TestDox/TestMethod/Subscriber/TestCreatedPartialMockObjectSubscriber.php', - 'PHPUnit\\Logging\\TestDox\\TestCreatedTestProxySubscriber' => __DIR__ . '/..' . '/phpunit/phpunit/src/Logging/TestDox/TestMethod/Subscriber/TestCreatedTestProxySubscriber.php', - 'PHPUnit\\Logging\\TestDox\\TestCreatedTestStubSubscriber' => __DIR__ . '/..' . '/phpunit/phpunit/src/Logging/TestDox/TestMethod/Subscriber/TestCreatedTestStubSubscriber.php', - 'PHPUnit\\Logging\\TestDox\\TestErroredSubscriber' => __DIR__ . '/..' . '/phpunit/phpunit/src/Logging/TestDox/TestMethod/Subscriber/TestErroredSubscriber.php', - 'PHPUnit\\Logging\\TestDox\\TestFailedSubscriber' => __DIR__ . '/..' . '/phpunit/phpunit/src/Logging/TestDox/TestMethod/Subscriber/TestFailedSubscriber.php', - 'PHPUnit\\Logging\\TestDox\\TestFinishedSubscriber' => __DIR__ . '/..' . '/phpunit/phpunit/src/Logging/TestDox/TestMethod/Subscriber/TestFinishedSubscriber.php', - 'PHPUnit\\Logging\\TestDox\\TestMarkedIncompleteSubscriber' => __DIR__ . '/..' . '/phpunit/phpunit/src/Logging/TestDox/TestMethod/Subscriber/TestMarkedIncompleteSubscriber.php', - 'PHPUnit\\Logging\\TestDox\\TestPassedSubscriber' => __DIR__ . '/..' . '/phpunit/phpunit/src/Logging/TestDox/TestMethod/Subscriber/TestPassedSubscriber.php', - 'PHPUnit\\Logging\\TestDox\\TestPreparedSubscriber' => __DIR__ . '/..' . '/phpunit/phpunit/src/Logging/TestDox/TestMethod/Subscriber/TestPreparedSubscriber.php', - 'PHPUnit\\Logging\\TestDox\\TestResult' => __DIR__ . '/..' . '/phpunit/phpunit/src/Logging/TestDox/TestMethod/TestResult.php', - 'PHPUnit\\Logging\\TestDox\\TestResultCollection' => __DIR__ . '/..' . '/phpunit/phpunit/src/Logging/TestDox/TestMethod/TestResultCollection.php', - 'PHPUnit\\Logging\\TestDox\\TestResultCollectionIterator' => __DIR__ . '/..' . '/phpunit/phpunit/src/Logging/TestDox/TestMethod/TestResultCollectionIterator.php', - 'PHPUnit\\Logging\\TestDox\\TestResultCollector' => __DIR__ . '/..' . '/phpunit/phpunit/src/Logging/TestDox/TestMethod/TestResultCollector.php', - 'PHPUnit\\Logging\\TestDox\\TestSkippedSubscriber' => __DIR__ . '/..' . '/phpunit/phpunit/src/Logging/TestDox/TestMethod/Subscriber/TestSkippedSubscriber.php', + 'PHPUnit\\Logging\\TestDox\\Subscriber' => __DIR__ . '/..' . '/phpunit/phpunit/src/Logging/TestDox/TestResult/Subscriber/Subscriber.php', + 'PHPUnit\\Logging\\TestDox\\TestConsideredRiskySubscriber' => __DIR__ . '/..' . '/phpunit/phpunit/src/Logging/TestDox/TestResult/Subscriber/TestConsideredRiskySubscriber.php', + 'PHPUnit\\Logging\\TestDox\\TestErroredSubscriber' => __DIR__ . '/..' . '/phpunit/phpunit/src/Logging/TestDox/TestResult/Subscriber/TestErroredSubscriber.php', + 'PHPUnit\\Logging\\TestDox\\TestFailedSubscriber' => __DIR__ . '/..' . '/phpunit/phpunit/src/Logging/TestDox/TestResult/Subscriber/TestFailedSubscriber.php', + 'PHPUnit\\Logging\\TestDox\\TestFinishedSubscriber' => __DIR__ . '/..' . '/phpunit/phpunit/src/Logging/TestDox/TestResult/Subscriber/TestFinishedSubscriber.php', + 'PHPUnit\\Logging\\TestDox\\TestMarkedIncompleteSubscriber' => __DIR__ . '/..' . '/phpunit/phpunit/src/Logging/TestDox/TestResult/Subscriber/TestMarkedIncompleteSubscriber.php', + 'PHPUnit\\Logging\\TestDox\\TestPassedSubscriber' => __DIR__ . '/..' . '/phpunit/phpunit/src/Logging/TestDox/TestResult/Subscriber/TestPassedSubscriber.php', + 'PHPUnit\\Logging\\TestDox\\TestPreparedSubscriber' => __DIR__ . '/..' . '/phpunit/phpunit/src/Logging/TestDox/TestResult/Subscriber/TestPreparedSubscriber.php', + 'PHPUnit\\Logging\\TestDox\\TestResult' => __DIR__ . '/..' . '/phpunit/phpunit/src/Logging/TestDox/TestResult/TestResult.php', + 'PHPUnit\\Logging\\TestDox\\TestResultCollection' => __DIR__ . '/..' . '/phpunit/phpunit/src/Logging/TestDox/TestResult/TestResultCollection.php', + 'PHPUnit\\Logging\\TestDox\\TestResultCollectionIterator' => __DIR__ . '/..' . '/phpunit/phpunit/src/Logging/TestDox/TestResult/TestResultCollectionIterator.php', + 'PHPUnit\\Logging\\TestDox\\TestResultCollector' => __DIR__ . '/..' . '/phpunit/phpunit/src/Logging/TestDox/TestResult/TestResultCollector.php', + 'PHPUnit\\Logging\\TestDox\\TestSkippedSubscriber' => __DIR__ . '/..' . '/phpunit/phpunit/src/Logging/TestDox/TestResult/Subscriber/TestSkippedSubscriber.php', + 'PHPUnit\\Logging\\TestDox\\TestTriggeredDeprecationSubscriber' => __DIR__ . '/..' . '/phpunit/phpunit/src/Logging/TestDox/TestResult/Subscriber/TestTriggeredDeprecationSubscriber.php', + 'PHPUnit\\Logging\\TestDox\\TestTriggeredNoticeSubscriber' => __DIR__ . '/..' . '/phpunit/phpunit/src/Logging/TestDox/TestResult/Subscriber/TestTriggeredNoticeSubscriber.php', + 'PHPUnit\\Logging\\TestDox\\TestTriggeredPhpDeprecationSubscriber' => __DIR__ . '/..' . '/phpunit/phpunit/src/Logging/TestDox/TestResult/Subscriber/TestTriggeredPhpDeprecationSubscriber.php', + 'PHPUnit\\Logging\\TestDox\\TestTriggeredPhpNoticeSubscriber' => __DIR__ . '/..' . '/phpunit/phpunit/src/Logging/TestDox/TestResult/Subscriber/TestTriggeredPhpNoticeSubscriber.php', + 'PHPUnit\\Logging\\TestDox\\TestTriggeredPhpWarningSubscriber' => __DIR__ . '/..' . '/phpunit/phpunit/src/Logging/TestDox/TestResult/Subscriber/TestTriggeredPhpWarningSubscriber.php', + 'PHPUnit\\Logging\\TestDox\\TestTriggeredPhpunitDeprecationSubscriber' => __DIR__ . '/..' . '/phpunit/phpunit/src/Logging/TestDox/TestResult/Subscriber/TestTriggeredPhpunitDeprecationSubscriber.php', + 'PHPUnit\\Logging\\TestDox\\TestTriggeredPhpunitErrorSubscriber' => __DIR__ . '/..' . '/phpunit/phpunit/src/Logging/TestDox/TestResult/Subscriber/TestTriggeredPhpunitErrorSubscriber.php', + 'PHPUnit\\Logging\\TestDox\\TestTriggeredPhpunitWarningSubscriber' => __DIR__ . '/..' . '/phpunit/phpunit/src/Logging/TestDox/TestResult/Subscriber/TestTriggeredPhpunitWarningSubscriber.php', + 'PHPUnit\\Logging\\TestDox\\TestTriggeredWarningSubscriber' => __DIR__ . '/..' . '/phpunit/phpunit/src/Logging/TestDox/TestResult/Subscriber/TestTriggeredWarningSubscriber.php', 'PHPUnit\\Metadata\\After' => __DIR__ . '/..' . '/phpunit/phpunit/src/Metadata/After.php', 'PHPUnit\\Metadata\\AfterClass' => __DIR__ . '/..' . '/phpunit/phpunit/src/Metadata/AfterClass.php', 'PHPUnit\\Metadata\\Annotation\\Parser\\DocBlock' => __DIR__ . '/..' . '/phpunit/phpunit/src/Metadata/Parser/Annotation/DocBlock.php', @@ -5172,6 +5239,11 @@ class ComposerStaticInit0a39803e5364a51c44275cdfc5d8af8d 'PHPUnit\\Metadata\\ExcludeGlobalVariableFromBackup' => __DIR__ . '/..' . '/phpunit/phpunit/src/Metadata/ExcludeGlobalVariableFromBackup.php', 'PHPUnit\\Metadata\\ExcludeStaticPropertyFromBackup' => __DIR__ . '/..' . '/phpunit/phpunit/src/Metadata/ExcludeStaticPropertyFromBackup.php', 'PHPUnit\\Metadata\\Group' => __DIR__ . '/..' . '/phpunit/phpunit/src/Metadata/Group.php', + 'PHPUnit\\Metadata\\IgnoreClassForCodeCoverage' => __DIR__ . '/..' . '/phpunit/phpunit/src/Metadata/IgnoreClassForCodeCoverage.php', + 'PHPUnit\\Metadata\\IgnoreDeprecations' => __DIR__ . '/..' . '/phpunit/phpunit/src/Metadata/IgnoreDeprecations.php', + 'PHPUnit\\Metadata\\IgnoreFunctionForCodeCoverage' => __DIR__ . '/..' . '/phpunit/phpunit/src/Metadata/IgnoreFunctionForCodeCoverage.php', + 'PHPUnit\\Metadata\\IgnoreMethodForCodeCoverage' => __DIR__ . '/..' . '/phpunit/phpunit/src/Metadata/IgnoreMethodForCodeCoverage.php', + 'PHPUnit\\Metadata\\InvalidAttributeException' => __DIR__ . '/..' . '/phpunit/phpunit/src/Metadata/Exception/InvalidAttributeException.php', 'PHPUnit\\Metadata\\InvalidVersionRequirementException' => __DIR__ . '/..' . '/phpunit/phpunit/src/Metadata/Exception/InvalidVersionRequirementException.php', 'PHPUnit\\Metadata\\Metadata' => __DIR__ . '/..' . '/phpunit/phpunit/src/Metadata/Metadata.php', 'PHPUnit\\Metadata\\MetadataCollection' => __DIR__ . '/..' . '/phpunit/phpunit/src/Metadata/MetadataCollection.php', @@ -5208,13 +5280,30 @@ class ComposerStaticInit0a39803e5364a51c44275cdfc5d8af8d 'PHPUnit\\Metadata\\Version\\ComparisonRequirement' => __DIR__ . '/..' . '/phpunit/phpunit/src/Metadata/Version/ComparisonRequirement.php', 'PHPUnit\\Metadata\\Version\\ConstraintRequirement' => __DIR__ . '/..' . '/phpunit/phpunit/src/Metadata/Version/ConstraintRequirement.php', 'PHPUnit\\Metadata\\Version\\Requirement' => __DIR__ . '/..' . '/phpunit/phpunit/src/Metadata/Version/Requirement.php', + 'PHPUnit\\Metadata\\WithoutErrorHandler' => __DIR__ . '/..' . '/phpunit/phpunit/src/Metadata/WithoutErrorHandler.php', + 'PHPUnit\\Runner\\Baseline\\Baseline' => __DIR__ . '/..' . '/phpunit/phpunit/src/Runner/Baseline/Baseline.php', + 'PHPUnit\\Runner\\Baseline\\CannotLoadBaselineException' => __DIR__ . '/..' . '/phpunit/phpunit/src/Runner/Baseline/Exception/CannotLoadBaselineException.php', + 'PHPUnit\\Runner\\Baseline\\FileDoesNotHaveLineException' => __DIR__ . '/..' . '/phpunit/phpunit/src/Runner/Baseline/Exception/FileDoesNotHaveLineException.php', + 'PHPUnit\\Runner\\Baseline\\Generator' => __DIR__ . '/..' . '/phpunit/phpunit/src/Runner/Baseline/Generator.php', + 'PHPUnit\\Runner\\Baseline\\Issue' => __DIR__ . '/..' . '/phpunit/phpunit/src/Runner/Baseline/Issue.php', + 'PHPUnit\\Runner\\Baseline\\Reader' => __DIR__ . '/..' . '/phpunit/phpunit/src/Runner/Baseline/Reader.php', + 'PHPUnit\\Runner\\Baseline\\RelativePathCalculator' => __DIR__ . '/..' . '/phpunit/phpunit/src/Runner/Baseline/RelativePathCalculator.php', + 'PHPUnit\\Runner\\Baseline\\Subscriber' => __DIR__ . '/..' . '/phpunit/phpunit/src/Runner/Baseline/Subscriber/Subscriber.php', + 'PHPUnit\\Runner\\Baseline\\TestTriggeredDeprecationSubscriber' => __DIR__ . '/..' . '/phpunit/phpunit/src/Runner/Baseline/Subscriber/TestTriggeredDeprecationSubscriber.php', + 'PHPUnit\\Runner\\Baseline\\TestTriggeredNoticeSubscriber' => __DIR__ . '/..' . '/phpunit/phpunit/src/Runner/Baseline/Subscriber/TestTriggeredNoticeSubscriber.php', + 'PHPUnit\\Runner\\Baseline\\TestTriggeredPhpDeprecationSubscriber' => __DIR__ . '/..' . '/phpunit/phpunit/src/Runner/Baseline/Subscriber/TestTriggeredPhpDeprecationSubscriber.php', + 'PHPUnit\\Runner\\Baseline\\TestTriggeredPhpNoticeSubscriber' => __DIR__ . '/..' . '/phpunit/phpunit/src/Runner/Baseline/Subscriber/TestTriggeredPhpNoticeSubscriber.php', + 'PHPUnit\\Runner\\Baseline\\TestTriggeredPhpWarningSubscriber' => __DIR__ . '/..' . '/phpunit/phpunit/src/Runner/Baseline/Subscriber/TestTriggeredPhpWarningSubscriber.php', + 'PHPUnit\\Runner\\Baseline\\TestTriggeredWarningSubscriber' => __DIR__ . '/..' . '/phpunit/phpunit/src/Runner/Baseline/Subscriber/TestTriggeredWarningSubscriber.php', + 'PHPUnit\\Runner\\Baseline\\Writer' => __DIR__ . '/..' . '/phpunit/phpunit/src/Runner/Baseline/Writer.php', 'PHPUnit\\Runner\\ClassCannotBeFoundException' => __DIR__ . '/..' . '/phpunit/phpunit/src/Runner/Exception/ClassCannotBeFoundException.php', - 'PHPUnit\\Runner\\ClassCannotBeInstantiatedException' => __DIR__ . '/..' . '/phpunit/phpunit/src/Runner/Exception/ClassCannotBeInstantiatedException.php', - 'PHPUnit\\Runner\\ClassDoesNotExistException' => __DIR__ . '/..' . '/phpunit/phpunit/src/Runner/Exception/ClassDoesNotExistException.php', - 'PHPUnit\\Runner\\ClassDoesNotImplementExtensionInterfaceException' => __DIR__ . '/..' . '/phpunit/phpunit/src/Runner/Exception/ClassDoesNotImplementExtensionInterfaceException.php', + 'PHPUnit\\Runner\\ClassDoesNotExtendTestCaseException' => __DIR__ . '/..' . '/phpunit/phpunit/src/Runner/Exception/ClassDoesNotExtendTestCaseException.php', 'PHPUnit\\Runner\\ClassIsAbstractException' => __DIR__ . '/..' . '/phpunit/phpunit/src/Runner/Exception/ClassIsAbstractException.php', 'PHPUnit\\Runner\\CodeCoverage' => __DIR__ . '/..' . '/phpunit/phpunit/src/Runner/CodeCoverage.php', - 'PHPUnit\\Runner\\DirectoryCannotBeCreatedException' => __DIR__ . '/..' . '/phpunit/phpunit/src/Runner/Exception/DirectoryCannotBeCreatedException.php', + 'PHPUnit\\Runner\\CodeCoverageFileExistsException' => __DIR__ . '/..' . '/phpunit/phpunit/src/Runner/Exception/CodeCoverageFileExistsException.php', + 'PHPUnit\\Runner\\DirectoryDoesNotExistException' => __DIR__ . '/..' . '/phpunit/phpunit/src/Runner/Exception/DirectoryDoesNotExistException.php', + 'PHPUnit\\Runner\\ErrorException' => __DIR__ . '/..' . '/phpunit/phpunit/src/Runner/Exception/ErrorException.php', + 'PHPUnit\\Runner\\ErrorHandler' => __DIR__ . '/..' . '/phpunit/phpunit/src/Runner/ErrorHandler.php', 'PHPUnit\\Runner\\Exception' => __DIR__ . '/..' . '/phpunit/phpunit/src/Runner/Exception/Exception.php', 'PHPUnit\\Runner\\Extension\\Extension' => __DIR__ . '/..' . '/phpunit/phpunit/src/Runner/Extension/Extension.php', 'PHPUnit\\Runner\\Extension\\ExtensionBootstrapper' => __DIR__ . '/..' . '/phpunit/phpunit/src/Runner/Extension/ExtensionBootstrapper.php', @@ -5227,13 +5316,17 @@ class ComposerStaticInit0a39803e5364a51c44275cdfc5d8af8d 'PHPUnit\\Runner\\Filter\\GroupFilterIterator' => __DIR__ . '/..' . '/phpunit/phpunit/src/Runner/Filter/GroupFilterIterator.php', 'PHPUnit\\Runner\\Filter\\IncludeGroupFilterIterator' => __DIR__ . '/..' . '/phpunit/phpunit/src/Runner/Filter/IncludeGroupFilterIterator.php', 'PHPUnit\\Runner\\Filter\\NameFilterIterator' => __DIR__ . '/..' . '/phpunit/phpunit/src/Runner/Filter/NameFilterIterator.php', + 'PHPUnit\\Runner\\Filter\\TestIdFilterIterator' => __DIR__ . '/..' . '/phpunit/phpunit/src/Runner/Filter/TestIdFilterIterator.php', + 'PHPUnit\\Runner\\GarbageCollection\\ExecutionFinishedSubscriber' => __DIR__ . '/..' . '/phpunit/phpunit/src/Runner/GarbageCollection/Subscriber/ExecutionFinishedSubscriber.php', + 'PHPUnit\\Runner\\GarbageCollection\\ExecutionStartedSubscriber' => __DIR__ . '/..' . '/phpunit/phpunit/src/Runner/GarbageCollection/Subscriber/ExecutionStartedSubscriber.php', + 'PHPUnit\\Runner\\GarbageCollection\\GarbageCollectionHandler' => __DIR__ . '/..' . '/phpunit/phpunit/src/Runner/GarbageCollection/GarbageCollectionHandler.php', + 'PHPUnit\\Runner\\GarbageCollection\\Subscriber' => __DIR__ . '/..' . '/phpunit/phpunit/src/Runner/GarbageCollection/Subscriber/Subscriber.php', + 'PHPUnit\\Runner\\GarbageCollection\\TestFinishedSubscriber' => __DIR__ . '/..' . '/phpunit/phpunit/src/Runner/GarbageCollection/Subscriber/TestFinishedSubscriber.php', 'PHPUnit\\Runner\\InvalidOrderException' => __DIR__ . '/..' . '/phpunit/phpunit/src/Runner/Exception/InvalidOrderException.php', 'PHPUnit\\Runner\\InvalidPhptFileException' => __DIR__ . '/..' . '/phpunit/phpunit/src/Runner/Exception/InvalidPhptFileException.php', - 'PHPUnit\\Runner\\NoIgnoredEventException' => __DIR__ . '/..' . '/phpunit/phpunit/src/Runner/Exception/NoIgnoredEventException.php', 'PHPUnit\\Runner\\ParameterDoesNotExistException' => __DIR__ . '/..' . '/phpunit/phpunit/src/Runner/Exception/ParameterDoesNotExistException.php', 'PHPUnit\\Runner\\PhptExternalFileCannotBeLoadedException' => __DIR__ . '/..' . '/phpunit/phpunit/src/Runner/Exception/PhptExternalFileCannotBeLoadedException.php', 'PHPUnit\\Runner\\PhptTestCase' => __DIR__ . '/..' . '/phpunit/phpunit/src/Runner/PhptTestCase.php', - 'PHPUnit\\Runner\\ReflectionException' => __DIR__ . '/..' . '/phpunit/phpunit/src/Runner/Exception/ReflectionException.php', 'PHPUnit\\Runner\\ResultCache\\DefaultResultCache' => __DIR__ . '/..' . '/phpunit/phpunit/src/Runner/ResultCache/DefaultResultCache.php', 'PHPUnit\\Runner\\ResultCache\\NullResultCache' => __DIR__ . '/..' . '/phpunit/phpunit/src/Runner/ResultCache/NullResultCache.php', 'PHPUnit\\Runner\\ResultCache\\ResultCache' => __DIR__ . '/..' . '/phpunit/phpunit/src/Runner/ResultCache/ResultCache.php', @@ -5252,10 +5345,12 @@ class ComposerStaticInit0a39803e5364a51c44275cdfc5d8af8d 'PHPUnit\\Runner\\TestSuiteSorter' => __DIR__ . '/..' . '/phpunit/phpunit/src/Runner/TestSuiteSorter.php', 'PHPUnit\\Runner\\UnsupportedPhptSectionException' => __DIR__ . '/..' . '/phpunit/phpunit/src/Runner/Exception/UnsupportedPhptSectionException.php', 'PHPUnit\\Runner\\Version' => __DIR__ . '/..' . '/phpunit/phpunit/src/Runner/Version.php', + 'PHPUnit\\TestRunner\\TestResult\\AfterTestClassMethodErroredSubscriber' => __DIR__ . '/..' . '/phpunit/phpunit/src/Runner/TestResult/Subscriber/AfterTestClassMethodErroredSubscriber.php', 'PHPUnit\\TestRunner\\TestResult\\BeforeTestClassMethodErroredSubscriber' => __DIR__ . '/..' . '/phpunit/phpunit/src/Runner/TestResult/Subscriber/BeforeTestClassMethodErroredSubscriber.php', 'PHPUnit\\TestRunner\\TestResult\\Collector' => __DIR__ . '/..' . '/phpunit/phpunit/src/Runner/TestResult/Collector.php', 'PHPUnit\\TestRunner\\TestResult\\ExecutionStartedSubscriber' => __DIR__ . '/..' . '/phpunit/phpunit/src/Runner/TestResult/Subscriber/ExecutionStartedSubscriber.php', 'PHPUnit\\TestRunner\\TestResult\\Facade' => __DIR__ . '/..' . '/phpunit/phpunit/src/Runner/TestResult/Facade.php', + 'PHPUnit\\TestRunner\\TestResult\\Issues\\Issue' => __DIR__ . '/..' . '/phpunit/phpunit/src/Runner/TestResult/Issue.php', 'PHPUnit\\TestRunner\\TestResult\\PassedTests' => __DIR__ . '/..' . '/phpunit/phpunit/src/Runner/TestResult/PassedTests.php', 'PHPUnit\\TestRunner\\TestResult\\Subscriber' => __DIR__ . '/..' . '/phpunit/phpunit/src/Runner/TestResult/Subscriber/Subscriber.php', 'PHPUnit\\TestRunner\\TestResult\\TestConsideredRiskySubscriber' => __DIR__ . '/..' . '/phpunit/phpunit/src/Runner/TestResult/Subscriber/TestConsideredRiskySubscriber.php', @@ -5282,11 +5377,13 @@ class ComposerStaticInit0a39803e5364a51c44275cdfc5d8af8d 'PHPUnit\\TestRunner\\TestResult\\TestTriggeredPhpunitWarningSubscriber' => __DIR__ . '/..' . '/phpunit/phpunit/src/Runner/TestResult/Subscriber/TestTriggeredPhpunitWarningSubscriber.php', 'PHPUnit\\TestRunner\\TestResult\\TestTriggeredWarningSubscriber' => __DIR__ . '/..' . '/phpunit/phpunit/src/Runner/TestResult/Subscriber/TestTriggeredWarningSubscriber.php', 'PHPUnit\\TextUI\\Application' => __DIR__ . '/..' . '/phpunit/phpunit/src/TextUI/Application.php', + 'PHPUnit\\TextUI\\CannotOpenSocketException' => __DIR__ . '/..' . '/phpunit/phpunit/src/TextUI/Exception/CannotOpenSocketException.php', 'PHPUnit\\TextUI\\CliArguments\\Builder' => __DIR__ . '/..' . '/phpunit/phpunit/src/TextUI/Configuration/Cli/Builder.php', 'PHPUnit\\TextUI\\CliArguments\\Configuration' => __DIR__ . '/..' . '/phpunit/phpunit/src/TextUI/Configuration/Cli/Configuration.php', 'PHPUnit\\TextUI\\CliArguments\\Exception' => __DIR__ . '/..' . '/phpunit/phpunit/src/TextUI/Configuration/Cli/Exception.php', 'PHPUnit\\TextUI\\CliArguments\\XmlConfigurationFileFinder' => __DIR__ . '/..' . '/phpunit/phpunit/src/TextUI/Configuration/Cli/XmlConfigurationFileFinder.php', 'PHPUnit\\TextUI\\Command\\AtLeastVersionCommand' => __DIR__ . '/..' . '/phpunit/phpunit/src/TextUI/Command/Commands/AtLeastVersionCommand.php', + 'PHPUnit\\TextUI\\Command\\CheckPhpConfigurationCommand' => __DIR__ . '/..' . '/phpunit/phpunit/src/TextUI/Command/Commands/CheckPhpConfigurationCommand.php', 'PHPUnit\\TextUI\\Command\\Command' => __DIR__ . '/..' . '/phpunit/phpunit/src/TextUI/Command/Command.php', 'PHPUnit\\TextUI\\Command\\GenerateConfigurationCommand' => __DIR__ . '/..' . '/phpunit/phpunit/src/TextUI/Command/Commands/GenerateConfigurationCommand.php', 'PHPUnit\\TextUI\\Command\\ListGroupsCommand' => __DIR__ . '/..' . '/phpunit/phpunit/src/TextUI/Command/Commands/ListGroupsCommand.php', @@ -5324,12 +5421,12 @@ class ComposerStaticInit0a39803e5364a51c44275cdfc5d8af8d 'PHPUnit\\TextUI\\Configuration\\Group' => __DIR__ . '/..' . '/phpunit/phpunit/src/TextUI/Configuration/Value/Group.php', 'PHPUnit\\TextUI\\Configuration\\GroupCollection' => __DIR__ . '/..' . '/phpunit/phpunit/src/TextUI/Configuration/Value/GroupCollection.php', 'PHPUnit\\TextUI\\Configuration\\GroupCollectionIterator' => __DIR__ . '/..' . '/phpunit/phpunit/src/TextUI/Configuration/Value/GroupCollectionIterator.php', - 'PHPUnit\\TextUI\\Configuration\\IncludePathNotConfiguredException' => __DIR__ . '/..' . '/phpunit/phpunit/src/TextUI/Configuration/Exception/IncludePathNotConfiguredException.php', 'PHPUnit\\TextUI\\Configuration\\IniSetting' => __DIR__ . '/..' . '/phpunit/phpunit/src/TextUI/Configuration/Value/IniSetting.php', 'PHPUnit\\TextUI\\Configuration\\IniSettingCollection' => __DIR__ . '/..' . '/phpunit/phpunit/src/TextUI/Configuration/Value/IniSettingCollection.php', 'PHPUnit\\TextUI\\Configuration\\IniSettingCollectionIterator' => __DIR__ . '/..' . '/phpunit/phpunit/src/TextUI/Configuration/Value/IniSettingCollectionIterator.php', 'PHPUnit\\TextUI\\Configuration\\LoggingNotConfiguredException' => __DIR__ . '/..' . '/phpunit/phpunit/src/TextUI/Configuration/Exception/LoggingNotConfiguredException.php', 'PHPUnit\\TextUI\\Configuration\\Merger' => __DIR__ . '/..' . '/phpunit/phpunit/src/TextUI/Configuration/Merger.php', + 'PHPUnit\\TextUI\\Configuration\\NoBaselineException' => __DIR__ . '/..' . '/phpunit/phpunit/src/TextUI/Configuration/Exception/NoBaselineException.php', 'PHPUnit\\TextUI\\Configuration\\NoBootstrapException' => __DIR__ . '/..' . '/phpunit/phpunit/src/TextUI/Configuration/Exception/NoBootstrapException.php', 'PHPUnit\\TextUI\\Configuration\\NoCacheDirectoryException' => __DIR__ . '/..' . '/phpunit/phpunit/src/TextUI/Configuration/Exception/NoCacheDirectoryException.php', 'PHPUnit\\TextUI\\Configuration\\NoCliArgumentException' => __DIR__ . '/..' . '/phpunit/phpunit/src/TextUI/Configuration/Exception/NoCliArgumentException.php', @@ -5341,6 +5438,9 @@ class ComposerStaticInit0a39803e5364a51c44275cdfc5d8af8d 'PHPUnit\\TextUI\\Configuration\\Php' => __DIR__ . '/..' . '/phpunit/phpunit/src/TextUI/Configuration/Value/Php.php', 'PHPUnit\\TextUI\\Configuration\\PhpHandler' => __DIR__ . '/..' . '/phpunit/phpunit/src/TextUI/Configuration/PhpHandler.php', 'PHPUnit\\TextUI\\Configuration\\Registry' => __DIR__ . '/..' . '/phpunit/phpunit/src/TextUI/Configuration/Registry.php', + 'PHPUnit\\TextUI\\Configuration\\Source' => __DIR__ . '/..' . '/phpunit/phpunit/src/TextUI/Configuration/Value/Source.php', + 'PHPUnit\\TextUI\\Configuration\\SourceFilter' => __DIR__ . '/..' . '/phpunit/phpunit/src/TextUI/Configuration/SourceFilter.php', + 'PHPUnit\\TextUI\\Configuration\\SourceMapper' => __DIR__ . '/..' . '/phpunit/phpunit/src/TextUI/Configuration/SourceMapper.php', 'PHPUnit\\TextUI\\Configuration\\TestDirectory' => __DIR__ . '/..' . '/phpunit/phpunit/src/TextUI/Configuration/Value/TestDirectory.php', 'PHPUnit\\TextUI\\Configuration\\TestDirectoryCollection' => __DIR__ . '/..' . '/phpunit/phpunit/src/TextUI/Configuration/Value/TestDirectoryCollection.php', 'PHPUnit\\TextUI\\Configuration\\TestDirectoryCollectionIterator' => __DIR__ . '/..' . '/phpunit/phpunit/src/TextUI/Configuration/Value/TestDirectoryCollectionIterator.php', @@ -5355,8 +5455,8 @@ class ComposerStaticInit0a39803e5364a51c44275cdfc5d8af8d 'PHPUnit\\TextUI\\Configuration\\VariableCollection' => __DIR__ . '/..' . '/phpunit/phpunit/src/TextUI/Configuration/Value/VariableCollection.php', 'PHPUnit\\TextUI\\Configuration\\VariableCollectionIterator' => __DIR__ . '/..' . '/phpunit/phpunit/src/TextUI/Configuration/Value/VariableCollectionIterator.php', 'PHPUnit\\TextUI\\Exception' => __DIR__ . '/..' . '/phpunit/phpunit/src/TextUI/Exception/Exception.php', - 'PHPUnit\\TextUI\\ExtensionsNotConfiguredException' => __DIR__ . '/..' . '/phpunit/phpunit/src/TextUI/Exception/ExtensionsNotConfiguredException.php', 'PHPUnit\\TextUI\\Help' => __DIR__ . '/..' . '/phpunit/phpunit/src/TextUI/Help.php', + 'PHPUnit\\TextUI\\InvalidSocketException' => __DIR__ . '/..' . '/phpunit/phpunit/src/TextUI/Exception/InvalidSocketException.php', 'PHPUnit\\TextUI\\Output\\DefaultPrinter' => __DIR__ . '/..' . '/phpunit/phpunit/src/TextUI/Output/Printer/DefaultPrinter.php', 'PHPUnit\\TextUI\\Output\\Default\\ProgressPrinter\\BeforeTestClassMethodErroredSubscriber' => __DIR__ . '/..' . '/phpunit/phpunit/src/TextUI/Output/Default/ProgressPrinter/Subscriber/BeforeTestClassMethodErroredSubscriber.php', 'PHPUnit\\TextUI\\Output\\Default\\ProgressPrinter\\ProgressPrinter' => __DIR__ . '/..' . '/phpunit/phpunit/src/TextUI/Output/Default/ProgressPrinter/ProgressPrinter.php', @@ -5367,10 +5467,10 @@ class ComposerStaticInit0a39803e5364a51c44275cdfc5d8af8d 'PHPUnit\\TextUI\\Output\\Default\\ProgressPrinter\\TestFinishedSubscriber' => __DIR__ . '/..' . '/phpunit/phpunit/src/TextUI/Output/Default/ProgressPrinter/Subscriber/TestFinishedSubscriber.php', 'PHPUnit\\TextUI\\Output\\Default\\ProgressPrinter\\TestMarkedIncompleteSubscriber' => __DIR__ . '/..' . '/phpunit/phpunit/src/TextUI/Output/Default/ProgressPrinter/Subscriber/TestMarkedIncompleteSubscriber.php', 'PHPUnit\\TextUI\\Output\\Default\\ProgressPrinter\\TestPreparedSubscriber' => __DIR__ . '/..' . '/phpunit/phpunit/src/TextUI/Output/Default/ProgressPrinter/Subscriber/TestPreparedSubscriber.php', - 'PHPUnit\\TextUI\\Output\\Default\\ProgressPrinter\\TestPrintedUnexpectedOutputSubscriber' => __DIR__ . '/..' . '/phpunit/phpunit/src/TextUI/Output/Default/ProgressPrinter/Subscriber/TestPrintedUnexpectedOutputSubscriber.php', 'PHPUnit\\TextUI\\Output\\Default\\ProgressPrinter\\TestRunnerExecutionStartedSubscriber' => __DIR__ . '/..' . '/phpunit/phpunit/src/TextUI/Output/Default/ProgressPrinter/Subscriber/TestRunnerExecutionStartedSubscriber.php', 'PHPUnit\\TextUI\\Output\\Default\\ProgressPrinter\\TestSkippedSubscriber' => __DIR__ . '/..' . '/phpunit/phpunit/src/TextUI/Output/Default/ProgressPrinter/Subscriber/TestSkippedSubscriber.php', 'PHPUnit\\TextUI\\Output\\Default\\ProgressPrinter\\TestTriggeredDeprecationSubscriber' => __DIR__ . '/..' . '/phpunit/phpunit/src/TextUI/Output/Default/ProgressPrinter/Subscriber/TestTriggeredDeprecationSubscriber.php', + 'PHPUnit\\TextUI\\Output\\Default\\ProgressPrinter\\TestTriggeredErrorSubscriber' => __DIR__ . '/..' . '/phpunit/phpunit/src/TextUI/Output/Default/ProgressPrinter/Subscriber/TestTriggeredErrorSubscriber.php', 'PHPUnit\\TextUI\\Output\\Default\\ProgressPrinter\\TestTriggeredNoticeSubscriber' => __DIR__ . '/..' . '/phpunit/phpunit/src/TextUI/Output/Default/ProgressPrinter/Subscriber/TestTriggeredNoticeSubscriber.php', 'PHPUnit\\TextUI\\Output\\Default\\ProgressPrinter\\TestTriggeredPhpDeprecationSubscriber' => __DIR__ . '/..' . '/phpunit/phpunit/src/TextUI/Output/Default/ProgressPrinter/Subscriber/TestTriggeredPhpDeprecationSubscriber.php', 'PHPUnit\\TextUI\\Output\\Default\\ProgressPrinter\\TestTriggeredPhpNoticeSubscriber' => __DIR__ . '/..' . '/phpunit/phpunit/src/TextUI/Output/Default/ProgressPrinter/Subscriber/TestTriggeredPhpNoticeSubscriber.php', @@ -5379,18 +5479,19 @@ class ComposerStaticInit0a39803e5364a51c44275cdfc5d8af8d 'PHPUnit\\TextUI\\Output\\Default\\ProgressPrinter\\TestTriggeredPhpunitWarningSubscriber' => __DIR__ . '/..' . '/phpunit/phpunit/src/TextUI/Output/Default/ProgressPrinter/Subscriber/TestTriggeredPhpunitWarningSubscriber.php', 'PHPUnit\\TextUI\\Output\\Default\\ProgressPrinter\\TestTriggeredWarningSubscriber' => __DIR__ . '/..' . '/phpunit/phpunit/src/TextUI/Output/Default/ProgressPrinter/Subscriber/TestTriggeredWarningSubscriber.php', 'PHPUnit\\TextUI\\Output\\Default\\ResultPrinter' => __DIR__ . '/..' . '/phpunit/phpunit/src/TextUI/Output/Default/ResultPrinter.php', + 'PHPUnit\\TextUI\\Output\\Default\\UnexpectedOutputPrinter' => __DIR__ . '/..' . '/phpunit/phpunit/src/TextUI/Output/Default/UnexpectedOutputPrinter.php', 'PHPUnit\\TextUI\\Output\\Facade' => __DIR__ . '/..' . '/phpunit/phpunit/src/TextUI/Output/Facade.php', 'PHPUnit\\TextUI\\Output\\NullPrinter' => __DIR__ . '/..' . '/phpunit/phpunit/src/TextUI/Output/Printer/NullPrinter.php', 'PHPUnit\\TextUI\\Output\\Printer' => __DIR__ . '/..' . '/phpunit/phpunit/src/TextUI/Output/Printer/Printer.php', 'PHPUnit\\TextUI\\Output\\SummaryPrinter' => __DIR__ . '/..' . '/phpunit/phpunit/src/TextUI/Output/SummaryPrinter.php', 'PHPUnit\\TextUI\\Output\\TestDox\\ResultPrinter' => __DIR__ . '/..' . '/phpunit/phpunit/src/TextUI/Output/TestDox/ResultPrinter.php', - 'PHPUnit\\TextUI\\ReflectionException' => __DIR__ . '/..' . '/phpunit/phpunit/src/TextUI/Exception/ReflectionException.php', 'PHPUnit\\TextUI\\RuntimeException' => __DIR__ . '/..' . '/phpunit/phpunit/src/TextUI/Exception/RuntimeException.php', 'PHPUnit\\TextUI\\ShellExitCodeCalculator' => __DIR__ . '/..' . '/phpunit/phpunit/src/TextUI/ShellExitCodeCalculator.php', 'PHPUnit\\TextUI\\TestDirectoryNotFoundException' => __DIR__ . '/..' . '/phpunit/phpunit/src/TextUI/Exception/TestDirectoryNotFoundException.php', 'PHPUnit\\TextUI\\TestFileNotFoundException' => __DIR__ . '/..' . '/phpunit/phpunit/src/TextUI/Exception/TestFileNotFoundException.php', 'PHPUnit\\TextUI\\TestRunner' => __DIR__ . '/..' . '/phpunit/phpunit/src/TextUI/TestRunner.php', 'PHPUnit\\TextUI\\TestSuiteFilterProcessor' => __DIR__ . '/..' . '/phpunit/phpunit/src/TextUI/TestSuiteFilterProcessor.php', + 'PHPUnit\\TextUI\\XmlConfiguration\\CannotFindSchemaException' => __DIR__ . '/..' . '/phpunit/phpunit/src/TextUI/Configuration/Exception/CannotFindSchemaException.php', 'PHPUnit\\TextUI\\XmlConfiguration\\CodeCoverage\\CodeCoverage' => __DIR__ . '/..' . '/phpunit/phpunit/src/TextUI/Configuration/Xml/CodeCoverage/CodeCoverage.php', 'PHPUnit\\TextUI\\XmlConfiguration\\CodeCoverage\\Report\\Clover' => __DIR__ . '/..' . '/phpunit/phpunit/src/TextUI/Configuration/Xml/CodeCoverage/Report/Clover.php', 'PHPUnit\\TextUI\\XmlConfiguration\\CodeCoverage\\Report\\Cobertura' => __DIR__ . '/..' . '/phpunit/phpunit/src/TextUI/Configuration/Xml/CodeCoverage/Report/Cobertura.php', @@ -5409,6 +5510,7 @@ class ComposerStaticInit0a39803e5364a51c44275cdfc5d8af8d 'PHPUnit\\TextUI\\XmlConfiguration\\CoverageXmlToReport' => __DIR__ . '/..' . '/phpunit/phpunit/src/TextUI/Configuration/Xml/Migration/Migrations/CoverageXmlToReport.php', 'PHPUnit\\TextUI\\XmlConfiguration\\DefaultConfiguration' => __DIR__ . '/..' . '/phpunit/phpunit/src/TextUI/Configuration/Xml/DefaultConfiguration.php', 'PHPUnit\\TextUI\\XmlConfiguration\\Exception' => __DIR__ . '/..' . '/phpunit/phpunit/src/TextUI/Configuration/Xml/Exception.php', + 'PHPUnit\\TextUI\\XmlConfiguration\\FailedSchemaDetectionResult' => __DIR__ . '/..' . '/phpunit/phpunit/src/TextUI/Configuration/Xml/SchemaDetector/FailedSchemaDetectionResult.php', 'PHPUnit\\TextUI\\XmlConfiguration\\Generator' => __DIR__ . '/..' . '/phpunit/phpunit/src/TextUI/Configuration/Xml/Generator.php', 'PHPUnit\\TextUI\\XmlConfiguration\\Groups' => __DIR__ . '/..' . '/phpunit/phpunit/src/TextUI/Configuration/Xml/Groups.php', 'PHPUnit\\TextUI\\XmlConfiguration\\IntroduceCacheDirectoryAttribute' => __DIR__ . '/..' . '/phpunit/phpunit/src/TextUI/Configuration/Xml/Migration/Migrations/IntroduceCacheDirectoryAttribute.php', @@ -5423,13 +5525,13 @@ class ComposerStaticInit0a39803e5364a51c44275cdfc5d8af8d 'PHPUnit\\TextUI\\XmlConfiguration\\Logging\\TestDox\\Text' => __DIR__ . '/..' . '/phpunit/phpunit/src/TextUI/Configuration/Xml/Logging/TestDox/Text.php', 'PHPUnit\\TextUI\\XmlConfiguration\\Migration' => __DIR__ . '/..' . '/phpunit/phpunit/src/TextUI/Configuration/Xml/Migration/Migrations/Migration.php', 'PHPUnit\\TextUI\\XmlConfiguration\\MigrationBuilder' => __DIR__ . '/..' . '/phpunit/phpunit/src/TextUI/Configuration/Xml/Migration/MigrationBuilder.php', - 'PHPUnit\\TextUI\\XmlConfiguration\\MigrationBuilderException' => __DIR__ . '/..' . '/phpunit/phpunit/src/TextUI/Configuration/Xml/Migration/MigrationBuilderException.php', 'PHPUnit\\TextUI\\XmlConfiguration\\MigrationException' => __DIR__ . '/..' . '/phpunit/phpunit/src/TextUI/Configuration/Xml/Migration/MigrationException.php', 'PHPUnit\\TextUI\\XmlConfiguration\\Migrator' => __DIR__ . '/..' . '/phpunit/phpunit/src/TextUI/Configuration/Xml/Migration/Migrator.php', 'PHPUnit\\TextUI\\XmlConfiguration\\MoveAttributesFromFilterWhitelistToCoverage' => __DIR__ . '/..' . '/phpunit/phpunit/src/TextUI/Configuration/Xml/Migration/Migrations/MoveAttributesFromFilterWhitelistToCoverage.php', 'PHPUnit\\TextUI\\XmlConfiguration\\MoveAttributesFromRootToCoverage' => __DIR__ . '/..' . '/phpunit/phpunit/src/TextUI/Configuration/Xml/Migration/Migrations/MoveAttributesFromRootToCoverage.php', - 'PHPUnit\\TextUI\\XmlConfiguration\\MoveWhitelistDirectoriesToCoverage' => __DIR__ . '/..' . '/phpunit/phpunit/src/TextUI/Configuration/Xml/Migration/Migrations/MoveWhitelistDirectoriesToCoverage.php', + 'PHPUnit\\TextUI\\XmlConfiguration\\MoveCoverageDirectoriesToSource' => __DIR__ . '/..' . '/phpunit/phpunit/src/TextUI/Configuration/Xml/Migration/Migrations/MoveCoverageDirectoriesToSource.php', 'PHPUnit\\TextUI\\XmlConfiguration\\MoveWhitelistExcludesToCoverage' => __DIR__ . '/..' . '/phpunit/phpunit/src/TextUI/Configuration/Xml/Migration/Migrations/MoveWhitelistExcludesToCoverage.php', + 'PHPUnit\\TextUI\\XmlConfiguration\\MoveWhitelistIncludesToCoverage' => __DIR__ . '/..' . '/phpunit/phpunit/src/TextUI/Configuration/Xml/Migration/Migrations/MoveWhitelistIncludesToCoverage.php', 'PHPUnit\\TextUI\\XmlConfiguration\\PHPUnit' => __DIR__ . '/..' . '/phpunit/phpunit/src/TextUI/Configuration/Xml/PHPUnit.php', 'PHPUnit\\TextUI\\XmlConfiguration\\RemoveBeStrictAboutResourceUsageDuringSmallTestsAttribute' => __DIR__ . '/..' . '/phpunit/phpunit/src/TextUI/Configuration/Xml/Migration/Migrations/RemoveBeStrictAboutResourceUsageDuringSmallTestsAttribute.php', 'PHPUnit\\TextUI\\XmlConfiguration\\RemoveBeStrictAboutTodoAnnotatedTestsAttribute' => __DIR__ . '/..' . '/phpunit/phpunit/src/TextUI/Configuration/Xml/Migration/Migrations/RemoveBeStrictAboutTodoAnnotatedTestsAttribute.php', @@ -5450,42 +5552,38 @@ class ComposerStaticInit0a39803e5364a51c44275cdfc5d8af8d 'PHPUnit\\TextUI\\XmlConfiguration\\RenameBackupStaticAttributesAttribute' => __DIR__ . '/..' . '/phpunit/phpunit/src/TextUI/Configuration/Xml/Migration/Migrations/RenameBackupStaticAttributesAttribute.php', 'PHPUnit\\TextUI\\XmlConfiguration\\RenameBeStrictAboutCoversAnnotationAttribute' => __DIR__ . '/..' . '/phpunit/phpunit/src/TextUI/Configuration/Xml/Migration/Migrations/RenameBeStrictAboutCoversAnnotationAttribute.php', 'PHPUnit\\TextUI\\XmlConfiguration\\RenameForceCoversAnnotationAttribute' => __DIR__ . '/..' . '/phpunit/phpunit/src/TextUI/Configuration/Xml/Migration/Migrations/RenameForceCoversAnnotationAttribute.php', + 'PHPUnit\\TextUI\\XmlConfiguration\\SchemaDetectionResult' => __DIR__ . '/..' . '/phpunit/phpunit/src/TextUI/Configuration/Xml/SchemaDetector/SchemaDetectionResult.php', + 'PHPUnit\\TextUI\\XmlConfiguration\\SchemaDetector' => __DIR__ . '/..' . '/phpunit/phpunit/src/TextUI/Configuration/Xml/SchemaDetector/SchemaDetector.php', + 'PHPUnit\\TextUI\\XmlConfiguration\\SchemaFinder' => __DIR__ . '/..' . '/phpunit/phpunit/src/TextUI/Configuration/Xml/SchemaFinder.php', + 'PHPUnit\\TextUI\\XmlConfiguration\\SnapshotNodeList' => __DIR__ . '/..' . '/phpunit/phpunit/src/TextUI/Configuration/Xml/Migration/SnapshotNodeList.php', + 'PHPUnit\\TextUI\\XmlConfiguration\\SuccessfulSchemaDetectionResult' => __DIR__ . '/..' . '/phpunit/phpunit/src/TextUI/Configuration/Xml/SchemaDetector/SuccessfulSchemaDetectionResult.php', 'PHPUnit\\TextUI\\XmlConfiguration\\TestSuiteMapper' => __DIR__ . '/..' . '/phpunit/phpunit/src/TextUI/Configuration/Xml/TestSuiteMapper.php', 'PHPUnit\\TextUI\\XmlConfiguration\\UpdateSchemaLocation' => __DIR__ . '/..' . '/phpunit/phpunit/src/TextUI/Configuration/Xml/Migration/Migrations/UpdateSchemaLocation.php', + 'PHPUnit\\TextUI\\XmlConfiguration\\ValidationResult' => __DIR__ . '/..' . '/phpunit/phpunit/src/TextUI/Configuration/Xml/Validator/ValidationResult.php', + 'PHPUnit\\TextUI\\XmlConfiguration\\Validator' => __DIR__ . '/..' . '/phpunit/phpunit/src/TextUI/Configuration/Xml/Validator/Validator.php', 'PHPUnit\\Util\\Cloner' => __DIR__ . '/..' . '/phpunit/phpunit/src/Util/Cloner.php', 'PHPUnit\\Util\\Color' => __DIR__ . '/..' . '/phpunit/phpunit/src/Util/Color.php', - 'PHPUnit\\Util\\DirectoryDoesNotExistException' => __DIR__ . '/..' . '/phpunit/phpunit/src/Util/Exception/DirectoryDoesNotExistException.php', - 'PHPUnit\\Util\\ErrorHandler' => __DIR__ . '/..' . '/phpunit/phpunit/src/Util/ErrorHandler.php', 'PHPUnit\\Util\\Exception' => __DIR__ . '/..' . '/phpunit/phpunit/src/Util/Exception/Exception.php', 'PHPUnit\\Util\\ExcludeList' => __DIR__ . '/..' . '/phpunit/phpunit/src/Util/ExcludeList.php', + 'PHPUnit\\Util\\Exporter' => __DIR__ . '/..' . '/phpunit/phpunit/src/Util/Exporter.php', 'PHPUnit\\Util\\Filesystem' => __DIR__ . '/..' . '/phpunit/phpunit/src/Util/Filesystem.php', 'PHPUnit\\Util\\Filter' => __DIR__ . '/..' . '/phpunit/phpunit/src/Util/Filter.php', 'PHPUnit\\Util\\GlobalState' => __DIR__ . '/..' . '/phpunit/phpunit/src/Util/GlobalState.php', + 'PHPUnit\\Util\\Http\\Downloader' => __DIR__ . '/..' . '/phpunit/phpunit/src/Util/Http/Downloader.php', + 'PHPUnit\\Util\\Http\\PhpDownloader' => __DIR__ . '/..' . '/phpunit/phpunit/src/Util/Http/PhpDownloader.php', 'PHPUnit\\Util\\InvalidDirectoryException' => __DIR__ . '/..' . '/phpunit/phpunit/src/Util/Exception/InvalidDirectoryException.php', 'PHPUnit\\Util\\InvalidJsonException' => __DIR__ . '/..' . '/phpunit/phpunit/src/Util/Exception/InvalidJsonException.php', - 'PHPUnit\\Util\\InvalidSocketException' => __DIR__ . '/..' . '/phpunit/phpunit/src/Util/Exception/InvalidSocketException.php', 'PHPUnit\\Util\\InvalidVersionOperatorException' => __DIR__ . '/..' . '/phpunit/phpunit/src/Util/Exception/InvalidVersionOperatorException.php', 'PHPUnit\\Util\\Json' => __DIR__ . '/..' . '/phpunit/phpunit/src/Util/Json.php', - 'PHPUnit\\Util\\NoTestCaseObjectOnCallStackException' => __DIR__ . '/..' . '/phpunit/phpunit/src/Util/Exception/NoTestCaseObjectOnCallStackException.php', 'PHPUnit\\Util\\PHP\\AbstractPhpProcess' => __DIR__ . '/..' . '/phpunit/phpunit/src/Util/PHP/AbstractPhpProcess.php', 'PHPUnit\\Util\\PHP\\DefaultPhpProcess' => __DIR__ . '/..' . '/phpunit/phpunit/src/Util/PHP/DefaultPhpProcess.php', 'PHPUnit\\Util\\PHP\\PhpProcessException' => __DIR__ . '/..' . '/phpunit/phpunit/src/Util/Exception/PhpProcessException.php', - 'PHPUnit\\Util\\PHP\\WindowsPhpProcess' => __DIR__ . '/..' . '/phpunit/phpunit/src/Util/PHP/WindowsPhpProcess.php', 'PHPUnit\\Util\\Reflection' => __DIR__ . '/..' . '/phpunit/phpunit/src/Util/Reflection.php', 'PHPUnit\\Util\\Test' => __DIR__ . '/..' . '/phpunit/phpunit/src/Util/Test.php', 'PHPUnit\\Util\\ThrowableToStringMapper' => __DIR__ . '/..' . '/phpunit/phpunit/src/Util/ThrowableToStringMapper.php', 'PHPUnit\\Util\\VersionComparisonOperator' => __DIR__ . '/..' . '/phpunit/phpunit/src/Util/VersionComparisonOperator.php', - 'PHPUnit\\Util\\Xml' => __DIR__ . '/..' . '/phpunit/phpunit/src/Util/Xml.php', - 'PHPUnit\\Util\\Xml\\Exception' => __DIR__ . '/..' . '/phpunit/phpunit/src/Util/Xml/Exception.php', - 'PHPUnit\\Util\\Xml\\FailedSchemaDetectionResult' => __DIR__ . '/..' . '/phpunit/phpunit/src/Util/Xml/FailedSchemaDetectionResult.php', + 'PHPUnit\\Util\\Xml' => __DIR__ . '/..' . '/phpunit/phpunit/src/Util/Xml/Xml.php', 'PHPUnit\\Util\\Xml\\Loader' => __DIR__ . '/..' . '/phpunit/phpunit/src/Util/Xml/Loader.php', - 'PHPUnit\\Util\\Xml\\SchemaDetectionResult' => __DIR__ . '/..' . '/phpunit/phpunit/src/Util/Xml/SchemaDetectionResult.php', - 'PHPUnit\\Util\\Xml\\SchemaDetector' => __DIR__ . '/..' . '/phpunit/phpunit/src/Util/Xml/SchemaDetector.php', - 'PHPUnit\\Util\\Xml\\SchemaFinder' => __DIR__ . '/..' . '/phpunit/phpunit/src/Util/Xml/SchemaFinder.php', - 'PHPUnit\\Util\\Xml\\SnapshotNodeList' => __DIR__ . '/..' . '/phpunit/phpunit/src/Util/Xml/SnapshotNodeList.php', - 'PHPUnit\\Util\\Xml\\SuccessfulSchemaDetectionResult' => __DIR__ . '/..' . '/phpunit/phpunit/src/Util/Xml/SuccessfulSchemaDetectionResult.php', - 'PHPUnit\\Util\\Xml\\ValidationResult' => __DIR__ . '/..' . '/phpunit/phpunit/src/Util/Xml/ValidationResult.php', - 'PHPUnit\\Util\\Xml\\Validator' => __DIR__ . '/..' . '/phpunit/phpunit/src/Util/Xml/Validator.php', 'PHPUnit\\Util\\Xml\\XmlException' => __DIR__ . '/..' . '/phpunit/phpunit/src/Util/Exception/XmlException.php', 'ParaTest\\Coverage\\CoverageMerger' => __DIR__ . '/..' . '/brianium/paratest/src/Coverage/CoverageMerger.php', 'ParaTest\\JUnit\\LogMerger' => __DIR__ . '/..' . '/brianium/paratest/src/JUnit/LogMerger.php', @@ -5499,6 +5597,7 @@ class ComposerStaticInit0a39803e5364a51c44275cdfc5d8af8d 'ParaTest\\RunnerInterface' => __DIR__ . '/..' . '/brianium/paratest/src/RunnerInterface.php', 'ParaTest\\Util\\PhpstormHelper' => __DIR__ . '/..' . '/brianium/paratest/src/Util/PhpstormHelper.php', 'ParaTest\\WrapperRunner\\ApplicationForWrapperWorker' => __DIR__ . '/..' . '/brianium/paratest/src/WrapperRunner/ApplicationForWrapperWorker.php', + 'ParaTest\\WrapperRunner\\ProgressPrinterOutput' => __DIR__ . '/..' . '/brianium/paratest/src/WrapperRunner/ProgressPrinterOutput.php', 'ParaTest\\WrapperRunner\\ResultPrinter' => __DIR__ . '/..' . '/brianium/paratest/src/WrapperRunner/ResultPrinter.php', 'ParaTest\\WrapperRunner\\SuiteLoader' => __DIR__ . '/..' . '/brianium/paratest/src/WrapperRunner/SuiteLoader.php', 'ParaTest\\WrapperRunner\\WorkerCrashedException' => __DIR__ . '/..' . '/brianium/paratest/src/WrapperRunner/WorkerCrashedException.php', @@ -5545,6 +5644,7 @@ class ComposerStaticInit0a39803e5364a51c44275cdfc5d8af8d 'PharIo\\Manifest\\ManifestLoader' => __DIR__ . '/..' . '/phar-io/manifest/src/ManifestLoader.php', 'PharIo\\Manifest\\ManifestLoaderException' => __DIR__ . '/..' . '/phar-io/manifest/src/exceptions/ManifestLoaderException.php', 'PharIo\\Manifest\\ManifestSerializer' => __DIR__ . '/..' . '/phar-io/manifest/src/ManifestSerializer.php', + 'PharIo\\Manifest\\NoEmailAddressException' => __DIR__ . '/..' . '/phar-io/manifest/src/exceptions/NoEmailAddressException.php', 'PharIo\\Manifest\\PhpElement' => __DIR__ . '/..' . '/phar-io/manifest/src/xml/PhpElement.php', 'PharIo\\Manifest\\PhpExtensionRequirement' => __DIR__ . '/..' . '/phar-io/manifest/src/values/PhpExtensionRequirement.php', 'PharIo\\Manifest\\PhpVersionRequirement' => __DIR__ . '/..' . '/phar-io/manifest/src/values/PhpVersionRequirement.php', @@ -6325,6 +6425,7 @@ class ComposerStaticInit0a39803e5364a51c44275cdfc5d8af8d 'SebastianBergmann\\CodeCoverage\\Driver\\XdebugNotAvailableException' => __DIR__ . '/..' . '/phpunit/php-code-coverage/src/Exception/XdebugNotAvailableException.php', 'SebastianBergmann\\CodeCoverage\\Driver\\XdebugNotEnabledException' => __DIR__ . '/..' . '/phpunit/php-code-coverage/src/Exception/XdebugNotEnabledException.php', 'SebastianBergmann\\CodeCoverage\\Exception' => __DIR__ . '/..' . '/phpunit/php-code-coverage/src/Exception/Exception.php', + 'SebastianBergmann\\CodeCoverage\\FileCouldNotBeWrittenException' => __DIR__ . '/..' . '/phpunit/php-code-coverage/src/Exception/FileCouldNotBeWrittenException.php', 'SebastianBergmann\\CodeCoverage\\Filter' => __DIR__ . '/..' . '/phpunit/php-code-coverage/src/Filter.php', 'SebastianBergmann\\CodeCoverage\\InvalidArgumentException' => __DIR__ . '/..' . '/phpunit/php-code-coverage/src/Exception/InvalidArgumentException.php', 'SebastianBergmann\\CodeCoverage\\NoCodeCoverageDriverAvailableException' => __DIR__ . '/..' . '/phpunit/php-code-coverage/src/Exception/NoCodeCoverageDriverAvailableException.php', @@ -6794,6 +6895,7 @@ class ComposerStaticInit0a39803e5364a51c44275cdfc5d8af8d 'Symfony\\Component\\Console\\Command\\ListCommand' => __DIR__ . '/..' . '/symfony/console/Command/ListCommand.php', 'Symfony\\Component\\Console\\Command\\LockableTrait' => __DIR__ . '/..' . '/symfony/console/Command/LockableTrait.php', 'Symfony\\Component\\Console\\Command\\SignalableCommandInterface' => __DIR__ . '/..' . '/symfony/console/Command/SignalableCommandInterface.php', + 'Symfony\\Component\\Console\\Command\\TraceableCommand' => __DIR__ . '/..' . '/symfony/console/Command/TraceableCommand.php', 'Symfony\\Component\\Console\\Completion\\CompletionInput' => __DIR__ . '/..' . '/symfony/console/Completion/CompletionInput.php', 'Symfony\\Component\\Console\\Completion\\CompletionSuggestions' => __DIR__ . '/..' . '/symfony/console/Completion/CompletionSuggestions.php', 'Symfony\\Component\\Console\\Completion\\Output\\BashCompletionOutput' => __DIR__ . '/..' . '/symfony/console/Completion/Output/BashCompletionOutput.php', @@ -6803,12 +6905,15 @@ class ComposerStaticInit0a39803e5364a51c44275cdfc5d8af8d 'Symfony\\Component\\Console\\Completion\\Suggestion' => __DIR__ . '/..' . '/symfony/console/Completion/Suggestion.php', 'Symfony\\Component\\Console\\ConsoleEvents' => __DIR__ . '/..' . '/symfony/console/ConsoleEvents.php', 'Symfony\\Component\\Console\\Cursor' => __DIR__ . '/..' . '/symfony/console/Cursor.php', + 'Symfony\\Component\\Console\\DataCollector\\CommandDataCollector' => __DIR__ . '/..' . '/symfony/console/DataCollector/CommandDataCollector.php', + 'Symfony\\Component\\Console\\Debug\\CliRequest' => __DIR__ . '/..' . '/symfony/console/Debug/CliRequest.php', 'Symfony\\Component\\Console\\DependencyInjection\\AddConsoleCommandPass' => __DIR__ . '/..' . '/symfony/console/DependencyInjection/AddConsoleCommandPass.php', 'Symfony\\Component\\Console\\Descriptor\\ApplicationDescription' => __DIR__ . '/..' . '/symfony/console/Descriptor/ApplicationDescription.php', 'Symfony\\Component\\Console\\Descriptor\\Descriptor' => __DIR__ . '/..' . '/symfony/console/Descriptor/Descriptor.php', 'Symfony\\Component\\Console\\Descriptor\\DescriptorInterface' => __DIR__ . '/..' . '/symfony/console/Descriptor/DescriptorInterface.php', 'Symfony\\Component\\Console\\Descriptor\\JsonDescriptor' => __DIR__ . '/..' . '/symfony/console/Descriptor/JsonDescriptor.php', 'Symfony\\Component\\Console\\Descriptor\\MarkdownDescriptor' => __DIR__ . '/..' . '/symfony/console/Descriptor/MarkdownDescriptor.php', + 'Symfony\\Component\\Console\\Descriptor\\ReStructuredTextDescriptor' => __DIR__ . '/..' . '/symfony/console/Descriptor/ReStructuredTextDescriptor.php', 'Symfony\\Component\\Console\\Descriptor\\TextDescriptor' => __DIR__ . '/..' . '/symfony/console/Descriptor/TextDescriptor.php', 'Symfony\\Component\\Console\\Descriptor\\XmlDescriptor' => __DIR__ . '/..' . '/symfony/console/Descriptor/XmlDescriptor.php', 'Symfony\\Component\\Console\\EventListener\\ErrorListener' => __DIR__ . '/..' . '/symfony/console/EventListener/ErrorListener.php', @@ -6824,6 +6929,7 @@ class ComposerStaticInit0a39803e5364a51c44275cdfc5d8af8d 'Symfony\\Component\\Console\\Exception\\LogicException' => __DIR__ . '/..' . '/symfony/console/Exception/LogicException.php', 'Symfony\\Component\\Console\\Exception\\MissingInputException' => __DIR__ . '/..' . '/symfony/console/Exception/MissingInputException.php', 'Symfony\\Component\\Console\\Exception\\NamespaceNotFoundException' => __DIR__ . '/..' . '/symfony/console/Exception/NamespaceNotFoundException.php', + 'Symfony\\Component\\Console\\Exception\\RunCommandFailedException' => __DIR__ . '/..' . '/symfony/console/Exception/RunCommandFailedException.php', 'Symfony\\Component\\Console\\Exception\\RuntimeException' => __DIR__ . '/..' . '/symfony/console/Exception/RuntimeException.php', 'Symfony\\Component\\Console\\Formatter\\NullOutputFormatter' => __DIR__ . '/..' . '/symfony/console/Formatter/NullOutputFormatter.php', 'Symfony\\Component\\Console\\Formatter\\NullOutputFormatterStyle' => __DIR__ . '/..' . '/symfony/console/Formatter/NullOutputFormatterStyle.php', @@ -6853,6 +6959,7 @@ class ComposerStaticInit0a39803e5364a51c44275cdfc5d8af8d 'Symfony\\Component\\Console\\Helper\\TableRows' => __DIR__ . '/..' . '/symfony/console/Helper/TableRows.php', 'Symfony\\Component\\Console\\Helper\\TableSeparator' => __DIR__ . '/..' . '/symfony/console/Helper/TableSeparator.php', 'Symfony\\Component\\Console\\Helper\\TableStyle' => __DIR__ . '/..' . '/symfony/console/Helper/TableStyle.php', + 'Symfony\\Component\\Console\\Helper\\TerminalInputHelper' => __DIR__ . '/..' . '/symfony/console/Helper/TerminalInputHelper.php', 'Symfony\\Component\\Console\\Input\\ArgvInput' => __DIR__ . '/..' . '/symfony/console/Input/ArgvInput.php', 'Symfony\\Component\\Console\\Input\\ArrayInput' => __DIR__ . '/..' . '/symfony/console/Input/ArrayInput.php', 'Symfony\\Component\\Console\\Input\\Input' => __DIR__ . '/..' . '/symfony/console/Input/Input.php', @@ -6864,6 +6971,9 @@ class ComposerStaticInit0a39803e5364a51c44275cdfc5d8af8d 'Symfony\\Component\\Console\\Input\\StreamableInputInterface' => __DIR__ . '/..' . '/symfony/console/Input/StreamableInputInterface.php', 'Symfony\\Component\\Console\\Input\\StringInput' => __DIR__ . '/..' . '/symfony/console/Input/StringInput.php', 'Symfony\\Component\\Console\\Logger\\ConsoleLogger' => __DIR__ . '/..' . '/symfony/console/Logger/ConsoleLogger.php', + 'Symfony\\Component\\Console\\Messenger\\RunCommandContext' => __DIR__ . '/..' . '/symfony/console/Messenger/RunCommandContext.php', + 'Symfony\\Component\\Console\\Messenger\\RunCommandMessage' => __DIR__ . '/..' . '/symfony/console/Messenger/RunCommandMessage.php', + 'Symfony\\Component\\Console\\Messenger\\RunCommandMessageHandler' => __DIR__ . '/..' . '/symfony/console/Messenger/RunCommandMessageHandler.php', 'Symfony\\Component\\Console\\Output\\AnsiColorMode' => __DIR__ . '/..' . '/symfony/console/Output/AnsiColorMode.php', 'Symfony\\Component\\Console\\Output\\BufferedOutput' => __DIR__ . '/..' . '/symfony/console/Output/BufferedOutput.php', 'Symfony\\Component\\Console\\Output\\ConsoleOutput' => __DIR__ . '/..' . '/symfony/console/Output/ConsoleOutput.php', @@ -6877,6 +6987,7 @@ class ComposerStaticInit0a39803e5364a51c44275cdfc5d8af8d 'Symfony\\Component\\Console\\Question\\ChoiceQuestion' => __DIR__ . '/..' . '/symfony/console/Question/ChoiceQuestion.php', 'Symfony\\Component\\Console\\Question\\ConfirmationQuestion' => __DIR__ . '/..' . '/symfony/console/Question/ConfirmationQuestion.php', 'Symfony\\Component\\Console\\Question\\Question' => __DIR__ . '/..' . '/symfony/console/Question/Question.php', + 'Symfony\\Component\\Console\\SignalRegistry\\SignalMap' => __DIR__ . '/..' . '/symfony/console/SignalRegistry/SignalMap.php', 'Symfony\\Component\\Console\\SignalRegistry\\SignalRegistry' => __DIR__ . '/..' . '/symfony/console/SignalRegistry/SignalRegistry.php', 'Symfony\\Component\\Console\\SingleCommandApplication' => __DIR__ . '/..' . '/symfony/console/SingleCommandApplication.php', 'Symfony\\Component\\Console\\Style\\OutputStyle' => __DIR__ . '/..' . '/symfony/console/Style/OutputStyle.php', @@ -7385,11 +7496,16 @@ class ComposerStaticInit0a39803e5364a51c44275cdfc5d8af8d 'Symfony\\Component\\Process\\Exception\\ProcessFailedException' => __DIR__ . '/..' . '/symfony/process/Exception/ProcessFailedException.php', 'Symfony\\Component\\Process\\Exception\\ProcessSignaledException' => __DIR__ . '/..' . '/symfony/process/Exception/ProcessSignaledException.php', 'Symfony\\Component\\Process\\Exception\\ProcessTimedOutException' => __DIR__ . '/..' . '/symfony/process/Exception/ProcessTimedOutException.php', + 'Symfony\\Component\\Process\\Exception\\RunProcessFailedException' => __DIR__ . '/..' . '/symfony/process/Exception/RunProcessFailedException.php', 'Symfony\\Component\\Process\\Exception\\RuntimeException' => __DIR__ . '/..' . '/symfony/process/Exception/RuntimeException.php', 'Symfony\\Component\\Process\\ExecutableFinder' => __DIR__ . '/..' . '/symfony/process/ExecutableFinder.php', 'Symfony\\Component\\Process\\InputStream' => __DIR__ . '/..' . '/symfony/process/InputStream.php', + 'Symfony\\Component\\Process\\Messenger\\RunProcessContext' => __DIR__ . '/..' . '/symfony/process/Messenger/RunProcessContext.php', + 'Symfony\\Component\\Process\\Messenger\\RunProcessMessage' => __DIR__ . '/..' . '/symfony/process/Messenger/RunProcessMessage.php', + 'Symfony\\Component\\Process\\Messenger\\RunProcessMessageHandler' => __DIR__ . '/..' . '/symfony/process/Messenger/RunProcessMessageHandler.php', 'Symfony\\Component\\Process\\PhpExecutableFinder' => __DIR__ . '/..' . '/symfony/process/PhpExecutableFinder.php', 'Symfony\\Component\\Process\\PhpProcess' => __DIR__ . '/..' . '/symfony/process/PhpProcess.php', + 'Symfony\\Component\\Process\\PhpSubprocess' => __DIR__ . '/..' . '/symfony/process/PhpSubprocess.php', 'Symfony\\Component\\Process\\Pipes\\AbstractPipes' => __DIR__ . '/..' . '/symfony/process/Pipes/AbstractPipes.php', 'Symfony\\Component\\Process\\Pipes\\PipesInterface' => __DIR__ . '/..' . '/symfony/process/Pipes/PipesInterface.php', 'Symfony\\Component\\Process\\Pipes\\UnixPipes' => __DIR__ . '/..' . '/symfony/process/Pipes/UnixPipes.php', @@ -7472,9 +7588,11 @@ class ComposerStaticInit0a39803e5364a51c44275cdfc5d8af8d 'Symfony\\Component\\String\\Inflector\\EnglishInflector' => __DIR__ . '/..' . '/symfony/string/Inflector/EnglishInflector.php', 'Symfony\\Component\\String\\Inflector\\FrenchInflector' => __DIR__ . '/..' . '/symfony/string/Inflector/FrenchInflector.php', 'Symfony\\Component\\String\\Inflector\\InflectorInterface' => __DIR__ . '/..' . '/symfony/string/Inflector/InflectorInterface.php', + 'Symfony\\Component\\String\\Inflector\\SpanishInflector' => __DIR__ . '/..' . '/symfony/string/Inflector/SpanishInflector.php', 'Symfony\\Component\\String\\LazyString' => __DIR__ . '/..' . '/symfony/string/LazyString.php', 'Symfony\\Component\\String\\Slugger\\AsciiSlugger' => __DIR__ . '/..' . '/symfony/string/Slugger/AsciiSlugger.php', 'Symfony\\Component\\String\\Slugger\\SluggerInterface' => __DIR__ . '/..' . '/symfony/string/Slugger/SluggerInterface.php', + 'Symfony\\Component\\String\\TruncateMode' => __DIR__ . '/..' . '/symfony/string/TruncateMode.php', 'Symfony\\Component\\String\\UnicodeString' => __DIR__ . '/..' . '/symfony/string/UnicodeString.php', 'Symfony\\Component\\Translation\\CatalogueMetadataAwareInterface' => __DIR__ . '/..' . '/symfony/translation/CatalogueMetadataAwareInterface.php', 'Symfony\\Component\\Translation\\Catalogue\\AbstractOperation' => __DIR__ . '/..' . '/symfony/translation/Catalogue/AbstractOperation.php', @@ -7675,8 +7793,12 @@ class ComposerStaticInit0a39803e5364a51c44275cdfc5d8af8d 'Symfony\\Contracts\\EventDispatcher\\EventDispatcherInterface' => __DIR__ . '/..' . '/symfony/event-dispatcher-contracts/EventDispatcherInterface.php', 'Symfony\\Contracts\\Service\\Attribute\\Required' => __DIR__ . '/..' . '/symfony/service-contracts/Attribute/Required.php', 'Symfony\\Contracts\\Service\\Attribute\\SubscribedService' => __DIR__ . '/..' . '/symfony/service-contracts/Attribute/SubscribedService.php', + 'Symfony\\Contracts\\Service\\ContainerAwareInterface' => __DIR__ . '/..' . '/symfony/service-contracts/ContainerAwareInterface.php', + 'Symfony\\Contracts\\Service\\ContainerProviderInterface' => __DIR__ . '/..' . '/symfony/service-contracts/ContainerProviderInterface.php', 'Symfony\\Contracts\\Service\\ResetInterface' => __DIR__ . '/..' . '/symfony/service-contracts/ResetInterface.php', + 'Symfony\\Contracts\\Service\\ServiceCollectionInterface' => __DIR__ . '/..' . '/symfony/service-contracts/ServiceCollectionInterface.php', 'Symfony\\Contracts\\Service\\ServiceLocatorTrait' => __DIR__ . '/..' . '/symfony/service-contracts/ServiceLocatorTrait.php', + 'Symfony\\Contracts\\Service\\ServiceMethodsSubscriberTrait' => __DIR__ . '/..' . '/symfony/service-contracts/ServiceMethodsSubscriberTrait.php', 'Symfony\\Contracts\\Service\\ServiceProviderInterface' => __DIR__ . '/..' . '/symfony/service-contracts/ServiceProviderInterface.php', 'Symfony\\Contracts\\Service\\ServiceSubscriberInterface' => __DIR__ . '/..' . '/symfony/service-contracts/ServiceSubscriberInterface.php', 'Symfony\\Contracts\\Service\\ServiceSubscriberTrait' => __DIR__ . '/..' . '/symfony/service-contracts/ServiceSubscriberTrait.php', diff --git a/vendor/composer/installed.json b/vendor/composer/installed.json index 55cc12f2..78a98f53 100644 --- a/vendor/composer/installed.json +++ b/vendor/composer/installed.json @@ -378,17 +378,17 @@ }, { "name": "brianium/paratest", - "version": "v7.1.1", - "version_normalized": "7.1.1.0", + "version": "v7.4.9", + "version_normalized": "7.4.9.0", "source": { "type": "git", "url": "https://github.com/paratestphp/paratest.git", - "reference": "abc123183e90f33ce1312b5bfaa49d80d8c646b2" + "reference": "633c0987ecf6d9b057431225da37b088aa9274a5" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/paratestphp/paratest/zipball/abc123183e90f33ce1312b5bfaa49d80d8c646b2", - "reference": "abc123183e90f33ce1312b5bfaa49d80d8c646b2", + "url": "https://api.github.com/repos/paratestphp/paratest/zipball/633c0987ecf6d9b057431225da37b088aa9274a5", + "reference": "633c0987ecf6d9b057431225da37b088aa9274a5", "shasum": "" }, "require": { @@ -396,33 +396,31 @@ "ext-pcre": "*", "ext-reflection": "*", "ext-simplexml": "*", - "fidry/cpu-core-counter": "^0.4.1 || ^0.5.1", - "jean85/pretty-package-versions": "^2.0.5", - "php": "~8.1.0 || ~8.2.0", - "phpunit/php-code-coverage": "^10.0.2", - "phpunit/php-file-iterator": "^4.0.1", - "phpunit/php-timer": "^6.0", - "phpunit/phpunit": "^10.0.16", - "sebastian/environment": "^6.0", - "symfony/console": "^6.2.7", - "symfony/process": "^6.2.7" + "fidry/cpu-core-counter": "^1.2.0", + "jean85/pretty-package-versions": "^2.0.6", + "php": "~8.2.0 || ~8.3.0 || ~8.4.0", + "phpunit/php-code-coverage": "^10.1.16", + "phpunit/php-file-iterator": "^4.1.0", + "phpunit/php-timer": "^6.0.0", + "phpunit/phpunit": "^10.5.47", + "sebastian/environment": "^6.1.0", + "symfony/console": "^6.4.7 || ^7.1.5", + "symfony/process": "^6.4.7 || ^7.1.5" }, "require-dev": { - "doctrine/coding-standard": "^11.1.0", + "doctrine/coding-standard": "^12.0.0", "ext-pcov": "*", "ext-posix": "*", - "infection/infection": "^0.26.19", - "phpstan/phpstan": "^1.10.6", - "phpstan/phpstan-deprecation-rules": "^1.1.2", - "phpstan/phpstan-phpunit": "^1.3.10", - "phpstan/phpstan-strict-rules": "^1.5", - "squizlabs/php_codesniffer": "^3.7.2", - "symfony/filesystem": "^6.2.7" + "phpstan/phpstan": "^1.12.6", + "phpstan/phpstan-deprecation-rules": "^1.2.1", + "phpstan/phpstan-phpunit": "^1.4.0", + "phpstan/phpstan-strict-rules": "^1.6.1", + "squizlabs/php_codesniffer": "^3.10.3", + "symfony/filesystem": "^6.4.3 || ^7.1.5" }, - "time": "2023-03-13T10:11:07+00:00", + "time": "2025-06-25T06:09:59+00:00", "bin": [ "bin/paratest", - "bin/paratest.bat", "bin/paratest_for_phpstorm" ], "type": "library", @@ -460,7 +458,7 @@ ], "support": { "issues": "https://github.com/paratestphp/paratest/issues", - "source": "https://github.com/paratestphp/paratest/tree/v7.1.1" + "source": "https://github.com/paratestphp/paratest/tree/v7.4.9" }, "funding": [ { @@ -1085,17 +1083,17 @@ }, { "name": "dflydev/dot-access-data", - "version": "v3.0.2", - "version_normalized": "3.0.2.0", + "version": "v3.0.3", + "version_normalized": "3.0.3.0", "source": { "type": "git", "url": "https://github.com/dflydev/dflydev-dot-access-data.git", - "reference": "f41715465d65213d644d3141a6a93081be5d3549" + "reference": "a23a2bf4f31d3518f3ecb38660c95715dfead60f" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/dflydev/dflydev-dot-access-data/zipball/f41715465d65213d644d3141a6a93081be5d3549", - "reference": "f41715465d65213d644d3141a6a93081be5d3549", + "url": "https://api.github.com/repos/dflydev/dflydev-dot-access-data/zipball/a23a2bf4f31d3518f3ecb38660c95715dfead60f", + "reference": "a23a2bf4f31d3518f3ecb38660c95715dfead60f", "shasum": "" }, "require": { @@ -1108,7 +1106,7 @@ "squizlabs/php_codesniffer": "^3.5", "vimeo/psalm": "^4.0.0" }, - "time": "2022-10-27T11:44:00+00:00", + "time": "2024-07-08T12:26:09+00:00", "type": "library", "extra": { "branch-alias": { @@ -1157,7 +1155,7 @@ ], "support": { "issues": "https://github.com/dflydev/dflydev-dot-access-data/issues", - "source": "https://github.com/dflydev/dflydev-dot-access-data/tree/v3.0.2" + "source": "https://github.com/dflydev/dflydev-dot-access-data/tree/v3.0.3" }, "install-path": "../dflydev/dot-access-data" }, @@ -1893,17 +1891,17 @@ }, { "name": "fidry/cpu-core-counter", - "version": "0.5.1", - "version_normalized": "0.5.1.0", + "version": "1.3.0", + "version_normalized": "1.3.0.0", "source": { "type": "git", "url": "https://github.com/theofidry/cpu-core-counter.git", - "reference": "b58e5a3933e541dc286cc91fc4f3898bbc6f1623" + "reference": "db9508f7b1474469d9d3c53b86f817e344732678" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/theofidry/cpu-core-counter/zipball/b58e5a3933e541dc286cc91fc4f3898bbc6f1623", - "reference": "b58e5a3933e541dc286cc91fc4f3898bbc6f1623", + "url": "https://api.github.com/repos/theofidry/cpu-core-counter/zipball/db9508f7b1474469d9d3c53b86f817e344732678", + "reference": "db9508f7b1474469d9d3c53b86f817e344732678", "shasum": "" }, "require": { @@ -1911,16 +1909,16 @@ }, "require-dev": { "fidry/makefile": "^0.2.0", + "fidry/php-cs-fixer-config": "^1.1.2", "phpstan/extension-installer": "^1.2.0", - "phpstan/phpstan": "^1.9.2", - "phpstan/phpstan-deprecation-rules": "^1.0.0", - "phpstan/phpstan-phpunit": "^1.2.2", - "phpstan/phpstan-strict-rules": "^1.4.4", - "phpunit/phpunit": "^9.5.26 || ^8.5.31", - "theofidry/php-cs-fixer-config": "^1.0", + "phpstan/phpstan": "^2.0", + "phpstan/phpstan-deprecation-rules": "^2.0.0", + "phpstan/phpstan-phpunit": "^2.0", + "phpstan/phpstan-strict-rules": "^2.0", + "phpunit/phpunit": "^8.5.31 || ^9.5.26", "webmozarts/strict-phpunit": "^7.5" }, - "time": "2022-12-24T12:35:10+00:00", + "time": "2025-08-14T07:29:31+00:00", "type": "library", "installation-source": "dist", "autoload": { @@ -1945,7 +1943,7 @@ ], "support": { "issues": "https://github.com/theofidry/cpu-core-counter/issues", - "source": "https://github.com/theofidry/cpu-core-counter/tree/0.5.1" + "source": "https://github.com/theofidry/cpu-core-counter/tree/1.3.0" }, "funding": [ { @@ -2793,31 +2791,32 @@ }, { "name": "jean85/pretty-package-versions", - "version": "2.0.5", - "version_normalized": "2.0.5.0", + "version": "2.1.1", + "version_normalized": "2.1.1.0", "source": { "type": "git", "url": "https://github.com/Jean85/pretty-package-versions.git", - "reference": "ae547e455a3d8babd07b96966b17d7fd21d9c6af" + "reference": "4d7aa5dab42e2a76d99559706022885de0e18e1a" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/Jean85/pretty-package-versions/zipball/ae547e455a3d8babd07b96966b17d7fd21d9c6af", - "reference": "ae547e455a3d8babd07b96966b17d7fd21d9c6af", + "url": "https://api.github.com/repos/Jean85/pretty-package-versions/zipball/4d7aa5dab42e2a76d99559706022885de0e18e1a", + "reference": "4d7aa5dab42e2a76d99559706022885de0e18e1a", "shasum": "" }, "require": { - "composer-runtime-api": "^2.0.0", - "php": "^7.1|^8.0" + "composer-runtime-api": "^2.1.0", + "php": "^7.4|^8.0" }, "require-dev": { - "friendsofphp/php-cs-fixer": "^2.17", + "friendsofphp/php-cs-fixer": "^3.2", "jean85/composer-provided-replaced-stub-package": "^1.0", - "phpstan/phpstan": "^0.12.66", - "phpunit/phpunit": "^7.5|^8.5|^9.4", - "vimeo/psalm": "^4.3" + "phpstan/phpstan": "^2.0", + "phpunit/phpunit": "^7.5|^8.5|^9.6", + "rector/rector": "^2.0", + "vimeo/psalm": "^4.3 || ^5.0" }, - "time": "2021-10-08T21:21:46+00:00", + "time": "2025-03-19T14:43:43+00:00", "type": "library", "extra": { "branch-alias": { @@ -2849,7 +2848,7 @@ ], "support": { "issues": "https://github.com/Jean85/pretty-package-versions/issues", - "source": "https://github.com/Jean85/pretty-package-versions/tree/2.0.5" + "source": "https://github.com/Jean85/pretty-package-versions/tree/2.1.1" }, "install-path": "../jean85/pretty-package-versions" }, @@ -4517,17 +4516,17 @@ }, { "name": "myclabs/deep-copy", - "version": "1.11.1", - "version_normalized": "1.11.1.0", + "version": "1.13.4", + "version_normalized": "1.13.4.0", "source": { "type": "git", "url": "https://github.com/myclabs/DeepCopy.git", - "reference": "7284c22080590fb39f2ffa3e9057f10a4ddd0e0c" + "reference": "07d290f0c47959fd5eed98c95ee5602db07e0b6a" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/myclabs/DeepCopy/zipball/7284c22080590fb39f2ffa3e9057f10a4ddd0e0c", - "reference": "7284c22080590fb39f2ffa3e9057f10a4ddd0e0c", + "url": "https://api.github.com/repos/myclabs/DeepCopy/zipball/07d290f0c47959fd5eed98c95ee5602db07e0b6a", + "reference": "07d290f0c47959fd5eed98c95ee5602db07e0b6a", "shasum": "" }, "require": { @@ -4535,14 +4534,15 @@ }, "conflict": { "doctrine/collections": "<1.6.8", - "doctrine/common": "<2.13.3 || >=3,<3.2.2" + "doctrine/common": "<2.13.3 || >=3 <3.2.2" }, "require-dev": { "doctrine/collections": "^1.6.8", "doctrine/common": "^2.13.3 || ^3.2.2", + "phpspec/prophecy": "^1.10", "phpunit/phpunit": "^7.5.20 || ^8.5.23 || ^9.5.13" }, - "time": "2023-03-08T13:26:56+00:00", + "time": "2025-08-01T08:46:24+00:00", "type": "library", "installation-source": "dist", "autoload": { @@ -4567,7 +4567,7 @@ ], "support": { "issues": "https://github.com/myclabs/DeepCopy/issues", - "source": "https://github.com/myclabs/DeepCopy/tree/1.11.1" + "source": "https://github.com/myclabs/DeepCopy/tree/1.13.4" }, "funding": [ { @@ -4684,37 +4684,42 @@ }, { "name": "nette/schema", - "version": "v1.2.3", - "version_normalized": "1.2.3.0", + "version": "v1.3.5", + "version_normalized": "1.3.5.0", "source": { "type": "git", "url": "https://github.com/nette/schema.git", - "reference": "abbdbb70e0245d5f3bf77874cea1dfb0c930d06f" + "reference": "f0ab1a3cda782dbc5da270d28545236aa80c4002" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/nette/schema/zipball/abbdbb70e0245d5f3bf77874cea1dfb0c930d06f", - "reference": "abbdbb70e0245d5f3bf77874cea1dfb0c930d06f", + "url": "https://api.github.com/repos/nette/schema/zipball/f0ab1a3cda782dbc5da270d28545236aa80c4002", + "reference": "f0ab1a3cda782dbc5da270d28545236aa80c4002", "shasum": "" }, "require": { - "nette/utils": "^2.5.7 || ^3.1.5 || ^4.0", - "php": ">=7.1 <8.3" + "nette/utils": "^4.0", + "php": "8.1 - 8.5" }, "require-dev": { - "nette/tester": "^2.3 || ^2.4", - "phpstan/phpstan-nette": "^1.0", - "tracy/tracy": "^2.7" + "nette/phpstan-rules": "^1.0", + "nette/tester": "^2.6", + "phpstan/extension-installer": "^1.4@stable", + "phpstan/phpstan": "^2.1.39@stable", + "tracy/tracy": "^2.8" }, - "time": "2022-10-13T01:24:26+00:00", + "time": "2026-02-23T03:47:12+00:00", "type": "library", "extra": { "branch-alias": { - "dev-master": "1.2-dev" + "dev-master": "1.3-dev" } }, "installation-source": "dist", "autoload": { + "psr-4": { + "Nette\\": "src" + }, "classmap": [ "src/" ] @@ -4743,56 +4748,60 @@ ], "support": { "issues": "https://github.com/nette/schema/issues", - "source": "https://github.com/nette/schema/tree/v1.2.3" + "source": "https://github.com/nette/schema/tree/v1.3.5" }, "install-path": "../nette/schema" }, { "name": "nette/utils", - "version": "v4.0.0", - "version_normalized": "4.0.0.0", + "version": "v4.1.5", + "version_normalized": "4.1.5.0", "source": { "type": "git", "url": "https://github.com/nette/utils.git", - "reference": "cacdbf5a91a657ede665c541eda28941d4b09c1e" + "reference": "b043439dbdf954e6c28b5ea7e34b0100f83165e0" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/nette/utils/zipball/cacdbf5a91a657ede665c541eda28941d4b09c1e", - "reference": "cacdbf5a91a657ede665c541eda28941d4b09c1e", + "url": "https://api.github.com/repos/nette/utils/zipball/b043439dbdf954e6c28b5ea7e34b0100f83165e0", + "reference": "b043439dbdf954e6c28b5ea7e34b0100f83165e0", "shasum": "" }, "require": { - "php": ">=8.0 <8.3" + "php": "8.2 - 8.5" }, "conflict": { "nette/finder": "<3", "nette/schema": "<1.2.2" }, "require-dev": { - "jetbrains/phpstorm-attributes": "dev-master", - "nette/tester": "^2.4", - "phpstan/phpstan": "^1.0", + "jetbrains/phpstorm-attributes": "^1.2", + "nette/phpstan-rules": "^1.0", + "nette/tester": "^2.5", + "phpstan/extension-installer": "^1.4@stable", + "phpstan/phpstan": "^2.1@stable", "tracy/tracy": "^2.9" }, "suggest": { "ext-gd": "to use Image", - "ext-iconv": "to use Strings::webalize(), toAscii(), chr() and reverse()", + "ext-iconv": "to use Strings::chr(), ord() and reverse()", "ext-intl": "to use Strings::webalize(), toAscii(), normalize() and compare()", "ext-json": "to use Nette\\Utils\\Json", "ext-mbstring": "to use Strings::lower() etc...", - "ext-tokenizer": "to use Nette\\Utils\\Reflection::getUseStatements()", - "ext-xml": "to use Strings::length() etc. when mbstring is not available" + "ext-tokenizer": "to use Nette\\Utils\\Reflection::getUseStatements()" }, - "time": "2023-02-02T10:41:53+00:00", + "time": "2026-07-17T23:02:45+00:00", "type": "library", "extra": { "branch-alias": { - "dev-master": "4.0-dev" + "dev-master": "4.1-dev" } }, "installation-source": "dist", "autoload": { + "psr-4": { + "Nette\\": "src" + }, "classmap": [ "src/" ] @@ -4833,43 +4842,38 @@ ], "support": { "issues": "https://github.com/nette/utils/issues", - "source": "https://github.com/nette/utils/tree/v4.0.0" + "source": "https://github.com/nette/utils/tree/v4.1.5" }, "install-path": "../nette/utils" }, { "name": "nikic/php-parser", - "version": "v4.15.4", - "version_normalized": "4.15.4.0", + "version": "v4.19.5", + "version_normalized": "4.19.5.0", "source": { "type": "git", "url": "https://github.com/nikic/PHP-Parser.git", - "reference": "6bb5176bc4af8bcb7d926f88718db9b96a2d4290" + "reference": "51bd93cc741b7fc3d63d20b6bdcd99fdaa359837" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/nikic/PHP-Parser/zipball/6bb5176bc4af8bcb7d926f88718db9b96a2d4290", - "reference": "6bb5176bc4af8bcb7d926f88718db9b96a2d4290", + "url": "https://api.github.com/repos/nikic/PHP-Parser/zipball/51bd93cc741b7fc3d63d20b6bdcd99fdaa359837", + "reference": "51bd93cc741b7fc3d63d20b6bdcd99fdaa359837", "shasum": "" }, "require": { "ext-tokenizer": "*", - "php": ">=7.0" + "php": ">=7.1" }, "require-dev": { "ircmaxell/php-yacc": "^0.0.7", - "phpunit/phpunit": "^6.5 || ^7.0 || ^8.0 || ^9.0" + "phpunit/phpunit": "^7.0 || ^8.0 || ^9.0" }, - "time": "2023-03-05T19:49:14+00:00", + "time": "2025-12-06T11:45:25+00:00", "bin": [ "bin/php-parse" ], "type": "library", - "extra": { - "branch-alias": { - "dev-master": "4.9-dev" - } - }, "installation-source": "dist", "autoload": { "psr-4": { @@ -4892,7 +4896,7 @@ ], "support": { "issues": "https://github.com/nikic/PHP-Parser/issues", - "source": "https://github.com/nikic/PHP-Parser/tree/v4.15.4" + "source": "https://github.com/nikic/PHP-Parser/tree/v4.19.5" }, "install-path": "../nikic/php-parser" }, @@ -5086,27 +5090,28 @@ }, { "name": "phar-io/manifest", - "version": "2.0.3", - "version_normalized": "2.0.3.0", + "version": "2.0.4", + "version_normalized": "2.0.4.0", "source": { "type": "git", "url": "https://github.com/phar-io/manifest.git", - "reference": "97803eca37d319dfa7826cc2437fc020857acb53" + "reference": "54750ef60c58e43759730615a392c31c80e23176" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phar-io/manifest/zipball/97803eca37d319dfa7826cc2437fc020857acb53", - "reference": "97803eca37d319dfa7826cc2437fc020857acb53", + "url": "https://api.github.com/repos/phar-io/manifest/zipball/54750ef60c58e43759730615a392c31c80e23176", + "reference": "54750ef60c58e43759730615a392c31c80e23176", "shasum": "" }, "require": { "ext-dom": "*", + "ext-libxml": "*", "ext-phar": "*", "ext-xmlwriter": "*", "phar-io/version": "^3.0.1", "php": "^7.2 || ^8.0" }, - "time": "2021-07-20T11:28:43+00:00", + "time": "2024-03-03T12:33:53+00:00", "type": "library", "extra": { "branch-alias": { @@ -5143,8 +5148,14 @@ "description": "Component for reading phar.io manifest information from a PHP Archive (PHAR)", "support": { "issues": "https://github.com/phar-io/manifest/issues", - "source": "https://github.com/phar-io/manifest/tree/2.0.3" + "source": "https://github.com/phar-io/manifest/tree/2.0.4" }, + "funding": [ + { + "url": "https://github.com/theseer", + "type": "github" + } + ], "install-path": "../phar-io/manifest" }, { @@ -5479,46 +5490,46 @@ }, { "name": "phpunit/php-code-coverage", - "version": "10.0.2", - "version_normalized": "10.0.2.0", + "version": "10.1.16", + "version_normalized": "10.1.16.0", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/php-code-coverage.git", - "reference": "20800e84296ea4732f9a125e08ce86b4004ae3e4" + "reference": "7e308268858ed6baedc8704a304727d20bc07c77" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/20800e84296ea4732f9a125e08ce86b4004ae3e4", - "reference": "20800e84296ea4732f9a125e08ce86b4004ae3e4", + "url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/7e308268858ed6baedc8704a304727d20bc07c77", + "reference": "7e308268858ed6baedc8704a304727d20bc07c77", "shasum": "" }, "require": { "ext-dom": "*", "ext-libxml": "*", "ext-xmlwriter": "*", - "nikic/php-parser": "^4.15", + "nikic/php-parser": "^4.19.1 || ^5.1.0", "php": ">=8.1", - "phpunit/php-file-iterator": "^4.0", - "phpunit/php-text-template": "^3.0", - "sebastian/code-unit-reverse-lookup": "^3.0", - "sebastian/complexity": "^3.0", - "sebastian/environment": "^6.0", - "sebastian/lines-of-code": "^2.0", - "sebastian/version": "^4.0", - "theseer/tokenizer": "^1.2.0" + "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": "^10.0" + "phpunit/phpunit": "^10.1" }, "suggest": { "ext-pcov": "PHP extension that provides line coverage", "ext-xdebug": "PHP extension that provides line coverage as well as branch and path coverage" }, - "time": "2023-03-06T13:00:19+00:00", + "time": "2024-08-22T04:31:57+00:00", "type": "library", "extra": { "branch-alias": { - "dev-main": "10.0-dev" + "dev-main": "10.1.x-dev" } }, "installation-source": "dist", @@ -5547,7 +5558,8 @@ ], "support": { "issues": "https://github.com/sebastianbergmann/php-code-coverage/issues", - "source": "https://github.com/sebastianbergmann/php-code-coverage/tree/10.0.2" + "security": "https://github.com/sebastianbergmann/php-code-coverage/security/policy", + "source": "https://github.com/sebastianbergmann/php-code-coverage/tree/10.1.16" }, "funding": [ { @@ -5559,17 +5571,17 @@ }, { "name": "phpunit/php-file-iterator", - "version": "4.0.1", - "version_normalized": "4.0.1.0", + "version": "4.1.0", + "version_normalized": "4.1.0.0", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/php-file-iterator.git", - "reference": "fd9329ab3368f59fe1fe808a189c51086bd4b6bd" + "reference": "a95037b6d9e608ba092da1b23931e537cadc3c3c" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-file-iterator/zipball/fd9329ab3368f59fe1fe808a189c51086bd4b6bd", - "reference": "fd9329ab3368f59fe1fe808a189c51086bd4b6bd", + "url": "https://api.github.com/repos/sebastianbergmann/php-file-iterator/zipball/a95037b6d9e608ba092da1b23931e537cadc3c3c", + "reference": "a95037b6d9e608ba092da1b23931e537cadc3c3c", "shasum": "" }, "require": { @@ -5578,7 +5590,7 @@ "require-dev": { "phpunit/phpunit": "^10.0" }, - "time": "2023-02-10T16:53:14+00:00", + "time": "2023-08-31T06:24:48+00:00", "type": "library", "extra": { "branch-alias": { @@ -5610,7 +5622,8 @@ ], "support": { "issues": "https://github.com/sebastianbergmann/php-file-iterator/issues", - "source": "https://github.com/sebastianbergmann/php-file-iterator/tree/4.0.1" + "security": "https://github.com/sebastianbergmann/php-file-iterator/security/policy", + "source": "https://github.com/sebastianbergmann/php-file-iterator/tree/4.1.0" }, "funding": [ { @@ -5688,17 +5701,17 @@ }, { "name": "phpunit/php-text-template", - "version": "3.0.0", - "version_normalized": "3.0.0.0", + "version": "3.0.1", + "version_normalized": "3.0.1.0", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/php-text-template.git", - "reference": "9f3d3709577a527025f55bcf0f7ab8052c8bb37d" + "reference": "0c7b06ff49e3d5072f057eb1fa59258bf287a748" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-text-template/zipball/9f3d3709577a527025f55bcf0f7ab8052c8bb37d", - "reference": "9f3d3709577a527025f55bcf0f7ab8052c8bb37d", + "url": "https://api.github.com/repos/sebastianbergmann/php-text-template/zipball/0c7b06ff49e3d5072f057eb1fa59258bf287a748", + "reference": "0c7b06ff49e3d5072f057eb1fa59258bf287a748", "shasum": "" }, "require": { @@ -5707,7 +5720,7 @@ "require-dev": { "phpunit/phpunit": "^10.0" }, - "time": "2023-02-03T06:56:46+00:00", + "time": "2023-08-31T14:07:24+00:00", "type": "library", "extra": { "branch-alias": { @@ -5738,7 +5751,8 @@ ], "support": { "issues": "https://github.com/sebastianbergmann/php-text-template/issues", - "source": "https://github.com/sebastianbergmann/php-text-template/tree/3.0.0" + "security": "https://github.com/sebastianbergmann/php-text-template/security/policy", + "source": "https://github.com/sebastianbergmann/php-text-template/tree/3.0.1" }, "funding": [ { @@ -5812,58 +5826,58 @@ }, { "name": "phpunit/phpunit", - "version": "10.0.16", - "version_normalized": "10.0.16.0", + "version": "10.5.64", + "version_normalized": "10.5.64.0", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/phpunit.git", - "reference": "07d386a11ac7094032900f07cada1c8975d16607" + "reference": "0e8c1d19cea35ad97d4887f363d07c78e30fbf06" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/07d386a11ac7094032900f07cada1c8975d16607", - "reference": "07d386a11ac7094032900f07cada1c8975d16607", + "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/0e8c1d19cea35ad97d4887f363d07c78e30fbf06", + "reference": "0e8c1d19cea35ad97d4887f363d07c78e30fbf06", "shasum": "" }, "require": { "ext-dom": "*", + "ext-filter": "*", "ext-json": "*", "ext-libxml": "*", "ext-mbstring": "*", - "ext-xml": "*", "ext-xmlwriter": "*", - "myclabs/deep-copy": "^1.10.1", - "phar-io/manifest": "^2.0.3", - "phar-io/version": "^3.0.2", + "myclabs/deep-copy": "^1.13.4", + "phar-io/manifest": "^2.0.4", + "phar-io/version": "^3.2.1", "php": ">=8.1", - "phpunit/php-code-coverage": "^10.0", - "phpunit/php-file-iterator": "^4.0", - "phpunit/php-invoker": "^4.0", - "phpunit/php-text-template": "^3.0", - "phpunit/php-timer": "^6.0", - "sebastian/cli-parser": "^2.0", - "sebastian/code-unit": "^2.0", - "sebastian/comparator": "^5.0", - "sebastian/diff": "^5.0", - "sebastian/environment": "^6.0", - "sebastian/exporter": "^5.0", - "sebastian/global-state": "^6.0", - "sebastian/object-enumerator": "^5.0", - "sebastian/recursion-context": "^5.0", - "sebastian/type": "^4.0", - "sebastian/version": "^4.0" + "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.5", + "sebastian/diff": "^5.1.1", + "sebastian/environment": "^6.1.0", + "sebastian/exporter": "^5.1.4", + "sebastian/global-state": "^6.0.2", + "sebastian/object-enumerator": "^5.0.0", + "sebastian/recursion-context": "^5.0.1", + "sebastian/type": "^4.0.0", + "sebastian/version": "^4.0.1" }, "suggest": { "ext-soap": "To be able to generate mocks based on WSDL files" }, - "time": "2023-03-13T09:02:40+00:00", + "time": "2026-07-06T14:50:35+00:00", "bin": [ "phpunit" ], "type": "library", "extra": { "branch-alias": { - "dev-main": "10.0-dev" + "dev-main": "10.5-dev" } }, "installation-source": "dist", @@ -5895,20 +5909,13 @@ ], "support": { "issues": "https://github.com/sebastianbergmann/phpunit/issues", - "source": "https://github.com/sebastianbergmann/phpunit/tree/10.0.16" + "security": "https://github.com/sebastianbergmann/phpunit/security/policy", + "source": "https://github.com/sebastianbergmann/phpunit/tree/10.5.64" }, "funding": [ { - "url": "https://phpunit.de/sponsors.html", - "type": "custom" - }, - { - "url": "https://github.com/sebastianbergmann", - "type": "github" - }, - { - "url": "https://tidelift.com/funding/github/packagist/phpunit/phpunit", - "type": "tidelift" + "url": "https://phpunit.de/sponsoring.html", + "type": "other" } ], "install-path": "../phpunit/phpunit" @@ -6384,23 +6391,23 @@ }, { "name": "psr/log", - "version": "3.0.0", - "version_normalized": "3.0.0.0", + "version": "3.0.2", + "version_normalized": "3.0.2.0", "source": { "type": "git", "url": "https://github.com/php-fig/log.git", - "reference": "fe5ea303b0887d5caefd3d431c3e61ad47037001" + "reference": "f16e1d5863e37f8d8c2a01719f5b34baa2b714d3" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/php-fig/log/zipball/fe5ea303b0887d5caefd3d431c3e61ad47037001", - "reference": "fe5ea303b0887d5caefd3d431c3e61ad47037001", + "url": "https://api.github.com/repos/php-fig/log/zipball/f16e1d5863e37f8d8c2a01719f5b34baa2b714d3", + "reference": "f16e1d5863e37f8d8c2a01719f5b34baa2b714d3", "shasum": "" }, "require": { "php": ">=8.0.0" }, - "time": "2021-07-14T16:46:02+00:00", + "time": "2024-09-11T13:17:53+00:00", "type": "library", "extra": { "branch-alias": { @@ -6431,7 +6438,7 @@ "psr-3" ], "support": { - "source": "https://github.com/php-fig/log/tree/3.0.0" + "source": "https://github.com/php-fig/log/tree/3.0.2" }, "install-path": "../psr/log" }, @@ -6894,17 +6901,17 @@ }, { "name": "sebastian/cli-parser", - "version": "2.0.0", - "version_normalized": "2.0.0.0", + "version": "2.0.1", + "version_normalized": "2.0.1.0", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/cli-parser.git", - "reference": "efdc130dbbbb8ef0b545a994fd811725c5282cae" + "reference": "c34583b87e7b7a8055bf6c450c2c77ce32a24084" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/cli-parser/zipball/efdc130dbbbb8ef0b545a994fd811725c5282cae", - "reference": "efdc130dbbbb8ef0b545a994fd811725c5282cae", + "url": "https://api.github.com/repos/sebastianbergmann/cli-parser/zipball/c34583b87e7b7a8055bf6c450c2c77ce32a24084", + "reference": "c34583b87e7b7a8055bf6c450c2c77ce32a24084", "shasum": "" }, "require": { @@ -6913,7 +6920,7 @@ "require-dev": { "phpunit/phpunit": "^10.0" }, - "time": "2023-02-03T06:58:15+00:00", + "time": "2024-03-02T07:12:49+00:00", "type": "library", "extra": { "branch-alias": { @@ -6941,7 +6948,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/2.0.0" + "security": "https://github.com/sebastianbergmann/cli-parser/security/policy", + "source": "https://github.com/sebastianbergmann/cli-parser/tree/2.0.1" }, "funding": [ { @@ -7070,17 +7078,17 @@ }, { "name": "sebastian/comparator", - "version": "5.0.0", - "version_normalized": "5.0.0.0", + "version": "5.0.5", + "version_normalized": "5.0.5.0", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/comparator.git", - "reference": "72f01e6586e0caf6af81297897bd112eb7e9627c" + "reference": "55dfef806eb7dfeb6e7a6935601fef866f8ca48d" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/comparator/zipball/72f01e6586e0caf6af81297897bd112eb7e9627c", - "reference": "72f01e6586e0caf6af81297897bd112eb7e9627c", + "url": "https://api.github.com/repos/sebastianbergmann/comparator/zipball/55dfef806eb7dfeb6e7a6935601fef866f8ca48d", + "reference": "55dfef806eb7dfeb6e7a6935601fef866f8ca48d", "shasum": "" }, "require": { @@ -7091,9 +7099,9 @@ "sebastian/exporter": "^5.0" }, "require-dev": { - "phpunit/phpunit": "^10.0" + "phpunit/phpunit": "^10.5" }, - "time": "2023-02-03T07:07:16+00:00", + "time": "2026-01-24T09:25:16+00:00", "type": "library", "extra": { "branch-alias": { @@ -7137,43 +7145,56 @@ ], "support": { "issues": "https://github.com/sebastianbergmann/comparator/issues", - "source": "https://github.com/sebastianbergmann/comparator/tree/5.0.0" + "security": "https://github.com/sebastianbergmann/comparator/security/policy", + "source": "https://github.com/sebastianbergmann/comparator/tree/5.0.5" }, "funding": [ { "url": "https://github.com/sebastianbergmann", "type": "github" + }, + { + "url": "https://liberapay.com/sebastianbergmann", + "type": "liberapay" + }, + { + "url": "https://thanks.dev/u/gh/sebastianbergmann", + "type": "thanks_dev" + }, + { + "url": "https://tidelift.com/funding/github/packagist/sebastian/comparator", + "type": "tidelift" } ], "install-path": "../sebastian/comparator" }, { "name": "sebastian/complexity", - "version": "3.0.0", - "version_normalized": "3.0.0.0", + "version": "3.2.0", + "version_normalized": "3.2.0.0", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/complexity.git", - "reference": "e67d240970c9dc7ea7b2123a6d520e334dd61dc6" + "reference": "68ff824baeae169ec9f2137158ee529584553799" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/complexity/zipball/e67d240970c9dc7ea7b2123a6d520e334dd61dc6", - "reference": "e67d240970c9dc7ea7b2123a6d520e334dd61dc6", + "url": "https://api.github.com/repos/sebastianbergmann/complexity/zipball/68ff824baeae169ec9f2137158ee529584553799", + "reference": "68ff824baeae169ec9f2137158ee529584553799", "shasum": "" }, "require": { - "nikic/php-parser": "^4.10", + "nikic/php-parser": "^4.18 || ^5.0", "php": ">=8.1" }, "require-dev": { "phpunit/phpunit": "^10.0" }, - "time": "2023-02-03T06:59:47+00:00", + "time": "2023-12-21T08:37:17+00:00", "type": "library", "extra": { "branch-alias": { - "dev-main": "3.0-dev" + "dev-main": "3.2-dev" } }, "installation-source": "dist", @@ -7197,7 +7218,8 @@ "homepage": "https://github.com/sebastianbergmann/complexity", "support": { "issues": "https://github.com/sebastianbergmann/complexity/issues", - "source": "https://github.com/sebastianbergmann/complexity/tree/3.0.0" + "security": "https://github.com/sebastianbergmann/complexity/security/policy", + "source": "https://github.com/sebastianbergmann/complexity/tree/3.2.0" }, "funding": [ { @@ -7209,17 +7231,17 @@ }, { "name": "sebastian/diff", - "version": "5.0.0", - "version_normalized": "5.0.0.0", + "version": "5.1.1", + "version_normalized": "5.1.1.0", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/diff.git", - "reference": "70dd1b20bc198da394ad542e988381b44e64e39f" + "reference": "c41e007b4b62af48218231d6c2275e4c9b975b2e" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/diff/zipball/70dd1b20bc198da394ad542e988381b44e64e39f", - "reference": "70dd1b20bc198da394ad542e988381b44e64e39f", + "url": "https://api.github.com/repos/sebastianbergmann/diff/zipball/c41e007b4b62af48218231d6c2275e4c9b975b2e", + "reference": "c41e007b4b62af48218231d6c2275e4c9b975b2e", "shasum": "" }, "require": { @@ -7227,13 +7249,13 @@ }, "require-dev": { "phpunit/phpunit": "^10.0", - "symfony/process": "^4.2 || ^5" + "symfony/process": "^6.4" }, - "time": "2023-02-03T07:00:31+00:00", + "time": "2024-03-02T07:15:17+00:00", "type": "library", "extra": { "branch-alias": { - "dev-main": "5.0-dev" + "dev-main": "5.1-dev" } }, "installation-source": "dist", @@ -7266,7 +7288,8 @@ ], "support": { "issues": "https://github.com/sebastianbergmann/diff/issues", - "source": "https://github.com/sebastianbergmann/diff/tree/5.0.0" + "security": "https://github.com/sebastianbergmann/diff/security/policy", + "source": "https://github.com/sebastianbergmann/diff/tree/5.1.1" }, "funding": [ { @@ -7278,17 +7301,17 @@ }, { "name": "sebastian/environment", - "version": "6.0.0", - "version_normalized": "6.0.0.0", + "version": "6.1.0", + "version_normalized": "6.1.0.0", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/environment.git", - "reference": "b6f3694c6386c7959915a0037652e0c40f6f69cc" + "reference": "8074dbcd93529b357029f5cc5058fd3e43666984" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/environment/zipball/b6f3694c6386c7959915a0037652e0c40f6f69cc", - "reference": "b6f3694c6386c7959915a0037652e0c40f6f69cc", + "url": "https://api.github.com/repos/sebastianbergmann/environment/zipball/8074dbcd93529b357029f5cc5058fd3e43666984", + "reference": "8074dbcd93529b357029f5cc5058fd3e43666984", "shasum": "" }, "require": { @@ -7300,11 +7323,11 @@ "suggest": { "ext-posix": "*" }, - "time": "2023-02-03T07:03:04+00:00", + "time": "2024-03-23T08:47:14+00:00", "type": "library", "extra": { "branch-alias": { - "dev-main": "6.0-dev" + "dev-main": "6.1-dev" } }, "installation-source": "dist", @@ -7332,7 +7355,8 @@ ], "support": { "issues": "https://github.com/sebastianbergmann/environment/issues", - "source": "https://github.com/sebastianbergmann/environment/tree/6.0.0" + "security": "https://github.com/sebastianbergmann/environment/security/policy", + "source": "https://github.com/sebastianbergmann/environment/tree/6.1.0" }, "funding": [ { @@ -7344,17 +7368,17 @@ }, { "name": "sebastian/exporter", - "version": "5.0.0", - "version_normalized": "5.0.0.0", + "version": "5.1.4", + "version_normalized": "5.1.4.0", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/exporter.git", - "reference": "f3ec4bf931c0b31e5b413f5b4fc970a7d03338c0" + "reference": "0735b90f4da94969541dac1da743446e276defa6" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/exporter/zipball/f3ec4bf931c0b31e5b413f5b4fc970a7d03338c0", - "reference": "f3ec4bf931c0b31e5b413f5b4fc970a7d03338c0", + "url": "https://api.github.com/repos/sebastianbergmann/exporter/zipball/0735b90f4da94969541dac1da743446e276defa6", + "reference": "0735b90f4da94969541dac1da743446e276defa6", "shasum": "" }, "require": { @@ -7363,13 +7387,13 @@ "sebastian/recursion-context": "^5.0" }, "require-dev": { - "phpunit/phpunit": "^10.0" + "phpunit/phpunit": "^10.5" }, - "time": "2023-02-03T07:06:49+00:00", + "time": "2025-09-24T06:09:11+00:00", "type": "library", "extra": { "branch-alias": { - "dev-main": "5.0-dev" + "dev-main": "5.1-dev" } }, "installation-source": "dist", @@ -7412,29 +7436,42 @@ ], "support": { "issues": "https://github.com/sebastianbergmann/exporter/issues", - "source": "https://github.com/sebastianbergmann/exporter/tree/5.0.0" + "security": "https://github.com/sebastianbergmann/exporter/security/policy", + "source": "https://github.com/sebastianbergmann/exporter/tree/5.1.4" }, "funding": [ { "url": "https://github.com/sebastianbergmann", "type": "github" + }, + { + "url": "https://liberapay.com/sebastianbergmann", + "type": "liberapay" + }, + { + "url": "https://thanks.dev/u/gh/sebastianbergmann", + "type": "thanks_dev" + }, + { + "url": "https://tidelift.com/funding/github/packagist/sebastian/exporter", + "type": "tidelift" } ], "install-path": "../sebastian/exporter" }, { "name": "sebastian/global-state", - "version": "6.0.0", - "version_normalized": "6.0.0.0", + "version": "6.0.2", + "version_normalized": "6.0.2.0", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/global-state.git", - "reference": "aab257c712de87b90194febd52e4d184551c2d44" + "reference": "987bafff24ecc4c9ac418cab1145b96dd6e9cbd9" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/global-state/zipball/aab257c712de87b90194febd52e4d184551c2d44", - "reference": "aab257c712de87b90194febd52e4d184551c2d44", + "url": "https://api.github.com/repos/sebastianbergmann/global-state/zipball/987bafff24ecc4c9ac418cab1145b96dd6e9cbd9", + "reference": "987bafff24ecc4c9ac418cab1145b96dd6e9cbd9", "shasum": "" }, "require": { @@ -7446,7 +7483,7 @@ "ext-dom": "*", "phpunit/phpunit": "^10.0" }, - "time": "2023-02-03T07:07:38+00:00", + "time": "2024-03-02T07:19:19+00:00", "type": "library", "extra": { "branch-alias": { @@ -7470,13 +7507,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/6.0.0" + "security": "https://github.com/sebastianbergmann/global-state/security/policy", + "source": "https://github.com/sebastianbergmann/global-state/tree/6.0.2" }, "funding": [ { @@ -7488,27 +7526,27 @@ }, { "name": "sebastian/lines-of-code", - "version": "2.0.0", - "version_normalized": "2.0.0.0", + "version": "2.0.2", + "version_normalized": "2.0.2.0", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/lines-of-code.git", - "reference": "17c4d940ecafb3d15d2cf916f4108f664e28b130" + "reference": "856e7f6a75a84e339195d48c556f23be2ebf75d0" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/lines-of-code/zipball/17c4d940ecafb3d15d2cf916f4108f664e28b130", - "reference": "17c4d940ecafb3d15d2cf916f4108f664e28b130", + "url": "https://api.github.com/repos/sebastianbergmann/lines-of-code/zipball/856e7f6a75a84e339195d48c556f23be2ebf75d0", + "reference": "856e7f6a75a84e339195d48c556f23be2ebf75d0", "shasum": "" }, "require": { - "nikic/php-parser": "^4.10", + "nikic/php-parser": "^4.18 || ^5.0", "php": ">=8.1" }, "require-dev": { "phpunit/phpunit": "^10.0" }, - "time": "2023-02-03T07:08:02+00:00", + "time": "2023-12-21T08:38:20+00:00", "type": "library", "extra": { "branch-alias": { @@ -7536,7 +7574,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/2.0.0" + "security": "https://github.com/sebastianbergmann/lines-of-code/security/policy", + "source": "https://github.com/sebastianbergmann/lines-of-code/tree/2.0.2" }, "funding": [ { @@ -7666,26 +7705,26 @@ }, { "name": "sebastian/recursion-context", - "version": "5.0.0", - "version_normalized": "5.0.0.0", + "version": "5.0.1", + "version_normalized": "5.0.1.0", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/recursion-context.git", - "reference": "05909fb5bc7df4c52992396d0116aed689f93712" + "reference": "47e34210757a2f37a97dcd207d032e1b01e64c7a" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/recursion-context/zipball/05909fb5bc7df4c52992396d0116aed689f93712", - "reference": "05909fb5bc7df4c52992396d0116aed689f93712", + "url": "https://api.github.com/repos/sebastianbergmann/recursion-context/zipball/47e34210757a2f37a97dcd207d032e1b01e64c7a", + "reference": "47e34210757a2f37a97dcd207d032e1b01e64c7a", "shasum": "" }, "require": { "php": ">=8.1" }, "require-dev": { - "phpunit/phpunit": "^10.0" + "phpunit/phpunit": "^10.5" }, - "time": "2023-02-03T07:05:40+00:00", + "time": "2025-08-10T07:50:56+00:00", "type": "library", "extra": { "branch-alias": { @@ -7720,12 +7759,25 @@ "homepage": "https://github.com/sebastianbergmann/recursion-context", "support": { "issues": "https://github.com/sebastianbergmann/recursion-context/issues", - "source": "https://github.com/sebastianbergmann/recursion-context/tree/5.0.0" + "security": "https://github.com/sebastianbergmann/recursion-context/security/policy", + "source": "https://github.com/sebastianbergmann/recursion-context/tree/5.0.1" }, "funding": [ { "url": "https://github.com/sebastianbergmann", "type": "github" + }, + { + "url": "https://liberapay.com/sebastianbergmann", + "type": "liberapay" + }, + { + "url": "https://thanks.dev/u/gh/sebastianbergmann", + "type": "thanks_dev" + }, + { + "url": "https://tidelift.com/funding/github/packagist/sebastian/recursion-context", + "type": "tidelift" } ], "install-path": "../sebastian/recursion-context" @@ -8373,25 +8425,25 @@ }, { "name": "symfony/console", - "version": "v6.2.7", - "version_normalized": "6.2.7.0", + "version": "v6.4.43", + "version_normalized": "6.4.43.0", "source": { "type": "git", "url": "https://github.com/symfony/console.git", - "reference": "cbad09eb8925b6ad4fb721c7a179344dc4a19d45" + "reference": "3b643aa587acbc42f967a429af088a56ed8f046d" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/console/zipball/cbad09eb8925b6ad4fb721c7a179344dc4a19d45", - "reference": "cbad09eb8925b6ad4fb721c7a179344dc4a19d45", + "url": "https://api.github.com/repos/symfony/console/zipball/3b643aa587acbc42f967a429af088a56ed8f046d", + "reference": "3b643aa587acbc42f967a429af088a56ed8f046d", "shasum": "" }, "require": { "php": ">=8.1", - "symfony/deprecation-contracts": "^2.1|^3", + "symfony/deprecation-contracts": "^2.5|^3", "symfony/polyfill-mbstring": "~1.0", - "symfony/service-contracts": "^1.1|^2|^3", - "symfony/string": "^5.4|^6.0" + "symfony/service-contracts": "^2.5|^3", + "symfony/string": "^5.4|^6.0|^7.0" }, "conflict": { "symfony/dependency-injection": "<5.4", @@ -8405,20 +8457,18 @@ }, "require-dev": { "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" + "symfony/config": "^5.4|^6.0|^7.0", + "symfony/dependency-injection": "^5.4|^6.0|^7.0", + "symfony/event-dispatcher": "^5.4|^6.0|^7.0", + "symfony/http-foundation": "^6.4|^7.0", + "symfony/http-kernel": "^6.4|^7.0", + "symfony/lock": "^5.4|^6.0|^7.0", + "symfony/messenger": "^5.4|^6.0|^7.0", + "symfony/process": "^5.4|^6.0|^7.0", + "symfony/stopwatch": "^5.4|^6.0|^7.0", + "symfony/var-dumper": "^5.4|^6.0|^7.0" }, - "suggest": { - "psr/log": "For using the console logger", - "symfony/event-dispatcher": "", - "symfony/lock": "", - "symfony/process": "" - }, - "time": "2023-02-25T17:00:03+00:00", + "time": "2026-07-26T14:44:19+00:00", "type": "library", "installation-source": "dist", "autoload": { @@ -8447,12 +8497,12 @@ "homepage": "https://symfony.com", "keywords": [ "cli", - "command line", + "command-line", "console", "terminal" ], "support": { - "source": "https://github.com/symfony/console/tree/v6.2.7" + "source": "https://github.com/symfony/console/tree/v6.4.43" }, "funding": [ { @@ -8463,6 +8513,10 @@ "url": "https://github.com/fabpot", "type": "github" }, + { + "url": "https://github.com/nicolas-grekas", + "type": "github" + }, { "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", "type": "tidelift" @@ -8540,31 +8594,31 @@ }, { "name": "symfony/deprecation-contracts", - "version": "v3.2.1", - "version_normalized": "3.2.1.0", + "version": "v3.7.1", + "version_normalized": "3.7.1.0", "source": { "type": "git", "url": "https://github.com/symfony/deprecation-contracts.git", - "reference": "e2d1534420bd723d0ef5aec58a22c5fe60ce6f5e" + "reference": "f3202fa1b5097b0af062dc978b32ecf63404e31d" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/deprecation-contracts/zipball/e2d1534420bd723d0ef5aec58a22c5fe60ce6f5e", - "reference": "e2d1534420bd723d0ef5aec58a22c5fe60ce6f5e", + "url": "https://api.github.com/repos/symfony/deprecation-contracts/zipball/f3202fa1b5097b0af062dc978b32ecf63404e31d", + "reference": "f3202fa1b5097b0af062dc978b32ecf63404e31d", "shasum": "" }, "require": { "php": ">=8.1" }, - "time": "2023-03-01T10:25:55+00:00", + "time": "2026-06-05T06:23:12+00:00", "type": "library", "extra": { - "branch-alias": { - "dev-main": "3.3-dev" - }, "thanks": { - "name": "symfony/contracts", - "url": "https://github.com/symfony/contracts" + "url": "https://github.com/symfony/contracts", + "name": "symfony/contracts" + }, + "branch-alias": { + "dev-main": "3.7-dev" } }, "installation-source": "dist", @@ -8590,7 +8644,7 @@ "description": "A generic function and convention to trigger deprecation notices", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/deprecation-contracts/tree/v3.2.1" + "source": "https://github.com/symfony/deprecation-contracts/tree/v3.7.1" }, "funding": [ { @@ -8601,6 +8655,10 @@ "url": "https://github.com/fabpot", "type": "github" }, + { + "url": "https://github.com/nicolas-grekas", + "type": "github" + }, { "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", "type": "tidelift" @@ -8770,35 +8828,32 @@ }, { "name": "symfony/event-dispatcher-contracts", - "version": "v3.2.1", - "version_normalized": "3.2.1.0", + "version": "v3.7.1", + "version_normalized": "3.7.1.0", "source": { "type": "git", "url": "https://github.com/symfony/event-dispatcher-contracts.git", - "reference": "0ad3b6f1e4e2da5690fefe075cd53a238646d8dd" + "reference": "c7de7a00ffb67842132da02ea92988a39ccd9f4e" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/event-dispatcher-contracts/zipball/0ad3b6f1e4e2da5690fefe075cd53a238646d8dd", - "reference": "0ad3b6f1e4e2da5690fefe075cd53a238646d8dd", + "url": "https://api.github.com/repos/symfony/event-dispatcher-contracts/zipball/c7de7a00ffb67842132da02ea92988a39ccd9f4e", + "reference": "c7de7a00ffb67842132da02ea92988a39ccd9f4e", "shasum": "" }, "require": { "php": ">=8.1", "psr/event-dispatcher": "^1" }, - "suggest": { - "symfony/event-dispatcher-implementation": "" - }, - "time": "2023-03-01T10:32:47+00:00", + "time": "2026-06-05T06:23:12+00:00", "type": "library", "extra": { - "branch-alias": { - "dev-main": "3.3-dev" - }, "thanks": { - "name": "symfony/contracts", - "url": "https://github.com/symfony/contracts" + "url": "https://github.com/symfony/contracts", + "name": "symfony/contracts" + }, + "branch-alias": { + "dev-main": "3.7-dev" } }, "installation-source": "dist", @@ -8832,7 +8887,7 @@ "standards" ], "support": { - "source": "https://github.com/symfony/event-dispatcher-contracts/tree/v3.2.1" + "source": "https://github.com/symfony/event-dispatcher-contracts/tree/v3.7.1" }, "funding": [ { @@ -8843,6 +8898,10 @@ "url": "https://github.com/fabpot", "type": "github" }, + { + "url": "https://github.com/nicolas-grekas", + "type": "github" + }, { "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", "type": "tidelift" @@ -9355,21 +9414,21 @@ }, { "name": "symfony/polyfill-ctype", - "version": "v1.27.0", - "version_normalized": "1.27.0.0", + "version": "v1.37.0", + "version_normalized": "1.37.0.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-ctype.git", - "reference": "5bbc823adecdae860bb64756d639ecfec17b050a" + "reference": "141046a8f9477948ff284fa65be2095baafb94f2" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-ctype/zipball/5bbc823adecdae860bb64756d639ecfec17b050a", - "reference": "5bbc823adecdae860bb64756d639ecfec17b050a", + "url": "https://api.github.com/repos/symfony/polyfill-ctype/zipball/141046a8f9477948ff284fa65be2095baafb94f2", + "reference": "141046a8f9477948ff284fa65be2095baafb94f2", "shasum": "" }, "require": { - "php": ">=7.1" + "php": ">=7.2" }, "provide": { "ext-ctype": "*" @@ -9377,15 +9436,12 @@ "suggest": { "ext-ctype": "For best performance" }, - "time": "2022-11-03T14:55:06+00:00", + "time": "2026-04-10T16:19:22+00:00", "type": "library", "extra": { - "branch-alias": { - "dev-main": "1.27-dev" - }, "thanks": { - "name": "symfony/polyfill", - "url": "https://github.com/symfony/polyfill" + "url": "https://github.com/symfony/polyfill", + "name": "symfony/polyfill" } }, "installation-source": "dist", @@ -9420,7 +9476,7 @@ "portable" ], "support": { - "source": "https://github.com/symfony/polyfill-ctype/tree/v1.27.0" + "source": "https://github.com/symfony/polyfill-ctype/tree/v1.37.0" }, "funding": [ { @@ -9431,6 +9487,10 @@ "url": "https://github.com/fabpot", "type": "github" }, + { + "url": "https://github.com/nicolas-grekas", + "type": "github" + }, { "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", "type": "tidelift" @@ -9440,34 +9500,31 @@ }, { "name": "symfony/polyfill-intl-grapheme", - "version": "v1.27.0", - "version_normalized": "1.27.0.0", + "version": "v1.41.0", + "version_normalized": "1.41.0.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-intl-grapheme.git", - "reference": "511a08c03c1960e08a883f4cffcacd219b758354" + "reference": "bb899c1db0aa8127dc3afe8cda4a67eb24915f8d" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-intl-grapheme/zipball/511a08c03c1960e08a883f4cffcacd219b758354", - "reference": "511a08c03c1960e08a883f4cffcacd219b758354", + "url": "https://api.github.com/repos/symfony/polyfill-intl-grapheme/zipball/bb899c1db0aa8127dc3afe8cda4a67eb24915f8d", + "reference": "bb899c1db0aa8127dc3afe8cda4a67eb24915f8d", "shasum": "" }, "require": { - "php": ">=7.1" + "php": ">=7.2" }, "suggest": { "ext-intl": "For best performance" }, - "time": "2022-11-03T14:55:06+00:00", + "time": "2026-07-28T08:25:59+00:00", "type": "library", "extra": { - "branch-alias": { - "dev-main": "1.27-dev" - }, "thanks": { - "name": "symfony/polyfill", - "url": "https://github.com/symfony/polyfill" + "url": "https://github.com/symfony/polyfill", + "name": "symfony/polyfill" } }, "installation-source": "dist", @@ -9504,7 +9561,7 @@ "shim" ], "support": { - "source": "https://github.com/symfony/polyfill-intl-grapheme/tree/v1.27.0" + "source": "https://github.com/symfony/polyfill-intl-grapheme/tree/v1.41.0" }, "funding": [ { @@ -9515,6 +9572,10 @@ "url": "https://github.com/fabpot", "type": "github" }, + { + "url": "https://github.com/nicolas-grekas", + "type": "github" + }, { "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", "type": "tidelift" @@ -9614,34 +9675,31 @@ }, { "name": "symfony/polyfill-intl-normalizer", - "version": "v1.27.0", - "version_normalized": "1.27.0.0", + "version": "v1.38.0", + "version_normalized": "1.38.0.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-intl-normalizer.git", - "reference": "19bd1e4fcd5b91116f14d8533c57831ed00571b6" + "reference": "2d446c214bdbe5b71bde5011b060a05fece3ae6b" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-intl-normalizer/zipball/19bd1e4fcd5b91116f14d8533c57831ed00571b6", - "reference": "19bd1e4fcd5b91116f14d8533c57831ed00571b6", + "url": "https://api.github.com/repos/symfony/polyfill-intl-normalizer/zipball/2d446c214bdbe5b71bde5011b060a05fece3ae6b", + "reference": "2d446c214bdbe5b71bde5011b060a05fece3ae6b", "shasum": "" }, "require": { - "php": ">=7.1" + "php": ">=7.2" }, "suggest": { "ext-intl": "For best performance" }, - "time": "2022-11-03T14:55:06+00:00", + "time": "2026-05-25T13:48:31+00:00", "type": "library", "extra": { - "branch-alias": { - "dev-main": "1.27-dev" - }, "thanks": { - "name": "symfony/polyfill", - "url": "https://github.com/symfony/polyfill" + "url": "https://github.com/symfony/polyfill", + "name": "symfony/polyfill" } }, "installation-source": "dist", @@ -9681,7 +9739,7 @@ "shim" ], "support": { - "source": "https://github.com/symfony/polyfill-intl-normalizer/tree/v1.27.0" + "source": "https://github.com/symfony/polyfill-intl-normalizer/tree/v1.38.0" }, "funding": [ { @@ -9692,6 +9750,10 @@ "url": "https://github.com/fabpot", "type": "github" }, + { + "url": "https://github.com/nicolas-grekas", + "type": "github" + }, { "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", "type": "tidelift" @@ -9701,21 +9763,22 @@ }, { "name": "symfony/polyfill-mbstring", - "version": "v1.27.0", - "version_normalized": "1.27.0.0", + "version": "v1.38.2", + "version_normalized": "1.38.2.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-mbstring.git", - "reference": "8ad114f6b39e2c98a8b0e3bd907732c207c2b534" + "reference": "d3d318bad5e7a1bfbd026009c8bfb8d8f99ae6b6" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/8ad114f6b39e2c98a8b0e3bd907732c207c2b534", - "reference": "8ad114f6b39e2c98a8b0e3bd907732c207c2b534", + "url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/d3d318bad5e7a1bfbd026009c8bfb8d8f99ae6b6", + "reference": "d3d318bad5e7a1bfbd026009c8bfb8d8f99ae6b6", "shasum": "" }, "require": { - "php": ">=7.1" + "ext-iconv": "*", + "php": ">=7.2" }, "provide": { "ext-mbstring": "*" @@ -9723,15 +9786,12 @@ "suggest": { "ext-mbstring": "For best performance" }, - "time": "2022-11-03T14:55:06+00:00", + "time": "2026-05-27T06:59:30+00:00", "type": "library", "extra": { - "branch-alias": { - "dev-main": "1.27-dev" - }, "thanks": { - "name": "symfony/polyfill", - "url": "https://github.com/symfony/polyfill" + "url": "https://github.com/symfony/polyfill", + "name": "symfony/polyfill" } }, "installation-source": "dist", @@ -9767,7 +9827,7 @@ "shim" ], "support": { - "source": "https://github.com/symfony/polyfill-mbstring/tree/v1.27.0" + "source": "https://github.com/symfony/polyfill-mbstring/tree/v1.38.2" }, "funding": [ { @@ -9778,6 +9838,10 @@ "url": "https://github.com/fabpot", "type": "github" }, + { + "url": "https://github.com/nicolas-grekas", + "type": "github" + }, { "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", "type": "tidelift" @@ -9866,31 +9930,28 @@ }, { "name": "symfony/polyfill-php80", - "version": "v1.27.0", - "version_normalized": "1.27.0.0", + "version": "v1.37.0", + "version_normalized": "1.37.0.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-php80.git", - "reference": "7a6ff3f1959bb01aefccb463a0f2cd3d3d2fd936" + "reference": "dfb55726c3a76ea3b6459fcfda1ec2d80a682411" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-php80/zipball/7a6ff3f1959bb01aefccb463a0f2cd3d3d2fd936", - "reference": "7a6ff3f1959bb01aefccb463a0f2cd3d3d2fd936", + "url": "https://api.github.com/repos/symfony/polyfill-php80/zipball/dfb55726c3a76ea3b6459fcfda1ec2d80a682411", + "reference": "dfb55726c3a76ea3b6459fcfda1ec2d80a682411", "shasum": "" }, "require": { - "php": ">=7.1" + "php": ">=7.2" }, - "time": "2022-11-03T14:55:06+00:00", + "time": "2026-04-10T16:19:22+00:00", "type": "library", "extra": { - "branch-alias": { - "dev-main": "1.27-dev" - }, "thanks": { - "name": "symfony/polyfill", - "url": "https://github.com/symfony/polyfill" + "url": "https://github.com/symfony/polyfill", + "name": "symfony/polyfill" } }, "installation-source": "dist", @@ -9932,7 +9993,7 @@ "shim" ], "support": { - "source": "https://github.com/symfony/polyfill-php80/tree/v1.27.0" + "source": "https://github.com/symfony/polyfill-php80/tree/v1.37.0" }, "funding": [ { @@ -9943,6 +10004,10 @@ "url": "https://github.com/fabpot", "type": "github" }, + { + "url": "https://github.com/nicolas-grekas", + "type": "github" + }, { "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", "type": "tidelift" @@ -10037,23 +10102,23 @@ }, { "name": "symfony/process", - "version": "v6.2.7", - "version_normalized": "6.2.7.0", + "version": "v6.4.41", + "version_normalized": "6.4.41.0", "source": { "type": "git", "url": "https://github.com/symfony/process.git", - "reference": "680e8a2ea6b3f87aecc07a6a65a203ae573d1902" + "reference": "c8fc09bdfe9fde9aaa89b415a4477feaccec16a7" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/process/zipball/680e8a2ea6b3f87aecc07a6a65a203ae573d1902", - "reference": "680e8a2ea6b3f87aecc07a6a65a203ae573d1902", + "url": "https://api.github.com/repos/symfony/process/zipball/c8fc09bdfe9fde9aaa89b415a4477feaccec16a7", + "reference": "c8fc09bdfe9fde9aaa89b415a4477feaccec16a7", "shasum": "" }, "require": { "php": ">=8.1" }, - "time": "2023-02-24T10:42:00+00:00", + "time": "2026-05-23T13:47:21+00:00", "type": "library", "installation-source": "dist", "autoload": { @@ -10081,7 +10146,7 @@ "description": "Executes commands in sub-processes", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/process/tree/v6.2.7" + "source": "https://github.com/symfony/process/tree/v6.4.41" }, "funding": [ { @@ -10092,6 +10157,10 @@ "url": "https://github.com/fabpot", "type": "github" }, + { + "url": "https://github.com/nicolas-grekas", + "type": "github" + }, { "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", "type": "tidelift" @@ -10192,38 +10261,36 @@ }, { "name": "symfony/service-contracts", - "version": "v3.2.1", - "version_normalized": "3.2.1.0", + "version": "v3.7.1", + "version_normalized": "3.7.1.0", "source": { "type": "git", "url": "https://github.com/symfony/service-contracts.git", - "reference": "a8c9cedf55f314f3a186041d19537303766df09a" + "reference": "c0a284bab1ed8aa0417e3d69250ab437739563a0" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/service-contracts/zipball/a8c9cedf55f314f3a186041d19537303766df09a", - "reference": "a8c9cedf55f314f3a186041d19537303766df09a", + "url": "https://api.github.com/repos/symfony/service-contracts/zipball/c0a284bab1ed8aa0417e3d69250ab437739563a0", + "reference": "c0a284bab1ed8aa0417e3d69250ab437739563a0", "shasum": "" }, "require": { "php": ">=8.1", - "psr/container": "^2.0" + "psr/container": "^1.1|^2.0", + "symfony/deprecation-contracts": "^2.5|^3" }, "conflict": { "ext-psr": "<1.1|>=2" }, - "suggest": { - "symfony/service-implementation": "" - }, - "time": "2023-03-01T10:32:47+00:00", + "time": "2026-06-16T09:55:08+00:00", "type": "library", "extra": { - "branch-alias": { - "dev-main": "3.3-dev" - }, "thanks": { - "name": "symfony/contracts", - "url": "https://github.com/symfony/contracts" + "url": "https://github.com/symfony/contracts", + "name": "symfony/contracts" + }, + "branch-alias": { + "dev-main": "3.7-dev" } }, "installation-source": "dist", @@ -10260,7 +10327,7 @@ "standards" ], "support": { - "source": "https://github.com/symfony/service-contracts/tree/v3.2.1" + "source": "https://github.com/symfony/service-contracts/tree/v3.7.1" }, "funding": [ { @@ -10271,6 +10338,10 @@ "url": "https://github.com/fabpot", "type": "github" }, + { + "url": "https://github.com/nicolas-grekas", + "type": "github" + }, { "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", "type": "tidelift" @@ -10280,37 +10351,38 @@ }, { "name": "symfony/string", - "version": "v6.2.7", - "version_normalized": "6.2.7.0", + "version": "v7.4.15", + "version_normalized": "7.4.15.0", "source": { "type": "git", "url": "https://github.com/symfony/string.git", - "reference": "67b8c1eec78296b85dc1c7d9743830160218993d" + "reference": "e394af32256bf9e7bf80849d95e589167c10097b" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/string/zipball/67b8c1eec78296b85dc1c7d9743830160218993d", - "reference": "67b8c1eec78296b85dc1c7d9743830160218993d", + "url": "https://api.github.com/repos/symfony/string/zipball/e394af32256bf9e7bf80849d95e589167c10097b", + "reference": "e394af32256bf9e7bf80849d95e589167c10097b", "shasum": "" }, "require": { - "php": ">=8.1", + "php": ">=8.2", + "symfony/deprecation-contracts": "^2.5|^3.0", "symfony/polyfill-ctype": "~1.8", - "symfony/polyfill-intl-grapheme": "~1.0", + "symfony/polyfill-intl-grapheme": "~1.33", "symfony/polyfill-intl-normalizer": "~1.0", "symfony/polyfill-mbstring": "~1.0" }, "conflict": { - "symfony/translation-contracts": "<2.0" + "symfony/translation-contracts": "<2.5" }, "require-dev": { - "symfony/error-handler": "^5.4|^6.0", - "symfony/http-client": "^5.4|^6.0", - "symfony/intl": "^6.2", - "symfony/translation-contracts": "^2.0|^3.0", - "symfony/var-exporter": "^5.4|^6.0" + "symfony/emoji": "^7.1|^8.0", + "symfony/http-client": "^6.4|^7.0|^8.0", + "symfony/intl": "^6.4|^7.0|^8.0", + "symfony/translation-contracts": "^2.5|^3.0", + "symfony/var-exporter": "^6.4|^7.0|^8.0" }, - "time": "2023-02-24T10:42:00+00:00", + "time": "2026-07-28T07:33:02+00:00", "type": "library", "installation-source": "dist", "autoload": { @@ -10349,7 +10421,7 @@ "utf8" ], "support": { - "source": "https://github.com/symfony/string/tree/v6.2.7" + "source": "https://github.com/symfony/string/tree/v7.4.15" }, "funding": [ { @@ -10360,6 +10432,10 @@ "url": "https://github.com/fabpot", "type": "github" }, + { + "url": "https://github.com/nicolas-grekas", + "type": "github" + }, { "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", "type": "tidelift" @@ -10470,34 +10546,31 @@ }, { "name": "symfony/translation-contracts", - "version": "v3.2.1", - "version_normalized": "3.2.1.0", + "version": "v3.7.1", + "version_normalized": "3.7.1.0", "source": { "type": "git", "url": "https://github.com/symfony/translation-contracts.git", - "reference": "dfec258b9dd17a6b24420d464c43bffe347441c8" + "reference": "ccb206b98faccc511ebae8e5fad50f2dc0b30621" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/translation-contracts/zipball/dfec258b9dd17a6b24420d464c43bffe347441c8", - "reference": "dfec258b9dd17a6b24420d464c43bffe347441c8", + "url": "https://api.github.com/repos/symfony/translation-contracts/zipball/ccb206b98faccc511ebae8e5fad50f2dc0b30621", + "reference": "ccb206b98faccc511ebae8e5fad50f2dc0b30621", "shasum": "" }, "require": { "php": ">=8.1" }, - "suggest": { - "symfony/translation-implementation": "" - }, - "time": "2023-03-01T10:32:47+00:00", + "time": "2026-06-05T06:23:12+00:00", "type": "library", "extra": { - "branch-alias": { - "dev-main": "3.3-dev" - }, "thanks": { - "name": "symfony/contracts", - "url": "https://github.com/symfony/contracts" + "url": "https://github.com/symfony/contracts", + "name": "symfony/contracts" + }, + "branch-alias": { + "dev-main": "3.7-dev" } }, "installation-source": "dist", @@ -10534,7 +10607,7 @@ "standards" ], "support": { - "source": "https://github.com/symfony/translation-contracts/tree/v3.2.1" + "source": "https://github.com/symfony/translation-contracts/tree/v3.7.1" }, "funding": [ { @@ -10545,6 +10618,10 @@ "url": "https://github.com/fabpot", "type": "github" }, + { + "url": "https://github.com/nicolas-grekas", + "type": "github" + }, { "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", "type": "tidelift" @@ -10799,17 +10876,17 @@ }, { "name": "theseer/tokenizer", - "version": "1.2.1", - "version_normalized": "1.2.1.0", + "version": "1.3.1", + "version_normalized": "1.3.1.0", "source": { "type": "git", "url": "https://github.com/theseer/tokenizer.git", - "reference": "34a41e998c2183e22995f158c581e7b5e755ab9e" + "reference": "b7489ce515e168639d17feec34b8847c326b0b3c" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/theseer/tokenizer/zipball/34a41e998c2183e22995f158c581e7b5e755ab9e", - "reference": "34a41e998c2183e22995f158c581e7b5e755ab9e", + "url": "https://api.github.com/repos/theseer/tokenizer/zipball/b7489ce515e168639d17feec34b8847c326b0b3c", + "reference": "b7489ce515e168639d17feec34b8847c326b0b3c", "shasum": "" }, "require": { @@ -10818,7 +10895,7 @@ "ext-xmlwriter": "*", "php": "^7.2 || ^8.0" }, - "time": "2021-07-28T10:34:58+00:00", + "time": "2025-11-17T20:03:58+00:00", "type": "library", "installation-source": "dist", "autoload": { @@ -10840,7 +10917,7 @@ "description": "A small library for converting tokenized PHP source code into XML and potentially other formats", "support": { "issues": "https://github.com/theseer/tokenizer/issues", - "source": "https://github.com/theseer/tokenizer/tree/1.2.1" + "source": "https://github.com/theseer/tokenizer/tree/1.3.1" }, "funding": [ { @@ -11380,12 +11457,6 @@ "barryvdh/laravel-ide-helper", "barryvdh/reflection-docblock", "brianium/paratest", - "cakephp/chronos", - "cakephp/core", - "cakephp/database", - "cakephp/datasource", - "cakephp/event", - "cakephp/utility", "composer/class-map-generator", "composer/pcre", "doctrine/cache", @@ -11398,7 +11469,6 @@ "hamcrest/hamcrest-php", "jean85/pretty-package-versions", "laravel/sail", - "league/container", "maximebf/debugbar", "mockery/mockery", "myclabs/deep-copy", @@ -11414,8 +11484,6 @@ "phpunit/php-timer", "phpunit/phpunit", "psr/cache", - "psr/clock", - "robmorgan/phinx", "sebastian/cli-parser", "sebastian/code-unit", "sebastian/code-unit-reverse-lookup", @@ -11435,8 +11503,6 @@ "spatie/flare-client-php", "spatie/ignition", "spatie/laravel-ignition", - "symfony/config", - "symfony/filesystem", "symfony/yaml", "theseer/tokenizer" ] diff --git a/vendor/composer/installed.php b/vendor/composer/installed.php index a9bbfbc8..217a8564 100644 --- a/vendor/composer/installed.php +++ b/vendor/composer/installed.php @@ -3,7 +3,7 @@ 'name' => 'loshmis/vanguard', 'pretty_version' => 'dev-master', 'version' => 'dev-master', - 'reference' => 'f7301024bc22b755aa9be32157a3f6184e380dfa', + 'reference' => '1ede9cc3af1f9af71f39bf845682059fb4c18431', 'type' => 'project', 'install_path' => __DIR__ . '/../../', 'aliases' => array(), @@ -56,9 +56,9 @@ 'dev_requirement' => true, ), 'brianium/paratest' => array( - 'pretty_version' => 'v7.1.1', - 'version' => '7.1.1.0', - 'reference' => 'abc123183e90f33ce1312b5bfaa49d80d8c646b2', + 'pretty_version' => 'v7.4.9', + 'version' => '7.4.9.0', + 'reference' => '633c0987ecf6d9b057431225da37b088aa9274a5', 'type' => 'library', 'install_path' => __DIR__ . '/../brianium/paratest', 'aliases' => array(), @@ -80,7 +80,7 @@ 'type' => 'library', 'install_path' => __DIR__ . '/../cakephp/chronos', 'aliases' => array(), - 'dev_requirement' => true, + 'dev_requirement' => false, ), 'cakephp/core' => array( 'pretty_version' => '5.4.1', @@ -89,7 +89,7 @@ 'type' => 'library', 'install_path' => __DIR__ . '/../cakephp/core', 'aliases' => array(), - 'dev_requirement' => true, + 'dev_requirement' => false, ), 'cakephp/database' => array( 'pretty_version' => '5.4.1', @@ -98,7 +98,7 @@ 'type' => 'library', 'install_path' => __DIR__ . '/../cakephp/database', 'aliases' => array(), - 'dev_requirement' => true, + 'dev_requirement' => false, ), 'cakephp/datasource' => array( 'pretty_version' => '5.4.1', @@ -107,7 +107,7 @@ 'type' => 'library', 'install_path' => __DIR__ . '/../cakephp/datasource', 'aliases' => array(), - 'dev_requirement' => true, + 'dev_requirement' => false, ), 'cakephp/event' => array( 'pretty_version' => '5.4.1', @@ -116,7 +116,7 @@ 'type' => 'library', 'install_path' => __DIR__ . '/../cakephp/event', 'aliases' => array(), - 'dev_requirement' => true, + 'dev_requirement' => false, ), 'cakephp/utility' => array( 'pretty_version' => '5.4.1', @@ -125,7 +125,7 @@ 'type' => 'library', 'install_path' => __DIR__ . '/../cakephp/utility', 'aliases' => array(), - 'dev_requirement' => true, + 'dev_requirement' => false, ), 'composer/class-map-generator' => array( 'pretty_version' => '1.0.0', @@ -158,9 +158,9 @@ ), ), 'dflydev/dot-access-data' => array( - 'pretty_version' => 'v3.0.2', - 'version' => '3.0.2.0', - 'reference' => 'f41715465d65213d644d3141a6a93081be5d3549', + 'pretty_version' => 'v3.0.3', + 'version' => '3.0.3.0', + 'reference' => 'a23a2bf4f31d3518f3ecb38660c95715dfead60f', 'type' => 'library', 'install_path' => __DIR__ . '/../dflydev/dot-access-data', 'aliases' => array(), @@ -248,9 +248,9 @@ 'dev_requirement' => true, ), 'fidry/cpu-core-counter' => array( - 'pretty_version' => '0.5.1', - 'version' => '0.5.1.0', - 'reference' => 'b58e5a3933e541dc286cc91fc4f3898bbc6f1623', + 'pretty_version' => '1.3.0', + 'version' => '1.3.0.0', + 'reference' => 'db9508f7b1474469d9d3c53b86f817e344732678', 'type' => 'library', 'install_path' => __DIR__ . '/../fidry/cpu-core-counter', 'aliases' => array(), @@ -545,9 +545,9 @@ 'dev_requirement' => false, ), 'jean85/pretty-package-versions' => array( - 'pretty_version' => '2.0.5', - 'version' => '2.0.5.0', - 'reference' => 'ae547e455a3d8babd07b96966b17d7fd21d9c6af', + 'pretty_version' => '2.1.1', + 'version' => '2.1.1.0', + 'reference' => '4d7aa5dab42e2a76d99559706022885de0e18e1a', 'type' => 'library', 'install_path' => __DIR__ . '/../jean85/pretty-package-versions', 'aliases' => array(), @@ -674,7 +674,7 @@ 'type' => 'library', 'install_path' => __DIR__ . '/../league/container', 'aliases' => array(), - 'dev_requirement' => true, + 'dev_requirement' => false, ), 'league/flysystem' => array( 'pretty_version' => '3.12.3', @@ -706,7 +706,7 @@ 'loshmis/vanguard' => array( 'pretty_version' => 'dev-master', 'version' => 'dev-master', - 'reference' => 'f7301024bc22b755aa9be32157a3f6184e380dfa', + 'reference' => '1ede9cc3af1f9af71f39bf845682059fb4c18431', 'type' => 'project', 'install_path' => __DIR__ . '/../../', 'aliases' => array(), @@ -755,9 +755,9 @@ ), ), 'myclabs/deep-copy' => array( - 'pretty_version' => '1.11.1', - 'version' => '1.11.1.0', - 'reference' => '7284c22080590fb39f2ffa3e9057f10a4ddd0e0c', + 'pretty_version' => '1.13.4', + 'version' => '1.13.4.0', + 'reference' => '07d290f0c47959fd5eed98c95ee5602db07e0b6a', 'type' => 'library', 'install_path' => __DIR__ . '/../myclabs/deep-copy', 'aliases' => array(), @@ -773,27 +773,27 @@ 'dev_requirement' => false, ), 'nette/schema' => array( - 'pretty_version' => 'v1.2.3', - 'version' => '1.2.3.0', - 'reference' => 'abbdbb70e0245d5f3bf77874cea1dfb0c930d06f', + 'pretty_version' => 'v1.3.5', + 'version' => '1.3.5.0', + 'reference' => 'f0ab1a3cda782dbc5da270d28545236aa80c4002', 'type' => 'library', 'install_path' => __DIR__ . '/../nette/schema', 'aliases' => array(), 'dev_requirement' => false, ), 'nette/utils' => array( - 'pretty_version' => 'v4.0.0', - 'version' => '4.0.0.0', - 'reference' => 'cacdbf5a91a657ede665c541eda28941d4b09c1e', + 'pretty_version' => 'v4.1.5', + 'version' => '4.1.5.0', + 'reference' => 'b043439dbdf954e6c28b5ea7e34b0100f83165e0', 'type' => 'library', 'install_path' => __DIR__ . '/../nette/utils', 'aliases' => array(), 'dev_requirement' => false, ), 'nikic/php-parser' => array( - 'pretty_version' => 'v4.15.4', - 'version' => '4.15.4.0', - 'reference' => '6bb5176bc4af8bcb7d926f88718db9b96a2d4290', + 'pretty_version' => 'v4.19.5', + 'version' => '4.19.5.0', + 'reference' => '51bd93cc741b7fc3d63d20b6bdcd99fdaa359837', 'type' => 'library', 'install_path' => __DIR__ . '/../nikic/php-parser', 'aliases' => array(), @@ -818,15 +818,15 @@ 'dev_requirement' => false, ), 'orno/di' => array( - 'dev_requirement' => true, + 'dev_requirement' => false, 'replaced' => array( 0 => '~2.0', ), ), 'phar-io/manifest' => array( - 'pretty_version' => '2.0.3', - 'version' => '2.0.3.0', - 'reference' => '97803eca37d319dfa7826cc2437fc020857acb53', + 'pretty_version' => '2.0.4', + 'version' => '2.0.4.0', + 'reference' => '54750ef60c58e43759730615a392c31c80e23176', 'type' => 'library', 'install_path' => __DIR__ . '/../phar-io/manifest', 'aliases' => array(), @@ -878,18 +878,18 @@ 'dev_requirement' => false, ), 'phpunit/php-code-coverage' => array( - 'pretty_version' => '10.0.2', - 'version' => '10.0.2.0', - 'reference' => '20800e84296ea4732f9a125e08ce86b4004ae3e4', + 'pretty_version' => '10.1.16', + 'version' => '10.1.16.0', + 'reference' => '7e308268858ed6baedc8704a304727d20bc07c77', 'type' => 'library', 'install_path' => __DIR__ . '/../phpunit/php-code-coverage', 'aliases' => array(), 'dev_requirement' => true, ), 'phpunit/php-file-iterator' => array( - 'pretty_version' => '4.0.1', - 'version' => '4.0.1.0', - 'reference' => 'fd9329ab3368f59fe1fe808a189c51086bd4b6bd', + 'pretty_version' => '4.1.0', + 'version' => '4.1.0.0', + 'reference' => 'a95037b6d9e608ba092da1b23931e537cadc3c3c', 'type' => 'library', 'install_path' => __DIR__ . '/../phpunit/php-file-iterator', 'aliases' => array(), @@ -905,9 +905,9 @@ 'dev_requirement' => true, ), 'phpunit/php-text-template' => array( - 'pretty_version' => '3.0.0', - 'version' => '3.0.0.0', - 'reference' => '9f3d3709577a527025f55bcf0f7ab8052c8bb37d', + 'pretty_version' => '3.0.1', + 'version' => '3.0.1.0', + 'reference' => '0c7b06ff49e3d5072f057eb1fa59258bf287a748', 'type' => 'library', 'install_path' => __DIR__ . '/../phpunit/php-text-template', 'aliases' => array(), @@ -923,9 +923,9 @@ 'dev_requirement' => true, ), 'phpunit/phpunit' => array( - 'pretty_version' => '10.0.16', - 'version' => '10.0.16.0', - 'reference' => '07d386a11ac7094032900f07cada1c8975d16607', + 'pretty_version' => '10.5.64', + 'version' => '10.5.64.0', + 'reference' => '0e8c1d19cea35ad97d4887f363d07c78e30fbf06', 'type' => 'library', 'install_path' => __DIR__ . '/../phpunit/phpunit', 'aliases' => array(), @@ -956,10 +956,10 @@ 'type' => 'library', 'install_path' => __DIR__ . '/../psr/clock', 'aliases' => array(), - 'dev_requirement' => true, + 'dev_requirement' => false, ), 'psr/clock-implementation' => array( - 'dev_requirement' => true, + 'dev_requirement' => false, 'provided' => array( 0 => '1.0', ), @@ -1042,9 +1042,9 @@ ), ), 'psr/log' => array( - 'pretty_version' => '3.0.0', - 'version' => '3.0.0.0', - 'reference' => 'fe5ea303b0887d5caefd3d431c3e61ad47037001', + 'pretty_version' => '3.0.2', + 'version' => '3.0.2.0', + 'reference' => 'f16e1d5863e37f8d8c2a01719f5b34baa2b714d3', 'type' => 'library', 'install_path' => __DIR__ . '/../psr/log', 'aliases' => array(), @@ -1121,12 +1121,12 @@ 'type' => 'library', 'install_path' => __DIR__ . '/../robmorgan/phinx', 'aliases' => array(), - 'dev_requirement' => true, + 'dev_requirement' => false, ), 'sebastian/cli-parser' => array( - 'pretty_version' => '2.0.0', - 'version' => '2.0.0.0', - 'reference' => 'efdc130dbbbb8ef0b545a994fd811725c5282cae', + 'pretty_version' => '2.0.1', + 'version' => '2.0.1.0', + 'reference' => 'c34583b87e7b7a8055bf6c450c2c77ce32a24084', 'type' => 'library', 'install_path' => __DIR__ . '/../sebastian/cli-parser', 'aliases' => array(), @@ -1151,63 +1151,63 @@ 'dev_requirement' => true, ), 'sebastian/comparator' => array( - 'pretty_version' => '5.0.0', - 'version' => '5.0.0.0', - 'reference' => '72f01e6586e0caf6af81297897bd112eb7e9627c', + 'pretty_version' => '5.0.5', + 'version' => '5.0.5.0', + 'reference' => '55dfef806eb7dfeb6e7a6935601fef866f8ca48d', 'type' => 'library', 'install_path' => __DIR__ . '/../sebastian/comparator', 'aliases' => array(), 'dev_requirement' => true, ), 'sebastian/complexity' => array( - 'pretty_version' => '3.0.0', - 'version' => '3.0.0.0', - 'reference' => 'e67d240970c9dc7ea7b2123a6d520e334dd61dc6', + 'pretty_version' => '3.2.0', + 'version' => '3.2.0.0', + 'reference' => '68ff824baeae169ec9f2137158ee529584553799', 'type' => 'library', 'install_path' => __DIR__ . '/../sebastian/complexity', 'aliases' => array(), 'dev_requirement' => true, ), 'sebastian/diff' => array( - 'pretty_version' => '5.0.0', - 'version' => '5.0.0.0', - 'reference' => '70dd1b20bc198da394ad542e988381b44e64e39f', + 'pretty_version' => '5.1.1', + 'version' => '5.1.1.0', + 'reference' => 'c41e007b4b62af48218231d6c2275e4c9b975b2e', 'type' => 'library', 'install_path' => __DIR__ . '/../sebastian/diff', 'aliases' => array(), 'dev_requirement' => true, ), 'sebastian/environment' => array( - 'pretty_version' => '6.0.0', - 'version' => '6.0.0.0', - 'reference' => 'b6f3694c6386c7959915a0037652e0c40f6f69cc', + 'pretty_version' => '6.1.0', + 'version' => '6.1.0.0', + 'reference' => '8074dbcd93529b357029f5cc5058fd3e43666984', 'type' => 'library', 'install_path' => __DIR__ . '/../sebastian/environment', 'aliases' => array(), 'dev_requirement' => true, ), 'sebastian/exporter' => array( - 'pretty_version' => '5.0.0', - 'version' => '5.0.0.0', - 'reference' => 'f3ec4bf931c0b31e5b413f5b4fc970a7d03338c0', + 'pretty_version' => '5.1.4', + 'version' => '5.1.4.0', + 'reference' => '0735b90f4da94969541dac1da743446e276defa6', 'type' => 'library', 'install_path' => __DIR__ . '/../sebastian/exporter', 'aliases' => array(), 'dev_requirement' => true, ), 'sebastian/global-state' => array( - 'pretty_version' => '6.0.0', - 'version' => '6.0.0.0', - 'reference' => 'aab257c712de87b90194febd52e4d184551c2d44', + 'pretty_version' => '6.0.2', + 'version' => '6.0.2.0', + 'reference' => '987bafff24ecc4c9ac418cab1145b96dd6e9cbd9', 'type' => 'library', 'install_path' => __DIR__ . '/../sebastian/global-state', 'aliases' => array(), 'dev_requirement' => true, ), 'sebastian/lines-of-code' => array( - 'pretty_version' => '2.0.0', - 'version' => '2.0.0.0', - 'reference' => '17c4d940ecafb3d15d2cf916f4108f664e28b130', + 'pretty_version' => '2.0.2', + 'version' => '2.0.2.0', + 'reference' => '856e7f6a75a84e339195d48c556f23be2ebf75d0', 'type' => 'library', 'install_path' => __DIR__ . '/../sebastian/lines-of-code', 'aliases' => array(), @@ -1232,9 +1232,9 @@ 'dev_requirement' => true, ), 'sebastian/recursion-context' => array( - 'pretty_version' => '5.0.0', - 'version' => '5.0.0.0', - 'reference' => '05909fb5bc7df4c52992396d0116aed689f93712', + 'pretty_version' => '5.0.1', + 'version' => '5.0.1.0', + 'reference' => '47e34210757a2f37a97dcd207d032e1b01e64c7a', 'type' => 'library', 'install_path' => __DIR__ . '/../sebastian/recursion-context', 'aliases' => array(), @@ -1319,12 +1319,12 @@ 'type' => 'library', 'install_path' => __DIR__ . '/../symfony/config', 'aliases' => array(), - 'dev_requirement' => true, + 'dev_requirement' => false, ), 'symfony/console' => array( - 'pretty_version' => 'v6.2.7', - 'version' => '6.2.7.0', - 'reference' => 'cbad09eb8925b6ad4fb721c7a179344dc4a19d45', + 'pretty_version' => 'v6.4.43', + 'version' => '6.4.43.0', + 'reference' => '3b643aa587acbc42f967a429af088a56ed8f046d', 'type' => 'library', 'install_path' => __DIR__ . '/../symfony/console', 'aliases' => array(), @@ -1340,9 +1340,9 @@ 'dev_requirement' => false, ), 'symfony/deprecation-contracts' => array( - 'pretty_version' => 'v3.2.1', - 'version' => '3.2.1.0', - 'reference' => 'e2d1534420bd723d0ef5aec58a22c5fe60ce6f5e', + 'pretty_version' => 'v3.7.1', + 'version' => '3.7.1.0', + 'reference' => 'f3202fa1b5097b0af062dc978b32ecf63404e31d', 'type' => 'library', 'install_path' => __DIR__ . '/../symfony/deprecation-contracts', 'aliases' => array(), @@ -1367,9 +1367,9 @@ 'dev_requirement' => false, ), 'symfony/event-dispatcher-contracts' => array( - 'pretty_version' => 'v3.2.1', - 'version' => '3.2.1.0', - 'reference' => '0ad3b6f1e4e2da5690fefe075cd53a238646d8dd', + 'pretty_version' => 'v3.7.1', + 'version' => '3.7.1.0', + 'reference' => 'c7de7a00ffb67842132da02ea92988a39ccd9f4e', 'type' => 'library', 'install_path' => __DIR__ . '/../symfony/event-dispatcher-contracts', 'aliases' => array(), @@ -1388,7 +1388,7 @@ 'type' => 'library', 'install_path' => __DIR__ . '/../symfony/filesystem', 'aliases' => array(), - 'dev_requirement' => true, + 'dev_requirement' => false, ), 'symfony/finder' => array( 'pretty_version' => 'v6.2.7', @@ -1436,18 +1436,18 @@ 'dev_requirement' => false, ), 'symfony/polyfill-ctype' => array( - 'pretty_version' => 'v1.27.0', - 'version' => '1.27.0.0', - 'reference' => '5bbc823adecdae860bb64756d639ecfec17b050a', + 'pretty_version' => 'v1.37.0', + 'version' => '1.37.0.0', + 'reference' => '141046a8f9477948ff284fa65be2095baafb94f2', 'type' => 'library', 'install_path' => __DIR__ . '/../symfony/polyfill-ctype', 'aliases' => array(), 'dev_requirement' => false, ), 'symfony/polyfill-intl-grapheme' => array( - 'pretty_version' => 'v1.27.0', - 'version' => '1.27.0.0', - 'reference' => '511a08c03c1960e08a883f4cffcacd219b758354', + 'pretty_version' => 'v1.41.0', + 'version' => '1.41.0.0', + 'reference' => 'bb899c1db0aa8127dc3afe8cda4a67eb24915f8d', 'type' => 'library', 'install_path' => __DIR__ . '/../symfony/polyfill-intl-grapheme', 'aliases' => array(), @@ -1463,18 +1463,18 @@ 'dev_requirement' => false, ), 'symfony/polyfill-intl-normalizer' => array( - 'pretty_version' => 'v1.27.0', - 'version' => '1.27.0.0', - 'reference' => '19bd1e4fcd5b91116f14d8533c57831ed00571b6', + 'pretty_version' => 'v1.38.0', + 'version' => '1.38.0.0', + 'reference' => '2d446c214bdbe5b71bde5011b060a05fece3ae6b', 'type' => 'library', 'install_path' => __DIR__ . '/../symfony/polyfill-intl-normalizer', 'aliases' => array(), 'dev_requirement' => false, ), 'symfony/polyfill-mbstring' => array( - 'pretty_version' => 'v1.27.0', - 'version' => '1.27.0.0', - 'reference' => '8ad114f6b39e2c98a8b0e3bd907732c207c2b534', + 'pretty_version' => 'v1.38.2', + 'version' => '1.38.2.0', + 'reference' => 'd3d318bad5e7a1bfbd026009c8bfb8d8f99ae6b6', 'type' => 'library', 'install_path' => __DIR__ . '/../symfony/polyfill-mbstring', 'aliases' => array(), @@ -1490,9 +1490,9 @@ 'dev_requirement' => false, ), 'symfony/polyfill-php80' => array( - 'pretty_version' => 'v1.27.0', - 'version' => '1.27.0.0', - 'reference' => '7a6ff3f1959bb01aefccb463a0f2cd3d3d2fd936', + 'pretty_version' => 'v1.37.0', + 'version' => '1.37.0.0', + 'reference' => 'dfb55726c3a76ea3b6459fcfda1ec2d80a682411', 'type' => 'library', 'install_path' => __DIR__ . '/../symfony/polyfill-php80', 'aliases' => array(), @@ -1508,9 +1508,9 @@ 'dev_requirement' => false, ), 'symfony/process' => array( - 'pretty_version' => 'v6.2.7', - 'version' => '6.2.7.0', - 'reference' => '680e8a2ea6b3f87aecc07a6a65a203ae573d1902', + 'pretty_version' => 'v6.4.41', + 'version' => '6.4.41.0', + 'reference' => 'c8fc09bdfe9fde9aaa89b415a4477feaccec16a7', 'type' => 'library', 'install_path' => __DIR__ . '/../symfony/process', 'aliases' => array(), @@ -1526,18 +1526,18 @@ 'dev_requirement' => false, ), 'symfony/service-contracts' => array( - 'pretty_version' => 'v3.2.1', - 'version' => '3.2.1.0', - 'reference' => 'a8c9cedf55f314f3a186041d19537303766df09a', + 'pretty_version' => 'v3.7.1', + 'version' => '3.7.1.0', + 'reference' => 'c0a284bab1ed8aa0417e3d69250ab437739563a0', 'type' => 'library', 'install_path' => __DIR__ . '/../symfony/service-contracts', 'aliases' => array(), 'dev_requirement' => false, ), 'symfony/string' => array( - 'pretty_version' => 'v6.2.7', - 'version' => '6.2.7.0', - 'reference' => '67b8c1eec78296b85dc1c7d9743830160218993d', + 'pretty_version' => 'v7.4.15', + 'version' => '7.4.15.0', + 'reference' => 'e394af32256bf9e7bf80849d95e589167c10097b', 'type' => 'library', 'install_path' => __DIR__ . '/../symfony/string', 'aliases' => array(), @@ -1553,9 +1553,9 @@ 'dev_requirement' => false, ), 'symfony/translation-contracts' => array( - 'pretty_version' => 'v3.2.1', - 'version' => '3.2.1.0', - 'reference' => 'dfec258b9dd17a6b24420d464c43bffe347441c8', + 'pretty_version' => 'v3.7.1', + 'version' => '3.7.1.0', + 'reference' => 'ccb206b98faccc511ebae8e5fad50f2dc0b30621', 'type' => 'library', 'install_path' => __DIR__ . '/../symfony/translation-contracts', 'aliases' => array(), @@ -1595,9 +1595,9 @@ 'dev_requirement' => true, ), 'theseer/tokenizer' => array( - 'pretty_version' => '1.2.1', - 'version' => '1.2.1.0', - 'reference' => '34a41e998c2183e22995f158c581e7b5e755ab9e', + 'pretty_version' => '1.3.1', + 'version' => '1.3.1.0', + 'reference' => 'b7489ce515e168639d17feec34b8847c326b0b3c', 'type' => 'library', 'install_path' => __DIR__ . '/../theseer/tokenizer', 'aliases' => array(), diff --git a/vendor/composer/platform_check.php b/vendor/composer/platform_check.php index 2beb1491..87484392 100644 --- a/vendor/composer/platform_check.php +++ b/vendor/composer/platform_check.php @@ -4,8 +4,12 @@ $issues = array(); -if (!(PHP_VERSION_ID >= 80100)) { - $issues[] = 'Your Composer dependencies require a PHP version ">= 8.1.0". You are running ' . PHP_VERSION . '.'; +if (!(PHP_VERSION_ID >= 80200)) { + $issues[] = 'Your Composer dependencies require a PHP version ">= 8.2.0". You are running ' . PHP_VERSION . '.'; +} + +if (PHP_INT_SIZE !== 8) { + $issues[] = 'Your Composer dependencies require a 64-bit build of PHP.'; } if ($issues) { diff --git a/vendor/dflydev/dot-access-data/CHANGELOG.md b/vendor/dflydev/dot-access-data/CHANGELOG.md index 8e92c238..b8b468d7 100644 --- a/vendor/dflydev/dot-access-data/CHANGELOG.md +++ b/vendor/dflydev/dot-access-data/CHANGELOG.md @@ -7,6 +7,12 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] +## [3.0.3] - 2024-07-08 + +### Fixed + + - Fixed PHP 8.4 deprecation notices (#47) + ## [3.0.2] - 2022-10-27 ### Fixed @@ -57,7 +63,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 **Initial release!** -[Unreleased]: https://github.com/dflydev/dflydev-dot-access-data/compare/v3.0.2...main +[Unreleased]: https://github.com/dflydev/dflydev-dot-access-data/compare/v3.0.3...main +[3.0.3]: https://github.com/dflydev/dflydev-dot-access-data/compare/v3.0.2...v3.0.3 [3.0.2]: https://github.com/dflydev/dflydev-dot-access-data/compare/v3.0.1...v3.0.2 [3.0.1]: https://github.com/dflydev/dflydev-dot-access-data/compare/v3.0.0...v3.0.1 [3.0.0]: https://github.com/dflydev/dflydev-dot-access-data/compare/v2.0.0...v3.0.0 diff --git a/vendor/dflydev/dot-access-data/src/Exception/MissingPathException.php b/vendor/dflydev/dot-access-data/src/Exception/MissingPathException.php index 7b1d7588..92577e78 100644 --- a/vendor/dflydev/dot-access-data/src/Exception/MissingPathException.php +++ b/vendor/dflydev/dot-access-data/src/Exception/MissingPathException.php @@ -23,7 +23,7 @@ class MissingPathException extends DataException /** @var string */ protected $path; - public function __construct(string $path, string $message = '', int $code = 0, Throwable $previous = null) + public function __construct(string $path, string $message = '', int $code = 0, ?Throwable $previous = null) { $this->path = $path; diff --git a/vendor/fidry/cpu-core-counter/README.md b/vendor/fidry/cpu-core-counter/README.md index 8c86a187..6b554d2e 100644 --- a/vendor/fidry/cpu-core-counter/README.md +++ b/vendor/fidry/cpu-core-counter/README.md @@ -16,6 +16,10 @@ use Fidry\CpuCoreCounter\Finder\DummyCpuCoreFinder; $counter = new CpuCoreCounter(); +// For knowing the number of cores you can use for launching parallel processes: +$counter->getAvailableForParallelisation()->availableCpus; + +// Get the number of CPU cores (by default it will use the logical cores count): try { $counter->getCount(); // e.g. 8 } catch (NumberOfCpuCoreNotFound) { @@ -29,6 +33,10 @@ $counter = new CpuCoreCounter([ new DummyCpuCoreFinder(1), // Fallback value ]); +// A type-safe alternative form: +$counter->getCountWithFallback(1); + +// Note that the result is memoized. $counter->getCount(); // e.g. 8 ``` @@ -68,30 +76,46 @@ $cores = (new CpuCoreCounter($finders))->getCount(); `FinderRegistry` provides two helpful entries: - `::getDefaultLogicalFinders()`: gives an ordered list of finders that will - look for the _logical_ CPU cores count + look for the _logical_ CPU cores count. - `::getDefaultPhysicalFinders()`: gives an ordered list of finders that will - look for the _physical_ CPU cores count + look for the _physical_ CPU cores count. -By default when using `CpuCoreCounter`, it will use the logical finders since +By default, when using `CpuCoreCounter`, it will use the logical finders since it is more likely what you are looking for and is what is used by PHP source to build the PHP binary. ### Checks what finders find what on your system -You have two commands available that provides insight about what the finders +You have three scrips available that provides insight about what the finders can find: -``` -$ make diagnosis # From this repository -$ ./vendor/fidry/cpu-core-counter/bin/diagnose.php # From the library +```shell +# Checks what each given finder will find on your system with details about the +# information it had. +make diagnose # From this repository +./vendor/fidry/cpu-core-counter/bin/diagnose.php # From the library ``` And: +```shell +# Execute all finders and display the result they found. +make execute # From this repository +./vendor/fidry/cpu-core-counter/bin/execute.php # From the library ``` -$ make execute # From this repository -$ ./vendor/fidry/cpu-core-counter/bin/execute.php # From the library -``` + + +### Debug the results found + +You have 3 methods available to help you find out what happened: + +1. If you are using the default configuration of finder registries, you can check + the previous section which will provide plenty of information. +2. If what you are interested in is how many CPU cores were found, you can use + the `CpuCoreCounter::trace()` method. +3. If what you are interested in is how the calculation of CPU cores available + for parallelisation was done, you can inspect the values of `ParallelisationResult` + returned by `CpuCoreCounter::getAvailableForParallelisation()`. ## Backward Compatibility Promise (BCP) diff --git a/vendor/fidry/cpu-core-counter/bin/diagnose.php b/vendor/fidry/cpu-core-counter/bin/diagnose.php index ec589e31..7dd894a1 100644 --- a/vendor/fidry/cpu-core-counter/bin/diagnose.php +++ b/vendor/fidry/cpu-core-counter/bin/diagnose.php @@ -19,3 +19,9 @@ require_once __DIR__.'/../vendor/autoload.php'; echo 'Running diagnosis...'.PHP_EOL.PHP_EOL; echo Diagnoser::diagnose(FinderRegistry::getAllVariants()).PHP_EOL; + +echo 'Logical CPU cores finders...'.PHP_EOL.PHP_EOL; +echo Diagnoser::diagnose(FinderRegistry::getDefaultLogicalFinders()).PHP_EOL; + +echo 'Physical CPU cores finders...'.PHP_EOL.PHP_EOL; +echo Diagnoser::diagnose(FinderRegistry::getDefaultPhysicalFinders()).PHP_EOL; diff --git a/vendor/fidry/cpu-core-counter/composer.json b/vendor/fidry/cpu-core-counter/composer.json index 2ddaf525..6ca8df6a 100644 --- a/vendor/fidry/cpu-core-counter/composer.json +++ b/vendor/fidry/cpu-core-counter/composer.json @@ -18,13 +18,13 @@ }, "require-dev": { "fidry/makefile": "^0.2.0", + "fidry/php-cs-fixer-config": "^1.1.2", "phpstan/extension-installer": "^1.2.0", - "phpstan/phpstan": "^1.9.2", - "phpstan/phpstan-deprecation-rules": "^1.0.0", - "phpstan/phpstan-phpunit": "^1.2.2", - "phpstan/phpstan-strict-rules": "^1.4.4", - "phpunit/phpunit": "^9.5.26 || ^8.5.31", - "theofidry/php-cs-fixer-config": "^1.0", + "phpstan/phpstan": "^2.0", + "phpstan/phpstan-deprecation-rules": "^2.0.0", + "phpstan/phpstan-phpunit": "^2.0", + "phpstan/phpstan-strict-rules": "^2.0", + "phpunit/phpunit": "^8.5.31 || ^9.5.26", "webmozarts/strict-phpunit": "^7.5" }, "autoload": { diff --git a/vendor/fidry/cpu-core-counter/src/CpuCoreCounter.php b/vendor/fidry/cpu-core-counter/src/CpuCoreCounter.php index 098693b5..d1150316 100644 --- a/vendor/fidry/cpu-core-counter/src/CpuCoreCounter.php +++ b/vendor/fidry/cpu-core-counter/src/CpuCoreCounter.php @@ -14,7 +14,14 @@ declare(strict_types=1); namespace Fidry\CpuCoreCounter; use Fidry\CpuCoreCounter\Finder\CpuCoreFinder; +use Fidry\CpuCoreCounter\Finder\EnvVariableFinder; use Fidry\CpuCoreCounter\Finder\FinderRegistry; +use InvalidArgumentException; +use function implode; +use function max; +use function sprintf; +use function sys_getloadavg; +use const PHP_EOL; final class CpuCoreCounter { @@ -36,6 +43,91 @@ final class CpuCoreCounter $this->finders = $finders ?? FinderRegistry::getDefaultLogicalFinders(); } + /** + * @param positive-int|0 $reservedCpus Number of CPUs to reserve. This is useful when you want + * to reserve some CPUs for other processes. If the main + * process is going to be busy still, you may want to set + * this value to 1. + * @param non-zero-int|null $countLimit The maximum number of CPUs to return. If not provided, it + * may look for a limit in the environment variables, e.g. + * KUBERNETES_CPU_LIMIT. If negative, the limit will be + * the total number of cores found minus the absolute value. + * For instance if the system has 10 cores and countLimit=-2, + * then the effective limit considered will be 8. + * @param float|null $loadLimit Element of [0., 1.]. Percentage representing the + * amount of cores that should be used among the available + * resources. For instance, if set to 0.7, it will use 70% + * of the available cores, i.e. if 1 core is reserved, 11 + * cores are available and 5 are busy, it will use 70% + * of (11-1-5)=5 cores, so 3 cores. Set this parameter to null + * to skip this check. Beware that 1 does not mean "no limit", + * but 100% of the _available_ resources, i.e. with the + * previous example, it will return 5 cores. How busy is + * the system is determined by the system load average + * (see $systemLoadAverage). + * @param float|null $systemLoadAverage The system load average. If passed, it will use + * this information to limit the available cores based + * on the _available_ resources. For instance, if there + * is 10 cores but 3 are busy, then only 7 cores will + * be considered for further calculation. If set to + * `null`, it will use `sys_getloadavg()` to check the + * load of the system in the past minute. You can + * otherwise pass an arbitrary value. Should be a + * positive float. + * + * @see https://php.net/manual/en/function.sys-getloadavg.php + */ + public function getAvailableForParallelisation( + int $reservedCpus = 0, + ?int $countLimit = null, + ?float $loadLimit = null, + ?float $systemLoadAverage = 0. + ): ParallelisationResult { + self::checkCountLimit($countLimit); + self::checkLoadLimit($loadLimit); + self::checkSystemLoadAverage($systemLoadAverage); + + $totalCoreCount = $this->getCountWithFallback(1); + $availableCores = max(1, $totalCoreCount - $reservedCpus); + + // Adjust available CPUs based on current load + if (null !== $loadLimit) { + // https://github.com/phpstan/phpstan/issues/13198 + /** @var float $correctedSystemLoadAverage */ + $correctedSystemLoadAverage = null === $systemLoadAverage + ? sys_getloadavg()[0] ?? 0. + : $systemLoadAverage; + + $availableCores = max( + 1, + $loadLimit * ($availableCores - $correctedSystemLoadAverage) + ); + } + + if (null === $countLimit) { + $correctedCountLimit = self::getKubernetesLimit(); + } else { + $correctedCountLimit = $countLimit > 0 + ? $countLimit + : max(1, $totalCoreCount + $countLimit); + } + + if (null !== $correctedCountLimit && $availableCores > $correctedCountLimit) { + $availableCores = $correctedCountLimit; + } + + return new ParallelisationResult( + $reservedCpus, + $countLimit, + $loadLimit, + $systemLoadAverage, + $correctedCountLimit, + $correctedSystemLoadAverage ?? $systemLoadAverage, + $totalCoreCount, + (int) $availableCores + ); + } + /** * @throws NumberOfCpuCoreNotFound * @@ -51,6 +143,48 @@ final class CpuCoreCounter return $this->count; } + /** + * @param positive-int $fallback + * + * @return positive-int + */ + public function getCountWithFallback(int $fallback): int + { + try { + return $this->getCount(); + } catch (NumberOfCpuCoreNotFound $exception) { + return $fallback; + } + } + + /** + * This method is mostly for debugging purposes. + */ + public function trace(): string + { + $output = []; + + foreach ($this->finders as $finder) { + $output[] = sprintf( + 'Executing the finder "%s":', + $finder->toString() + ); + $output[] = $finder->diagnose(); + + $cores = $finder->find(); + + if (null !== $cores) { + $output[] = 'Result found: '.$cores; + + break; + } + + $output[] = '–––'; + } + + return implode(PHP_EOL, $output); + } + /** * @throws NumberOfCpuCoreNotFound * @@ -86,4 +220,51 @@ final class CpuCoreCounter throw NumberOfCpuCoreNotFound::create(); } + + /** + * @return positive-int|null + */ + public static function getKubernetesLimit(): ?int + { + $finder = new EnvVariableFinder('KUBERNETES_CPU_LIMIT'); + + return $finder->find(); + } + + private static function checkCountLimit(?int $countLimit): void + { + if (0 === $countLimit) { + throw new InvalidArgumentException( + 'The count limit must be a non zero integer. Got "0".' + ); + } + } + + private static function checkLoadLimit(?float $loadLimit): void + { + if (null === $loadLimit) { + return; + } + + if ($loadLimit < 0. || $loadLimit > 1.) { + throw new InvalidArgumentException( + sprintf( + 'The load limit must be in the range [0., 1.], got "%s".', + $loadLimit + ) + ); + } + } + + private static function checkSystemLoadAverage(?float $systemLoadAverage): void + { + if (null !== $systemLoadAverage && $systemLoadAverage < 0.) { + throw new InvalidArgumentException( + sprintf( + 'The system load average must be a positive float, got "%s".', + $systemLoadAverage + ) + ); + } + } } diff --git a/vendor/fidry/cpu-core-counter/src/Executor/ProcOpenExecutor.php b/vendor/fidry/cpu-core-counter/src/Executor/ProcOpenExecutor.php index 751a311d..d526ce19 100644 --- a/vendor/fidry/cpu-core-counter/src/Executor/ProcOpenExecutor.php +++ b/vendor/fidry/cpu-core-counter/src/Executor/ProcOpenExecutor.php @@ -39,15 +39,16 @@ final class ProcOpenExecutor implements ProcessExecutor ], $pipes ); - + // https://github.com/phpstan/phpstan/issues/13197 + /** @var array{resource, resource, resource} $pipes */ if (!is_resource($process)) { return null; } fclose($pipes[0]); - $stdout = (string) stream_get_contents($pipes[1]); - $stderr = (string) stream_get_contents($pipes[2]); + $stdout = stream_get_contents($pipes[1]); + $stderr = stream_get_contents($pipes[2]); proc_close($process); diff --git a/vendor/fidry/cpu-core-counter/src/Finder/CpuInfoFinder.php b/vendor/fidry/cpu-core-counter/src/Finder/CpuInfoFinder.php index dea4c412..8013877d 100644 --- a/vendor/fidry/cpu-core-counter/src/Finder/CpuInfoFinder.php +++ b/vendor/fidry/cpu-core-counter/src/Finder/CpuInfoFinder.php @@ -49,10 +49,12 @@ final class CpuInfoFinder implements CpuCoreFinder } return sprintf( - 'Found the file "%s" with the content:%s%s', + 'Found the file "%s" with the content:%s%s%sWill return "%s".', self::CPU_INFO_PATH, PHP_EOL, - $cpuInfo + $cpuInfo, + PHP_EOL, + self::countCpuCores($cpuInfo) ); } diff --git a/vendor/fidry/cpu-core-counter/src/Finder/DummyCpuCoreFinder.php b/vendor/fidry/cpu-core-counter/src/Finder/DummyCpuCoreFinder.php index 1efa4da6..8c996124 100644 --- a/vendor/fidry/cpu-core-counter/src/Finder/DummyCpuCoreFinder.php +++ b/vendor/fidry/cpu-core-counter/src/Finder/DummyCpuCoreFinder.php @@ -42,6 +42,7 @@ final class DummyCpuCoreFinder implements CpuCoreFinder $this->count = $count; } + /** @phpstan-ignore return.unusedType */ public function find(): ?int { return $this->count; diff --git a/vendor/fidry/cpu-core-counter/src/Finder/FinderRegistry.php b/vendor/fidry/cpu-core-counter/src/Finder/FinderRegistry.php index 4f824587..ca9b8602 100644 --- a/vendor/fidry/cpu-core-counter/src/Finder/FinderRegistry.php +++ b/vendor/fidry/cpu-core-counter/src/Finder/FinderRegistry.php @@ -38,6 +38,9 @@ final class FinderRegistry OnlyOnOSFamilyFinder::forWindows( new DummyCpuCoreFinder(1) ), + new OnlyInPowerShellFinder(new CmiCmdletLogicalFinder()), + new OnlyInPowerShellFinder(new CmiCmdletPhysicalFinder()), + new WindowsRegistryLogicalFinder(), new WmicPhysicalFinder(), new WmicLogicalFinder(), ]; @@ -49,6 +52,12 @@ final class FinderRegistry public static function getDefaultLogicalFinders(): array { return [ + OnlyOnOSFamilyFinder::forWindows( + new OnlyInPowerShellFinder( + new CmiCmdletLogicalFinder() + ) + ), + OnlyOnOSFamilyFinder::forWindows(new WindowsRegistryLogicalFinder()), OnlyOnOSFamilyFinder::forWindows(new WmicLogicalFinder()), new NProcFinder(), new HwLogicalFinder(), @@ -65,6 +74,11 @@ final class FinderRegistry public static function getDefaultPhysicalFinders(): array { return [ + OnlyOnOSFamilyFinder::forWindows( + new OnlyInPowerShellFinder( + new CmiCmdletPhysicalFinder() + ) + ), OnlyOnOSFamilyFinder::forWindows(new WmicPhysicalFinder()), new HwPhysicalFinder(), new LscpuPhysicalFinder(), diff --git a/vendor/fidry/cpu-core-counter/src/Finder/LscpuPhysicalFinder.php b/vendor/fidry/cpu-core-counter/src/Finder/LscpuPhysicalFinder.php index 58523cee..c89bcb9a 100644 --- a/vendor/fidry/cpu-core-counter/src/Finder/LscpuPhysicalFinder.php +++ b/vendor/fidry/cpu-core-counter/src/Finder/LscpuPhysicalFinder.php @@ -40,6 +40,7 @@ final class LscpuPhysicalFinder extends ProcOpenBasedFinder protected function countCpuCores(string $process): ?int { $lines = explode(PHP_EOL, $process); + /** @var string[]|false $actualLines */ $actualLines = preg_grep('/^\d+/', $lines); if (!is_array($actualLines)) { diff --git a/vendor/fidry/cpu-core-counter/src/Finder/NProcFinder.php b/vendor/fidry/cpu-core-counter/src/Finder/NProcFinder.php index 60a8ab78..c0f7a6f7 100644 --- a/vendor/fidry/cpu-core-counter/src/Finder/NProcFinder.php +++ b/vendor/fidry/cpu-core-counter/src/Finder/NProcFinder.php @@ -30,10 +30,13 @@ final class NProcFinder extends ProcOpenBasedFinder private $all; /** - * @param bool $all If disabled will give the number of cores available for the current process only. + * @param bool $all If disabled will give the number of cores available for the current process + * only. This is disabled by default as it is known to be "buggy" on virtual + * environments as the virtualization tool, e.g. VMWare, might over-commit + * resources by default. */ public function __construct( - bool $all = true, + bool $all = false, ?ProcessExecutor $executor = null ) { parent::__construct($executor); diff --git a/vendor/fidry/cpu-core-counter/src/Finder/ProcOpenBasedFinder.php b/vendor/fidry/cpu-core-counter/src/Finder/ProcOpenBasedFinder.php index 793ec647..4d51f898 100644 --- a/vendor/fidry/cpu-core-counter/src/Finder/ProcOpenBasedFinder.php +++ b/vendor/fidry/cpu-core-counter/src/Finder/ProcOpenBasedFinder.php @@ -56,16 +56,19 @@ abstract class ProcOpenBasedFinder implements CpuCoreFinder return $failed ? sprintf( - 'Executed the command "%s" which wrote the following output to the STDERR:%s%s', + 'Executed the command "%s" which wrote the following output to the STDERR:%s%s%sWill return "null".', $command, PHP_EOL, - $stderr + $stderr, + PHP_EOL ) : sprintf( - 'Executed the command "%s" and got the following (STDOUT) output:%s%s', + 'Executed the command "%s" and got the following (STDOUT) output:%s%s%sWill return "%s".', $command, PHP_EOL, - $stdout + $stdout, + PHP_EOL, + $this->countCpuCores($stdout) ?? 'null' ); } diff --git a/vendor/fidry/cpu-core-counter/src/Finder/WmicLogicalFinder.php b/vendor/fidry/cpu-core-counter/src/Finder/WmicLogicalFinder.php index db576a64..0beb21e9 100644 --- a/vendor/fidry/cpu-core-counter/src/Finder/WmicLogicalFinder.php +++ b/vendor/fidry/cpu-core-counter/src/Finder/WmicLogicalFinder.php @@ -40,6 +40,7 @@ final class WmicLogicalFinder extends ProcOpenBasedFinder return parent::countCpuCores($process); } + /** @phpstan-ignore offsetAccess.notFound */ $count = $matches['count']; return parent::countCpuCores($count); diff --git a/vendor/fidry/cpu-core-counter/src/Finder/WmicPhysicalFinder.php b/vendor/fidry/cpu-core-counter/src/Finder/WmicPhysicalFinder.php index 140b9fdb..04abdc50 100644 --- a/vendor/fidry/cpu-core-counter/src/Finder/WmicPhysicalFinder.php +++ b/vendor/fidry/cpu-core-counter/src/Finder/WmicPhysicalFinder.php @@ -40,6 +40,7 @@ final class WmicPhysicalFinder extends ProcOpenBasedFinder return parent::countCpuCores($process); } + /** @phpstan-ignore offsetAccess.notFound */ $count = $matches['count']; return parent::countCpuCores($count); diff --git a/vendor/jean85/pretty-package-versions/.github/workflows/tests.yaml b/vendor/jean85/pretty-package-versions/.github/workflows/tests.yaml deleted file mode 100644 index 7737dda7..00000000 --- a/vendor/jean85/pretty-package-versions/.github/workflows/tests.yaml +++ /dev/null @@ -1,76 +0,0 @@ -name: Tests - -on: - pull_request: null - push: - branches: - - 2.x - -jobs: - tests: - runs-on: ubuntu-latest - strategy: - matrix: - php: - - '7.1' - - '7.2' - - '7.3' - - '7.4' - - '8.0' - - '8.1' - composer_version: ['v2'] - include: - - description: '(prefer lowest)' - php: '7.1' - composer_version: '2.0.0' - dependencies: 'lowest' - - name: PHP ${{ matrix.php }} tests ${{ matrix.description }} - steps: - # checkout git - - uses: actions/checkout@v2 - # setup PHP - - uses: shivammathur/setup-php@v2 - with: - php-version: ${{ matrix.php }} - tools: composer:${{ matrix.composer_version }} - coverage: xdebug - - uses: "ramsey/composer-install@v1" - with: - dependency-versions: ${{ matrix.dependencies }} - - run: vendor/bin/phpunit --coverage-clover=coverage.xml - - uses: codecov/codecov-action@v1 - with: - file: './coverage.xml' - fail_ci_if_error: true - PHP-CS-Fixer: - runs-on: ubuntu-latest - name: Code style - steps: - - uses: actions/checkout@v2 - - uses: shivammathur/setup-php@v2 - with: - php-version: '7.4' - coverage: none - - uses: "ramsey/composer-install@v1" - - run: vendor/bin/php-cs-fixer fix --ansi --verbose --dry-run - PHPStan: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v2 - - uses: shivammathur/setup-php@v2 - with: - php-version: '7.4' - coverage: none - - uses: "ramsey/composer-install@v1" - - run: vendor/bin/phpstan analyse - Psalm: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v2 - - uses: shivammathur/setup-php@v2 - with: - php-version: '7.4' - coverage: none - - uses: "ramsey/composer-install@v1" - - run: vendor/bin/psalm diff --git a/vendor/jean85/pretty-package-versions/.php_cs.dist b/vendor/jean85/pretty-package-versions/.php_cs.dist deleted file mode 100644 index 8a6261a1..00000000 --- a/vendor/jean85/pretty-package-versions/.php_cs.dist +++ /dev/null @@ -1,118 +0,0 @@ -setRiskyAllowed(true); -$config->setRules([ - '@PSR2' => true, - 'align_multiline_comment' => true, - 'array_indentation' => true, - 'array_syntax' => [ - 'syntax' => 'short', - ], - 'binary_operator_spaces' => [ - 'align_double_arrow' => false, - 'align_equals' => false, - ], - 'blank_line_after_namespace' => true, - 'blank_line_after_opening_tag' => true, - 'blank_line_before_statement' => [ - 'statements' => [ - 'return', - ], - ], - 'cast_spaces' => [ - 'space' => 'single', - ], - 'class_attributes_separation' => [ - 'elements' => [ - 'method' => 'one', - 'property' => 'one', - ], - ], - 'compact_nullable_typehint' => true, - 'concat_space' => [ - 'spacing' => 'one', - ], - 'declare_equal_normalize' => true, - 'declare_strict_types' => true, - 'function_typehint_space' => true, - 'include' => true, - 'indentation_type' => true, - 'lowercase_cast' => true, - 'method_chaining_indentation' => true, - 'method_separation' => true, - 'multiline_comment_opening_closing' => true, - 'native_function_casing' => true, - 'new_with_braces' => true, - 'no_blank_lines_after_phpdoc' => true, - 'no_empty_comment' => true, - 'no_empty_phpdoc' => true, - 'no_empty_statement' => true, - 'no_extra_consecutive_blank_lines' => [ - 'tokens' => [ - 'curly_brace_block', - 'extra', - 'parenthesis_brace_block', - 'square_brace_block', - 'throw', - 'use', - ], - ], - 'no_leading_import_slash' => true, - 'no_leading_namespace_whitespace' => true, - 'no_mixed_echo_print' => [ - 'use' => 'echo', - ], - 'no_multiline_whitespace_around_double_arrow' => true, - 'no_short_bool_cast' => true, - 'no_singleline_whitespace_before_semicolons' => true, - 'no_spaces_around_offset' => true, - 'no_superfluous_phpdoc_tags' => [ - 'allow_mixed' => true, - ], - 'no_trailing_comma_in_list_call' => true, - 'no_trailing_comma_in_singleline_array' => true, - 'no_unneeded_control_parentheses' => true, - 'no_unused_imports' => true, - 'no_whitespace_before_comma_in_array' => true, - 'no_whitespace_in_blank_line' => true, - 'not_operator_with_successor_space' => true, - 'normalize_index_brace' => true, - 'object_operator_without_whitespace' => true, - 'ordered_imports' => true, - 'phpdoc_align' => false, - 'phpdoc_annotation_without_dot' => true, - 'phpdoc_indent' => true, - 'phpdoc_no_package' => true, - 'phpdoc_no_useless_inheritdoc' => true, - 'phpdoc_order' => true, - 'phpdoc_scalar' => true, - 'phpdoc_separation' => true, - 'phpdoc_single_line_var_spacing' => true, - 'phpdoc_to_comment' => true, - 'phpdoc_trim' => true, - 'phpdoc_trim_consecutive_blank_line_separation' => true, - 'phpdoc_types' => true, - 'phpdoc_var_without_name' => true, - 'pre_increment' => true, - 'psr4' => true, - 'return_type_declaration' => true, - 'short_scalar_cast' => true, - 'single_blank_line_before_namespace' => true, - 'single_class_element_per_statement' => true, - 'single_quote' => true, - 'space_after_semicolon' => true, - 'standardize_not_equals' => true, - 'ternary_operator_spaces' => true, - 'ternary_to_null_coalescing' => true, - 'trailing_comma_in_multiline_array' => true, - 'trim_array_spaces' => true, - 'unary_operator_spaces' => true, - 'whitespace_after_comma_in_array' => true, -]); - -$finder = PhpCsFixer\Finder::create(); -$finder->in(__DIR__); -$config->setFinder($finder); - -return $config; diff --git a/vendor/jean85/pretty-package-versions/Makefile b/vendor/jean85/pretty-package-versions/Makefile deleted file mode 100644 index e221044e..00000000 --- a/vendor/jean85/pretty-package-versions/Makefile +++ /dev/null @@ -1,19 +0,0 @@ -pre-commit-check: composer cs phpstan psalm test - -composer: - composer install - -cs: - vendor/bin/php-cs-fixer fix --verbose - -cs-dry-run: - vendor/bin/php-cs-fixer fix --verbose --dry-run - -phpstan: - vendor/bin/phpstan analyze - -psalm: - vendor/bin/psalm - -test: - vendor/bin/phpunit diff --git a/vendor/jean85/pretty-package-versions/codecov.yml b/vendor/jean85/pretty-package-versions/codecov.yml deleted file mode 100644 index 69cb7601..00000000 --- a/vendor/jean85/pretty-package-versions/codecov.yml +++ /dev/null @@ -1 +0,0 @@ -comment: false diff --git a/vendor/jean85/pretty-package-versions/composer.json b/vendor/jean85/pretty-package-versions/composer.json index 9449eeba..026b0a52 100644 --- a/vendor/jean85/pretty-package-versions/composer.json +++ b/vendor/jean85/pretty-package-versions/composer.json @@ -3,15 +3,16 @@ "description": "A library to get pretty versions strings of installed dependencies", "type": "library", "require": { - "php": "^7.1|^8.0", - "composer-runtime-api": "^2.0.0" + "php": "^7.4|^8.0", + "composer-runtime-api": "^2.1.0" }, "require-dev": { - "friendsofphp/php-cs-fixer": "^2.17", + "friendsofphp/php-cs-fixer": "^3.2", "jean85/composer-provided-replaced-stub-package": "^1.0", - "phpstan/phpstan": "^0.12.66", - "phpunit/phpunit": "^7.5|^8.5|^9.4", - "vimeo/psalm": "^4.3" + "phpstan/phpstan": "^2.0", + "phpunit/phpunit": "^7.5|^8.5|^9.6", + "rector/rector": "^2.0", + "vimeo/psalm": "^4.3 || ^5.0" }, "license": "MIT", "authors": [ diff --git a/vendor/jean85/pretty-package-versions/phpstan.neon b/vendor/jean85/pretty-package-versions/phpstan.neon deleted file mode 100644 index e4a12408..00000000 --- a/vendor/jean85/pretty-package-versions/phpstan.neon +++ /dev/null @@ -1,5 +0,0 @@ -parameters: - level: 8 - paths: - - src/ - - tests/ diff --git a/vendor/jean85/pretty-package-versions/psalm.xml b/vendor/jean85/pretty-package-versions/psalm.xml deleted file mode 100644 index 68b73f68..00000000 --- a/vendor/jean85/pretty-package-versions/psalm.xml +++ /dev/null @@ -1,16 +0,0 @@ - - - - - - - - - - diff --git a/vendor/jean85/pretty-package-versions/src/PrettyVersions.php b/vendor/jean85/pretty-package-versions/src/PrettyVersions.php index 2155d9ef..17b33b82 100644 --- a/vendor/jean85/pretty-package-versions/src/PrettyVersions.php +++ b/vendor/jean85/pretty-package-versions/src/PrettyVersions.php @@ -43,14 +43,6 @@ class PrettyVersions protected static function checkProvidedPackages(string $packageName): void { - if (! method_exists(InstalledVersions::class, 'getAllRawData')) { - if (isset(InstalledVersions::getRawData()['versions'][$packageName]['provided'])) { - throw ProvidedPackageException::create($packageName); - } - - return; - } - foreach (InstalledVersions::getAllRawData() as $installed) { if (isset($installed['versions'][$packageName]['provided'])) { throw ProvidedPackageException::create($packageName); @@ -60,14 +52,6 @@ class PrettyVersions protected static function checkReplacedPackages(string $packageName): void { - if (! method_exists(InstalledVersions::class, 'getAllRawData')) { - if (isset(InstalledVersions::getRawData()['versions'][$packageName]['replaced'])) { - throw ReplacedPackageException::create($packageName); - } - - return; - } - foreach (InstalledVersions::getAllRawData() as $installed) { if (isset($installed['versions'][$packageName]['replaced'])) { throw ReplacedPackageException::create($packageName); diff --git a/vendor/jean85/pretty-package-versions/src/Version.php b/vendor/jean85/pretty-package-versions/src/Version.php index 6af9974a..b2ef109b 100644 --- a/vendor/jean85/pretty-package-versions/src/Version.php +++ b/vendor/jean85/pretty-package-versions/src/Version.php @@ -8,17 +8,13 @@ class Version { private const SHORT_COMMIT_LENGTH = 7; - /** @var string */ - private $packageName; + private string $packageName; - /** @var string */ - private $prettyVersion; + private string $prettyVersion; - /** @var string */ - private $reference; + private string $reference; - /** @var bool */ - private $versionIsTagged; + private bool $versionIsTagged; public const NO_VERSION_TEXT = '{no version}'; public const NO_REFERENCE_TEXT = '{no reference}'; @@ -28,7 +24,7 @@ class Version $this->packageName = $packageName; $this->prettyVersion = $prettyVersion ?? self::NO_VERSION_TEXT; $this->reference = $reference ?? self::NO_REFERENCE_TEXT; - $this->versionIsTagged = preg_match('/[^v\d.]/', $this->getShortVersion()) === 0; + $this->versionIsTagged = preg_match('/^v?(\d+\.)+\d+(-(beta|RC|alpha).?\d+)?/i', $this->getShortVersion()) === 1; } public function getPrettyVersion(): string @@ -91,6 +87,10 @@ class Version public function getShortReference(): string { + if ($this->reference === self::NO_REFERENCE_TEXT) { + return self::NO_REFERENCE_TEXT; + } + return substr($this->reference, 0, self::SHORT_COMMIT_LENGTH); } diff --git a/vendor/myclabs/deep-copy/.github/FUNDING.yml b/vendor/myclabs/deep-copy/.github/FUNDING.yml deleted file mode 100644 index b8da664d..00000000 --- a/vendor/myclabs/deep-copy/.github/FUNDING.yml +++ /dev/null @@ -1,12 +0,0 @@ -# These are supported funding model platforms - -github: # Replace with up to 4 GitHub Sponsors-enabled usernames e.g., [user1, user2] -patreon: # Replace with a single Patreon username -open_collective: # Replace with a single Open Collective username -ko_fi: # Replace with a single Ko-fi username -tidelift: "packagist/myclabs/deep-copy" -community_bridge: # Replace with a single Community Bridge project-name e.g., cloud-foundry -liberapay: # Replace with a single Liberapay username -issuehunt: # Replace with a single IssueHunt username -otechie: # Replace with a single Otechie username -custom: # Replace with up to 4 custom sponsorship URLs e.g., ['link1', 'link2'] diff --git a/vendor/myclabs/deep-copy/.github/workflows/ci.yaml b/vendor/myclabs/deep-copy/.github/workflows/ci.yaml deleted file mode 100644 index eac2812e..00000000 --- a/vendor/myclabs/deep-copy/.github/workflows/ci.yaml +++ /dev/null @@ -1,101 +0,0 @@ -name: "Continuous Integration" - -on: - - pull_request - - push - -env: - COMPOSER_ROOT_VERSION: 1.99 - -jobs: - composer-json-lint: - name: "Lint composer.json" - - runs-on: "ubuntu-latest" - - strategy: - matrix: - php-version: - - "8.1" - - steps: - - name: "Checkout" - uses: "actions/checkout@v2" - - - name: "Install PHP" - uses: "shivammathur/setup-php@v2" - with: - coverage: "none" - php-version: "${{ matrix.php-version }}" - tools: composer-normalize - - - name: "Get composer cache directory" - id: composercache - run: echo "::set-output name=dir::$(composer config cache-files-dir)" - - - name: "Cache dependencies" - uses: actions/cache@v2 - with: - path: ${{ steps.composercache.outputs.dir }} - key: ${{ runner.os }}-php-${{ matrix.php-version }}-${{ matrix.dependencies }}-composer-${{ hashFiles('**/composer.json') }} - restore-keys: ${{ runner.os }}-php-${{ matrix.php-version }}-${{ matrix.dependencies }}-composer- - - - name: "Install dependencies" - run: "composer update --no-interaction --no-progress" - - - name: "Validate composer.json" - run: "composer validate --strict" - - - name: "Normalize composer.json" - run: "composer-normalize --dry-run" - - tests: - name: "Tests" - - runs-on: "ubuntu-latest" - - strategy: - matrix: - php-version: - - "7.1" - - "7.2" - - "7.3" - - "7.4" - - "8.0" - - "8.1" - dependencies: - - "lowest" - - "highest" - - steps: - - name: "Checkout" - uses: "actions/checkout@v2" - - - name: "Install PHP" - uses: "shivammathur/setup-php@v2" - with: - php-version: "${{ matrix.php-version }}" - ini-values: zend.assertions=1 - - - name: "Get composer cache directory" - id: composercache - run: echo "::set-output name=dir::$(composer config cache-files-dir)" - - - name: "Cache dependencies" - uses: actions/cache@v2 - with: - path: ${{ steps.composercache.outputs.dir }} - key: ${{ runner.os }}-php-${{ matrix.php-version }}-${{ matrix.dependencies }}-composer-${{ hashFiles('**/composer.json') }} - restore-keys: ${{ runner.os }}-php-${{ matrix.php-version }}-${{ matrix.dependencies }}-composer- - - - name: "Install lowest dependencies" - if: ${{ matrix.dependencies == 'lowest' }} - run: "composer update --no-interaction --no-progress --prefer-lowest" - - - name: "Install highest dependencies" - if: ${{ matrix.dependencies == 'highest' }} - run: "composer update --no-interaction --no-progress" - - - name: "Run tests" - timeout-minutes: 3 - run: "vendor/bin/phpunit" diff --git a/vendor/myclabs/deep-copy/README.md b/vendor/myclabs/deep-copy/README.md index 94aaa06d..88ae14cc 100644 --- a/vendor/myclabs/deep-copy/README.md +++ b/vendor/myclabs/deep-copy/README.md @@ -3,7 +3,7 @@ DeepCopy helps you create deep copies (clones) of your objects. It is designed to handle cycles in the association graph. [![Total Downloads](https://poser.pugx.org/myclabs/deep-copy/downloads.svg)](https://packagist.org/packages/myclabs/deep-copy) -[![Integrate](https://github.com/myclabs/DeepCopy/workflows/ci/badge.svg?branch=1.x)](https://github.com/myclabs/DeepCopy/actions) +[![Integrate](https://github.com/myclabs/DeepCopy/actions/workflows/ci.yaml/badge.svg?branch=1.x)](https://github.com/myclabs/DeepCopy/actions/workflows/ci.yaml) ## Table of Contents diff --git a/vendor/myclabs/deep-copy/composer.json b/vendor/myclabs/deep-copy/composer.json index 66fb34a5..f115fff8 100644 --- a/vendor/myclabs/deep-copy/composer.json +++ b/vendor/myclabs/deep-copy/composer.json @@ -16,11 +16,12 @@ "require-dev": { "doctrine/collections": "^1.6.8", "doctrine/common": "^2.13.3 || ^3.2.2", + "phpspec/prophecy": "^1.10", "phpunit/phpunit": "^7.5.20 || ^8.5.23 || ^9.5.13" }, "conflict": { "doctrine/collections": "<1.6.8", - "doctrine/common": "<2.13.3 || >=3,<3.2.2" + "doctrine/common": "<2.13.3 || >=3 <3.2.2" }, "autoload": { "psr-4": { @@ -32,8 +33,8 @@ }, "autoload-dev": { "psr-4": { - "DeepCopy\\": "fixtures/", - "DeepCopyTest\\": "tests/DeepCopyTest/" + "DeepCopyTest\\": "tests/DeepCopyTest/", + "DeepCopy\\": "fixtures/" } }, "config": { diff --git a/vendor/myclabs/deep-copy/src/DeepCopy/DeepCopy.php b/vendor/myclabs/deep-copy/src/DeepCopy/DeepCopy.php index 6e766d80..a944697d 100644 --- a/vendor/myclabs/deep-copy/src/DeepCopy/DeepCopy.php +++ b/vendor/myclabs/deep-copy/src/DeepCopy/DeepCopy.php @@ -4,6 +4,7 @@ namespace DeepCopy; use ArrayObject; use DateInterval; +use DatePeriod; use DateTimeInterface; use DateTimeZone; use DeepCopy\Exception\CloneException; @@ -12,6 +13,7 @@ use DeepCopy\Filter\Filter; use DeepCopy\Matcher\Matcher; use DeepCopy\Reflection\ReflectionHelper; use DeepCopy\TypeFilter\Date\DateIntervalFilter; +use DeepCopy\TypeFilter\Date\DatePeriodFilter; use DeepCopy\TypeFilter\Spl\ArrayObjectFilter; use DeepCopy\TypeFilter\Spl\SplDoublyLinkedListFilter; use DeepCopy\TypeFilter\TypeFilter; @@ -64,6 +66,7 @@ class DeepCopy $this->addTypeFilter(new ArrayObjectFilter($this), new TypeMatcher(ArrayObject::class)); $this->addTypeFilter(new DateIntervalFilter(), new TypeMatcher(DateInterval::class)); + $this->addTypeFilter(new DatePeriodFilter(), new TypeMatcher(DatePeriod::class)); $this->addTypeFilter(new SplDoublyLinkedListFilter($this), new TypeMatcher(SplDoublyLinkedList::class)); } @@ -84,9 +87,11 @@ class DeepCopy /** * Deep copies the given object. * - * @param mixed $object + * @template TObject * - * @return mixed + * @param TObject $object + * + * @return TObject */ public function copy($object) { @@ -119,6 +124,14 @@ class DeepCopy ]; } + public function prependTypeFilter(TypeFilter $filter, TypeMatcher $matcher) + { + array_unshift($this->typeFilters, [ + 'matcher' => $matcher, + 'filter' => $filter, + ]); + } + private function recursiveCopy($var) { // Matches Type Filter @@ -224,6 +237,11 @@ class DeepCopy return; } + // Ignore readonly properties + if (method_exists($property, 'isReadOnly') && $property->isReadOnly()) { + return; + } + // Apply the filters foreach ($this->filters as $item) { /** @var Matcher $matcher */ @@ -249,7 +267,9 @@ class DeepCopy } } - $property->setAccessible(true); + if (PHP_VERSION_ID < 80100) { + $property->setAccessible(true); + } // Ignore uninitialized properties (for PHP >7.4) if (method_exists($property, 'isInitialized') && !$property->isInitialized($object)) { diff --git a/vendor/myclabs/deep-copy/src/DeepCopy/Filter/Doctrine/DoctrineCollectionFilter.php b/vendor/myclabs/deep-copy/src/DeepCopy/Filter/Doctrine/DoctrineCollectionFilter.php index e6d93771..66e91e59 100644 --- a/vendor/myclabs/deep-copy/src/DeepCopy/Filter/Doctrine/DoctrineCollectionFilter.php +++ b/vendor/myclabs/deep-copy/src/DeepCopy/Filter/Doctrine/DoctrineCollectionFilter.php @@ -19,7 +19,9 @@ class DoctrineCollectionFilter implements Filter { $reflectionProperty = ReflectionHelper::getProperty($object, $property); - $reflectionProperty->setAccessible(true); + if (PHP_VERSION_ID < 80100) { + $reflectionProperty->setAccessible(true); + } $oldCollection = $reflectionProperty->getValue($object); $newCollection = $oldCollection->map( diff --git a/vendor/myclabs/deep-copy/src/DeepCopy/Filter/Doctrine/DoctrineEmptyCollectionFilter.php b/vendor/myclabs/deep-copy/src/DeepCopy/Filter/Doctrine/DoctrineEmptyCollectionFilter.php index 7b33fd54..fa1c0341 100644 --- a/vendor/myclabs/deep-copy/src/DeepCopy/Filter/Doctrine/DoctrineEmptyCollectionFilter.php +++ b/vendor/myclabs/deep-copy/src/DeepCopy/Filter/Doctrine/DoctrineEmptyCollectionFilter.php @@ -21,7 +21,9 @@ class DoctrineEmptyCollectionFilter implements Filter public function apply($object, $property, $objectCopier) { $reflectionProperty = ReflectionHelper::getProperty($object, $property); - $reflectionProperty->setAccessible(true); + if (PHP_VERSION_ID < 80100) { + $reflectionProperty->setAccessible(true); + } $reflectionProperty->setValue($object, new ArrayCollection()); } diff --git a/vendor/myclabs/deep-copy/src/DeepCopy/Filter/ReplaceFilter.php b/vendor/myclabs/deep-copy/src/DeepCopy/Filter/ReplaceFilter.php index 7aca593b..fda8e726 100644 --- a/vendor/myclabs/deep-copy/src/DeepCopy/Filter/ReplaceFilter.php +++ b/vendor/myclabs/deep-copy/src/DeepCopy/Filter/ReplaceFilter.php @@ -30,7 +30,9 @@ class ReplaceFilter implements Filter public function apply($object, $property, $objectCopier) { $reflectionProperty = ReflectionHelper::getProperty($object, $property); - $reflectionProperty->setAccessible(true); + if (PHP_VERSION_ID < 80100) { + $reflectionProperty->setAccessible(true); + } $value = call_user_func($this->callback, $reflectionProperty->getValue($object)); diff --git a/vendor/myclabs/deep-copy/src/DeepCopy/Filter/SetNullFilter.php b/vendor/myclabs/deep-copy/src/DeepCopy/Filter/SetNullFilter.php index bea86b88..67222724 100644 --- a/vendor/myclabs/deep-copy/src/DeepCopy/Filter/SetNullFilter.php +++ b/vendor/myclabs/deep-copy/src/DeepCopy/Filter/SetNullFilter.php @@ -18,7 +18,9 @@ class SetNullFilter implements Filter { $reflectionProperty = ReflectionHelper::getProperty($object, $property); - $reflectionProperty->setAccessible(true); + if (PHP_VERSION_ID < 80100) { + $reflectionProperty->setAccessible(true); + } $reflectionProperty->setValue($object, null); } } diff --git a/vendor/myclabs/deep-copy/src/DeepCopy/Matcher/PropertyTypeMatcher.php b/vendor/myclabs/deep-copy/src/DeepCopy/Matcher/PropertyTypeMatcher.php index c7f46908..7980bfa2 100644 --- a/vendor/myclabs/deep-copy/src/DeepCopy/Matcher/PropertyTypeMatcher.php +++ b/vendor/myclabs/deep-copy/src/DeepCopy/Matcher/PropertyTypeMatcher.php @@ -39,7 +39,9 @@ class PropertyTypeMatcher implements Matcher return false; } - $reflectionProperty->setAccessible(true); + if (PHP_VERSION_ID < 80100) { + $reflectionProperty->setAccessible(true); + } // Uninitialized properties (for PHP >7.4) if (method_exists($reflectionProperty, 'isInitialized') && !$reflectionProperty->isInitialized($object)) { diff --git a/vendor/nette/schema/composer.json b/vendor/nette/schema/composer.json index bece68ac..fd48db36 100644 --- a/vendor/nette/schema/composer.json +++ b/vendor/nette/schema/composer.json @@ -15,16 +15,21 @@ } ], "require": { - "php": ">=7.1 <8.3", - "nette/utils": "^2.5.7 || ^3.1.5 || ^4.0" + "php": "8.1 - 8.5", + "nette/utils": "^4.0" }, "require-dev": { - "nette/tester": "^2.3 || ^2.4", - "tracy/tracy": "^2.7", - "phpstan/phpstan-nette": "^1.0" + "nette/tester": "^2.6", + "tracy/tracy": "^2.8", + "phpstan/phpstan": "^2.1.39@stable", + "phpstan/extension-installer": "^1.4@stable", + "nette/phpstan-rules": "^1.0" }, "autoload": { - "classmap": ["src/"] + "classmap": ["src/"], + "psr-4": { + "Nette\\": "src" + } }, "minimum-stability": "dev", "scripts": { @@ -33,7 +38,12 @@ }, "extra": { "branch-alias": { - "dev-master": "1.2-dev" + "dev-master": "1.3-dev" + } + }, + "config": { + "allow-plugins": { + "phpstan/extension-installer": true } } } diff --git a/vendor/nette/schema/contributing.md b/vendor/nette/schema/contributing.md deleted file mode 100644 index 184152c0..00000000 --- a/vendor/nette/schema/contributing.md +++ /dev/null @@ -1,33 +0,0 @@ -How to contribute & use the issue tracker -========================================= - -Nette welcomes your contributions. There are several ways to help out: - -* Create an issue on GitHub, if you have found a bug -* Write test cases for open bug issues -* Write fixes for open bug/feature issues, preferably with test cases included -* Contribute to the [documentation](https://nette.org/en/writing) - -Issues ------- - -Please **do not use the issue tracker to ask questions**. We will be happy to help you -on [Nette forum](https://forum.nette.org) or chat with us on [Gitter](https://gitter.im/nette/nette). - -A good bug report shouldn't leave others needing to chase you up for more -information. Please try to be as detailed as possible in your report. - -**Feature requests** are welcome. But take a moment to find out whether your idea -fits with the scope and aims of the project. It's up to *you* to make a strong -case to convince the project's developers of the merits of this feature. - -Contributing ------------- - -If you'd like to contribute, please take a moment to read [the contributing guide](https://nette.org/en/contributing). - -The best way to propose a feature is to discuss your ideas on [Nette forum](https://forum.nette.org) before implementing them. - -Please do not fix whitespace, format code, or make a purely cosmetic patch. - -Thanks! :heart: diff --git a/vendor/nette/schema/readme.md b/vendor/nette/schema/readme.md index 20b5de2a..ce9d0d10 100644 --- a/vendor/nette/schema/readme.md +++ b/vendor/nette/schema/readme.md @@ -1,5 +1,4 @@ -Nette Schema -************ +# Nette Schema [![Downloads this Month](https://img.shields.io/packagist/dm/nette/schema.svg)](https://packagist.org/packages/nette/schema) [![Tests](https://github.com/nette/schema/workflows/Tests/badge.svg?branch=master)](https://github.com/nette/schema/actions) @@ -21,7 +20,7 @@ Installation: composer require nette/schema ``` -It requires PHP version 7.1 and supports PHP up to 8.2. +It requires PHP version 8.1 and supports PHP up to 8.5. [Support Me](https://github.com/sponsors/dg) @@ -39,7 +38,7 @@ Basic Usage In variable `$schema` we have a validation schema (what exactly this means and how to create it we will say later) and in variable `$data` we have a data structure that we want to validate and normalize. This can be, for example, data sent by the user through an API, configuration file, etc. -The task is handled by the [Nette\Schema\Processor](https://api.nette.org/3.0/Nette/Schema/Processor.html) class, which processes the input and either returns normalized data or throws an [Nette\Schema\ValidationException](https://api.nette.org/3.0/Nette/Schema/ValidationException.html) exception on error. +The task is handled by the [Nette\Schema\Processor](https://api.nette.org/schema/master/Nette/Schema/Processor.html) class, which processes the input and either returns normalized data or throws an [Nette\Schema\ValidationException](https://api.nette.org/schema/master/Nette/Schema/ValidationException.html) exception on error. ```php $processor = new Nette\Schema\Processor; @@ -51,20 +50,20 @@ try { } ``` -Method `$e->getMessages()` returns array of all message strings and `$e->getMessageObjects()` return all messages as [Nette\Schema\Message](https://api.nette.org/3.1/Nette/Schema/Message.html) objects. +Method `$e->getMessages()` returns array of all message strings and `$e->getMessageObjects()` return all messages as [Nette\Schema\Message](https://api.nette.org/schema/master/Nette/Schema/Message.html) objects. Defining Schema --------------- -And now let's create a schema. The class [Nette\Schema\Expect](https://api.nette.org/3.0/Nette/Schema/Expect.html) is used to define it, we actually define expectations of what the data should look like. Let's say that the input data must be a structure (e.g. an array) containing elements `processRefund` of type bool and `refundAmount` of type int. +And now let's create a schema. The class [Nette\Schema\Expect](https://api.nette.org/schema/master/Nette/Schema/Expect.html) is used to define it, we actually define expectations of what the data should look like. Let's say that the input data must be a structure (e.g. an array) containing elements `processRefund` of type bool and `refundAmount` of type int. ```php use Nette\Schema\Expect; $schema = Expect::structure([ - 'processRefund' => Expect::bool(), - 'refundAmount' => Expect::int(), + 'processRefund' => Expect::bool(), + 'refundAmount' => Expect::int(), ]); ``` @@ -74,8 +73,8 @@ Lets send the following data for validation: ```php $data = [ - 'processRefund' => true, - 'refundAmount' => 17, + 'processRefund' => true, + 'refundAmount' => 17, ]; $normalized = $processor->process($schema, $data); // OK, it passes @@ -87,7 +86,7 @@ All elements of the structure are optional and have a default value `null`. Exam ```php $data = [ - 'refundAmount' => 17, + 'refundAmount' => 17, ]; $normalized = $processor->process($schema, $data); // OK, it passes @@ -102,8 +101,8 @@ And what if we wanted to accept `1` and `0` besides booleans? Then we list the a ```php $schema = Expect::structure([ - 'processRefund' => Expect::anyOf(true, false, 1, 0)->castTo('bool'), - 'refundAmount' => Expect::int(), + 'processRefund' => Expect::anyOf(true, false, 1, 0)->castTo('bool'), + 'refundAmount' => Expect::int(), ]); $normalized = $processor->process($schema, $data); @@ -113,7 +112,6 @@ is_bool($normalized->processRefund); // true Now you know the basics of how the schema is defined and how the individual elements of the structure behave. We will now show what all the other elements can be used in defining a schema. - Data Types: type() ------------------ @@ -152,6 +150,15 @@ $processor->process($schema, ['a' => 'hello', 'b' => 'world']); // OK $processor->process($schema, ['key' => 123]); // ERROR: 123 is not a string ``` +The second parameter can be used to specify keys (since version 1.2): + +```php +$schema = Expect::arrayOf('string', 'int'); + +$processor->process($schema, ['hello', 'world']); // OK +$processor->process($schema, ['a' => 'hello']); // ERROR: 'a' is not int +``` + The list is an indexed array: ```php @@ -169,7 +176,7 @@ The parameter can also be a schema, so we can write: Expect::arrayOf(Expect::bool()) ``` -The default value is an empty array. If you specify default value, it will be merged with the passed data. This can be disabled using `mergeDefaults(false)`. +The default value is an empty array. If you specify a default value, it will be merged with the passed data. This can be disabled using `mergeDefaults(false)`. Enumeration: anyOf() @@ -179,7 +186,7 @@ Enumeration: anyOf() ```php $schema = Expect::listOf( - Expect::anyOf('a', true, null) + Expect::anyOf('a', true, null), ); $processor->process($schema, ['a', true, null, 'a']); // OK @@ -190,14 +197,21 @@ The enumeration elements can also be schemas: ```php $schema = Expect::listOf( - Expect::anyOf(Expect::string(), true, null) + Expect::anyOf(Expect::string(), true, null), ); $processor->process($schema, ['foo', true, null, 'bar']); // OK $processor->process($schema, [123]); // ERROR ``` -The default value is `null`. +The `anyOf()` method accepts variants as individual parameters, not as array. To pass it an array of values, use the unpacking operator `anyOf(...$variants)`. + +The default value is `null`. Use the `firstIsDefault()` method to make the first element the default: + +```php +// default is 'hello' +Expect::anyOf(Expect::string('hello'), true, null)->firstIsDefault(); +``` Structures @@ -216,12 +230,24 @@ $schema = Expect::structure([ ]); $processor->process($schema, ['optional' => '']); -// ERROR: item 'required' is missing +// ERROR: option 'required' is missing $processor->process($schema, ['required' => 'foo']); // OK, returns {'required' => 'foo', 'optional' => null} ``` +If you do not want to output properties with only a default value, use `skipDefaults()`: + +```php +$schema = Expect::structure([ + 'required' => Expect::string()->required(), + 'optional' => Expect::string(), +])->skipDefaults(); + +$processor->process($schema, ['required' => 'foo']); +// OK, returns {'required' => 'foo'} +``` + Although `null` is the default value of the `optional` property, it is not allowed in the input data (the value must be a string). Properties accepting `null` are defined using `nullable()`: ```php @@ -259,10 +285,11 @@ $processor->process($schema, ['additional' => 1]); // OK $processor->process($schema, ['additional' => true]); // ERROR ``` + Deprecations ------------ -You can deprecate property using the `deprecated([string $message])` method. Deprecation notices are returned by `$processor->getWarnings()` (since v1.1): +You can deprecate property using the `deprecated([string $message])` method. Deprecation notices are returned by `$processor->getWarnings()`: ```php $schema = Expect::structure([ @@ -273,6 +300,7 @@ $processor->process($schema, ['old' => 1]); // OK $processor->getWarnings(); // ["The item 'old' is deprecated"] ``` + Ranges: min() max() ------------------- @@ -322,7 +350,7 @@ Custom Assertions: assert() You can add any other restrictions using `assert(callable $fn)`. ```php -$countIsEven = function ($v) { return count($v) % 2 === 0; }; +$countIsEven = fn($v) => count($v) % 2 === 0; $schema = Expect::arrayOf('string') ->assert($countIsEven); // the count must be even @@ -337,7 +365,7 @@ Or Expect::string()->assert('is_file'); // the file must exist ``` -You can add your own description for each assertions. It will be part of the error message. +You can add your own description for each assertion. It will be part of the error message. ```php $schema = Expect::arrayOf('string') @@ -347,7 +375,106 @@ $processor->process($schema, ['a', 'b', 'c']); // Failed assertion "Even items in array" for item with value array. ``` -The method can be called repeatedly to add more assertions. +The method can be called repeatedly to add multiple constraints. It can be intermixed with calls to `transform()` and `castTo()`. + + +Transformation: transform() +--------------------------- + +Successfully validated data can be modified using a custom function: + +```php +// conversion to uppercase: +Expect::string()->transform(fn(string $s) => strtoupper($s)); +``` + +The method can be called repeatedly to add multiple transformations. It can be intermixed with calls to `assert()` and `castTo()`. The operations will be executed in the order in which they are declared: + +```php +Expect::type('string|int') + ->castTo('string') + ->assert('ctype_lower', 'All characters must be lowercased') + ->transform(fn(string $s) => strtoupper($s)); // conversion to uppercase +``` + +The `transform()` method can both transform and validate the value simultaneously. This is often simpler and less redundant than chaining `transform()` and `assert()`. For this purpose, the function receives a [Nette\Schema\Context](https://api.nette.org/schema/master/Nette/Schema/Context.html) object with an `addError()` method, which can be used to add information about validation issues: + +```php +Expect::string() + ->transform(function (string $s, Nette\Schema\Context $context) { + if (!ctype_lower($s)) { + $context->addError('All characters must be lowercased', 'my.case.error'); + return null; + } + + return strtoupper($s); + }); +``` + + +Casting: castTo() +----------------- + +Successfully validated data can be cast: + +```php +Expect::scalar()->castTo('string'); +``` + +In addition to native PHP types, you can also cast to classes. It distinguishes whether it is a simple class without a constructor or a class with a constructor. If the class has no constructor, an instance of it is created and all elements of the structure are written to its properties: + +```php +class Info +{ + public bool $processRefund; + public int $refundAmount; +} + +Expect::structure([ + 'processRefund' => Expect::bool(), + 'refundAmount' => Expect::int(), +])->castTo(Info::class); + +// creates '$obj = new Info' and writes to $obj->processRefund and $obj->refundAmount +``` + +If the class has a constructor, the elements of the structure are passed as named parameters to the constructor: + +```php +class Info +{ + public function __construct( + public bool $processRefund, + public int $refundAmount, + ) { + } +} + +// creates $obj = new Info(processRefund: ..., refundAmount: ...) +``` + +Casting combined with a scalar parameter creates an object and passes the value as the sole parameter to the constructor: + +```php +Expect::string()->castTo(DateTime::class); +// creates new DateTime(...) +``` + + +Normalization: before() +----------------------- + +Prior to the validation itself, the data can be normalized using the method `before()`. As an example, let's have an element that must be an array of strings (eg `['a', 'b', 'c']`), but receives input in the form of a string `a b c`: + +```php +$explode = fn($v) => explode(' ', $v); + +$schema = Expect::arrayOf('string') + ->before($explode); + +$normalized = $processor->process($schema, 'a b c'); +// OK, returns ['a', 'b', 'c'] +``` Mapping to Objects: from() @@ -407,35 +534,3 @@ $schema = Expect::from(new Config, [ 'name' => Expect::string()->pattern('\w:.*'), ]); ``` - - -Casting: castTo() ------------------ - -Successfully validated data can be cast: - -```php -Expect::scalar()->castTo('string'); -``` - -In addition to native PHP types, you can also cast to classes: - -```php -Expect::scalar()->castTo('AddressEntity'); -``` - - -Normalization: before() ------------------------ - -Prior to the validation itself, the data can be normalized using the method `before()`. As an example, let's have an element that must be an array of strings (eg `['a', 'b', 'c']`), but receives input in the form of a string `a b c`: - -```php -$explode = function ($v) { return explode(' ', $v); }; - -$schema = Expect::arrayOf('string') - ->before($explode); - -$normalized = $processor->process($schema, 'a b c'); -// OK, returns ['a', 'b', 'c'] -``` diff --git a/vendor/nette/schema/src/Schema/Context.php b/vendor/nette/schema/src/Schema/Context.php index e486d2e5..a002d5ce 100644 --- a/vendor/nette/schema/src/Schema/Context.php +++ b/vendor/nette/schema/src/Schema/Context.php @@ -1,40 +1,35 @@ - */ + public array $path = []; - /** @var string[] */ - public $path = []; + public bool $isKey = false; - /** @var bool */ - public $isKey = false; + /** @var list */ + public array $errors = []; - /** @var Message[] */ - public $errors = []; + /** @var list */ + public array $warnings = []; - /** @var Message[] */ - public $warnings = []; - - /** @var array[] */ - public $dynamics = []; + /** @var list}> */ + public array $dynamics = []; + /** @param array $variables */ public function addError(string $message, string $code, array $variables = []): Message { $variables['isKey'] = $this->isKey; @@ -42,8 +37,17 @@ final class Context } + /** @param array $variables */ public function addWarning(string $message, string $code, array $variables = []): Message { return $this->warnings[] = new Message($message, $code, $this->path, $variables); } + + + /** @return \Closure(): bool */ + public function createChecker(): \Closure + { + $count = count($this->errors); + return fn(): bool => $count === count($this->errors); + } } diff --git a/vendor/nette/schema/src/Schema/DynamicParameter.php b/vendor/nette/schema/src/Schema/DynamicParameter.php index 8dd61050..35ec47d5 100644 --- a/vendor/nette/schema/src/Schema/DynamicParameter.php +++ b/vendor/nette/schema/src/Schema/DynamicParameter.php @@ -1,12 +1,10 @@ -doNormalize($value, $context); } - public function merge($value, $base) + public function merge(mixed $value, mixed $base): mixed { - if (is_array($value) && isset($value[Helpers::PREVENT_MERGING])) { - unset($value[Helpers::PREVENT_MERGING]); + if (is_array($value) && isset($value[Helpers::PreventMerging])) { + unset($value[Helpers::PreventMerging]); return $value; } @@ -78,7 +73,16 @@ final class AnyOf implements Schema } - public function complete($value, Context $context) + public function complete(mixed $value, Context $context): mixed + { + $isOk = $context->createChecker(); + $value = $this->findAlternative($value, $context); + $isOk() && $value = $this->doTransform($value, $context); + return $isOk() ? $value : null; + } + + + private function findAlternative(mixed $value, Context $context): mixed { $expecteds = $innerErrors = []; foreach ($this->set as $item) { @@ -88,7 +92,7 @@ final class AnyOf implements Schema $res = $item->complete($item->normalize($value, $dolly), $dolly); if (!$dolly->errors) { $context->warnings = array_merge($context->warnings, $dolly->warnings); - return $this->doFinalize($res, $context); + return $res; } foreach ($dolly->errors as $error) { @@ -100,7 +104,7 @@ final class AnyOf implements Schema } } else { if ($item === $value) { - return $this->doFinalize($value, $context); + return $value; } $expecteds[] = Nette\Schema\Helpers::formatValue($item); @@ -112,22 +116,24 @@ final class AnyOf implements Schema } else { $context->addError( 'The %label% %path% expects to be %expected%, %value% given.', - Nette\Schema\Message::TYPE_MISMATCH, + Nette\Schema\Message::TypeMismatch, [ 'value' => $value, 'expected' => implode('|', array_unique($expecteds)), - ] + ], ); } + + return null; } - public function completeDefault(Context $context) + public function completeDefault(Context $context): mixed { if ($this->required) { $context->addError( 'The mandatory item %path% is missing.', - Nette\Schema\Message::MISSING_ITEM + Nette\Schema\Message::MissingItem, ); return null; } diff --git a/vendor/nette/schema/src/Schema/Elements/Base.php b/vendor/nette/schema/src/Schema/Elements/Base.php index 60817612..6e83eb7b 100644 --- a/vendor/nette/schema/src/Schema/Elements/Base.php +++ b/vendor/nette/schema/src/Schema/Elements/Base.php @@ -1,16 +1,16 @@ - */ + private array $transforms = []; + private ?string $deprecated = null; - public function default($value): self + public function default(mixed $value): self { $this->default = $value; return $this; @@ -51,24 +43,42 @@ trait Base } + /** @param callable(mixed): mixed $handler */ public function before(callable $handler): self { - $this->before = $handler; + $this->before = $handler(...); return $this; } public function castTo(string $type): self { - $this->castTo = $type; + return $this->transform(Helpers::getCastStrategy($type)); + } + + + /** @param callable(mixed, Context): mixed $handler */ + public function transform(callable $handler): self + { + $this->transforms[] = $handler(...); return $this; } + /** @param callable(mixed): bool $handler */ public function assert(callable $handler, ?string $description = null): self { - $this->asserts[] = [$handler, $description]; - return $this; + $expected = $description ?? (is_string($handler) ? "$handler()" : '#' . count($this->transforms)); + return $this->transform(function ($value, Context $context) use ($handler, $description, $expected) { + if ($handler($value)) { + return $value; + } + $context->addError( + 'Failed assertion ' . ($description ? "'%assertion%'" : '%assertion%') . ' for %label% %path% with value %value%.', + Nette\Schema\Message::FailedAssertion, + ['value' => $value, 'assertion' => $expected], + ); + }); } @@ -80,12 +90,12 @@ trait Base } - public function completeDefault(Context $context) + public function completeDefault(Context $context): mixed { if ($this->required) { $context->addError( 'The mandatory item %path% is missing.', - Nette\Schema\Message::MISSING_ITEM + Nette\Schema\Message::MissingItem, ); return null; } @@ -94,7 +104,7 @@ trait Base } - public function doNormalize($value, Context $context) + public function doNormalize(mixed $value, Context $context): mixed { if ($this->before) { $value = ($this->before)($value); @@ -109,92 +119,49 @@ trait Base if ($this->deprecated !== null) { $context->addWarning( $this->deprecated, - Nette\Schema\Message::DEPRECATED + Nette\Schema\Message::Deprecated, ); } } - private function doValidate($value, string $expected, Context $context): bool + private function doTransform(mixed $value, Context $context): mixed { - if (!Nette\Utils\Validators::is($value, $expected)) { - $expected = str_replace(['|', ':'], [' or ', ' in range '], $expected); - $context->addError( - 'The %label% %path% expects to be %expected%, %value% given.', - Nette\Schema\Message::TYPE_MISMATCH, - ['value' => $value, 'expected' => $expected] - ); - return false; - } - - return true; - } - - - private function doValidateRange($value, array $range, Context $context, string $types = ''): bool - { - if (is_array($value) || is_string($value)) { - [$length, $label] = is_array($value) - ? [count($value), 'items'] - : (in_array('unicode', explode('|', $types), true) - ? [Nette\Utils\Strings::length($value), 'characters'] - : [strlen($value), 'bytes']); - - if (!self::isInRange($length, $range)) { - $context->addError( - "The length of %label% %path% expects to be in range %expected%, %length% $label given.", - Nette\Schema\Message::LENGTH_OUT_OF_RANGE, - ['value' => $value, 'length' => $length, 'expected' => implode('..', $range)] - ); - return false; - } - } elseif ((is_int($value) || is_float($value)) && !self::isInRange($value, $range)) { - $context->addError( - 'The %label% %path% expects to be in range %expected%, %value% given.', - Nette\Schema\Message::VALUE_OUT_OF_RANGE, - ['value' => $value, 'expected' => implode('..', $range)] - ); - return false; - } - - return true; - } - - - private function isInRange($value, array $range): bool - { - return ($range[0] === null || $value >= $range[0]) - && ($range[1] === null || $value <= $range[1]); - } - - - private function doFinalize($value, Context $context) - { - if ($this->castTo) { - if (Nette\Utils\Reflection::isBuiltinType($this->castTo)) { - settype($value, $this->castTo); - } else { - $object = new $this->castTo; - foreach ($value as $k => $v) { - $object->$k = $v; - } - - $value = $object; + $isOk = $context->createChecker(); + foreach ($this->transforms as $handler) { + $value = $handler($value, $context); + if (!$isOk()) { + return null; } } - - foreach ($this->asserts as $i => [$handler, $description]) { - if (!$handler($value)) { - $expected = $description ?: (is_string($handler) ? "$handler()" : "#$i"); - $context->addError( - 'Failed assertion ' . ($description ? "'%assertion%'" : '%assertion%') . ' for %label% %path% with value %value%.', - Nette\Schema\Message::FAILED_ASSERTION, - ['value' => $value, 'assertion' => $expected] - ); - return; - } - } - return $value; } + + + /** @deprecated use Nette\Schema\Validators::validateType() */ + private function doValidate(mixed $value, string $expected, Context $context): bool + { + $isOk = $context->createChecker(); + Helpers::validateType($value, $expected, $context); + return $isOk(); + } + + + /** + * @deprecated use Nette\Schema\Validators::validateRange() + * @param array{?float, ?float} $range + */ + private static function doValidateRange(mixed $value, array $range, Context $context, string $types = ''): bool + { + $isOk = $context->createChecker(); + Helpers::validateRange($value, $range, $context, $types); + return $isOk(); + } + + + /** @deprecated use doTransform() */ + private function doFinalize(mixed $value, Context $context): mixed + { + return $this->doTransform($value, $context); + } } diff --git a/vendor/nette/schema/src/Schema/Elements/Structure.php b/vendor/nette/schema/src/Schema/Elements/Structure.php index a622dc1b..1abf49fc 100644 --- a/vendor/nette/schema/src/Schema/Elements/Structure.php +++ b/vendor/nette/schema/src/Schema/Elements/Structure.php @@ -1,51 +1,45 @@ -items = $items; - $this->castTo = 'object'; + (function (Schema ...$items) {})(...array_values($shape)); + $this->items = $shape; + $this->castTo('object'); $this->required = true; } - public function default($value): self + public function default(mixed $value): self { throw new Nette\InvalidStateException('Structure cannot have default value.'); } @@ -65,10 +59,7 @@ final class Structure implements Schema } - /** - * @param string|Schema $type - */ - public function otherItems($type = 'mixed'): self + public function otherItems(string|Schema $type = 'mixed'): self { $this->otherItems = $type instanceof Schema ? $type : new Type($type); return $this; @@ -82,13 +73,28 @@ final class Structure implements Schema } + /** @param Schema[]|self $shape */ + public function extend(array|self $shape): self + { + $shape = $shape instanceof self ? $shape->items : $shape; + return new self(array_merge($this->items, $shape)); + } + + + /** @return Schema[] */ + public function getShape(): array + { + return $this->items; + } + + /********************* processing ****************d*g**/ - public function normalize($value, Context $context) + public function normalize(mixed $value, Context $context): mixed { - if ($prevent = (is_array($value) && isset($value[Helpers::PREVENT_MERGING]))) { - unset($value[Helpers::PREVENT_MERGING]); + if ($prevent = (is_array($value) && isset($value[Helpers::PreventMerging]))) { + unset($value[Helpers::PreventMerging]); } $value = $this->doNormalize($value, $context); @@ -107,7 +113,7 @@ final class Structure implements Schema } if ($prevent) { - $value[Helpers::PREVENT_MERGING] = true; + $value[Helpers::PreventMerging] = true; } } @@ -115,37 +121,34 @@ final class Structure implements Schema } - public function merge($value, $base) + public function merge(mixed $value, mixed $base): mixed { - if (is_array($value) && isset($value[Helpers::PREVENT_MERGING])) { - unset($value[Helpers::PREVENT_MERGING]); + if (is_array($value) && isset($value[Helpers::PreventMerging])) { + unset($value[Helpers::PreventMerging]); $base = null; } if (is_array($value) && is_array($base)) { - $index = 0; + $index = $this->otherItems === null ? null : 0; foreach ($value as $key => $val) { if ($key === $index) { $base[] = $val; $index++; - } elseif (array_key_exists($key, $base)) { - $itemSchema = $this->items[$key] ?? $this->otherItems; - $base[$key] = $itemSchema - ? $itemSchema->merge($val, $base[$key]) - : Helpers::merge($val, $base[$key]); } else { - $base[$key] = $val; + $base[$key] = array_key_exists($key, $base) && ($itemSchema = $this->items[$key] ?? $this->otherItems) + ? $itemSchema->merge($val, $base[$key]) + : $val; } } return $base; } - return Helpers::merge($value, $base); + return $value ?? $base; } - public function complete($value, Context $context) + public function complete(mixed $value, Context $context): mixed { if ($value === null) { $value = []; // is unable to distinguish null from array in NEON @@ -153,25 +156,30 @@ final class Structure implements Schema $this->doDeprecation($context); - if (!$this->doValidate($value, 'array', $context) - || !$this->doValidateRange($value, $this->range, $context) - ) { - return; - } + $isOk = $context->createChecker(); + Helpers::validateType($value, 'array', $context); + $isOk() && Helpers::validateRange($value, $this->range, $context); + $isOk() && $this->validateItems($value, $context); + $isOk() && $value = $this->doTransform($value, $context); + return $isOk() ? $value : null; + } - $errCount = count($context->errors); + + /** @param array $value */ + private function validateItems(array &$value, Context $context): void + { $items = $this->items; if ($extraKeys = array_keys(array_diff_key($value, $items))) { if ($this->otherItems) { $items += array_fill_keys($extraKeys, $this->otherItems); } else { - $keys = array_map('strval', array_keys($items)); + $keys = array_map(strval(...), array_keys($items)); foreach ($extraKeys as $key) { - $hint = Nette\Utils\ObjectHelpers::getSuggestion($keys, (string) $key); + $hint = Nette\Utils\Helpers::getSuggestion($keys, (string) $key); $context->addError( 'Unexpected item %path%' . ($hint ? ", did you mean '%hint%'?" : '.'), - Nette\Schema\Message::UNEXPECTED_ITEM, - ['hint' => $hint] + Nette\Schema\Message::UnexpectedItem, + ['hint' => $hint], )->path[] = $key; } } @@ -190,16 +198,10 @@ final class Structure implements Schema array_pop($context->path); } - - if (count($context->errors) > $errCount) { - return; - } - - return $this->doFinalize($value, $context); } - public function completeDefault(Context $context) + public function completeDefault(Context $context): mixed { return $this->required ? $this->complete([], $context) diff --git a/vendor/nette/schema/src/Schema/Elements/Type.php b/vendor/nette/schema/src/Schema/Elements/Type.php index 5d8b2c09..4413f69a 100644 --- a/vendor/nette/schema/src/Schema/Elements/Type.php +++ b/vendor/nette/schema/src/Schema/Elements/Type.php @@ -1,43 +1,31 @@ -itemsValue = $valueType instanceof Schema ? $valueType @@ -110,10 +96,10 @@ final class Type implements Schema /********************* processing ****************d*g**/ - public function normalize($value, Context $context) + public function normalize(mixed $value, Context $context): mixed { - if ($prevent = (is_array($value) && isset($value[Helpers::PREVENT_MERGING]))) { - unset($value[Helpers::PREVENT_MERGING]); + if ($prevent = (is_array($value) && isset($value[Helpers::PreventMerging]))) { + unset($value[Helpers::PreventMerging]); } $value = $this->doNormalize($value, $context); @@ -134,17 +120,17 @@ final class Type implements Schema } if ($prevent && is_array($value)) { - $value[Helpers::PREVENT_MERGING] = true; + $value[Helpers::PreventMerging] = true; } return $value; } - public function merge($value, $base) + public function merge(mixed $value, mixed $base): mixed { - if (is_array($value) && isset($value[Helpers::PREVENT_MERGING])) { - unset($value[Helpers::PREVENT_MERGING]); + if (is_array($value) && isset($value[Helpers::PreventMerging])) { + unset($value[Helpers::PreventMerging]); return $value; } @@ -168,11 +154,11 @@ final class Type implements Schema } - public function complete($value, Context $context) + public function complete(mixed $value, Context $context): mixed { $merge = $this->merge; - if (is_array($value) && isset($value[Helpers::PREVENT_MERGING])) { - unset($value[Helpers::PREVENT_MERGING]); + if (is_array($value) && isset($value[Helpers::PreventMerging])) { + unset($value[Helpers::PreventMerging]); $merge = false; } @@ -182,49 +168,41 @@ final class Type implements Schema $this->doDeprecation($context); - if (!$this->doValidate($value, $this->type, $context) - || !$this->doValidateRange($value, $this->range, $context, $this->type) - ) { - return; - } - - if ($value !== null && $this->pattern !== null && !preg_match("\x01^(?:$this->pattern)$\x01Du", $value)) { - $context->addError( - "The %label% %path% expects to match pattern '%pattern%', %value% given.", - Nette\Schema\Message::PATTERN_MISMATCH, - ['value' => $value, 'pattern' => $this->pattern] - ); - return; + $isOk = $context->createChecker(); + Helpers::validateType($value, $this->type, $context); + $isOk() && Helpers::validateRange($value, $this->range, $context, $this->type); + $isOk() && $value !== null && $this->pattern !== null && Helpers::validatePattern($value, $this->pattern, $context); + $isOk() && is_array($value) && $this->validateItems($value, $context); + $isOk() && $merge && $value = Helpers::merge($value, $this->default); + $isOk() && $value = $this->doTransform($value, $context); + if (!$isOk()) { + return null; } if ($value instanceof DynamicParameter) { $expected = $this->type . ($this->range === [null, null] ? '' : ':' . implode('..', $this->range)); - $context->dynamics[] = [$value, str_replace(DynamicParameter::class . '|', '', $expected)]; + $context->dynamics[] = [$value, str_replace(DynamicParameter::class . '|', '', $expected), $context->path]; + } + return $value; + } + + + /** @param array $value */ + private function validateItems(array &$value, Context $context): void + { + if (!$this->itemsValue) { + return; } - if ($this->itemsValue) { - $errCount = count($context->errors); - $res = []; - foreach ($value as $key => $val) { - $context->path[] = $key; - $context->isKey = true; - $key = $this->itemsKey ? $this->itemsKey->complete($key, $context) : $key; - $context->isKey = false; - $res[$key] = $this->itemsValue->complete($val, $context); - array_pop($context->path); - } - - if (count($context->errors) > $errCount) { - return null; - } - - $value = $res; + $res = []; + foreach ($value as $key => $val) { + $context->path[] = $key; + $context->isKey = true; + $key = $this->itemsKey ? $this->itemsKey->complete($key, $context) : $key; + $context->isKey = false; + $res[$key ?? ''] = $this->itemsValue->complete($val, $context); + array_pop($context->path); } - - if ($merge) { - $value = Helpers::merge($value, $this->default); - } - - return $this->doFinalize($value, $context); + $value = $res; } } diff --git a/vendor/nette/schema/src/Schema/Expect.php b/vendor/nette/schema/src/Schema/Expect.php index f2999502..64e31f25 100644 --- a/vendor/nette/schema/src/Schema/Expect.php +++ b/vendor/nette/schema/src/Schema/Expect.php @@ -1,18 +1,17 @@ - $args */ public static function __callStatic(string $name, array $args): Type { $type = new Type($name); @@ -51,39 +48,34 @@ final class Expect } - /** - * @param mixed|Schema ...$set - */ - public static function anyOf(...$set): AnyOf + public static function anyOf(mixed ...$set): AnyOf { return new AnyOf(...$set); } - /** - * @param Schema[] $items - */ - public static function structure(array $items): Structure + /** @param Schema[] $shape */ + public static function structure(array $shape): Structure { - return new Structure($items); + return new Structure($shape); } - /** - * @param object $object - */ - public static function from($object, array $items = []): Structure + /** @param array $items */ + public static function from(object $object, array $items = []): Structure { $ro = new \ReflectionObject($object); - foreach ($ro->getProperties() as $prop) { - $type = Helpers::getPropertyType($prop) ?? 'mixed'; - $item = &$items[$prop->getName()]; - if (!$item) { + $props = $ro->hasMethod('__construct') + ? $ro->getMethod('__construct')->getParameters() + : $ro->getProperties(); + + foreach ($props as $prop) { + $name = $prop->getName(); + if (!isset($items[$name])) { + $type = Helpers::getPropertyType($prop) ?? 'mixed'; $item = new Type($type); - if (PHP_VERSION_ID >= 70400 && !$prop->isInitialized($object)) { - $item->required(); - } else { - $def = $prop->getValue($object); + if ($prop instanceof \ReflectionProperty ? $prop->isInitialized($object) : $prop->isOptional()) { + $def = ($prop instanceof \ReflectionProperty ? $prop->getValue($object) : $prop->getDefaultValue()); if (is_object($def)) { $item = static::from($def); } elseif ($def === null && !Nette\Utils\Validators::is(null, $type)) { @@ -91,7 +83,10 @@ final class Expect } else { $item->default($def); } + } else { + $item->required(); } + $items[$name] = $item; } } @@ -100,19 +95,24 @@ final class Expect /** - * @param string|Schema $valueType - * @param string|Schema|null $keyType + * @param mixed[] $shape */ - public static function arrayOf($valueType, $keyType = null): Type + public static function array(?array $shape = []): Structure|Type + { + $shape ??= []; + return Nette\Utils\Arrays::first($shape) instanceof Schema + ? (new Structure($shape))->castTo('array') + : (new Type('array'))->default($shape); + } + + + public static function arrayOf(string|Schema $valueType, string|Schema|null $keyType = null): Type { return (new Type('array'))->items($valueType, $keyType); } - /** - * @param string|Schema $type - */ - public static function listOf($type): Type + public static function listOf(string|Schema $type): Type { return (new Type('list'))->items($type); } diff --git a/vendor/nette/schema/src/Schema/Helpers.php b/vendor/nette/schema/src/Schema/Helpers.php index 0d2f12c4..79a4a3cf 100644 --- a/vendor/nette/schema/src/Schema/Helpers.php +++ b/vendor/nette/schema/src/Schema/Helpers.php @@ -1,16 +1,15 @@ - Reflection::expandClassName($m[0], $class), $type); } return null; @@ -75,9 +72,9 @@ final class Helpers /** * Returns an annotation value. - * @param \ReflectionProperty $ref + * @param \ReflectionClass|\ReflectionProperty $ref */ - public static function parseAnnotation(\Reflector $ref, string $name): ?string + public static function parseAnnotation(\ReflectionClass|\ReflectionProperty $ref, string $name): ?string { if (!Reflection::areCommentsAvailable()) { throw new Nette\InvalidStateException('You have to enable phpDoc comments in opcode cache.'); @@ -92,19 +89,97 @@ final class Helpers } - /** - * @param mixed $value - */ - public static function formatValue($value): string + public static function formatValue(mixed $value): string { - if (is_object($value)) { - return 'object ' . get_class($value); + if ($value instanceof DynamicParameter) { + return 'dynamic'; + } elseif (is_object($value)) { + return 'object ' . $value::class; } elseif (is_string($value)) { return "'" . Nette\Utils\Strings::truncate($value, 15, '...') . "'"; } elseif (is_scalar($value)) { - return var_export($value, true); + return var_export($value, return: true); } else { - return strtolower(gettype($value)); + return get_debug_type($value); + } + } + + + public static function validateType(mixed $value, string $expected, Context $context): void + { + if (!Nette\Utils\Validators::is($value, $expected)) { + $expected = str_replace(DynamicParameter::class . '|', '', $expected); + $expected = str_replace(['|', ':'], [' or ', ' in range '], $expected); + $context->addError( + 'The %label% %path% expects to be %expected%, %value% given.', + Message::TypeMismatch, + ['value' => $value, 'expected' => $expected], + ); + } + } + + + /** @param array{?float, ?float} $range */ + public static function validateRange(mixed $value, array $range, Context $context, string $types = ''): void + { + if (is_array($value) || is_string($value)) { + [$length, $label] = is_array($value) + ? [count($value), 'items'] + : (in_array('unicode', explode('|', $types), strict: true) + ? [Nette\Utils\Strings::length($value), 'characters'] + : [strlen($value), 'bytes']); + + if (!self::isInRange($length, $range)) { + $context->addError( + "The length of %label% %path% expects to be in range %expected%, %length% $label given.", + Message::LengthOutOfRange, + ['value' => $value, 'length' => $length, 'expected' => implode('..', $range)], + ); + } + } elseif ((is_int($value) || is_float($value)) && !self::isInRange($value, $range)) { + $context->addError( + 'The %label% %path% expects to be in range %expected%, %value% given.', + Message::ValueOutOfRange, + ['value' => $value, 'expected' => implode('..', $range)], + ); + } + } + + + /** @param array{?float, ?float} $range */ + public static function isInRange(mixed $value, array $range): bool + { + return ($range[0] === null || $value >= $range[0]) + && ($range[1] === null || $value <= $range[1]); + } + + + public static function validatePattern(string $value, string $pattern, Context $context): void + { + if (!preg_match("\x01^(?:$pattern)$\x01Du", $value)) { + $context->addError( + "The %label% %path% expects to match pattern '%pattern%', %value% given.", + Message::PatternMismatch, + ['value' => $value, 'pattern' => $pattern], + ); + } + } + + + /** @return \Closure(mixed): mixed */ + public static function getCastStrategy(string $type): \Closure + { + if (Nette\Utils\Validators::isBuiltinType($type)) { + return static function ($value) use ($type) { + settype($value, $type); + return $value; + }; + } elseif (method_exists($type, '__construct')) { + return static fn($value) => is_array($value) || $value instanceof \stdClass + ? new $type(...(array) $value) + : new $type($value); + } else { + return static fn($value) => Nette\Utils\Arrays::toObject((array) $value, new $type); } } } diff --git a/vendor/nette/schema/src/Schema/Message.php b/vendor/nette/schema/src/Schema/Message.php index 49c32bd5..4923f14a 100644 --- a/vendor/nette/schema/src/Schema/Message.php +++ b/vendor/nette/schema/src/Schema/Message.php @@ -1,64 +1,74 @@ -message = $message; - $this->code = $code; - $this->path = $path; - $this->variables = $variables; + public function __construct( + public string $message, + public string $code, + /** @var list */ + public array $path, + /** @var array */ + public array $variables = [], + ) { } diff --git a/vendor/nette/schema/src/Schema/Processor.php b/vendor/nette/schema/src/Schema/Processor.php index a10a0ef6..4a2ef7bc 100644 --- a/vendor/nette/schema/src/Schema/Processor.php +++ b/vendor/nette/schema/src/Schema/Processor.php @@ -1,12 +1,10 @@ - */ + public array $onNewContext = []; + private Context $context; + private bool $skipDefaults = false; - public function skipDefaults(bool $value = true) + public function skipDefaults(bool $value = true): void { $this->skipDefaults = $value; } @@ -37,10 +29,9 @@ final class Processor /** * Normalizes and validates data. Result is a clean completed data. - * @return mixed * @throws ValidationException */ - public function process(Schema $schema, $data) + public function process(Schema $schema, mixed $data): mixed { $this->createContext(); $data = $schema->normalize($data, $this->context); @@ -53,10 +44,10 @@ final class Processor /** * Normalizes and validates and merges multiple data. Result is a clean completed data. - * @return mixed + * @param list $dataset * @throws ValidationException */ - public function processMultiple(Schema $schema, array $dataset) + public function processMultiple(Schema $schema, array $dataset): mixed { $this->createContext(); $flatten = null; @@ -74,9 +65,7 @@ final class Processor } - /** - * @return string[] - */ + /** @return list */ public function getWarnings(): array { $res = []; @@ -96,10 +85,10 @@ final class Processor } - private function createContext() + private function createContext(): void { $this->context = new Context; $this->context->skipDefaults = $this->skipDefaults; - $this->onNewContext($this->context); + Nette\Utils\Arrays::invoke($this->onNewContext, $this->context); } } diff --git a/vendor/nette/schema/src/Schema/Schema.php b/vendor/nette/schema/src/Schema/Schema.php index bbd8bd09..1616f642 100644 --- a/vendor/nette/schema/src/Schema/Schema.php +++ b/vendor/nette/schema/src/Schema/Schema.php @@ -1,12 +1,10 @@ -toString()); - $this->messages = $messages; + public function __construct( + ?string $message, + /** @var list */ + private array $messages = [], + ) { + parent::__construct($message ?? $messages[0]->toString()); } - /** - * @return string[] - */ + /** @return list */ public function getMessages(): array { $res = []; @@ -45,9 +36,7 @@ class ValidationException extends Nette\InvalidStateException } - /** - * @return Message[] - */ + /** @return list */ public function getMessageObjects(): array { return $this->messages; diff --git a/vendor/nette/utils/.phpstorm.meta.php b/vendor/nette/utils/.phpstorm.meta.php index 25851af6..64dc4870 100644 --- a/vendor/nette/utils/.phpstorm.meta.php +++ b/vendor/nette/utils/.phpstorm.meta.php @@ -1,6 +1,4 @@ -=8.0 <8.3" + "php": "8.2 - 8.5" }, "require-dev": { - "nette/tester": "^2.4", + "nette/tester": "^2.5", "tracy/tracy": "^2.9", - "phpstan/phpstan": "^1.0", - "jetbrains/phpstorm-attributes": "dev-master" + "phpstan/phpstan": "^2.1@stable", + "phpstan/extension-installer": "^1.4@stable", + "nette/phpstan-rules": "^1.0", + "jetbrains/phpstorm-attributes": "^1.2" }, "conflict": { "nette/finder": "<3", "nette/schema": "<1.2.2" }, "suggest": { - "ext-iconv": "to use Strings::webalize(), toAscii(), chr() and reverse()", + "ext-iconv": "to use Strings::chr(), ord() and reverse()", "ext-json": "to use Nette\\Utils\\Json", "ext-intl": "to use Strings::webalize(), toAscii(), normalize() and compare()", "ext-mbstring": "to use Strings::lower() etc...", - "ext-xml": "to use Strings::length() etc. when mbstring is not available", "ext-gd": "to use Image", "ext-tokenizer": "to use Nette\\Utils\\Reflection::getUseStatements()" }, "autoload": { - "classmap": ["src/"] + "classmap": ["src/"], + "psr-4": { + "Nette\\": "src" + } }, "minimum-stability": "dev", "scripts": { @@ -46,7 +50,12 @@ }, "extra": { "branch-alias": { - "dev-master": "4.0-dev" + "dev-master": "4.1-dev" + } + }, + "config": { + "allow-plugins": { + "phpstan/extension-installer": true } } } diff --git a/vendor/nette/utils/readme.md b/vendor/nette/utils/readme.md index ff2ab46c..8c717be4 100644 --- a/vendor/nette/utils/readme.md +++ b/vendor/nette/utils/readme.md @@ -1,5 +1,4 @@ -Nette Utility Classes -===================== +[![Nette Utils](https://github.com/nette/utils/assets/194960/c33fdb74-0652-4cad-ac6e-c1ce0d29e32a)](https://doc.nette.org/en/utils) [![Downloads this Month](https://img.shields.io/packagist/dm/nette/utils.svg)](https://packagist.org/packages/nette/utils) [![Tests](https://github.com/nette/utils/workflows/Tests/badge.svg?branch=master)](https://github.com/nette/utils/actions) @@ -11,25 +10,27 @@ Nette Utility Classes Introduction ------------ -In package nette/utils you will find a set of [useful classes](https://doc.nette.org/utils) for everyday use: +In package nette/utils you will find a set of useful classes for everyday use: -- [Arrays](https://doc.nette.org/utils/arrays) - manipulate arrays -- [Callback](https://doc.nette.org/utils/callback) - PHP callbacks -- [Date and Time](https://doc.nette.org/utils/datetime) - modify times and dates -- [Filesystem](https://doc.nette.org/utils/filesystem) - copying, renaming, … -- [Finder](https://doc.nette.org/utils/finder) - finds files and directories -- [Helper Functions](https://doc.nette.org/utils/helpers) -- [HTML elements](https://doc.nette.org/utils/html-elements) - generate HTML -- [Images](https://doc.nette.org/utils/images) - crop, resize, rotate images -- [JSON](https://doc.nette.org/utils/json) - encoding and decoding -- [Generating Random Strings](https://doc.nette.org/utils/random) -- [Paginator](https://doc.nette.org/utils/paginator) - pagination math -- [PHP Reflection](https://doc.nette.org/utils/reflection) -- [Strings](https://doc.nette.org/utils/strings) - useful text functions -- [SmartObject](https://doc.nette.org/utils/smartobject) - PHP object enhancements -- [Validation](https://doc.nette.org/utils/validators) - validate inputs -- [Type](https://doc.nette.org/utils/type) - PHP data type +✅ [Arrays](https://doc.nette.org/utils/arrays)
+✅ [Callback](https://doc.nette.org/utils/callback) - PHP callbacks
+✅ [Filesystem](https://doc.nette.org/utils/filesystem) - copying, renaming, …
+✅ [Finder](https://doc.nette.org/utils/finder) - finds files and directories
+✅ [Floats](https://doc.nette.org/utils/floats) - floating point numbers
+✅ [Helper Functions](https://doc.nette.org/utils/helpers)
+✅ [HTML elements](https://doc.nette.org/utils/html-elements) - generate HTML
+✅ [Images](https://doc.nette.org/utils/images) - crop, resize, rotate images
+✅ [Iterables](https://doc.nette.org/utils/iterables)
+✅ [JSON](https://doc.nette.org/utils/json) - encoding and decoding
+✅ [Generating Random Strings](https://doc.nette.org/utils/random)
+✅ [Paginator](https://doc.nette.org/utils/paginator) - pagination math
+✅ [PHP Reflection](https://doc.nette.org/utils/reflection)
+✅ [Strings](https://doc.nette.org/utils/strings) - useful text functions
+✅ [SmartObject](https://doc.nette.org/utils/smartobject) - PHP object enhancements
+✅ [Type](https://doc.nette.org/utils/type) - PHP data type
+✅ [Validation](https://doc.nette.org/utils/validators) - validate inputs
Installation ------------ @@ -40,11 +41,9 @@ The recommended way to install is via Composer: composer require nette/utils ``` -- Nette Utils 4.0 is compatible with PHP 8.0 to 8.2 -- Nette Utils 3.2 is compatible with PHP 7.2 to 8.2 -- Nette Utils 3.1 is compatible with PHP 7.1 to 8.0 -- Nette Utils 3.0 is compatible with PHP 7.1 to 8.0 -- Nette Utils 2.5 is compatible with PHP 5.6 to 8.0 +Nette Utils 4.1 is compatible with PHP 8.2 to 8.5. + +  [Support Me](https://github.com/sponsors/dg) -------------------------------------------- diff --git a/vendor/nette/utils/src/HtmlStringable.php b/vendor/nette/utils/src/HtmlStringable.php index d749d4ee..c9600d2c 100644 --- a/vendor/nette/utils/src/HtmlStringable.php +++ b/vendor/nette/utils/src/HtmlStringable.php @@ -1,19 +1,20 @@ -> * @property-read bool $first * @property-read bool $last * @property-read bool $empty * @property-read bool $odd * @property-read bool $even * @property-read int $counter - * @property-read mixed $nextKey - * @property-read mixed $nextValue + * @property-read TKey $nextKey + * @property-read TValue $nextValue */ class CachingIterator extends \CachingIterator implements \Countable { @@ -31,26 +32,13 @@ class CachingIterator extends \CachingIterator implements \Countable private int $counter = 0; - public function __construct($iterator) + /** @param iterable|\stdClass $iterable */ + public function __construct(iterable|\stdClass $iterable) { - if (is_array($iterator) || $iterator instanceof \stdClass) { - $iterator = new \ArrayIterator($iterator); - - } elseif ($iterator instanceof \IteratorAggregate) { - do { - $iterator = $iterator->getIterator(); - } while ($iterator instanceof \IteratorAggregate); - - assert($iterator instanceof \Iterator); - - } elseif ($iterator instanceof \Iterator) { - } elseif ($iterator instanceof \Traversable) { - $iterator = new \IteratorIterator($iterator); - } else { - throw new Nette\InvalidArgumentException(sprintf('Invalid argument passed to %s; array or Traversable expected, %s given.', self::class, is_object($iterator) ? $iterator::class : gettype($iterator))); - } - - parent::__construct($iterator, 0); + $iterable = $iterable instanceof \stdClass + ? new \ArrayIterator((array) $iterable) + : Nette\Utils\Iterables::toIterator($iterable); + parent::__construct($iterable, 0); } @@ -72,45 +60,30 @@ class CachingIterator extends \CachingIterator implements \Countable } - /** - * Is the iterator empty? - */ public function isEmpty(): bool { return $this->counter === 0; } - /** - * Is the counter odd? - */ public function isOdd(): bool { return $this->counter % 2 === 1; } - /** - * Is the counter even? - */ public function isEven(): bool { return $this->counter % 2 === 0; } - /** - * Returns the counter. - */ public function getCounter(): int { return $this->counter; } - /** - * Returns the count of elements. - */ public function count(): int { $inner = $this->getInnerIterator(); @@ -145,18 +118,14 @@ class CachingIterator extends \CachingIterator implements \Countable } - /** - * Returns the next key. - */ + /** @return TKey */ public function getNextKey(): mixed { return $this->getInnerIterator()->key(); } - /** - * Returns the next element. - */ + /** @return TValue */ public function getNextValue(): mixed { return $this->getInnerIterator()->current(); diff --git a/vendor/nette/utils/src/Iterators/Mapper.php b/vendor/nette/utils/src/Iterators/Mapper.php index 87823baf..a9cfba04 100644 --- a/vendor/nette/utils/src/Iterators/Mapper.php +++ b/vendor/nette/utils/src/Iterators/Mapper.php @@ -1,29 +1,25 @@ -callback = $callback; + $this->callback = $callback(...); } diff --git a/vendor/nette/utils/src/SmartObject.php b/vendor/nette/utils/src/SmartObject.php index dca02d9d..d9742c8b 100644 --- a/vendor/nette/utils/src/SmartObject.php +++ b/vendor/nette/utils/src/SmartObject.php @@ -1,12 +1,10 @@ - + * @implements \ArrayAccess */ class ArrayHash extends \stdClass implements \ArrayAccess, \Countable, \IteratorAggregate { @@ -27,7 +28,7 @@ class ArrayHash extends \stdClass implements \ArrayAccess, \Countable, \Iterator $obj = new static; foreach ($array as $key => $value) { $obj->$key = $recursive && is_array($value) - ? static::from($value, true) + ? static::from($value) : $value; } @@ -36,8 +37,7 @@ class ArrayHash extends \stdClass implements \ArrayAccess, \Countable, \Iterator /** - * Returns an iterator over all items. - * @return \Iterator + * @return \Iterator */ public function &getIterator(): \Iterator { @@ -47,9 +47,6 @@ class ArrayHash extends \stdClass implements \ArrayAccess, \Countable, \Iterator } - /** - * Returns items count. - */ public function count(): int { return count((array) $this); @@ -57,14 +54,14 @@ class ArrayHash extends \stdClass implements \ArrayAccess, \Countable, \Iterator /** - * Replaces or appends a item. - * @param string|int $key + * Replaces or appends an item. + * @param array-key $key * @param T $value */ public function offsetSet($key, $value): void { if (!is_scalar($key)) { // prevents null - throw new Nette\InvalidArgumentException(sprintf('Key must be either a string or an integer, %s given.', gettype($key))); + throw new Nette\InvalidArgumentException(sprintf('Key must be either a string or an integer, %s given.', get_debug_type($key))); } $this->$key = $value; @@ -72,20 +69,19 @@ class ArrayHash extends \stdClass implements \ArrayAccess, \Countable, \Iterator /** - * Returns a item. - * @param string|int $key + * Returns an item. + * @param array-key $key * @return T */ - #[\ReturnTypeWillChange] - public function offsetGet($key) + public function offsetGet($key): mixed { return $this->$key; } /** - * Determines whether a item exists. - * @param string|int $key + * Determines whether an item exists. + * @param array-key $key */ public function offsetExists($key): bool { @@ -95,7 +91,7 @@ class ArrayHash extends \stdClass implements \ArrayAccess, \Countable, \Iterator /** * Removes the element from this list. - * @param string|int $key + * @param array-key $key */ public function offsetUnset($key): void { diff --git a/vendor/nette/utils/src/Utils/ArrayList.php b/vendor/nette/utils/src/Utils/ArrayList.php index 4f32061b..90b3ec07 100644 --- a/vendor/nette/utils/src/Utils/ArrayList.php +++ b/vendor/nette/utils/src/Utils/ArrayList.php @@ -1,31 +1,31 @@ - + * @implements \ArrayAccess */ class ArrayList implements \ArrayAccess, \Countable, \IteratorAggregate { - use Nette\SmartObject; - + /** @var list */ private array $list = []; /** * Transforms array to ArrayList. - * @param array $array + * @param list $array */ public static function from(array $array): static { @@ -40,7 +40,6 @@ class ArrayList implements \ArrayAccess, \Countable, \IteratorAggregate /** - * Returns an iterator over all items. * @return \Iterator */ public function &getIterator(): \Iterator @@ -51,9 +50,6 @@ class ArrayList implements \ArrayAccess, \Countable, \IteratorAggregate } - /** - * Returns items count. - */ public function count(): int { return count($this->list); @@ -61,8 +57,8 @@ class ArrayList implements \ArrayAccess, \Countable, \IteratorAggregate /** - * Replaces or appends a item. - * @param int|null $index + * Replaces or appends an item. + * @param ?int $index * @param T $value * @throws Nette\OutOfRangeException */ @@ -81,7 +77,7 @@ class ArrayList implements \ArrayAccess, \Countable, \IteratorAggregate /** - * Returns a item. + * Returns an item. * @param int $index * @return T * @throws Nette\OutOfRangeException @@ -97,7 +93,7 @@ class ArrayList implements \ArrayAccess, \Countable, \IteratorAggregate /** - * Determines whether a item exists. + * Determines whether an item exists. * @param int $index */ public function offsetExists($index): bool @@ -122,13 +118,13 @@ class ArrayList implements \ArrayAccess, \Countable, \IteratorAggregate /** - * Prepends a item. + * Prepends an item. * @param T $value */ public function prepend(mixed $value): void { - $first = array_slice($this->list, 0, 1); - $this->offsetSet(0, $value); - array_splice($this->list, 1, 0, $first); + // route the value through offsetSet() first so a validation added in a subclass isn't bypassed + $this->offsetSet(null, $value); + array_unshift($this->list, ...array_splice($this->list, -1)); } } diff --git a/vendor/nette/utils/src/Utils/Arrays.php b/vendor/nette/utils/src/Utils/Arrays.php index 336b3dfc..51b346fa 100644 --- a/vendor/nette/utils/src/Utils/Arrays.php +++ b/vendor/nette/utils/src/Utils/Arrays.php @@ -1,21 +1,20 @@ - $array1 * @param array $array2 - * @return array + * @return array> */ public static function mergeTree(array $array1, array $array2): array { @@ -95,17 +94,19 @@ class Arrays /** * Returns zero-indexed position of given array key. Returns null if key is not found. + * @param array $array */ public static function getKeyOffset(array $array, string|int $key): ?int { - return Helpers::falseToNull(array_search(self::toKey($key), array_keys($array), true)); + return Helpers::falseToNull(array_search(self::toKey($key), array_keys($array), strict: true)); } /** + * @param array $array * @deprecated use getKeyOffset() */ - public static function searchKey(array $array, $key): ?int + public static function searchKey(array $array, string|int $key): ?int { return self::getKeyOffset($array, $key); } @@ -113,53 +114,110 @@ class Arrays /** * Tests an array for the presence of value. + * @param array $array */ public static function contains(array $array, mixed $value): bool { - return in_array($value, $array, true); + return in_array($value, $array, strict: true); } /** - * Returns the first item from the array or null if array is empty. - * @template T - * @param array $array - * @return ?T + * Returns the first item (matching the specified predicate if given). If there is no such item, it returns result of invoking $else or null. + * @template K of int|string + * @template V + * @template E + * @param array $array + * @param ?callable(V, K, array): bool $predicate + * @param ?callable(): E $else + * @return ($else is null ? ?V : V|E) */ - public static function first(array $array): mixed + public static function first(array $array, ?callable $predicate = null, ?callable $else = null): mixed { - return count($array) ? reset($array) : null; + $key = self::firstKey($array, $predicate); + return $key === null + ? ($else ? $else() : null) + : $array[$key]; } /** - * Returns the last item from the array or null if array is empty. - * @template T - * @param array $array - * @return ?T + * Returns the last item (matching the specified predicate if given). If there is no such item, it returns result of invoking $else or null. + * @template K of int|string + * @template V + * @template E + * @param array $array + * @param ?callable(V, K, array): bool $predicate + * @param ?callable(): E $else + * @return ($else is null ? ?V : V|E) */ - public static function last(array $array): mixed + public static function last(array $array, ?callable $predicate = null, ?callable $else = null): mixed { - return count($array) ? end($array) : null; + $key = self::lastKey($array, $predicate); + return $key === null + ? ($else ? $else() : null) + : $array[$key]; + } + + + /** + * Returns the key of first item (matching the specified predicate if given) or null if there is no such item. + * @template K of int|string + * @template V + * @param array $array + * @param ?callable(V, K, array): bool $predicate + * @return ?K + */ + public static function firstKey(array $array, ?callable $predicate = null): int|string|null + { + if (!$predicate) { + return array_key_first($array); + } + foreach ($array as $k => $v) { + if ($predicate($v, $k, $array)) { + return $k; + } + } + return null; + } + + + /** + * Returns the key of last item (matching the specified predicate if given) or null if there is no such item. + * @template K of int|string + * @template V + * @param array $array + * @param ?callable(V, K, array): bool $predicate + * @return ?K + */ + public static function lastKey(array $array, ?callable $predicate = null): int|string|null + { + return $predicate + ? self::firstKey(array_reverse($array, preserve_keys: true), $predicate) + : array_key_last($array); + } + + + /** + * Inserts the contents of the $inserted array into the $array immediately before the $key. + * If $key is null (or does not exist), it is inserted at the beginning. + * @param array $array + * @param array $inserted + */ + public static function insertBefore(array &$array, string|int|null $key, array $inserted): void + { + $offset = $key === null ? 0 : (int) self::getKeyOffset($array, $key); + $array = array_slice($array, 0, $offset, preserve_keys: true) + + $inserted + + array_slice($array, $offset, count($array), preserve_keys: true); } /** * Inserts the contents of the $inserted array into the $array immediately after the $key. - * If $key is null (or does not exist), it is inserted at the beginning. - */ - public static function insertBefore(array &$array, string|int|null $key, array $inserted): void - { - $offset = $key === null ? 0 : (int) self::getKeyOffset($array, $key); - $array = array_slice($array, 0, $offset, true) - + $inserted - + array_slice($array, $offset, count($array), true); - } - - - /** - * Inserts the contents of the $inserted array into the $array before the $key. * If $key is null (or does not exist), it is inserted at the end. + * @param array $array + * @param array $inserted */ public static function insertAfter(array &$array, string|int|null $key, array $inserted): void { @@ -167,14 +225,15 @@ class Arrays $offset = count($array) - 1; } - $array = array_slice($array, 0, $offset + 1, true) + $array = array_slice($array, 0, $offset + 1, preserve_keys: true) + $inserted - + array_slice($array, $offset + 1, count($array), true); + + array_slice($array, $offset + 1, count($array), preserve_keys: true); } /** * Renames key in array. + * @param array $array */ public static function renameKey(array &$array, string|int $oldKey, string|int $newKey): bool { @@ -211,6 +270,8 @@ class Arrays /** * Transforms multidimensional array to flat array. + * @param array $array + * @return array */ public static function flatten(array $array, bool $preserveKeys = false): array { @@ -225,28 +286,28 @@ class Arrays /** * Checks if the array is indexed in ascending order of numeric keys from zero, a.k.a list. + * @return ($value is list ? true : false) */ public static function isList(mixed $value): bool { - return is_array($value) && (PHP_VERSION_ID < 80100 - ? !$value || array_keys($value) === range(0, count($value) - 1) - : array_is_list($value) - ); + return is_array($value) && array_is_list($value); } /** - * Reformats table to associative tree. Path looks like 'field|field[]field->field=field'. - * @param string|string[] $path + * Transforms a flat array of rows into an associative tree using a path expression like 'field|field[]field->field=field'. + * @param array $array + * @param string|list $path + * @return array|\stdClass */ - public static function associate(array $array, $path): array|\stdClass + public static function associate(array $array, string|array $path): array|\stdClass { $parts = is_array($path) ? $path - : preg_split('#(\[\]|->|=|\|)#', $path, -1, PREG_SPLIT_DELIM_CAPTURE | PREG_SPLIT_NO_EMPTY); + : preg_split('#(\[]|->|=|\|)#', $path, -1, PREG_SPLIT_DELIM_CAPTURE | PREG_SPLIT_NO_EMPTY); if (!$parts || $parts === ['->'] || $parts[0] === '=' || $parts[0] === '|') { - throw new Nette\InvalidArgumentException("Invalid path '$path'."); + throw new Nette\InvalidArgumentException("Invalid path '" . (is_array($path) ? implode('', $path) : $path) . "'."); } $res = $parts[0] === '->' ? new \stdClass : []; @@ -265,6 +326,8 @@ class Arrays $x = $row[$parts[$i]]; $row = null; } + break; // '=' is always the final operation + } elseif ($part === '->') { if (isset($parts[++$i])) { if ($x === null) { @@ -290,7 +353,9 @@ class Arrays /** - * Normalizes array to associative array. Replace numeric keys with their values, the new value will be $filling. + * Converts array to associative: items with numeric keys are converted to keys, with $filling as their value. + * @param array $array + * @return array */ public static function normalize(array $array, mixed $filling = null): array { @@ -329,13 +394,16 @@ class Arrays /** - * Tests whether at least one element in the array passes the test implemented by the - * provided callback with signature `function ($value, $key, array $array): bool`. + * Tests whether at least one element in the array passes the test implemented by the provided function. + * @template K of int|string + * @template V + * @param array $array + * @param callable(V, K, array): bool $predicate */ - public static function some(iterable $array, callable $callback): bool + public static function some(iterable $array, callable $predicate): bool { foreach ($array as $k => $v) { - if ($callback($v, $k, $array)) { + if ($predicate($v, $k, $array)) { return true; } } @@ -345,13 +413,16 @@ class Arrays /** - * Tests whether all elements in the array pass the test implemented by the provided function, - * which has the signature `function ($value, $key, array $array): bool`. + * Tests whether all elements in the array pass the test implemented by the provided function. + * @template K of int|string + * @template V + * @param array $array + * @param callable(V, K, array): bool $predicate */ - public static function every(iterable $array, callable $callback): bool + public static function every(iterable $array, callable $predicate): bool { foreach ($array as $k => $v) { - if (!$callback($v, $k, $array)) { + if (!$predicate($v, $k, $array)) { return false; } } @@ -361,14 +432,64 @@ class Arrays /** - * Calls $callback on all elements in the array and returns the array of return values. - * The callback has the signature `function ($value, $key, array $array): bool`. + * Returns a new array containing all key-value pairs matching the given $predicate. + * @template K of int|string + * @template V + * @param array $array + * @param callable(V, K, array): bool $predicate + * @return array */ - public static function map(iterable $array, callable $callback): array + public static function filter(array $array, callable $predicate): array { $res = []; foreach ($array as $k => $v) { - $res[$k] = $callback($v, $k, $array); + if ($predicate($v, $k, $array)) { + $res[$k] = $v; + } + } + return $res; + } + + + /** + * Returns an array containing the original keys and results of applying the given transform function to each element. + * @template K of int|string + * @template V + * @template R + * @param array $array + * @param callable(V, K, array): R $transformer + * @return array + */ + public static function map(iterable $array, callable $transformer): array + { + $res = []; + foreach ($array as $k => $v) { + $res[$k] = $transformer($v, $k, $array); + } + + return $res; + } + + + /** + * Returns an array containing new keys and values generated by applying the given transform function to each element. + * If the function returns null, the element is skipped. + * @template K of int|string + * @template V + * @template ResK of int|string + * @template ResV + * @param array $array + * @param callable(V, K, array): ?array{ResK, ResV} $transformer + * @return array + */ + public static function mapWithKeys(array $array, callable $transformer): array + { + $res = []; + foreach ($array as $k => $v) { + $pair = $transformer($v, $k, $array); + if ($pair) { + $res[$pair[0]] = $pair[1]; + } } return $res; @@ -377,9 +498,10 @@ class Arrays /** * Invokes all callbacks and returns array of results. - * @param callable[] $callbacks + * @param iterable $callbacks + * @return array */ - public static function invoke(iterable $callbacks, ...$args): array + public static function invoke(iterable $callbacks, mixed ...$args): array { $res = []; foreach ($callbacks as $k => $cb) { @@ -392,9 +514,10 @@ class Arrays /** * Invokes method on every object in an array and returns array of results. - * @param object[] $objects + * @param iterable $objects + * @return array */ - public static function invokeMethod(iterable $objects, string $method, ...$args): array + public static function invokeMethod(iterable $objects, string $method, mixed ...$args): array { $res = []; foreach ($objects as $k => $obj) { @@ -408,6 +531,7 @@ class Arrays /** * Copies the elements of the $array array to the $object object and then returns it. * @template T of object + * @param iterable $array * @param T $object * @return T */ @@ -426,13 +550,12 @@ class Arrays */ public static function toKey(mixed $value): int|string { - return key([$value => null]); + return key(@[$value => null]); } /** - * Returns copy of the $array where every item is converted to string - * and prefixed by $prefix and suffixed by $suffix. + * Returns a copy of $array where every item is cast to string and wrapped with $prefix and $suffix. * @param string[] $array * @return string[] */ diff --git a/vendor/nette/utils/src/Utils/Callback.php b/vendor/nette/utils/src/Utils/Callback.php index 496c1e7a..1c34ac9d 100644 --- a/vendor/nette/utils/src/Utils/Callback.php +++ b/vendor/nette/utils/src/Utils/Callback.php @@ -1,16 +1,14 @@ - $args + * @param callable(string, int): (bool|void|null) $onError */ public static function invokeSafe(string $function, array $args, callable $onError): mixed { - $prev = set_error_handler(function ($severity, $message, $file) use ($onError, &$prev, $function): ?bool { + $prev = set_error_handler(function (int $severity, string $message, string $file, int $line) use ($onError, &$prev, $function): bool { if ($file === __FILE__) { $msg = ini_get('html_errors') ? Html::htmlToText($message) : $message; - $msg = preg_replace("#^$function\\(.*?\\): #", '', $msg); + $msg = (string) preg_replace("#^$function\\(.*?\\): #", '', $msg); if ($onError($msg, $severity) !== false) { - return null; + return true; } } - return $prev ? $prev(...func_get_args()) : false; + return $prev ? $prev(...func_get_args()) !== false : false; }); try { @@ -48,12 +49,12 @@ final class Callback /** - * Checks that $callable is valid PHP callback. Otherwise throws exception. If the $syntax is set to true, only verifies - * that $callable has a valid structure to be used as a callback, but does not verify if the class or method actually exists. + * Checks that $callable is a valid PHP callback and returns it. With $syntax set to true, only verifies + * the structural validity without checking whether the class or method actually exists. * @return callable * @throws Nette\InvalidArgumentException */ - public static function check(mixed $callable, bool $syntax = false) + public static function check(mixed $callable, bool $syntax = false): mixed { if (!is_callable($callable, $syntax)) { throw new Nette\InvalidArgumentException( @@ -87,19 +88,20 @@ final class Callback * @param callable $callable type check is escalated to ReflectionException * @throws \ReflectionException if callback is not valid */ - public static function toReflection($callable): \ReflectionMethod|\ReflectionFunction + public static function toReflection(mixed $callable): \ReflectionMethod|\ReflectionFunction { if ($callable instanceof \Closure) { $callable = self::unwrap($callable); } if (is_string($callable) && str_contains($callable, '::')) { - return new \ReflectionMethod($callable); + return new ReflectionMethod(...explode('::', $callable, 2)); } elseif (is_array($callable)) { - return new \ReflectionMethod($callable[0], $callable[1]); + return new ReflectionMethod($callable[0], $callable[1]); } elseif (is_object($callable) && !$callable instanceof \Closure) { - return new \ReflectionMethod($callable, '__invoke'); + return new ReflectionMethod($callable, '__invoke'); } else { + assert($callable instanceof \Closure || is_string($callable)); return new \ReflectionFunction($callable); } } @@ -116,18 +118,20 @@ final class Callback /** * Unwraps closure created by Closure::fromCallable(). + * @return callable|array{object|class-string, string}|string */ - public static function unwrap(\Closure $closure): callable|array + public static function unwrap(\Closure $closure): callable|array|string { $r = new \ReflectionFunction($closure); + $class = $r->getClosureScopeClass()?->name; if (str_ends_with($r->name, '}')) { return $closure; - } elseif ($obj = $r->getClosureThis()) { + } elseif (($obj = $r->getClosureThis()) && $obj::class === $class) { return [$obj, $r->name]; - } elseif ($class = $r->getClosureScopeClass()) { - return [$class->name, $r->name]; + } elseif ($class) { + return [$class, $r->name]; } else { return $r->name; diff --git a/vendor/nette/utils/src/Utils/DateTime.php b/vendor/nette/utils/src/Utils/DateTime.php index 963407c0..af4e94d7 100644 --- a/vendor/nette/utils/src/Utils/DateTime.php +++ b/vendor/nette/utils/src/Utils/DateTime.php @@ -1,24 +1,20 @@ -format('Y-m-d H:i:s.u'), $time->getTimezone()); + return static::createFromInterface($time); } elseif (is_numeric($time)) { if ($time <= self::YEAR) { $time += time(); } - return (new static('@' . $time))->setTimezone(new \DateTimeZone(date_default_timezone_get())); + return (new static)->setTimestamp((int) $time); } else { // textual or null return new static((string) $time); @@ -62,7 +58,7 @@ class DateTime extends \DateTime implements \JsonSerializable /** * Creates DateTime object. - * @throws Nette\InvalidArgumentException if the date and time are not valid. + * @throws \Exception if the date and time are not valid. */ public static function fromParts( int $year, @@ -73,44 +69,105 @@ class DateTime extends \DateTime implements \JsonSerializable float $second = 0.0, ): static { - $s = sprintf('%04d-%02d-%02d %02d:%02d:%02.5F', $year, $month, $day, $hour, $minute, $second); - if ( - !checkdate($month, $day, $year) - || $hour < 0 - || $hour > 23 - || $minute < 0 - || $minute > 59 - || $second < 0 - || $second >= 60 - ) { - throw new Nette\InvalidArgumentException("Invalid date '$s'"); - } - - return new static($s); + $sec = (int) floor($second); + return (new static('')) + ->setDate($year, $month, $day) + ->setTime($hour, $minute, $sec, (int) round(($second - $sec) * 1e6)); } /** - * Returns new DateTime object formatted according to the specified format. + * Returns a new DateTime object formatted according to the specified format. */ public static function createFromFormat( string $format, - string $time, + string $datetime, string|\DateTimeZone|null $timezone = null, ): static|false { - if ($timezone === null) { - $timezone = new \DateTimeZone(date_default_timezone_get()); - - } elseif (is_string($timezone)) { + if (is_string($timezone)) { $timezone = new \DateTimeZone($timezone); } - $date = parent::createFromFormat($format, $time, $timezone); + $date = parent::createFromFormat($format, $datetime, $timezone); return $date ? static::from($date) : false; } + public function __construct(string $datetime = 'now', ?\DateTimeZone $timezone = null) + { + $this->apply($datetime, $timezone, true); + } + + + public function modify(string $modifier): static + { + $this->apply($modifier); + return $this; + } + + + public function setDate(int $year, int $month, int $day): static + { + if (!checkdate($month, $day, $year)) { + throw new \Exception(sprintf('The date %04d-%02d-%02d is not valid.', $year, $month, $day)); + } + return parent::setDate($year, $month, $day); + } + + + public function setTime(int $hour, int $minute, int $second = 0, int $microsecond = 0): static + { + if ( + $hour < 0 || $hour > 23 + || $minute < 0 || $minute > 59 + || $second < 0 || $second >= 60 + || $microsecond < 0 || $microsecond >= 1_000_000 + ) { + throw new \Exception(sprintf('The time %02d:%02d:%08.5F is not valid.', $hour, $minute, $second + $microsecond / 1_000_000)); + } + return parent::setTime($hour, $minute, $second, $microsecond); + } + + + /** + * Converts a relative time string (e.g. '10 minut') to seconds. + */ + public static function relativeToSeconds(string $relativeTime): int + { + return (new self('@0 ' . $relativeTime)) + ->getTimestamp(); + } + + + private function apply(string $datetime, ?\DateTimeZone $timezone = null, bool $ctr = false): void + { + $relPart = ''; + $absPart = preg_replace_callback( + '/[+-]?\s*\d+\s+((microsecond|millisecond|[mµu]sec)s?|[mµ]s|sec(ond)?s?|min(ute)?s?|hours?)(\s+ago)?\b/iu', + function ($m) use (&$relPart) { + $relPart .= $m[0] . ' '; + return ''; + }, + $datetime, + ); + + if ($ctr) { + parent::__construct($absPart, $timezone); + $this->handleErrors($datetime); + } elseif (trim($absPart)) { + parent::modify($absPart) && $this->handleErrors($datetime); + } + + if ($relPart) { + $timezone ??= $this->getTimezone(); + $this->setTimezone(new \DateTimeZone('UTC')); + parent::modify($relPart) && $this->handleErrors($datetime); + $this->setTimezone($timezone); + } + } + + /** * Returns JSON representation in ISO 8601 (used by JavaScript). */ @@ -130,11 +187,21 @@ class DateTime extends \DateTime implements \JsonSerializable /** - * Creates a copy with a modified time. + * Returns a modified copy of the object. Use (clone $dt)->modify(...) for better type safety. */ public function modifyClone(string $modify = ''): static { $dolly = clone $this; return $modify ? $dolly->modify($modify) : $dolly; } + + + private function handleErrors(string $value): void + { + $errors = self::getLastErrors(); + $errors = array_merge($errors['errors'] ?? [], $errors['warnings'] ?? []); + if ($errors) { + throw new \Exception(implode(', ', $errors) . " '$value'"); + } + } } diff --git a/vendor/nette/utils/src/Utils/FileInfo.php b/vendor/nette/utils/src/Utils/FileInfo.php index fb92d119..64eeb740 100644 --- a/vendor/nette/utils/src/Utils/FileInfo.php +++ b/vendor/nette/utils/src/Utils/FileInfo.php @@ -1,15 +1,14 @@ -setInfoClass(static::class); - $this->relativePath = $relativePath; + $this->setInfoClass(self::class); } diff --git a/vendor/nette/utils/src/Utils/FileSystem.php b/vendor/nette/utils/src/Utils/FileSystem.php index a51539be..a665665f 100644 --- a/vendor/nette/utils/src/Utils/FileSystem.php +++ b/vendor/nette/utils/src/Utils/FileSystem.php @@ -1,15 +1,15 @@ -getPathname()); } foreach ($iterator = new \RecursiveIteratorIterator(new \RecursiveDirectoryIterator($origin, \RecursiveDirectoryIterator::SKIP_DOTS), \RecursiveIteratorIterator::SELF_FIRST) as $item) { if ($item->isDir()) { - static::createDir($target . '/' . $iterator->getSubPathName()); + static::createDir($target . '/' . $iterator->getSubPathname()); } else { - static::copy($item->getPathname(), $target . '/' . $iterator->getSubPathName()); + static::copy($item->getPathname(), $target . '/' . $iterator->getSubPathname()); } } } else { @@ -112,6 +111,7 @@ final class FileSystem } } elseif (is_dir($path)) { foreach (new \FilesystemIterator($path) as $item) { + \assert($item instanceof \SplFileInfo); static::delete($item->getPathname()); } @@ -208,10 +208,10 @@ final class FileSystem /** - * Writes the string to a file. + * Writes the string to a file. Creates the parent directory if it does not exist. Pass null as $mode to skip chmod. * @throws Nette\IOException on error occurred */ - public static function write(string $file, string $content, ?int $mode = 0666): void + public static function write(string $file, string $content, ?int $mode = 0o666): void { static::createDir(dirname($file)); if (@file_put_contents($file, $content) === false) { // @ is escalated to exception @@ -233,12 +233,42 @@ final class FileSystem } + /** + * Writes the string to a file atomically: the content is written to a temporary file, which then replaces + * the target, so a concurrent reader never sees the file partially written or truncated. + * Creates the parent directory if it does not exist. Pass null as $mode to skip chmod. + * @throws Nette\IOException on error occurred + */ + public static function writeAtomic(string $file, string $content, ?int $mode = 0o666): void + { + $file = realpath($file) ?: $file; // writes through a symlink to its target, as write() does + $tmp = $file . '.' . uniqid('', more_entropy: true) . '.tmp'; + try { + static::write($tmp, $content, $mode); + // plain rename() is atomic; static::rename() must not be used here, it deletes the target first + for ($i = 0; !@rename($tmp, $file); $i++) { // @ is escalated to exception + if (!Helpers::IsWindows || $i >= 20) { + throw new Nette\IOException(sprintf( + "Unable to write file '%s'. %s", + self::normalizePath($file), + Helpers::getLastError(), + )); + } + usleep(5_000); // on Windows, rename fails while the target is open in another process + } + } catch (\Throwable $e) { + @unlink($tmp); + throw $e; + } + } + + /** * Sets file permissions to `$fileMode` or directory permissions to `$dirMode`. * Recursively traverses and sets permissions on the entire contents of the directory as well. * @throws Nette\IOException on error occurred */ - public static function makeWritable(string $path, int $dirMode = 0777, int $fileMode = 0666): void + public static function makeWritable(string $path, int $dirMode = 0o777, int $fileMode = 0o666): void { if (is_file($path)) { if (!@chmod($path, $fileMode)) { // @ is escalated to exception @@ -251,6 +281,7 @@ final class FileSystem } } elseif (is_dir($path)) { foreach (new \FilesystemIterator($path) as $item) { + \assert($item instanceof \SplFileInfo); static::makeWritable($item->getPathname(), $dirMode, $fileMode); } @@ -273,7 +304,20 @@ final class FileSystem */ public static function isAbsolute(string $path): bool { - return (bool) preg_match('#([a-z]:)?[/\\\\]|[a-z][a-z0-9+.-]*://#Ai', $path); + return (bool) preg_match('#([a-z]:)?[/\\\]|[a-z][a-z0-9+.-]*://#Ai', $path); + } + + + /** + * Determines whether the string is a valid cross-platform filename without any path information. + */ + public static function isValidFilename(string $name): bool + { + [$stem] = explode('.', $name, 2); + return $name !== '' && $name !== '.' && $name !== '..' + && !preg_match('#[\x00-\x1F<>:"|?*\\\/]#', $name) // control and reserved characters + && !str_ends_with($name, '.') && !str_ends_with($name, ' ') // trailing dots/spaces + && !preg_match('#^(CON|PRN|AUX|NUL|COM[1-9]|LPT[1-9])$#i', $stem); // Windows reserved device names } @@ -282,7 +326,7 @@ final class FileSystem */ public static function normalizePath(string $path): string { - $parts = $path === '' ? [] : preg_split('~[/\\\\]+~', $path); + $parts = $path === '' ? [] : preg_split('~[/\\\]+~', $path); $res = []; foreach ($parts as $part) { if ($part === '..' && $res && end($res) !== '..' && end($res) !== '') { @@ -307,6 +351,19 @@ final class FileSystem } + /** + * Resolves a path against a base path. If the path is absolute, returns it directly, if it's relative, joins it with the base path. + */ + public static function resolvePath(string $basePath, string $path): string + { + return match (true) { + self::isAbsolute($path) => self::platformSlashes($path), + $path === '' => self::platformSlashes($basePath), + default => self::joinPaths($basePath, $path), + }; + } + + /** * Converts backslashes to slashes. */ diff --git a/vendor/nette/utils/src/Utils/Finder.php b/vendor/nette/utils/src/Utils/Finder.php index 491f6902..87e8e399 100644 --- a/vendor/nette/utils/src/Utils/Finder.php +++ b/vendor/nette/utils/src/Utils/Finder.php @@ -1,19 +1,19 @@ -size('> 10kB') @@ -24,44 +24,45 @@ use Nette; */ class Finder implements \IteratorAggregate { - use Nette\SmartObject; - /** @var array */ private array $find = []; /** @var string[] */ private array $in = []; - /** @var \Closure[] */ + /** @var array<\Closure(FileInfo): bool> */ private array $filters = []; - /** @var \Closure[] */ + /** @var array<\Closure(FileInfo): bool> */ private array $descentFilters = []; /** @var array */ private array $appends = []; private bool $childFirst = false; - /** @var ?callable */ - private $sort; + /** @var ?(\Closure(FileInfo, FileInfo): int) */ + private ?\Closure $sort = null; private int $maxDepth = -1; private bool $ignoreUnreadableDirs = true; /** - * Begins search for files and directories matching mask. + * Begins search for files and directories matching mask. The ** wildcard searches recursively; a trailing slash limits the mask to directories. + * @param string|list $masks */ - public static function find(string|array $masks): static + public static function find(string|array $masks = ['*']): static { $masks = is_array($masks) ? $masks : func_get_args(); // compatibility with variadic - return (new static)->addMask($masks, 'dir')->addMask($masks, 'file'); + $files = array_filter($masks, fn(string $mask): bool => !self::hasTrailingSeparator($mask)); // trailing slash means directories only + return (new static)->addMask($masks, 'dir')->addMask(array_values($files), 'file'); } /** - * Begins search for files matching mask. + * Begins search for files matching mask. The ** wildcard searches recursively. + * @param string|list $masks */ - public static function findFiles(string|array $masks): static + public static function findFiles(string|array $masks = ['*']): static { $masks = is_array($masks) ? $masks : func_get_args(); // compatibility with variadic return (new static)->addMask($masks, 'file'); @@ -69,9 +70,10 @@ class Finder implements \IteratorAggregate /** - * Begins search for directories matching mask. + * Begins search for directories matching mask. The ** wildcard searches recursively. + * @param string|list $masks */ - public static function findDirectories(string|array $masks): static + public static function findDirectories(string|array $masks = ['*']): static { $masks = is_array($masks) ? $masks : func_get_args(); // compatibility with variadic return (new static)->addMask($masks, 'dir'); @@ -80,8 +82,9 @@ class Finder implements \IteratorAggregate /** * Finds files matching the specified masks. + * @param string|list $masks */ - public function files(string|array $masks): static + public function files(string|array $masks = ['*']): static { return $this->addMask((array) $masks, 'file'); } @@ -89,34 +92,47 @@ class Finder implements \IteratorAggregate /** * Finds directories matching the specified masks. + * @param string|list $masks */ - public function directories(string|array $masks): static + public function directories(string|array $masks = ['*']): static { return $this->addMask((array) $masks, 'dir'); } + /** @param list $masks */ private function addMask(array $masks, string $mode): static { foreach ($masks as $mask) { - $mask = FileSystem::unixSlashes($mask); + $orig = $mask; if ($mode === 'dir') { - $mask = rtrim($mask, '/'); + $mask = rtrim($mask, '/\\'); } - if ($mask === '' || ($mode === 'file' && str_ends_with($mask, '/'))) { - throw new Nette\InvalidArgumentException("Invalid mask '$mask'"); + if ($mask === '' || ($mode === 'file' && self::hasTrailingSeparator($mask))) { + throw new Nette\InvalidArgumentException("Invalid mask '$orig'"); } - if (str_starts_with($mask, '**/')) { - $mask = substr($mask, 3); - } - $this->find[] = [$mask, $mode]; + $this->find[] = [self::expandGlobStar($mask), $mode]; } return $this; } + private static function hasTrailingSeparator(string $mask): bool + { + return ($last = substr($mask, -1)) === '/' || $last === '\\'; + } + + + // Expands a ** that is not followed by a slash into **/*, so that e.g. "test/**" and "**.c" search recursively. + private static function expandGlobStar(string $mask): string + { + return preg_replace('~(?<=^|[/\\\])\*\*(?![/\\\])~', '**/*', $mask); + } + + /** - * Searches in the given directories. Wildcards are allowed. + * Searches in the given directories. Wildcards * and ? are allowed; unlike in masks, [ and ] are taken literally. + * @param string|list $paths */ public function in(string|array $paths): static { @@ -127,23 +143,25 @@ class Finder implements \IteratorAggregate /** - * Searches recursively from the given directories. Wildcards are allowed. + * Searches recursively from the given directories. Wildcards * and ? are allowed; unlike in masks, [ and ] are taken literally. + * @param string|list $paths */ public function from(string|array $paths): static { $paths = is_array($paths) ? $paths : func_get_args(); // compatibility with variadic - $this->addLocation($paths, '/**'); + $this->addLocation($paths, DIRECTORY_SEPARATOR . '**'); return $this; } + /** @param list $paths */ private function addLocation(array $paths, string $ext): void { foreach ($paths as $path) { if ($path === '') { throw new Nette\InvalidArgumentException("Invalid directory '$path'"); } - $path = rtrim(FileSystem::unixSlashes($path), '/'); + $path = rtrim($path, '/\\'); $this->in[] = $path . $ext; } } @@ -170,12 +188,12 @@ class Finder implements \IteratorAggregate /** - * Set a compare function for sorting directory entries. The function will be called to sort entries from the same directory. + * Sets a comparison function for sorting entries within each directory. * @param callable(FileInfo, FileInfo): int $callback */ public function sortBy(callable $callback): static { - $this->sort = $callback; + $this->sort = $callback(...); return $this; } @@ -191,7 +209,8 @@ class Finder implements \IteratorAggregate /** - * Adds the specified paths or appends a new finder that returns. + * Appends the specified file paths to results. Passing null creates and returns a new sub-finder whose results are appended. + * @param string|list|null $paths */ public function append(string|array|null $paths = null): static { @@ -208,23 +227,29 @@ class Finder implements \IteratorAggregate /** - * Skips entries that matches the given masks relative to the ones defined with the in() or from() methods. + * Skips entries that match the given masks, using the same grammar as find() masks, relative to the directories from in() or from(). + * A trailing slash excludes directories only; a trailing /* or /** excludes the contents while keeping the directory itself. + * @param string|list $masks */ public function exclude(string|array $masks): static { $masks = is_array($masks) ? $masks : func_get_args(); // compatibility with variadic foreach ($masks as $mask) { + $orig = $mask; $mask = FileSystem::unixSlashes($mask); - if (!preg_match('~^/?(\*\*/)?(.+)(/\*\*|/\*|/|)$~D', $mask, $m)) { - throw new Nette\InvalidArgumentException("Invalid mask '$mask'"); + if (FileSystem::isAbsolute($mask) || $mask === '..' || str_starts_with($mask, '../')) { + trigger_error("Absolute or ../ mask '$orig' in exclude() is deprecated and will change meaning, use a mask relative to the searched directory.", E_USER_DEPRECATED); + } + if (!preg_match('~^/?(\*\*/)?(.+?)(/\*\*|/\*|/|)$~D', $mask, $m)) { + throw new Nette\InvalidArgumentException("Invalid mask '$orig'"); } $end = $m[3]; - $re = $this->buildPattern($m[2]); + $re = $this->buildPattern(self::expandGlobStar($m[2])); $filter = fn(FileInfo $file): bool => ($end && !$file->isDir()) || !preg_match($re, FileSystem::unixSlashes($file->getRelativePathname())); $this->descentFilter($filter); - if ($end !== '/*') { + if ($end === '' || $end === '/') { $this->filter($filter); } } @@ -239,7 +264,7 @@ class Finder implements \IteratorAggregate */ public function filter(callable $callback): static { - $this->filters[] = \Closure::fromCallable($callback); + $this->filters[] = $callback(...); return $this; } @@ -250,7 +275,7 @@ class Finder implements \IteratorAggregate */ public function descentFilter(callable $callback): static { - $this->descentFilters[] = \Closure::fromCallable($callback); + $this->descentFilters[] = $callback(...); return $this; } @@ -267,6 +292,7 @@ class Finder implements \IteratorAggregate /** * Restricts the search by size. $operator accepts "[operator] [size] [unit]" example: >=10kB + * @param '>'|'>='|'<'|'<='|'='|'=='|'==='|'!='|'!=='|'<>' $operator or predicate string */ public function size(string $operator, ?int $size = null): static { @@ -277,7 +303,7 @@ class Finder implements \IteratorAggregate [, $operator, $size, $unit] = $matches; $units = ['' => 1, 'k' => 1e3, 'm' => 1e6, 'g' => 1e9]; - $size *= $units[strtolower($unit)]; + $size = (float) $size * $units[strtolower($unit)]; $operator = $operator ?: '='; } @@ -287,6 +313,7 @@ class Finder implements \IteratorAggregate /** * Restricts the search by modified time. $operator accepts "[operator] [date]" example: >1978-01-23 + * @param '>'|'>='|'<'|'<='|'='|'=='|'==='|'!='|'!=='|'<>' $operator or predicate string */ public function date(string $operator, string|int|\DateTimeInterface|null $date = null): static { @@ -299,7 +326,7 @@ class Finder implements \IteratorAggregate $operator = $operator ?: '='; } - $date = DateTime::from($date)->format('U'); + $date = DateTime::from($date)->getTimestamp(); return $this->filter(fn(FileInfo $file): bool => !$file->isFile() || Helpers::compare($file->getMTime(), $operator, $date)); } @@ -309,10 +336,11 @@ class Finder implements \IteratorAggregate /** * Returns an array with all found files and directories. + * @return list */ public function collect(): array { - return iterator_to_array($this->getIterator()); + return iterator_to_array($this->getIterator(), preserve_keys: false); } @@ -328,7 +356,6 @@ class Finder implements \IteratorAggregate if ($item instanceof self) { yield from $item->getIterator(); } else { - $item = FileSystem::platformSlashes($item); yield $item => new FileInfo($item); } } @@ -336,7 +363,7 @@ class Finder implements \IteratorAggregate /** - * @param array<\stdClass{pattern: string, mode: string, recursive: bool}> $searches + * @param array $searches * @param string[] $subdirs * @return \Generator */ @@ -345,11 +372,11 @@ class Finder implements \IteratorAggregate if ($this->maxDepth >= 0 && count($subdirs) > $this->maxDepth) { return; } elseif (!is_dir($dir)) { - throw new Nette\InvalidStateException("Directory '$dir' not found."); + throw new Nette\InvalidStateException(sprintf("Directory '%s' does not exist.", rtrim($dir, '/\\'))); } try { - $pathNames = new \FilesystemIterator($dir, \FilesystemIterator::FOLLOW_SYMLINKS | \FilesystemIterator::SKIP_DOTS | \FilesystemIterator::CURRENT_AS_PATHNAME | \FilesystemIterator::UNIX_PATHS); + $pathNames = new \FilesystemIterator($dir, \FilesystemIterator::FOLLOW_SYMLINKS | \FilesystemIterator::SKIP_DOTS | \FilesystemIterator::CURRENT_AS_PATHNAME); } catch (\UnexpectedValueException $e) { if ($this->ignoreUnreadableDirs) { return; @@ -358,7 +385,7 @@ class Finder implements \IteratorAggregate } } - $files = $this->convertToFiles($pathNames, implode('/', $subdirs), FileSystem::isAbsolute($dir)); + $files = $this->convertToFiles($pathNames, implode(DIRECTORY_SEPARATOR, $subdirs), FileSystem::isAbsolute($dir)); if ($this->sort) { $files = iterator_to_array($files); @@ -384,7 +411,7 @@ class Finder implements \IteratorAggregate $relativePathname = FileSystem::unixSlashes($file->getRelativePathname()); foreach ($searches as $search) { if ( - $file->getType() === $search->mode + "is_$search->mode"(Helpers::IsWindows && $file->isLink() ? $file->getLinkTarget() : $file->getPathname()) && preg_match($search->pattern, $relativePathname) && $this->proveFilters($this->filters, $file, $cache) ) { @@ -400,18 +427,22 @@ class Finder implements \IteratorAggregate } + /** @param iterable $pathNames */ private function convertToFiles(iterable $pathNames, string $relativePath, bool $absolute): \Generator { foreach ($pathNames as $pathName) { if (!$absolute) { - $pathName = preg_replace('~\.?/~A', '', $pathName); + $pathName = preg_replace('~\.?[\\\/]~A', '', $pathName); } - $pathName = FileSystem::platformSlashes($pathName); yield new FileInfo($pathName, $relativePath); } } + /** + * @param (\Closure(FileInfo): bool)[] $filters + * @param array $cache + */ private function proveFilters(array $filters, FileInfo $file, array &$cache): bool { foreach ($filters as $filter) { @@ -426,7 +457,7 @@ class Finder implements \IteratorAggregate } - /** @return array> */ + /** @return array> */ private function buildPlan(): array { $plan = $dirCache = []; @@ -440,7 +471,7 @@ class Finder implements \IteratorAggregate } else { foreach ($this->in ?: ['.'] as $in) { $in = strtr($in, ['[' => '[[]', ']' => '[]]']); // in path, do not treat [ and ] as a pattern by glob() - $splits[] = self::splitRecursivePart($in . '/' . $mask); + $splits[] = self::splitRecursivePart($in . DIRECTORY_SEPARATOR . $mask); } } @@ -450,6 +481,10 @@ class Finder implements \IteratorAggregate ? glob($base, GLOB_NOSORT | GLOB_ONLYDIR | GLOB_NOESCAPE) : [strtr($base, ['[[]' => '[', '[]]' => ']'])]; // unescape [ and ] + if (!$dirs) { + throw new Nette\InvalidStateException(sprintf("Directory '%s' does not exist.", rtrim($base, '/\\'))); + } + $search = (object) ['pattern' => $this->buildPattern($rest), 'mode' => $mode, 'recursive' => $recursive]; foreach ($dirs as $dir) { $plan[$dir][] = $search; @@ -463,14 +498,17 @@ class Finder implements \IteratorAggregate /** * Since glob() does not know ** wildcard, we divide the path into a part for glob and a part for manual traversal. + * @return array{string, string, bool} */ private static function splitRecursivePart(string $path): array { - $a = strrpos($path, '/'); - $parts = preg_split('~(?<=^|/)\*\*($|/)~', substr($path, 0, $a + 1), 2); + $pos = strrpos(strtr($path, '\\', '/'), '/'); + $dir = $pos === false ? '' : substr($path, 0, $pos + 1); + $file = $pos === false ? $path : substr($path, $pos + 1); + $parts = preg_split('~(?<=^|[\\\/])\*\*($|[\\\/])~', $dir, 2); return isset($parts[1]) - ? [$parts[0], $parts[1] . substr($path, $a + 1), true] - : [$parts[0], substr($path, $a + 1), false]; + ? [$parts[0], $parts[1] . $file, true] + : [$parts[0], $file, false]; } @@ -479,6 +517,7 @@ class Finder implements \IteratorAggregate */ private function buildPattern(string $mask): string { + $mask = FileSystem::unixSlashes($mask); if ($mask === '*') { return '##'; } elseif (str_starts_with($mask, './')) { @@ -500,6 +539,6 @@ class Finder implements \IteratorAggregate '\-' => '-', ], ); - return '#' . $anchor . $pattern . '$#D' . (defined('PHP_WINDOWS_VERSION_BUILD') ? 'i' : ''); + return '#' . $anchor . $pattern . '$#D' . (Helpers::IsWindows ? 'i' : ''); } } diff --git a/vendor/nette/utils/src/Utils/Floats.php b/vendor/nette/utils/src/Utils/Floats.php index cc2781d7..02cebeb9 100644 --- a/vendor/nette/utils/src/Utils/Floats.php +++ b/vendor/nette/utils/src/Utils/Floats.php @@ -1,15 +1,14 @@ - ''); try { $func(); return ob_get_clean(); @@ -32,7 +39,7 @@ class Helpers /** * Returns the last occurred PHP error or an empty string if no error occurred. Unlike error_get_last(), - * it is nit affected by the PHP directive html_errors and always returns text, not HTML. + * it is not affected by the PHP directive html_errors and always returns text, not HTML. */ public static function getLastError(): string { @@ -54,6 +61,7 @@ class Helpers /** * Returns value clamped to the inclusive range of min and max. + * @return ($value is float ? float : ($min is float ? float : ($max is float ? float : int))) */ public static function clamp(int|float $value, int|float $min, int|float $max): int|float { @@ -66,7 +74,7 @@ class Helpers /** - * Looks for a string from possibilities that is most similar to value, but not the same (for 8-bit encoding). + * Finds the string from $possibilities most similar to $value using Levenshtein distance, or null if none is close enough. * @param string[] $possibilities */ public static function getSuggestion(array $possibilities, string $value): ?string @@ -86,6 +94,7 @@ class Helpers /** * Compares two values in the same way that PHP does. Recognizes operators: >, >=, <, <=, =, ==, ===, !=, !==, <> + * @param '>'|'>='|'<'|'<='|'='|'=='|'==='|'!='|'!=='|'<>' $operator */ public static function compare(mixed $left, string $operator, mixed $right): bool { @@ -101,4 +110,16 @@ class Helpers default => throw new Nette\InvalidArgumentException("Unknown operator '$operator'"), }; } + + + /** + * Splits a class name into namespace and short class name. + * @return array{string, string} + */ + public static function splitClassName(string $name): array + { + return ($pos = strrpos($name, '\\')) === false + ? ['', $name] + : [substr($name, 0, $pos), substr($name, $pos + 1)]; + } } diff --git a/vendor/nette/utils/src/Utils/Html.php b/vendor/nette/utils/src/Utils/Html.php index 7e401b8f..437e39eb 100644 --- a/vendor/nette/utils/src/Utils/Html.php +++ b/vendor/nette/utils/src/Utils/Html.php @@ -1,129 +1,127 @@ - + * @implements \ArrayAccess */ class Html implements \ArrayAccess, \Countable, \IteratorAggregate, HtmlStringable { - use Nette\SmartObject; - /** @var array element's attributes */ - public $attrs = []; + public array $attrs = []; - /** void elements */ - public static $emptyElements = [ + /** @var array void elements */ + public static array $emptyElements = [ 'img' => 1, 'hr' => 1, 'br' => 1, 'input' => 1, 'meta' => 1, 'area' => 1, 'embed' => 1, 'keygen' => 1, 'source' => 1, 'base' => 1, 'col' => 1, 'link' => 1, 'param' => 1, 'basefont' => 1, 'frame' => 1, 'isindex' => 1, 'wbr' => 1, 'command' => 1, 'track' => 1, ]; - /** @var array nodes */ - protected $children = []; + /** @var array nodes */ + protected array $children = []; /** element's name */ private string $name = ''; @@ -256,7 +258,7 @@ class Html implements \ArrayAccess, \Countable, \IteratorAggregate, HtmlStringab /** * Constructs new HTML element. - * @param array|string $attrs element's attributes or plain text content + * @param array|string|null $attrs element's attributes or plain text content */ public static function el(?string $name = null, array|string|null $attrs = null): static { @@ -281,8 +283,19 @@ class Html implements \ArrayAccess, \Countable, \IteratorAggregate, HtmlStringab } + /** + * Creates a nameless element (fragment) containing the given children. + * Everything except HtmlStringable is escaped; use Html::html() for raw HTML. Nulls are skipped. + */ + public static function fragment(HtmlStringable|\Stringable|string|int|null ...$children): static + { + return (new static)->add(...$children); + } + + /** * Returns an object representing HTML text. + * @deprecated use Html::html() */ public static function fromHtml(string $html): static { @@ -292,6 +305,7 @@ class Html implements \ArrayAccess, \Countable, \IteratorAggregate, HtmlStringab /** * Returns an object representing plain text. + * @deprecated use Html::text() */ public static function fromText(string $text): static { @@ -347,7 +361,7 @@ class Html implements \ArrayAccess, \Countable, \IteratorAggregate, HtmlStringab /** - * Is element empty? + * Checks whether the element is a void (self-closing) element. */ final public function isEmpty(): bool { @@ -357,6 +371,7 @@ class Html implements \ArrayAccess, \Countable, \IteratorAggregate, HtmlStringab /** * Sets multiple attributes. + * @param array $attrs */ public function addAttributes(array $attrs): static { @@ -419,6 +434,7 @@ class Html implements \ArrayAccess, \Countable, \IteratorAggregate, HtmlStringab /** * Unsets element's attributes. + * @param list $attributes */ public function removeAttributes(array $attributes): static { @@ -431,7 +447,7 @@ class Html implements \ArrayAccess, \Countable, \IteratorAggregate, HtmlStringab /** - * Overloaded setter for element's attribute. + * Sets element's attribute via property assignment. */ final public function __set(string $name, mixed $value): void { @@ -440,7 +456,7 @@ class Html implements \ArrayAccess, \Countable, \IteratorAggregate, HtmlStringab /** - * Overloaded getter for element's attribute. + * Returns element's attribute via property access. */ final public function &__get(string $name): mixed { @@ -449,7 +465,7 @@ class Html implements \ArrayAccess, \Countable, \IteratorAggregate, HtmlStringab /** - * Overloaded tester for element's attribute. + * Checks if element's attribute is set. */ final public function __isset(string $name): bool { @@ -458,7 +474,7 @@ class Html implements \ArrayAccess, \Countable, \IteratorAggregate, HtmlStringab /** - * Overloaded unsetter for element's attribute. + * Unsets element's attribute via property unset. */ final public function __unset(string $name): void { @@ -467,10 +483,15 @@ class Html implements \ArrayAccess, \Countable, \IteratorAggregate, HtmlStringab /** - * Overloaded setter for element's attribute. + * Sets or returns element's attribute via method call. + * @param mixed[] $args */ final public function __call(string $m, array $args): mixed { + if ($m === 'text' || $m === 'html') { + trigger_error("Method \$el->$m() is deprecated, use set" . ucfirst($m) . "() for content or setAttribute() for the '$m' attribute; Html::$m() is a static factory.", E_USER_DEPRECATED); + } + $p = substr($m, 0, 3); if ($p === 'get' || $p === 'set' || $p === 'add') { $m = substr($m, 3); @@ -496,8 +517,23 @@ class Html implements \ArrayAccess, \Countable, \IteratorAggregate, HtmlStringab } + /** + * Creates element with escaped text (Html::text()) or raw HTML (Html::html()) content. + * @param mixed[] $args + */ + final public static function __callStatic(string $name, array $args): static + { + return match ($name) { + 'text' => (new static)->setText(...$args), + 'html' => (new static)->setHtml(...$args), + default => ObjectHelpers::strictStaticCall(static::class, $name), + }; + } + + /** * Special setter for element's attribute. + * @param array $query */ final public function href(string $path, array $query = []): static { @@ -572,10 +608,25 @@ class Html implements \ArrayAccess, \Countable, \IteratorAggregate, HtmlStringab } + /** + * Appends the given children. Everything except HtmlStringable is escaped; use Html::html() for raw HTML. Nulls are skipped. + */ + public function add(HtmlStringable|\Stringable|string|int|null ...$children): static + { + foreach ($children as $child) { + if ($child !== null) { + $this->addText($child); + } + } + + return $this; + } + + /** * Adds new element's child. */ - final public function addHtml(mixed $child): static + final public function addHtml(HtmlStringable|string $child): static { return $this->insert(null, $child); } @@ -584,7 +635,7 @@ class Html implements \ArrayAccess, \Countable, \IteratorAggregate, HtmlStringab /** * Appends plain-text string to element content. */ - public function addText(mixed $text): static + public function addText(\Stringable|string|int|null $text): static { if (!$text instanceof HtmlStringable) { $text = htmlspecialchars((string) $text, ENT_NOQUOTES, 'UTF-8'); @@ -596,6 +647,7 @@ class Html implements \ArrayAccess, \Countable, \IteratorAggregate, HtmlStringab /** * Creates and adds a new Html child. + * @param array|string|null $attrs */ final public function create(string $name, array|string|null $attrs = null): static { @@ -623,12 +675,12 @@ class Html implements \ArrayAccess, \Countable, \IteratorAggregate, HtmlStringab /** * Inserts (replaces) child node (\ArrayAccess implementation). - * @param int|null $index position or null for appending + * @param ?int $index position or null for appending * @param Html|string $child Html node or raw HTML string */ final public function offsetSet($index, $child): void { - $this->insert($index, $child, true); + $this->insert($index, $child, replace: true); } @@ -636,7 +688,7 @@ class Html implements \ArrayAccess, \Countable, \IteratorAggregate, HtmlStringab * Returns child node (\ArrayAccess implementation). * @param int $index */ - final public function offsetGet($index): HtmlStringable|string + final public function offsetGet($index): self|string { return $this->children[$index]; } @@ -684,7 +736,7 @@ class Html implements \ArrayAccess, \Countable, \IteratorAggregate, HtmlStringab /** * Iterates over elements. - * @return \ArrayIterator + * @return \ArrayIterator */ final public function getIterator(): \ArrayIterator { @@ -694,6 +746,7 @@ class Html implements \ArrayAccess, \Countable, \IteratorAggregate, HtmlStringab /** * Returns all children. + * @return array */ final public function getChildren(): array { @@ -702,7 +755,7 @@ class Html implements \ArrayAccess, \Countable, \IteratorAggregate, HtmlStringab /** - * Renders element's start tag, content and end tag. + * Renders element's start tag, content and end tag. Pass indent level to enable pretty-printing. */ final public function render(?int $indent = null): string { @@ -766,10 +819,6 @@ class Html implements \ArrayAccess, \Countable, \IteratorAggregate, HtmlStringab */ final public function attributes(): string { - if (!is_array($this->attrs)) { - return ''; - } - $s = ''; $attrs = $this->attrs; foreach ($attrs as $key => $value) { @@ -782,7 +831,7 @@ class Html implements \ArrayAccess, \Countable, \IteratorAggregate, HtmlStringab continue; } elseif (is_array($value)) { - if (strncmp($key, 'data-', 5) === 0) { + if (str_starts_with($key, 'data-')) { $value = Json::encode($value); } else { @@ -812,8 +861,8 @@ class Html implements \ArrayAccess, \Countable, \IteratorAggregate, HtmlStringab $q = str_contains($value, '"') ? "'" : '"'; $s .= ' ' . $key . '=' . $q . str_replace( - ['&', $q, '<'], - ['&', $q === '"' ? '"' : ''', '<'], + ['&', $q], + ['&', $q === '"' ? '"' : '''], $value, ) . (str_contains($value, '`') && strpbrk($value, ' <>"\'') === false ? ' ' : '') diff --git a/vendor/nette/utils/src/Utils/Image.php b/vendor/nette/utils/src/Utils/Image.php index a24fd183..55d80262 100644 --- a/vendor/nette/utils/src/Utils/Image.php +++ b/vendor/nette/utils/src/Utils/Image.php @@ -1,15 +1,15 @@ -send(); * * - * @method Image affine(array $affine, array $clip = null) - * @method array affineMatrixConcat(array $m1, array $m2) - * @method array affineMatrixGet(int $type, mixed $options = null) - * @method void alphaBlending(bool $on) - * @method void antialias(bool $on) - * @method void arc($x, $y, $w, $h, $start, $end, $color) - * @method void char(int $font, $x, $y, string $char, $color) - * @method void charUp(int $font, $x, $y, string $char, $color) - * @method int colorAllocate($red, $green, $blue) - * @method int colorAllocateAlpha($red, $green, $blue, $alpha) - * @method int colorAt($x, $y) - * @method int colorClosest($red, $green, $blue) - * @method int colorClosestAlpha($red, $green, $blue, $alpha) - * @method int colorClosestHWB($red, $green, $blue) - * @method void colorDeallocate($color) - * @method int colorExact($red, $green, $blue) - * @method int colorExactAlpha($red, $green, $blue, $alpha) + * @method Image affine(array $affine, ?array{x: int, y: int, width: int, height: int} $clip = null) + * @method void alphaBlending(bool $enable) + * @method void antialias(bool $enable) + * @method void arc(int $centerX, int $centerY, int $width, int $height, int $startAngle, int $endAngle, ImageColor $color) + * @method int colorAllocate(int $red, int $green, int $blue) + * @method int colorAllocateAlpha(int $red, int $green, int $blue, int $alpha) + * @method int colorAt(int $x, int $y) + * @method int colorClosest(int $red, int $green, int $blue) + * @method int colorClosestAlpha(int $red, int $green, int $blue, int $alpha) + * @method int colorClosestHWB(int $red, int $green, int $blue) + * @method void colorDeallocate(int $color) + * @method int colorExact(int $red, int $green, int $blue) + * @method int colorExactAlpha(int $red, int $green, int $blue, int $alpha) * @method void colorMatch(Image $image2) - * @method int colorResolve($red, $green, $blue) - * @method int colorResolveAlpha($red, $green, $blue, $alpha) - * @method void colorSet($index, $red, $green, $blue) - * @method array colorsForIndex($index) + * @method int colorResolve(int $red, int $green, int $blue) + * @method int colorResolveAlpha(int $red, int $green, int $blue, int $alpha) + * @method void colorSet(int $index, int $red, int $green, int $blue, int $alpha = 0) + * @method array{red: int, green: int, blue: int, alpha: int} colorsForIndex(int $color) * @method int colorsTotal() - * @method int colorTransparent($color = null) - * @method void convolution(array $matrix, float $div, float $offset) - * @method void copy(Image $src, $dstX, $dstY, $srcX, $srcY, $srcW, $srcH) - * @method void copyMerge(Image $src, $dstX, $dstY, $srcX, $srcY, $srcW, $srcH, $opacity) - * @method void copyMergeGray(Image $src, $dstX, $dstY, $srcX, $srcY, $srcW, $srcH, $opacity) - * @method void copyResampled(Image $src, $dstX, $dstY, $srcX, $srcY, $dstW, $dstH, $srcW, $srcH) - * @method void copyResized(Image $src, $dstX, $dstY, $srcX, $srcY, $dstW, $dstH, $srcW, $srcH) - * @method Image cropAuto(int $mode = -1, float $threshold = .5, int $color = -1) - * @method void ellipse($cx, $cy, $w, $h, $color) - * @method void fill($x, $y, $color) - * @method void filledArc($cx, $cy, $w, $h, $s, $e, $color, $style) - * @method void filledEllipse($cx, $cy, $w, $h, $color) - * @method void filledPolygon(array $points, $numPoints, $color) - * @method void filledRectangle($x1, $y1, $x2, $y2, $color) - * @method void fillToBorder($x, $y, $border, $color) - * @method void filter($filtertype) + * @method int colorTransparent(?int $color = null) + * @method void convolution(array> $matrix, float $div, float $offset) + * @method void copy(Image $src, int $dstX, int $dstY, int $srcX, int $srcY, int $srcW, int $srcH) + * @method void copyMerge(Image $src, int $dstX, int $dstY, int $srcX, int $srcY, int $srcW, int $srcH, int $pct) + * @method void copyMergeGray(Image $src, int $dstX, int $dstY, int $srcX, int $srcY, int $srcW, int $srcH, int $pct) + * @method void copyResampled(Image $src, int $dstX, int $dstY, int $srcX, int $srcY, int $dstW, int $dstH, int $srcW, int $srcH) + * @method void copyResized(Image $src, int $dstX, int $dstY, int $srcX, int $srcY, int $dstW, int $dstH, int $srcW, int $srcH) + * @method Image cropAuto(int $mode = 0, float $threshold = .5, ?ImageColor $color = null) + * @method void ellipse(int $centerX, int $centerY, int $width, int $height, ImageColor $color) + * @method void fill(int $x, int $y, ImageColor $color) + * @method void filledArc(int $centerX, int $centerY, int $width, int $height, int $startAngle, int $endAngle, ImageColor $color, int $style) + * @method void filledEllipse(int $centerX, int $centerY, int $width, int $height, ImageColor $color) + * @method void filledPolygon(array $points, ImageColor $color) + * @method void filledRectangle(int $x1, int $y1, int $x2, int $y2, ImageColor $color) + * @method void fillToBorder(int $x, int $y, ImageColor $borderColor, ImageColor $color) + * @method void filter(int $filter, ...$args) * @method void flip(int $mode) - * @method array ftText($size, $angle, $x, $y, $col, string $fontFile, string $text, array $extrainfo = null) + * @method array ftText(float $size, float $angle, int $x, int $y, ImageColor $color, string $fontFile, string $text, array $options = []) * @method void gammaCorrect(float $inputgamma, float $outputgamma) - * @method array getClip() - * @method int interlace($interlace = null) + * @method array{int, int, int, int} getClip() + * @method int getInterpolation() + * @method int interlace(?bool $enable = null) * @method bool isTrueColor() - * @method void layerEffect($effect) - * @method void line($x1, $y1, $x2, $y2, $color) - * @method void openPolygon(array $points, int $num_points, int $color) + * @method void layerEffect(int $effect) + * @method void line(int $x1, int $y1, int $x2, int $y2, ImageColor $color) + * @method void openPolygon(array $points, ImageColor $color) * @method void paletteCopy(Image $source) * @method void paletteToTrueColor() - * @method void polygon(array $points, $numPoints, $color) - * @method array psText(string $text, $font, $size, $color, $backgroundColor, $x, $y, $space = null, $tightness = null, float $angle = null, $antialiasSteps = null) - * @method void rectangle($x1, $y1, $x2, $y2, $col) - * @method mixed resolution(int $res_x = null, int $res_y = null) - * @method Image rotate(float $angle, $backgroundColor) - * @method void saveAlpha(bool $saveflag) - * @method Image scale(int $newWidth, int $newHeight = -1, int $mode = IMG_BILINEAR_FIXED) + * @method void polygon(array $points, ImageColor $color) + * @method void rectangle(int $x1, int $y1, int $x2, int $y2, ImageColor $color) + * @method mixed resolution(?int $resolutionX = null, ?int $resolutionY = null) + * @method Image rotate(float $angle, ImageColor $backgroundColor) + * @method void saveAlpha(bool $enable) + * @method Image scale(int $newWidth, int $newHeight = -1, int $mode = 3) * @method void setBrush(Image $brush) * @method void setClip(int $x1, int $y1, int $x2, int $y2) - * @method void setInterpolation(int $method = IMG_BILINEAR_FIXED) - * @method void setPixel($x, $y, $color) - * @method void setStyle(array $style) - * @method void setThickness($thickness) + * @method void setInterpolation(int $method = 3) + * @method void setPixel(int $x, int $y, ImageColor $color) + * @method void setStyle(array $style) + * @method void setThickness(int $thickness) * @method void setTile(Image $tile) - * @method void string($font, $x, $y, string $s, $col) - * @method void stringUp($font, $x, $y, string $s, $col) - * @method void trueColorToPalette(bool $dither, $ncolors) - * @method array ttfText($size, $angle, $x, $y, $color, string $fontfile, string $text) - * @property-read int $width - * @property-read int $height + * @method void trueColorToPalette(bool $dither, int $ncolors) + * @method array ttfText(float $size, float $angle, int $x, int $y, ImageColor $color, string $fontfile, string $text, array $options = []) + * @property-read positive-int $width + * @property-read positive-int $height * @property-read \GdImage $imageResource */ class Image @@ -133,22 +127,25 @@ class Image /** image types */ public const - JPEG = IMAGETYPE_JPEG, - PNG = IMAGETYPE_PNG, - GIF = IMAGETYPE_GIF, - WEBP = IMAGETYPE_WEBP, - AVIF = 19, // IMAGETYPE_AVIF, - BMP = IMAGETYPE_BMP; + JPEG = ImageType::JPEG, + PNG = ImageType::PNG, + GIF = ImageType::GIF, + WEBP = ImageType::WEBP, + AVIF = ImageType::AVIF, + BMP = ImageType::BMP; public const EmptyGIF = "GIF89a\x01\x00\x01\x00\x80\x00\x00\x00\x00\x00\x00\x00\x00!\xf9\x04\x01\x00\x00\x00\x00,\x00\x00\x00\x00\x01\x00\x01\x00\x00\x02\x02D\x01\x00;"; - private const Formats = [self::JPEG => 'jpeg', self::PNG => 'png', self::GIF => 'gif', self::WEBP => 'webp', self::AVIF => 'avif', self::BMP => 'bmp']; + private const Formats = [ImageType::JPEG => 'jpeg', ImageType::PNG => 'png', ImageType::GIF => 'gif', ImageType::WEBP => 'webp', ImageType::AVIF => 'avif', ImageType::BMP => 'bmp']; + private const Sentinel = "\0"; private \GdImage $image; /** * Returns RGB color (0..255) and transparency (0..127). + * @deprecated use ImageColor::rgb() + * @return array{red: int, green: int, blue: int, alpha: int} */ public static function rgb(int $red, int $green, int $blue, int $transparency = 0): array { @@ -162,56 +159,64 @@ class Image /** - * Reads an image from a file and returns its type in $type. + * Reads an image from a file and returns its type in $type. If $warnings is passed, recoverable decoder + * warnings are returned in it instead of being raised as a PHP warning. + * @param-out ?string $warnings * @throws Nette\NotSupportedException if gd extension is not loaded * @throws UnknownImageFileException if file not found or file type is not known */ - public static function fromFile(string $file, ?int &$type = null): static + public static function fromFile(string $file, ?int &$type = null, ?string &$warnings = self::Sentinel): static { - if (!extension_loaded('gd')) { - throw new Nette\NotSupportedException('PHP extension GD is not loaded.'); - } - + self::ensureExtension(); $type = self::detectTypeFromFile($file); if (!$type) { throw new UnknownImageFileException(is_file($file) ? "Unknown type of file '$file'." : "File '$file' not found."); } - return self::invokeSafe('imagecreatefrom' . self::Formats[$type], $file, "Unable to open file '$file'.", __METHOD__); + return self::invokeSafe('imagecreatefrom' . self::Formats[$type], $file, "Unable to open file '$file'.", __METHOD__, $warnings); } /** - * Reads an image from a string and returns its type in $type. + * Reads an image from a string and returns its type in $type. If $warnings is passed, recoverable decoder + * warnings are returned in it instead of being raised as a PHP warning. + * @param-out ?string $warnings * @throws Nette\NotSupportedException if gd extension is not loaded * @throws ImageException */ - public static function fromString(string $s, ?int &$type = null): static + public static function fromString(string $s, ?int &$type = null, ?string &$warnings = self::Sentinel): static { - if (!extension_loaded('gd')) { - throw new Nette\NotSupportedException('PHP extension GD is not loaded.'); - } - + self::ensureExtension(); $type = self::detectTypeFromString($s); if (!$type) { throw new UnknownImageFileException('Unknown type of image.'); } - return self::invokeSafe('imagecreatefromstring', $s, 'Unable to open image from string.', __METHOD__); + return self::invokeSafe('imagecreatefromstring', $s, 'Unable to open image from string.', __METHOD__, $warnings); } - private static function invokeSafe(string $func, string $arg, string $message, string $callee): static + /** @param callable-string $func */ + private static function invokeSafe( + string $func, + string $arg, + string $message, + string $callee, + ?string &$warnings = self::Sentinel, + ): static { $errors = []; $res = Callback::invokeSafe($func, [$arg], function (string $message) use (&$errors): void { $errors[] = $message; }); + $raiseWarning = $warnings === self::Sentinel; + $warnings = $errors ? implode(', ', $errors) : null; + if (!$res) { - throw new ImageException($message . ' Errors: ' . implode(', ', $errors)); - } elseif ($errors) { - trigger_error($callee . '(): ' . implode(', ', $errors), E_USER_WARNING); + throw new ImageException($message . ' Errors: ' . $warnings); + } elseif ($errors && $raiseWarning) { + trigger_error($callee . '(): ' . $warnings, E_USER_WARNING); } return new static($res); @@ -220,53 +225,59 @@ class Image /** * Creates a new true color image of the given dimensions. The default color is black. + * @param positive-int $width + * @param positive-int $height + * @param ImageColor|array{red: int, green: int, blue: int, alpha?: int}|null $color * @throws Nette\NotSupportedException if gd extension is not loaded */ - public static function fromBlank(int $width, int $height, ?array $color = null): static + public static function fromBlank(int $width, int $height, ImageColor|array|null $color = null): static { - if (!extension_loaded('gd')) { - throw new Nette\NotSupportedException('PHP extension GD is not loaded.'); - } - + self::ensureExtension(); if ($width < 1 || $height < 1) { throw new Nette\InvalidArgumentException('Image width and height must be greater than zero.'); } - $image = imagecreatetruecolor($width, $height); + $image = new static(imagecreatetruecolor($width, $height)); if ($color) { - $color += ['alpha' => 0]; - $color = imagecolorresolvealpha($image, $color['red'], $color['green'], $color['blue'], $color['alpha']); - imagealphablending($image, false); - imagefilledrectangle($image, 0, 0, $width - 1, $height - 1, $color); - imagealphablending($image, true); + $image->alphaBlending(false); + $image->filledRectangle(0, 0, $width - 1, $height - 1, self::normalizeColor($color)); + $image->alphaBlending(true); } - return new static($image); + return $image; } /** * Returns the type of image from file. + * @param-out ?int $width + * @param-out ?int $height + * @return ?ImageType::* */ - public static function detectTypeFromFile(string $file, &$width = null, &$height = null): ?int + public static function detectTypeFromFile(string $file, mixed &$width = null, mixed &$height = null): ?int { - [$width, $height, $type] = @getimagesize($file); // @ - files smaller than 12 bytes causes read error - return isset(self::Formats[$type]) ? $type : null; + [$width, $height, $type] = Helpers::falseToNull(@getimagesize($file)); // @ - files smaller than 12 bytes causes read error + return $type && isset(self::Formats[$type]) ? $type : null; } /** * Returns the type of image from string. + * @param-out ?int $width + * @param-out ?int $height + * @return ?ImageType::* */ - public static function detectTypeFromString(string $s, &$width = null, &$height = null): ?int + public static function detectTypeFromString(string $s, mixed &$width = null, mixed &$height = null): ?int { - [$width, $height, $type] = @getimagesizefromstring($s); // @ - strings smaller than 12 bytes causes read error - return isset(self::Formats[$type]) ? $type : null; + [$width, $height, $type] = Helpers::falseToNull(@getimagesizefromstring($s)); // @ - strings smaller than 12 bytes causes read error + return $type && isset(self::Formats[$type]) ? $type : null; } /** - * Returns the file extension for the given `Image::XXX` constant. + * Returns the file extension for the given image type. + * @param ImageType::* $type + * @return value-of */ public static function typeToExtension(int $type): string { @@ -279,11 +290,12 @@ class Image /** - * Returns the `Image::XXX` constant for given file extension. + * Returns the image type for given file extension. + * @return ImageType::* */ public static function extensionToType(string $extension): int { - $extensions = array_flip(self::Formats) + ['jpg' => self::JPEG]; + $extensions = array_flip(self::Formats) + ['jpg' => ImageType::JPEG]; $extension = strtolower($extension); if (!isset($extensions[$extension])) { throw new Nette\InvalidArgumentException("Unsupported file extension '$extension'."); @@ -294,7 +306,8 @@ class Image /** - * Returns the mime type for the given `Image::XXX` constant. + * Returns the mime type for the given image type. + * @param ImageType::* $type */ public static function typeToMimeType(int $type): string { @@ -302,6 +315,44 @@ class Image } + /** + * Checks whether the given image type is supported by the GD extension. + * @param ImageType::* $type + */ + public static function isTypeSupported(int $type): bool + { + self::ensureExtension(); + return (bool) (imagetypes() & match ($type) { + ImageType::JPEG => IMG_JPG, + ImageType::PNG => IMG_PNG, + ImageType::GIF => IMG_GIF, + ImageType::WEBP => IMG_WEBP, + ImageType::AVIF => IMG_AVIF, + ImageType::BMP => IMG_BMP, + default => 0, + }); + } + + + /** + * Returns list of image types supported by the GD extension. + * @return ImageType::*[] + */ + public static function getSupportedTypes(): array + { + self::ensureExtension(); + $flag = imagetypes(); + return array_filter([ + $flag & IMG_GIF ? ImageType::GIF : null, + $flag & IMG_JPG ? ImageType::JPEG : null, + $flag & IMG_PNG ? ImageType::PNG : null, + $flag & IMG_WEBP ? ImageType::WEBP : null, + $flag & IMG_AVIF ? ImageType::AVIF : null, + $flag & IMG_BMP ? ImageType::BMP : null, + ]); + } + + /** * Wraps GD image. */ @@ -314,6 +365,7 @@ class Image /** * Returns image width. + * @return positive-int */ public function getWidth(): int { @@ -323,6 +375,7 @@ class Image /** * Returns image height. + * @return positive-int */ public function getHeight(): int { @@ -351,18 +404,22 @@ class Image /** * Scales an image. Width and height accept pixels or percent. - * @param self::OrSmaller|self::OrBigger|self::Stretch|self::Cover|self::ShrinkOnly $mode + * @param int-mask-of $mode */ public function resize(int|string|null $width, int|string|null $height, int $mode = self::OrSmaller): static { if ($mode & self::Cover) { + if ($width === null || $height === null) { + throw new Nette\InvalidArgumentException('Both width and height must be set for Cover mode.'); + } + return $this->resize($width, $height, self::OrBigger)->crop('50%', '50%', $width, $height); } [$newWidth, $newHeight] = static::calculateSize($this->getWidth(), $this->getHeight(), $width, $height, $mode); if ($newWidth !== $this->getWidth() || $newHeight !== $this->getHeight()) { // resize - $newImage = static::fromBlank($newWidth, $newHeight, self::rgb(0, 0, 0, 127))->getImageResource(); + $newImage = static::fromBlank($newWidth, $newHeight, ImageColor::rgb(0, 0, 0, 0))->getImageResource(); imagecopyresampled( $newImage, $this->image, @@ -388,13 +445,14 @@ class Image /** * Calculates dimensions of resized image. Width and height accept pixels or percent. - * @param self::OrSmaller|self::OrBigger|self::Stretch|self::Cover|self::ShrinkOnly $mode + * @param int-mask-of $mode + * @return array{int<1, max>, int<1, max>} */ public static function calculateSize( int $srcWidth, int $srcHeight, - $newWidth, - $newHeight, + int|string|null $newWidth, + int|string|null $newHeight, int $mode = self::OrSmaller, ): array { @@ -438,19 +496,19 @@ class Image } if ($mode & self::OrBigger) { - $scale = [max($scale)]; + $scale = [max($scale ?: [1])]; } if ($mode & self::ShrinkOnly) { $scale[] = 1; } - $scale = min($scale); + $scale = min($scale ?: [1]); $newWidth = (int) round($srcWidth * $scale); $newHeight = (int) round($srcHeight * $scale); } - return [max($newWidth, 1), max($newHeight, 1)]; + return [max((int) $newWidth, 1), max((int) $newHeight, 1)]; } @@ -465,7 +523,7 @@ class Image $this->image = imagecrop($this->image, $r); imagesavealpha($this->image, true); } else { - $newImage = static::fromBlank($r['width'], $r['height'], self::RGB(0, 0, 0, 127))->getImageResource(); + $newImage = static::fromBlank(max(1, $r['width']), max(1, $r['height']), ImageColor::rgb(0, 0, 0, 0))->getImageResource(); imagecopy($newImage, $this->image, 0, 0, $r['x'], $r['y'], $r['width'], $r['height']); $this->image = $newImage; } @@ -476,6 +534,7 @@ class Image /** * Calculates dimensions of cutout in image. Arguments accepts pixels or percent. + * @return array{int, int, int, int} */ public static function calculateCutout( int $srcWidth, @@ -486,21 +545,10 @@ class Image int|string $newHeight, ): array { - if (self::isPercent($newWidth)) { - $newWidth = (int) round($srcWidth / 100 * $newWidth); - } - - if (self::isPercent($newHeight)) { - $newHeight = (int) round($srcHeight / 100 * $newHeight); - } - - if (self::isPercent($left)) { - $left = (int) round(($srcWidth - $newWidth) / 100 * $left); - } - - if (self::isPercent($top)) { - $top = (int) round(($srcHeight - $newHeight) / 100 * $top); - } + $newWidth = (int) (self::isPercent($newWidth) ? round($srcWidth / 100 * $newWidth) : $newWidth); + $newHeight = (int) (self::isPercent($newHeight) ? round($srcHeight / 100 * $newHeight) : $newHeight); + $left = (int) (self::isPercent($left) ? round(($srcWidth - $newWidth) / 100 * $left) : $left); + $top = (int) (self::isPercent($top) ? round(($srcHeight - $newHeight) / 100 * $top) : $top); if ($left < 0) { $newWidth += $left; @@ -534,7 +582,7 @@ class Image /** * Puts another image into this image. Left and top accepts pixels or percent. - * @param int $opacity 0..100 + * @param int<0, 100> $opacity 0..100 */ public function place(self $image, int|string $left = 0, int|string $top = 0, int $opacity = 100): static { @@ -545,14 +593,8 @@ class Image $width = $image->getWidth(); $height = $image->getHeight(); - - if (self::isPercent($left)) { - $left = (int) round(($this->getWidth() - $width) / 100 * $left); - } - - if (self::isPercent($top)) { - $top = (int) round(($this->getHeight() - $height) / 100 * $top); - } + $left = (int) (self::isPercent($left) ? round(($this->getWidth() - $width) / 100 * $left) : $left); + $top = (int) (self::isPercent($top) ? round(($this->getHeight() - $height) / 100 * $top) : $top); $output = $input = $image->image; if ($opacity < 100) { @@ -565,7 +607,7 @@ class Image imagealphablending($output, false); if (!$image->isTrueColor()) { $input = $output; - imagefilledrectangle($output, 0, 0, $width, $height, imagecolorallocatealpha($output, 0, 0, 0, 127)); + imagefilledrectangle($output, 0, 0, $width, $height, (int) imagecolorallocatealpha($output, 0, 0, 0, 127)); imagecopy($output, $image->image, 0, 0, 0, 0, $width, $height); } @@ -594,8 +636,55 @@ class Image } + /** + * Calculates the bounding box for a TrueType text. Returns keys left, top, width and height. + * @param array $options + * @return array{left: int, top: int, width: int, height: int} + */ + public static function calculateTextBox( + string $text, + string $fontFile, + float $size, + float $angle = 0, + array $options = [], + ): array + { + self::ensureExtension(); + $box = imagettfbbox($size, $angle, $fontFile, $text, $options); + return [ + 'left' => $minX = min([$box[0], $box[2], $box[4], $box[6]]), + 'top' => $minY = min([$box[1], $box[3], $box[5], $box[7]]), + 'width' => max([$box[0], $box[2], $box[4], $box[6]]) - $minX + 1, + 'height' => max([$box[1], $box[3], $box[5], $box[7]]) - $minY + 1, + ]; + } + + + /** + * Draws a rectangle using top-left coordinates and dimensions instead of two corner coordinates. + */ + public function rectangleWH(int $x, int $y, int $width, int $height, ImageColor $color): void + { + if ($width !== 0 && $height !== 0) { + $this->rectangle($x, $y, $x + $width + ($width > 0 ? -1 : 1), $y + $height + ($height > 0 ? -1 : 1), $color); + } + } + + + /** + * Draws a filled rectangle using top-left coordinates and dimensions instead of two corner coordinates. + */ + public function filledRectangleWH(int $x, int $y, int $width, int $height, ImageColor $color): void + { + if ($width !== 0 && $height !== 0) { + $this->filledRectangle($x, $y, $x + $width + ($width > 0 ? -1 : 1), $y + $height + ($height > 0 ? -1 : 1), $color); + } + } + + /** * Saves image to the file. Quality is in the range 0..100 for JPEG (default 85), WEBP (default 80) and AVIF (default 30) and 0..9 for PNG (default 9). + * @param ?ImageType::* $type * @throws ImageException */ public function save(string $file, ?int $quality = null, ?int $type = null): void @@ -607,8 +696,9 @@ class Image /** * Outputs image to string. Quality is in the range 0..100 for JPEG (default 85), WEBP (default 80) and AVIF (default 30) and 0..9 for PNG (default 9). + * @param ImageType::* $type */ - public function toString(int $type = self::JPEG, ?int $quality = null): string + public function toString(int $type = ImageType::JPEG, ?int $quality = null): string { return Helpers::capture(function () use ($type, $quality): void { $this->output($type, $quality); @@ -627,9 +717,10 @@ class Image /** * Outputs image to browser. Quality is in the range 0..100 for JPEG (default 85), WEBP (default 80) and AVIF (default 30) and 0..9 for PNG (default 9). + * @param ImageType::* $type * @throws ImageException */ - public function send(int $type = self::JPEG, ?int $quality = null): void + public function send(int $type = ImageType::JPEG, ?int $quality = null): void { header('Content-Type: ' . self::typeToMimeType($type)); $this->output($type, $quality); @@ -638,51 +729,38 @@ class Image /** * Outputs image to browser or file. + * @param ImageType::* $type * @throws ImageException */ private function output(int $type, ?int $quality, ?string $file = null): void { - switch ($type) { - case self::JPEG: - $quality = $quality === null ? 85 : max(0, min(100, $quality)); - $success = @imagejpeg($this->image, $file, $quality); // @ is escalated to exception - break; + [$defQuality, $min, $max] = match ($type) { + ImageType::JPEG => [85, 0, 100], + ImageType::PNG => [9, 0, 9], + ImageType::GIF => [null, null, null], + ImageType::WEBP => [80, 0, 100], + ImageType::AVIF => [30, 0, 100], + ImageType::BMP => [null, null, null], + default => throw new Nette\InvalidArgumentException("Unsupported image type '$type'."), + }; - case self::PNG: - $quality = $quality === null ? 9 : max(0, min(9, $quality)); - $success = @imagepng($this->image, $file, $quality); // @ is escalated to exception - break; - - case self::GIF: - $success = @imagegif($this->image, $file); // @ is escalated to exception - break; - - case self::WEBP: - $quality = $quality === null ? 80 : max(0, min(100, $quality)); - $success = @imagewebp($this->image, $file, $quality); // @ is escalated to exception - break; - - case self::AVIF: - $quality = $quality === null ? 30 : max(0, min(100, $quality)); - $success = @imageavif($this->image, $file, $quality); // @ is escalated to exception - break; - - case self::BMP: - $success = @imagebmp($this->image, $file); // @ is escalated to exception - break; - - default: - throw new Nette\InvalidArgumentException("Unsupported image type '$type'."); + $args = [$this->image, $file]; + if ($defQuality !== null) { + $args[] = $quality === null ? $defQuality : max($min, min($max, $quality)); } - if (!$success) { - throw new ImageException(Helpers::getLastError() ?: 'Unknown error'); - } + Callback::invokeSafe('image' . self::Formats[$type], $args, function (string $message) use ($file): void { + if ($file !== null) { + @unlink($file); + } + throw new ImageException($message); + }); } /** * Call to undefined method. + * @param mixed[] $args * @throws Nette\MemberAccessException */ public function __call(string $name, array $args): mixed @@ -696,20 +774,9 @@ class Image if ($value instanceof self) { $args[$key] = $value->getImageResource(); - } elseif (is_array($value) && isset($value['red'])) { // rgb - $args[$key] = imagecolorallocatealpha( - $this->image, - $value['red'], - $value['green'], - $value['blue'], - $value['alpha'], - ) ?: imagecolorresolvealpha( - $this->image, - $value['red'], - $value['green'], - $value['blue'], - $value['alpha'], - ); + } elseif ($value instanceof ImageColor || (is_array($value) && isset($value['red']))) { + /** @var ImageColor|array{red: int, green: int, blue: int, alpha?: int} $value */ + $args[$key] = $this->resolveColor($value); } } @@ -722,12 +789,13 @@ class Image public function __clone() { - ob_start(function () {}); + ob_start(fn() => ''); imagepng($this->image, null, 0); - $this->setImageResource(imagecreatefromstring(ob_get_clean())); + $this->setImageResource(imagecreatefromstring(ob_get_clean()) ?: throw new Nette\ShouldNotHappenException); } + /** @param-out int|float $num */ private static function isPercent(int|string &$num): bool { if (is_string($num) && str_ends_with($num, '%')) { @@ -745,8 +813,41 @@ class Image /** * Prevents serialization. */ - public function __sleep(): array + public function __serialize(): array { throw new Nette\NotSupportedException('You cannot serialize or unserialize ' . self::class . ' instances.'); } + + + /** + * Resolves a color to a GD color index for the current image. + * @param ImageColor|array{red: int, green: int, blue: int, alpha?: int} $color + */ + public function resolveColor(ImageColor|array $color): int + { + $color = self::normalizeColor($color)->toRGBA(); + return imagecolorallocatealpha($this->image, ...$color) ?: imagecolorresolvealpha($this->image, ...$color); + } + + + /** @param ImageColor|array{red: int, green: int, blue: int, alpha?: int} $color */ + private static function normalizeColor(ImageColor|array $color): ImageColor + { + return $color instanceof ImageColor + ? $color + : ImageColor::rgb( + $color['red'], + $color['green'], + $color['blue'], + (127 - ($color['alpha'] ?? 0)) / 127, + ); + } + + + private static function ensureExtension(): void + { + if (!extension_loaded('gd')) { + throw new Nette\NotSupportedException('PHP extension GD is not loaded.'); + } + } } diff --git a/vendor/nette/utils/src/Utils/Json.php b/vendor/nette/utils/src/Utils/Json.php index b87917b2..4103d8b9 100644 --- a/vendor/nette/utils/src/Utils/Json.php +++ b/vendor/nette/utils/src/Utils/Json.php @@ -1,15 +1,15 @@ -isPublic() && !$rp->isStatic()) { $prop = $name >= 'onA' && $name < 'on_' ? 'event' : true; } - } catch (\ReflectionException $e) { + } catch (\ReflectionException) { } } diff --git a/vendor/nette/utils/src/Utils/Paginator.php b/vendor/nette/utils/src/Utils/Paginator.php index 91d55c50..e95df0d2 100644 --- a/vendor/nette/utils/src/Utils/Paginator.php +++ b/vendor/nette/utils/src/Utils/Paginator.php @@ -1,12 +1,10 @@ - $firstItemOnPage + * @property-read int<0,max> $lastItemOnPage * @property int $base * @property-read bool $first * @property-read bool $last - * @property-read int|null $pageCount - * @property int $itemsPerPage - * @property int|null $itemCount - * @property-read int $offset - * @property-read int|null $countdownOffset - * @property-read int $length + * @property-read ?int<0,max> $pageCount + * @property positive-int $itemsPerPage + * @property ?int<0,max> $itemCount + * @property-read int<0,max> $offset + * @property-read ?int<0,max> $countdownOffset + * @property-read int<0,max> $length */ class Paginator { use Nette\SmartObject; private int $base = 1; + + /** @var positive-int */ private int $itemsPerPage = 1; + private int $page = 1; + + /** @var ?int<0, max> */ private ?int $itemCount = null; - /** - * Sets current page number. - */ public function setPage(int $page): static { $this->page = $page; @@ -50,27 +50,18 @@ class Paginator } - /** - * Returns current page number. - */ public function getPage(): int { return $this->base + $this->getPageIndex(); } - /** - * Returns first page number. - */ public function getFirstPage(): int { return $this->base; } - /** - * Returns last page number. - */ public function getLastPage(): ?int { return $this->itemCount === null @@ -80,7 +71,8 @@ class Paginator /** - * Returns the sequence number of the first element on the page + * Returns the 1-based index of the first item on the current page, or 0 if the page is empty. + * @return int<0, max> */ public function getFirstItemOnPage(): int { @@ -91,7 +83,8 @@ class Paginator /** - * Returns the sequence number of the last element on the page + * Returns the 1-based index of the last item on the current page. + * @return int<0, max> */ public function getLastItemOnPage(): int { @@ -99,9 +92,6 @@ class Paginator } - /** - * Sets first page (base) number. - */ public function setBase(int $base): static { $this->base = $base; @@ -109,9 +99,6 @@ class Paginator } - /** - * Returns first page (base) number. - */ public function getBase(): int { return $this->base; @@ -120,6 +107,7 @@ class Paginator /** * Returns zero-based page number. + * @return int<0, max> */ protected function getPageIndex(): int { @@ -130,18 +118,12 @@ class Paginator } - /** - * Is the current page the first one? - */ public function isFirst(): bool { return $this->getPageIndex() === 0; } - /** - * Is the current page the last one? - */ public function isLast(): bool { return $this->itemCount === null @@ -151,19 +133,16 @@ class Paginator /** - * Returns the total number of pages. + * @return ?int<0, max> */ public function getPageCount(): ?int { return $this->itemCount === null ? null - : (int) ceil($this->itemCount / $this->itemsPerPage); + : max(0, (int) ceil($this->itemCount / $this->itemsPerPage)); } - /** - * Sets the number of items to display on a single page. - */ public function setItemsPerPage(int $itemsPerPage): static { $this->itemsPerPage = max(1, $itemsPerPage); @@ -172,7 +151,7 @@ class Paginator /** - * Returns the number of items to display on a single page. + * @return positive-int */ public function getItemsPerPage(): int { @@ -180,9 +159,6 @@ class Paginator } - /** - * Sets the total number of items. - */ public function setItemCount(?int $itemCount = null): static { $this->itemCount = $itemCount === null ? null : max(0, $itemCount); @@ -191,7 +167,7 @@ class Paginator /** - * Returns the total number of items. + * @return ?int<0, max> */ public function getItemCount(): ?int { @@ -201,6 +177,7 @@ class Paginator /** * Returns the absolute index of the first item on current page. + * @return int<0, max> */ public function getOffset(): int { @@ -210,6 +187,7 @@ class Paginator /** * Returns the absolute index of the first item on current page in countdown paging. + * @return ?int<0, max> */ public function getCountdownOffset(): ?int { @@ -221,11 +199,12 @@ class Paginator /** * Returns the number of items on current page. + * @return int<0, max> */ public function getLength(): int { return $this->itemCount === null ? $this->itemsPerPage - : min($this->itemsPerPage, $this->itemCount - $this->getPageIndex() * $this->itemsPerPage); + : max(0, min($this->itemsPerPage, $this->itemCount - $this->getPageIndex() * $this->itemsPerPage)); } } diff --git a/vendor/nette/utils/src/Utils/Random.php b/vendor/nette/utils/src/Utils/Random.php index d8ebcdc7..f3ec874c 100644 --- a/vendor/nette/utils/src/Utils/Random.php +++ b/vendor/nette/utils/src/Utils/Random.php @@ -1,15 +1,16 @@ -= 80300) { + return (new Randomizer)->getBytesFromString($charlist, $length); } $res = ''; diff --git a/vendor/nette/utils/src/Utils/Reflection.php b/vendor/nette/utils/src/Utils/Reflection.php index f5a36a25..d6a7b3b3 100644 --- a/vendor/nette/utils/src/Utils/Reflection.php +++ b/vendor/nette/utils/src/Utils/Reflection.php @@ -1,15 +1,15 @@ -isDefaultValueConstant()) { - $const = $orig = $param->getDefaultValueConstantName(); + $const = $orig = $param->getDefaultValueConstantName() ?? throw new Nette\ShouldNotHappenException; $pair = explode('::', $const); if (isset($pair[1])) { $pair[0] = Type::resolve($pair[0], $param); @@ -67,6 +70,7 @@ final class Reflection /** * Returns a reflection of a class or trait that contains a declaration of given property. Property can also be declared in the trait. + * @return \ReflectionClass */ public static function getPropertyDeclaringClass(\ReflectionProperty $prop): \ReflectionClass { @@ -100,7 +104,7 @@ final class Reflection $hash = [$method->getFileName(), $method->getStartLine(), $method->getEndLine()]; if (($alias = $decl->getTraitAliases()[$method->name] ?? null) - && ($m = new \ReflectionMethod($alias)) + && ($m = new \ReflectionMethod(...explode('::', $alias, 2))) && $hash === [$m->getFileName(), $m->getStartLine(), $m->getEndLine()] ) { return self::getMethodDeclaringMethod($m); @@ -125,10 +129,13 @@ final class Reflection public static function areCommentsAvailable(): bool { static $res; - return $res ?? $res = (bool) (new \ReflectionMethod(__METHOD__))->getDocComment(); + return $res ?? $res = (bool) (new \ReflectionMethod(self::class, __FUNCTION__))->getDocComment(); } + /** + * Returns a human-readable string representation of a reflection object. + */ public static function toString(\Reflector $ref): string { if ($ref instanceof \ReflectionClass) { @@ -136,7 +143,7 @@ final class Reflection } elseif ($ref instanceof \ReflectionMethod) { return $ref->getDeclaringClass()->name . '::' . $ref->name . '()'; } elseif ($ref instanceof \ReflectionFunction) { - return $ref->name . '()'; + return $ref->isAnonymous() ? '{closure}()' : $ref->name . '()'; } elseif ($ref instanceof \ReflectionProperty) { return self::getPropertyDeclaringClass($ref)->name . '::$' . $ref->name; } elseif ($ref instanceof \ReflectionParameter) { @@ -150,6 +157,7 @@ final class Reflection /** * Expands the name of the class to full name in the given context of given class. * Thus, it returns how the PHP parser would understand $name if it were written in the body of the class $context. + * @param \ReflectionClass $context * @throws Nette\InvalidArgumentException */ public static function expandClassName(string $name, \ReflectionClass $context): string @@ -188,7 +196,11 @@ final class Reflection } - /** @return array of [alias => class] */ + /** + * Returns the use statements from the file where the class is defined. + * @param \ReflectionClass $class + * @return array Map of alias to fully qualified class name + */ public static function getUseStatements(\ReflectionClass $class): array { if ($class->isAnonymous()) { @@ -200,7 +212,7 @@ final class Reflection if ($class->isInternal()) { $cache[$name] = []; } else { - $code = file_get_contents($class->getFileName()); + $code = (string) file_get_contents((string) $class->getFileName()); $cache = self::parseUseStatements($code, $name) + $cache; } } @@ -211,17 +223,19 @@ final class Reflection /** * Parses PHP code to [class => [alias => class, ...]] + * @return array> */ private static function parseUseStatements(string $code, ?string $forClass = null): array { try { $tokens = \PhpToken::tokenize($code, TOKEN_PARSE); } catch (\ParseError $e) { - trigger_error($e->getMessage(), E_USER_NOTICE); + trigger_error($e->getMessage()); $tokens = []; } - $namespace = $class = $classLevel = $level = null; + $namespace = $class = null; + $classLevel = $level = 0; $res = $uses = []; $nameTokens = [T_STRING, T_NS_SEPARATOR, T_NAME_QUALIFIED, T_NAME_FULLY_QUALIFIED]; @@ -237,9 +251,7 @@ final class Reflection case T_CLASS: case T_INTERFACE: case T_TRAIT: - case PHP_VERSION_ID < 80100 - ? T_CLASS - : T_ENUM: + case T_ENUM: if ($name = self::fetch($tokens, T_STRING)) { $class = $namespace . $name; $classLevel = $level + 1; @@ -256,8 +268,8 @@ final class Reflection $name = ltrim($name, '\\'); if (self::fetch($tokens, '{')) { while ($suffix = self::fetch($tokens, $nameTokens)) { - if (self::fetch($tokens, T_AS)) { - $uses[self::fetch($tokens, T_STRING)] = $name . $suffix; + if (self::fetch($tokens, T_AS) && ($alias = self::fetch($tokens, T_STRING))) { + $uses[$alias] = $name . $suffix; } else { $tmp = explode('\\', $suffix); $uses[end($tmp)] = $name . $suffix; @@ -267,8 +279,8 @@ final class Reflection break; } } - } elseif (self::fetch($tokens, T_AS)) { - $uses[self::fetch($tokens, T_STRING)] = $name; + } elseif (self::fetch($tokens, T_AS) && ($alias = self::fetch($tokens, T_STRING))) { + $uses[$alias] = $name; } else { $tmp = explode('\\', $name); @@ -290,7 +302,7 @@ final class Reflection case ord('}'): if ($level === $classLevel) { - $class = $classLevel = null; + $class = $classLevel = 0; } $level--; @@ -301,6 +313,10 @@ final class Reflection } + /** + * @param \PhpToken[] $tokens + * @param string|int|int[] $take + */ private static function fetch(array &$tokens, string|int|array $take): ?string { $res = null; diff --git a/vendor/nette/utils/src/Utils/Strings.php b/vendor/nette/utils/src/Utils/Strings.php index 32732c10..27bd39c9 100644 --- a/vendor/nette/utils/src/Utils/Strings.php +++ b/vendor/nette/utils/src/Utils/Strings.php @@ -1,17 +1,16 @@ - '(R)', "\u{A9}" => '(c)', "\u{2026}" => '...', "\u{AB}" => '<<', "\u{BB}" => '>>', "\u{A3}" => 'lb', "\u{A5}" => 'yen', "\u{B2}" => '^2', "\u{B3}" => '^3', "\u{B5}" => 'u', "\u{B9}" => '^1', "\u{BA}" => 'o', "\u{BF}" => '?', "\u{2CA}" => "'", "\u{2CD}" => '_', "\u{2DD}" => '"', "\u{1FEF}" => '', "\u{20AC}" => 'EUR', "\u{2122}" => 'TM', "\u{212E}" => 'e', "\u{2190}" => '<-', "\u{2191}" => '^', "\u{2192}" => '->', "\u{2193}" => 'V', "\u{2194}" => '<->']); // ® © … « » £ ¥ ² ³ µ ¹ º ¿ ˊ ˍ ˝ ` € ™ ℮ ← ↑ → ↓ ↔ } - if ($transliterator) { - $s = $transliterator->transliterate($s); - // use iconv because The transliterator leaves some characters out of ASCII, eg → ʾ - if ($iconv === 'glibc') { - $s = strtr($s, '?', "\x01"); // temporarily hide ? to distinguish them from the garbage that iconv creates - $s = iconv('UTF-8', 'ASCII//TRANSLIT//IGNORE', $s); - $s = str_replace(['?', "\x01"], ['', '?'], $s); // remove garbage and restore ? characters - } elseif ($iconv === 'libiconv') { - $s = iconv('UTF-8', 'ASCII//TRANSLIT//IGNORE', $s); - } else { // null or 'unknown' (#216) - $s = self::pcre('preg_replace', ['#[^\x00-\x7F]++#', '', $s]); // remove non-ascii chars - } - } elseif ($iconv === 'glibc' || $iconv === 'libiconv') { - // temporarily hide these characters to distinguish them from the garbage that iconv creates - $s = strtr($s, '`\'"^~?', "\x01\x02\x03\x04\x05\x06"); - if ($iconv === 'glibc') { - // glibc implementation is very limited. transliterate into Windows-1250 and then into ASCII, so most Eastern European characters are preserved - $s = iconv('UTF-8', 'WINDOWS-1250//TRANSLIT//IGNORE', $s); - $s = strtr( - $s, - "\xa5\xa3\xbc\x8c\xa7\x8a\xaa\x8d\x8f\x8e\xaf\xb9\xb3\xbe\x9c\x9a\xba\x9d\x9f\x9e\xbf\xc0\xc1\xc2\xc3\xc4\xc5\xc6\xc7\xc8\xc9\xca\xcb\xcc\xcd\xce\xcf\xd0\xd1\xd2\xd3\xd4\xd5\xd6\xd7\xd8\xd9\xda\xdb\xdc\xdd\xde\xdf\xe0\xe1\xe2\xe3\xe4\xe5\xe6\xe7\xe8\xe9\xea\xeb\xec\xed\xee\xef\xf0\xf1\xf2\xf3\xf4\xf5\xf6\xf8\xf9\xfa\xfb\xfc\xfd\xfe\x96\xa0\x8b\x97\x9b\xa6\xad\xb7", - 'ALLSSSSTZZZallssstzzzRAAAALCCCEEEEIIDDNNOOOOxRUUUUYTsraaaalccceeeeiiddnnooooruuuuyt- <->|-.', - ); - $s = self::pcre('preg_replace', ['#[^\x00-\x7F]++#', '', $s]); - } else { - $s = iconv('UTF-8', 'ASCII//TRANSLIT//IGNORE', $s); + $s = \Transliterator::create('Any-Latin; Latin-ASCII')?->transliterate($s) + ?? throw new Nette\InvalidStateException('Transliterator::transliterate() failed.'); + + // use iconv because The transliterator leaves some characters out of ASCII, eg → ʾ + if ($iconv === 'glibc') { + $s = strtr($s, '?', "\x01"); // temporarily hide ? to distinguish them from the garbage that iconv creates + $s = iconv('UTF-8', 'ASCII//TRANSLIT//IGNORE', $s); + if ($s === false) { + throw new Nette\InvalidStateException('iconv() failed.'); } - // remove garbage that iconv creates during transliteration (eg Ý -> Y') - $s = str_replace(['`', "'", '"', '^', '~', '?'], '', $s); - // restore temporarily hidden characters - $s = strtr($s, "\x01\x02\x03\x04\x05\x06", '`\'"^~?'); - } else { + $s = str_replace(['?', "\x01"], ['', '?'], $s); // remove garbage and restore ? characters + } elseif ($iconv === 'libiconv') { + $s = iconv('UTF-8', 'ASCII//TRANSLIT//IGNORE', $s); + if ($s === false) { + throw new Nette\InvalidStateException('iconv() failed.'); + } + } else { // null or 'unknown' (#216) $s = self::pcre('preg_replace', ['#[^\x00-\x7F]++#', '', $s]); // remove non-ascii chars } @@ -351,9 +332,9 @@ class Strings */ public static function compare(string $left, string $right, ?int $length = null): bool { - if (class_exists('Normalizer', false)) { - $left = \Normalizer::normalize($left, \Normalizer::FORM_D); // form NFD is faster - $right = \Normalizer::normalize($right, \Normalizer::FORM_D); // form NFD is faster + if (class_exists('Normalizer', autoload: false)) { + $left = \Normalizer::normalize($left, \Normalizer::FORM_D) ?: $left; // form NFD is faster, false on invalid UTF-8 + $right = \Normalizer::normalize($right, \Normalizer::FORM_D) ?: $right; // form NFD is faster, false on invalid UTF-8 } if ($length < 0) { @@ -375,6 +356,10 @@ class Strings public static function findPrefix(array $strings): string { $first = array_shift($strings); + if ($first === null) { + return ''; + } + for ($i = 0; $i < strlen($first); $i++) { foreach ($strings as $s) { if (!isset($s[$i]) || $first[$i] !== $s[$i]) { @@ -397,9 +382,11 @@ class Strings */ public static function length(string $s): int { - return function_exists('mb_strlen') - ? mb_strlen($s, 'UTF-8') - : strlen(utf8_decode($s)); + return match (true) { + extension_loaded('mbstring') => (int) mb_strlen($s, 'UTF-8'), + extension_loaded('iconv') => (int) iconv_strlen($s, 'UTF-8'), + default => strlen((string) preg_replace('#[\x80-\xBF]#', '', $s)), // strips UTF-8 continuation bytes + }; } @@ -409,12 +396,13 @@ class Strings public static function trim(string $s, string $charlist = self::TrimCharacters): string { $charlist = preg_quote($charlist, '#'); - return self::replace($s, '#^[' . $charlist . ']+|[' . $charlist . ']+$#Du', ''); + return self::replace($s, '#^[' . $charlist . ']+|[' . $charlist . ']+$#Du'); } /** * Pads a UTF-8 string to given length by prepending the $pad string to the beginning. + * @param non-empty-string $pad */ public static function padLeft(string $s, int $length, string $pad = ' '): string { @@ -426,6 +414,7 @@ class Strings /** * Pads UTF-8 string to given length by appending the $pad string to the end. + * @param non-empty-string $pad */ public static function padRight(string $s, int $length, string $pad = ' '): string { @@ -444,7 +433,10 @@ class Strings throw new Nette\NotSupportedException(__METHOD__ . '() requires ICONV extension that is not loaded.'); } - return iconv('UTF-32LE', 'UTF-8', strrev(iconv('UTF-8', 'UTF-32BE', $s))); + $tmp = iconv('UTF-8', 'UTF-32BE', $s); + return $tmp === false + ? throw new Nette\InvalidStateException('iconv() failed.') + : (string) iconv('UTF-32LE', 'UTF-8', strrev($tmp)); } @@ -522,7 +514,8 @@ class Strings /** - * Divides the string into arrays according to the regular expression. Expressions in parentheses will be captured and returned as well. + * Splits the string by a regular expression. Expressions in parentheses will be captured and returned as well. + * @return list */ public static function split( string $subject, @@ -543,13 +536,13 @@ class Strings return $utf8 && $captureOffset ? self::bytesToChars($subject, [$m])[0] : $m; - } /** - * Searches the string for the part matching the regular expression and returns - * an array with the found expression and individual subexpressions, or `null`. + * Searches the string for the first match of the regular expression and returns + * an array with the found expression and individual subexpressions, or null. + * @return ?array */ public static function match( string $subject, @@ -570,6 +563,7 @@ class Strings $pattern .= 'u'; } + $m = []; if ($offset > strlen($subject)) { return null; } elseif (!self::pcre('preg_match', [$pattern, $subject, &$m, $flags, $offset])) { @@ -583,8 +577,9 @@ class Strings /** - * Searches the string for all occurrences matching the regular expression and - * returns an array of arrays containing the found expression and each subexpression. + * Searches the string for all occurrences matching the regular expression and returns + * an array of arrays containing the found expression and each subexpression. + * @return ($lazy is true ? \Generator> : list>) */ public static function matchAll( string $subject, @@ -595,21 +590,44 @@ class Strings bool $unmatchedAsNull = false, bool $patternOrder = false, bool $utf8 = false, - ): array + bool $lazy = false, + ): array|\Generator { - $flags = is_int($captureOffset) // back compatibility - ? $captureOffset - : ($captureOffset ? PREG_OFFSET_CAPTURE : 0) | ($unmatchedAsNull ? PREG_UNMATCHED_AS_NULL : 0) | ($patternOrder ? PREG_PATTERN_ORDER : 0); - if ($utf8) { $offset = strlen(self::substring($subject, 0, $offset)); $pattern .= 'u'; } + if ($lazy) { + $flags = PREG_OFFSET_CAPTURE | ($unmatchedAsNull ? PREG_UNMATCHED_AS_NULL : 0); + return (function () use ($utf8, $captureOffset, $flags, $subject, $pattern, $offset) { + $counter = 0; + $m = []; + while ( + $offset <= strlen($subject) - ($counter ? 1 : 0) + && self::pcre('preg_match', [$pattern, $subject, &$m, $flags, $offset]) + ) { + /** @var list $m */ + $offset = $m[0][1] + max(1, strlen($m[0][0])); + if (!$captureOffset) { + $m = array_map(fn($item) => $item[0], $m); + } elseif ($utf8) { + $m = self::bytesToChars($subject, [$m])[0]; + } + yield $counter++ => $m; + } + })(); + } + if ($offset > strlen($subject)) { return []; } + $flags = is_int($captureOffset) // back compatibility + ? $captureOffset + : ($captureOffset ? PREG_OFFSET_CAPTURE : 0) | ($unmatchedAsNull ? PREG_UNMATCHED_AS_NULL : 0) | ($patternOrder ? PREG_PATTERN_ORDER : 0); + + $m = []; self::pcre('preg_match_all', [ $pattern, $subject, &$m, ($flags & PREG_PATTERN_ORDER) ? $flags : ($flags | PREG_SET_ORDER), @@ -618,12 +636,12 @@ class Strings return $utf8 && $captureOffset ? self::bytesToChars($subject, $m) : $m; - } /** - * Replaces all occurrences matching regular expression $pattern which can be string or array in the form `pattern => replacement`. + * Replaces all occurrences matching the regular expression $pattern, which can be a string or array in the form `pattern => replacement`. + * @param string|array $pattern */ public static function replace( string $subject, @@ -643,7 +661,7 @@ class Strings $flags = ($captureOffset ? PREG_OFFSET_CAPTURE : 0) | ($unmatchedAsNull ? PREG_UNMATCHED_AS_NULL : 0); if ($utf8) { - $pattern .= 'u'; + $pattern = is_array($pattern) ? array_map(fn($item) => $item . 'u', $pattern) : $pattern . 'u'; if ($captureOffset) { $replacement = fn($m) => $replacement(self::bytesToChars($subject, [$m])[0]); } @@ -664,6 +682,10 @@ class Strings } + /** + * @param list> $groups + * @return list> + */ private static function bytesToChars(string $s, array $groups): array { $lastBytes = $lastChars = 0; @@ -684,8 +706,12 @@ class Strings } - /** @internal */ - public static function pcre(string $func, array $args) + /** + * @param callable-string $func + * @param list $args + * @internal + */ + public static function pcre(string $func, array $args): mixed { $res = Callback::invokeSafe($func, $args, function (string $message) use ($args): void { // compile-time error, not detectable by preg_last_error @@ -693,7 +719,7 @@ class Strings }); if (($code = preg_last_error()) // run-time error, but preg_last_error & return code are liars - && ($res === null || !in_array($func, ['preg_filter', 'preg_replace_callback', 'preg_replace'], true)) + && ($res === null || !in_array($func, ['preg_filter', 'preg_replace_callback', 'preg_replace'], strict: true)) ) { throw new RegexpException(preg_last_error_msg() . ' (pattern: ' . implode(' or ', (array) $args[0]) . ')', $code); diff --git a/vendor/nette/utils/src/Utils/Type.php b/vendor/nette/utils/src/Utils/Type.php index 965977bc..329475ce 100644 --- a/vendor/nette/utils/src/Utils/Type.php +++ b/vendor/nette/utils/src/Utils/Type.php @@ -1,25 +1,24 @@ - */ + /** @var list */ private array $types; - private bool $simple; + private ?string $singleName; private string $kind; // | & @@ -32,14 +31,19 @@ final class Type ): ?self { $type = $reflection instanceof \ReflectionFunctionAbstract - ? $reflection->getReturnType() ?? (PHP_VERSION_ID >= 80100 && $reflection instanceof \ReflectionMethod ? $reflection->getTentativeReturnType() : null) + ? $reflection->getReturnType() ?? ($reflection instanceof \ReflectionMethod ? $reflection->getTentativeReturnType() : null) : $reflection->getType(); - return $type ? self::fromReflectionType($type, $reflection, true) : null; + return $type ? self::fromReflectionType($type, $reflection, asObject: true) : null; } - private static function fromReflectionType(\ReflectionType $type, $of, bool $asObject): self|string + /** @return ($asObject is true ? self : self|string) */ + private static function fromReflectionType( + \ReflectionType $type, + \ReflectionFunctionAbstract|\ReflectionParameter|\ReflectionProperty $of, + bool $asObject, + ): self|string { if ($type instanceof \ReflectionNamedType) { $name = self::resolve($type->getName(), $of); @@ -49,7 +53,7 @@ final class Type } elseif ($type instanceof \ReflectionUnionType || $type instanceof \ReflectionIntersectionType) { return new self( - array_map(fn($t) => self::fromReflectionType($t, $of, false), $type->getTypes()), + array_map(fn($t) => self::fromReflectionType($t, $of, asObject: false), $type->getTypes()), $type instanceof \ReflectionUnionType ? '|' : '&', ); @@ -84,37 +88,62 @@ final class Type } + /** + * Creates a Type object based on the actual type of value. + */ + public static function fromValue(mixed $value): self + { + $type = get_debug_type($value); + if (is_resource($value)) { + $type = 'mixed'; + } elseif (str_ends_with($type, '@anonymous')) { + $parent = substr($type, 0, -10); + $type = $parent === 'class' ? 'object' : $parent; + } + + return new self([$type]); + } + + /** * Resolves 'self', 'static' and 'parent' to the actual class name. */ public static function resolve( string $type, - \ReflectionFunctionAbstract|\ReflectionParameter|\ReflectionProperty $of, + \ReflectionFunction|\ReflectionMethod|\ReflectionParameter|\ReflectionProperty $of, ): string { $lower = strtolower($type); if ($of instanceof \ReflectionFunction) { return $type; - } elseif ($lower === 'self' || $lower === 'static') { - return $of->getDeclaringClass()->name; - } elseif ($lower === 'parent' && $of->getDeclaringClass()->getParentClass()) { - return $of->getDeclaringClass()->getParentClass()->name; + } + + $class = $of->getDeclaringClass(); + if ($class === null) { + return $type; + } elseif ($lower === 'self') { + return $class->name; + } elseif ($lower === 'static') { + return ($of instanceof ReflectionMethod ? $of->getOriginalClass() : $class)->name; + } elseif ($lower === 'parent' && $class->getParentClass()) { + return $class->getParentClass()->name; } else { return $type; } } + /** @param array $types */ private function __construct(array $types, string $kind = '|') { - $o = array_search('null', $types, true); + $o = array_search('null', $types, strict: true); if ($o !== false) { // null as last - array_splice($types, $o, 1); + array_splice($types, (int) $o, 1); $types[] = 'null'; } - $this->types = $types; - $this->simple = is_string($types[0]) && ($types[1] ?? 'null') === 'null'; + $this->types = array_values($types); + $this->singleName = is_string($types[0]) && ($types[1] ?? 'null') === 'null' ? $types[0] : null; $this->kind = count($types) > 1 ? $kind : ''; } @@ -122,8 +151,8 @@ final class Type public function __toString(): string { $multi = count($this->types) > 1; - if ($this->simple) { - return ($multi ? '?' : '') . $this->types[0]; + if ($this->singleName !== null) { + return ($multi ? '?' : '') . $this->singleName; } $res = []; @@ -134,9 +163,26 @@ final class Type } + /** + * Returns a union type that accepts both the current type and the given type. + */ + public function with(string|self $type): self + { + $type = is_string($type) ? self::fromString($type) : $type; + return match (true) { + $this->allows($type) => $this, + $type->allows($this) => $type, + default => new self(array_unique( + array_merge($this->isIntersection() ? [$this] : $this->types, $type->isIntersection() ? [$type] : $type->types), + SORT_REGULAR, + ), '|'), + }; + } + + /** * Returns the array of subtypes that make up the compound type as strings. - * @return array + * @return list>> */ public function getNames(): array { @@ -145,8 +191,8 @@ final class Type /** - * Returns the array of subtypes that make up the compound type as Type objects: - * @return self[] + * Returns the array of subtypes that make up the compound type as Type objects. + * @return list */ public function getTypes(): array { @@ -159,9 +205,7 @@ final class Type */ public function getSingleName(): ?string { - return $this->simple - ? $this->types[0] - : null; + return $this->singleName; } @@ -184,36 +228,36 @@ final class Type /** - * Returns true whether it is a simple type. Single nullable types are also considered to be simple types. + * Checks whether it is a simple (non-compound) type. Single nullable types such as ?int are also considered simple. */ public function isSimple(): bool { - return $this->simple; + return $this->singleName !== null; } - /** @deprecated use isSimple() */ + #[\Deprecated('use isSimple()')] public function isSingle(): bool { - return $this->simple; + return $this->singleName !== null; } /** - * Returns true whether the type is both a simple and a PHP built-in type. + * Checks whether it is a simple PHP built-in type (int, string, bool, etc.). */ public function isBuiltin(): bool { - return $this->simple && Validators::isBuiltinType($this->types[0]); + return $this->singleName !== null && Validators::isBuiltinType($this->singleName); } /** - * Returns true whether the type is both a simple and a class name. + * Checks whether it is a simple class or interface name (not a built-in type). */ public function isClass(): bool { - return $this->simple && !Validators::isBuiltinType($this->types[0]); + return $this->singleName !== null && !Validators::isBuiltinType($this->singleName); } @@ -222,44 +266,49 @@ final class Type */ public function isClassKeyword(): bool { - return $this->simple && Validators::isClassKeyword($this->types[0]); + return $this->singleName !== null && Validators::isClassKeyword($this->singleName); } /** - * Verifies type compatibility. For example, it checks if a value of a certain type could be passed as a parameter. + * Checks whether a value of the given type could be assigned to this type. */ - public function allows(string $subtype): bool + public function allows(string|self $type): bool { if ($this->types === ['mixed']) { return true; } - $subtype = self::fromString($subtype); - return $subtype->isUnion() - ? Arrays::every($subtype->types, fn($t) => $this->allows2($t instanceof self ? $t->types : [$t])) - : $this->allows2($subtype->types); + $type = is_string($type) ? self::fromString($type) : $type; + return $type->isUnion() + ? Arrays::every($type->types, fn($t) => $this->allowsAny($t instanceof self ? $t->types : [$t])) + : $this->allowsAny($type->types); } - private function allows2(array $subtypes): bool + /** @param array $givenTypes */ + private function allowsAny(array $givenTypes): bool { return $this->isUnion() - ? Arrays::some($this->types, fn($t) => $this->allows3($t instanceof self ? $t->types : [$t], $subtypes)) - : $this->allows3($this->types, $subtypes); + ? Arrays::some($this->types, fn($t) => $this->allowsAll($t instanceof self ? $t->types : [$t], $givenTypes)) + : $this->allowsAll($this->types, $givenTypes); } - private function allows3(array $types, array $subtypes): bool + /** + * @param array $ourTypes + * @param array $givenTypes + */ + private function allowsAll(array $ourTypes, array $givenTypes): bool { return Arrays::every( - $types, - fn($type) => Arrays::some( - $subtypes, - fn($subtype) => Validators::isBuiltinType($type) - ? strcasecmp($type, $subtype) === 0 - : is_a($subtype, $type, true) - ) + $ourTypes, + fn(string $ourType) => Arrays::some( + $givenTypes, + fn(string $givenType) => Validators::isBuiltinType($ourType) + ? strcasecmp($ourType, $givenType) === 0 + : is_a($givenType, $ourType, allow_string: true), + ), ); } } diff --git a/vendor/nette/utils/src/Utils/Validators.php b/vendor/nette/utils/src/Utils/Validators.php index 8e34fb03..b11d7e1e 100644 --- a/vendor/nette/utils/src/Utils/Validators.php +++ b/vendor/nette/utils/src/Utils/Validators.php @@ -1,15 +1,14 @@ - 1, 'true' => 1, ]; - /** @var array */ + /** @var array */ protected static $validators = [ // PHP types 'array' => 'is_array', @@ -75,7 +74,7 @@ class Validators 'type' => [self::class, 'isType'], ]; - /** @var array */ + /** @var array */ protected static $counters = [ 'string' => 'strlen', 'unicode' => [Strings::class, 'length'], @@ -102,7 +101,7 @@ class Validators $translate = ['boolean' => 'bool', 'integer' => 'int', 'double' => 'float', 'NULL' => 'null']; $type = $translate[gettype($value)] ?? gettype($value); if (is_int($value) || is_float($value) || (is_string($value) && strlen($value) < 40)) { - $type .= ' ' . var_export($value, true); + $type .= ' ' . var_export($value, return: true); } elseif (is_object($value)) { $type .= ' ' . $value::class; } @@ -113,22 +112,22 @@ class Validators /** - * Verifies that element $key in array is of expected types separated by pipe. + * Verifies that item $key in array exists and is of expected types separated by pipe. * @param mixed[] $array * @throws AssertionException */ public static function assertField( array $array, - $key, + int|string $key, ?string $expected = null, string $label = "item '%' in array", ): void { if (!array_key_exists($key, $array)) { - throw new AssertionException('Missing ' . str_replace('%', $key, $label) . '.'); + throw new AssertionException('Missing ' . str_replace('%', (string) $key, $label) . '.'); } elseif ($expected) { - static::assert($array[$key], $expected, str_replace('%', $key, $label)); + static::assert($array[$key], $expected, str_replace('%', (string) $key, $label)); } } @@ -158,7 +157,7 @@ class Validators if (!static::$validators[$type]($value)) { continue; } - } catch (\TypeError $e) { + } catch (\TypeError) { continue; } } elseif ($type === 'pattern') { @@ -196,7 +195,7 @@ class Validators /** * Finds whether all values are of expected types separated by pipe. - * @param mixed[] $values + * @param iterable $values */ public static function everyIs(iterable $values, string $expected): bool { @@ -212,6 +211,7 @@ class Validators /** * Checks if the value is an integer or a float. + * @return ($value is int|float ? true : false) */ public static function isNumber(mixed $value): bool { @@ -221,6 +221,7 @@ class Validators /** * Checks if the value is an integer or a integer written in a string. + * @return ($value is non-empty-string ? bool : ($value is int ? true : false)) */ public static function isNumericInt(mixed $value): bool { @@ -230,6 +231,7 @@ class Validators /** * Checks if the value is a number or a number written in a string. + * @return ($value is non-empty-string ? bool : ($value is int|float ? true : false)) */ public static function isNumeric(mixed $value): bool { @@ -242,7 +244,7 @@ class Validators */ public static function isCallable(mixed $value): bool { - return $value && is_callable($value, true); + return $value && is_callable($value, syntax_only: true); } @@ -257,6 +259,7 @@ class Validators /** * Checks if the value is 0, '', false or null. + * @return ($value is 0|0.0|''|false|null ? true : false) */ public static function isNone(mixed $value): bool { @@ -274,6 +277,7 @@ class Validators /** * Checks if a variable is a zero-based integer indexed array. * @deprecated use Nette\Utils\Arrays::isList + * @return ($value is list ? true : false) */ public static function isList(mixed $value): bool { @@ -284,6 +288,7 @@ class Validators /** * Checks if the value is in the given range [min, max], where the upper or lower limit can be omitted (null). * Numbers, strings and DateTime objects can be compared. + * @param array{int|float|string|\DateTimeInterface|null, int|float|string|\DateTimeInterface|null} $range */ public static function isInRange(mixed $value, array $range): bool { @@ -332,14 +337,15 @@ class Validators public static function isUrl(string $value): bool { $alpha = "a-z\x80-\xFF"; + $octet = '(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9]?[0-9])'; // 0..255 return (bool) preg_match(<<= 7.0; for parsing PHP 5.2 to PHP 8.2). +[**Documentation for version 4.x**][doc_4_x] (stable; for running on PHP >= 7.1; for parsing PHP 5.2 to PHP 8.2). [Documentation for version 3.x][doc_3_x] (unsupported; for running on PHP >= 5.5; for parsing PHP 5.2 to PHP 7.2). diff --git a/vendor/nikic/php-parser/composer.json b/vendor/nikic/php-parser/composer.json index 2fd064a2..ef416d94 100644 --- a/vendor/nikic/php-parser/composer.json +++ b/vendor/nikic/php-parser/composer.json @@ -13,18 +13,13 @@ } ], "require": { - "php": ">=7.0", + "php": ">=7.1", "ext-tokenizer": "*" }, "require-dev": { - "phpunit/phpunit": "^6.5 || ^7.0 || ^8.0 || ^9.0", + "phpunit/phpunit": "^7.0 || ^8.0 || ^9.0", "ircmaxell/php-yacc": "^0.0.7" }, - "extra": { - "branch-alias": { - "dev-master": "4.9-dev" - } - }, "autoload": { "psr-4": { "PhpParser\\": "lib/PhpParser" diff --git a/vendor/nikic/php-parser/grammar/README.md b/vendor/nikic/php-parser/grammar/README.md deleted file mode 100644 index 4bae11d8..00000000 --- a/vendor/nikic/php-parser/grammar/README.md +++ /dev/null @@ -1,30 +0,0 @@ -What do all those files mean? -============================= - - * `php5.y`: PHP 5 grammar written in a pseudo language - * `php7.y`: PHP 7 grammar written in a pseudo language - * `tokens.y`: Tokens definition shared between PHP 5 and PHP 7 grammars - * `parser.template`: A `kmyacc` parser prototype file for PHP - * `tokens.template`: A `kmyacc` prototype file for the `Tokens` class - * `rebuildParsers.php`: Preprocesses the grammar and builds the parser using `kmyacc` - -.phpy pseudo language -===================== - -The `.y` file is a normal grammar in `kmyacc` (`yacc`) style, with some transformations -applied to it: - - * Nodes are created using the syntax `Name[..., ...]`. This is transformed into - `new Name(..., ..., attributes())` - * Some function-like constructs are resolved (see `rebuildParsers.php` for a list) - -Building the parser -=================== - -Run `php grammar/rebuildParsers.php` to rebuild the parsers. Additional options: - - * The `KMYACC` environment variable can be used to specify an alternative `kmyacc` binary. - By default the `phpyacc` dev dependency will be used. To use the original `kmyacc`, you - need to compile [moriyoshi's fork](https://github.com/moriyoshi/kmyacc-forked). - * The `--debug` option enables emission of debug symbols and creates the `y.output` file. - * The `--keep-tmp-grammar` option preserves the preprocessed grammar file. diff --git a/vendor/nikic/php-parser/grammar/parser.template b/vendor/nikic/php-parser/grammar/parser.template deleted file mode 100644 index 6166607c..00000000 --- a/vendor/nikic/php-parser/grammar/parser.template +++ /dev/null @@ -1,106 +0,0 @@ -semValue -#semval($,%t) $this->semValue -#semval(%n) $stackPos-(%l-%n) -#semval(%n,%t) $stackPos-(%l-%n) - -namespace PhpParser\Parser; - -use PhpParser\Error; -use PhpParser\Node; -use PhpParser\Node\Expr; -use PhpParser\Node\Name; -use PhpParser\Node\Scalar; -use PhpParser\Node\Stmt; -#include; - -/* This is an automatically GENERATED file, which should not be manually edited. - * Instead edit one of the following: - * * the grammar files grammar/php5.y or grammar/php7.y - * * the skeleton file grammar/parser.template - * * the preprocessing script grammar/rebuildParsers.php - */ -class #(-p) extends \PhpParser\ParserAbstract -{ - protected $tokenToSymbolMapSize = #(YYMAXLEX); - protected $actionTableSize = #(YYLAST); - protected $gotoTableSize = #(YYGLAST); - - protected $invalidSymbol = #(YYBADCH); - protected $errorSymbol = #(YYINTERRTOK); - protected $defaultAction = #(YYDEFAULT); - protected $unexpectedTokenRule = #(YYUNEXPECTED); - - protected $YY2TBLSTATE = #(YY2TBLSTATE); - protected $numNonLeafStates = #(YYNLSTATES); - - protected $symbolToName = array( - #listvar terminals - ); - - protected $tokenToSymbol = array( - #listvar yytranslate - ); - - protected $action = array( - #listvar yyaction - ); - - protected $actionCheck = array( - #listvar yycheck - ); - - protected $actionBase = array( - #listvar yybase - ); - - protected $actionDefault = array( - #listvar yydefault - ); - - protected $goto = array( - #listvar yygoto - ); - - protected $gotoCheck = array( - #listvar yygcheck - ); - - protected $gotoBase = array( - #listvar yygbase - ); - - protected $gotoDefault = array( - #listvar yygdefault - ); - - protected $ruleToNonTerminal = array( - #listvar yylhs - ); - - protected $ruleToLength = array( - #listvar yylen - ); -#if -t - - protected $productions = array( - #production-strings; - ); -#endif - - protected function initReduceCallbacks() { - $this->reduceCallbacks = [ -#reduce - %n => function ($stackPos) { - %b - }, -#noact - %n => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos]; - }, -#endreduce - ]; - } -} -#tailcode; diff --git a/vendor/nikic/php-parser/grammar/php5.y b/vendor/nikic/php-parser/grammar/php5.y deleted file mode 100644 index 2920dead..00000000 --- a/vendor/nikic/php-parser/grammar/php5.y +++ /dev/null @@ -1,1046 +0,0 @@ -%pure_parser -%expect 6 - -%tokens - -%% - -start: - top_statement_list { $$ = $this->handleNamespaces($1); } -; - -top_statement_list_ex: - top_statement_list_ex top_statement { pushNormalizing($1, $2); } - | /* empty */ { init(); } -; - -top_statement_list: - top_statement_list_ex - { makeZeroLengthNop($nop, $this->lookaheadStartAttributes); - if ($nop !== null) { $1[] = $nop; } $$ = $1; } -; - -ampersand: - T_AMPERSAND_FOLLOWED_BY_VAR_OR_VARARG - | T_AMPERSAND_NOT_FOLLOWED_BY_VAR_OR_VARARG -; - -reserved_non_modifiers: - T_INCLUDE | T_INCLUDE_ONCE | T_EVAL | T_REQUIRE | T_REQUIRE_ONCE | T_LOGICAL_OR | T_LOGICAL_XOR | T_LOGICAL_AND - | T_INSTANCEOF | T_NEW | T_CLONE | T_EXIT | T_IF | T_ELSEIF | T_ELSE | T_ENDIF | T_ECHO | T_DO | T_WHILE - | T_ENDWHILE | T_FOR | T_ENDFOR | T_FOREACH | T_ENDFOREACH | T_DECLARE | T_ENDDECLARE | T_AS | T_TRY | T_CATCH - | T_FINALLY | T_THROW | T_USE | T_INSTEADOF | T_GLOBAL | T_VAR | T_UNSET | T_ISSET | T_EMPTY | T_CONTINUE | T_GOTO - | T_FUNCTION | T_CONST | T_RETURN | T_PRINT | T_YIELD | T_LIST | T_SWITCH | T_ENDSWITCH | T_CASE | T_DEFAULT - | T_BREAK | T_ARRAY | T_CALLABLE | T_EXTENDS | T_IMPLEMENTS | T_NAMESPACE | T_TRAIT | T_INTERFACE | T_CLASS - | T_CLASS_C | T_TRAIT_C | T_FUNC_C | T_METHOD_C | T_LINE | T_FILE | T_DIR | T_NS_C | T_HALT_COMPILER | T_FN - | T_MATCH -; - -semi_reserved: - reserved_non_modifiers - | T_STATIC | T_ABSTRACT | T_FINAL | T_PRIVATE | T_PROTECTED | T_PUBLIC -; - -identifier_ex: - T_STRING { $$ = Node\Identifier[$1]; } - | semi_reserved { $$ = Node\Identifier[$1]; } -; - -identifier: - T_STRING { $$ = Node\Identifier[$1]; } -; - -reserved_non_modifiers_identifier: - reserved_non_modifiers { $$ = Node\Identifier[$1]; } -; - -namespace_name: - T_STRING { $$ = Name[$1]; } - | T_NAME_QUALIFIED { $$ = Name[$1]; } -; - -legacy_namespace_name: - namespace_name { $$ = $1; } - | T_NAME_FULLY_QUALIFIED { $$ = Name[substr($1, 1)]; } -; - -plain_variable: - T_VARIABLE { $$ = Expr\Variable[parseVar($1)]; } -; - -top_statement: - statement { $$ = $1; } - | function_declaration_statement { $$ = $1; } - | class_declaration_statement { $$ = $1; } - | T_HALT_COMPILER - { $$ = Stmt\HaltCompiler[$this->lexer->handleHaltCompiler()]; } - | T_NAMESPACE namespace_name ';' - { $$ = Stmt\Namespace_[$2, null]; - $$->setAttribute('kind', Stmt\Namespace_::KIND_SEMICOLON); - $this->checkNamespace($$); } - | T_NAMESPACE namespace_name '{' top_statement_list '}' - { $$ = Stmt\Namespace_[$2, $4]; - $$->setAttribute('kind', Stmt\Namespace_::KIND_BRACED); - $this->checkNamespace($$); } - | T_NAMESPACE '{' top_statement_list '}' - { $$ = Stmt\Namespace_[null, $3]; - $$->setAttribute('kind', Stmt\Namespace_::KIND_BRACED); - $this->checkNamespace($$); } - | T_USE use_declarations ';' { $$ = Stmt\Use_[$2, Stmt\Use_::TYPE_NORMAL]; } - | T_USE use_type use_declarations ';' { $$ = Stmt\Use_[$3, $2]; } - | group_use_declaration ';' { $$ = $1; } - | T_CONST constant_declaration_list ';' { $$ = Stmt\Const_[$2]; } -; - -use_type: - T_FUNCTION { $$ = Stmt\Use_::TYPE_FUNCTION; } - | T_CONST { $$ = Stmt\Use_::TYPE_CONSTANT; } -; - -group_use_declaration: - T_USE use_type legacy_namespace_name T_NS_SEPARATOR '{' unprefixed_use_declarations '}' - { $$ = Stmt\GroupUse[$3, $6, $2]; } - | T_USE legacy_namespace_name T_NS_SEPARATOR '{' inline_use_declarations '}' - { $$ = Stmt\GroupUse[$2, $5, Stmt\Use_::TYPE_UNKNOWN]; } -; - -unprefixed_use_declarations: - unprefixed_use_declarations ',' unprefixed_use_declaration - { push($1, $3); } - | unprefixed_use_declaration { init($1); } -; - -use_declarations: - use_declarations ',' use_declaration { push($1, $3); } - | use_declaration { init($1); } -; - -inline_use_declarations: - inline_use_declarations ',' inline_use_declaration { push($1, $3); } - | inline_use_declaration { init($1); } -; - -unprefixed_use_declaration: - namespace_name - { $$ = Stmt\UseUse[$1, null, Stmt\Use_::TYPE_UNKNOWN]; $this->checkUseUse($$, #1); } - | namespace_name T_AS identifier - { $$ = Stmt\UseUse[$1, $3, Stmt\Use_::TYPE_UNKNOWN]; $this->checkUseUse($$, #3); } -; - -use_declaration: - legacy_namespace_name - { $$ = Stmt\UseUse[$1, null, Stmt\Use_::TYPE_UNKNOWN]; $this->checkUseUse($$, #1); } - | legacy_namespace_name T_AS identifier - { $$ = Stmt\UseUse[$1, $3, Stmt\Use_::TYPE_UNKNOWN]; $this->checkUseUse($$, #3); } -; - -inline_use_declaration: - unprefixed_use_declaration { $$ = $1; $$->type = Stmt\Use_::TYPE_NORMAL; } - | use_type unprefixed_use_declaration { $$ = $2; $$->type = $1; } -; - -constant_declaration_list: - constant_declaration_list ',' constant_declaration { push($1, $3); } - | constant_declaration { init($1); } -; - -constant_declaration: - identifier '=' static_scalar { $$ = Node\Const_[$1, $3]; } -; - -class_const_list: - class_const_list ',' class_const { push($1, $3); } - | class_const { init($1); } -; - -class_const: - identifier_ex '=' static_scalar { $$ = Node\Const_[$1, $3]; } -; - -inner_statement_list_ex: - inner_statement_list_ex inner_statement { pushNormalizing($1, $2); } - | /* empty */ { init(); } -; - -inner_statement_list: - inner_statement_list_ex - { makeZeroLengthNop($nop, $this->lookaheadStartAttributes); - if ($nop !== null) { $1[] = $nop; } $$ = $1; } -; - -inner_statement: - statement { $$ = $1; } - | function_declaration_statement { $$ = $1; } - | class_declaration_statement { $$ = $1; } - | T_HALT_COMPILER - { throw new Error('__HALT_COMPILER() can only be used from the outermost scope', attributes()); } -; - -non_empty_statement: - '{' inner_statement_list '}' - { - if ($2) { - $$ = $2; prependLeadingComments($$); - } else { - makeNop($$, $this->startAttributeStack[#1], $this->endAttributes); - if (null === $$) { $$ = array(); } - } - } - | T_IF parentheses_expr statement elseif_list else_single - { $$ = Stmt\If_[$2, ['stmts' => toArray($3), 'elseifs' => $4, 'else' => $5]]; } - | T_IF parentheses_expr ':' inner_statement_list new_elseif_list new_else_single T_ENDIF ';' - { $$ = Stmt\If_[$2, ['stmts' => $4, 'elseifs' => $5, 'else' => $6]]; } - | T_WHILE parentheses_expr while_statement { $$ = Stmt\While_[$2, $3]; } - | T_DO statement T_WHILE parentheses_expr ';' { $$ = Stmt\Do_ [$4, toArray($2)]; } - | T_FOR '(' for_expr ';' for_expr ';' for_expr ')' for_statement - { $$ = Stmt\For_[['init' => $3, 'cond' => $5, 'loop' => $7, 'stmts' => $9]]; } - | T_SWITCH parentheses_expr switch_case_list { $$ = Stmt\Switch_[$2, $3]; } - | T_BREAK ';' { $$ = Stmt\Break_[null]; } - | T_BREAK expr ';' { $$ = Stmt\Break_[$2]; } - | T_CONTINUE ';' { $$ = Stmt\Continue_[null]; } - | T_CONTINUE expr ';' { $$ = Stmt\Continue_[$2]; } - | T_RETURN ';' { $$ = Stmt\Return_[null]; } - | T_RETURN expr ';' { $$ = Stmt\Return_[$2]; } - | T_GLOBAL global_var_list ';' { $$ = Stmt\Global_[$2]; } - | T_STATIC static_var_list ';' { $$ = Stmt\Static_[$2]; } - | T_ECHO expr_list ';' { $$ = Stmt\Echo_[$2]; } - | T_INLINE_HTML { $$ = Stmt\InlineHTML[$1]; } - | yield_expr ';' { $$ = Stmt\Expression[$1]; } - | expr ';' { $$ = Stmt\Expression[$1]; } - | T_UNSET '(' variables_list ')' ';' { $$ = Stmt\Unset_[$3]; } - | T_FOREACH '(' expr T_AS foreach_variable ')' foreach_statement - { $$ = Stmt\Foreach_[$3, $5[0], ['keyVar' => null, 'byRef' => $5[1], 'stmts' => $7]]; } - | T_FOREACH '(' expr T_AS variable T_DOUBLE_ARROW foreach_variable ')' foreach_statement - { $$ = Stmt\Foreach_[$3, $7[0], ['keyVar' => $5, 'byRef' => $7[1], 'stmts' => $9]]; } - | T_DECLARE '(' declare_list ')' declare_statement { $$ = Stmt\Declare_[$3, $5]; } - | T_TRY '{' inner_statement_list '}' catches optional_finally - { $$ = Stmt\TryCatch[$3, $5, $6]; $this->checkTryCatch($$); } - | T_THROW expr ';' { $$ = Stmt\Throw_[$2]; } - | T_GOTO identifier ';' { $$ = Stmt\Goto_[$2]; } - | identifier ':' { $$ = Stmt\Label[$1]; } - | expr error { $$ = Stmt\Expression[$1]; } - | error { $$ = array(); /* means: no statement */ } -; - -statement: - non_empty_statement { $$ = $1; } - | ';' - { makeNop($$, $this->startAttributeStack[#1], $this->endAttributes); - if ($$ === null) $$ = array(); /* means: no statement */ } -; - -catches: - /* empty */ { init(); } - | catches catch { push($1, $2); } -; - -catch: - T_CATCH '(' name plain_variable ')' '{' inner_statement_list '}' - { $$ = Stmt\Catch_[array($3), $4, $7]; } -; - -optional_finally: - /* empty */ { $$ = null; } - | T_FINALLY '{' inner_statement_list '}' { $$ = Stmt\Finally_[$3]; } -; - -variables_list: - variable { init($1); } - | variables_list ',' variable { push($1, $3); } -; - -optional_ref: - /* empty */ { $$ = false; } - | ampersand { $$ = true; } -; - -optional_arg_ref: - /* empty */ { $$ = false; } - | T_AMPERSAND_FOLLOWED_BY_VAR_OR_VARARG { $$ = true; } -; - -optional_ellipsis: - /* empty */ { $$ = false; } - | T_ELLIPSIS { $$ = true; } -; - -identifier_maybe_readonly: - identifier { $$ = $1; } - | T_READONLY { $$ = Node\Identifier[$1]; } -; - -function_declaration_statement: - T_FUNCTION optional_ref identifier_maybe_readonly '(' parameter_list ')' optional_return_type '{' inner_statement_list '}' - { $$ = Stmt\Function_[$3, ['byRef' => $2, 'params' => $5, 'returnType' => $7, 'stmts' => $9]]; } -; - -class_declaration_statement: - class_entry_type identifier extends_from implements_list '{' class_statement_list '}' - { $$ = Stmt\Class_[$2, ['type' => $1, 'extends' => $3, 'implements' => $4, 'stmts' => $6]]; - $this->checkClass($$, #2); } - | T_INTERFACE identifier interface_extends_list '{' class_statement_list '}' - { $$ = Stmt\Interface_[$2, ['extends' => $3, 'stmts' => $5]]; - $this->checkInterface($$, #2); } - | T_TRAIT identifier '{' class_statement_list '}' - { $$ = Stmt\Trait_[$2, ['stmts' => $4]]; } -; - -class_entry_type: - T_CLASS { $$ = 0; } - | T_ABSTRACT T_CLASS { $$ = Stmt\Class_::MODIFIER_ABSTRACT; } - | T_FINAL T_CLASS { $$ = Stmt\Class_::MODIFIER_FINAL; } -; - -extends_from: - /* empty */ { $$ = null; } - | T_EXTENDS class_name { $$ = $2; } -; - -interface_extends_list: - /* empty */ { $$ = array(); } - | T_EXTENDS class_name_list { $$ = $2; } -; - -implements_list: - /* empty */ { $$ = array(); } - | T_IMPLEMENTS class_name_list { $$ = $2; } -; - -class_name_list: - class_name { init($1); } - | class_name_list ',' class_name { push($1, $3); } -; - -for_statement: - statement { $$ = toArray($1); } - | ':' inner_statement_list T_ENDFOR ';' { $$ = $2; } -; - -foreach_statement: - statement { $$ = toArray($1); } - | ':' inner_statement_list T_ENDFOREACH ';' { $$ = $2; } -; - -declare_statement: - non_empty_statement { $$ = toArray($1); } - | ';' { $$ = null; } - | ':' inner_statement_list T_ENDDECLARE ';' { $$ = $2; } -; - -declare_list: - declare_list_element { init($1); } - | declare_list ',' declare_list_element { push($1, $3); } -; - -declare_list_element: - identifier '=' static_scalar { $$ = Stmt\DeclareDeclare[$1, $3]; } -; - -switch_case_list: - '{' case_list '}' { $$ = $2; } - | '{' ';' case_list '}' { $$ = $3; } - | ':' case_list T_ENDSWITCH ';' { $$ = $2; } - | ':' ';' case_list T_ENDSWITCH ';' { $$ = $3; } -; - -case_list: - /* empty */ { init(); } - | case_list case { push($1, $2); } -; - -case: - T_CASE expr case_separator inner_statement_list_ex { $$ = Stmt\Case_[$2, $4]; } - | T_DEFAULT case_separator inner_statement_list_ex { $$ = Stmt\Case_[null, $3]; } -; - -case_separator: - ':' - | ';' -; - -while_statement: - statement { $$ = toArray($1); } - | ':' inner_statement_list T_ENDWHILE ';' { $$ = $2; } -; - -elseif_list: - /* empty */ { init(); } - | elseif_list elseif { push($1, $2); } -; - -elseif: - T_ELSEIF parentheses_expr statement { $$ = Stmt\ElseIf_[$2, toArray($3)]; } -; - -new_elseif_list: - /* empty */ { init(); } - | new_elseif_list new_elseif { push($1, $2); } -; - -new_elseif: - T_ELSEIF parentheses_expr ':' inner_statement_list { $$ = Stmt\ElseIf_[$2, $4]; } -; - -else_single: - /* empty */ { $$ = null; } - | T_ELSE statement { $$ = Stmt\Else_[toArray($2)]; } -; - -new_else_single: - /* empty */ { $$ = null; } - | T_ELSE ':' inner_statement_list { $$ = Stmt\Else_[$3]; } -; - -foreach_variable: - variable { $$ = array($1, false); } - | ampersand variable { $$ = array($2, true); } - | list_expr { $$ = array($1, false); } -; - -parameter_list: - non_empty_parameter_list { $$ = $1; } - | /* empty */ { $$ = array(); } -; - -non_empty_parameter_list: - parameter { init($1); } - | non_empty_parameter_list ',' parameter { push($1, $3); } -; - -parameter: - optional_param_type optional_arg_ref optional_ellipsis plain_variable - { $$ = Node\Param[$4, null, $1, $2, $3]; $this->checkParam($$); } - | optional_param_type optional_arg_ref optional_ellipsis plain_variable '=' static_scalar - { $$ = Node\Param[$4, $6, $1, $2, $3]; $this->checkParam($$); } -; - -type: - name { $$ = $1; } - | T_ARRAY { $$ = Node\Identifier['array']; } - | T_CALLABLE { $$ = Node\Identifier['callable']; } -; - -optional_param_type: - /* empty */ { $$ = null; } - | type { $$ = $1; } -; - -optional_return_type: - /* empty */ { $$ = null; } - | ':' type { $$ = $2; } -; - -argument_list: - '(' ')' { $$ = array(); } - | '(' non_empty_argument_list ')' { $$ = $2; } - | '(' yield_expr ')' { $$ = array(Node\Arg[$2, false, false]); } -; - -non_empty_argument_list: - argument { init($1); } - | non_empty_argument_list ',' argument { push($1, $3); } -; - -argument: - expr { $$ = Node\Arg[$1, false, false]; } - | ampersand variable { $$ = Node\Arg[$2, true, false]; } - | T_ELLIPSIS expr { $$ = Node\Arg[$2, false, true]; } -; - -global_var_list: - global_var_list ',' global_var { push($1, $3); } - | global_var { init($1); } -; - -global_var: - plain_variable { $$ = $1; } - | '$' variable { $$ = Expr\Variable[$2]; } - | '$' '{' expr '}' { $$ = Expr\Variable[$3]; } -; - -static_var_list: - static_var_list ',' static_var { push($1, $3); } - | static_var { init($1); } -; - -static_var: - plain_variable { $$ = Stmt\StaticVar[$1, null]; } - | plain_variable '=' static_scalar { $$ = Stmt\StaticVar[$1, $3]; } -; - -class_statement_list_ex: - class_statement_list_ex class_statement { if ($2 !== null) { push($1, $2); } } - | /* empty */ { init(); } -; - -class_statement_list: - class_statement_list_ex - { makeZeroLengthNop($nop, $this->lookaheadStartAttributes); - if ($nop !== null) { $1[] = $nop; } $$ = $1; } -; - -class_statement: - variable_modifiers property_declaration_list ';' - { $$ = Stmt\Property[$1, $2]; $this->checkProperty($$, #1); } - | T_CONST class_const_list ';' { $$ = Stmt\ClassConst[$2, 0]; } - | method_modifiers T_FUNCTION optional_ref identifier_ex '(' parameter_list ')' optional_return_type method_body - { $$ = Stmt\ClassMethod[$4, ['type' => $1, 'byRef' => $3, 'params' => $6, 'returnType' => $8, 'stmts' => $9]]; - $this->checkClassMethod($$, #1); } - | T_USE class_name_list trait_adaptations { $$ = Stmt\TraitUse[$2, $3]; } -; - -trait_adaptations: - ';' { $$ = array(); } - | '{' trait_adaptation_list '}' { $$ = $2; } -; - -trait_adaptation_list: - /* empty */ { init(); } - | trait_adaptation_list trait_adaptation { push($1, $2); } -; - -trait_adaptation: - trait_method_reference_fully_qualified T_INSTEADOF class_name_list ';' - { $$ = Stmt\TraitUseAdaptation\Precedence[$1[0], $1[1], $3]; } - | trait_method_reference T_AS member_modifier identifier_ex ';' - { $$ = Stmt\TraitUseAdaptation\Alias[$1[0], $1[1], $3, $4]; } - | trait_method_reference T_AS member_modifier ';' - { $$ = Stmt\TraitUseAdaptation\Alias[$1[0], $1[1], $3, null]; } - | trait_method_reference T_AS identifier ';' - { $$ = Stmt\TraitUseAdaptation\Alias[$1[0], $1[1], null, $3]; } - | trait_method_reference T_AS reserved_non_modifiers_identifier ';' - { $$ = Stmt\TraitUseAdaptation\Alias[$1[0], $1[1], null, $3]; } -; - -trait_method_reference_fully_qualified: - name T_PAAMAYIM_NEKUDOTAYIM identifier_ex { $$ = array($1, $3); } -; -trait_method_reference: - trait_method_reference_fully_qualified { $$ = $1; } - | identifier_ex { $$ = array(null, $1); } -; - -method_body: - ';' /* abstract method */ { $$ = null; } - | '{' inner_statement_list '}' { $$ = $2; } -; - -variable_modifiers: - non_empty_member_modifiers { $$ = $1; } - | T_VAR { $$ = 0; } -; - -method_modifiers: - /* empty */ { $$ = 0; } - | non_empty_member_modifiers { $$ = $1; } -; - -non_empty_member_modifiers: - member_modifier { $$ = $1; } - | non_empty_member_modifiers member_modifier { $this->checkModifier($1, $2, #2); $$ = $1 | $2; } -; - -member_modifier: - T_PUBLIC { $$ = Stmt\Class_::MODIFIER_PUBLIC; } - | T_PROTECTED { $$ = Stmt\Class_::MODIFIER_PROTECTED; } - | T_PRIVATE { $$ = Stmt\Class_::MODIFIER_PRIVATE; } - | T_STATIC { $$ = Stmt\Class_::MODIFIER_STATIC; } - | T_ABSTRACT { $$ = Stmt\Class_::MODIFIER_ABSTRACT; } - | T_FINAL { $$ = Stmt\Class_::MODIFIER_FINAL; } -; - -property_declaration_list: - property_declaration { init($1); } - | property_declaration_list ',' property_declaration { push($1, $3); } -; - -property_decl_name: - T_VARIABLE { $$ = Node\VarLikeIdentifier[parseVar($1)]; } -; - -property_declaration: - property_decl_name { $$ = Stmt\PropertyProperty[$1, null]; } - | property_decl_name '=' static_scalar { $$ = Stmt\PropertyProperty[$1, $3]; } -; - -expr_list: - expr_list ',' expr { push($1, $3); } - | expr { init($1); } -; - -for_expr: - /* empty */ { $$ = array(); } - | expr_list { $$ = $1; } -; - -expr: - variable { $$ = $1; } - | list_expr '=' expr { $$ = Expr\Assign[$1, $3]; } - | variable '=' expr { $$ = Expr\Assign[$1, $3]; } - | variable '=' ampersand variable { $$ = Expr\AssignRef[$1, $4]; } - | variable '=' ampersand new_expr { $$ = Expr\AssignRef[$1, $4]; } - | new_expr { $$ = $1; } - | T_CLONE expr { $$ = Expr\Clone_[$2]; } - | variable T_PLUS_EQUAL expr { $$ = Expr\AssignOp\Plus [$1, $3]; } - | variable T_MINUS_EQUAL expr { $$ = Expr\AssignOp\Minus [$1, $3]; } - | variable T_MUL_EQUAL expr { $$ = Expr\AssignOp\Mul [$1, $3]; } - | variable T_DIV_EQUAL expr { $$ = Expr\AssignOp\Div [$1, $3]; } - | variable T_CONCAT_EQUAL expr { $$ = Expr\AssignOp\Concat [$1, $3]; } - | variable T_MOD_EQUAL expr { $$ = Expr\AssignOp\Mod [$1, $3]; } - | variable T_AND_EQUAL expr { $$ = Expr\AssignOp\BitwiseAnd[$1, $3]; } - | variable T_OR_EQUAL expr { $$ = Expr\AssignOp\BitwiseOr [$1, $3]; } - | variable T_XOR_EQUAL expr { $$ = Expr\AssignOp\BitwiseXor[$1, $3]; } - | variable T_SL_EQUAL expr { $$ = Expr\AssignOp\ShiftLeft [$1, $3]; } - | variable T_SR_EQUAL expr { $$ = Expr\AssignOp\ShiftRight[$1, $3]; } - | variable T_POW_EQUAL expr { $$ = Expr\AssignOp\Pow [$1, $3]; } - | variable T_COALESCE_EQUAL expr { $$ = Expr\AssignOp\Coalesce [$1, $3]; } - | variable T_INC { $$ = Expr\PostInc[$1]; } - | T_INC variable { $$ = Expr\PreInc [$2]; } - | variable T_DEC { $$ = Expr\PostDec[$1]; } - | T_DEC variable { $$ = Expr\PreDec [$2]; } - | expr T_BOOLEAN_OR expr { $$ = Expr\BinaryOp\BooleanOr [$1, $3]; } - | expr T_BOOLEAN_AND expr { $$ = Expr\BinaryOp\BooleanAnd[$1, $3]; } - | expr T_LOGICAL_OR expr { $$ = Expr\BinaryOp\LogicalOr [$1, $3]; } - | expr T_LOGICAL_AND expr { $$ = Expr\BinaryOp\LogicalAnd[$1, $3]; } - | expr T_LOGICAL_XOR expr { $$ = Expr\BinaryOp\LogicalXor[$1, $3]; } - | expr '|' expr { $$ = Expr\BinaryOp\BitwiseOr [$1, $3]; } - | expr T_AMPERSAND_NOT_FOLLOWED_BY_VAR_OR_VARARG expr { $$ = Expr\BinaryOp\BitwiseAnd[$1, $3]; } - | expr T_AMPERSAND_FOLLOWED_BY_VAR_OR_VARARG expr { $$ = Expr\BinaryOp\BitwiseAnd[$1, $3]; } - | expr '^' expr { $$ = Expr\BinaryOp\BitwiseXor[$1, $3]; } - | expr '.' expr { $$ = Expr\BinaryOp\Concat [$1, $3]; } - | expr '+' expr { $$ = Expr\BinaryOp\Plus [$1, $3]; } - | expr '-' expr { $$ = Expr\BinaryOp\Minus [$1, $3]; } - | expr '*' expr { $$ = Expr\BinaryOp\Mul [$1, $3]; } - | expr '/' expr { $$ = Expr\BinaryOp\Div [$1, $3]; } - | expr '%' expr { $$ = Expr\BinaryOp\Mod [$1, $3]; } - | expr T_SL expr { $$ = Expr\BinaryOp\ShiftLeft [$1, $3]; } - | expr T_SR expr { $$ = Expr\BinaryOp\ShiftRight[$1, $3]; } - | expr T_POW expr { $$ = Expr\BinaryOp\Pow [$1, $3]; } - | '+' expr %prec T_INC { $$ = Expr\UnaryPlus [$2]; } - | '-' expr %prec T_INC { $$ = Expr\UnaryMinus[$2]; } - | '!' expr { $$ = Expr\BooleanNot[$2]; } - | '~' expr { $$ = Expr\BitwiseNot[$2]; } - | expr T_IS_IDENTICAL expr { $$ = Expr\BinaryOp\Identical [$1, $3]; } - | expr T_IS_NOT_IDENTICAL expr { $$ = Expr\BinaryOp\NotIdentical [$1, $3]; } - | expr T_IS_EQUAL expr { $$ = Expr\BinaryOp\Equal [$1, $3]; } - | expr T_IS_NOT_EQUAL expr { $$ = Expr\BinaryOp\NotEqual [$1, $3]; } - | expr T_SPACESHIP expr { $$ = Expr\BinaryOp\Spaceship [$1, $3]; } - | expr '<' expr { $$ = Expr\BinaryOp\Smaller [$1, $3]; } - | expr T_IS_SMALLER_OR_EQUAL expr { $$ = Expr\BinaryOp\SmallerOrEqual[$1, $3]; } - | expr '>' expr { $$ = Expr\BinaryOp\Greater [$1, $3]; } - | expr T_IS_GREATER_OR_EQUAL expr { $$ = Expr\BinaryOp\GreaterOrEqual[$1, $3]; } - | expr T_INSTANCEOF class_name_reference { $$ = Expr\Instanceof_[$1, $3]; } - | parentheses_expr { $$ = $1; } - /* we need a separate '(' new_expr ')' rule to avoid problems caused by a s/r conflict */ - | '(' new_expr ')' { $$ = $2; } - | expr '?' expr ':' expr { $$ = Expr\Ternary[$1, $3, $5]; } - | expr '?' ':' expr { $$ = Expr\Ternary[$1, null, $4]; } - | expr T_COALESCE expr { $$ = Expr\BinaryOp\Coalesce[$1, $3]; } - | T_ISSET '(' variables_list ')' { $$ = Expr\Isset_[$3]; } - | T_EMPTY '(' expr ')' { $$ = Expr\Empty_[$3]; } - | T_INCLUDE expr { $$ = Expr\Include_[$2, Expr\Include_::TYPE_INCLUDE]; } - | T_INCLUDE_ONCE expr { $$ = Expr\Include_[$2, Expr\Include_::TYPE_INCLUDE_ONCE]; } - | T_EVAL parentheses_expr { $$ = Expr\Eval_[$2]; } - | T_REQUIRE expr { $$ = Expr\Include_[$2, Expr\Include_::TYPE_REQUIRE]; } - | T_REQUIRE_ONCE expr { $$ = Expr\Include_[$2, Expr\Include_::TYPE_REQUIRE_ONCE]; } - | T_INT_CAST expr { $$ = Expr\Cast\Int_ [$2]; } - | T_DOUBLE_CAST expr - { $attrs = attributes(); - $attrs['kind'] = $this->getFloatCastKind($1); - $$ = new Expr\Cast\Double($2, $attrs); } - | T_STRING_CAST expr { $$ = Expr\Cast\String_ [$2]; } - | T_ARRAY_CAST expr { $$ = Expr\Cast\Array_ [$2]; } - | T_OBJECT_CAST expr { $$ = Expr\Cast\Object_ [$2]; } - | T_BOOL_CAST expr { $$ = Expr\Cast\Bool_ [$2]; } - | T_UNSET_CAST expr { $$ = Expr\Cast\Unset_ [$2]; } - | T_EXIT exit_expr - { $attrs = attributes(); - $attrs['kind'] = strtolower($1) === 'exit' ? Expr\Exit_::KIND_EXIT : Expr\Exit_::KIND_DIE; - $$ = new Expr\Exit_($2, $attrs); } - | '@' expr { $$ = Expr\ErrorSuppress[$2]; } - | scalar { $$ = $1; } - | array_expr { $$ = $1; } - | scalar_dereference { $$ = $1; } - | '`' backticks_expr '`' { $$ = Expr\ShellExec[$2]; } - | T_PRINT expr { $$ = Expr\Print_[$2]; } - | T_YIELD { $$ = Expr\Yield_[null, null]; } - | T_YIELD_FROM expr { $$ = Expr\YieldFrom[$2]; } - | T_FUNCTION optional_ref '(' parameter_list ')' lexical_vars optional_return_type - '{' inner_statement_list '}' - { $$ = Expr\Closure[['static' => false, 'byRef' => $2, 'params' => $4, 'uses' => $6, 'returnType' => $7, 'stmts' => $9]]; } - | T_STATIC T_FUNCTION optional_ref '(' parameter_list ')' lexical_vars optional_return_type - '{' inner_statement_list '}' - { $$ = Expr\Closure[['static' => true, 'byRef' => $3, 'params' => $5, 'uses' => $7, 'returnType' => $8, 'stmts' => $10]]; } -; - -parentheses_expr: - '(' expr ')' { $$ = $2; } - | '(' yield_expr ')' { $$ = $2; } -; - -yield_expr: - T_YIELD expr { $$ = Expr\Yield_[$2, null]; } - | T_YIELD expr T_DOUBLE_ARROW expr { $$ = Expr\Yield_[$4, $2]; } -; - -array_expr: - T_ARRAY '(' array_pair_list ')' - { $attrs = attributes(); $attrs['kind'] = Expr\Array_::KIND_LONG; - $$ = new Expr\Array_($3, $attrs); } - | '[' array_pair_list ']' - { $attrs = attributes(); $attrs['kind'] = Expr\Array_::KIND_SHORT; - $$ = new Expr\Array_($2, $attrs); } -; - -scalar_dereference: - array_expr '[' dim_offset ']' { $$ = Expr\ArrayDimFetch[$1, $3]; } - | T_CONSTANT_ENCAPSED_STRING '[' dim_offset ']' { $$ = Expr\ArrayDimFetch[Scalar\String_::fromString($1, attributes()), $3]; } - | constant '[' dim_offset ']' { $$ = Expr\ArrayDimFetch[$1, $3]; } - | scalar_dereference '[' dim_offset ']' { $$ = Expr\ArrayDimFetch[$1, $3]; } - /* alternative array syntax missing intentionally */ -; - -anonymous_class: - T_CLASS ctor_arguments extends_from implements_list '{' class_statement_list '}' - { $$ = array(Stmt\Class_[null, ['type' => 0, 'extends' => $3, 'implements' => $4, 'stmts' => $6]], $2); - $this->checkClass($$[0], -1); } -; - -new_expr: - T_NEW class_name_reference ctor_arguments { $$ = Expr\New_[$2, $3]; } - | T_NEW anonymous_class - { list($class, $ctorArgs) = $2; $$ = Expr\New_[$class, $ctorArgs]; } -; - -lexical_vars: - /* empty */ { $$ = array(); } - | T_USE '(' lexical_var_list ')' { $$ = $3; } -; - -lexical_var_list: - lexical_var { init($1); } - | lexical_var_list ',' lexical_var { push($1, $3); } -; - -lexical_var: - optional_ref plain_variable { $$ = Expr\ClosureUse[$2, $1]; } -; - -name_readonly: - T_READONLY { $$ = Name[$1]; } -; - -function_call: - name argument_list { $$ = Expr\FuncCall[$1, $2]; } - | name_readonly argument_list { $$ = Expr\FuncCall[$1, $2]; } - | class_name_or_var T_PAAMAYIM_NEKUDOTAYIM identifier_ex argument_list - { $$ = Expr\StaticCall[$1, $3, $4]; } - | class_name_or_var T_PAAMAYIM_NEKUDOTAYIM '{' expr '}' argument_list - { $$ = Expr\StaticCall[$1, $4, $6]; } - | static_property argument_list - { $$ = $this->fixupPhp5StaticPropCall($1, $2, attributes()); } - | variable_without_objects argument_list - { $$ = Expr\FuncCall[$1, $2]; } - | function_call '[' dim_offset ']' { $$ = Expr\ArrayDimFetch[$1, $3]; } - /* alternative array syntax missing intentionally */ -; - -class_name: - T_STATIC { $$ = Name[$1]; } - | name { $$ = $1; } -; - -name: - T_STRING { $$ = Name[$1]; } - | T_NAME_QUALIFIED { $$ = Name[$1]; } - | T_NAME_FULLY_QUALIFIED { $$ = Name\FullyQualified[substr($1, 1)]; } - | T_NAME_RELATIVE { $$ = Name\Relative[substr($1, 10)]; } -; - -class_name_reference: - class_name { $$ = $1; } - | dynamic_class_name_reference { $$ = $1; } -; - -dynamic_class_name_reference: - object_access_for_dcnr { $$ = $1; } - | base_variable { $$ = $1; } -; - -class_name_or_var: - class_name { $$ = $1; } - | reference_variable { $$ = $1; } -; - -object_access_for_dcnr: - base_variable T_OBJECT_OPERATOR object_property - { $$ = Expr\PropertyFetch[$1, $3]; } - | object_access_for_dcnr T_OBJECT_OPERATOR object_property - { $$ = Expr\PropertyFetch[$1, $3]; } - | object_access_for_dcnr '[' dim_offset ']' { $$ = Expr\ArrayDimFetch[$1, $3]; } - | object_access_for_dcnr '{' expr '}' { $$ = Expr\ArrayDimFetch[$1, $3]; } -; - -exit_expr: - /* empty */ { $$ = null; } - | '(' ')' { $$ = null; } - | parentheses_expr { $$ = $1; } -; - -backticks_expr: - /* empty */ { $$ = array(); } - | T_ENCAPSED_AND_WHITESPACE - { $$ = array(Scalar\EncapsedStringPart[Scalar\String_::parseEscapeSequences($1, '`', false)]); } - | encaps_list { parseEncapsed($1, '`', false); $$ = $1; } -; - -ctor_arguments: - /* empty */ { $$ = array(); } - | argument_list { $$ = $1; } -; - -common_scalar: - T_LNUMBER { $$ = $this->parseLNumber($1, attributes(), true); } - | T_DNUMBER { $$ = Scalar\DNumber::fromString($1, attributes()); } - | T_CONSTANT_ENCAPSED_STRING { $$ = Scalar\String_::fromString($1, attributes(), false); } - | T_LINE { $$ = Scalar\MagicConst\Line[]; } - | T_FILE { $$ = Scalar\MagicConst\File[]; } - | T_DIR { $$ = Scalar\MagicConst\Dir[]; } - | T_CLASS_C { $$ = Scalar\MagicConst\Class_[]; } - | T_TRAIT_C { $$ = Scalar\MagicConst\Trait_[]; } - | T_METHOD_C { $$ = Scalar\MagicConst\Method[]; } - | T_FUNC_C { $$ = Scalar\MagicConst\Function_[]; } - | T_NS_C { $$ = Scalar\MagicConst\Namespace_[]; } - | T_START_HEREDOC T_ENCAPSED_AND_WHITESPACE T_END_HEREDOC - { $$ = $this->parseDocString($1, $2, $3, attributes(), stackAttributes(#3), false); } - | T_START_HEREDOC T_END_HEREDOC - { $$ = $this->parseDocString($1, '', $2, attributes(), stackAttributes(#2), false); } -; - -static_scalar: - common_scalar { $$ = $1; } - | class_name T_PAAMAYIM_NEKUDOTAYIM identifier_ex { $$ = Expr\ClassConstFetch[$1, $3]; } - | name { $$ = Expr\ConstFetch[$1]; } - | T_ARRAY '(' static_array_pair_list ')' { $$ = Expr\Array_[$3]; } - | '[' static_array_pair_list ']' { $$ = Expr\Array_[$2]; } - | static_operation { $$ = $1; } -; - -static_operation: - static_scalar T_BOOLEAN_OR static_scalar { $$ = Expr\BinaryOp\BooleanOr [$1, $3]; } - | static_scalar T_BOOLEAN_AND static_scalar { $$ = Expr\BinaryOp\BooleanAnd[$1, $3]; } - | static_scalar T_LOGICAL_OR static_scalar { $$ = Expr\BinaryOp\LogicalOr [$1, $3]; } - | static_scalar T_LOGICAL_AND static_scalar { $$ = Expr\BinaryOp\LogicalAnd[$1, $3]; } - | static_scalar T_LOGICAL_XOR static_scalar { $$ = Expr\BinaryOp\LogicalXor[$1, $3]; } - | static_scalar '|' static_scalar { $$ = Expr\BinaryOp\BitwiseOr [$1, $3]; } - | static_scalar T_AMPERSAND_NOT_FOLLOWED_BY_VAR_OR_VARARG static_scalar - { $$ = Expr\BinaryOp\BitwiseAnd[$1, $3]; } - | static_scalar T_AMPERSAND_FOLLOWED_BY_VAR_OR_VARARG static_scalar - { $$ = Expr\BinaryOp\BitwiseAnd[$1, $3]; } - | static_scalar '^' static_scalar { $$ = Expr\BinaryOp\BitwiseXor[$1, $3]; } - | static_scalar '.' static_scalar { $$ = Expr\BinaryOp\Concat [$1, $3]; } - | static_scalar '+' static_scalar { $$ = Expr\BinaryOp\Plus [$1, $3]; } - | static_scalar '-' static_scalar { $$ = Expr\BinaryOp\Minus [$1, $3]; } - | static_scalar '*' static_scalar { $$ = Expr\BinaryOp\Mul [$1, $3]; } - | static_scalar '/' static_scalar { $$ = Expr\BinaryOp\Div [$1, $3]; } - | static_scalar '%' static_scalar { $$ = Expr\BinaryOp\Mod [$1, $3]; } - | static_scalar T_SL static_scalar { $$ = Expr\BinaryOp\ShiftLeft [$1, $3]; } - | static_scalar T_SR static_scalar { $$ = Expr\BinaryOp\ShiftRight[$1, $3]; } - | static_scalar T_POW static_scalar { $$ = Expr\BinaryOp\Pow [$1, $3]; } - | '+' static_scalar %prec T_INC { $$ = Expr\UnaryPlus [$2]; } - | '-' static_scalar %prec T_INC { $$ = Expr\UnaryMinus[$2]; } - | '!' static_scalar { $$ = Expr\BooleanNot[$2]; } - | '~' static_scalar { $$ = Expr\BitwiseNot[$2]; } - | static_scalar T_IS_IDENTICAL static_scalar { $$ = Expr\BinaryOp\Identical [$1, $3]; } - | static_scalar T_IS_NOT_IDENTICAL static_scalar { $$ = Expr\BinaryOp\NotIdentical [$1, $3]; } - | static_scalar T_IS_EQUAL static_scalar { $$ = Expr\BinaryOp\Equal [$1, $3]; } - | static_scalar T_IS_NOT_EQUAL static_scalar { $$ = Expr\BinaryOp\NotEqual [$1, $3]; } - | static_scalar '<' static_scalar { $$ = Expr\BinaryOp\Smaller [$1, $3]; } - | static_scalar T_IS_SMALLER_OR_EQUAL static_scalar { $$ = Expr\BinaryOp\SmallerOrEqual[$1, $3]; } - | static_scalar '>' static_scalar { $$ = Expr\BinaryOp\Greater [$1, $3]; } - | static_scalar T_IS_GREATER_OR_EQUAL static_scalar { $$ = Expr\BinaryOp\GreaterOrEqual[$1, $3]; } - | static_scalar '?' static_scalar ':' static_scalar { $$ = Expr\Ternary[$1, $3, $5]; } - | static_scalar '?' ':' static_scalar { $$ = Expr\Ternary[$1, null, $4]; } - | static_scalar '[' static_scalar ']' { $$ = Expr\ArrayDimFetch[$1, $3]; } - | '(' static_scalar ')' { $$ = $2; } -; - -constant: - name { $$ = Expr\ConstFetch[$1]; } - | class_name_or_var T_PAAMAYIM_NEKUDOTAYIM identifier_ex - { $$ = Expr\ClassConstFetch[$1, $3]; } -; - -scalar: - common_scalar { $$ = $1; } - | constant { $$ = $1; } - | '"' encaps_list '"' - { $attrs = attributes(); $attrs['kind'] = Scalar\String_::KIND_DOUBLE_QUOTED; - parseEncapsed($2, '"', true); $$ = new Scalar\Encapsed($2, $attrs); } - | T_START_HEREDOC encaps_list T_END_HEREDOC - { $$ = $this->parseDocString($1, $2, $3, attributes(), stackAttributes(#3), true); } -; - -static_array_pair_list: - /* empty */ { $$ = array(); } - | non_empty_static_array_pair_list optional_comma { $$ = $1; } -; - -optional_comma: - /* empty */ - | ',' -; - -non_empty_static_array_pair_list: - non_empty_static_array_pair_list ',' static_array_pair { push($1, $3); } - | static_array_pair { init($1); } -; - -static_array_pair: - static_scalar T_DOUBLE_ARROW static_scalar { $$ = Expr\ArrayItem[$3, $1, false]; } - | static_scalar { $$ = Expr\ArrayItem[$1, null, false]; } -; - -variable: - object_access { $$ = $1; } - | base_variable { $$ = $1; } - | function_call { $$ = $1; } - | new_expr_array_deref { $$ = $1; } -; - -new_expr_array_deref: - '(' new_expr ')' '[' dim_offset ']' { $$ = Expr\ArrayDimFetch[$2, $5]; } - | new_expr_array_deref '[' dim_offset ']' { $$ = Expr\ArrayDimFetch[$1, $3]; } - /* alternative array syntax missing intentionally */ -; - -object_access: - variable_or_new_expr T_OBJECT_OPERATOR object_property - { $$ = Expr\PropertyFetch[$1, $3]; } - | variable_or_new_expr T_OBJECT_OPERATOR object_property argument_list - { $$ = Expr\MethodCall[$1, $3, $4]; } - | object_access argument_list { $$ = Expr\FuncCall[$1, $2]; } - | object_access '[' dim_offset ']' { $$ = Expr\ArrayDimFetch[$1, $3]; } - | object_access '{' expr '}' { $$ = Expr\ArrayDimFetch[$1, $3]; } -; - -variable_or_new_expr: - variable { $$ = $1; } - | '(' new_expr ')' { $$ = $2; } -; - -variable_without_objects: - reference_variable { $$ = $1; } - | '$' variable_without_objects { $$ = Expr\Variable[$2]; } -; - -base_variable: - variable_without_objects { $$ = $1; } - | static_property { $$ = $1; } -; - -static_property: - class_name_or_var T_PAAMAYIM_NEKUDOTAYIM '$' reference_variable - { $$ = Expr\StaticPropertyFetch[$1, $4]; } - | static_property_with_arrays { $$ = $1; } -; - -static_property_simple_name: - T_VARIABLE - { $var = parseVar($1); $$ = \is_string($var) ? Node\VarLikeIdentifier[$var] : $var; } -; - -static_property_with_arrays: - class_name_or_var T_PAAMAYIM_NEKUDOTAYIM static_property_simple_name - { $$ = Expr\StaticPropertyFetch[$1, $3]; } - | class_name_or_var T_PAAMAYIM_NEKUDOTAYIM '$' '{' expr '}' - { $$ = Expr\StaticPropertyFetch[$1, $5]; } - | static_property_with_arrays '[' dim_offset ']' { $$ = Expr\ArrayDimFetch[$1, $3]; } - | static_property_with_arrays '{' expr '}' { $$ = Expr\ArrayDimFetch[$1, $3]; } -; - -reference_variable: - reference_variable '[' dim_offset ']' { $$ = Expr\ArrayDimFetch[$1, $3]; } - | reference_variable '{' expr '}' { $$ = Expr\ArrayDimFetch[$1, $3]; } - | plain_variable { $$ = $1; } - | '$' '{' expr '}' { $$ = Expr\Variable[$3]; } -; - -dim_offset: - /* empty */ { $$ = null; } - | expr { $$ = $1; } -; - -object_property: - identifier { $$ = $1; } - | '{' expr '}' { $$ = $2; } - | variable_without_objects { $$ = $1; } - | error { $$ = Expr\Error[]; $this->errorState = 2; } -; - -list_expr: - T_LIST '(' list_expr_elements ')' { $$ = Expr\List_[$3]; } -; - -list_expr_elements: - list_expr_elements ',' list_expr_element { push($1, $3); } - | list_expr_element { init($1); } -; - -list_expr_element: - variable { $$ = Expr\ArrayItem[$1, null, false]; } - | list_expr { $$ = Expr\ArrayItem[$1, null, false]; } - | /* empty */ { $$ = null; } -; - -array_pair_list: - /* empty */ { $$ = array(); } - | non_empty_array_pair_list optional_comma { $$ = $1; } -; - -non_empty_array_pair_list: - non_empty_array_pair_list ',' array_pair { push($1, $3); } - | array_pair { init($1); } -; - -array_pair: - expr T_DOUBLE_ARROW expr { $$ = Expr\ArrayItem[$3, $1, false]; } - | expr { $$ = Expr\ArrayItem[$1, null, false]; } - | expr T_DOUBLE_ARROW ampersand variable { $$ = Expr\ArrayItem[$4, $1, true]; } - | ampersand variable { $$ = Expr\ArrayItem[$2, null, true]; } - | T_ELLIPSIS expr { $$ = Expr\ArrayItem[$2, null, false, attributes(), true]; } -; - -encaps_list: - encaps_list encaps_var { push($1, $2); } - | encaps_list encaps_string_part { push($1, $2); } - | encaps_var { init($1); } - | encaps_string_part encaps_var { init($1, $2); } -; - -encaps_string_part: - T_ENCAPSED_AND_WHITESPACE { $$ = Scalar\EncapsedStringPart[$1]; } -; - -encaps_str_varname: - T_STRING_VARNAME { $$ = Expr\Variable[$1]; } -; - -encaps_var: - plain_variable { $$ = $1; } - | plain_variable '[' encaps_var_offset ']' { $$ = Expr\ArrayDimFetch[$1, $3]; } - | plain_variable T_OBJECT_OPERATOR identifier { $$ = Expr\PropertyFetch[$1, $3]; } - | T_DOLLAR_OPEN_CURLY_BRACES expr '}' { $$ = Expr\Variable[$2]; } - | T_DOLLAR_OPEN_CURLY_BRACES T_STRING_VARNAME '}' { $$ = Expr\Variable[$2]; } - | T_DOLLAR_OPEN_CURLY_BRACES encaps_str_varname '[' expr ']' '}' - { $$ = Expr\ArrayDimFetch[$2, $4]; } - | T_CURLY_OPEN variable '}' { $$ = $2; } -; - -encaps_var_offset: - T_STRING { $$ = Scalar\String_[$1]; } - | T_NUM_STRING { $$ = $this->parseNumString($1, attributes()); } - | plain_variable { $$ = $1; } -; - -%% diff --git a/vendor/nikic/php-parser/grammar/php7.y b/vendor/nikic/php-parser/grammar/php7.y deleted file mode 100644 index fc7862c3..00000000 --- a/vendor/nikic/php-parser/grammar/php7.y +++ /dev/null @@ -1,1237 +0,0 @@ -%pure_parser -%expect 2 - -%tokens - -%% - -start: - top_statement_list { $$ = $this->handleNamespaces($1); } -; - -top_statement_list_ex: - top_statement_list_ex top_statement { pushNormalizing($1, $2); } - | /* empty */ { init(); } -; - -top_statement_list: - top_statement_list_ex - { makeZeroLengthNop($nop, $this->lookaheadStartAttributes); - if ($nop !== null) { $1[] = $nop; } $$ = $1; } -; - -ampersand: - T_AMPERSAND_FOLLOWED_BY_VAR_OR_VARARG - | T_AMPERSAND_NOT_FOLLOWED_BY_VAR_OR_VARARG -; - -reserved_non_modifiers: - T_INCLUDE | T_INCLUDE_ONCE | T_EVAL | T_REQUIRE | T_REQUIRE_ONCE | T_LOGICAL_OR | T_LOGICAL_XOR | T_LOGICAL_AND - | T_INSTANCEOF | T_NEW | T_CLONE | T_EXIT | T_IF | T_ELSEIF | T_ELSE | T_ENDIF | T_ECHO | T_DO | T_WHILE - | T_ENDWHILE | T_FOR | T_ENDFOR | T_FOREACH | T_ENDFOREACH | T_DECLARE | T_ENDDECLARE | T_AS | T_TRY | T_CATCH - | T_FINALLY | T_THROW | T_USE | T_INSTEADOF | T_GLOBAL | T_VAR | T_UNSET | T_ISSET | T_EMPTY | T_CONTINUE | T_GOTO - | T_FUNCTION | T_CONST | T_RETURN | T_PRINT | T_YIELD | T_LIST | T_SWITCH | T_ENDSWITCH | T_CASE | T_DEFAULT - | T_BREAK | T_ARRAY | T_CALLABLE | T_EXTENDS | T_IMPLEMENTS | T_NAMESPACE | T_TRAIT | T_INTERFACE | T_CLASS - | T_CLASS_C | T_TRAIT_C | T_FUNC_C | T_METHOD_C | T_LINE | T_FILE | T_DIR | T_NS_C | T_HALT_COMPILER | T_FN - | T_MATCH | T_ENUM -; - -semi_reserved: - reserved_non_modifiers - | T_STATIC | T_ABSTRACT | T_FINAL | T_PRIVATE | T_PROTECTED | T_PUBLIC | T_READONLY -; - -identifier_maybe_reserved: - T_STRING { $$ = Node\Identifier[$1]; } - | semi_reserved { $$ = Node\Identifier[$1]; } -; - -identifier_not_reserved: - T_STRING { $$ = Node\Identifier[$1]; } -; - -reserved_non_modifiers_identifier: - reserved_non_modifiers { $$ = Node\Identifier[$1]; } -; - -namespace_declaration_name: - T_STRING { $$ = Name[$1]; } - | semi_reserved { $$ = Name[$1]; } - | T_NAME_QUALIFIED { $$ = Name[$1]; } -; - -namespace_name: - T_STRING { $$ = Name[$1]; } - | T_NAME_QUALIFIED { $$ = Name[$1]; } -; - -legacy_namespace_name: - namespace_name { $$ = $1; } - | T_NAME_FULLY_QUALIFIED { $$ = Name[substr($1, 1)]; } -; - -plain_variable: - T_VARIABLE { $$ = Expr\Variable[parseVar($1)]; } -; - -semi: - ';' { /* nothing */ } - | error { /* nothing */ } -; - -no_comma: - /* empty */ { /* nothing */ } - | ',' { $this->emitError(new Error('A trailing comma is not allowed here', attributes())); } -; - -optional_comma: - /* empty */ - | ',' -; - -attribute_decl: - class_name { $$ = Node\Attribute[$1, []]; } - | class_name argument_list { $$ = Node\Attribute[$1, $2]; } -; - -attribute_group: - attribute_decl { init($1); } - | attribute_group ',' attribute_decl { push($1, $3); } -; - -attribute: - T_ATTRIBUTE attribute_group optional_comma ']' { $$ = Node\AttributeGroup[$2]; } -; - -attributes: - attribute { init($1); } - | attributes attribute { push($1, $2); } -; - -optional_attributes: - /* empty */ { $$ = []; } - | attributes { $$ = $1; } -; - -top_statement: - statement { $$ = $1; } - | function_declaration_statement { $$ = $1; } - | class_declaration_statement { $$ = $1; } - | T_HALT_COMPILER - { $$ = Stmt\HaltCompiler[$this->lexer->handleHaltCompiler()]; } - | T_NAMESPACE namespace_declaration_name semi - { $$ = Stmt\Namespace_[$2, null]; - $$->setAttribute('kind', Stmt\Namespace_::KIND_SEMICOLON); - $this->checkNamespace($$); } - | T_NAMESPACE namespace_declaration_name '{' top_statement_list '}' - { $$ = Stmt\Namespace_[$2, $4]; - $$->setAttribute('kind', Stmt\Namespace_::KIND_BRACED); - $this->checkNamespace($$); } - | T_NAMESPACE '{' top_statement_list '}' - { $$ = Stmt\Namespace_[null, $3]; - $$->setAttribute('kind', Stmt\Namespace_::KIND_BRACED); - $this->checkNamespace($$); } - | T_USE use_declarations semi { $$ = Stmt\Use_[$2, Stmt\Use_::TYPE_NORMAL]; } - | T_USE use_type use_declarations semi { $$ = Stmt\Use_[$3, $2]; } - | group_use_declaration semi { $$ = $1; } - | T_CONST constant_declaration_list semi { $$ = Stmt\Const_[$2]; } -; - -use_type: - T_FUNCTION { $$ = Stmt\Use_::TYPE_FUNCTION; } - | T_CONST { $$ = Stmt\Use_::TYPE_CONSTANT; } -; - -group_use_declaration: - T_USE use_type legacy_namespace_name T_NS_SEPARATOR '{' unprefixed_use_declarations '}' - { $$ = Stmt\GroupUse[$3, $6, $2]; } - | T_USE legacy_namespace_name T_NS_SEPARATOR '{' inline_use_declarations '}' - { $$ = Stmt\GroupUse[$2, $5, Stmt\Use_::TYPE_UNKNOWN]; } -; - -unprefixed_use_declarations: - non_empty_unprefixed_use_declarations optional_comma { $$ = $1; } -; - -non_empty_unprefixed_use_declarations: - non_empty_unprefixed_use_declarations ',' unprefixed_use_declaration - { push($1, $3); } - | unprefixed_use_declaration { init($1); } -; - -use_declarations: - non_empty_use_declarations no_comma { $$ = $1; } -; - -non_empty_use_declarations: - non_empty_use_declarations ',' use_declaration { push($1, $3); } - | use_declaration { init($1); } -; - -inline_use_declarations: - non_empty_inline_use_declarations optional_comma { $$ = $1; } -; - -non_empty_inline_use_declarations: - non_empty_inline_use_declarations ',' inline_use_declaration - { push($1, $3); } - | inline_use_declaration { init($1); } -; - -unprefixed_use_declaration: - namespace_name - { $$ = Stmt\UseUse[$1, null, Stmt\Use_::TYPE_UNKNOWN]; $this->checkUseUse($$, #1); } - | namespace_name T_AS identifier_not_reserved - { $$ = Stmt\UseUse[$1, $3, Stmt\Use_::TYPE_UNKNOWN]; $this->checkUseUse($$, #3); } -; - -use_declaration: - legacy_namespace_name - { $$ = Stmt\UseUse[$1, null, Stmt\Use_::TYPE_UNKNOWN]; $this->checkUseUse($$, #1); } - | legacy_namespace_name T_AS identifier_not_reserved - { $$ = Stmt\UseUse[$1, $3, Stmt\Use_::TYPE_UNKNOWN]; $this->checkUseUse($$, #3); } -; - -inline_use_declaration: - unprefixed_use_declaration { $$ = $1; $$->type = Stmt\Use_::TYPE_NORMAL; } - | use_type unprefixed_use_declaration { $$ = $2; $$->type = $1; } -; - -constant_declaration_list: - non_empty_constant_declaration_list no_comma { $$ = $1; } -; - -non_empty_constant_declaration_list: - non_empty_constant_declaration_list ',' constant_declaration - { push($1, $3); } - | constant_declaration { init($1); } -; - -constant_declaration: - identifier_not_reserved '=' expr { $$ = Node\Const_[$1, $3]; } -; - -class_const_list: - non_empty_class_const_list no_comma { $$ = $1; } -; - -non_empty_class_const_list: - non_empty_class_const_list ',' class_const { push($1, $3); } - | class_const { init($1); } -; - -class_const: - identifier_maybe_reserved '=' expr { $$ = Node\Const_[$1, $3]; } -; - -inner_statement_list_ex: - inner_statement_list_ex inner_statement { pushNormalizing($1, $2); } - | /* empty */ { init(); } -; - -inner_statement_list: - inner_statement_list_ex - { makeZeroLengthNop($nop, $this->lookaheadStartAttributes); - if ($nop !== null) { $1[] = $nop; } $$ = $1; } -; - -inner_statement: - statement { $$ = $1; } - | function_declaration_statement { $$ = $1; } - | class_declaration_statement { $$ = $1; } - | T_HALT_COMPILER - { throw new Error('__HALT_COMPILER() can only be used from the outermost scope', attributes()); } -; - -non_empty_statement: - '{' inner_statement_list '}' - { - if ($2) { - $$ = $2; prependLeadingComments($$); - } else { - makeNop($$, $this->startAttributeStack[#1], $this->endAttributes); - if (null === $$) { $$ = array(); } - } - } - | T_IF '(' expr ')' statement elseif_list else_single - { $$ = Stmt\If_[$3, ['stmts' => toArray($5), 'elseifs' => $6, 'else' => $7]]; } - | T_IF '(' expr ')' ':' inner_statement_list new_elseif_list new_else_single T_ENDIF ';' - { $$ = Stmt\If_[$3, ['stmts' => $6, 'elseifs' => $7, 'else' => $8]]; } - | T_WHILE '(' expr ')' while_statement { $$ = Stmt\While_[$3, $5]; } - | T_DO statement T_WHILE '(' expr ')' ';' { $$ = Stmt\Do_ [$5, toArray($2)]; } - | T_FOR '(' for_expr ';' for_expr ';' for_expr ')' for_statement - { $$ = Stmt\For_[['init' => $3, 'cond' => $5, 'loop' => $7, 'stmts' => $9]]; } - | T_SWITCH '(' expr ')' switch_case_list { $$ = Stmt\Switch_[$3, $5]; } - | T_BREAK optional_expr semi { $$ = Stmt\Break_[$2]; } - | T_CONTINUE optional_expr semi { $$ = Stmt\Continue_[$2]; } - | T_RETURN optional_expr semi { $$ = Stmt\Return_[$2]; } - | T_GLOBAL global_var_list semi { $$ = Stmt\Global_[$2]; } - | T_STATIC static_var_list semi { $$ = Stmt\Static_[$2]; } - | T_ECHO expr_list_forbid_comma semi { $$ = Stmt\Echo_[$2]; } - | T_INLINE_HTML { $$ = Stmt\InlineHTML[$1]; } - | expr semi { - $e = $1; - if ($e instanceof Expr\Throw_) { - // For backwards-compatibility reasons, convert throw in statement position into - // Stmt\Throw_ rather than Stmt\Expression(Expr\Throw_). - $$ = Stmt\Throw_[$e->expr]; - } else { - $$ = Stmt\Expression[$e]; - } - } - | T_UNSET '(' variables_list ')' semi { $$ = Stmt\Unset_[$3]; } - | T_FOREACH '(' expr T_AS foreach_variable ')' foreach_statement - { $$ = Stmt\Foreach_[$3, $5[0], ['keyVar' => null, 'byRef' => $5[1], 'stmts' => $7]]; } - | T_FOREACH '(' expr T_AS variable T_DOUBLE_ARROW foreach_variable ')' foreach_statement - { $$ = Stmt\Foreach_[$3, $7[0], ['keyVar' => $5, 'byRef' => $7[1], 'stmts' => $9]]; } - | T_FOREACH '(' expr error ')' foreach_statement - { $$ = Stmt\Foreach_[$3, new Expr\Error(stackAttributes(#4)), ['stmts' => $6]]; } - | T_DECLARE '(' declare_list ')' declare_statement { $$ = Stmt\Declare_[$3, $5]; } - | T_TRY '{' inner_statement_list '}' catches optional_finally - { $$ = Stmt\TryCatch[$3, $5, $6]; $this->checkTryCatch($$); } - | T_GOTO identifier_not_reserved semi { $$ = Stmt\Goto_[$2]; } - | identifier_not_reserved ':' { $$ = Stmt\Label[$1]; } - | error { $$ = array(); /* means: no statement */ } -; - -statement: - non_empty_statement { $$ = $1; } - | ';' - { makeNop($$, $this->startAttributeStack[#1], $this->endAttributes); - if ($$ === null) $$ = array(); /* means: no statement */ } -; - -catches: - /* empty */ { init(); } - | catches catch { push($1, $2); } -; - -name_union: - name { init($1); } - | name_union '|' name { push($1, $3); } -; - -catch: - T_CATCH '(' name_union optional_plain_variable ')' '{' inner_statement_list '}' - { $$ = Stmt\Catch_[$3, $4, $7]; } -; - -optional_finally: - /* empty */ { $$ = null; } - | T_FINALLY '{' inner_statement_list '}' { $$ = Stmt\Finally_[$3]; } -; - -variables_list: - non_empty_variables_list optional_comma { $$ = $1; } -; - -non_empty_variables_list: - variable { init($1); } - | non_empty_variables_list ',' variable { push($1, $3); } -; - -optional_ref: - /* empty */ { $$ = false; } - | ampersand { $$ = true; } -; - -optional_arg_ref: - /* empty */ { $$ = false; } - | T_AMPERSAND_FOLLOWED_BY_VAR_OR_VARARG { $$ = true; } -; - -optional_ellipsis: - /* empty */ { $$ = false; } - | T_ELLIPSIS { $$ = true; } -; - -block_or_error: - '{' inner_statement_list '}' { $$ = $2; } - | error { $$ = []; } -; - -identifier_maybe_readonly: - identifier_not_reserved { $$ = $1; } - | T_READONLY { $$ = Node\Identifier[$1]; } -; - -function_declaration_statement: - T_FUNCTION optional_ref identifier_maybe_readonly '(' parameter_list ')' optional_return_type block_or_error - { $$ = Stmt\Function_[$3, ['byRef' => $2, 'params' => $5, 'returnType' => $7, 'stmts' => $8, 'attrGroups' => []]]; } - | attributes T_FUNCTION optional_ref identifier_maybe_readonly '(' parameter_list ')' optional_return_type block_or_error - { $$ = Stmt\Function_[$4, ['byRef' => $3, 'params' => $6, 'returnType' => $8, 'stmts' => $9, 'attrGroups' => $1]]; } -; - -class_declaration_statement: - class_entry_type identifier_not_reserved extends_from implements_list '{' class_statement_list '}' - { $$ = Stmt\Class_[$2, ['type' => $1, 'extends' => $3, 'implements' => $4, 'stmts' => $6, 'attrGroups' => []]]; - $this->checkClass($$, #2); } - | attributes class_entry_type identifier_not_reserved extends_from implements_list '{' class_statement_list '}' - { $$ = Stmt\Class_[$3, ['type' => $2, 'extends' => $4, 'implements' => $5, 'stmts' => $7, 'attrGroups' => $1]]; - $this->checkClass($$, #3); } - | optional_attributes T_INTERFACE identifier_not_reserved interface_extends_list '{' class_statement_list '}' - { $$ = Stmt\Interface_[$3, ['extends' => $4, 'stmts' => $6, 'attrGroups' => $1]]; - $this->checkInterface($$, #3); } - | optional_attributes T_TRAIT identifier_not_reserved '{' class_statement_list '}' - { $$ = Stmt\Trait_[$3, ['stmts' => $5, 'attrGroups' => $1]]; } - | optional_attributes T_ENUM identifier_not_reserved enum_scalar_type implements_list '{' class_statement_list '}' - { $$ = Stmt\Enum_[$3, ['scalarType' => $4, 'implements' => $5, 'stmts' => $7, 'attrGroups' => $1]]; - $this->checkEnum($$, #3); } -; - -enum_scalar_type: - /* empty */ { $$ = null; } - | ':' type { $$ = $2; } - -enum_case_expr: - /* empty */ { $$ = null; } - | '=' expr { $$ = $2; } -; - -class_entry_type: - T_CLASS { $$ = 0; } - | class_modifiers T_CLASS { $$ = $1; } -; - -class_modifiers: - class_modifier { $$ = $1; } - | class_modifiers class_modifier { $this->checkClassModifier($1, $2, #2); $$ = $1 | $2; } -; - -class_modifier: - T_ABSTRACT { $$ = Stmt\Class_::MODIFIER_ABSTRACT; } - | T_FINAL { $$ = Stmt\Class_::MODIFIER_FINAL; } - | T_READONLY { $$ = Stmt\Class_::MODIFIER_READONLY; } -; - -extends_from: - /* empty */ { $$ = null; } - | T_EXTENDS class_name { $$ = $2; } -; - -interface_extends_list: - /* empty */ { $$ = array(); } - | T_EXTENDS class_name_list { $$ = $2; } -; - -implements_list: - /* empty */ { $$ = array(); } - | T_IMPLEMENTS class_name_list { $$ = $2; } -; - -class_name_list: - non_empty_class_name_list no_comma { $$ = $1; } -; - -non_empty_class_name_list: - class_name { init($1); } - | non_empty_class_name_list ',' class_name { push($1, $3); } -; - -for_statement: - statement { $$ = toArray($1); } - | ':' inner_statement_list T_ENDFOR ';' { $$ = $2; } -; - -foreach_statement: - statement { $$ = toArray($1); } - | ':' inner_statement_list T_ENDFOREACH ';' { $$ = $2; } -; - -declare_statement: - non_empty_statement { $$ = toArray($1); } - | ';' { $$ = null; } - | ':' inner_statement_list T_ENDDECLARE ';' { $$ = $2; } -; - -declare_list: - non_empty_declare_list no_comma { $$ = $1; } -; - -non_empty_declare_list: - declare_list_element { init($1); } - | non_empty_declare_list ',' declare_list_element { push($1, $3); } -; - -declare_list_element: - identifier_not_reserved '=' expr { $$ = Stmt\DeclareDeclare[$1, $3]; } -; - -switch_case_list: - '{' case_list '}' { $$ = $2; } - | '{' ';' case_list '}' { $$ = $3; } - | ':' case_list T_ENDSWITCH ';' { $$ = $2; } - | ':' ';' case_list T_ENDSWITCH ';' { $$ = $3; } -; - -case_list: - /* empty */ { init(); } - | case_list case { push($1, $2); } -; - -case: - T_CASE expr case_separator inner_statement_list_ex { $$ = Stmt\Case_[$2, $4]; } - | T_DEFAULT case_separator inner_statement_list_ex { $$ = Stmt\Case_[null, $3]; } -; - -case_separator: - ':' - | ';' -; - -match: - T_MATCH '(' expr ')' '{' match_arm_list '}' { $$ = Expr\Match_[$3, $6]; } -; - -match_arm_list: - /* empty */ { $$ = []; } - | non_empty_match_arm_list optional_comma { $$ = $1; } -; - -non_empty_match_arm_list: - match_arm { init($1); } - | non_empty_match_arm_list ',' match_arm { push($1, $3); } -; - -match_arm: - expr_list_allow_comma T_DOUBLE_ARROW expr { $$ = Node\MatchArm[$1, $3]; } - | T_DEFAULT optional_comma T_DOUBLE_ARROW expr { $$ = Node\MatchArm[null, $4]; } -; - -while_statement: - statement { $$ = toArray($1); } - | ':' inner_statement_list T_ENDWHILE ';' { $$ = $2; } -; - -elseif_list: - /* empty */ { init(); } - | elseif_list elseif { push($1, $2); } -; - -elseif: - T_ELSEIF '(' expr ')' statement { $$ = Stmt\ElseIf_[$3, toArray($5)]; } -; - -new_elseif_list: - /* empty */ { init(); } - | new_elseif_list new_elseif { push($1, $2); } -; - -new_elseif: - T_ELSEIF '(' expr ')' ':' inner_statement_list - { $$ = Stmt\ElseIf_[$3, $6]; $this->fixupAlternativeElse($$); } -; - -else_single: - /* empty */ { $$ = null; } - | T_ELSE statement { $$ = Stmt\Else_[toArray($2)]; } -; - -new_else_single: - /* empty */ { $$ = null; } - | T_ELSE ':' inner_statement_list - { $$ = Stmt\Else_[$3]; $this->fixupAlternativeElse($$); } -; - -foreach_variable: - variable { $$ = array($1, false); } - | ampersand variable { $$ = array($2, true); } - | list_expr { $$ = array($1, false); } - | array_short_syntax { $$ = array($1, false); } -; - -parameter_list: - non_empty_parameter_list optional_comma { $$ = $1; } - | /* empty */ { $$ = array(); } -; - -non_empty_parameter_list: - parameter { init($1); } - | non_empty_parameter_list ',' parameter { push($1, $3); } -; - -optional_property_modifiers: - /* empty */ { $$ = 0; } - | optional_property_modifiers property_modifier - { $this->checkModifier($1, $2, #2); $$ = $1 | $2; } -; - -property_modifier: - T_PUBLIC { $$ = Stmt\Class_::MODIFIER_PUBLIC; } - | T_PROTECTED { $$ = Stmt\Class_::MODIFIER_PROTECTED; } - | T_PRIVATE { $$ = Stmt\Class_::MODIFIER_PRIVATE; } - | T_READONLY { $$ = Stmt\Class_::MODIFIER_READONLY; } -; - -parameter: - optional_attributes optional_property_modifiers optional_type_without_static - optional_arg_ref optional_ellipsis plain_variable - { $$ = new Node\Param($6, null, $3, $4, $5, attributes(), $2, $1); - $this->checkParam($$); } - | optional_attributes optional_property_modifiers optional_type_without_static - optional_arg_ref optional_ellipsis plain_variable '=' expr - { $$ = new Node\Param($6, $8, $3, $4, $5, attributes(), $2, $1); - $this->checkParam($$); } - | optional_attributes optional_property_modifiers optional_type_without_static - optional_arg_ref optional_ellipsis error - { $$ = new Node\Param(Expr\Error[], null, $3, $4, $5, attributes(), $2, $1); } -; - -type_expr: - type { $$ = $1; } - | '?' type { $$ = Node\NullableType[$2]; } - | union_type { $$ = Node\UnionType[$1]; } - | intersection_type { $$ = $1; } -; - -type: - type_without_static { $$ = $1; } - | T_STATIC { $$ = Node\Name['static']; } -; - -type_without_static: - name { $$ = $this->handleBuiltinTypes($1); } - | T_ARRAY { $$ = Node\Identifier['array']; } - | T_CALLABLE { $$ = Node\Identifier['callable']; } -; - -union_type_element: - type { $$ = $1; } - | '(' intersection_type ')' { $$ = $2; } -; - -union_type: - union_type_element '|' union_type_element { init($1, $3); } - | union_type '|' union_type_element { push($1, $3); } -; - -union_type_without_static_element: - type_without_static { $$ = $1; } - | '(' intersection_type_without_static ')' { $$ = $2; } -; - -union_type_without_static: - union_type_without_static_element '|' union_type_without_static_element { init($1, $3); } - | union_type_without_static '|' union_type_without_static_element { push($1, $3); } -; - -intersection_type_list: - type T_AMPERSAND_NOT_FOLLOWED_BY_VAR_OR_VARARG type { init($1, $3); } - | intersection_type_list T_AMPERSAND_NOT_FOLLOWED_BY_VAR_OR_VARARG type - { push($1, $3); } -; - -intersection_type: - intersection_type_list { $$ = Node\IntersectionType[$1]; } -; - -intersection_type_without_static_list: - type_without_static T_AMPERSAND_NOT_FOLLOWED_BY_VAR_OR_VARARG type_without_static - { init($1, $3); } - | intersection_type_without_static_list T_AMPERSAND_NOT_FOLLOWED_BY_VAR_OR_VARARG type_without_static - { push($1, $3); } -; - -intersection_type_without_static: - intersection_type_without_static_list { $$ = Node\IntersectionType[$1]; } -; - -type_expr_without_static: - type_without_static { $$ = $1; } - | '?' type_without_static { $$ = Node\NullableType[$2]; } - | union_type_without_static { $$ = Node\UnionType[$1]; } - | intersection_type_without_static { $$ = $1; } -; - -optional_type_without_static: - /* empty */ { $$ = null; } - | type_expr_without_static { $$ = $1; } -; - -optional_return_type: - /* empty */ { $$ = null; } - | ':' type_expr { $$ = $2; } - | ':' error { $$ = null; } -; - -argument_list: - '(' ')' { $$ = array(); } - | '(' non_empty_argument_list optional_comma ')' { $$ = $2; } - | '(' variadic_placeholder ')' { init($2); } -; - -variadic_placeholder: - T_ELLIPSIS { $$ = Node\VariadicPlaceholder[]; } -; - -non_empty_argument_list: - argument { init($1); } - | non_empty_argument_list ',' argument { push($1, $3); } -; - -argument: - expr { $$ = Node\Arg[$1, false, false]; } - | ampersand variable { $$ = Node\Arg[$2, true, false]; } - | T_ELLIPSIS expr { $$ = Node\Arg[$2, false, true]; } - | identifier_maybe_reserved ':' expr - { $$ = new Node\Arg($3, false, false, attributes(), $1); } -; - -global_var_list: - non_empty_global_var_list no_comma { $$ = $1; } -; - -non_empty_global_var_list: - non_empty_global_var_list ',' global_var { push($1, $3); } - | global_var { init($1); } -; - -global_var: - simple_variable { $$ = $1; } -; - -static_var_list: - non_empty_static_var_list no_comma { $$ = $1; } -; - -non_empty_static_var_list: - non_empty_static_var_list ',' static_var { push($1, $3); } - | static_var { init($1); } -; - -static_var: - plain_variable { $$ = Stmt\StaticVar[$1, null]; } - | plain_variable '=' expr { $$ = Stmt\StaticVar[$1, $3]; } -; - -class_statement_list_ex: - class_statement_list_ex class_statement { if ($2 !== null) { push($1, $2); } } - | /* empty */ { init(); } -; - -class_statement_list: - class_statement_list_ex - { makeZeroLengthNop($nop, $this->lookaheadStartAttributes); - if ($nop !== null) { $1[] = $nop; } $$ = $1; } -; - -class_statement: - optional_attributes variable_modifiers optional_type_without_static property_declaration_list semi - { $$ = new Stmt\Property($2, $4, attributes(), $3, $1); - $this->checkProperty($$, #2); } - | optional_attributes method_modifiers T_CONST class_const_list semi - { $$ = new Stmt\ClassConst($4, $2, attributes(), $1); - $this->checkClassConst($$, #2); } - | optional_attributes method_modifiers T_FUNCTION optional_ref identifier_maybe_reserved '(' parameter_list ')' - optional_return_type method_body - { $$ = Stmt\ClassMethod[$5, ['type' => $2, 'byRef' => $4, 'params' => $7, 'returnType' => $9, 'stmts' => $10, 'attrGroups' => $1]]; - $this->checkClassMethod($$, #2); } - | T_USE class_name_list trait_adaptations { $$ = Stmt\TraitUse[$2, $3]; } - | optional_attributes T_CASE identifier_maybe_reserved enum_case_expr semi - { $$ = Stmt\EnumCase[$3, $4, $1]; } - | error { $$ = null; /* will be skipped */ } -; - -trait_adaptations: - ';' { $$ = array(); } - | '{' trait_adaptation_list '}' { $$ = $2; } -; - -trait_adaptation_list: - /* empty */ { init(); } - | trait_adaptation_list trait_adaptation { push($1, $2); } -; - -trait_adaptation: - trait_method_reference_fully_qualified T_INSTEADOF class_name_list ';' - { $$ = Stmt\TraitUseAdaptation\Precedence[$1[0], $1[1], $3]; } - | trait_method_reference T_AS member_modifier identifier_maybe_reserved ';' - { $$ = Stmt\TraitUseAdaptation\Alias[$1[0], $1[1], $3, $4]; } - | trait_method_reference T_AS member_modifier ';' - { $$ = Stmt\TraitUseAdaptation\Alias[$1[0], $1[1], $3, null]; } - | trait_method_reference T_AS identifier_not_reserved ';' - { $$ = Stmt\TraitUseAdaptation\Alias[$1[0], $1[1], null, $3]; } - | trait_method_reference T_AS reserved_non_modifiers_identifier ';' - { $$ = Stmt\TraitUseAdaptation\Alias[$1[0], $1[1], null, $3]; } -; - -trait_method_reference_fully_qualified: - name T_PAAMAYIM_NEKUDOTAYIM identifier_maybe_reserved { $$ = array($1, $3); } -; -trait_method_reference: - trait_method_reference_fully_qualified { $$ = $1; } - | identifier_maybe_reserved { $$ = array(null, $1); } -; - -method_body: - ';' /* abstract method */ { $$ = null; } - | block_or_error { $$ = $1; } -; - -variable_modifiers: - non_empty_member_modifiers { $$ = $1; } - | T_VAR { $$ = 0; } -; - -method_modifiers: - /* empty */ { $$ = 0; } - | non_empty_member_modifiers { $$ = $1; } -; - -non_empty_member_modifiers: - member_modifier { $$ = $1; } - | non_empty_member_modifiers member_modifier { $this->checkModifier($1, $2, #2); $$ = $1 | $2; } -; - -member_modifier: - T_PUBLIC { $$ = Stmt\Class_::MODIFIER_PUBLIC; } - | T_PROTECTED { $$ = Stmt\Class_::MODIFIER_PROTECTED; } - | T_PRIVATE { $$ = Stmt\Class_::MODIFIER_PRIVATE; } - | T_STATIC { $$ = Stmt\Class_::MODIFIER_STATIC; } - | T_ABSTRACT { $$ = Stmt\Class_::MODIFIER_ABSTRACT; } - | T_FINAL { $$ = Stmt\Class_::MODIFIER_FINAL; } - | T_READONLY { $$ = Stmt\Class_::MODIFIER_READONLY; } -; - -property_declaration_list: - non_empty_property_declaration_list no_comma { $$ = $1; } -; - -non_empty_property_declaration_list: - property_declaration { init($1); } - | non_empty_property_declaration_list ',' property_declaration - { push($1, $3); } -; - -property_decl_name: - T_VARIABLE { $$ = Node\VarLikeIdentifier[parseVar($1)]; } -; - -property_declaration: - property_decl_name { $$ = Stmt\PropertyProperty[$1, null]; } - | property_decl_name '=' expr { $$ = Stmt\PropertyProperty[$1, $3]; } -; - -expr_list_forbid_comma: - non_empty_expr_list no_comma { $$ = $1; } -; - -expr_list_allow_comma: - non_empty_expr_list optional_comma { $$ = $1; } -; - -non_empty_expr_list: - non_empty_expr_list ',' expr { push($1, $3); } - | expr { init($1); } -; - -for_expr: - /* empty */ { $$ = array(); } - | expr_list_forbid_comma { $$ = $1; } -; - -expr: - variable { $$ = $1; } - | list_expr '=' expr { $$ = Expr\Assign[$1, $3]; } - | array_short_syntax '=' expr { $$ = Expr\Assign[$1, $3]; } - | variable '=' expr { $$ = Expr\Assign[$1, $3]; } - | variable '=' ampersand variable { $$ = Expr\AssignRef[$1, $4]; } - | new_expr { $$ = $1; } - | match { $$ = $1; } - | T_CLONE expr { $$ = Expr\Clone_[$2]; } - | variable T_PLUS_EQUAL expr { $$ = Expr\AssignOp\Plus [$1, $3]; } - | variable T_MINUS_EQUAL expr { $$ = Expr\AssignOp\Minus [$1, $3]; } - | variable T_MUL_EQUAL expr { $$ = Expr\AssignOp\Mul [$1, $3]; } - | variable T_DIV_EQUAL expr { $$ = Expr\AssignOp\Div [$1, $3]; } - | variable T_CONCAT_EQUAL expr { $$ = Expr\AssignOp\Concat [$1, $3]; } - | variable T_MOD_EQUAL expr { $$ = Expr\AssignOp\Mod [$1, $3]; } - | variable T_AND_EQUAL expr { $$ = Expr\AssignOp\BitwiseAnd[$1, $3]; } - | variable T_OR_EQUAL expr { $$ = Expr\AssignOp\BitwiseOr [$1, $3]; } - | variable T_XOR_EQUAL expr { $$ = Expr\AssignOp\BitwiseXor[$1, $3]; } - | variable T_SL_EQUAL expr { $$ = Expr\AssignOp\ShiftLeft [$1, $3]; } - | variable T_SR_EQUAL expr { $$ = Expr\AssignOp\ShiftRight[$1, $3]; } - | variable T_POW_EQUAL expr { $$ = Expr\AssignOp\Pow [$1, $3]; } - | variable T_COALESCE_EQUAL expr { $$ = Expr\AssignOp\Coalesce [$1, $3]; } - | variable T_INC { $$ = Expr\PostInc[$1]; } - | T_INC variable { $$ = Expr\PreInc [$2]; } - | variable T_DEC { $$ = Expr\PostDec[$1]; } - | T_DEC variable { $$ = Expr\PreDec [$2]; } - | expr T_BOOLEAN_OR expr { $$ = Expr\BinaryOp\BooleanOr [$1, $3]; } - | expr T_BOOLEAN_AND expr { $$ = Expr\BinaryOp\BooleanAnd[$1, $3]; } - | expr T_LOGICAL_OR expr { $$ = Expr\BinaryOp\LogicalOr [$1, $3]; } - | expr T_LOGICAL_AND expr { $$ = Expr\BinaryOp\LogicalAnd[$1, $3]; } - | expr T_LOGICAL_XOR expr { $$ = Expr\BinaryOp\LogicalXor[$1, $3]; } - | expr '|' expr { $$ = Expr\BinaryOp\BitwiseOr [$1, $3]; } - | expr T_AMPERSAND_NOT_FOLLOWED_BY_VAR_OR_VARARG expr { $$ = Expr\BinaryOp\BitwiseAnd[$1, $3]; } - | expr T_AMPERSAND_FOLLOWED_BY_VAR_OR_VARARG expr { $$ = Expr\BinaryOp\BitwiseAnd[$1, $3]; } - | expr '^' expr { $$ = Expr\BinaryOp\BitwiseXor[$1, $3]; } - | expr '.' expr { $$ = Expr\BinaryOp\Concat [$1, $3]; } - | expr '+' expr { $$ = Expr\BinaryOp\Plus [$1, $3]; } - | expr '-' expr { $$ = Expr\BinaryOp\Minus [$1, $3]; } - | expr '*' expr { $$ = Expr\BinaryOp\Mul [$1, $3]; } - | expr '/' expr { $$ = Expr\BinaryOp\Div [$1, $3]; } - | expr '%' expr { $$ = Expr\BinaryOp\Mod [$1, $3]; } - | expr T_SL expr { $$ = Expr\BinaryOp\ShiftLeft [$1, $3]; } - | expr T_SR expr { $$ = Expr\BinaryOp\ShiftRight[$1, $3]; } - | expr T_POW expr { $$ = Expr\BinaryOp\Pow [$1, $3]; } - | '+' expr %prec T_INC { $$ = Expr\UnaryPlus [$2]; } - | '-' expr %prec T_INC { $$ = Expr\UnaryMinus[$2]; } - | '!' expr { $$ = Expr\BooleanNot[$2]; } - | '~' expr { $$ = Expr\BitwiseNot[$2]; } - | expr T_IS_IDENTICAL expr { $$ = Expr\BinaryOp\Identical [$1, $3]; } - | expr T_IS_NOT_IDENTICAL expr { $$ = Expr\BinaryOp\NotIdentical [$1, $3]; } - | expr T_IS_EQUAL expr { $$ = Expr\BinaryOp\Equal [$1, $3]; } - | expr T_IS_NOT_EQUAL expr { $$ = Expr\BinaryOp\NotEqual [$1, $3]; } - | expr T_SPACESHIP expr { $$ = Expr\BinaryOp\Spaceship [$1, $3]; } - | expr '<' expr { $$ = Expr\BinaryOp\Smaller [$1, $3]; } - | expr T_IS_SMALLER_OR_EQUAL expr { $$ = Expr\BinaryOp\SmallerOrEqual[$1, $3]; } - | expr '>' expr { $$ = Expr\BinaryOp\Greater [$1, $3]; } - | expr T_IS_GREATER_OR_EQUAL expr { $$ = Expr\BinaryOp\GreaterOrEqual[$1, $3]; } - | expr T_INSTANCEOF class_name_reference { $$ = Expr\Instanceof_[$1, $3]; } - | '(' expr ')' { $$ = $2; } - | expr '?' expr ':' expr { $$ = Expr\Ternary[$1, $3, $5]; } - | expr '?' ':' expr { $$ = Expr\Ternary[$1, null, $4]; } - | expr T_COALESCE expr { $$ = Expr\BinaryOp\Coalesce[$1, $3]; } - | T_ISSET '(' expr_list_allow_comma ')' { $$ = Expr\Isset_[$3]; } - | T_EMPTY '(' expr ')' { $$ = Expr\Empty_[$3]; } - | T_INCLUDE expr { $$ = Expr\Include_[$2, Expr\Include_::TYPE_INCLUDE]; } - | T_INCLUDE_ONCE expr { $$ = Expr\Include_[$2, Expr\Include_::TYPE_INCLUDE_ONCE]; } - | T_EVAL '(' expr ')' { $$ = Expr\Eval_[$3]; } - | T_REQUIRE expr { $$ = Expr\Include_[$2, Expr\Include_::TYPE_REQUIRE]; } - | T_REQUIRE_ONCE expr { $$ = Expr\Include_[$2, Expr\Include_::TYPE_REQUIRE_ONCE]; } - | T_INT_CAST expr { $$ = Expr\Cast\Int_ [$2]; } - | T_DOUBLE_CAST expr - { $attrs = attributes(); - $attrs['kind'] = $this->getFloatCastKind($1); - $$ = new Expr\Cast\Double($2, $attrs); } - | T_STRING_CAST expr { $$ = Expr\Cast\String_ [$2]; } - | T_ARRAY_CAST expr { $$ = Expr\Cast\Array_ [$2]; } - | T_OBJECT_CAST expr { $$ = Expr\Cast\Object_ [$2]; } - | T_BOOL_CAST expr { $$ = Expr\Cast\Bool_ [$2]; } - | T_UNSET_CAST expr { $$ = Expr\Cast\Unset_ [$2]; } - | T_EXIT exit_expr - { $attrs = attributes(); - $attrs['kind'] = strtolower($1) === 'exit' ? Expr\Exit_::KIND_EXIT : Expr\Exit_::KIND_DIE; - $$ = new Expr\Exit_($2, $attrs); } - | '@' expr { $$ = Expr\ErrorSuppress[$2]; } - | scalar { $$ = $1; } - | '`' backticks_expr '`' { $$ = Expr\ShellExec[$2]; } - | T_PRINT expr { $$ = Expr\Print_[$2]; } - | T_YIELD { $$ = Expr\Yield_[null, null]; } - | T_YIELD expr { $$ = Expr\Yield_[$2, null]; } - | T_YIELD expr T_DOUBLE_ARROW expr { $$ = Expr\Yield_[$4, $2]; } - | T_YIELD_FROM expr { $$ = Expr\YieldFrom[$2]; } - | T_THROW expr { $$ = Expr\Throw_[$2]; } - - | T_FN optional_ref '(' parameter_list ')' optional_return_type T_DOUBLE_ARROW expr %prec T_THROW - { $$ = Expr\ArrowFunction[['static' => false, 'byRef' => $2, 'params' => $4, 'returnType' => $6, 'expr' => $8, 'attrGroups' => []]]; } - | T_STATIC T_FN optional_ref '(' parameter_list ')' optional_return_type T_DOUBLE_ARROW expr %prec T_THROW - { $$ = Expr\ArrowFunction[['static' => true, 'byRef' => $3, 'params' => $5, 'returnType' => $7, 'expr' => $9, 'attrGroups' => []]]; } - | T_FUNCTION optional_ref '(' parameter_list ')' lexical_vars optional_return_type block_or_error - { $$ = Expr\Closure[['static' => false, 'byRef' => $2, 'params' => $4, 'uses' => $6, 'returnType' => $7, 'stmts' => $8, 'attrGroups' => []]]; } - | T_STATIC T_FUNCTION optional_ref '(' parameter_list ')' lexical_vars optional_return_type block_or_error - { $$ = Expr\Closure[['static' => true, 'byRef' => $3, 'params' => $5, 'uses' => $7, 'returnType' => $8, 'stmts' => $9, 'attrGroups' => []]]; } - - | attributes T_FN optional_ref '(' parameter_list ')' optional_return_type T_DOUBLE_ARROW expr %prec T_THROW - { $$ = Expr\ArrowFunction[['static' => false, 'byRef' => $3, 'params' => $5, 'returnType' => $7, 'expr' => $9, 'attrGroups' => $1]]; } - | attributes T_STATIC T_FN optional_ref '(' parameter_list ')' optional_return_type T_DOUBLE_ARROW expr %prec T_THROW - { $$ = Expr\ArrowFunction[['static' => true, 'byRef' => $4, 'params' => $6, 'returnType' => $8, 'expr' => $10, 'attrGroups' => $1]]; } - | attributes T_FUNCTION optional_ref '(' parameter_list ')' lexical_vars optional_return_type block_or_error - { $$ = Expr\Closure[['static' => false, 'byRef' => $3, 'params' => $5, 'uses' => $7, 'returnType' => $8, 'stmts' => $9, 'attrGroups' => $1]]; } - | attributes T_STATIC T_FUNCTION optional_ref '(' parameter_list ')' lexical_vars optional_return_type block_or_error - { $$ = Expr\Closure[['static' => true, 'byRef' => $4, 'params' => $6, 'uses' => $8, 'returnType' => $9, 'stmts' => $10, 'attrGroups' => $1]]; } -; - -anonymous_class: - optional_attributes T_CLASS ctor_arguments extends_from implements_list '{' class_statement_list '}' - { $$ = array(Stmt\Class_[null, ['type' => 0, 'extends' => $4, 'implements' => $5, 'stmts' => $7, 'attrGroups' => $1]], $3); - $this->checkClass($$[0], -1); } -; - -new_expr: - T_NEW class_name_reference ctor_arguments { $$ = Expr\New_[$2, $3]; } - | T_NEW anonymous_class - { list($class, $ctorArgs) = $2; $$ = Expr\New_[$class, $ctorArgs]; } -; - -lexical_vars: - /* empty */ { $$ = array(); } - | T_USE '(' lexical_var_list ')' { $$ = $3; } -; - -lexical_var_list: - non_empty_lexical_var_list optional_comma { $$ = $1; } -; - -non_empty_lexical_var_list: - lexical_var { init($1); } - | non_empty_lexical_var_list ',' lexical_var { push($1, $3); } -; - -lexical_var: - optional_ref plain_variable { $$ = Expr\ClosureUse[$2, $1]; } -; - -name_readonly: - T_READONLY { $$ = Name[$1]; } -; - -function_call: - name argument_list { $$ = Expr\FuncCall[$1, $2]; } - | name_readonly argument_list { $$ = Expr\FuncCall[$1, $2]; } - | callable_expr argument_list { $$ = Expr\FuncCall[$1, $2]; } - | class_name_or_var T_PAAMAYIM_NEKUDOTAYIM member_name argument_list - { $$ = Expr\StaticCall[$1, $3, $4]; } -; - -class_name: - T_STATIC { $$ = Name[$1]; } - | name { $$ = $1; } -; - -name: - T_STRING { $$ = Name[$1]; } - | T_NAME_QUALIFIED { $$ = Name[$1]; } - | T_NAME_FULLY_QUALIFIED { $$ = Name\FullyQualified[substr($1, 1)]; } - | T_NAME_RELATIVE { $$ = Name\Relative[substr($1, 10)]; } -; - -class_name_reference: - class_name { $$ = $1; } - | new_variable { $$ = $1; } - | '(' expr ')' { $$ = $2; } - | error { $$ = Expr\Error[]; $this->errorState = 2; } -; - -class_name_or_var: - class_name { $$ = $1; } - | fully_dereferencable { $$ = $1; } -; - -exit_expr: - /* empty */ { $$ = null; } - | '(' optional_expr ')' { $$ = $2; } -; - -backticks_expr: - /* empty */ { $$ = array(); } - | T_ENCAPSED_AND_WHITESPACE - { $$ = array(Scalar\EncapsedStringPart[Scalar\String_::parseEscapeSequences($1, '`')]); } - | encaps_list { parseEncapsed($1, '`', true); $$ = $1; } -; - -ctor_arguments: - /* empty */ { $$ = array(); } - | argument_list { $$ = $1; } -; - -constant: - name { $$ = Expr\ConstFetch[$1]; } - | T_LINE { $$ = Scalar\MagicConst\Line[]; } - | T_FILE { $$ = Scalar\MagicConst\File[]; } - | T_DIR { $$ = Scalar\MagicConst\Dir[]; } - | T_CLASS_C { $$ = Scalar\MagicConst\Class_[]; } - | T_TRAIT_C { $$ = Scalar\MagicConst\Trait_[]; } - | T_METHOD_C { $$ = Scalar\MagicConst\Method[]; } - | T_FUNC_C { $$ = Scalar\MagicConst\Function_[]; } - | T_NS_C { $$ = Scalar\MagicConst\Namespace_[]; } -; - -class_constant: - class_name_or_var T_PAAMAYIM_NEKUDOTAYIM identifier_maybe_reserved - { $$ = Expr\ClassConstFetch[$1, $3]; } - /* We interpret an isolated FOO:: as an unfinished class constant fetch. It could also be - an unfinished static property fetch or unfinished scoped call. */ - | class_name_or_var T_PAAMAYIM_NEKUDOTAYIM error - { $$ = Expr\ClassConstFetch[$1, new Expr\Error(stackAttributes(#3))]; $this->errorState = 2; } -; - -array_short_syntax: - '[' array_pair_list ']' - { $attrs = attributes(); $attrs['kind'] = Expr\Array_::KIND_SHORT; - $$ = new Expr\Array_($2, $attrs); } -; - -dereferencable_scalar: - T_ARRAY '(' array_pair_list ')' - { $attrs = attributes(); $attrs['kind'] = Expr\Array_::KIND_LONG; - $$ = new Expr\Array_($3, $attrs); } - | array_short_syntax { $$ = $1; } - | T_CONSTANT_ENCAPSED_STRING { $$ = Scalar\String_::fromString($1, attributes()); } - | '"' encaps_list '"' - { $attrs = attributes(); $attrs['kind'] = Scalar\String_::KIND_DOUBLE_QUOTED; - parseEncapsed($2, '"', true); $$ = new Scalar\Encapsed($2, $attrs); } -; - -scalar: - T_LNUMBER { $$ = $this->parseLNumber($1, attributes()); } - | T_DNUMBER { $$ = Scalar\DNumber::fromString($1, attributes()); } - | dereferencable_scalar { $$ = $1; } - | constant { $$ = $1; } - | class_constant { $$ = $1; } - | T_START_HEREDOC T_ENCAPSED_AND_WHITESPACE T_END_HEREDOC - { $$ = $this->parseDocString($1, $2, $3, attributes(), stackAttributes(#3), true); } - | T_START_HEREDOC T_END_HEREDOC - { $$ = $this->parseDocString($1, '', $2, attributes(), stackAttributes(#2), true); } - | T_START_HEREDOC encaps_list T_END_HEREDOC - { $$ = $this->parseDocString($1, $2, $3, attributes(), stackAttributes(#3), true); } -; - -optional_expr: - /* empty */ { $$ = null; } - | expr { $$ = $1; } -; - -fully_dereferencable: - variable { $$ = $1; } - | '(' expr ')' { $$ = $2; } - | dereferencable_scalar { $$ = $1; } - | class_constant { $$ = $1; } -; - -array_object_dereferencable: - fully_dereferencable { $$ = $1; } - | constant { $$ = $1; } -; - -callable_expr: - callable_variable { $$ = $1; } - | '(' expr ')' { $$ = $2; } - | dereferencable_scalar { $$ = $1; } -; - -callable_variable: - simple_variable { $$ = $1; } - | array_object_dereferencable '[' optional_expr ']' { $$ = Expr\ArrayDimFetch[$1, $3]; } - | array_object_dereferencable '{' expr '}' { $$ = Expr\ArrayDimFetch[$1, $3]; } - | function_call { $$ = $1; } - | array_object_dereferencable T_OBJECT_OPERATOR property_name argument_list - { $$ = Expr\MethodCall[$1, $3, $4]; } - | array_object_dereferencable T_NULLSAFE_OBJECT_OPERATOR property_name argument_list - { $$ = Expr\NullsafeMethodCall[$1, $3, $4]; } -; - -optional_plain_variable: - /* empty */ { $$ = null; } - | plain_variable { $$ = $1; } -; - -variable: - callable_variable { $$ = $1; } - | static_member { $$ = $1; } - | array_object_dereferencable T_OBJECT_OPERATOR property_name - { $$ = Expr\PropertyFetch[$1, $3]; } - | array_object_dereferencable T_NULLSAFE_OBJECT_OPERATOR property_name - { $$ = Expr\NullsafePropertyFetch[$1, $3]; } -; - -simple_variable: - plain_variable { $$ = $1; } - | '$' '{' expr '}' { $$ = Expr\Variable[$3]; } - | '$' simple_variable { $$ = Expr\Variable[$2]; } - | '$' error { $$ = Expr\Variable[Expr\Error[]]; $this->errorState = 2; } -; - -static_member_prop_name: - simple_variable - { $var = $1->name; $$ = \is_string($var) ? Node\VarLikeIdentifier[$var] : $var; } -; - -static_member: - class_name_or_var T_PAAMAYIM_NEKUDOTAYIM static_member_prop_name - { $$ = Expr\StaticPropertyFetch[$1, $3]; } -; - -new_variable: - simple_variable { $$ = $1; } - | new_variable '[' optional_expr ']' { $$ = Expr\ArrayDimFetch[$1, $3]; } - | new_variable '{' expr '}' { $$ = Expr\ArrayDimFetch[$1, $3]; } - | new_variable T_OBJECT_OPERATOR property_name { $$ = Expr\PropertyFetch[$1, $3]; } - | new_variable T_NULLSAFE_OBJECT_OPERATOR property_name { $$ = Expr\NullsafePropertyFetch[$1, $3]; } - | class_name T_PAAMAYIM_NEKUDOTAYIM static_member_prop_name - { $$ = Expr\StaticPropertyFetch[$1, $3]; } - | new_variable T_PAAMAYIM_NEKUDOTAYIM static_member_prop_name - { $$ = Expr\StaticPropertyFetch[$1, $3]; } -; - -member_name: - identifier_maybe_reserved { $$ = $1; } - | '{' expr '}' { $$ = $2; } - | simple_variable { $$ = $1; } -; - -property_name: - identifier_not_reserved { $$ = $1; } - | '{' expr '}' { $$ = $2; } - | simple_variable { $$ = $1; } - | error { $$ = Expr\Error[]; $this->errorState = 2; } -; - -list_expr: - T_LIST '(' inner_array_pair_list ')' { $$ = Expr\List_[$3]; } -; - -array_pair_list: - inner_array_pair_list - { $$ = $1; $end = count($$)-1; if ($$[$end] === null) array_pop($$); } -; - -comma_or_error: - ',' - | error - { /* do nothing -- prevent default action of $$=$1. See #551. */ } -; - -inner_array_pair_list: - inner_array_pair_list comma_or_error array_pair { push($1, $3); } - | array_pair { init($1); } -; - -array_pair: - expr { $$ = Expr\ArrayItem[$1, null, false]; } - | ampersand variable { $$ = Expr\ArrayItem[$2, null, true]; } - | list_expr { $$ = Expr\ArrayItem[$1, null, false]; } - | expr T_DOUBLE_ARROW expr { $$ = Expr\ArrayItem[$3, $1, false]; } - | expr T_DOUBLE_ARROW ampersand variable { $$ = Expr\ArrayItem[$4, $1, true]; } - | expr T_DOUBLE_ARROW list_expr { $$ = Expr\ArrayItem[$3, $1, false]; } - | T_ELLIPSIS expr { $$ = Expr\ArrayItem[$2, null, false, attributes(), true]; } - | /* empty */ { $$ = null; } -; - -encaps_list: - encaps_list encaps_var { push($1, $2); } - | encaps_list encaps_string_part { push($1, $2); } - | encaps_var { init($1); } - | encaps_string_part encaps_var { init($1, $2); } -; - -encaps_string_part: - T_ENCAPSED_AND_WHITESPACE { $$ = Scalar\EncapsedStringPart[$1]; } -; - -encaps_str_varname: - T_STRING_VARNAME { $$ = Expr\Variable[$1]; } -; - -encaps_var: - plain_variable { $$ = $1; } - | plain_variable '[' encaps_var_offset ']' { $$ = Expr\ArrayDimFetch[$1, $3]; } - | plain_variable T_OBJECT_OPERATOR identifier_not_reserved - { $$ = Expr\PropertyFetch[$1, $3]; } - | plain_variable T_NULLSAFE_OBJECT_OPERATOR identifier_not_reserved - { $$ = Expr\NullsafePropertyFetch[$1, $3]; } - | T_DOLLAR_OPEN_CURLY_BRACES expr '}' { $$ = Expr\Variable[$2]; } - | T_DOLLAR_OPEN_CURLY_BRACES T_STRING_VARNAME '}' { $$ = Expr\Variable[$2]; } - | T_DOLLAR_OPEN_CURLY_BRACES encaps_str_varname '[' expr ']' '}' - { $$ = Expr\ArrayDimFetch[$2, $4]; } - | T_CURLY_OPEN variable '}' { $$ = $2; } -; - -encaps_var_offset: - T_STRING { $$ = Scalar\String_[$1]; } - | T_NUM_STRING { $$ = $this->parseNumString($1, attributes()); } - | '-' T_NUM_STRING { $$ = $this->parseNumString('-' . $2, attributes()); } - | plain_variable { $$ = $1; } -; - -%% diff --git a/vendor/nikic/php-parser/grammar/phpyLang.php b/vendor/nikic/php-parser/grammar/phpyLang.php deleted file mode 100644 index 663c2a14..00000000 --- a/vendor/nikic/php-parser/grammar/phpyLang.php +++ /dev/null @@ -1,184 +0,0 @@ -\'[^\\\\\']*+(?:\\\\.[^\\\\\']*+)*+\') - (?"[^\\\\"]*+(?:\\\\.[^\\\\"]*+)*+") - (?(?&singleQuotedString)|(?&doubleQuotedString)) - (?/\*[^*]*+(?:\*(?!/)[^*]*+)*+\*/) - (?\{[^\'"/{}]*+(?:(?:(?&string)|(?&comment)|(?&code)|/)[^\'"/{}]*+)*+}) -)'; - -const PARAMS = '\[(?[^[\]]*+(?:\[(?¶ms)\][^[\]]*+)*+)\]'; -const ARGS = '\((?[^()]*+(?:\((?&args)\)[^()]*+)*+)\)'; - -/////////////////////////////// -/// Preprocessing functions /// -/////////////////////////////// - -function preprocessGrammar($code) { - $code = resolveNodes($code); - $code = resolveMacros($code); - $code = resolveStackAccess($code); - - return $code; -} - -function resolveNodes($code) { - return preg_replace_callback( - '~\b(?[A-Z][a-zA-Z_\\\\]++)\s*' . PARAMS . '~', - function($matches) { - // recurse - $matches['params'] = resolveNodes($matches['params']); - - $params = magicSplit( - '(?:' . PARAMS . '|' . ARGS . ')(*SKIP)(*FAIL)|,', - $matches['params'] - ); - - $paramCode = ''; - foreach ($params as $param) { - $paramCode .= $param . ', '; - } - - return 'new ' . $matches['name'] . '(' . $paramCode . 'attributes())'; - }, - $code - ); -} - -function resolveMacros($code) { - return preg_replace_callback( - '~\b(?)(?!array\()(?[a-z][A-Za-z]++)' . ARGS . '~', - function($matches) { - // recurse - $matches['args'] = resolveMacros($matches['args']); - - $name = $matches['name']; - $args = magicSplit( - '(?:' . PARAMS . '|' . ARGS . ')(*SKIP)(*FAIL)|,', - $matches['args'] - ); - - if ('attributes' === $name) { - assertArgs(0, $args, $name); - return '$this->startAttributeStack[#1] + $this->endAttributes'; - } - - if ('stackAttributes' === $name) { - assertArgs(1, $args, $name); - return '$this->startAttributeStack[' . $args[0] . ']' - . ' + $this->endAttributeStack[' . $args[0] . ']'; - } - - if ('init' === $name) { - return '$$ = array(' . implode(', ', $args) . ')'; - } - - if ('push' === $name) { - assertArgs(2, $args, $name); - - return $args[0] . '[] = ' . $args[1] . '; $$ = ' . $args[0]; - } - - if ('pushNormalizing' === $name) { - assertArgs(2, $args, $name); - - return 'if (is_array(' . $args[1] . ')) { $$ = array_merge(' . $args[0] . ', ' . $args[1] . '); }' - . ' else { ' . $args[0] . '[] = ' . $args[1] . '; $$ = ' . $args[0] . '; }'; - } - - if ('toArray' == $name) { - assertArgs(1, $args, $name); - - return 'is_array(' . $args[0] . ') ? ' . $args[0] . ' : array(' . $args[0] . ')'; - } - - if ('parseVar' === $name) { - assertArgs(1, $args, $name); - - return 'substr(' . $args[0] . ', 1)'; - } - - if ('parseEncapsed' === $name) { - assertArgs(3, $args, $name); - - return 'foreach (' . $args[0] . ' as $s) { if ($s instanceof Node\Scalar\EncapsedStringPart) {' - . ' $s->value = Node\Scalar\String_::parseEscapeSequences($s->value, ' . $args[1] . ', ' . $args[2] . '); } }'; - } - - if ('makeNop' === $name) { - assertArgs(3, $args, $name); - - return '$startAttributes = ' . $args[1] . ';' - . ' if (isset($startAttributes[\'comments\']))' - . ' { ' . $args[0] . ' = new Stmt\Nop($startAttributes + ' . $args[2] . '); }' - . ' else { ' . $args[0] . ' = null; }'; - } - - if ('makeZeroLengthNop' == $name) { - assertArgs(2, $args, $name); - - return '$startAttributes = ' . $args[1] . ';' - . ' if (isset($startAttributes[\'comments\']))' - . ' { ' . $args[0] . ' = new Stmt\Nop($this->createCommentNopAttributes($startAttributes[\'comments\'])); }' - . ' else { ' . $args[0] . ' = null; }'; - } - - if ('prependLeadingComments' === $name) { - assertArgs(1, $args, $name); - - return '$attrs = $this->startAttributeStack[#1]; $stmts = ' . $args[0] . '; ' - . 'if (!empty($attrs[\'comments\'])) {' - . '$stmts[0]->setAttribute(\'comments\', ' - . 'array_merge($attrs[\'comments\'], $stmts[0]->getAttribute(\'comments\', []))); }'; - } - - return $matches[0]; - }, - $code - ); -} - -function assertArgs($num, $args, $name) { - if ($num != count($args)) { - die('Wrong argument count for ' . $name . '().'); - } -} - -function resolveStackAccess($code) { - $code = preg_replace('/\$\d+/', '$this->semStack[$0]', $code); - $code = preg_replace('/#(\d+)/', '$$1', $code); - return $code; -} - -function removeTrailingWhitespace($code) { - $lines = explode("\n", $code); - $lines = array_map('rtrim', $lines); - return implode("\n", $lines); -} - -////////////////////////////// -/// Regex helper functions /// -////////////////////////////// - -function regex($regex) { - return '~' . LIB . '(?:' . str_replace('~', '\~', $regex) . ')~'; -} - -function magicSplit($regex, $string) { - $pieces = preg_split(regex('(?:(?&string)|(?&comment)|(?&code))(*SKIP)(*FAIL)|' . $regex), $string); - - foreach ($pieces as &$piece) { - $piece = trim($piece); - } - - if ($pieces === ['']) { - return []; - } - - return $pieces; -} diff --git a/vendor/nikic/php-parser/grammar/rebuildParsers.php b/vendor/nikic/php-parser/grammar/rebuildParsers.php deleted file mode 100644 index 2d0c6b14..00000000 --- a/vendor/nikic/php-parser/grammar/rebuildParsers.php +++ /dev/null @@ -1,81 +0,0 @@ - 'Php5', - __DIR__ . '/php7.y' => 'Php7', -]; - -$tokensFile = __DIR__ . '/tokens.y'; -$tokensTemplate = __DIR__ . '/tokens.template'; -$skeletonFile = __DIR__ . '/parser.template'; -$tmpGrammarFile = __DIR__ . '/tmp_parser.phpy'; -$tmpResultFile = __DIR__ . '/tmp_parser.php'; -$resultDir = __DIR__ . '/../lib/PhpParser/Parser'; -$tokensResultsFile = $resultDir . '/Tokens.php'; - -$kmyacc = getenv('KMYACC'); -if (!$kmyacc) { - // Use phpyacc from dev dependencies by default. - $kmyacc = __DIR__ . '/../vendor/bin/phpyacc'; -} - -$options = array_flip($argv); -$optionDebug = isset($options['--debug']); -$optionKeepTmpGrammar = isset($options['--keep-tmp-grammar']); - -/////////////////// -/// Main script /// -/////////////////// - -$tokens = file_get_contents($tokensFile); - -foreach ($grammarFileToName as $grammarFile => $name) { - echo "Building temporary $name grammar file.\n"; - - $grammarCode = file_get_contents($grammarFile); - $grammarCode = str_replace('%tokens', $tokens, $grammarCode); - $grammarCode = preprocessGrammar($grammarCode); - - file_put_contents($tmpGrammarFile, $grammarCode); - - $additionalArgs = $optionDebug ? '-t -v' : ''; - - echo "Building $name parser.\n"; - $output = execCmd("$kmyacc $additionalArgs -m $skeletonFile -p $name $tmpGrammarFile"); - - $resultCode = file_get_contents($tmpResultFile); - $resultCode = removeTrailingWhitespace($resultCode); - - ensureDirExists($resultDir); - file_put_contents("$resultDir/$name.php", $resultCode); - unlink($tmpResultFile); - - echo "Building token definition.\n"; - $output = execCmd("$kmyacc -m $tokensTemplate $tmpGrammarFile"); - rename($tmpResultFile, $tokensResultsFile); - - if (!$optionKeepTmpGrammar) { - unlink($tmpGrammarFile); - } -} - -//////////////////////////////// -/// Utility helper functions /// -//////////////////////////////// - -function ensureDirExists($dir) { - if (!is_dir($dir)) { - mkdir($dir, 0777, true); - } -} - -function execCmd($cmd) { - $output = trim(shell_exec("$cmd 2>&1")); - if ($output !== "") { - echo "> " . $cmd . "\n"; - echo $output; - } - return $output; -} diff --git a/vendor/nikic/php-parser/grammar/tokens.template b/vendor/nikic/php-parser/grammar/tokens.template deleted file mode 100644 index ba4e4901..00000000 --- a/vendor/nikic/php-parser/grammar/tokens.template +++ /dev/null @@ -1,17 +0,0 @@ -semValue -#semval($,%t) $this->semValue -#semval(%n) $this->stackPos-(%l-%n) -#semval(%n,%t) $this->stackPos-(%l-%n) - -namespace PhpParser\Parser; -#include; - -/* GENERATED file based on grammar/tokens.y */ -final class Tokens -{ -#tokenval - const %s = %n; -#endtokenval -} diff --git a/vendor/nikic/php-parser/grammar/tokens.y b/vendor/nikic/php-parser/grammar/tokens.y deleted file mode 100644 index 8f0b2172..00000000 --- a/vendor/nikic/php-parser/grammar/tokens.y +++ /dev/null @@ -1,115 +0,0 @@ -/* We currently rely on the token ID mapping to be the same between PHP 5 and PHP 7 - so the same lexer can be used for - * both. This is enforced by sharing this token file. */ - -%right T_THROW -%left T_INCLUDE T_INCLUDE_ONCE T_EVAL T_REQUIRE T_REQUIRE_ONCE -%left ',' -%left T_LOGICAL_OR -%left T_LOGICAL_XOR -%left T_LOGICAL_AND -%right T_PRINT -%right T_YIELD -%right T_DOUBLE_ARROW -%right T_YIELD_FROM -%left '=' T_PLUS_EQUAL T_MINUS_EQUAL T_MUL_EQUAL T_DIV_EQUAL T_CONCAT_EQUAL T_MOD_EQUAL T_AND_EQUAL T_OR_EQUAL T_XOR_EQUAL T_SL_EQUAL T_SR_EQUAL T_POW_EQUAL T_COALESCE_EQUAL -%left '?' ':' -%right T_COALESCE -%left T_BOOLEAN_OR -%left T_BOOLEAN_AND -%left '|' -%left '^' -%left T_AMPERSAND_NOT_FOLLOWED_BY_VAR_OR_VARARG T_AMPERSAND_FOLLOWED_BY_VAR_OR_VARARG -%nonassoc T_IS_EQUAL T_IS_NOT_EQUAL T_IS_IDENTICAL T_IS_NOT_IDENTICAL T_SPACESHIP -%nonassoc '<' T_IS_SMALLER_OR_EQUAL '>' T_IS_GREATER_OR_EQUAL -%left T_SL T_SR -%left '+' '-' '.' -%left '*' '/' '%' -%right '!' -%nonassoc T_INSTANCEOF -%right '~' T_INC T_DEC T_INT_CAST T_DOUBLE_CAST T_STRING_CAST T_ARRAY_CAST T_OBJECT_CAST T_BOOL_CAST T_UNSET_CAST '@' -%right T_POW -%right '[' -%nonassoc T_NEW T_CLONE -%token T_EXIT -%token T_IF -%left T_ELSEIF -%left T_ELSE -%left T_ENDIF -%token T_LNUMBER -%token T_DNUMBER -%token T_STRING -%token T_STRING_VARNAME -%token T_VARIABLE -%token T_NUM_STRING -%token T_INLINE_HTML -%token T_ENCAPSED_AND_WHITESPACE -%token T_CONSTANT_ENCAPSED_STRING -%token T_ECHO -%token T_DO -%token T_WHILE -%token T_ENDWHILE -%token T_FOR -%token T_ENDFOR -%token T_FOREACH -%token T_ENDFOREACH -%token T_DECLARE -%token T_ENDDECLARE -%token T_AS -%token T_SWITCH -%token T_MATCH -%token T_ENDSWITCH -%token T_CASE -%token T_DEFAULT -%token T_BREAK -%token T_CONTINUE -%token T_GOTO -%token T_FUNCTION -%token T_FN -%token T_CONST -%token T_RETURN -%token T_TRY -%token T_CATCH -%token T_FINALLY -%token T_THROW -%token T_USE -%token T_INSTEADOF -%token T_GLOBAL -%right T_STATIC T_ABSTRACT T_FINAL T_PRIVATE T_PROTECTED T_PUBLIC T_READONLY -%token T_VAR -%token T_UNSET -%token T_ISSET -%token T_EMPTY -%token T_HALT_COMPILER -%token T_CLASS -%token T_TRAIT -%token T_INTERFACE -%token T_ENUM -%token T_EXTENDS -%token T_IMPLEMENTS -%token T_OBJECT_OPERATOR -%token T_NULLSAFE_OBJECT_OPERATOR -%token T_DOUBLE_ARROW -%token T_LIST -%token T_ARRAY -%token T_CALLABLE -%token T_CLASS_C -%token T_TRAIT_C -%token T_METHOD_C -%token T_FUNC_C -%token T_LINE -%token T_FILE -%token T_START_HEREDOC -%token T_END_HEREDOC -%token T_DOLLAR_OPEN_CURLY_BRACES -%token T_CURLY_OPEN -%token T_PAAMAYIM_NEKUDOTAYIM -%token T_NAMESPACE -%token T_NS_C -%token T_DIR -%token T_NS_SEPARATOR -%token T_ELLIPSIS -%token T_NAME_FULLY_QUALIFIED -%token T_NAME_QUALIFIED -%token T_NAME_RELATIVE -%token T_ATTRIBUTE -%token T_ENUM diff --git a/vendor/nikic/php-parser/lib/PhpParser/Builder/ClassConst.php b/vendor/nikic/php-parser/lib/PhpParser/Builder/ClassConst.php index f616c627..7c1512d0 100644 --- a/vendor/nikic/php-parser/lib/PhpParser/Builder/ClassConst.php +++ b/vendor/nikic/php-parser/lib/PhpParser/Builder/ClassConst.php @@ -19,12 +19,14 @@ class ClassConst implements PhpParser\Builder /** @var Node\AttributeGroup[] */ protected $attributeGroups = []; + /** @var Identifier|Node\Name|Node\ComplexType */ + protected $type; /** * Creates a class constant builder * * @param string|Identifier $name Name - * @param Node\Expr|bool|null|int|float|string|array $value Value + * @param Node\Expr|bool|null|int|float|string|array|\UnitEnum $value Value */ public function __construct($name, $value) { $this->constants = [new Const_($name, BuilderHelpers::normalizeValue($value))]; @@ -34,7 +36,7 @@ class ClassConst implements PhpParser\Builder * Add another constant to const group * * @param string|Identifier $name Name - * @param Node\Expr|bool|null|int|float|string|array $value Value + * @param Node\Expr|bool|null|int|float|string|array|\UnitEnum $value Value * * @return $this The builder instance (for fluid interface) */ @@ -116,6 +118,19 @@ class ClassConst implements PhpParser\Builder return $this; } + /** + * Sets the constant type. + * + * @param string|Node\Name|Identifier|Node\ComplexType $type + * + * @return $this + */ + public function setType($type) { + $this->type = BuilderHelpers::normalizeType($type); + + return $this; + } + /** * Returns the built class node. * @@ -126,7 +141,8 @@ class ClassConst implements PhpParser\Builder $this->constants, $this->flags, $this->attributes, - $this->attributeGroups + $this->attributeGroups, + $this->type ); } } diff --git a/vendor/nikic/php-parser/lib/PhpParser/Builder/Param.php b/vendor/nikic/php-parser/lib/PhpParser/Builder/Param.php index de9aae7e..69f35332 100644 --- a/vendor/nikic/php-parser/lib/PhpParser/Builder/Param.php +++ b/vendor/nikic/php-parser/lib/PhpParser/Builder/Param.php @@ -19,6 +19,8 @@ class Param implements PhpParser\Builder protected $variadic = false; + protected $flags = 0; + /** @var Node\AttributeGroup[] */ protected $attributeGroups = []; @@ -95,6 +97,50 @@ class Param implements PhpParser\Builder return $this; } + /** + * Makes the (promoted) parameter public. + * + * @return $this The builder instance (for fluid interface) + */ + public function makePublic() { + $this->flags = BuilderHelpers::addModifier($this->flags, Node\Stmt\Class_::MODIFIER_PUBLIC); + + return $this; + } + + /** + * Makes the (promoted) parameter protected. + * + * @return $this The builder instance (for fluid interface) + */ + public function makeProtected() { + $this->flags = BuilderHelpers::addModifier($this->flags, Node\Stmt\Class_::MODIFIER_PROTECTED); + + return $this; + } + + /** + * Makes the (promoted) parameter private. + * + * @return $this The builder instance (for fluid interface) + */ + public function makePrivate() { + $this->flags = BuilderHelpers::addModifier($this->flags, Node\Stmt\Class_::MODIFIER_PRIVATE); + + return $this; + } + + /** + * Makes the (promoted) parameter readonly. + * + * @return $this The builder instance (for fluid interface) + */ + public function makeReadonly() { + $this->flags = BuilderHelpers::addModifier($this->flags, Node\Stmt\Class_::MODIFIER_READONLY); + + return $this; + } + /** * Adds an attribute group. * @@ -116,7 +162,7 @@ class Param implements PhpParser\Builder public function getNode() : Node { return new Node\Param( new Node\Expr\Variable($this->name), - $this->default, $this->type, $this->byRef, $this->variadic, [], 0, $this->attributeGroups + $this->default, $this->type, $this->byRef, $this->variadic, [], $this->flags, $this->attributeGroups ); } } diff --git a/vendor/nikic/php-parser/lib/PhpParser/BuilderFactory.php b/vendor/nikic/php-parser/lib/PhpParser/BuilderFactory.php index fef2579b..0aae8738 100644 --- a/vendor/nikic/php-parser/lib/PhpParser/BuilderFactory.php +++ b/vendor/nikic/php-parser/lib/PhpParser/BuilderFactory.php @@ -213,7 +213,7 @@ class BuilderFactory /** * Creates node a for a literal value. * - * @param Expr|bool|null|int|float|string|array $value $value + * @param Expr|bool|null|int|float|string|array|\UnitEnum $value $value * * @return Expr */ @@ -349,15 +349,15 @@ class BuilderFactory /** * Creates a class constant fetch node. * - * @param string|Name|Expr $class Class name - * @param string|Identifier $name Constant name + * @param string|Name|Expr $class Class name + * @param string|Identifier|Expr $name Constant name * * @return Expr\ClassConstFetch */ public function classConstFetch($class, $name): Expr\ClassConstFetch { return new Expr\ClassConstFetch( BuilderHelpers::normalizeNameOrExpr($class), - BuilderHelpers::normalizeIdentifier($name) + BuilderHelpers::normalizeIdentifierOrExpr($name) ); } diff --git a/vendor/nikic/php-parser/lib/PhpParser/BuilderHelpers.php b/vendor/nikic/php-parser/lib/PhpParser/BuilderHelpers.php index af6ceb99..05e7868f 100644 --- a/vendor/nikic/php-parser/lib/PhpParser/BuilderHelpers.php +++ b/vendor/nikic/php-parser/lib/PhpParser/BuilderHelpers.php @@ -6,6 +6,7 @@ use PhpParser\Node\ComplexType; use PhpParser\Node\Expr; use PhpParser\Node\Identifier; use PhpParser\Node\Name; +use PhpParser\Node\Name\FullyQualified; use PhpParser\Node\NullableType; use PhpParser\Node\Scalar; use PhpParser\Node\Stmt; @@ -215,7 +216,7 @@ final class BuilderHelpers * Normalizes a value: Converts nulls, booleans, integers, * floats, strings and arrays into their respective nodes * - * @param Node\Expr|bool|null|int|float|string|array $value The value to normalize + * @param Node\Expr|bool|null|int|float|string|array|\UnitEnum $value The value to normalize * * @return Expr The normalized value */ @@ -269,6 +270,10 @@ final class BuilderHelpers return new Expr\Array_($items); } + if ($value instanceof \UnitEnum) { + return new Expr\ClassConstFetch(new FullyQualified(\get_class($value)), new Identifier($value->name)); + } + throw new \LogicException('Invalid value'); } diff --git a/vendor/nikic/php-parser/lib/PhpParser/ConstExprEvaluator.php b/vendor/nikic/php-parser/lib/PhpParser/ConstExprEvaluator.php index 7131c3d2..ceb3f11f 100644 --- a/vendor/nikic/php-parser/lib/PhpParser/ConstExprEvaluator.php +++ b/vendor/nikic/php-parser/lib/PhpParser/ConstExprEvaluator.php @@ -37,7 +37,7 @@ class ConstExprEvaluator * * @param callable|null $fallbackEvaluator To call if subexpression cannot be evaluated */ - public function __construct(callable $fallbackEvaluator = null) { + public function __construct(?callable $fallbackEvaluator = null) { $this->fallbackEvaluator = $fallbackEvaluator ?? function(Expr $expr) { throw new ConstExprEvaluationException( "Expression of type {$expr->getType()} cannot be evaluated" diff --git a/vendor/nikic/php-parser/lib/PhpParser/Internal/PrintableNewAnonClassNode.php b/vendor/nikic/php-parser/lib/PhpParser/Internal/PrintableNewAnonClassNode.php index 3eeac04a..fc276ecb 100644 --- a/vendor/nikic/php-parser/lib/PhpParser/Internal/PrintableNewAnonClassNode.php +++ b/vendor/nikic/php-parser/lib/PhpParser/Internal/PrintableNewAnonClassNode.php @@ -19,6 +19,8 @@ class PrintableNewAnonClassNode extends Expr { /** @var Node\AttributeGroup[] PHP attribute groups */ public $attrGroups; + /** @var int Modifiers */ + public $flags; /** @var Node\Arg[] Arguments */ public $args; /** @var null|Node\Name Name of extended class */ @@ -29,11 +31,12 @@ class PrintableNewAnonClassNode extends Expr public $stmts; public function __construct( - array $attrGroups, array $args, Node\Name $extends = null, array $implements, + array $attrGroups, int $flags, array $args, ?Node\Name $extends, array $implements, array $stmts, array $attributes ) { parent::__construct($attributes); $this->attrGroups = $attrGroups; + $this->flags = $flags; $this->args = $args; $this->extends = $extends; $this->implements = $implements; @@ -46,7 +49,7 @@ class PrintableNewAnonClassNode extends Expr // We don't assert that $class->name is null here, to allow consumers to assign unique names // to anonymous classes for their own purposes. We simplify ignore the name here. return new self( - $class->attrGroups, $newNode->args, $class->extends, $class->implements, + $class->attrGroups, $class->flags, $newNode->args, $class->extends, $class->implements, $class->stmts, $newNode->getAttributes() ); } @@ -56,6 +59,6 @@ class PrintableNewAnonClassNode extends Expr } public function getSubNodeNames() : array { - return ['attrGroups', 'args', 'extends', 'implements', 'stmts']; + return ['attrGroups', 'flags', 'args', 'extends', 'implements', 'stmts']; } } diff --git a/vendor/nikic/php-parser/lib/PhpParser/Lexer.php b/vendor/nikic/php-parser/lib/PhpParser/Lexer.php index e15dd0a5..60b809b8 100644 --- a/vendor/nikic/php-parser/lib/PhpParser/Lexer.php +++ b/vendor/nikic/php-parser/lib/PhpParser/Lexer.php @@ -69,7 +69,7 @@ class Lexer * @param ErrorHandler|null $errorHandler Error handler to use for lexing errors. Defaults to * ErrorHandler\Throwing */ - public function startLexing(string $code, ErrorHandler $errorHandler = null) { + public function startLexing(string $code, ?ErrorHandler $errorHandler = null) { if (null === $errorHandler) { $errorHandler = new ErrorHandler\Throwing(); } diff --git a/vendor/nikic/php-parser/lib/PhpParser/Lexer/Emulative.php b/vendor/nikic/php-parser/lib/PhpParser/Lexer/Emulative.php index b0929f3c..a0e781d0 100644 --- a/vendor/nikic/php-parser/lib/PhpParser/Lexer/Emulative.php +++ b/vendor/nikic/php-parser/lib/PhpParser/Lexer/Emulative.php @@ -74,7 +74,7 @@ class Emulative extends Lexer } } - public function startLexing(string $code, ErrorHandler $errorHandler = null) { + public function startLexing(string $code, ?ErrorHandler $errorHandler = null) { $emulators = array_filter($this->emulators, function($emulator) use($code) { return $emulator->isEmulationNeeded($code); }); diff --git a/vendor/nikic/php-parser/lib/PhpParser/NameContext.php b/vendor/nikic/php-parser/lib/PhpParser/NameContext.php index 777a4afd..82c5acc2 100644 --- a/vendor/nikic/php-parser/lib/PhpParser/NameContext.php +++ b/vendor/nikic/php-parser/lib/PhpParser/NameContext.php @@ -36,7 +36,7 @@ class NameContext * * @param Name|null $namespace Null is the global namespace */ - public function startNamespace(Name $namespace = null) { + public function startNamespace(?Name $namespace = null) { $this->namespace = $namespace; $this->origAliases = $this->aliases = [ Stmt\Use_::TYPE_NORMAL => [], diff --git a/vendor/nikic/php-parser/lib/PhpParser/Node/Arg.php b/vendor/nikic/php-parser/lib/PhpParser/Node/Arg.php index bcf130e6..17e68026 100644 --- a/vendor/nikic/php-parser/lib/PhpParser/Node/Arg.php +++ b/vendor/nikic/php-parser/lib/PhpParser/Node/Arg.php @@ -27,7 +27,7 @@ class Arg extends NodeAbstract */ public function __construct( Expr $value, bool $byRef = false, bool $unpack = false, array $attributes = [], - Identifier $name = null + ?Identifier $name = null ) { $this->attributes = $attributes; $this->name = $name; diff --git a/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/ArrayDimFetch.php b/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/ArrayDimFetch.php index 71694478..46db975c 100644 --- a/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/ArrayDimFetch.php +++ b/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/ArrayDimFetch.php @@ -18,7 +18,7 @@ class ArrayDimFetch extends Expr * @param null|Expr $dim Array index / dim * @param array $attributes Additional attributes */ - public function __construct(Expr $var, Expr $dim = null, array $attributes = []) { + public function __construct(Expr $var, ?Expr $dim = null, array $attributes = []) { $this->attributes = $attributes; $this->var = $var; $this->dim = $dim; diff --git a/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/ArrayItem.php b/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/ArrayItem.php index 1b078f82..5aaa9867 100644 --- a/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/ArrayItem.php +++ b/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/ArrayItem.php @@ -23,7 +23,7 @@ class ArrayItem extends Expr * @param bool $byRef Whether to assign by reference * @param array $attributes Additional attributes */ - public function __construct(Expr $value, Expr $key = null, bool $byRef = false, array $attributes = [], bool $unpack = false) { + public function __construct(Expr $value, ?Expr $key = null, bool $byRef = false, array $attributes = [], bool $unpack = false) { $this->attributes = $attributes; $this->key = $key; $this->value = $value; diff --git a/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/ClassConstFetch.php b/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/ClassConstFetch.php index faf832f9..0c45ffb4 100644 --- a/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/ClassConstFetch.php +++ b/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/ClassConstFetch.php @@ -10,15 +10,15 @@ class ClassConstFetch extends Expr { /** @var Name|Expr Class name */ public $class; - /** @var Identifier|Error Constant name */ + /** @var Identifier|Expr|Error Constant name */ public $name; /** * Constructs a class const fetch node. * - * @param Name|Expr $class Class name - * @param string|Identifier|Error $name Constant name - * @param array $attributes Additional attributes + * @param Name|Expr $class Class name + * @param string|Identifier|Expr|Error $name Constant name + * @param array $attributes Additional attributes */ public function __construct($class, $name, array $attributes = []) { $this->attributes = $attributes; @@ -29,7 +29,7 @@ class ClassConstFetch extends Expr public function getSubNodeNames() : array { return ['class', 'name']; } - + public function getType() : string { return 'Expr_ClassConstFetch'; } diff --git a/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/Exit_.php b/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/Exit_.php index b88a8f7e..5469b8e4 100644 --- a/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/Exit_.php +++ b/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/Exit_.php @@ -19,7 +19,7 @@ class Exit_ extends Expr * @param null|Expr $expr Expression * @param array $attributes Additional attributes */ - public function __construct(Expr $expr = null, array $attributes = []) { + public function __construct(?Expr $expr = null, array $attributes = []) { $this->attributes = $attributes; $this->expr = $expr; } diff --git a/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/Yield_.php b/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/Yield_.php index aef8fc33..f15336ed 100644 --- a/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/Yield_.php +++ b/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/Yield_.php @@ -18,7 +18,7 @@ class Yield_ extends Expr * @param null|Expr $key Key expression * @param array $attributes Additional attributes */ - public function __construct(Expr $value = null, Expr $key = null, array $attributes = []) { + public function __construct(?Expr $value = null, ?Expr $key = null, array $attributes = []) { $this->attributes = $attributes; $this->key = $key; $this->value = $value; diff --git a/vendor/nikic/php-parser/lib/PhpParser/Node/Name.php b/vendor/nikic/php-parser/lib/PhpParser/Node/Name.php index 17bd1c0f..0d6e4b1f 100644 --- a/vendor/nikic/php-parser/lib/PhpParser/Node/Name.php +++ b/vendor/nikic/php-parser/lib/PhpParser/Node/Name.php @@ -6,7 +6,10 @@ use PhpParser\NodeAbstract; class Name extends NodeAbstract { - /** @var string[] Parts of the name */ + /** + * @var string[] Parts of the name + * @deprecated Use getParts() instead + */ public $parts; private static $specialClassNames = [ @@ -30,6 +33,15 @@ class Name extends NodeAbstract return ['parts']; } + /** + * Get parts of name (split by the namespace separator). + * + * @return string[] Parts of name + */ + public function getParts(): array { + return $this->parts; + } + /** * Gets the first part of the name, i.e. everything before the first namespace separator. * @@ -150,7 +162,7 @@ class Name extends NodeAbstract * * @return static|null Sliced name */ - public function slice(int $offset, int $length = null) { + public function slice(int $offset, ?int $length = null) { $numParts = count($this->parts); $realOffset = $offset < 0 ? $offset + $numParts : $offset; diff --git a/vendor/nikic/php-parser/lib/PhpParser/Node/Param.php b/vendor/nikic/php-parser/lib/PhpParser/Node/Param.php index 1e90b794..dfb77f62 100644 --- a/vendor/nikic/php-parser/lib/PhpParser/Node/Param.php +++ b/vendor/nikic/php-parser/lib/PhpParser/Node/Param.php @@ -34,7 +34,7 @@ class Param extends NodeAbstract * @param AttributeGroup[] $attrGroups PHP attribute groups */ public function __construct( - $var, Expr $default = null, $type = null, + $var, ?Expr $default = null, $type = null, bool $byRef = false, bool $variadic = false, array $attributes = [], int $flags = 0, diff --git a/vendor/nikic/php-parser/lib/PhpParser/Node/Scalar/String_.php b/vendor/nikic/php-parser/lib/PhpParser/Node/Scalar/String_.php index 6690a16b..df2f6c1b 100644 --- a/vendor/nikic/php-parser/lib/PhpParser/Node/Scalar/String_.php +++ b/vendor/nikic/php-parser/lib/PhpParser/Node/Scalar/String_.php @@ -120,7 +120,7 @@ class String_ extends Scalar } elseif ('u' === $str[0]) { return self::codePointToUtf8(hexdec($matches[2])); } else { - return chr(octdec($str)); + return chr(octdec($str) & 255); } }, $str diff --git a/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/Break_.php b/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/Break_.php index 6adc5a6c..d9464a1a 100644 --- a/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/Break_.php +++ b/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/Break_.php @@ -15,7 +15,7 @@ class Break_ extends Node\Stmt * @param null|Node\Expr $num Number of loops to break * @param array $attributes Additional attributes */ - public function __construct(Node\Expr $num = null, array $attributes = []) { + public function __construct(?Node\Expr $num = null, array $attributes = []) { $this->attributes = $attributes; $this->num = $num; } diff --git a/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/Catch_.php b/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/Catch_.php index 9b9c0947..5d7b5c01 100644 --- a/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/Catch_.php +++ b/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/Catch_.php @@ -23,7 +23,7 @@ class Catch_ extends Node\Stmt * @param array $attributes Additional attributes */ public function __construct( - array $types, Expr\Variable $var = null, array $stmts = [], array $attributes = [] + array $types, ?Expr\Variable $var = null, array $stmts = [], array $attributes = [] ) { $this->attributes = $attributes; $this->types = $types; diff --git a/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/ClassConst.php b/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/ClassConst.php index 1fc7f336..8abaad6d 100644 --- a/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/ClassConst.php +++ b/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/ClassConst.php @@ -10,31 +10,36 @@ class ClassConst extends Node\Stmt public $flags; /** @var Node\Const_[] Constant declarations */ public $consts; - /** @var Node\AttributeGroup[] */ + /** @var Node\AttributeGroup[] PHP attribute groups */ public $attrGroups; + /** @var Node\Identifier|Node\Name|Node\ComplexType|null Type declaration */ + public $type; /** * Constructs a class const list node. * - * @param Node\Const_[] $consts Constant declarations - * @param int $flags Modifiers - * @param array $attributes Additional attributes - * @param Node\AttributeGroup[] $attrGroups PHP attribute groups + * @param Node\Const_[] $consts Constant declarations + * @param int $flags Modifiers + * @param array $attributes Additional attributes + * @param Node\AttributeGroup[] $attrGroups PHP attribute groups + * @param null|string|Node\Identifier|Node\Name|Node\ComplexType $type Type declaration */ public function __construct( array $consts, int $flags = 0, array $attributes = [], - array $attrGroups = [] + array $attrGroups = [], + $type = null ) { $this->attributes = $attributes; $this->flags = $flags; $this->consts = $consts; $this->attrGroups = $attrGroups; + $this->type = \is_string($type) ? new Node\Identifier($type) : $type; } public function getSubNodeNames() : array { - return ['attrGroups', 'flags', 'consts']; + return ['attrGroups', 'flags', 'type', 'consts']; } /** diff --git a/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/Continue_.php b/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/Continue_.php index 24882683..f2b30d79 100644 --- a/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/Continue_.php +++ b/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/Continue_.php @@ -15,7 +15,7 @@ class Continue_ extends Node\Stmt * @param null|Node\Expr $num Number of loops to continue * @param array $attributes Additional attributes */ - public function __construct(Node\Expr $num = null, array $attributes = []) { + public function __construct(?Node\Expr $num = null, array $attributes = []) { $this->attributes = $attributes; $this->num = $num; } diff --git a/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/Declare_.php b/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/Declare_.php index f46ff0ba..a3a5bfaa 100644 --- a/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/Declare_.php +++ b/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/Declare_.php @@ -18,7 +18,7 @@ class Declare_ extends Node\Stmt * @param Node\Stmt[]|null $stmts Statements * @param array $attributes Additional attributes */ - public function __construct(array $declares, array $stmts = null, array $attributes = []) { + public function __construct(array $declares, ?array $stmts = null, array $attributes = []) { $this->attributes = $attributes; $this->declares = $declares; $this->stmts = $stmts; diff --git a/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/EnumCase.php b/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/EnumCase.php index 5beff8b3..4b1079bc 100644 --- a/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/EnumCase.php +++ b/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/EnumCase.php @@ -20,7 +20,7 @@ class EnumCase extends Node\Stmt * @param AttributeGroup[] $attrGroups PHP attribute groups * @param array $attributes Additional attributes */ - public function __construct($name, Node\Expr $expr = null, array $attrGroups = [], array $attributes = []) { + public function __construct($name, ?Node\Expr $expr = null, array $attrGroups = [], array $attributes = []) { parent::__construct($attributes); $this->name = \is_string($name) ? new Node\Identifier($name) : $name; $this->expr = $expr; diff --git a/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/Namespace_.php b/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/Namespace_.php index c6320457..fc249161 100644 --- a/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/Namespace_.php +++ b/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/Namespace_.php @@ -22,7 +22,7 @@ class Namespace_ extends Node\Stmt * @param null|Node\Stmt[] $stmts Statements * @param array $attributes Additional attributes */ - public function __construct(Node\Name $name = null, $stmts = [], array $attributes = []) { + public function __construct(?Node\Name $name = null, $stmts = [], array $attributes = []) { $this->attributes = $attributes; $this->name = $name; $this->stmts = $stmts; diff --git a/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/PropertyProperty.php b/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/PropertyProperty.php index 205731e2..286b4296 100644 --- a/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/PropertyProperty.php +++ b/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/PropertyProperty.php @@ -18,7 +18,7 @@ class PropertyProperty extends Node\Stmt * @param null|Node\Expr $default Default value * @param array $attributes Additional attributes */ - public function __construct($name, Node\Expr $default = null, array $attributes = []) { + public function __construct($name, ?Node\Expr $default = null, array $attributes = []) { $this->attributes = $attributes; $this->name = \is_string($name) ? new Node\VarLikeIdentifier($name) : $name; $this->default = $default; diff --git a/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/Return_.php b/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/Return_.php index efc578c5..53731254 100644 --- a/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/Return_.php +++ b/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/Return_.php @@ -15,7 +15,7 @@ class Return_ extends Node\Stmt * @param null|Node\Expr $expr Expression * @param array $attributes Additional attributes */ - public function __construct(Node\Expr $expr = null, array $attributes = []) { + public function __construct(?Node\Expr $expr = null, array $attributes = []) { $this->attributes = $attributes; $this->expr = $expr; } diff --git a/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/StaticVar.php b/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/StaticVar.php index 29584560..0cc47b41 100644 --- a/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/StaticVar.php +++ b/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/StaticVar.php @@ -20,7 +20,7 @@ class StaticVar extends Node\Stmt * @param array $attributes Additional attributes */ public function __construct( - Expr\Variable $var, Node\Expr $default = null, array $attributes = [] + Expr\Variable $var, ?Node\Expr $default = null, array $attributes = [] ) { $this->attributes = $attributes; $this->var = $var; diff --git a/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/TryCatch.php b/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/TryCatch.php index 7fc158c5..74e00438 100644 --- a/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/TryCatch.php +++ b/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/TryCatch.php @@ -21,7 +21,7 @@ class TryCatch extends Node\Stmt * @param null|Finally_ $finally Optional finally node * @param array $attributes Additional attributes */ - public function __construct(array $stmts, array $catches, Finally_ $finally = null, array $attributes = []) { + public function __construct(array $stmts, array $catches, ?Finally_ $finally = null, array $attributes = []) { $this->attributes = $attributes; $this->stmts = $stmts; $this->catches = $catches; diff --git a/vendor/nikic/php-parser/lib/PhpParser/NodeDumper.php b/vendor/nikic/php-parser/lib/PhpParser/NodeDumper.php index ba622efd..e0c7f783 100644 --- a/vendor/nikic/php-parser/lib/PhpParser/NodeDumper.php +++ b/vendor/nikic/php-parser/lib/PhpParser/NodeDumper.php @@ -39,7 +39,7 @@ class NodeDumper * * @return string Dumped value */ - public function dump($node, string $code = null) : string { + public function dump($node, ?string $code = null) : string { $this->code = $code; return $this->dumpRecursive($node); } diff --git a/vendor/nikic/php-parser/lib/PhpParser/NodeVisitor/NameResolver.php b/vendor/nikic/php-parser/lib/PhpParser/NodeVisitor/NameResolver.php index d0e7de02..dd2e9ca7 100644 --- a/vendor/nikic/php-parser/lib/PhpParser/NodeVisitor/NameResolver.php +++ b/vendor/nikic/php-parser/lib/PhpParser/NodeVisitor/NameResolver.php @@ -35,7 +35,7 @@ class NameResolver extends NodeVisitorAbstract * @param ErrorHandler|null $errorHandler Error handler * @param array $options Options */ - public function __construct(ErrorHandler $errorHandler = null, array $options = []) { + public function __construct(?ErrorHandler $errorHandler = null, array $options = []) { $this->nameContext = new NameContext($errorHandler ?? new ErrorHandler\Throwing); $this->preserveOriginalNames = $options['preserveOriginalNames'] ?? false; $this->replaceNodes = $options['replaceNodes'] ?? true; @@ -118,6 +118,9 @@ class NameResolver extends NodeVisitorAbstract $this->addNamespacedName($const); } } else if ($node instanceof Stmt\ClassConst) { + if (null !== $node->type) { + $node->type = $this->resolveType($node->type); + } $this->resolveAttrGroups($node); } else if ($node instanceof Stmt\EnumCase) { $this->resolveAttrGroups($node); @@ -161,7 +164,7 @@ class NameResolver extends NodeVisitorAbstract return null; } - private function addAlias(Stmt\UseUse $use, int $type, Name $prefix = null) { + private function addAlias(Stmt\UseUse $use, int $type, ?Name $prefix = null) { // Add prefix for group uses $name = $prefix ? Name::concat($prefix, $use->name) : $use->name; // Type is determined either by individual element or whole use declaration diff --git a/vendor/nikic/php-parser/lib/PhpParser/Parser.php b/vendor/nikic/php-parser/lib/PhpParser/Parser.php index 8956c767..7236c68e 100644 --- a/vendor/nikic/php-parser/lib/PhpParser/Parser.php +++ b/vendor/nikic/php-parser/lib/PhpParser/Parser.php @@ -14,5 +14,5 @@ interface Parser * @return Node\Stmt[]|null Array of statements (or null non-throwing error handler is used and * the parser was unable to recover from an error). */ - public function parse(string $code, ErrorHandler $errorHandler = null); + public function parse(string $code, ?ErrorHandler $errorHandler = null); } diff --git a/vendor/nikic/php-parser/lib/PhpParser/Parser/Multiple.php b/vendor/nikic/php-parser/lib/PhpParser/Parser/Multiple.php index 77fd1f3f..083ff465 100644 --- a/vendor/nikic/php-parser/lib/PhpParser/Parser/Multiple.php +++ b/vendor/nikic/php-parser/lib/PhpParser/Parser/Multiple.php @@ -24,7 +24,7 @@ class Multiple implements Parser $this->parsers = $parsers; } - public function parse(string $code, ErrorHandler $errorHandler = null) { + public function parse(string $code, ?ErrorHandler $errorHandler = null) { if (null === $errorHandler) { $errorHandler = new ErrorHandler\Throwing; } diff --git a/vendor/nikic/php-parser/lib/PhpParser/Parser/Php5.php b/vendor/nikic/php-parser/lib/PhpParser/Parser/Php5.php index 351db9ed..80ebdfb3 100644 --- a/vendor/nikic/php-parser/lib/PhpParser/Parser/Php5.php +++ b/vendor/nikic/php-parser/lib/PhpParser/Parser/Php5.php @@ -27,7 +27,7 @@ class Php5 extends \PhpParser\ParserAbstract protected $unexpectedTokenRule = 32767; protected $YY2TBLSTATE = 415; - protected $numNonLeafStates = 663; + protected $numNonLeafStates = 664; protected $symbolToName = array( "EOF", @@ -244,116 +244,116 @@ class Php5 extends \PhpParser\ParserAbstract ); protected $action = array( - 700, 670, 671, 672, 673, 674, 286, 675, 676, 677, - 713, 714, 223, 224, 225, 226, 227, 228, 229, 230, + 701, 671, 672, 673, 674, 675, 286, 676, 677, 678, + 714, 715, 223, 224, 225, 226, 227, 228, 229, 230, 231, 232, 0, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244,-32766,-32766,-32766,-32766,-32766, -32766,-32766,-32766,-32766,-32767,-32767,-32767,-32767, 245, 246, - 242, 243, 244,-32766,-32766, 678,-32766,-32766,-32766,-32766, - -32766,-32766,-32766,-32766,-32766, 1229, 245, 246, 1230, 679, - 680, 681, 682, 683, 684, 685, 899, 900, 747,-32766, - -32766,-32766,-32766,-32766,-32766, 686, 687, 688, 689, 690, - 691, 692, 693, 694, 695, 696, 716, 739, 717, 718, - 719, 720, 708, 709, 710, 738, 711, 712, 697, 698, - 699, 701, 702, 703, 741, 742, 743, 744, 745, 746, - 875, 704, 705, 706, 707, 737, 728, 726, 727, 723, - 724, 1046, 715, 721, 722, 729, 730, 732, 731, 733, - 734, 55, 56, 425, 57, 58, 725, 736, 735, 755, + 242, 243, 244,-32766,-32766, 679,-32766,-32766,-32766,-32766, + -32766,-32766,-32766,-32766,-32766, 1230, 245, 246, 1231, 680, + 681, 682, 683, 684, 685, 686, 900, 901, 748,-32766, + -32766,-32766,-32766,-32766,-32766, 687, 688, 689, 690, 691, + 692, 693, 694, 695, 696, 697, 717, 740, 718, 719, + 720, 721, 709, 710, 711, 739, 712, 713, 698, 699, + 700, 702, 703, 704, 742, 743, 744, 745, 746, 747, + 876, 705, 706, 707, 708, 738, 729, 727, 728, 724, + 725, 1047, 716, 722, 723, 730, 731, 733, 732, 734, + 735, 55, 56, 425, 57, 58, 726, 737, 736, 756, 59, 60, -226, 61,-32766,-32766,-32766,-32766,-32766,-32766, -32766,-32766,-32766,-32766, 337,-32767,-32767,-32767,-32767, 29, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, - 117, 118, 119, 620,-32766,-32766,-32766,-32766, 62, 63, - 1046,-32766,-32766,-32766, 64, 419, 65, 294, 295, 66, - 67, 68, 69, 70, 71, 72, 73, 823, 25, 302, - 74, 418, 984, 986, 669, 668, 1100, 1101, 1078, 755, - 755, 767, 1220, 768, 470,-32766,-32766,-32766, 341, 749, - 824, 54,-32767,-32767,-32767,-32767, 98, 99, 100, 101, - 102, 220, 221, 222, 362, 876,-32766, 27,-32766,-32766, - -32766,-32766,-32766, 1046, 493, 126, 1080, 1079, 1081, 370, - 1068, 930, 207, 478, 479, 952, 953, 954, 951, 950, - 949, 128, 480, 481, 803, 1106, 1107, 1108, 1109, 1103, - 1104, 319, 32, 297, 10, 211, -515, 1110, 1105, 669, - 668, 1080, 1079, 1081, 220, 221, 222, 41, 364, 341, - 334, 421, 336, 426, -128, -128, -128, 313, 1046, 469, - -4, 824, 54, 812, 770, 207, 40, 21, 427, -128, - 471, -128, 472, -128, 473, -128, 1046, 428, 220, 221, + 117, 118, 119, 621,-32766,-32766,-32766,-32766, 62, 63, + 1047,-32766,-32766,-32766, 64, 419, 65, 294, 295, 66, + 67, 68, 69, 70, 71, 72, 73, 824, 25, 302, + 74, 418, 985, 987, 670, 669, 1101, 1102, 1079, 756, + 756, 768, 1221, 769, 470,-32766,-32766,-32766, 341, 750, + 825, 54,-32767,-32767,-32767,-32767, 98, 99, 100, 101, + 102, 220, 221, 222, 362, 877,-32766, 27,-32766,-32766, + -32766,-32766,-32766, 1047, 492, 126, 1081, 1080, 1082, 370, + 1069, 931, 207, 478, 479, 953, 954, 955, 952, 951, + 950, 128, 480, 481, 804, 1107, 1108, 1109, 1110, 1104, + 1105, 319, 32, 297, 10, 211, -515, 1111, 1106, 670, + 669, 1081, 1080, 1082, 220, 221, 222, 41, 364, 341, + 334, 421, 336, 426, -128, -128, -128, 313, 1047, 469, + -4, 825, 54, 813, 597, 207, 40, 21, 427, -128, + 471, -128, 472, -128, 473, -128, 1047, 428, 220, 221, 222,-32766, 33, 34, 429, 361, 327, 52, 35, 474, -32766,-32766,-32766, 342, 357, 358, 475, 476, 48, 207, - 249, 669, 668, 477, 443, 300, 795, 846, 430, 431, - 28,-32766, 814,-32766,-32766,-32766,-32766,-32766,-32766,-32766, - -32767,-32767,-32767,-32767,-32767, 952, 953, 954, 951, 950, - 949, 422, 755, 424, 426, 826, 634, -128,-32766,-32766, - 469, 824, 54, 288, 812, 1151, 755, 40, 21, 427, - 317, 471, 345, 472, 129, 473, 9, 1186, 428, 769, - 360, 324, 905, 33, 34, 429, 361, 1046, 415, 35, - 474, 944, 1068, 315, 125, 357, 358, 475, 476,-32766, - -32766,-32766, 926, 302, 477, 121, 1068, 759, 846, 430, - 431, 669, 668, 423, 755, 1152, 809, 1046, 480, 766, - -32766, 805,-32766,-32766,-32766,-32766, -261, 127, 347, 436, - 841, 341, 1078, 1200, 426, 446, 826, 634, -4, 807, - 469, 824, 54, 436, 812, 341, 755, 40, 21, 427, - 444, 471, 130, 472, 1068, 473, 346, 767, 428, 768, - -211, -211, -211, 33, 34, 429, 361, 308, 1076, 35, - 474,-32766,-32766,-32766, 1046, 357, 358, 475, 476,-32766, - -32766,-32766, 906, 120, 477, 539, 1068, 795, 846, 430, - 431, 436,-32766, 341,-32766,-32766,-32766, 1046, 480, 810, - -32766, 925,-32766,-32766, 754, 1080, 1079, 1081, 49,-32766, - -32766,-32766, 749, 751, 426, 1201, 826, 634, -211, 30, - 469, 669, 668, 436, 812, 341, 75, 40, 21, 427, - -32766, 471, 1064, 472, 124, 473, 669, 668, 428, 212, - -210, -210, -210, 33, 34, 429, 361, 51, 1186, 35, - 474, 755,-32766,-32766,-32766, 357, 358, 475, 476, 213, - 824, 54, 221, 222, 477, 20, 581, 795, 846, 430, - 431, 220, 221, 222, 755, 222, 247, 78, 79, 80, - 81, 341, 207, 517, 103, 104, 105, 752, 307, 131, - 637, 1068, 207, 341, 207, 122, 826, 634, -210, 36, + 249, 670, 669, 477, 443, 300, 796, 847, 430, 431, + 28,-32766, 815,-32766,-32766,-32766,-32766,-32766,-32766,-32766, + -32767,-32767,-32767,-32767,-32767, 953, 954, 955, 952, 951, + 950, 422, 756, 424, 426, 827, 635, -128,-32766,-32766, + 469, 825, 54, 288, 813, 1152, 756, 40, 21, 427, + 317, 471, 345, 472, 129, 473, 9, 1187, 428, 612, + 360, 324, 906, 33, 34, 429, 361, 1047, 415, 35, + 474, 945, 1069, 315, 125, 357, 358, 475, 476,-32766, + -32766,-32766, 927, 302, 477, 121, 1069, 760, 847, 430, + 431, 670, 669, 423, 756, 1153, 810, 1047, 480, 767, + -32766, 806,-32766,-32766,-32766,-32766, -261, 127, 347, 436, + 842, 341, 1079, 1201, 426, 446, 827, 635, -4, 808, + 469, 825, 54, 436, 813, 341, 756, 40, 21, 427, + 444, 471, 130, 472, 1069, 473, 346, 768, 428, 769, + -211, -211, -211, 33, 34, 429, 361, 308, 1077, 35, + 474,-32766,-32766,-32766, 1047, 357, 358, 475, 476,-32766, + -32766,-32766, 907, 120, 477, 538, 1069, 796, 847, 430, + 431, 436,-32766, 341,-32766,-32766,-32766, 1047, 480, 811, + -32766, 926,-32766,-32766, 755, 1081, 1080, 1082, 49,-32766, + -32766,-32766, 750, 752, 426, 1202, 827, 635, -211, 30, + 469, 670, 669, 436, 813, 341, 75, 40, 21, 427, + -32766, 471, 1065, 472, 124, 473, 670, 669, 428, 212, + -210, -210, -210, 33, 34, 429, 361, 51, 1187, 35, + 474, 756,-32766,-32766,-32766, 357, 358, 475, 476, 213, + 825, 54, 221, 222, 477, 20, 580, 796, 847, 430, + 431, 220, 221, 222, 756, 222, 247, 78, 79, 80, + 81, 341, 207, 516, 103, 104, 105, 753, 307, 131, + 638, 1069, 207, 341, 207, 122, 827, 635, -210, 36, 106, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, - 101, 102, 103, 104, 105, 1112, 307, 346, 436, 214, - 341, 824, 54, 426, 123, 250, 129, 134, 106, 469, - -32766, 572, 1112, 812, 245, 246, 40, 21, 427, 251, - 471, 252, 472, 341, 473, 453, 22, 428, 207, 899, - 900, 638, 33, 34, 429, 824, 54, -86, 35, 474, + 101, 102, 103, 104, 105, 1113, 307, 346, 436, 214, + 341, 825, 54, 426, 123, 250, 129, 134, 106, 469, + -32766, 571, 1113, 813, 245, 246, 40, 21, 427, 251, + 471, 252, 472, 341, 473, 453, 22, 428, 207, 900, + 901, 639, 33, 34, 429, 825, 54, -86, 35, 474, 220, 221, 222, 314, 357, 358, 100, 101, 102, 239, - 240, 241, 645, 477, -230, 458, 589, 135, 374, 596, - 597, 207, 760, 640, 648, 642, 941, 654, 929, 662, - 822, 133, 307, 837, 426,-32766, 106, 749, 43, 44, - 469, 45, 442, 46, 812, 826, 634, 40, 21, 427, + 240, 241, 646, 477, -230, 458, 588, 135, 374, 595, + 596, 207, 761, 641, 649, 643, 942, 655, 930, 663, + 823, 133, 307, 838, 426,-32766, 106, 750, 43, 44, + 469, 45, 442, 46, 813, 827, 635, 40, 21, 427, 47, 471, 50, 472, 53, 473, 132, 608, 428, 302, - 604, -280,-32766, 33, 34, 429, 824, 54, 426, 35, - 474, 755, 957, -84, 469, 357, 358, 521, 812, 628, - 363, 40, 21, 427, 477, 471, 575, 472, -515, 473, - 847, 616, 428, -423,-32766, 11, 646, 33, 34, 429, - 824, 54, 445, 35, 474, 462, 285, 578, 1111, 357, - 358, 593, 369, 848, 594, 290, 826, 634, 477, 0, - 0, 532, 0, 0, 325, 0, 0, 0, 0, 0, - 651, 0, 0, 0, 322, 326, 0, 0, 0, 426, - 0, 0, 0, 0, 323, 469, 316, 318, -516, 812, - 862, 634, 40, 21, 427, 0, 471, 0, 472, 0, - 473, 1158, 0, 428, 0, -414, 6, 7, 33, 34, - 429, 824, 54, 426, 35, 474, 12, 14, 373, 469, - 357, 358, -424, 812, 563, 754, 40, 21, 427, 477, - 471, 248, 472, 839, 473, 38, 39, 428, 657, 658, - 765, 813, 33, 34, 429, 821, 800, 815, 35, 474, - 215, 216, 878, 869, 357, 358, 217, 870, 218, 798, - 863, 826, 634, 477, 860, 858, 936, 937, 934, 820, - 209, 804, 806, 808, 811, 933, 763, 764, 1100, 1101, - 935, 659, 78, 335, 426, 359, 1102, 635, 639, 641, - 469, 643, 644, 647, 812, 826, 634, 40, 21, 427, - 649, 471, 650, 472, 652, 473, 653, 636, 428, 796, - 1226, 1228, 762, 33, 34, 429, 215, 216, 845, 35, - 474, 761, 217, 844, 218, 357, 358, 1227, 843, 1060, - 831, 1048, 842, 1049, 477, 559, 209, 1106, 1107, 1108, - 1109, 1103, 1104, 398, 1100, 1101, 829, 942, 867, 1110, - 1105, 868, 1102, 457, 1225, 1194, 1192, 1177, 1157, 219, - 1190, 1091, 917, 1198, 1188, 0, 826, 634, 24, -433, - 26, 31, 37, 42, 76, 77, 210, 287, 292, 293, + 604, -280,-32766, 33, 34, 429, 825, 54, 426, 35, + 474, 756, 958, -84, 469, 357, 358, 520, 813, 629, + 363, 40, 21, 427, 477, 471, 574, 472, -515, 473, + 848, 617, 428, -423,-32766, 11, 647, 33, 34, 429, + 825, 54, 445, 35, 474, 462, 285, 577, 1112, 357, + 358, 592, 369, 849, 593, 290, 827, 635, 477, 0, + 0, 531, 0, 0, 325, 0, 0, 0, 0, 0, + 652, 0, 0, 0, 322, 326, 0, 0, 0, 426, + 0, 0, 0, 0, 323, 469, 316, 318, -516, 813, + 863, 635, 40, 21, 427, 0, 471, 0, 472, 0, + 473, 1159, 0, 428, 0, -414, 6, 7, 33, 34, + 429, 825, 54, 426, 35, 474, 12, 14, 373, 469, + 357, 358, -424, 813, 562, 755, 40, 21, 427, 477, + 471, 248, 472, 840, 473, 38, 39, 428, 658, 659, + 814, 822, 33, 34, 429, 801, 816, 879, 35, 474, + 215, 216, 870, 871, 357, 358, 217, 771, 218, 799, + 864, 827, 635, 477, 770, 861, 859, 937, 938, 935, + 209, 821, 805, 807, 809, 812, 934, 764, 1101, 1102, + 765, 936, 24, 78, 426, 335, 1103, 359, 636, 640, + 469, 642, 644, 645, 813, 827, 635, 40, 21, 427, + 648, 471, 650, 472, 651, 473, 653, 654, 428, 637, + 26, 660, 797, 33, 34, 429, 215, 216, 1227, 35, + 474, 1229, 217, 763, 218, 357, 358, 846, 762, 845, + 1228, 844, 1061, 832, 477, 558, 209, 1107, 1108, 1109, + 1110, 1104, 1105, 398, 1101, 1102, 1049, 843, 1050, 1111, + 1106, 830, 1103, 943, 868, 869, 457, 1226, 1158, 219, + 1195, 1193, 1178, 1191, 1092, 918, 827, 635, 31, 1199, + 1189, 1056, 37, 42, 76, 77, 210, 287, 292, 293, 308, 309, 310, 311, 339, 356, 416, 0, -227, -226, - 16, 17, 18, 393, 454, 461, 463, 467, 553, 625, - 1051, 559, 1054, 1106, 1107, 1108, 1109, 1103, 1104, 398, - 907, 1116, 1050, 1026, 564, 1110, 1105, 1025, 1093, 1055, - 0, 1044, 0, 1057, 1056, 219, 1059, 1058, 1075, 0, - 1191, 1176, 1172, 1189, 1090, 1223, 1117, 1171, 600 + 16, 17, 18, 393, 454, 461, 463, 467, 552, 626, + 1052, 558, 1055, 1107, 1108, 1109, 1110, 1104, 1105, 398, + 908, 1117, 1051, 1027, 563, 1111, 1106, 1026, 1094, 1058, + 0, -433, 1045, 0, 1057, 219, 1060, 1059, 1076, 0, + 1192, 1177, 1173, 1190, 1091, 1224, 1118, 1172, 600 ); protected $actionCheck = array( @@ -451,26 +451,26 @@ class Php5 extends \PhpParser\ParserAbstract 50, 51, 156, 156, 115, 116, 56, 156, 58, 156, 156, 156, 157, 124, 156, 156, 156, 156, 156, 156, 70, 156, 156, 156, 156, 156, 156, 156, 78, 79, - 156, 158, 157, 157, 74, 157, 86, 157, 157, 157, + 156, 156, 159, 157, 74, 157, 86, 157, 157, 157, 80, 157, 157, 157, 84, 156, 157, 87, 88, 89, - 157, 91, 157, 93, 157, 95, 157, 157, 98, 158, - 158, 158, 158, 103, 104, 105, 50, 51, 158, 109, + 157, 91, 157, 93, 157, 95, 157, 157, 98, 157, + 159, 158, 158, 103, 104, 105, 50, 51, 158, 109, 110, 158, 56, 158, 58, 115, 116, 158, 158, 158, 158, 158, 158, 158, 124, 135, 70, 137, 138, 139, 140, 141, 142, 143, 78, 79, 158, 158, 158, 149, 150, 158, 86, 158, 158, 158, 158, 158, 164, 159, - 158, 158, 158, 158, 158, -1, 156, 157, 159, 162, - 159, 159, 159, 159, 159, 159, 159, 159, 159, 159, + 158, 158, 158, 158, 158, 158, 156, 157, 159, 158, + 158, 163, 159, 159, 159, 159, 159, 159, 159, 159, 159, 159, 159, 159, 159, 159, 159, -1, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 135, 160, 137, 138, 139, 140, 141, 142, 143, 160, 160, 160, 160, 160, 149, 150, 160, 160, 163, - -1, 162, -1, 163, 163, 159, 163, 163, 163, -1, + -1, 162, 162, -1, 163, 159, 163, 163, 163, -1, 163, 163, 163, 163, 163, 163, 163, 163, 163 ); protected $actionBase = array( - 0, 229, 310, 390, 470, 103, 325, 325, 784, -2, + 0, 229, 310, 390, 470, 103, 325, 325, 785, -2, -2, 149, -2, -2, -2, 660, 765, 799, 765, 589, 694, 870, 870, 870, 252, 404, 404, 404, 514, 177, 177, 918, 434, 118, 295, 313, 240, 491, 491, 491, @@ -483,9 +483,9 @@ class Php5 extends \PhpParser\ParserAbstract 491, 491, 491, 491, 491, 491, 491, 491, 491, 491, 491, 491, 491, 491, 491, 491, 491, 491, 491, 491, 491, 491, 491, 491, 491, 491, 491, 491, 491, 491, - 491, 491, 491, 491, 491, 491, 89, 206, 773, 550, - 535, 775, 776, 777, 912, 709, 913, 856, 857, 700, - 858, 859, 862, 863, 864, 855, 865, 935, 866, 599, + 491, 491, 491, 491, 491, 491, 89, 206, 775, 550, + 535, 776, 777, 778, 912, 709, 913, 859, 862, 700, + 863, 864, 865, 866, 867, 858, 871, 935, 872, 599, 599, 599, 599, 599, 599, 599, 599, 599, 599, 599, 599, 322, 592, 285, 319, 232, 44, 691, 691, 691, 691, 691, 691, 691, 182, 182, 182, 182, 182, 182, @@ -504,43 +504,44 @@ class Php5 extends \PhpParser\ParserAbstract 554, 554, 679, -59, -59, 381, 462, 462, 462, 528, 717, 854, 382, 382, 382, 382, 382, 382, 561, 561, 561, -3, -3, -3, 692, 115, 137, 115, 137, 678, - 732, 450, 732, 338, 677, -15, 510, 810, 468, 707, - 850, 711, 853, 572, 735, 267, 529, 654, 674, 463, + 732, 450, 732, 338, 677, -15, 510, 812, 468, 707, + 856, 711, 857, 572, 735, 267, 529, 654, 674, 463, 529, 529, 529, 529, 654, 610, 640, 608, 463, 529, - 463, 718, 323, 496, 89, 570, 507, 675, 778, 293, - 670, 780, 290, 373, 332, 566, 278, 435, 733, 781, + 463, 718, 323, 496, 89, 570, 507, 675, 779, 293, + 670, 781, 290, 373, 332, 566, 278, 435, 733, 784, 914, 917, 385, 715, 675, 675, 675, 352, 511, 278, -8, 605, 605, 605, 605, 156, 605, 605, 605, 605, - 251, 276, 375, 402, 779, 657, 657, 690, 872, 869, - 869, 657, 689, 657, 690, 874, 874, 874, 874, 657, - 657, 657, 657, 869, 869, 869, 688, 869, 239, 703, - 704, 704, 874, 742, 743, 657, 657, 712, 869, 869, - 869, 712, 695, 874, 701, 741, 277, 869, 874, 672, + 251, 276, 375, 402, 780, 657, 657, 690, 869, 783, + 783, 657, 689, 657, 690, 874, 874, 874, 874, 657, + 657, 657, 657, 783, 783, 783, 688, 783, 239, 703, + 704, 704, 874, 742, 743, 657, 657, 712, 783, 783, + 783, 712, 695, 874, 701, 741, 277, 783, 874, 672, 689, 672, 657, 701, 672, 689, 689, 672, 22, 666, - 668, 873, 875, 887, 790, 662, 685, 879, 880, 876, - 878, 871, 699, 744, 745, 497, 669, 671, 673, 680, - 719, 682, 713, 674, 667, 667, 667, 655, 720, 655, - 667, 667, 667, 667, 667, 667, 667, 667, 916, 646, - 731, 714, 653, 749, 553, 573, 791, 664, 811, 900, - 893, 867, 919, 881, 898, 655, 920, 739, 247, 643, - 882, 783, 786, 655, 883, 655, 792, 655, 902, 812, - 686, 813, 814, 667, 910, 921, 923, 924, 925, 927, - 928, 929, 930, 684, 931, 750, 696, 894, 299, 877, - 718, 729, 705, 788, 751, 820, 328, 932, 823, 655, - 655, 794, 785, 655, 795, 756, 740, 890, 757, 895, - 933, 664, 708, 896, 655, 706, 825, 934, 328, 681, - 683, 888, 661, 761, 886, 911, 885, 796, 649, 663, - 829, 830, 831, 693, 763, 891, 892, 889, 764, 803, - 665, 805, 697, 832, 807, 884, 768, 833, 834, 899, - 676, 730, 710, 698, 687, 809, 835, 897, 769, 770, - 771, 848, 772, 849, 0, 0, 0, 0, 0, 0, + 668, 873, 875, 887, 791, 662, 685, 879, 880, 876, + 878, 811, 699, 744, 497, 669, 671, 673, 680, 719, + 682, 713, 674, 667, 667, 667, 655, 720, 655, 667, + 667, 667, 667, 667, 667, 667, 667, 868, 646, 731, + 714, 653, 745, 553, 573, 792, 664, 814, 900, 893, + 919, 920, 881, 898, 655, 916, 739, 247, 643, 882, + 813, 788, 655, 883, 655, 794, 655, 902, 820, 686, + 823, 825, 667, 910, 921, 923, 924, 925, 927, 928, + 929, 930, 684, 931, 749, 696, 894, 299, 877, 718, + 729, 705, 790, 750, 829, 328, 932, 830, 655, 655, + 795, 786, 655, 796, 751, 740, 890, 756, 895, 933, + 664, 708, 896, 655, 706, 831, 934, 328, 681, 683, + 888, 661, 757, 886, 911, 885, 803, 761, 649, 663, + 832, 833, 834, 693, 763, 891, 892, 889, 764, 805, + 665, 807, 768, 697, 835, 809, 884, 769, 848, 849, + 899, 676, 730, 710, 698, 687, 810, 850, 897, 770, + 771, 772, 853, 773, 855, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 138, 138, 138, 138, -2, -2, - -2, -2, 0, 0, -2, 0, 0, 0, 138, 138, + 0, 0, 0, 0, 0, 138, 138, 138, 138, -2, + -2, -2, -2, 0, 0, -2, 0, 0, 0, 138, 138, 138, 138, 138, 138, 138, 138, 138, 138, 138, 138, 138, 138, 138, 138, 138, 138, 138, 138, 138, - 138, 138, 138, 138, 0, 0, 138, 138, 138, 138, + 138, 138, 138, 138, 138, 0, 0, 138, 138, 138, + 138, 138, 138, 138, 138, 138, 138, 138, 138, 138, 138, 138, 138, 138, 138, 138, 138, 138, 138, 138, 138, 138, 138, 138, 138, 138, 138, 138, 138, 138, 138, 138, 138, 138, 138, 138, 138, 138, 138, 138, @@ -549,35 +550,34 @@ class Php5 extends \PhpParser\ParserAbstract 138, 138, 138, 138, 138, 138, 138, 138, 138, 138, 138, 138, 138, 138, 138, 138, 138, 138, 138, 138, 138, 138, 138, 138, 138, 138, 138, 138, 138, 138, - 138, 138, 138, 138, 138, 138, 138, 138, 138, 599, 599, 599, 599, 599, 599, 599, 599, 599, 599, 599, 599, 599, 599, 599, 599, 599, 599, 599, 599, 599, - 599, 599, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 599, -21, -21, -21, -21, 599, - -21, -21, -21, -21, -21, -21, -21, 599, 599, 599, + 599, 599, 599, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 599, -21, -21, -21, -21, + 599, -21, -21, -21, -21, -21, -21, -21, 599, 599, 599, 599, 599, 599, 599, 599, 599, 599, 599, 599, - 599, 599, 599, 599, 599, -21, 599, 599, 599, -21, - 382, -21, 382, 382, 382, 382, 382, 382, 382, 382, + 599, 599, 599, 599, 599, 599, -21, 599, 599, 599, + -21, 382, -21, 382, 382, 382, 382, 382, 382, 382, 382, 382, 382, 382, 382, 382, 382, 382, 382, 382, 382, 382, 382, 382, 382, 382, 382, 382, 382, 382, 382, 382, 382, 382, 382, 382, 382, 382, 382, 382, - 382, 382, 382, 382, 382, 382, 599, 0, 0, 599, - -21, 599, -21, 599, -21, -21, 599, 599, 599, 599, - 599, 599, 599, -21, -21, -21, -21, -21, -21, 0, - 561, 561, 561, 561, -21, -21, -21, -21, 382, 382, - 382, 382, 382, 382, 259, 382, 382, 382, 382, 382, - 382, 382, 382, 382, 382, 382, 561, 561, -3, -3, - 382, 382, 382, 382, 382, 259, 382, 382, 463, 689, - 689, 689, 137, 137, 137, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 137, 463, 0, - 463, 0, 382, 463, 689, 463, 657, 137, 689, 689, - 463, 869, 616, 616, 616, 616, 328, 278, 0, 0, - 689, 689, 0, 0, 0, 0, 0, 689, 0, 0, - 0, 0, 0, 0, 869, 0, 0, 0, 0, 0, - 667, 247, 0, 705, 335, 0, 0, 0, 0, 0, - 0, 705, 335, 347, 347, 0, 684, 667, 667, 667, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 328 + 382, 382, 382, 382, 382, 382, 382, 599, 0, 0, + 599, -21, 599, -21, 599, -21, -21, 599, 599, 599, + 599, 599, 599, 599, -21, -21, -21, -21, -21, -21, + 0, 561, 561, 561, 561, -21, -21, -21, -21, 382, + 382, 382, 382, 382, 382, 259, 382, 382, 382, 382, + 382, 382, 382, 382, 382, 382, 382, 561, 561, -3, + -3, 382, 382, 382, 382, 382, 259, 382, 382, 463, + 689, 689, 689, 137, 137, 137, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 137, 463, + 0, 463, 0, 382, 463, 689, 463, 657, 137, 689, + 689, 463, 783, 616, 616, 616, 616, 328, 278, 0, + 0, 689, 689, 0, 0, 0, 0, 0, 689, 0, + 0, 0, 0, 0, 0, 783, 0, 0, 0, 0, + 0, 667, 247, 0, 705, 335, 0, 0, 0, 0, + 0, 0, 705, 335, 347, 347, 0, 684, 667, 667, + 667, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 328 ); protected $actionDefault = array( @@ -629,90 +629,90 @@ class Php5 extends \PhpParser\ParserAbstract 32767, 190, 173,32767, 400, 175, 498,32767,32767, 240, 32767, 240,32767, 400, 240,32767,32767, 240,32767, 415, 439,32767,32767,32767,32767,32767,32767,32767,32767,32767, - 32767,32767,32767,32767,32767,32767, 379, 380, 493, 506, - 32767, 507,32767, 413, 343, 344, 346, 322,32767, 324, - 369, 370, 371, 372, 373, 374, 375, 377,32767, 419, - 32767, 422,32767,32767,32767, 257,32767, 557,32767,32767, - 306, 557,32767,32767,32767, 551,32767,32767, 300,32767, - 32767,32767,32767, 253,32767, 169,32767, 541,32767, 558, - 32767, 515,32767, 342,32767,32767,32767,32767,32767,32767, - 32767,32767,32767, 516,32767,32767,32767,32767, 229,32767, - 452,32767, 116,32767,32767,32767, 189,32767,32767, 304, - 248,32767,32767, 550,32767,32767,32767,32767,32767,32767, - 32767,32767, 114,32767, 170,32767,32767,32767, 191,32767, - 32767, 515,32767,32767,32767,32767,32767,32767,32767, 295, + 32767,32767,32767,32767,32767, 379, 380, 493, 506,32767, + 507,32767, 413, 343, 344, 346, 322,32767, 324, 369, + 370, 371, 372, 373, 374, 375, 377,32767, 419,32767, + 422,32767,32767,32767, 257,32767, 557,32767,32767, 306, + 557,32767,32767,32767, 551,32767,32767, 300,32767,32767, + 32767,32767, 253,32767, 169,32767, 541,32767, 558,32767, + 515,32767, 342,32767,32767,32767,32767,32767,32767,32767, + 32767,32767, 516,32767,32767,32767,32767, 229,32767, 452, + 32767, 116,32767,32767,32767, 189,32767,32767, 304, 248, + 32767,32767, 550,32767,32767,32767,32767,32767,32767,32767, + 32767, 114,32767, 170,32767,32767,32767, 191,32767,32767, + 515,32767,32767,32767,32767,32767,32767,32767,32767, 295, 32767,32767,32767,32767,32767,32767,32767, 515,32767,32767, 233,32767,32767,32767,32767,32767,32767,32767,32767,32767, - 415,32767, 276,32767,32767,32767,32767,32767,32767,32767, - 32767,32767,32767,32767, 127, 127, 3, 127, 127, 260, - 3, 260, 127, 260, 260, 127, 127, 127, 127, 127, - 127, 127, 127, 127, 127, 216, 219, 208, 208, 164, - 127, 127, 268 + 32767, 415,32767, 276,32767,32767,32767,32767,32767,32767, + 32767,32767,32767,32767,32767, 127, 127, 3, 127, 127, + 260, 3, 260, 127, 260, 260, 127, 127, 127, 127, + 127, 127, 127, 127, 127, 127, 216, 219, 208, 208, + 164, 127, 127, 268 ); protected $goto = array( 166, 140, 140, 140, 166, 187, 168, 144, 147, 141, 142, 143, 149, 163, 163, 163, 163, 144, 144, 165, 165, 165, 165, 165, 165, 165, 165, 165, 165, 165, - 138, 159, 160, 161, 162, 184, 139, 185, 494, 495, - 377, 496, 500, 501, 502, 503, 504, 505, 506, 507, - 970, 164, 145, 146, 148, 171, 176, 186, 203, 253, + 138, 159, 160, 161, 162, 184, 139, 185, 493, 494, + 377, 495, 499, 500, 501, 502, 503, 504, 505, 506, + 971, 164, 145, 146, 148, 171, 176, 186, 203, 253, 256, 258, 260, 263, 264, 265, 266, 267, 268, 269, 277, 278, 279, 280, 303, 304, 328, 329, 330, 394, - 395, 396, 543, 188, 189, 190, 191, 192, 193, 194, + 395, 396, 542, 188, 189, 190, 191, 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, 150, 151, 152, 167, 153, 169, 154, 204, 170, 155, 156, 157, 205, - 158, 136, 621, 561, 757, 561, 561, 561, 561, 561, - 561, 561, 561, 561, 561, 561, 561, 561, 561, 561, - 561, 561, 561, 561, 561, 561, 561, 561, 561, 561, - 561, 561, 561, 561, 561, 561, 561, 561, 561, 561, - 561, 561, 561, 561, 561, 561, 561, 561, 561, 1113, - 629, 1113, 1113, 1113, 1113, 1113, 1113, 1113, 1113, 1113, - 1113, 1113, 1113, 1113, 1113, 1113, 1113, 1113, 1113, 1113, - 1113, 1113, 1113, 1113, 1113, 1113, 1113, 1113, 1113, 1113, - 1113, 1113, 1113, 1113, 1113, 1113, 1113, 1113, 1113, 1113, - 1113, 1113, 1113, 1113, 1113, 758, 520, 531, 509, 656, - 556, 1183, 750, 509, 592, 786, 1183, 888, 612, 613, - 884, 617, 618, 624, 626, 631, 633, 817, 855, 855, - 855, 855, 850, 856, 174, 891, 891, 1205, 1205, 177, + 158, 136, 622, 560, 758, 560, 560, 560, 560, 560, + 560, 560, 560, 560, 560, 560, 560, 560, 560, 560, + 560, 560, 560, 560, 560, 560, 560, 560, 560, 560, + 560, 560, 560, 560, 560, 560, 560, 560, 560, 560, + 560, 560, 560, 560, 560, 560, 560, 560, 560, 1114, + 630, 1114, 1114, 1114, 1114, 1114, 1114, 1114, 1114, 1114, + 1114, 1114, 1114, 1114, 1114, 1114, 1114, 1114, 1114, 1114, + 1114, 1114, 1114, 1114, 1114, 1114, 1114, 1114, 1114, 1114, + 1114, 1114, 1114, 1114, 1114, 1114, 1114, 1114, 1114, 1114, + 1114, 1114, 1114, 1114, 1114, 759, 519, 530, 508, 657, + 555, 1184, 350, 508, 591, 787, 1184, 889, 613, 614, + 885, 618, 619, 625, 627, 632, 634, 751, 856, 856, + 856, 856, 851, 857, 174, 892, 892, 1206, 1206, 177, 178, 179, 401, 402, 403, 404, 173, 202, 206, 208, 257, 259, 261, 262, 270, 271, 272, 273, 274, 275, 281, 282, 283, 284, 305, 306, 331, 332, 333, 406, 407, 408, 409, 175, 180, 254, 255, 181, 182, 183, - 498, 498, 498, 498, 498, 498, 861, 498, 498, 498, - 498, 498, 498, 498, 498, 498, 498, 510, 586, 538, - 601, 602, 510, 545, 546, 547, 548, 549, 550, 551, - 552, 554, 587, 1209, 560, 350, 560, 560, 560, 560, - 560, 560, 560, 560, 560, 560, 560, 560, 560, 560, - 560, 560, 560, 560, 560, 560, 560, 560, 560, 560, - 560, 560, 560, 560, 560, 560, 560, 560, 560, 560, - 560, 560, 560, 560, 560, 560, 560, 560, 560, 560, - 400, 607, 537, 537, 569, 533, 909, 535, 535, 497, - 499, 525, 541, 570, 573, 584, 591, 298, 296, 296, - 296, 298, 289, 299, 611, 378, 511, 614, 595, 947, - 375, 511, 437, 437, 437, 437, 437, 437, 1163, 437, - 437, 437, 437, 437, 437, 437, 437, 437, 437, 1077, - 948, 338, 1175, 321, 1077, 898, 898, 898, 898, 606, - 898, 898, 1217, 1217, 1202, 753, 576, 605, 756, 1077, - 1077, 1077, 1077, 1077, 1077, 1069, 384, 384, 384, 391, - 1217, 877, 859, 857, 859, 655, 466, 512, 886, 881, - 753, 384, 753, 384, 968, 384, 895, 385, 588, 353, - 414, 384, 1231, 1019, 542, 1197, 1197, 1197, 568, 1094, - 386, 386, 386, 904, 915, 515, 1029, 19, 15, 372, - 389, 915, 940, 448, 450, 632, 340, 1216, 1216, 1114, - 615, 938, 840, 555, 775, 386, 913, 1070, 1073, 1074, - 399, 1069, 1182, 660, 23, 1216, 773, 1182, 544, 603, - 1066, 1219, 1071, 1174, 1071, 519, 1199, 1199, 1199, 1089, - 1088, 1072, 343, 523, 534, 519, 519, 772, 351, 352, - 13, 579, 583, 627, 1061, 388, 782, 562, 771, 515, - 783, 1181, 3, 4, 918, 956, 865, 451, 574, 1160, + 497, 497, 497, 497, 497, 497, 818, 497, 497, 497, + 497, 497, 497, 497, 497, 497, 497, 509, 585, 862, + 601, 602, 509, 544, 545, 546, 547, 548, 549, 550, + 551, 553, 586, 338, 559, 321, 559, 559, 559, 559, + 559, 559, 559, 559, 559, 559, 559, 559, 559, 559, + 559, 559, 559, 559, 559, 559, 559, 559, 559, 559, + 559, 559, 559, 559, 559, 559, 559, 559, 559, 559, + 559, 559, 559, 559, 559, 559, 559, 559, 559, 559, + 400, 607, 536, 536, 568, 532, 537, 534, 534, 496, + 498, 524, 540, 569, 572, 583, 590, 298, 296, 296, + 296, 298, 289, 299, 611, 1210, 510, 615, 910, 948, + 375, 510, 437, 437, 437, 437, 437, 437, 594, 437, + 437, 437, 437, 437, 437, 437, 437, 437, 437, 1078, + 949, 388, 1176, 561, 1078, 899, 899, 899, 899, 378, + 899, 899, 1218, 1218, 1164, 754, 351, 352, 757, 1078, + 1078, 1078, 1078, 1078, 1078, 1070, 384, 384, 384, 606, + 1218, 878, 860, 858, 860, 656, 466, 511, 887, 882, + 754, 384, 754, 384, 969, 384, 391, 385, 587, 353, + 414, 384, 1232, 1203, 541, 1198, 1198, 1198, 567, 1095, + 386, 386, 386, 1020, 916, 514, 1030, 19, 15, 372, + 776, 916, 941, 448, 450, 633, 896, 1217, 1217, 1115, + 616, 939, 841, 554, 905, 386, 340, 1071, 1074, 1075, + 399, 1070, 1183, 914, 23, 1217, 774, 1183, 543, 603, + 389, 1220, 1072, 1175, 1072, 518, 1200, 1200, 1200, 575, + 605, 1073, 343, 522, 533, 518, 518, 773, 1090, 1089, + 13, 578, 582, 628, 3, 4, 783, 1067, 772, 514, + 1062, 1182, 784, 661, 919, 451, 866, 573, 957, 1161, 464, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 514, 529, 0, 0, 0, 0, - 514, 0, 529, 0, 0, 0, 0, 610, 513, 516, - 439, 440, 1067, 619, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 780, 1224, 0, 0, 0, 0, - 0, 524, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 778, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 513, 528, 0, 0, 0, 0, + 513, 0, 528, 0, 0, 0, 0, 610, 512, 515, + 439, 440, 1068, 620, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 781, 1225, 0, 0, 0, 0, + 0, 523, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 779, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 301, 301 ); @@ -739,40 +739,40 @@ class Php5 extends \PhpParser\ParserAbstract 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 16, 102, 32, 69, 32, - 32, 120, 6, 69, 32, 29, 120, 32, 32, 32, - 32, 32, 32, 32, 32, 32, 32, 50, 69, 69, + 32, 120, 72, 69, 32, 29, 120, 32, 32, 32, + 32, 32, 32, 32, 32, 32, 32, 6, 69, 69, 69, 69, 69, 69, 27, 77, 77, 77, 77, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, - 119, 119, 119, 119, 119, 119, 33, 119, 119, 119, - 119, 119, 119, 119, 119, 119, 119, 119, 67, 110, + 119, 119, 119, 119, 119, 119, 50, 119, 119, 119, + 119, 119, 119, 119, 119, 119, 119, 119, 67, 33, 67, 67, 119, 111, 111, 111, 111, 111, 111, 111, - 111, 111, 111, 142, 57, 72, 57, 57, 57, 57, + 111, 111, 111, 127, 57, 127, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, - 51, 51, 51, 51, 51, 51, 84, 51, 51, 51, + 51, 51, 51, 51, 51, 51, 110, 51, 51, 51, 51, 51, 51, 51, 51, 51, 51, 5, 5, 5, - 5, 5, 5, 5, 63, 46, 124, 63, 129, 98, - 63, 124, 57, 57, 57, 57, 57, 57, 133, 57, + 5, 5, 5, 5, 63, 142, 124, 63, 84, 98, + 63, 124, 57, 57, 57, 57, 57, 57, 129, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, - 98, 127, 82, 127, 57, 57, 57, 57, 57, 49, - 57, 57, 144, 144, 140, 11, 40, 40, 14, 57, - 57, 57, 57, 57, 57, 82, 13, 13, 13, 48, + 98, 12, 82, 12, 57, 57, 57, 57, 57, 46, + 57, 57, 144, 144, 133, 11, 72, 72, 14, 57, + 57, 57, 57, 57, 57, 82, 13, 13, 13, 49, 144, 14, 14, 14, 14, 14, 57, 14, 14, 14, - 11, 13, 11, 13, 102, 13, 79, 11, 70, 70, - 70, 13, 13, 103, 2, 9, 9, 9, 2, 34, - 125, 125, 125, 81, 13, 13, 34, 34, 34, 34, - 17, 13, 8, 8, 8, 8, 18, 143, 143, 8, - 8, 8, 9, 34, 25, 125, 85, 82, 82, 82, - 125, 82, 121, 74, 34, 143, 24, 121, 47, 34, - 116, 143, 82, 82, 82, 47, 121, 121, 121, 126, - 126, 82, 58, 58, 58, 47, 47, 23, 72, 72, - 58, 62, 62, 62, 114, 12, 23, 12, 23, 13, - 26, 121, 30, 30, 86, 100, 71, 65, 66, 132, + 11, 13, 11, 13, 102, 13, 48, 11, 70, 70, + 70, 13, 13, 140, 2, 9, 9, 9, 2, 34, + 125, 125, 125, 103, 13, 13, 34, 34, 34, 34, + 25, 13, 8, 8, 8, 8, 79, 143, 143, 8, + 8, 8, 9, 34, 81, 125, 18, 82, 82, 82, + 125, 82, 121, 85, 34, 143, 24, 121, 47, 34, + 17, 143, 82, 82, 82, 47, 121, 121, 121, 40, + 40, 82, 58, 58, 58, 47, 47, 23, 126, 126, + 58, 62, 62, 62, 30, 30, 23, 116, 23, 13, + 114, 121, 26, 74, 86, 65, 71, 66, 100, 132, 109, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 9, 9, -1, -1, -1, -1, 9, -1, 9, -1, -1, -1, -1, 13, 9, 9, @@ -785,39 +785,39 @@ class Php5 extends \PhpParser\ParserAbstract ); protected $gotoBase = array( - 0, 0, -172, 0, 0, 353, 201, 0, 477, 149, - 0, 110, 195, 117, 426, 112, 203, 140, 171, 0, - 0, 0, 0, 168, 164, 157, 119, 27, 0, 205, - -118, 0, -428, 266, 51, 0, 0, 0, 0, 0, - 388, 0, 0, -24, 0, 0, 345, 484, 146, 133, - 209, 75, 0, 0, 0, 0, 0, 107, 161, 0, - 0, 0, 222, -77, 0, 106, 97, -343, 0, -94, - 135, 123, -129, 0, 129, 0, 0, -50, 0, 143, - 0, 159, 64, 0, 338, 132, 122, 0, 0, 0, + 0, 0, -173, 0, 0, 353, 216, 0, 477, 149, + 0, 110, 71, 117, 426, 112, 203, 170, 181, 0, + 0, 0, 0, 168, 164, 143, 121, 27, 0, 205, + -127, 0, -429, 279, 51, 0, 0, 0, 0, 0, + 481, 0, 0, -24, 0, 0, 379, 484, 163, 153, + 268, 75, 0, 0, 0, 0, 0, 107, 161, 0, + 0, 0, 222, -77, 0, 104, 96, -344, 0, -94, + 135, 123, -232, 0, 169, 0, 0, -50, 0, 173, + 0, 180, 64, 0, 360, 139, 122, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 98, 0, - 121, 0, 165, 156, 0, 0, 0, 0, 0, 87, - 273, 259, 0, 0, 114, 0, 150, 0, 0, -5, - -91, 200, 0, 0, 84, 154, 202, 77, -48, 178, - 0, 0, 93, 187, 0, 0, 0, 0, 0, 0, - 136, 0, 286, 167, 102, 0, 0 + 124, 0, 165, 166, 0, 0, 0, 0, 0, 87, + 340, 259, 0, 0, 120, 0, 177, 0, 0, -5, + -91, 200, 0, 0, 84, 154, 211, -21, -48, 188, + 0, 0, 93, 213, 0, 0, 0, 0, 0, 0, + 175, 0, 358, 167, 102, 0, 0 ); protected $gotoDefault = array( - -32768, 468, 664, 2, 665, 835, 740, 748, 598, 482, - 630, 582, 380, 1193, 792, 793, 794, 381, 368, 483, - 379, 410, 405, 781, 774, 776, 784, 172, 411, 787, - 1, 789, 518, 825, 1020, 365, 797, 366, 590, 799, - 527, 801, 802, 137, 382, 383, 528, 484, 390, 577, - 816, 276, 387, 818, 367, 819, 828, 371, 465, 455, - 460, 530, 557, 609, 432, 447, 571, 565, 536, 1086, - 566, 864, 349, 872, 661, 880, 883, 485, 558, 894, - 452, 902, 1099, 397, 908, 914, 919, 291, 922, 417, - 412, 585, 927, 928, 5, 932, 622, 623, 8, 312, - 955, 599, 969, 420, 1039, 1041, 486, 487, 522, 459, - 508, 526, 488, 1062, 441, 413, 1065, 433, 489, 490, - 434, 435, 1083, 355, 1168, 354, 449, 320, 1155, 580, - 1118, 456, 1208, 1164, 348, 491, 492, 376, 1187, 392, - 1203, 438, 1210, 1218, 344, 540, 567 + -32768, 468, 665, 2, 666, 836, 741, 749, 598, 482, + 631, 581, 380, 1194, 793, 794, 795, 381, 368, 766, + 379, 410, 405, 782, 775, 777, 785, 172, 411, 788, + 1, 790, 517, 826, 1021, 365, 798, 366, 589, 800, + 526, 802, 803, 137, 382, 383, 527, 483, 390, 576, + 817, 276, 387, 819, 367, 820, 829, 371, 465, 455, + 460, 529, 556, 609, 432, 447, 570, 564, 535, 1087, + 565, 865, 349, 873, 662, 881, 884, 484, 557, 895, + 452, 903, 1100, 397, 909, 915, 920, 291, 923, 417, + 412, 584, 928, 929, 5, 933, 623, 624, 8, 312, + 956, 599, 970, 420, 1040, 1042, 485, 486, 521, 459, + 507, 525, 487, 1063, 441, 413, 1066, 433, 488, 489, + 434, 435, 1084, 355, 1169, 354, 449, 320, 1156, 579, + 1119, 456, 1209, 1165, 348, 490, 491, 376, 1188, 392, + 1204, 438, 1211, 1219, 344, 539, 566 ); protected $ruleToNonTerminal = array( @@ -891,7 +891,7 @@ class Php5 extends \PhpParser\ParserAbstract 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 3, 5, 4, - 3, 4, 2, 3, 1, 1, 7, 6, 3, 1, + 3, 4, 1, 3, 1, 1, 8, 7, 3, 1, 3, 1, 3, 1, 1, 3, 1, 3, 1, 2, 3, 1, 3, 3, 1, 3, 2, 0, 1, 1, 1, 1, 1, 3, 5, 8, 3, 5, 9, 3, @@ -1256,7 +1256,7 @@ class Php5 extends \PhpParser\ParserAbstract $this->semValue = new Stmt\Use_($this->semStack[$stackPos-(4-3)], $this->semStack[$stackPos-(4-2)], $this->startAttributeStack[$stackPos-(4-1)] + $this->endAttributes); }, 102 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos-(2-1)]; + $this->semValue = $this->semStack[$stackPos-(1-1)]; }, 103 => function ($stackPos) { $this->semValue = new Stmt\Const_($this->semStack[$stackPos-(3-2)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); @@ -1268,10 +1268,10 @@ class Php5 extends \PhpParser\ParserAbstract $this->semValue = Stmt\Use_::TYPE_CONSTANT; }, 106 => function ($stackPos) { - $this->semValue = new Stmt\GroupUse($this->semStack[$stackPos-(7-3)], $this->semStack[$stackPos-(7-6)], $this->semStack[$stackPos-(7-2)], $this->startAttributeStack[$stackPos-(7-1)] + $this->endAttributes); + $this->semValue = new Stmt\GroupUse($this->semStack[$stackPos-(8-3)], $this->semStack[$stackPos-(8-6)], $this->semStack[$stackPos-(8-2)], $this->startAttributeStack[$stackPos-(8-1)] + $this->endAttributes); }, 107 => function ($stackPos) { - $this->semValue = new Stmt\GroupUse($this->semStack[$stackPos-(6-2)], $this->semStack[$stackPos-(6-5)], Stmt\Use_::TYPE_UNKNOWN, $this->startAttributeStack[$stackPos-(6-1)] + $this->endAttributes); + $this->semValue = new Stmt\GroupUse($this->semStack[$stackPos-(7-2)], $this->semStack[$stackPos-(7-5)], Stmt\Use_::TYPE_UNKNOWN, $this->startAttributeStack[$stackPos-(7-1)] + $this->endAttributes); }, 108 => function ($stackPos) { $this->semStack[$stackPos-(3-1)][] = $this->semStack[$stackPos-(3-3)]; $this->semValue = $this->semStack[$stackPos-(3-1)]; @@ -1738,7 +1738,7 @@ class Php5 extends \PhpParser\ParserAbstract $this->semValue = new Stmt\StaticVar($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); }, 259 => function ($stackPos) { - if ($this->semStack[$stackPos-(2-2)] !== null) { $this->semStack[$stackPos-(2-1)][] = $this->semStack[$stackPos-(2-2)]; $this->semValue = $this->semStack[$stackPos-(2-1)]; } + if ($this->semStack[$stackPos-(2-2)] !== null) { $this->semStack[$stackPos-(2-1)][] = $this->semStack[$stackPos-(2-2)]; $this->semValue = $this->semStack[$stackPos-(2-1)]; } else { $this->semValue = $this->semStack[$stackPos-(2-1)]; } }, 260 => function ($stackPos) { $this->semValue = array(); @@ -2627,7 +2627,7 @@ class Php5 extends \PhpParser\ParserAbstract $this->semValue = new Expr\ArrayItem($this->semStack[$stackPos-(2-2)], null, true, $this->startAttributeStack[$stackPos-(2-1)] + $this->endAttributes); }, 552 => function ($stackPos) { - $this->semValue = new Expr\ArrayItem($this->semStack[$stackPos-(2-2)], null, false, $this->startAttributeStack[$stackPos-(2-1)] + $this->endAttributes, true, $this->startAttributeStack[$stackPos-(2-1)] + $this->endAttributes); + $this->semValue = new Expr\ArrayItem($this->semStack[$stackPos-(2-2)], null, false, $this->startAttributeStack[$stackPos-(2-1)] + $this->endAttributes, true); }, 553 => function ($stackPos) { $this->semStack[$stackPos-(2-1)][] = $this->semStack[$stackPos-(2-2)]; $this->semValue = $this->semStack[$stackPos-(2-1)]; diff --git a/vendor/nikic/php-parser/lib/PhpParser/Parser/Php7.php b/vendor/nikic/php-parser/lib/PhpParser/Parser/Php7.php index c6b9abd0..d41bb836 100644 --- a/vendor/nikic/php-parser/lib/PhpParser/Parser/Php7.php +++ b/vendor/nikic/php-parser/lib/PhpParser/Parser/Php7.php @@ -18,16 +18,16 @@ use PhpParser\Node\Stmt; class Php7 extends \PhpParser\ParserAbstract { protected $tokenToSymbolMapSize = 396; - protected $actionTableSize = 1223; - protected $gotoTableSize = 626; + protected $actionTableSize = 1241; + protected $gotoTableSize = 629; protected $invalidSymbol = 168; protected $errorSymbol = 1; protected $defaultAction = -32766; protected $unexpectedTokenRule = 32767; - protected $YY2TBLSTATE = 429; - protected $numNonLeafStates = 726; + protected $YY2TBLSTATE = 435; + protected $numNonLeafStates = 737; protected $symbolToName = array( "EOF", @@ -244,262 +244,266 @@ class Php7 extends \PhpParser\ParserAbstract ); protected $action = array( - 132, 133, 134, 575, 135, 136, 0, 738, 739, 740, - 137, 37, 850, 825, 851, 476,-32766,-32766,-32766,-32767, - -32767,-32767,-32767, 101, 102, 103, 104, 105, 1097, 1098, - 1099, 1096, 1095, 1094, 1100, 732, 731,-32766, 1289,-32766, + 133, 134, 135, 580, 136, 137, 0, 749, 750, 751, + 138, 38, 327,-32766,-32766,-32766,-32766,-32766,-32766,-32767, + -32767,-32767,-32767, 102, 103, 104, 105, 106, 1110, 1111, + 1112, 1109, 1108, 1107, 1113, 743, 742,-32766, 1233,-32766, -32766,-32766,-32766,-32766,-32766,-32766,-32767,-32767,-32767,-32767, - -32767, 1022, 377, 376, 2, 741,-32766,-32766,-32766,-32766, - -32766, 822, 417,-32766,-32766,-32766,-32766,-32766,-32766, 267, - 138, 399, 745, 746, 747, 748, 287,-32766, 423,-32766, - -32766,-32766,-32766,-32766,-32766, 749, 750, 751, 752, 753, - 754, 755, 756, 757, 758, 759, 779, 576, 780, 781, - 782, 783, 771, 772, 340, 341, 774, 775, 760, 761, - 762, 764, 765, 766, 351, 806, 807, 808, 809, 810, - 577, 767, 768, 578, 579, 800, 791, 789, 790, 803, - 786, 787, -327, 423, 580, 581, 785, 582, 583, 584, - 585, 586, 587, 605, -590, 477, -86, 814, 788, 588, - 589, -590, 139,-32766,-32766,-32766, 132, 133, 134, 575, - 135, 136, 1046, 738, 739, 740, 137, 37, 323, 1013, - 823, 824, 1334, 1324,-32766, 1335,-32766,-32766,-32766,-32766, - -32766,-32766,-32766, 1097, 1098, 1099, 1096, 1095, 1094, 1100, - -587, 732, 731,-32766,-32766,-32766, 12, -587, 81,-32766, - -32766,-32766, 945, 946, 322, 927, 34, 947, 1224, 1223, - 1225, 741, -86, 942,-32766, 1075,-32766,-32766,-32766,-32766, - -32766, 239,-32766,-32766,-32766, 267, 138, 399, 745, 746, - 747, 748, 461, 462, 423, 35, 247, 103, 104, 105, - 128, 749, 750, 751, 752, 753, 754, 755, 756, 757, - 758, 759, 779, 576, 780, 781, 782, 783, 771, 772, - 340, 341, 774, 775, 760, 761, 762, 764, 765, 766, - 351, 806, 807, 808, 809, 810, 577, 767, 768, 578, - 579, 800, 791, 789, 790, 803, 786, 787, -327, 144, - 580, 581, 785, 582, 583, 584, 585, 586, 587, 1222, - 82, 83, 84, -590, 788, 588, 589, -590, 148, 763, - 733, 734, 735, 736, 737, 1309, 738, 739, 740, 776, - 777, 36, 1308, 85, 86, 87, 88, 89, 90, 91, - 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, - 102, 103, 104, 105, 106, 107, 108, 288, 271, -587, - -193, 375, 376, -587, 976,-32766, 1021, 453, 454, 455, - 109, 417, 945, 946, 741, 712, 819, 947,-32766,-32766, - -32766, -271, 1073, 941, 1224, 1223, 1225, 288, 742, 743, - 744, 745, 746, 747, 748, -192, -365, 812, -365,-32766, - 599,-32766,-32766, 549, 749, 750, 751, 752, 753, 754, - 755, 756, 757, 758, 759, 779, 802, 780, 781, 782, - 783, 771, 772, 773, 801, 774, 775, 760, 761, 762, - 764, 765, 766, 805, 806, 807, 808, 809, 810, 811, - 767, 768, 769, 770, 800, 791, 789, 790, 803, 786, - 787, 251, 820, 778, 784, 785, 792, 793, 795, 794, - 796, 797, 732, 731, 1261, 1022, 1019, 788, 799, 798, - 49, 50, 51, 507, 52, 53, 1009, 1008, 1007, 1010, - 54, 55, -111, 56, 816, 1045, 14, -111, 1022, -111, - 287, 1305, 977, 306, 302, 1022, 238, -111, -111, -111, - -111, -111, -111, -111, -111, 106, 107, 108, 1089, 271, - -32766,-32766,-32766, 280, 284, 126, -193, 929, 57, 58, - 287, 109, 1019, -541, 59, 308, 60, 244, 245, 61, - 62, 63, 64, 65, 66, 67, 68, 1229, 27, 269, - 69, 439, 508, -341, 1022, 929, 1255, 1256, 509, 907, - 823, -192, 150, 907, 1253, 41, 24, 510, 352, 511, - 818, 512, 386, 513, 11, 699, 514, 515, 648, 25, - 814, 43, 44, 440, 372, 371, 907, 45, 516, 702, - 1220, 667, 668, 363, 334, -540, 357, -541, -541, 320, - 1215, 1249, 518, 519, 520, -581, 1074, 335, 724, -581, - 1019,-32766, -541, 336, 521, 522, 703, 1243, 1244, 1245, - 1246, 1240, 1241, 294, -541, 850, -547, 851, 823, 1247, - 1242, 365, 1022, 1224, 1223, 1225, 295, -153, -153, -153, - 369, 70, 897, 318, 319, 322, 897, 384, 149, 402, - 373, 374, -153, 435, -153, 436, -153, 280, -153, -540, - -540, 141, 1220, 378, 379, 639, 640, 322, 370, 897, - 907, 437, 438, 829, -540, -88, 151, 732, 731, 945, - 946, 153, 823,-32766, 517, -51, -540, 154, -546, 883, - 941, -111, -111, -111, 31, 110, 111, 112, 113, 114, - 115, 116, 117, 118, 119, 120, 121, 122, 155, 74, - 27, 157, 32, 322, -85, 123, 124, 909, 129, 697, - 130, 909, 823, 697, -153, 143, 1253, 158,-32766, -544, - 1229, -542, 159, 160, 1222, 161, -79, 1134, 1136, -75, - 285,-32766,-32766,-32766, 909,-32766, 697,-32766, -539,-32766, - -301, -73,-32766, 897, -72, -71, 1220,-32766,-32766,-32766, - -16, 140, 1215,-32766,-32766, 732, 731, 322, -70,-32766, - 414, -69, -4, 907, -68, -67, 521, 522,-32766, 1243, - 1244, 1245, 1246, 1240, 1241, -66, -47, -18, 147, 270, - 281, 1247, 1242, -544, -544, -542, -542, 732, 731, 713, - 716, 906,-32766, 72, 146, 907, 319, 322, 1222, -297, - -542, 823, -539, -539, 276,-32766,-32766,-32766, 277,-32766, - -544,-32766, -542,-32766, 282, 283,-32766, -539, 909, 328, - 697,-32766,-32766,-32766,-32766, 704, 286,-32766,-32766, -539, - 1222, 923, 289,-32766, 414, 1220, 290,-32766,-32766,-32766, - 271,-32766,-32766,-32766, 47,-32766, 897, -111,-32766, 677, - 109, 814, 145,-32766,-32766,-32766,-32766, 823, 131,-32766, - -32766, 1336,-32766, 654, 670,-32766, 414, 1104, 370, 637, - 430, 551, 73, 13,-32766, 293, 555, 295, 897, 945, - 946, 649, 74, 434, 517, 458, 322, 487, 690, 842, - 941, -111, -111, -111, 301, 1022, 561, 655, 671, 1260, - 300,-32766, -539,-32766, 907, 603, 303, 1222, 296, 297, - 39, 1262, 9, 40,-32766,-32766,-32766, 0,-32766, 907, - -32766, 909,-32766, 697, -4,-32766, 0, 1229, 907, 0, - -32766,-32766,-32766,-32766, 307, 125,-32766,-32766, 0, 1222, - 907, 0,-32766, 414, 0, 0,-32766,-32766,-32766, 707, - -32766,-32766,-32766, 962,-32766, 697, -505,-32766, 714, -495, - 7, 482,-32766,-32766,-32766,-32766, -539, -539,-32766,-32766, - 16, 1222, 567, 367,-32766, 414, 925, 295,-32766,-32766, - -32766, -539,-32766,-32766,-32766, 822,-32766, 897, 721,-32766, - 722, -575, 888, -539,-32766,-32766,-32766, 986, 963, 970, - -32766,-32766, 897, -249, -249, -249,-32766, 414, 823, 370, - 960, 897, 971, 886, 958,-32766, 1078, 1081, 718, 1082, - 945, 946, 1079, 897, 1080, 517, 1086, 33, 1250, 834, - 883, 941, -111, -111, -111, 27, 1275, 1293, 1327, -248, - -248, -248, 1220, 642, 884, 370, 317, 823, 366, 698, - 701, 1253, 1331, 705, -111, 706, 945, 946, 708, 709, - 710, 517, 909,-32766, 697, -249, 883, 941, -111, -111, - -111, 711, 715, 700, -509, 1333, 845, 909, 48, 697, - -573, 1220, 844, 853, 295, 935, 909, 1215, 697, 74, - 978, 852, 1332, 322, 934, 932, 933, 936, 909, 1206, - 697, -248, 522, 916, 1243, 1244, 1245, 1246, 1240, 1241, - 926, 914, 968, 969, 1330, 1287, 1247, 1242, 1276, 1294, - -32766, 1300, 1303, 1191, -547, -546, 1222, -545, 72, -489, - 1, 319, 322,-32766,-32766,-32766, 28,-32766, 29,-32766, - 38,-32766, 298, 299,-32766, 42, 46, 71, 75,-32766, - -32766,-32766, 76, 77, 78,-32766,-32766, 368, 79, 80, - 142,-32766, 414, 152, 156, 243, 324, 352, 353, 127, - -32766, -274, 354, 355, 356, 357, 358, 359, 360, 361, - 362, 364, 431, 0, -272, -271, 18, 19, 20, 21, - 23, 401, 478, 479, 486, 489, 490, 491, 492, 496, - 497, 498, 505, 684, 1233, 1174, 1251, 1048, 1047, 1028, - 0, 1210, 1024, -276, -103, 17, 22, 26, 292, 400, - 596, 600, 628, 689, 1178, 1228, 1175, 1306, 0, 0, - 1254, 0, 322 + -32767, 2, 107, 108, 109, 752, 274, 381, 380,-32766, + -32766,-32766,-32766, 104, 105, 106, 1025, 423, 110, 265, + 139, 402, 756, 757, 758, 759, 467, 468, 429, 939, + 291,-32766, 287,-32766,-32766, 760, 761, 762, 763, 764, + 765, 766, 767, 768, 769, 770, 790, 581, 791, 792, + 793, 794, 782, 783, 344, 345, 785, 786, 771, 772, + 773, 775, 776, 777, 355, 817, 818, 819, 820, 821, + 582, 778, 779, 583, 584, 811, 802, 800, 801, 814, + 797, 798, 688, -545, 585, 586, 796, 587, 588, 589, + 590, 591, 592, -328, -593, -367, 1235, -367, 799, 593, + 594, -593, 140,-32766,-32766,-32766, 133, 134, 135, 580, + 136, 137, 1058, 749, 750, 751, 138, 38, 689, 1021, + 1020, 1019, 1022, 390,-32766, 7,-32766,-32766,-32766,-32766, + -32766,-32766,-32766,-32766,-32766,-32766, 379, 380, 1034, 690, + 691, 743, 742,-32766,-32766,-32766, 423, -545, -545, -590, + -32766,-32766,-32766, 1033,-32766, 127, -590, 1237, 1236, 1238, + 1319, 752, -545, 290,-32766, 283,-32766,-32766,-32766,-32766, + -32766, 1237, 1236, 1238, -545, 265, 139, 402, 756, 757, + 758, 759, 16, 482, 429, 459, 460, 461, 298, 723, + 35, 760, 761, 762, 763, 764, 765, 766, 767, 768, + 769, 770, 790, 581, 791, 792, 793, 794, 782, 783, + 344, 345, 785, 786, 771, 772, 773, 775, 776, 777, + 355, 817, 818, 819, 820, 821, 582, 778, 779, 583, + 584, 811, 802, 800, 801, 814, 797, 798, 129, 825, + 585, 586, 796, 587, 588, 589, 590, 591, 592, -328, + 83, 84, 85, -593, 799, 593, 594, -593, 149, 774, + 744, 745, 746, 747, 748, 825, 749, 750, 751, 787, + 788, 37, 145, 86, 87, 88, 89, 90, 91, 92, + 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, + 103, 104, 105, 106, 107, 108, 109, 291, 274, 836, + 254, 1110, 1111, 1112, 1109, 1108, 1107, 1113, -590, 861, + 110, 862, -590, 483, 752,-32766,-32766,-32766,-32766,-32766, + 142, 604, 1086, 743, 742, 1263, 326, 988, 753, 754, + 755, 756, 757, 758, 759, 309,-32766, 823,-32766,-32766, + -32766,-32766, 242, 554, 760, 761, 762, 763, 764, 765, + 766, 767, 768, 769, 770, 790, 813, 791, 792, 793, + 794, 782, 783, 784, 812, 785, 786, 771, 772, 773, + 775, 776, 777, 816, 817, 818, 819, 820, 821, 822, + 778, 779, 780, 781, 811, 802, 800, 801, 814, 797, + 798, 311, 941, 789, 795, 796, 803, 804, 806, 805, + 807, 808, 323, 610, 1275, 1034, 834, 799, 810, 809, + 50, 51, 52, 513, 53, 54, 861, 241, 862, 919, + 55, 56, -111, 57,-32766,-32766,-32766, -111, 827, -111, + 290, 1303, 1348, 356, 305, 1349, 339, -111, -111, -111, + -111, -111, -111, -111, -111,-32766, -194,-32766,-32766,-32766, + -193, 957, 958, 830, -86, 989, 959, 835, 58, 59, + 340, 429, 953, -544, 60, 833, 61, 247, 248, 62, + 63, 64, 65, 66, 67, 68, 69, 1242, 28, 267, + 70, 445, 514, -342,-32766, 141, 1269, 1270, 515, 919, + 834, 326, -272, 919, 1267, 42, 25, 516, 941, 517, + 14, 518, 909, 519, 829, 369, 520, 521, 373, 710, + 1034, 44, 45, 446, 376, 375, 388, 46, 522, 713, + -86, 441, 1102, 367, 338, -543, 442, -544, -544, 831, + 1228, 443, 524, 525, 526, 290, 1237, 1236, 1238, 361, + 1031, 444, -544, 1088, 527, 528, 840, 1256, 1257, 1258, + 1259, 1253, 1254, 297, -544, 151, -550, -584, 834, 1260, + 1255, -584, 1034, 1237, 1236, 1238, 298, -154, -154, -154, + 152, 71, 909, 321, 322, 326, 909, 921, 1031, 708, + 834, 154, -154, 1338, -154, 155, -154, 283, -154, -543, + -543, 82, 1233, 1087, 1323, 735, 156, 326, 374, 158, + 1034, 1322, -194, -79, -543, -88, -193, 743, 742, 957, + 958, 654, 26,-32766, 523, -51, -543, 33, -549, 895, + 953, -111, -111, -111, 32, 111, 112, 113, 114, 115, + 116, 117, 118, 119, 120, 121, 122, 123, -59, 75, + 28, 673, 674, 326, -58, 36, 250, 921, 124, 708, + 125, 921, 834, 708, -154, 130, 1267, 131,-32766, -547, + 144, -542, 150, 406, 1235, 377, 378, 1147, 1149, 382, + 383,-32766,-32766,-32766, -85,-32766, 1057,-32766, -542,-32766, + 645, 646,-32766, 159, 160, 161, 1233,-32766,-32766,-32766, + 162, -79, 1228,-32766,-32766, 743, 742, 163, -302,-32766, + 420, -75, -4, 919, -73, 287, 527, 528,-32766, 1256, + 1257, 1258, 1259, 1253, 1254, -72, -71, -70, -69, -68, + -67, 1260, 1255, -547, -547, -542, -542, 743, 742, -66, + -47, -18,-32766, 73, 148, 919, 322, 326, 1235, 273, + -542, 284, -542, -542, 724,-32766,-32766,-32766, 727,-32766, + -547,-32766, -542,-32766, 918, 147,-32766, -542, 288, 289, + -298,-32766,-32766,-32766,-32766, 714, 279,-32766,-32766, -542, + 1235, 280, 285,-32766, 420, 48, 286,-32766,-32766,-32766, + 332,-32766,-32766,-32766, 292,-32766, 909, 293,-32766, 935, + 274, 1031, 919,-32766,-32766,-32766, 110, 683, 132,-32766, + -32766, 834, 146,-32766, 560,-32766, 420, 660, 374, 825, + 436, 1350, 74, 1034,-32766, 296, 655, 1117, 909, 957, + 958, 306, 715, 699, 523, 556, 303, 13, 310, 853, + 953, -111, -111, -111, 701, 464, 493, 954, 283, 299, + 300,-32766, 49, 676, 919, 304, 661, 1235, 677, 937, + 1274,-32766, 10, 1264,-32766,-32766,-32766, 643,-32766, 919, + -32766, 921,-32766, 708, -4,-32766, 126, 34, 919, 566, + -32766,-32766,-32766,-32766, 0, 909,-32766,-32766, 0, 1235, + 919, 0,-32766, 420, 0, 0,-32766,-32766,-32766, 718, + -32766,-32766,-32766, 921,-32766, 708, 1034,-32766, 725, 1276, + 0, 488,-32766,-32766,-32766,-32766, 301, 302,-32766,-32766, + -507, 1235, 572, -497,-32766, 420, 608, 8,-32766,-32766, + -32766, 372,-32766,-32766,-32766, 17,-32766, 909, 371,-32766, + 833, 298, 320, 128,-32766,-32766,-32766, 40, 370, 41, + -32766,-32766, 909, -250, -250, -250,-32766, 420, 732, 374, + 974, 909, 708, 733, 900,-32766, 998, 975, 405, 982, + 957, 958, 972, 909, 983, 523, 898, 970, 1091, 1094, + 895, 953, -111, -111, -111, 28, 1095, 1092, 1093, -249, + -249, -249, 1242, 1099, 709, 374, 845, 834, 1289, 1307, + 1341, 1267, 648, 1268, 712, 716, 957, 958, 717, 1242, + 719, 523, 921, 720, 708, -250, 895, 953, -111, -111, + -111, 721, -16, 722, 726, 711, -511, 921, 409, 708, + -578, 1233, 729, 896, 1345, 1347, 921, 1228, 708, -577, + 856, 855, 947, 990, 1346, 946, 944, 945, 921, 948, + 708, -249, 528, 1219, 1256, 1257, 1258, 1259, 1253, 1254, + 928, 938, 926, 980, 981, 632, 1260, 1255, 1344, 1301, + -32766, 1290, 1308, 834, 1317, -275, 1235, -576, 73, -550, + -549, 322, 326,-32766,-32766,-32766, -548,-32766, -491,-32766, + 834,-32766, 1, 29,-32766, 30, 39, 43, 47,-32766, + -32766,-32766, 72, 76, 77,-32766,-32766, 1233, -111, -111, + 78,-32766, 420, -111, 79, 80, 81, 143, 153, -111, + -32766, 157, 246, 328, 1233, -111, -111, 356,-32766, 357, + -111, 358, 359, 360, 361, 362, -111, 363, 364, 365, + 366, 368, 437, 0, -273,-32766, -272, 19, 20, 298, + 21, 22, 24, 404, 75, 1204, 484, 485, 326, 492, + 0, 495, 496, 497, 498, 502, 298, 503, 504, 511, + 694, 75, 0, 1246, 1187, 326, 1265, 1060, 1059, 1040, + 1223, 1036, -277, -103, 18, 23, 27, 295, 403, 601, + 605, 634, 700, 1191, 1241, 1188, 1320, 0, 0, 0, + 326 ); protected $actionCheck = array( 2, 3, 4, 5, 6, 7, 0, 9, 10, 11, - 12, 13, 106, 1, 108, 31, 9, 10, 11, 44, + 12, 13, 70, 9, 10, 11, 9, 10, 11, 44, 45, 46, 47, 48, 49, 50, 51, 52, 116, 117, - 118, 119, 120, 121, 122, 37, 38, 30, 1, 32, + 118, 119, 120, 121, 122, 37, 38, 30, 116, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, - 43, 138, 106, 107, 8, 57, 9, 10, 11, 9, - 10, 155, 116, 9, 10, 11, 9, 10, 11, 71, - 72, 73, 74, 75, 76, 77, 163, 30, 80, 32, - 33, 34, 35, 36, 30, 87, 88, 89, 90, 91, + 43, 8, 53, 54, 55, 57, 57, 106, 107, 137, + 9, 10, 11, 50, 51, 52, 1, 116, 69, 71, + 72, 73, 74, 75, 76, 77, 134, 135, 80, 1, + 30, 30, 30, 32, 33, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, - 132, 133, 8, 80, 136, 137, 138, 139, 140, 141, - 142, 143, 144, 51, 1, 161, 31, 80, 150, 151, + 132, 133, 80, 70, 136, 137, 138, 139, 140, 141, + 142, 143, 144, 8, 1, 106, 80, 108, 150, 151, 152, 8, 154, 9, 10, 11, 2, 3, 4, 5, - 6, 7, 164, 9, 10, 11, 12, 13, 70, 1, - 82, 159, 80, 85, 30, 83, 32, 33, 34, 35, - 36, 37, 38, 116, 117, 118, 119, 120, 121, 122, - 1, 37, 38, 9, 10, 11, 8, 8, 161, 9, - 10, 11, 117, 118, 167, 1, 8, 122, 155, 156, - 157, 57, 97, 128, 30, 162, 32, 33, 34, 35, - 30, 14, 32, 33, 34, 71, 72, 73, 74, 75, - 76, 77, 134, 135, 80, 147, 148, 50, 51, 52, + 6, 7, 164, 9, 10, 11, 12, 13, 116, 119, + 120, 121, 122, 106, 30, 108, 32, 33, 34, 35, + 36, 37, 38, 9, 10, 11, 106, 107, 138, 137, + 138, 37, 38, 9, 10, 11, 116, 134, 135, 1, + 9, 10, 11, 137, 30, 14, 8, 155, 156, 157, + 1, 57, 149, 163, 30, 163, 32, 33, 34, 35, + 36, 155, 156, 157, 161, 71, 72, 73, 74, 75, + 76, 77, 8, 31, 80, 129, 130, 131, 158, 161, 8, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, - 126, 127, 128, 129, 130, 131, 132, 133, 164, 8, - 136, 137, 138, 139, 140, 141, 142, 143, 144, 80, + 126, 127, 128, 129, 130, 131, 132, 133, 8, 80, + 136, 137, 138, 139, 140, 141, 142, 143, 144, 164, 9, 10, 11, 160, 150, 151, 152, 164, 154, 2, - 3, 4, 5, 6, 7, 1, 9, 10, 11, 12, + 3, 4, 5, 6, 7, 80, 9, 10, 11, 12, 13, 30, 8, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, - 49, 50, 51, 52, 53, 54, 55, 30, 57, 160, - 8, 106, 107, 164, 31, 9, 137, 129, 130, 131, - 69, 116, 117, 118, 57, 161, 80, 122, 9, 10, - 11, 164, 1, 128, 155, 156, 157, 30, 71, 72, - 73, 74, 75, 76, 77, 8, 106, 80, 108, 30, - 1, 32, 33, 85, 87, 88, 89, 90, 91, 92, + 49, 50, 51, 52, 53, 54, 55, 30, 57, 1, + 8, 116, 117, 118, 119, 120, 121, 122, 160, 106, + 69, 108, 164, 161, 57, 9, 10, 11, 9, 10, + 161, 1, 1, 37, 38, 1, 167, 31, 71, 72, + 73, 74, 75, 76, 77, 8, 30, 80, 32, 33, + 34, 35, 14, 85, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, 132, - 133, 8, 156, 136, 137, 138, 139, 140, 141, 142, - 143, 144, 37, 38, 146, 138, 116, 150, 151, 152, - 2, 3, 4, 5, 6, 7, 119, 120, 121, 122, - 12, 13, 101, 15, 80, 1, 101, 106, 138, 108, - 163, 1, 159, 8, 113, 138, 97, 116, 117, 118, - 119, 120, 121, 122, 123, 53, 54, 55, 123, 57, - 9, 10, 11, 163, 30, 14, 164, 122, 50, 51, - 163, 69, 116, 70, 56, 8, 58, 59, 60, 61, + 133, 8, 122, 136, 137, 138, 139, 140, 141, 142, + 143, 144, 8, 51, 146, 138, 82, 150, 151, 152, + 2, 3, 4, 5, 6, 7, 106, 97, 108, 1, + 12, 13, 101, 15, 9, 10, 11, 106, 80, 108, + 163, 1, 80, 163, 113, 83, 8, 116, 117, 118, + 119, 120, 121, 122, 123, 30, 8, 32, 33, 34, + 8, 117, 118, 80, 31, 159, 122, 159, 50, 51, + 8, 80, 128, 70, 56, 155, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 1, 70, 71, - 72, 73, 74, 162, 138, 122, 78, 79, 80, 1, - 82, 164, 14, 1, 86, 87, 88, 89, 163, 91, - 156, 93, 106, 95, 108, 161, 98, 99, 75, 76, - 80, 103, 104, 105, 106, 107, 1, 109, 110, 31, - 116, 75, 76, 115, 116, 70, 163, 134, 135, 8, - 122, 1, 124, 125, 126, 160, 159, 8, 161, 164, - 116, 137, 149, 8, 136, 137, 31, 139, 140, 141, - 142, 143, 144, 145, 161, 106, 163, 108, 82, 151, - 152, 8, 138, 155, 156, 157, 158, 75, 76, 77, - 8, 163, 84, 165, 166, 167, 84, 8, 101, 102, - 106, 107, 90, 8, 92, 8, 94, 163, 96, 134, - 135, 161, 116, 106, 107, 111, 112, 167, 106, 84, - 1, 8, 8, 8, 149, 31, 14, 37, 38, 117, - 118, 14, 82, 137, 122, 31, 161, 14, 163, 127, + 72, 73, 74, 162, 9, 161, 78, 79, 80, 1, + 82, 167, 164, 1, 86, 87, 88, 89, 122, 91, + 101, 93, 84, 95, 156, 8, 98, 99, 8, 161, + 138, 103, 104, 105, 106, 107, 8, 109, 110, 31, + 97, 8, 123, 115, 116, 70, 8, 134, 135, 156, + 122, 8, 124, 125, 126, 163, 155, 156, 157, 163, + 116, 8, 149, 162, 136, 137, 8, 139, 140, 141, + 142, 143, 144, 145, 161, 14, 163, 160, 82, 151, + 152, 164, 138, 155, 156, 157, 158, 75, 76, 77, + 14, 163, 84, 165, 166, 167, 84, 159, 116, 161, + 82, 14, 90, 85, 92, 14, 94, 163, 96, 134, + 135, 161, 116, 159, 1, 161, 14, 167, 106, 14, + 138, 8, 164, 16, 149, 31, 164, 37, 38, 117, + 118, 75, 76, 137, 122, 31, 161, 14, 163, 127, 128, 129, 130, 131, 16, 17, 18, 19, 20, 21, - 22, 23, 24, 25, 26, 27, 28, 29, 14, 163, - 70, 14, 14, 167, 31, 16, 16, 159, 16, 161, + 22, 23, 24, 25, 26, 27, 28, 29, 16, 163, + 70, 75, 76, 167, 16, 147, 148, 159, 16, 161, 16, 159, 82, 161, 162, 16, 86, 16, 74, 70, - 1, 70, 16, 16, 80, 16, 31, 59, 60, 31, - 37, 87, 88, 89, 159, 91, 161, 93, 70, 95, - 35, 31, 98, 84, 31, 31, 116, 103, 104, 105, - 31, 161, 122, 109, 110, 37, 38, 167, 31, 115, - 116, 31, 0, 1, 31, 31, 136, 137, 124, 139, + 16, 70, 101, 102, 80, 106, 107, 59, 60, 106, + 107, 87, 88, 89, 31, 91, 1, 93, 70, 95, + 111, 112, 98, 16, 16, 16, 116, 103, 104, 105, + 16, 31, 122, 109, 110, 37, 38, 16, 35, 115, + 116, 31, 0, 1, 31, 30, 136, 137, 124, 139, 140, 141, 142, 143, 144, 31, 31, 31, 31, 31, 31, 151, 152, 134, 135, 134, 135, 37, 38, 31, - 31, 31, 74, 163, 31, 1, 166, 167, 80, 35, - 149, 82, 134, 135, 35, 87, 88, 89, 35, 91, - 161, 93, 161, 95, 35, 35, 98, 149, 159, 35, - 161, 103, 104, 105, 74, 31, 37, 109, 110, 161, - 80, 38, 37, 115, 116, 116, 37, 87, 88, 89, - 57, 91, 124, 93, 70, 95, 84, 128, 98, 77, - 69, 80, 70, 103, 104, 105, 137, 82, 31, 109, - 110, 83, 85, 96, 94, 115, 116, 82, 106, 113, - 108, 85, 154, 97, 124, 113, 89, 158, 84, 117, - 118, 90, 163, 128, 122, 97, 167, 97, 92, 127, - 128, 129, 130, 131, 133, 138, 153, 100, 100, 146, - 132, 74, 70, 137, 1, 153, 114, 80, 134, 135, - 159, 146, 150, 159, 87, 88, 89, -1, 91, 1, - 93, 159, 95, 161, 162, 98, -1, 1, 1, -1, - 103, 104, 105, 74, 132, 161, 109, 110, -1, 80, + 31, 31, 74, 163, 31, 1, 166, 167, 80, 31, + 149, 31, 134, 135, 31, 87, 88, 89, 31, 91, + 161, 93, 161, 95, 31, 31, 98, 149, 37, 37, + 35, 103, 104, 105, 74, 31, 35, 109, 110, 161, + 80, 35, 35, 115, 116, 70, 35, 87, 88, 89, + 35, 91, 124, 93, 37, 95, 84, 37, 98, 38, + 57, 116, 1, 103, 104, 105, 69, 77, 31, 109, + 110, 82, 70, 85, 89, 115, 116, 96, 106, 80, + 108, 83, 154, 138, 124, 113, 90, 82, 84, 117, + 118, 114, 31, 80, 122, 85, 132, 97, 132, 127, + 128, 129, 130, 131, 92, 97, 97, 128, 163, 134, + 135, 74, 70, 94, 1, 133, 100, 80, 100, 154, + 146, 137, 150, 160, 87, 88, 89, 113, 91, 1, + 93, 159, 95, 161, 162, 98, 161, 161, 1, 153, + 103, 104, 105, 74, -1, 84, 109, 110, -1, 80, 1, -1, 115, 116, -1, -1, 87, 88, 89, 31, - 91, 124, 93, 159, 95, 161, 149, 98, 31, 149, - 149, 102, 103, 104, 105, 74, 134, 135, 109, 110, - 149, 80, 81, 149, 115, 116, 154, 158, 87, 88, - 89, 149, 91, 124, 93, 155, 95, 84, 159, 98, - 159, 163, 159, 161, 103, 104, 105, 159, 159, 159, - 109, 110, 84, 100, 101, 102, 115, 116, 82, 106, - 159, 84, 159, 159, 159, 124, 159, 159, 162, 159, - 117, 118, 159, 84, 159, 122, 159, 161, 160, 160, - 127, 128, 129, 130, 131, 70, 160, 160, 160, 100, - 101, 102, 116, 160, 162, 106, 161, 82, 161, 161, - 161, 86, 162, 161, 128, 161, 117, 118, 161, 161, - 161, 122, 159, 137, 161, 162, 127, 128, 129, 130, - 131, 161, 161, 161, 165, 162, 162, 159, 70, 161, - 163, 116, 162, 162, 158, 162, 159, 122, 161, 163, - 162, 162, 162, 167, 162, 162, 162, 162, 159, 162, + 91, 124, 93, 159, 95, 161, 138, 98, 31, 146, + -1, 102, 103, 104, 105, 74, 134, 135, 109, 110, + 149, 80, 81, 149, 115, 116, 153, 149, 87, 88, + 89, 149, 91, 124, 93, 149, 95, 84, 149, 98, + 155, 158, 161, 161, 103, 104, 105, 159, 161, 159, + 109, 110, 84, 100, 101, 102, 115, 116, 159, 106, + 159, 84, 161, 159, 159, 124, 159, 159, 162, 159, + 117, 118, 159, 84, 159, 122, 159, 159, 159, 159, + 127, 128, 129, 130, 131, 70, 159, 159, 159, 100, + 101, 102, 1, 159, 161, 106, 160, 82, 160, 160, + 160, 86, 160, 166, 161, 161, 117, 118, 161, 1, + 161, 122, 159, 161, 161, 162, 127, 128, 129, 130, + 131, 161, 31, 161, 161, 161, 165, 159, 162, 161, + 163, 116, 162, 162, 162, 162, 159, 122, 161, 163, + 162, 162, 162, 162, 162, 162, 162, 162, 159, 162, 161, 162, 137, 162, 139, 140, 141, 142, 143, 144, 162, 162, 162, 162, 162, 162, 151, 152, 162, 162, - 74, 162, 162, 165, 163, 163, 80, 163, 163, 163, + 74, 162, 162, 82, 162, 164, 80, 163, 163, 163, 163, 166, 167, 87, 88, 89, 163, 91, 163, 93, - 163, 95, 134, 135, 98, 163, 163, 163, 163, 103, - 104, 105, 163, 163, 163, 109, 110, 149, 163, 163, - 163, 115, 116, 163, 163, 163, 163, 163, 163, 161, - 124, 164, 163, 163, 163, 163, 163, 163, 163, 163, - 163, 163, 163, -1, 164, 164, 164, 164, 164, 164, + 82, 95, 163, 163, 98, 163, 163, 163, 163, 103, + 104, 105, 163, 163, 163, 109, 110, 116, 117, 118, + 163, 115, 116, 122, 163, 163, 163, 163, 163, 128, + 124, 163, 163, 163, 116, 117, 118, 163, 137, 163, + 122, 163, 163, 163, 163, 163, 128, 163, 163, 163, + 163, 163, 163, -1, 164, 137, 164, 164, 164, 158, + 164, 164, 164, 164, 163, 165, 164, 164, 167, 164, + -1, 164, 164, 164, 164, 164, 158, 164, 164, 164, + 164, 163, -1, 164, 164, 167, 164, 164, 164, 164, 164, 164, 164, 164, 164, 164, 164, 164, 164, 164, - 164, 164, 164, 164, 164, 164, 164, 164, 164, 164, - -1, 164, 164, 164, 164, 164, 164, 164, 164, 164, - 164, 164, 164, 164, 164, 164, 164, 164, -1, -1, - 166, -1, 167 + 164, 164, 164, 164, 164, 164, 164, -1, -1, -1, + 167 ); protected $actionBase = array( - 0, -2, 154, 542, 752, 893, 929, 580, 53, 394, - 855, 307, 307, 67, 307, 307, 307, 565, 908, 908, - 917, 908, 538, 784, 649, 649, 649, 708, 708, 708, - 708, 740, 740, 849, 849, 881, 817, 634, 1036, 1036, + 0, -2, 154, 542, 752, 893, 929, 52, 374, 431, + 398, 869, 793, 235, 307, 307, 793, 307, 784, 908, + 908, 917, 908, 538, 841, 468, 468, 468, 708, 708, + 708, 708, 740, 740, 849, 849, 881, 817, 634, 1036, 1036, 1036, 1036, 1036, 1036, 1036, 1036, 1036, 1036, 1036, 1036, 1036, 1036, 1036, 1036, 1036, 1036, 1036, 1036, 1036, 1036, 1036, 1036, 1036, 1036, 1036, 1036, 1036, 1036, 1036, @@ -512,65 +516,66 @@ class Php7 extends \PhpParser\ParserAbstract 1036, 1036, 1036, 1036, 1036, 1036, 1036, 1036, 1036, 1036, 1036, 1036, 1036, 1036, 1036, 1036, 1036, 1036, 1036, 1036, 1036, 1036, 1036, 1036, 1036, 1036, 1036, 1036, 1036, 1036, - 1036, 1036, 12, 323, 389, 678, 1044, 1050, 1046, 1051, - 1042, 1041, 1045, 1047, 1052, 942, 943, 753, 946, 947, - 949, 950, 1048, 873, 1043, 1049, 291, 291, 291, 291, + 1036, 1036, 1036, 1036, 348, 346, 370, 653, 1063, 1069, + 1065, 1070, 1061, 1060, 1064, 1066, 1071, 946, 947, 774, + 949, 950, 943, 952, 1067, 882, 1062, 1068, 291, 291, 291, 291, 291, 291, 291, 291, 291, 291, 291, 291, 291, 291, 291, 291, 291, 291, 291, 291, 291, 291, - 291, 291, 346, 491, 50, 57, 57, 57, 57, 57, - 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, - 57, 57, 57, 57, 57, 54, 54, 54, 620, 620, - 359, 190, 184, 955, 955, 955, 955, 955, 955, 955, - 955, 955, 955, 658, 47, 144, 144, 7, 7, 7, - 7, 7, 371, -25, -25, -25, -25, 709, 347, 916, - 474, 526, 375, 280, 317, 245, 340, 340, 187, 187, - 396, 396, -87, -87, 396, 396, 396, 747, 747, 747, - 747, 443, 505, -94, 308, 454, 480, 480, 480, 480, - 454, 454, 454, 454, 755, 1054, 454, 454, 454, 641, - 822, 822, 998, 442, 442, 442, 822, 499, 776, 88, - 499, 88, 37, 92, 756, 85, -54, 425, 756, 639, - 764, 189, 143, 820, 524, 820, 1040, 385, 767, 413, - 735, 688, 857, 902, 1053, 787, 940, 788, 941, 228, - 98, 685, 1039, 1039, 1039, 1039, 1039, 1039, 1039, 1039, - 1039, 1039, 1039, 1055, 415, 1040, 286, 1055, 1055, 1055, - 415, 415, 415, 415, 415, 415, 415, 415, 415, 415, - 534, 286, 483, 496, 286, 774, 415, 12, 800, 12, - 12, 12, 12, 12, 12, 12, 12, 12, 12, 736, - -16, 12, 323, 204, 204, 427, 168, 204, 204, 204, - 204, 12, 12, 12, 524, 773, 733, 537, 742, 377, - 773, 773, 773, 115, 124, 207, 342, 695, 754, 446, - 761, 761, 775, 957, 957, 761, 765, 761, 775, 973, - 761, 761, 957, 957, 809, 232, 625, 579, 612, 627, - 957, 475, 761, 761, 761, 761, 792, 643, 761, 433, - 281, 761, 761, 792, 758, 739, 46, 751, 957, 957, - 957, 792, 603, 751, 751, 751, 819, 821, 746, 738, - 571, 507, 645, 198, 783, 738, 738, 761, 619, 746, - 738, 746, 738, 812, 738, 738, 738, 746, 738, 765, - 585, 738, 691, 644, 188, 738, 6, 974, 975, 624, - 979, 967, 980, 1009, 981, 985, 878, 956, 992, 972, - 986, 965, 963, 750, 679, 680, 801, 797, 954, 771, - 771, 771, 951, 771, 771, 771, 771, 771, 771, 771, - 771, 679, 858, 814, 745, 777, 995, 682, 684, 743, - 872, 899, 948, 994, 1030, 987, 741, 689, 1016, 999, - 846, 875, 1000, 1001, 1017, 1031, 1032, 880, 772, 903, - 904, 859, 1003, 879, 771, 974, 985, 663, 972, 986, - 965, 963, 734, 724, 720, 723, 717, 704, 700, 703, - 737, 1033, 907, 818, 866, 1002, 952, 679, 867, 1012, - 856, 1018, 1019, 877, 778, 768, 868, 910, 1004, 1005, - 1006, 882, 1034, 884, 744, 1013, 997, 1020, 780, 911, - 1021, 1022, 1023, 1024, 887, 913, 888, 889, 823, 781, - 1010, 757, 918, 528, 769, 770, 789, 1008, 642, 993, - 900, 919, 920, 1025, 1026, 1027, 922, 923, 990, 828, - 1014, 760, 1015, 1011, 829, 830, 647, 785, 1035, 759, - 763, 779, 653, 674, 924, 925, 927, 991, 748, 762, - 841, 843, 1037, 683, 1038, 931, 677, 844, 696, 938, - 1029, 697, 699, 786, 901, 811, 782, 766, 1007, 749, - 845, 939, 847, 848, 850, 1028, 853, 0, 0, 0, + 291, 291, 291, 291, 291, 525, 191, 359, 4, 4, + 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, + 4, 4, 4, 4, 4, 4, 4, 4, 174, 174, + 174, 620, 620, 51, 465, 356, 955, 955, 955, 955, + 955, 955, 955, 955, 955, 955, 658, 184, 144, 144, + 7, 7, 7, 7, 7, 1031, 371, 1048, -25, -25, + -25, -25, 50, 725, 526, 449, 39, 317, 80, 474, + 474, 13, 13, 512, 512, 422, 422, 512, 512, 512, + 808, 808, 808, 808, 443, 505, 360, 308, -78, 209, + 209, 209, 209, -78, -78, -78, -78, 803, 877, -78, + -78, -78, 63, 641, 641, 822, -1, -1, -1, 641, + 253, 790, 548, 253, 384, 548, 480, 402, 764, 759, + -49, 447, 764, 639, 755, 198, 143, 825, 609, 825, + 1059, 320, 768, 426, 749, 720, 874, 904, 1072, 796, + 941, 798, 942, 106, -58, 710, 1058, 1058, 1058, 1058, + 1058, 1058, 1058, 1058, 1058, 1058, 1058, 1073, 336, 1059, + 423, 1073, 1073, 1073, 336, 336, 336, 336, 336, 336, + 336, 336, 336, 336, 619, 423, 586, 616, 423, 795, + 336, 814, 348, 348, 348, 348, 348, 348, 348, 348, + 348, 348, 750, 202, 348, 348, 346, 78, 78, 348, + 484, 65, 78, 78, 78, 78, 348, 348, 348, 348, + 609, 783, 766, 613, 813, 492, 783, 783, 783, 473, + 135, 378, 488, 713, 775, 67, 779, 779, 785, 969, + 969, 779, 769, 779, 785, 975, 779, 779, 969, 969, + 823, 280, 563, 478, 550, 568, 969, 377, 779, 779, + 779, 779, 746, 573, 779, 342, 314, 779, 779, 746, + 744, 760, 43, 762, 969, 969, 969, 746, 547, 762, + 762, 762, 839, 844, 794, 758, 444, 433, 588, 232, + 801, 758, 758, 779, 558, 794, 758, 794, 758, 745, + 758, 758, 758, 794, 758, 769, 502, 758, 717, 583, + 224, 758, 6, 979, 980, 624, 981, 973, 987, 1019, + 991, 992, 873, 965, 999, 974, 993, 972, 970, 773, + 682, 684, 818, 811, 963, 777, 777, 777, 956, 777, + 777, 777, 777, 777, 777, 777, 777, 682, 743, 829, + 765, 1006, 689, 691, 754, 911, 901, 1030, 1004, 1049, + 994, 828, 694, 1028, 1008, 910, 821, 1009, 1010, 1029, + 1050, 1052, 912, 782, 913, 918, 876, 1012, 883, 777, + 979, 992, 693, 974, 993, 972, 970, 748, 739, 737, + 738, 736, 735, 723, 734, 753, 1053, 954, 907, 878, + 1011, 957, 682, 879, 1023, 756, 1032, 1033, 827, 788, + 778, 880, 919, 1014, 1015, 1016, 884, 1054, 887, 830, + 1024, 951, 1035, 789, 846, 1037, 1038, 1039, 1040, 889, + 920, 892, 916, 900, 845, 776, 1020, 761, 921, 591, + 787, 791, 800, 1018, 606, 1000, 902, 906, 922, 1041, + 1043, 1044, 923, 924, 995, 847, 1026, 799, 1027, 1022, + 848, 850, 617, 797, 1055, 781, 786, 772, 621, 632, + 925, 927, 931, 998, 763, 770, 853, 855, 1056, 771, + 1057, 938, 635, 857, 718, 939, 1046, 719, 724, 637, + 678, 672, 731, 792, 903, 826, 757, 780, 1017, 724, + 767, 858, 940, 859, 860, 867, 1045, 868, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 458, 458, 458, - 458, 458, 458, 307, 307, 307, 307, 0, 0, 307, - 0, 0, 0, 458, 458, 458, 458, 458, 458, 458, + 0, 0, 0, 0, 0, 0, 0, 0, 458, 458, + 458, 458, 458, 458, 307, 307, 307, 307, 307, 307, + 307, 0, 0, 307, 0, 458, 458, 458, 458, 458, 458, 458, 458, 458, 458, 458, 458, 458, 458, 458, 458, 458, 458, 458, 458, 458, 458, 458, 458, 458, 458, 458, 458, 458, 458, 458, 458, 458, 458, 458, @@ -584,182 +589,184 @@ class Php7 extends \PhpParser\ParserAbstract 458, 458, 458, 458, 458, 458, 458, 458, 458, 458, 458, 458, 458, 458, 458, 458, 458, 458, 458, 458, 458, 458, 458, 458, 458, 458, 458, 458, 458, 458, - 458, 458, 458, 458, 458, 458, 458, 458, 291, 291, + 458, 458, 458, 458, 458, 458, 458, 458, 458, 458, + 458, 291, 291, 291, 291, 291, 291, 291, 291, 291, 291, 291, 291, 291, 291, 291, 291, 291, 291, 291, - 291, 291, 291, 291, 291, 291, 291, 291, 291, 291, - 291, 291, 0, 0, 0, 0, 0, 0, 0, 0, + 291, 291, 291, 291, 291, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 291, 291, - 291, 291, 291, 291, 291, 291, 291, 291, 291, 291, - 291, 291, 291, 291, 291, 291, 291, 291, 291, 291, - 291, 291, 291, 291, 219, 219, 291, 291, 291, 219, - 219, 219, 219, 219, 219, 219, 219, 219, 219, 0, - 291, 291, 291, 291, 291, 291, 291, 291, 809, 442, - 442, 442, 442, 219, 219, 219, 219, 219, -88, -88, - 219, 809, 219, 219, 442, 442, 219, 219, 219, 219, - 219, 219, 219, 219, 219, 219, 219, 0, 0, 286, - 88, 219, 765, 765, 765, 765, 219, 219, 219, 219, - 88, 88, 219, 219, 219, 0, 0, 0, 0, 0, - 0, 0, 0, 286, 88, 0, 286, 0, 765, 765, - 219, 0, 809, 314, 219, 0, 0, 0, 0, 286, - 765, 286, 415, 761, 88, 761, 415, 415, 204, 12, - 314, 527, 527, 527, 527, 0, 0, 524, 809, 809, - 809, 809, 809, 809, 809, 809, 809, 809, 809, 765, - 0, 809, 0, 765, 765, 765, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 765, 0, 0, 957, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 973, 0, 0, 0, 0, - 0, 0, 765, 0, 0, 0, 0, 0, 0, 0, - 0, 771, 778, 0, 778, 0, 771, 771, 771, 0, - 0, 0, 0, 785, 683 + 0, 0, 291, 291, 291, 291, 291, 291, 291, 291, + 291, 291, 291, 291, 291, 291, 291, 291, 291, 291, + 291, 291, 291, 291, 291, 291, 291, 291, 66, 66, + 291, 291, 291, 66, 66, 66, 66, 66, 66, 66, + 66, 66, 66, 0, 291, 291, 291, 291, 291, 291, + 291, 291, 66, 823, 66, -1, -1, -1, -1, 66, + 66, 66, -88, -88, 66, 384, 66, 66, -1, -1, + 66, 66, 66, 66, 66, 66, 66, 66, 66, 66, + 66, 0, 0, 423, 548, 66, 769, 769, 769, 769, + 66, 66, 66, 66, 548, 548, 66, 66, 66, 0, + 0, 0, 0, 0, 0, 0, 0, 423, 548, 0, + 423, 0, 0, 769, 769, 66, 384, 823, 643, 66, + 0, 0, 0, 0, 423, 769, 423, 336, 779, 548, + 779, 336, 336, 78, 348, 643, 611, 611, 611, 611, + 0, 0, 609, 823, 823, 823, 823, 823, 823, 823, + 823, 823, 823, 823, 769, 0, 823, 0, 769, 769, + 769, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 769, 0, 969, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 975, + 0, 0, 0, 0, 0, 0, 0, 0, 769, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 777, 788, + 0, 788, 0, 777, 777, 777, 0, 0, 0, 0, + 797, 771 ); protected $actionDefault = array( 3,32767, 103,32767,32767,32767,32767,32767,32767,32767, - 32767,32767, 101,32767,32767,32767,32767,32767,32767,32767, - 32767,32767,32767,32767,32767,32767,32767, 593, 593, 593, - 593,32767,32767, 253, 103,32767,32767, 467, 385, 385, - 385,32767,32767, 537, 537, 537, 537, 537, 537,32767, - 32767,32767,32767,32767,32767, 467,32767,32767,32767,32767, + 32767,32767,32767,32767,32767,32767, 101,32767,32767,32767, + 32767,32767,32767,32767,32767,32767,32767,32767, 596, 596, + 596, 596,32767,32767, 254, 103,32767,32767, 469, 387, + 387, 387,32767,32767, 540, 540, 540, 540, 540, 540, + 32767,32767,32767,32767,32767,32767, 469,32767,32767,32767, 32767,32767,32767,32767,32767,32767,32767,32767,32767,32767, 32767,32767,32767,32767,32767,32767,32767,32767,32767,32767, 32767,32767,32767,32767,32767,32767,32767,32767,32767,32767, 32767,32767,32767,32767,32767,32767,32767,32767,32767,32767, 32767,32767,32767,32767,32767,32767,32767,32767,32767,32767, 32767,32767,32767,32767,32767,32767,32767,32767,32767,32767, - 32767,32767,32767,32767,32767,32767,32767,32767, 101,32767, - 32767,32767, 37, 7, 8, 10, 11, 50, 17, 323, - 32767,32767,32767,32767, 103,32767,32767,32767,32767,32767, + 32767,32767,32767,32767,32767,32767,32767,32767,32767, 101, + 32767,32767,32767, 37, 7, 8, 10, 11, 50, 17, + 324,32767,32767,32767,32767, 103,32767,32767,32767,32767, 32767,32767,32767,32767,32767,32767,32767,32767,32767,32767, - 32767,32767,32767,32767,32767, 586,32767,32767,32767,32767, + 32767,32767,32767,32767,32767,32767,32767, 589,32767,32767, 32767,32767,32767,32767,32767,32767,32767,32767,32767,32767, - 32767,32767,32767,32767,32767,32767, 471, 450, 451, 453, - 454, 384, 538, 592, 326, 589, 383, 146, 338, 328, - 241, 329, 257, 472, 258, 473, 476, 477, 214, 286, - 380, 150, 414, 468, 416, 466, 470, 415, 390, 395, - 396, 397, 398, 399, 400, 401, 402, 403, 404, 405, - 406, 407, 388, 389, 469, 447, 446, 445,32767,32767, - 412, 413, 417,32767,32767,32767,32767,32767,32767,32767, - 32767, 103,32767, 387, 420, 418, 419, 436, 437, 434, - 435, 438,32767, 439, 440, 441, 442,32767, 315,32767, - 32767,32767, 364, 362, 315, 112,32767,32767, 427, 428, + 32767,32767,32767,32767,32767,32767,32767,32767, 473, 452, + 453, 455, 456, 386, 541, 595, 327, 592, 385, 146, + 339, 329, 242, 330, 258, 474, 259, 475, 478, 479, + 215, 287, 382, 150, 151, 416, 470, 418, 468, 472, + 417, 392, 397, 398, 399, 400, 401, 402, 403, 404, + 405, 406, 407, 408, 409, 390, 391, 471, 449, 448, + 447,32767,32767, 414, 415, 419,32767,32767,32767,32767, + 32767,32767,32767,32767, 103,32767, 389, 422, 420, 421, + 438, 439, 436, 437, 440,32767,32767,32767, 441, 442, + 443, 444, 316,32767,32767, 366, 364, 316, 112,32767, + 32767, 429, 430,32767,32767,32767,32767,32767,32767,32767, + 32767,32767,32767,32767, 534, 446,32767,32767,32767,32767, + 32767,32767,32767,32767,32767,32767,32767,32767,32767, 103, + 32767, 101, 536, 411, 413, 503, 424, 425, 423, 393, + 32767, 510,32767, 103,32767, 512,32767,32767,32767,32767, + 32767,32767,32767, 535,32767, 542, 542,32767, 496, 101, + 195,32767,32767,32767, 195, 195,32767,32767,32767,32767, + 32767,32767,32767,32767, 603, 496, 111, 111, 111, 111, + 111, 111, 111, 111, 111, 111, 111,32767, 195, 111, + 32767,32767,32767, 101, 195, 195, 195, 195, 195, 195, + 195, 195, 195, 195, 190,32767, 268, 270, 103, 557, + 195, 515,32767,32767,32767,32767,32767,32767,32767,32767, + 32767,32767, 508,32767,32767,32767,32767,32767,32767,32767, 32767,32767,32767,32767,32767,32767,32767,32767,32767,32767, - 32767, 531, 444,32767,32767,32767,32767,32767,32767,32767, - 32767,32767,32767,32767,32767,32767, 103,32767, 101, 533, - 409, 411, 501, 422, 423, 421, 391,32767, 508,32767, - 103, 510,32767,32767,32767,32767,32767,32767,32767, 532, - 32767, 539, 539,32767, 494, 101, 194,32767,32767,32767, - 194, 194,32767,32767,32767,32767,32767,32767,32767,32767, - 600, 494, 111, 111, 111, 111, 111, 111, 111, 111, - 111, 111, 111,32767, 194, 111,32767,32767,32767, 101, - 194, 194, 194, 194, 194, 194, 194, 194, 194, 194, - 189,32767, 267, 269, 103, 554, 194,32767, 513,32767, - 32767,32767,32767,32767,32767,32767,32767,32767,32767, 506, + 496, 434, 139,32767, 139, 542, 426, 427, 428, 498, + 542, 542, 542, 312, 289,32767,32767,32767,32767, 513, + 513, 101, 101, 101, 101, 508,32767,32767,32767,32767, + 112, 100, 100, 100, 100, 100, 104, 102,32767,32767, + 32767,32767, 223, 100,32767, 102, 102,32767,32767, 223, + 225, 212, 102, 227,32767, 561, 562, 223, 102, 227, + 227, 227, 247, 247, 485, 318, 102, 100, 102, 102, + 197, 318, 318,32767, 102, 485, 318, 485, 318, 199, + 318, 318, 318, 485, 318,32767, 102, 318, 214, 100, + 100, 318,32767,32767,32767, 498,32767,32767,32767,32767, + 32767,32767,32767, 222,32767,32767,32767,32767,32767,32767, + 32767, 529,32767, 546, 559, 432, 433, 435, 544, 457, + 458, 459, 460, 461, 462, 463, 465, 591,32767, 502, + 32767,32767,32767, 338, 601,32767, 601,32767,32767,32767, 32767,32767,32767,32767,32767,32767,32767,32767,32767,32767, - 32767,32767,32767,32767, 494, 432, 139,32767, 139, 539, - 424, 425, 426, 496, 539, 539, 539, 311, 288,32767, - 32767,32767,32767, 511, 511, 101, 101, 101, 101, 506, - 32767,32767,32767,32767, 112, 100, 100, 100, 100, 100, - 104, 102,32767,32767,32767,32767, 222, 100,32767, 102, - 102,32767,32767, 222, 224, 211, 102, 226,32767, 558, - 559, 222, 102, 226, 226, 226, 246, 246, 483, 317, - 102, 100, 102, 102, 196, 317, 317,32767, 102, 483, - 317, 483, 317, 198, 317, 317, 317, 483, 317,32767, - 102, 317, 213, 100, 100, 317,32767,32767,32767, 496, - 32767,32767,32767,32767,32767,32767,32767, 221,32767,32767, - 32767,32767,32767,32767,32767, 526,32767, 543, 556, 430, - 431, 433, 541, 455, 456, 457, 458, 459, 460, 461, - 463, 588,32767, 500,32767,32767,32767,32767, 337, 598, - 32767, 598,32767,32767,32767,32767,32767,32767,32767,32767, - 32767,32767,32767,32767,32767,32767,32767, 599,32767, 539, - 32767,32767,32767,32767, 429, 9, 76, 489, 43, 44, - 52, 58, 517, 518, 519, 520, 514, 515, 521, 516, - 32767,32767, 522, 564,32767,32767, 540, 591,32767,32767, - 32767,32767,32767,32767, 139,32767,32767,32767,32767,32767, - 32767,32767,32767,32767,32767,32767, 526,32767, 137,32767, + 32767,32767, 602,32767, 542,32767,32767,32767,32767, 431, + 9, 76, 491, 43, 44, 52, 58, 519, 520, 521, + 522, 516, 517, 523, 518,32767,32767, 524, 567,32767, + 32767, 543, 594,32767,32767,32767,32767,32767,32767, 139, 32767,32767,32767,32767,32767,32767,32767,32767,32767,32767, - 539,32767,32767,32767,32767, 313, 310,32767,32767,32767, + 32767, 529,32767, 137,32767,32767,32767,32767,32767,32767, + 32767,32767, 525,32767,32767,32767, 542,32767,32767,32767, + 32767, 314, 311,32767,32767,32767,32767,32767,32767,32767, + 32767,32767,32767,32767,32767,32767,32767,32767,32767, 542, + 32767,32767,32767,32767,32767, 291,32767, 308,32767,32767, 32767,32767,32767,32767,32767,32767,32767,32767,32767,32767, - 32767,32767,32767, 539,32767,32767,32767,32767,32767, 290, - 32767, 307,32767,32767,32767,32767,32767,32767,32767,32767, - 32767,32767,32767,32767,32767,32767,32767,32767, 285,32767, - 32767, 379,32767,32767,32767,32767, 358,32767,32767,32767, - 32767,32767,32767,32767,32767,32767,32767, 152, 152, 3, - 3, 340, 152, 152, 152, 340, 340, 152, 340, 340, - 340, 152, 152, 152, 152, 152, 152, 279, 184, 261, - 264, 246, 246, 152, 350, 152 + 32767,32767,32767,32767, 286,32767,32767, 381, 498, 294, + 296, 297,32767,32767,32767,32767, 360,32767,32767,32767, + 32767,32767,32767,32767,32767,32767,32767,32767, 153, 153, + 3, 3, 341, 153, 153, 153, 341, 341, 153, 341, + 341, 341, 153, 153, 153, 153, 153, 153, 280, 185, + 262, 265, 247, 247, 153, 352, 153 ); protected $goto = array( - 194, 194, 685, 425, 653, 346, 614, 650, 419, 310, - 311, 331, 569, 316, 424, 332, 426, 630, 1200, 930, - 693, 1051, 1201, 1204, 931, 1205, 165, 165, 165, 165, - 218, 195, 191, 191, 175, 177, 213, 191, 191, 191, - 191, 191, 192, 192, 192, 192, 192, 192, 186, 187, - 188, 189, 190, 215, 213, 216, 529, 530, 415, 531, - 533, 534, 535, 536, 537, 538, 539, 540, 1120, 166, - 167, 168, 193, 169, 170, 171, 164, 172, 173, 174, - 176, 212, 214, 217, 235, 240, 241, 242, 254, 255, - 256, 257, 258, 259, 260, 261, 263, 264, 265, 266, - 278, 279, 313, 314, 315, 420, 421, 422, 574, 219, - 220, 221, 222, 223, 224, 225, 226, 227, 228, 229, - 230, 231, 232, 233, 178, 234, 179, 196, 197, 198, - 236, 186, 187, 188, 189, 190, 215, 1120, 199, 180, - 181, 182, 200, 196, 183, 237, 201, 199, 163, 202, - 203, 184, 204, 205, 206, 185, 207, 208, 209, 210, - 211, 275, 275, 275, 275, 843, 593, 646, 647, 560, - 664, 665, 666, 720, 629, 631, 840, 418, 651, 604, - 841, 350, 675, 679, 996, 683, 691, 992, 616, 616, - 817, 350, 350, 1252, 1252, 1252, 1252, 1252, 1252, 1252, - 1252, 1252, 1252, 1092, 1093, 350, 350, 874, 350, 848, - 1337, 896, 891, 892, 905, 849, 893, 846, 894, 895, - 847, 548, 900, 899, 901, 350, 391, 394, 554, 594, - 598, 1270, 1270, 1072, 1068, 1069, 1270, 1270, 1270, 1270, - 1270, 1270, 1270, 1270, 1270, 1270, 1268, 1268, 815, 347, - 348, 1268, 1268, 1268, 1268, 1268, 1268, 1268, 1268, 1268, - 1268, 1221, 1020, 1221, 1020, 1221, 836, 5, 1020, 6, - 1020, 1020, 1281, 961, 1020, 1020, 1020, 1020, 1020, 1020, - 1020, 1020, 1020, 1020, 1020, 349, 349, 349, 349, 1221, - 460, 460, 566, 678, 1221, 1221, 1221, 1221, 344, 460, - 1221, 1221, 1221, 1302, 1302, 1302, 1302, 602, 617, 620, - 621, 622, 623, 643, 644, 645, 695, 836, 912, 553, - 546, 1310, 913, 548, 532, 532, 821, 856, 982, 532, - 532, 532, 532, 532, 532, 532, 532, 532, 532, 543, - 473, 543, 868, 543, 928, 855, 928, 389, 475, 337, - 546, 553, 562, 563, 339, 572, 595, 609, 610, 1320, - 1320, 249, 249, 1026, 1025, 15, 821, 450, 821, 494, - 565, 495, 955, 955, 955, 955, 1320, 501, 450, 949, - 956, 839, 652, 1321, 1321, 1169, 1214, 246, 246, 246, - 246, 248, 250, 1323, 985, 959, 959, 957, 959, 719, - 1321, 545, 994, 989, 470, 1295, 1296, 953, 405, 692, - 917, 1108, 432, 541, 541, 541, 541, 612, 597, 452, - 444, 1029, 1030, 1001, 658, 444, 1292, 444, 1292, 674, - 1292, 860, 833, 656, 980, 836, 861, 547, 557, 854, - 321, 305, 547, 333, 557, 1297, 1298, 392, 456, 570, - 607, 1211, 944, 398, 858, 1304, 1304, 1304, 1304, 463, - 573, 464, 465, 608, 1004, 866, 403, 404, 1328, 1329, - 1057, 662, 1212, 663, 471, 407, 408, 409, 723, 676, - 870, 1288, 410, 624, 626, 627, 342, 427, 1216, 869, - 857, 1056, 1060, 427, 864, 1061, 1103, 966, 0, 0, - 964, 1027, 1027, 0, 0, 0, 657, 1038, 1034, 1035, - 444, 444, 444, 444, 444, 444, 444, 444, 444, 444, - 444, 0, 1059, 444, 954, 0, 1290, 1290, 1059, 592, - 1085, 0, 696, 682, 682, 0, 502, 688, 1083, 0, - 0, 0, 1217, 1218, 272, 428, 1101, 873, 0, 544, - 831, 544, 0, 0, 0, 673, 938, 0, 0, 1015, - 1031, 1032, 0, 0, 0, 0, 0, 0, 1219, 1278, - 1279, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 252, 252, + 196, 196, 1032, 704, 695, 431, 659, 1063, 1335, 1335, + 425, 313, 314, 335, 574, 319, 430, 336, 432, 636, + 652, 653, 851, 670, 671, 672, 1335, 167, 167, 167, + 167, 221, 197, 193, 193, 177, 179, 216, 193, 193, + 193, 193, 193, 194, 194, 194, 194, 194, 194, 188, + 189, 190, 191, 192, 218, 216, 219, 535, 536, 421, + 537, 539, 540, 541, 542, 543, 544, 545, 546, 1133, + 168, 169, 170, 195, 171, 172, 173, 166, 174, 175, + 176, 178, 215, 217, 220, 238, 243, 244, 245, 257, + 258, 259, 260, 261, 262, 263, 264, 268, 269, 270, + 271, 281, 282, 316, 317, 318, 426, 427, 428, 579, + 222, 223, 224, 225, 226, 227, 228, 229, 230, 231, + 232, 233, 234, 235, 236, 180, 237, 181, 198, 199, + 200, 239, 188, 189, 190, 191, 192, 218, 1133, 201, + 182, 183, 184, 202, 198, 185, 240, 203, 201, 165, + 204, 205, 186, 206, 207, 208, 187, 209, 210, 211, + 212, 213, 214, 854, 619, 656, 278, 278, 278, 278, + 852, 621, 621, 350, 419, 598, 1266, 1266, 1266, 1266, + 1266, 1266, 1266, 1266, 1266, 1266, 1284, 1284, 832, 1105, + 1106, 1284, 1284, 1284, 1284, 1284, 1284, 1284, 1284, 1284, + 1284, 353, 353, 353, 353, 826, 558, 551, 908, 903, + 904, 917, 860, 905, 857, 906, 907, 858, 1035, 1035, + 911, 864, 679, 950, 458, 863, 1027, 1043, 1044, 832, + 885, 832, 1085, 1080, 1081, 1082, 341, 551, 558, 567, + 568, 343, 577, 600, 614, 615, 547, 547, 547, 547, + 973, 602, 15, 394, 397, 559, 599, 603, 1213, 942, + 1234, 571, 1234, 1214, 1217, 943, 1218, 1032, 1032, 1234, + 440, 912, 1032, 913, 1032, 1032, 1038, 1037, 1032, 1032, + 1032, 1032, 1032, 1032, 1032, 1032, 1032, 1032, 1032, 1316, + 1316, 1316, 1316, 1234, 476, 1309, 1310, 348, 1234, 1234, + 1234, 1234, 407, 408, 1234, 1234, 1234, 668, 1324, 669, + 354, 412, 413, 414, 867, 682, 466, 466, 415, 994, + 354, 354, 346, 924, 424, 466, 609, 925, 5, 879, + 6, 940, 866, 940, 354, 354, 1282, 1282, 354, 392, + 1351, 1282, 1282, 1282, 1282, 1282, 1282, 1282, 1282, 1282, + 1282, 553, 538, 538, 570, 354, 658, 538, 538, 538, + 538, 538, 538, 538, 538, 538, 538, 549, 565, 549, + 1041, 1042, 731, 635, 637, 850, 549, 657, 965, 410, + 703, 681, 685, 1008, 693, 702, 1004, 252, 252, 997, + 971, 971, 969, 971, 730, 1056, 550, 1006, 1001, 1182, + 456, 847, 1295, 1334, 1334, 967, 967, 967, 967, 325, + 308, 456, 961, 968, 249, 249, 249, 249, 251, 253, + 438, 1334, 351, 352, 684, 680, 552, 562, 450, 450, + 450, 552, 1306, 562, 1306, 479, 395, 462, 1337, 1311, + 1312, 1306, 664, 481, 500, 337, 501, 844, 469, 578, + 470, 471, 507, 847, 877, 553, 872, 1342, 1343, 1011, + 1011, 575, 612, 324, 275, 324, 1318, 1318, 1318, 1318, + 607, 622, 625, 626, 627, 628, 649, 650, 651, 706, + 956, 401, 692, 875, 1229, 828, 869, 692, 629, 631, + 633, 692, 433, 1302, 1225, 734, 613, 433, 880, 868, + 1068, 1072, 1069, 1016, 477, 1039, 1039, 881, 0, 976, + 663, 1050, 1046, 1047, 1073, 1116, 978, 0, 1227, 450, + 450, 450, 450, 450, 450, 450, 450, 450, 450, 450, + 929, 1121, 450, 966, 1071, 0, 0, 617, 1304, 1304, + 1071, 1230, 1231, 1013, 0, 0, 0, 0, 0, 842, + 0, 871, 0, 662, 992, 1114, 884, 597, 1098, 865, + 707, 0, 0, 508, 698, 0, 1096, 1232, 1292, 1293, + 0, 1224, 0, 847, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 999, 999 + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 255, 255 ); protected $gotoCheck = array( - 42, 42, 72, 65, 65, 96, 55, 55, 65, 65, - 65, 65, 65, 65, 65, 65, 65, 65, 78, 78, - 9, 126, 78, 78, 78, 78, 42, 42, 42, 42, + 42, 42, 72, 9, 72, 65, 65, 126, 181, 181, + 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, + 85, 85, 26, 85, 85, 85, 181, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, @@ -773,97 +780,97 @@ class Php7 extends \PhpParser\ParserAbstract 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, - 42, 23, 23, 23, 23, 15, 129, 85, 85, 48, - 85, 85, 85, 48, 48, 48, 26, 13, 48, 13, - 27, 14, 48, 48, 48, 48, 48, 48, 107, 107, - 7, 14, 14, 107, 107, 107, 107, 107, 107, 107, - 107, 107, 107, 143, 143, 14, 14, 45, 14, 15, - 14, 15, 15, 15, 15, 15, 15, 15, 15, 15, - 15, 14, 64, 15, 64, 14, 58, 58, 58, 58, - 58, 168, 168, 15, 15, 15, 168, 168, 168, 168, - 168, 168, 168, 168, 168, 168, 169, 169, 6, 96, - 96, 169, 169, 169, 169, 169, 169, 169, 169, 169, - 169, 72, 72, 72, 72, 72, 22, 46, 72, 46, - 72, 72, 14, 49, 72, 72, 72, 72, 72, 72, - 72, 72, 72, 72, 72, 24, 24, 24, 24, 72, - 148, 148, 170, 14, 72, 72, 72, 72, 177, 148, - 72, 72, 72, 9, 9, 9, 9, 80, 80, 80, - 80, 80, 80, 80, 80, 80, 80, 22, 72, 75, - 75, 179, 72, 14, 171, 171, 12, 35, 102, 171, - 171, 171, 171, 171, 171, 171, 171, 171, 171, 19, - 83, 19, 35, 19, 9, 35, 9, 61, 83, 75, - 75, 75, 75, 75, 75, 75, 75, 75, 75, 180, - 180, 5, 5, 117, 117, 75, 12, 19, 12, 154, - 103, 154, 19, 19, 19, 19, 180, 154, 19, 19, - 19, 25, 63, 181, 181, 150, 14, 5, 5, 5, - 5, 5, 5, 180, 25, 25, 25, 25, 25, 25, - 181, 25, 25, 25, 174, 174, 174, 92, 92, 92, - 17, 17, 112, 106, 106, 106, 106, 17, 106, 82, - 23, 118, 118, 17, 119, 23, 129, 23, 129, 115, - 129, 17, 18, 17, 17, 22, 39, 9, 9, 17, - 167, 167, 9, 29, 9, 176, 176, 9, 9, 2, - 2, 17, 91, 28, 37, 129, 129, 129, 129, 9, - 9, 9, 9, 79, 109, 9, 81, 81, 9, 9, - 128, 81, 159, 81, 156, 81, 81, 81, 98, 81, - 41, 129, 81, 84, 84, 84, 81, 116, 20, 16, - 16, 16, 16, 116, 9, 131, 146, 95, -1, -1, - 16, 116, 116, -1, -1, -1, 116, 116, 116, 116, + 42, 42, 42, 15, 55, 55, 23, 23, 23, 23, + 27, 107, 107, 96, 43, 129, 107, 107, 107, 107, + 107, 107, 107, 107, 107, 107, 168, 168, 12, 143, + 143, 168, 168, 168, 168, 168, 168, 168, 168, 168, + 168, 24, 24, 24, 24, 6, 75, 75, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 88, 88, + 15, 15, 88, 88, 82, 15, 88, 88, 88, 12, + 45, 12, 15, 15, 15, 15, 75, 75, 75, 75, + 75, 75, 75, 75, 75, 75, 106, 106, 106, 106, + 49, 106, 75, 58, 58, 58, 58, 58, 78, 78, + 72, 170, 72, 78, 78, 78, 78, 72, 72, 72, + 82, 64, 72, 64, 72, 72, 117, 117, 72, 72, + 72, 72, 72, 72, 72, 72, 72, 72, 72, 9, + 9, 9, 9, 72, 174, 174, 174, 177, 72, 72, + 72, 72, 81, 81, 72, 72, 72, 81, 179, 81, + 14, 81, 81, 81, 35, 81, 148, 148, 81, 102, + 14, 14, 81, 72, 13, 148, 13, 72, 46, 35, + 46, 9, 35, 9, 14, 14, 169, 169, 14, 61, + 14, 169, 169, 169, 169, 169, 169, 169, 169, 169, + 169, 14, 171, 171, 103, 14, 63, 171, 171, 171, + 171, 171, 171, 171, 171, 171, 171, 19, 48, 19, + 118, 118, 48, 48, 48, 25, 19, 48, 92, 92, + 92, 48, 48, 48, 48, 48, 48, 5, 5, 25, + 25, 25, 25, 25, 25, 113, 25, 25, 25, 150, + 19, 22, 14, 180, 180, 19, 19, 19, 19, 167, + 167, 19, 19, 19, 5, 5, 5, 5, 5, 5, + 112, 180, 96, 96, 14, 115, 9, 9, 23, 23, + 23, 9, 129, 9, 129, 83, 9, 9, 180, 176, + 176, 129, 119, 83, 154, 29, 154, 18, 9, 9, + 9, 9, 154, 22, 9, 14, 39, 9, 9, 106, + 106, 2, 2, 24, 24, 24, 129, 129, 129, 129, + 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, + 91, 28, 7, 9, 20, 7, 37, 7, 84, 84, + 84, 7, 116, 129, 159, 98, 79, 116, 16, 16, + 16, 16, 128, 109, 156, 116, 116, 41, -1, 16, + 116, 116, 116, 116, 131, 146, 95, -1, 14, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, - 23, -1, 129, 23, 16, -1, 129, 129, 129, 8, - 8, -1, 8, 8, 8, -1, 8, 8, 8, -1, - -1, -1, 20, 20, 24, 88, 16, 16, -1, 24, - 20, 24, -1, -1, -1, 88, 88, -1, -1, 88, - 88, 88, -1, -1, -1, -1, -1, -1, 20, 20, - 20, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, 5, 5, + 17, 17, 23, 16, 129, -1, -1, 17, 129, 129, + 129, 20, 20, 17, -1, -1, -1, -1, -1, 20, + -1, 17, -1, 17, 17, 16, 16, 8, 8, 17, + 8, -1, -1, 8, 8, -1, 8, 20, 20, 20, + -1, 17, -1, 22, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, 106, 106 + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, 5, 5 ); protected $gotoBase = array( - 0, 0, -250, 0, 0, 360, 235, 181, 522, 7, - 0, 0, 33, -156, -113, -178, 43, -49, 126, 72, - 100, 0, -9, 158, 282, 377, 172, 176, 120, 150, - 0, 0, 0, 0, 0, -39, 0, 119, 0, 116, - 0, 45, -1, 0, 0, 195, -456, 0, -529, 250, - 0, 0, 0, 0, 0, -33, 0, 0, 182, 0, - 0, 306, 0, 143, 203, -235, 0, 0, 0, 0, - 0, 0, -6, 0, 0, -21, 0, 0, -385, 124, - -46, -19, 144, -123, 10, -538, 0, 0, 275, 0, - 0, 127, 106, 0, 0, 60, -472, 0, 76, 0, - 0, 0, 294, 328, 0, 0, 386, -50, 0, 99, - 0, 0, 138, 0, 0, 149, 219, 87, 139, 137, - 0, 0, 0, 0, 0, 0, 19, 0, 101, 159, - 0, 59, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, -69, 0, 0, 58, 0, 257, 0, - 114, 0, 0, 0, -120, 0, 40, 0, 0, 108, - 0, 0, 0, 0, 0, 0, 0, 122, -7, 8, - 264, 86, 0, 0, 107, 0, 78, 269, 0, 291, - 55, 79, 0, 0 + 0, 0, -249, 0, 0, 386, 192, 475, 549, -10, + 0, 0, -108, -13, 13, -184, 46, 65, 138, 102, + 93, 0, 123, 163, 198, 371, 18, 166, 144, 149, + 0, 0, 0, 0, 0, -56, 0, 147, 0, 133, + 0, 66, -1, 162, 0, 214, -406, 0, -341, 226, + 0, 0, 0, 0, 0, 124, 0, 0, 208, 0, + 0, 297, 0, 114, 251, -236, 0, 0, 0, 0, + 0, 0, -5, 0, 0, -138, 0, 0, -149, 153, + 113, -189, -54, -34, 9, -696, 0, 0, -61, 0, + 0, 151, 74, 0, 0, 73, -310, 0, 89, 0, + 0, 0, 284, 311, 0, 0, 218, -70, 0, 134, + 0, 0, 143, 122, 0, 142, 220, -3, 85, 152, + 0, 0, 0, 0, 0, 0, 5, 0, 129, 167, + 0, 72, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, -86, 0, 0, 71, 0, 282, 0, + 125, 0, 0, 0, -51, 0, 64, 0, 0, 126, + 0, 0, 0, 0, 0, 0, 0, 88, -55, 95, + 232, 111, 0, 0, -6, 0, 68, 267, 0, 277, + 96, -299, 0, 0 ); protected $gotoDefault = array( - -32768, 506, 727, 4, 728, 921, 804, 813, 590, 523, - 694, 343, 618, 416, 1286, 898, 1107, 571, 832, 1230, - 1238, 451, 835, 326, 717, 880, 881, 882, 395, 381, - 387, 393, 641, 619, 488, 867, 447, 859, 480, 862, - 446, 871, 162, 413, 504, 875, 3, 877, 550, 908, - 382, 885, 383, 669, 887, 556, 889, 890, 390, 396, - 397, 1112, 564, 615, 902, 253, 558, 903, 380, 904, - 911, 385, 388, 680, 459, 499, 493, 406, 1087, 559, - 601, 638, 441, 467, 613, 625, 611, 474, 1023, 411, - 325, 943, 951, 481, 457, 965, 345, 973, 725, 1119, - 632, 483, 981, 633, 988, 991, 524, 525, 472, 1003, - 268, 1006, 484, 1044, 659, 1017, 1018, 660, 634, 1040, - 635, 661, 636, 1042, 466, 591, 1050, 448, 1058, 1274, - 449, 1062, 262, 1065, 274, 412, 429, 1070, 1071, 8, - 1077, 686, 687, 10, 273, 503, 1102, 681, 445, 1118, - 433, 1188, 1190, 552, 485, 1208, 1207, 672, 500, 1213, - 442, 1277, 443, 526, 468, 312, 527, 304, 329, 309, - 542, 291, 330, 528, 469, 1283, 1291, 327, 30, 1311, - 1322, 338, 568, 606 + -32768, 512, 738, 4, 739, 933, 815, 824, 595, 529, + 705, 347, 623, 422, 1300, 910, 1120, 576, 843, 1243, + 1251, 457, 846, 330, 728, 892, 893, 894, 398, 385, + 859, 396, 647, 624, 494, 878, 453, 870, 486, 873, + 452, 882, 164, 418, 510, 886, 3, 889, 555, 920, + 386, 897, 387, 675, 899, 561, 901, 902, 393, 399, + 400, 1125, 569, 620, 914, 256, 563, 915, 384, 916, + 923, 389, 391, 686, 465, 505, 499, 411, 1100, 564, + 606, 644, 447, 473, 618, 630, 616, 480, 434, 416, + 329, 955, 963, 487, 463, 977, 349, 985, 736, 1132, + 638, 489, 993, 639, 1000, 1003, 530, 531, 478, 1015, + 272, 1018, 490, 12, 665, 1029, 1030, 666, 640, 1052, + 641, 667, 642, 1054, 472, 596, 1062, 454, 1070, 1288, + 455, 1074, 266, 1077, 277, 417, 435, 1083, 1084, 9, + 1090, 696, 697, 11, 276, 509, 1115, 687, 451, 1131, + 439, 1201, 1203, 557, 491, 1221, 1220, 678, 506, 1226, + 448, 1291, 449, 532, 474, 315, 533, 307, 333, 312, + 548, 294, 334, 534, 475, 1297, 1305, 331, 31, 1325, + 1336, 342, 573, 611 ); protected $ruleToNonTerminal = array( @@ -882,30 +889,30 @@ class Php7 extends \PhpParser\ParserAbstract 4, 4, 4, 4, 29, 29, 30, 30, 32, 34, 34, 28, 36, 36, 33, 38, 38, 35, 35, 37, 37, 39, 39, 31, 40, 40, 41, 43, 44, 44, - 45, 46, 46, 48, 47, 47, 47, 47, 49, 49, + 45, 45, 46, 46, 48, 47, 47, 47, 47, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, - 49, 49, 25, 25, 68, 68, 71, 71, 70, 69, - 69, 62, 74, 74, 75, 75, 76, 76, 77, 77, - 78, 78, 79, 79, 26, 26, 27, 27, 27, 27, - 27, 87, 87, 89, 89, 82, 82, 90, 90, 91, - 91, 91, 83, 83, 86, 86, 84, 84, 92, 93, - 93, 56, 56, 64, 64, 67, 67, 67, 66, 94, - 94, 95, 57, 57, 57, 57, 96, 96, 97, 97, - 98, 98, 99, 100, 100, 101, 101, 102, 102, 54, - 54, 50, 50, 104, 52, 52, 105, 51, 51, 53, - 53, 63, 63, 63, 63, 80, 80, 108, 108, 110, - 110, 111, 111, 111, 111, 109, 109, 109, 113, 113, - 113, 113, 88, 88, 116, 116, 116, 117, 117, 114, - 114, 118, 118, 120, 120, 121, 121, 115, 122, 122, - 119, 123, 123, 123, 123, 112, 112, 81, 81, 81, - 20, 20, 20, 125, 124, 124, 126, 126, 126, 126, - 59, 127, 127, 128, 60, 130, 130, 131, 131, 132, - 132, 85, 133, 133, 133, 133, 133, 133, 138, 138, - 139, 139, 140, 140, 140, 140, 140, 141, 142, 142, - 137, 137, 134, 134, 136, 136, 144, 144, 143, 143, - 143, 143, 143, 143, 143, 135, 145, 145, 147, 146, - 146, 61, 103, 148, 148, 55, 55, 42, 42, 42, + 49, 49, 49, 25, 25, 68, 68, 71, 71, 70, + 69, 69, 62, 74, 74, 75, 75, 76, 76, 77, + 77, 78, 78, 79, 79, 26, 26, 27, 27, 27, + 27, 27, 87, 87, 89, 89, 82, 82, 90, 90, + 91, 91, 91, 83, 83, 86, 86, 84, 84, 92, + 93, 93, 56, 56, 64, 64, 67, 67, 67, 66, + 94, 94, 95, 57, 57, 57, 57, 96, 96, 97, + 97, 98, 98, 99, 100, 100, 101, 101, 102, 102, + 54, 54, 50, 50, 104, 52, 52, 105, 51, 51, + 53, 53, 63, 63, 63, 63, 80, 80, 108, 108, + 110, 110, 111, 111, 111, 111, 109, 109, 109, 113, + 113, 113, 113, 88, 88, 116, 116, 116, 117, 117, + 114, 114, 118, 118, 120, 120, 121, 121, 115, 122, + 122, 119, 123, 123, 123, 123, 112, 112, 81, 81, + 81, 20, 20, 20, 125, 124, 124, 126, 126, 126, + 126, 59, 127, 127, 128, 60, 130, 130, 131, 131, + 132, 132, 85, 133, 133, 133, 133, 133, 133, 133, + 138, 138, 139, 139, 140, 140, 140, 140, 140, 141, + 142, 142, 137, 137, 134, 134, 136, 136, 144, 144, + 143, 143, 143, 143, 143, 143, 143, 135, 145, 145, + 147, 146, 146, 61, 103, 148, 148, 55, 55, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, @@ -915,20 +922,20 @@ class Php7 extends \PhpParser\ParserAbstract 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, - 155, 149, 149, 154, 154, 157, 158, 158, 159, 160, - 161, 161, 161, 161, 19, 19, 72, 72, 72, 72, - 150, 150, 150, 150, 163, 163, 151, 151, 153, 153, - 153, 156, 156, 168, 168, 168, 168, 168, 168, 168, - 168, 168, 169, 169, 107, 171, 171, 171, 171, 152, - 152, 152, 152, 152, 152, 152, 152, 58, 58, 166, - 166, 166, 166, 172, 172, 162, 162, 162, 173, 173, - 173, 173, 173, 173, 73, 73, 65, 65, 65, 65, - 129, 129, 129, 129, 176, 175, 165, 165, 165, 165, - 165, 165, 165, 164, 164, 164, 174, 174, 174, 174, - 106, 170, 178, 178, 177, 177, 179, 179, 179, 179, - 179, 179, 179, 179, 167, 167, 167, 167, 181, 182, - 180, 180, 180, 180, 180, 180, 180, 180, 183, 183, - 183, 183 + 42, 42, 155, 149, 149, 154, 154, 157, 158, 158, + 159, 160, 161, 161, 161, 161, 19, 19, 72, 72, + 72, 72, 150, 150, 150, 150, 163, 163, 151, 151, + 153, 153, 153, 156, 156, 168, 168, 168, 168, 168, + 168, 168, 168, 168, 169, 169, 169, 107, 171, 171, + 171, 171, 152, 152, 152, 152, 152, 152, 152, 152, + 58, 58, 166, 166, 166, 166, 172, 172, 162, 162, + 162, 173, 173, 173, 173, 173, 173, 73, 73, 65, + 65, 65, 65, 129, 129, 129, 129, 176, 175, 165, + 165, 165, 165, 165, 165, 165, 164, 164, 164, 174, + 174, 174, 174, 106, 170, 178, 178, 177, 177, 179, + 179, 179, 179, 179, 179, 179, 179, 167, 167, 167, + 167, 181, 182, 180, 180, 180, 180, 180, 180, 180, + 180, 183, 183, 183, 183 ); protected $ruleToLength = array( @@ -944,56 +951,56 @@ class Php7 extends \PhpParser\ParserAbstract 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 1, 0, 1, 1, 2, 1, 3, 4, 1, 2, 0, 1, 1, 1, 1, 1, 3, 5, 4, - 3, 4, 2, 3, 1, 1, 7, 6, 2, 3, + 3, 4, 1, 3, 1, 1, 8, 7, 2, 3, 1, 2, 3, 1, 2, 3, 1, 1, 3, 1, 3, 1, 2, 2, 3, 1, 3, 2, 3, 1, - 3, 2, 0, 1, 1, 1, 1, 1, 3, 7, - 10, 5, 7, 9, 5, 3, 3, 3, 3, 3, - 3, 1, 2, 5, 7, 9, 6, 5, 6, 3, - 2, 1, 1, 1, 0, 2, 1, 3, 8, 0, - 4, 2, 1, 3, 0, 1, 0, 1, 0, 1, - 3, 1, 1, 1, 8, 9, 7, 8, 7, 6, - 8, 0, 2, 0, 2, 1, 2, 1, 2, 1, - 1, 1, 0, 2, 0, 2, 0, 2, 2, 1, - 3, 1, 4, 1, 4, 1, 1, 4, 2, 1, - 3, 3, 3, 4, 4, 5, 0, 2, 4, 3, - 1, 1, 7, 0, 2, 1, 3, 3, 4, 1, - 4, 0, 2, 5, 0, 2, 6, 0, 2, 0, - 3, 1, 2, 1, 1, 2, 0, 1, 3, 0, - 2, 1, 1, 1, 1, 6, 8, 6, 1, 2, - 1, 1, 1, 1, 1, 1, 1, 1, 3, 3, - 3, 1, 3, 3, 3, 3, 3, 1, 3, 3, - 1, 1, 2, 1, 1, 0, 1, 0, 2, 2, - 2, 4, 3, 1, 1, 3, 1, 2, 2, 3, - 2, 3, 1, 1, 2, 3, 1, 1, 3, 2, - 0, 1, 5, 5, 10, 3, 5, 1, 1, 3, - 0, 2, 4, 5, 4, 4, 4, 3, 1, 1, - 1, 1, 1, 1, 0, 1, 1, 2, 1, 1, - 1, 1, 1, 1, 1, 2, 1, 3, 1, 1, - 3, 2, 2, 3, 1, 0, 1, 1, 3, 3, - 3, 4, 1, 1, 2, 3, 3, 3, 3, 3, - 3, 3, 3, 3, 3, 3, 3, 3, 2, 2, - 2, 2, 3, 3, 3, 3, 3, 3, 3, 3, + 3, 3, 2, 0, 1, 1, 1, 1, 1, 3, + 7, 10, 5, 7, 9, 5, 3, 3, 3, 3, + 3, 3, 1, 2, 5, 7, 9, 6, 5, 6, + 3, 2, 1, 1, 1, 0, 2, 1, 3, 8, + 0, 4, 2, 1, 3, 0, 1, 0, 1, 0, + 1, 3, 1, 1, 1, 8, 9, 7, 8, 7, + 6, 8, 0, 2, 0, 2, 1, 2, 1, 2, + 1, 1, 1, 0, 2, 0, 2, 0, 2, 2, + 1, 3, 1, 4, 1, 4, 1, 1, 4, 2, + 1, 3, 3, 3, 4, 4, 5, 0, 2, 4, + 3, 1, 1, 7, 0, 2, 1, 3, 3, 4, + 1, 4, 0, 2, 5, 0, 2, 6, 0, 2, + 0, 3, 1, 2, 1, 1, 2, 0, 1, 3, + 0, 2, 1, 1, 1, 1, 6, 8, 6, 1, + 2, 1, 1, 1, 1, 1, 1, 1, 1, 3, + 3, 3, 1, 3, 3, 3, 3, 3, 1, 3, + 3, 1, 1, 2, 1, 1, 0, 1, 0, 2, + 2, 2, 4, 3, 1, 1, 3, 1, 2, 2, + 3, 2, 3, 1, 1, 2, 3, 1, 1, 3, + 2, 0, 1, 5, 5, 6, 10, 3, 5, 1, + 1, 3, 0, 2, 4, 5, 4, 4, 4, 3, + 1, 1, 1, 1, 1, 1, 0, 1, 1, 2, + 1, 1, 1, 1, 1, 1, 1, 2, 1, 3, + 1, 1, 3, 2, 2, 3, 1, 0, 1, 1, + 3, 3, 3, 4, 1, 1, 2, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 2, 2, 2, 2, 3, 3, 3, 3, 3, 3, - 3, 3, 3, 3, 3, 5, 4, 3, 4, 4, - 2, 2, 4, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 1, 3, 2, 1, 2, 4, - 2, 2, 8, 9, 8, 9, 9, 10, 9, 10, - 8, 3, 2, 0, 4, 2, 1, 3, 2, 1, - 2, 2, 2, 4, 1, 1, 1, 1, 1, 1, - 1, 1, 3, 1, 1, 1, 0, 3, 0, 1, - 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 3, 3, 3, 4, 1, 1, 3, 1, - 1, 1, 1, 1, 3, 2, 3, 0, 1, 1, - 3, 1, 1, 1, 1, 1, 3, 1, 1, 4, - 4, 1, 4, 4, 0, 1, 1, 1, 3, 3, - 1, 4, 2, 2, 1, 3, 1, 4, 4, 3, - 3, 3, 3, 1, 3, 1, 1, 3, 1, 1, - 4, 1, 1, 1, 3, 1, 1, 2, 1, 3, - 4, 3, 2, 0, 2, 2, 1, 2, 1, 1, - 1, 4, 3, 3, 3, 3, 6, 3, 1, 1, - 2, 1 + 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, + 3, 3, 2, 2, 2, 2, 3, 3, 3, 3, + 3, 3, 3, 3, 3, 3, 3, 5, 4, 3, + 4, 4, 2, 2, 4, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 1, 3, 2, 1, + 2, 4, 2, 2, 8, 9, 8, 9, 9, 10, + 9, 10, 8, 3, 2, 0, 4, 2, 1, 3, + 2, 1, 2, 2, 2, 4, 1, 1, 1, 1, + 1, 1, 1, 1, 3, 1, 1, 1, 0, 3, + 0, 1, 1, 0, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 3, 5, 3, 3, 4, 1, + 1, 3, 1, 1, 1, 1, 1, 3, 2, 3, + 0, 1, 1, 3, 1, 1, 1, 1, 1, 3, + 1, 1, 4, 4, 1, 4, 4, 0, 1, 1, + 1, 3, 3, 1, 4, 2, 2, 1, 3, 1, + 4, 4, 3, 3, 3, 3, 1, 3, 1, 1, + 3, 1, 1, 4, 1, 1, 1, 3, 1, 1, + 2, 1, 3, 4, 3, 2, 0, 2, 2, 1, + 2, 1, 1, 1, 4, 3, 3, 3, 3, 6, + 3, 1, 1, 2, 1 ); protected function initReduceCallbacks() { @@ -1372,7 +1379,7 @@ class Php7 extends \PhpParser\ParserAbstract $this->semValue = new Stmt\Use_($this->semStack[$stackPos-(4-3)], $this->semStack[$stackPos-(4-2)], $this->startAttributeStack[$stackPos-(4-1)] + $this->endAttributes); }, 122 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos-(2-1)]; + $this->semValue = $this->semStack[$stackPos-(1-1)]; }, 123 => function ($stackPos) { $this->semValue = new Stmt\Const_($this->semStack[$stackPos-(3-2)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); @@ -1384,10 +1391,10 @@ class Php7 extends \PhpParser\ParserAbstract $this->semValue = Stmt\Use_::TYPE_CONSTANT; }, 126 => function ($stackPos) { - $this->semValue = new Stmt\GroupUse($this->semStack[$stackPos-(7-3)], $this->semStack[$stackPos-(7-6)], $this->semStack[$stackPos-(7-2)], $this->startAttributeStack[$stackPos-(7-1)] + $this->endAttributes); + $this->semValue = new Stmt\GroupUse($this->semStack[$stackPos-(8-3)], $this->semStack[$stackPos-(8-6)], $this->semStack[$stackPos-(8-2)], $this->startAttributeStack[$stackPos-(8-1)] + $this->endAttributes); }, 127 => function ($stackPos) { - $this->semValue = new Stmt\GroupUse($this->semStack[$stackPos-(6-2)], $this->semStack[$stackPos-(6-5)], Stmt\Use_::TYPE_UNKNOWN, $this->startAttributeStack[$stackPos-(6-1)] + $this->endAttributes); + $this->semValue = new Stmt\GroupUse($this->semStack[$stackPos-(7-2)], $this->semStack[$stackPos-(7-5)], Stmt\Use_::TYPE_UNKNOWN, $this->startAttributeStack[$stackPos-(7-1)] + $this->endAttributes); }, 128 => function ($stackPos) { $this->semValue = $this->semStack[$stackPos-(2-1)]; @@ -1456,20 +1463,20 @@ class Php7 extends \PhpParser\ParserAbstract $this->semValue = array($this->semStack[$stackPos-(1-1)]); }, 150 => function ($stackPos) { - $this->semValue = new Node\Const_($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); + $this->semValue = new Node\Const_(new Node\Identifier($this->semStack[$stackPos-(3-1)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributeStack[$stackPos-(3-1)]), $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); }, 151 => function ($stackPos) { - if (is_array($this->semStack[$stackPos-(2-2)])) { $this->semValue = array_merge($this->semStack[$stackPos-(2-1)], $this->semStack[$stackPos-(2-2)]); } else { $this->semStack[$stackPos-(2-1)][] = $this->semStack[$stackPos-(2-2)]; $this->semValue = $this->semStack[$stackPos-(2-1)]; }; + $this->semValue = new Node\Const_(new Node\Identifier($this->semStack[$stackPos-(3-1)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributeStack[$stackPos-(3-1)]), $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); }, 152 => function ($stackPos) { - $this->semValue = array(); + if (is_array($this->semStack[$stackPos-(2-2)])) { $this->semValue = array_merge($this->semStack[$stackPos-(2-1)], $this->semStack[$stackPos-(2-2)]); } else { $this->semStack[$stackPos-(2-1)][] = $this->semStack[$stackPos-(2-2)]; $this->semValue = $this->semStack[$stackPos-(2-1)]; }; }, 153 => function ($stackPos) { - $startAttributes = $this->lookaheadStartAttributes; if (isset($startAttributes['comments'])) { $nop = new Stmt\Nop($this->createCommentNopAttributes($startAttributes['comments'])); } else { $nop = null; }; - if ($nop !== null) { $this->semStack[$stackPos-(1-1)][] = $nop; } $this->semValue = $this->semStack[$stackPos-(1-1)]; + $this->semValue = array(); }, 154 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos-(1-1)]; + $startAttributes = $this->lookaheadStartAttributes; if (isset($startAttributes['comments'])) { $nop = new Stmt\Nop($this->createCommentNopAttributes($startAttributes['comments'])); } else { $nop = null; }; + if ($nop !== null) { $this->semStack[$stackPos-(1-1)][] = $nop; } $this->semValue = $this->semStack[$stackPos-(1-1)]; }, 155 => function ($stackPos) { $this->semValue = $this->semStack[$stackPos-(1-1)]; @@ -1478,9 +1485,12 @@ class Php7 extends \PhpParser\ParserAbstract $this->semValue = $this->semStack[$stackPos-(1-1)]; }, 157 => function ($stackPos) { - throw new Error('__HALT_COMPILER() can only be used from the outermost scope', $this->startAttributeStack[$stackPos-(1-1)] + $this->endAttributes); + $this->semValue = $this->semStack[$stackPos-(1-1)]; }, 158 => function ($stackPos) { + throw new Error('__HALT_COMPILER() can only be used from the outermost scope', $this->startAttributeStack[$stackPos-(1-1)] + $this->endAttributes); + }, + 159 => function ($stackPos) { if ($this->semStack[$stackPos-(3-2)]) { $this->semValue = $this->semStack[$stackPos-(3-2)]; $attrs = $this->startAttributeStack[$stackPos-(3-1)]; $stmts = $this->semValue; if (!empty($attrs['comments'])) {$stmts[0]->setAttribute('comments', array_merge($attrs['comments'], $stmts[0]->getAttribute('comments', []))); }; @@ -1490,46 +1500,46 @@ class Php7 extends \PhpParser\ParserAbstract } }, - 159 => function ($stackPos) { + 160 => function ($stackPos) { $this->semValue = new Stmt\If_($this->semStack[$stackPos-(7-3)], ['stmts' => is_array($this->semStack[$stackPos-(7-5)]) ? $this->semStack[$stackPos-(7-5)] : array($this->semStack[$stackPos-(7-5)]), 'elseifs' => $this->semStack[$stackPos-(7-6)], 'else' => $this->semStack[$stackPos-(7-7)]], $this->startAttributeStack[$stackPos-(7-1)] + $this->endAttributes); }, - 160 => function ($stackPos) { + 161 => function ($stackPos) { $this->semValue = new Stmt\If_($this->semStack[$stackPos-(10-3)], ['stmts' => $this->semStack[$stackPos-(10-6)], 'elseifs' => $this->semStack[$stackPos-(10-7)], 'else' => $this->semStack[$stackPos-(10-8)]], $this->startAttributeStack[$stackPos-(10-1)] + $this->endAttributes); }, - 161 => function ($stackPos) { + 162 => function ($stackPos) { $this->semValue = new Stmt\While_($this->semStack[$stackPos-(5-3)], $this->semStack[$stackPos-(5-5)], $this->startAttributeStack[$stackPos-(5-1)] + $this->endAttributes); }, - 162 => function ($stackPos) { + 163 => function ($stackPos) { $this->semValue = new Stmt\Do_($this->semStack[$stackPos-(7-5)], is_array($this->semStack[$stackPos-(7-2)]) ? $this->semStack[$stackPos-(7-2)] : array($this->semStack[$stackPos-(7-2)]), $this->startAttributeStack[$stackPos-(7-1)] + $this->endAttributes); }, - 163 => function ($stackPos) { + 164 => function ($stackPos) { $this->semValue = new Stmt\For_(['init' => $this->semStack[$stackPos-(9-3)], 'cond' => $this->semStack[$stackPos-(9-5)], 'loop' => $this->semStack[$stackPos-(9-7)], 'stmts' => $this->semStack[$stackPos-(9-9)]], $this->startAttributeStack[$stackPos-(9-1)] + $this->endAttributes); }, - 164 => function ($stackPos) { + 165 => function ($stackPos) { $this->semValue = new Stmt\Switch_($this->semStack[$stackPos-(5-3)], $this->semStack[$stackPos-(5-5)], $this->startAttributeStack[$stackPos-(5-1)] + $this->endAttributes); }, - 165 => function ($stackPos) { + 166 => function ($stackPos) { $this->semValue = new Stmt\Break_($this->semStack[$stackPos-(3-2)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); }, - 166 => function ($stackPos) { + 167 => function ($stackPos) { $this->semValue = new Stmt\Continue_($this->semStack[$stackPos-(3-2)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); }, - 167 => function ($stackPos) { + 168 => function ($stackPos) { $this->semValue = new Stmt\Return_($this->semStack[$stackPos-(3-2)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); }, - 168 => function ($stackPos) { + 169 => function ($stackPos) { $this->semValue = new Stmt\Global_($this->semStack[$stackPos-(3-2)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); }, - 169 => function ($stackPos) { + 170 => function ($stackPos) { $this->semValue = new Stmt\Static_($this->semStack[$stackPos-(3-2)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); }, - 170 => function ($stackPos) { + 171 => function ($stackPos) { $this->semValue = new Stmt\Echo_($this->semStack[$stackPos-(3-2)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); }, - 171 => function ($stackPos) { + 172 => function ($stackPos) { $this->semValue = new Stmt\InlineHTML($this->semStack[$stackPos-(1-1)], $this->startAttributeStack[$stackPos-(1-1)] + $this->endAttributes); }, - 172 => function ($stackPos) { + 173 => function ($stackPos) { $e = $this->semStack[$stackPos-(2-1)]; if ($e instanceof Expr\Throw_) { @@ -1541,1128 +1551,1126 @@ class Php7 extends \PhpParser\ParserAbstract } }, - 173 => function ($stackPos) { + 174 => function ($stackPos) { $this->semValue = new Stmt\Unset_($this->semStack[$stackPos-(5-3)], $this->startAttributeStack[$stackPos-(5-1)] + $this->endAttributes); }, - 174 => function ($stackPos) { + 175 => function ($stackPos) { $this->semValue = new Stmt\Foreach_($this->semStack[$stackPos-(7-3)], $this->semStack[$stackPos-(7-5)][0], ['keyVar' => null, 'byRef' => $this->semStack[$stackPos-(7-5)][1], 'stmts' => $this->semStack[$stackPos-(7-7)]], $this->startAttributeStack[$stackPos-(7-1)] + $this->endAttributes); }, - 175 => function ($stackPos) { + 176 => function ($stackPos) { $this->semValue = new Stmt\Foreach_($this->semStack[$stackPos-(9-3)], $this->semStack[$stackPos-(9-7)][0], ['keyVar' => $this->semStack[$stackPos-(9-5)], 'byRef' => $this->semStack[$stackPos-(9-7)][1], 'stmts' => $this->semStack[$stackPos-(9-9)]], $this->startAttributeStack[$stackPos-(9-1)] + $this->endAttributes); }, - 176 => function ($stackPos) { + 177 => function ($stackPos) { $this->semValue = new Stmt\Foreach_($this->semStack[$stackPos-(6-3)], new Expr\Error($this->startAttributeStack[$stackPos-(6-4)] + $this->endAttributeStack[$stackPos-(6-4)]), ['stmts' => $this->semStack[$stackPos-(6-6)]], $this->startAttributeStack[$stackPos-(6-1)] + $this->endAttributes); }, - 177 => function ($stackPos) { + 178 => function ($stackPos) { $this->semValue = new Stmt\Declare_($this->semStack[$stackPos-(5-3)], $this->semStack[$stackPos-(5-5)], $this->startAttributeStack[$stackPos-(5-1)] + $this->endAttributes); }, - 178 => function ($stackPos) { + 179 => function ($stackPos) { $this->semValue = new Stmt\TryCatch($this->semStack[$stackPos-(6-3)], $this->semStack[$stackPos-(6-5)], $this->semStack[$stackPos-(6-6)], $this->startAttributeStack[$stackPos-(6-1)] + $this->endAttributes); $this->checkTryCatch($this->semValue); }, - 179 => function ($stackPos) { + 180 => function ($stackPos) { $this->semValue = new Stmt\Goto_($this->semStack[$stackPos-(3-2)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); }, - 180 => function ($stackPos) { + 181 => function ($stackPos) { $this->semValue = new Stmt\Label($this->semStack[$stackPos-(2-1)], $this->startAttributeStack[$stackPos-(2-1)] + $this->endAttributes); }, - 181 => function ($stackPos) { + 182 => function ($stackPos) { $this->semValue = array(); /* means: no statement */ }, - 182 => function ($stackPos) { + 183 => function ($stackPos) { $this->semValue = $this->semStack[$stackPos-(1-1)]; }, - 183 => function ($stackPos) { + 184 => function ($stackPos) { $startAttributes = $this->startAttributeStack[$stackPos-(1-1)]; if (isset($startAttributes['comments'])) { $this->semValue = new Stmt\Nop($startAttributes + $this->endAttributes); } else { $this->semValue = null; }; if ($this->semValue === null) $this->semValue = array(); /* means: no statement */ }, - 184 => function ($stackPos) { + 185 => function ($stackPos) { $this->semValue = array(); }, - 185 => function ($stackPos) { + 186 => function ($stackPos) { $this->semStack[$stackPos-(2-1)][] = $this->semStack[$stackPos-(2-2)]; $this->semValue = $this->semStack[$stackPos-(2-1)]; }, - 186 => function ($stackPos) { - $this->semValue = array($this->semStack[$stackPos-(1-1)]); - }, 187 => function ($stackPos) { - $this->semStack[$stackPos-(3-1)][] = $this->semStack[$stackPos-(3-3)]; $this->semValue = $this->semStack[$stackPos-(3-1)]; + $this->semValue = array($this->semStack[$stackPos-(1-1)]); }, 188 => function ($stackPos) { - $this->semValue = new Stmt\Catch_($this->semStack[$stackPos-(8-3)], $this->semStack[$stackPos-(8-4)], $this->semStack[$stackPos-(8-7)], $this->startAttributeStack[$stackPos-(8-1)] + $this->endAttributes); - }, - 189 => function ($stackPos) { - $this->semValue = null; - }, - 190 => function ($stackPos) { - $this->semValue = new Stmt\Finally_($this->semStack[$stackPos-(4-3)], $this->startAttributeStack[$stackPos-(4-1)] + $this->endAttributes); - }, - 191 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos-(2-1)]; - }, - 192 => function ($stackPos) { - $this->semValue = array($this->semStack[$stackPos-(1-1)]); - }, - 193 => function ($stackPos) { $this->semStack[$stackPos-(3-1)][] = $this->semStack[$stackPos-(3-3)]; $this->semValue = $this->semStack[$stackPos-(3-1)]; }, + 189 => function ($stackPos) { + $this->semValue = new Stmt\Catch_($this->semStack[$stackPos-(8-3)], $this->semStack[$stackPos-(8-4)], $this->semStack[$stackPos-(8-7)], $this->startAttributeStack[$stackPos-(8-1)] + $this->endAttributes); + }, + 190 => function ($stackPos) { + $this->semValue = null; + }, + 191 => function ($stackPos) { + $this->semValue = new Stmt\Finally_($this->semStack[$stackPos-(4-3)], $this->startAttributeStack[$stackPos-(4-1)] + $this->endAttributes); + }, + 192 => function ($stackPos) { + $this->semValue = $this->semStack[$stackPos-(2-1)]; + }, + 193 => function ($stackPos) { + $this->semValue = array($this->semStack[$stackPos-(1-1)]); + }, 194 => function ($stackPos) { - $this->semValue = false; + $this->semStack[$stackPos-(3-1)][] = $this->semStack[$stackPos-(3-3)]; $this->semValue = $this->semStack[$stackPos-(3-1)]; }, 195 => function ($stackPos) { - $this->semValue = true; + $this->semValue = false; }, 196 => function ($stackPos) { - $this->semValue = false; + $this->semValue = true; }, 197 => function ($stackPos) { - $this->semValue = true; - }, - 198 => function ($stackPos) { $this->semValue = false; }, - 199 => function ($stackPos) { + 198 => function ($stackPos) { $this->semValue = true; }, + 199 => function ($stackPos) { + $this->semValue = false; + }, 200 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos-(3-2)]; + $this->semValue = true; }, 201 => function ($stackPos) { - $this->semValue = []; + $this->semValue = $this->semStack[$stackPos-(3-2)]; }, 202 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos-(1-1)]; + $this->semValue = []; }, 203 => function ($stackPos) { - $this->semValue = new Node\Identifier($this->semStack[$stackPos-(1-1)], $this->startAttributeStack[$stackPos-(1-1)] + $this->endAttributes); + $this->semValue = $this->semStack[$stackPos-(1-1)]; }, 204 => function ($stackPos) { - $this->semValue = new Stmt\Function_($this->semStack[$stackPos-(8-3)], ['byRef' => $this->semStack[$stackPos-(8-2)], 'params' => $this->semStack[$stackPos-(8-5)], 'returnType' => $this->semStack[$stackPos-(8-7)], 'stmts' => $this->semStack[$stackPos-(8-8)], 'attrGroups' => []], $this->startAttributeStack[$stackPos-(8-1)] + $this->endAttributes); + $this->semValue = new Node\Identifier($this->semStack[$stackPos-(1-1)], $this->startAttributeStack[$stackPos-(1-1)] + $this->endAttributes); }, 205 => function ($stackPos) { - $this->semValue = new Stmt\Function_($this->semStack[$stackPos-(9-4)], ['byRef' => $this->semStack[$stackPos-(9-3)], 'params' => $this->semStack[$stackPos-(9-6)], 'returnType' => $this->semStack[$stackPos-(9-8)], 'stmts' => $this->semStack[$stackPos-(9-9)], 'attrGroups' => $this->semStack[$stackPos-(9-1)]], $this->startAttributeStack[$stackPos-(9-1)] + $this->endAttributes); + $this->semValue = new Stmt\Function_($this->semStack[$stackPos-(8-3)], ['byRef' => $this->semStack[$stackPos-(8-2)], 'params' => $this->semStack[$stackPos-(8-5)], 'returnType' => $this->semStack[$stackPos-(8-7)], 'stmts' => $this->semStack[$stackPos-(8-8)], 'attrGroups' => []], $this->startAttributeStack[$stackPos-(8-1)] + $this->endAttributes); }, 206 => function ($stackPos) { + $this->semValue = new Stmt\Function_($this->semStack[$stackPos-(9-4)], ['byRef' => $this->semStack[$stackPos-(9-3)], 'params' => $this->semStack[$stackPos-(9-6)], 'returnType' => $this->semStack[$stackPos-(9-8)], 'stmts' => $this->semStack[$stackPos-(9-9)], 'attrGroups' => $this->semStack[$stackPos-(9-1)]], $this->startAttributeStack[$stackPos-(9-1)] + $this->endAttributes); + }, + 207 => function ($stackPos) { $this->semValue = new Stmt\Class_($this->semStack[$stackPos-(7-2)], ['type' => $this->semStack[$stackPos-(7-1)], 'extends' => $this->semStack[$stackPos-(7-3)], 'implements' => $this->semStack[$stackPos-(7-4)], 'stmts' => $this->semStack[$stackPos-(7-6)], 'attrGroups' => []], $this->startAttributeStack[$stackPos-(7-1)] + $this->endAttributes); $this->checkClass($this->semValue, $stackPos-(7-2)); }, - 207 => function ($stackPos) { + 208 => function ($stackPos) { $this->semValue = new Stmt\Class_($this->semStack[$stackPos-(8-3)], ['type' => $this->semStack[$stackPos-(8-2)], 'extends' => $this->semStack[$stackPos-(8-4)], 'implements' => $this->semStack[$stackPos-(8-5)], 'stmts' => $this->semStack[$stackPos-(8-7)], 'attrGroups' => $this->semStack[$stackPos-(8-1)]], $this->startAttributeStack[$stackPos-(8-1)] + $this->endAttributes); $this->checkClass($this->semValue, $stackPos-(8-3)); }, - 208 => function ($stackPos) { + 209 => function ($stackPos) { $this->semValue = new Stmt\Interface_($this->semStack[$stackPos-(7-3)], ['extends' => $this->semStack[$stackPos-(7-4)], 'stmts' => $this->semStack[$stackPos-(7-6)], 'attrGroups' => $this->semStack[$stackPos-(7-1)]], $this->startAttributeStack[$stackPos-(7-1)] + $this->endAttributes); $this->checkInterface($this->semValue, $stackPos-(7-3)); }, - 209 => function ($stackPos) { + 210 => function ($stackPos) { $this->semValue = new Stmt\Trait_($this->semStack[$stackPos-(6-3)], ['stmts' => $this->semStack[$stackPos-(6-5)], 'attrGroups' => $this->semStack[$stackPos-(6-1)]], $this->startAttributeStack[$stackPos-(6-1)] + $this->endAttributes); }, - 210 => function ($stackPos) { + 211 => function ($stackPos) { $this->semValue = new Stmt\Enum_($this->semStack[$stackPos-(8-3)], ['scalarType' => $this->semStack[$stackPos-(8-4)], 'implements' => $this->semStack[$stackPos-(8-5)], 'stmts' => $this->semStack[$stackPos-(8-7)], 'attrGroups' => $this->semStack[$stackPos-(8-1)]], $this->startAttributeStack[$stackPos-(8-1)] + $this->endAttributes); $this->checkEnum($this->semValue, $stackPos-(8-3)); }, - 211 => function ($stackPos) { - $this->semValue = null; - }, 212 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos-(2-2)]; + $this->semValue = null; }, 213 => function ($stackPos) { - $this->semValue = null; + $this->semValue = $this->semStack[$stackPos-(2-2)]; }, 214 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos-(2-2)]; + $this->semValue = null; }, 215 => function ($stackPos) { - $this->semValue = 0; + $this->semValue = $this->semStack[$stackPos-(2-2)]; }, 216 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos-(2-1)]; + $this->semValue = 0; }, 217 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos-(1-1)]; + $this->semValue = $this->semStack[$stackPos-(2-1)]; }, 218 => function ($stackPos) { - $this->checkClassModifier($this->semStack[$stackPos-(2-1)], $this->semStack[$stackPos-(2-2)], $stackPos-(2-2)); $this->semValue = $this->semStack[$stackPos-(2-1)] | $this->semStack[$stackPos-(2-2)]; + $this->semValue = $this->semStack[$stackPos-(1-1)]; }, 219 => function ($stackPos) { - $this->semValue = Stmt\Class_::MODIFIER_ABSTRACT; + $this->checkClassModifier($this->semStack[$stackPos-(2-1)], $this->semStack[$stackPos-(2-2)], $stackPos-(2-2)); $this->semValue = $this->semStack[$stackPos-(2-1)] | $this->semStack[$stackPos-(2-2)]; }, 220 => function ($stackPos) { - $this->semValue = Stmt\Class_::MODIFIER_FINAL; + $this->semValue = Stmt\Class_::MODIFIER_ABSTRACT; }, 221 => function ($stackPos) { - $this->semValue = Stmt\Class_::MODIFIER_READONLY; + $this->semValue = Stmt\Class_::MODIFIER_FINAL; }, 222 => function ($stackPos) { - $this->semValue = null; + $this->semValue = Stmt\Class_::MODIFIER_READONLY; }, 223 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos-(2-2)]; - }, - 224 => function ($stackPos) { - $this->semValue = array(); - }, - 225 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos-(2-2)]; - }, - 226 => function ($stackPos) { - $this->semValue = array(); - }, - 227 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos-(2-2)]; - }, - 228 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos-(2-1)]; - }, - 229 => function ($stackPos) { - $this->semValue = array($this->semStack[$stackPos-(1-1)]); - }, - 230 => function ($stackPos) { - $this->semStack[$stackPos-(3-1)][] = $this->semStack[$stackPos-(3-3)]; $this->semValue = $this->semStack[$stackPos-(3-1)]; - }, - 231 => function ($stackPos) { - $this->semValue = is_array($this->semStack[$stackPos-(1-1)]) ? $this->semStack[$stackPos-(1-1)] : array($this->semStack[$stackPos-(1-1)]); - }, - 232 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos-(4-2)]; - }, - 233 => function ($stackPos) { - $this->semValue = is_array($this->semStack[$stackPos-(1-1)]) ? $this->semStack[$stackPos-(1-1)] : array($this->semStack[$stackPos-(1-1)]); - }, - 234 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos-(4-2)]; - }, - 235 => function ($stackPos) { - $this->semValue = is_array($this->semStack[$stackPos-(1-1)]) ? $this->semStack[$stackPos-(1-1)] : array($this->semStack[$stackPos-(1-1)]); - }, - 236 => function ($stackPos) { $this->semValue = null; }, - 237 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos-(4-2)]; + 224 => function ($stackPos) { + $this->semValue = $this->semStack[$stackPos-(2-2)]; }, - 238 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos-(2-1)]; - }, - 239 => function ($stackPos) { - $this->semValue = array($this->semStack[$stackPos-(1-1)]); - }, - 240 => function ($stackPos) { - $this->semStack[$stackPos-(3-1)][] = $this->semStack[$stackPos-(3-3)]; $this->semValue = $this->semStack[$stackPos-(3-1)]; - }, - 241 => function ($stackPos) { - $this->semValue = new Stmt\DeclareDeclare($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); - }, - 242 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos-(3-2)]; - }, - 243 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos-(4-3)]; - }, - 244 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos-(4-2)]; - }, - 245 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos-(5-3)]; - }, - 246 => function ($stackPos) { + 225 => function ($stackPos) { $this->semValue = array(); }, + 226 => function ($stackPos) { + $this->semValue = $this->semStack[$stackPos-(2-2)]; + }, + 227 => function ($stackPos) { + $this->semValue = array(); + }, + 228 => function ($stackPos) { + $this->semValue = $this->semStack[$stackPos-(2-2)]; + }, + 229 => function ($stackPos) { + $this->semValue = $this->semStack[$stackPos-(2-1)]; + }, + 230 => function ($stackPos) { + $this->semValue = array($this->semStack[$stackPos-(1-1)]); + }, + 231 => function ($stackPos) { + $this->semStack[$stackPos-(3-1)][] = $this->semStack[$stackPos-(3-3)]; $this->semValue = $this->semStack[$stackPos-(3-1)]; + }, + 232 => function ($stackPos) { + $this->semValue = is_array($this->semStack[$stackPos-(1-1)]) ? $this->semStack[$stackPos-(1-1)] : array($this->semStack[$stackPos-(1-1)]); + }, + 233 => function ($stackPos) { + $this->semValue = $this->semStack[$stackPos-(4-2)]; + }, + 234 => function ($stackPos) { + $this->semValue = is_array($this->semStack[$stackPos-(1-1)]) ? $this->semStack[$stackPos-(1-1)] : array($this->semStack[$stackPos-(1-1)]); + }, + 235 => function ($stackPos) { + $this->semValue = $this->semStack[$stackPos-(4-2)]; + }, + 236 => function ($stackPos) { + $this->semValue = is_array($this->semStack[$stackPos-(1-1)]) ? $this->semStack[$stackPos-(1-1)] : array($this->semStack[$stackPos-(1-1)]); + }, + 237 => function ($stackPos) { + $this->semValue = null; + }, + 238 => function ($stackPos) { + $this->semValue = $this->semStack[$stackPos-(4-2)]; + }, + 239 => function ($stackPos) { + $this->semValue = $this->semStack[$stackPos-(2-1)]; + }, + 240 => function ($stackPos) { + $this->semValue = array($this->semStack[$stackPos-(1-1)]); + }, + 241 => function ($stackPos) { + $this->semStack[$stackPos-(3-1)][] = $this->semStack[$stackPos-(3-3)]; $this->semValue = $this->semStack[$stackPos-(3-1)]; + }, + 242 => function ($stackPos) { + $this->semValue = new Stmt\DeclareDeclare($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); + }, + 243 => function ($stackPos) { + $this->semValue = $this->semStack[$stackPos-(3-2)]; + }, + 244 => function ($stackPos) { + $this->semValue = $this->semStack[$stackPos-(4-3)]; + }, + 245 => function ($stackPos) { + $this->semValue = $this->semStack[$stackPos-(4-2)]; + }, + 246 => function ($stackPos) { + $this->semValue = $this->semStack[$stackPos-(5-3)]; + }, 247 => function ($stackPos) { - $this->semStack[$stackPos-(2-1)][] = $this->semStack[$stackPos-(2-2)]; $this->semValue = $this->semStack[$stackPos-(2-1)]; + $this->semValue = array(); }, 248 => function ($stackPos) { - $this->semValue = new Stmt\Case_($this->semStack[$stackPos-(4-2)], $this->semStack[$stackPos-(4-4)], $this->startAttributeStack[$stackPos-(4-1)] + $this->endAttributes); + $this->semStack[$stackPos-(2-1)][] = $this->semStack[$stackPos-(2-2)]; $this->semValue = $this->semStack[$stackPos-(2-1)]; }, 249 => function ($stackPos) { - $this->semValue = new Stmt\Case_(null, $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); + $this->semValue = new Stmt\Case_($this->semStack[$stackPos-(4-2)], $this->semStack[$stackPos-(4-4)], $this->startAttributeStack[$stackPos-(4-1)] + $this->endAttributes); }, 250 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos]; + $this->semValue = new Stmt\Case_(null, $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); }, 251 => function ($stackPos) { $this->semValue = $this->semStack[$stackPos]; }, 252 => function ($stackPos) { - $this->semValue = new Expr\Match_($this->semStack[$stackPos-(7-3)], $this->semStack[$stackPos-(7-6)], $this->startAttributeStack[$stackPos-(7-1)] + $this->endAttributes); + $this->semValue = $this->semStack[$stackPos]; }, 253 => function ($stackPos) { - $this->semValue = []; + $this->semValue = new Expr\Match_($this->semStack[$stackPos-(7-3)], $this->semStack[$stackPos-(7-6)], $this->startAttributeStack[$stackPos-(7-1)] + $this->endAttributes); }, 254 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos-(2-1)]; + $this->semValue = []; }, 255 => function ($stackPos) { - $this->semValue = array($this->semStack[$stackPos-(1-1)]); + $this->semValue = $this->semStack[$stackPos-(2-1)]; }, 256 => function ($stackPos) { - $this->semStack[$stackPos-(3-1)][] = $this->semStack[$stackPos-(3-3)]; $this->semValue = $this->semStack[$stackPos-(3-1)]; + $this->semValue = array($this->semStack[$stackPos-(1-1)]); }, 257 => function ($stackPos) { - $this->semValue = new Node\MatchArm($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); + $this->semStack[$stackPos-(3-1)][] = $this->semStack[$stackPos-(3-3)]; $this->semValue = $this->semStack[$stackPos-(3-1)]; }, 258 => function ($stackPos) { - $this->semValue = new Node\MatchArm(null, $this->semStack[$stackPos-(4-4)], $this->startAttributeStack[$stackPos-(4-1)] + $this->endAttributes); + $this->semValue = new Node\MatchArm($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); }, 259 => function ($stackPos) { - $this->semValue = is_array($this->semStack[$stackPos-(1-1)]) ? $this->semStack[$stackPos-(1-1)] : array($this->semStack[$stackPos-(1-1)]); + $this->semValue = new Node\MatchArm(null, $this->semStack[$stackPos-(4-4)], $this->startAttributeStack[$stackPos-(4-1)] + $this->endAttributes); }, 260 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos-(4-2)]; + $this->semValue = is_array($this->semStack[$stackPos-(1-1)]) ? $this->semStack[$stackPos-(1-1)] : array($this->semStack[$stackPos-(1-1)]); }, 261 => function ($stackPos) { - $this->semValue = array(); + $this->semValue = $this->semStack[$stackPos-(4-2)]; }, 262 => function ($stackPos) { - $this->semStack[$stackPos-(2-1)][] = $this->semStack[$stackPos-(2-2)]; $this->semValue = $this->semStack[$stackPos-(2-1)]; - }, - 263 => function ($stackPos) { - $this->semValue = new Stmt\ElseIf_($this->semStack[$stackPos-(5-3)], is_array($this->semStack[$stackPos-(5-5)]) ? $this->semStack[$stackPos-(5-5)] : array($this->semStack[$stackPos-(5-5)]), $this->startAttributeStack[$stackPos-(5-1)] + $this->endAttributes); - }, - 264 => function ($stackPos) { $this->semValue = array(); }, - 265 => function ($stackPos) { + 263 => function ($stackPos) { $this->semStack[$stackPos-(2-1)][] = $this->semStack[$stackPos-(2-2)]; $this->semValue = $this->semStack[$stackPos-(2-1)]; }, + 264 => function ($stackPos) { + $this->semValue = new Stmt\ElseIf_($this->semStack[$stackPos-(5-3)], is_array($this->semStack[$stackPos-(5-5)]) ? $this->semStack[$stackPos-(5-5)] : array($this->semStack[$stackPos-(5-5)]), $this->startAttributeStack[$stackPos-(5-1)] + $this->endAttributes); + }, + 265 => function ($stackPos) { + $this->semValue = array(); + }, 266 => function ($stackPos) { - $this->semValue = new Stmt\ElseIf_($this->semStack[$stackPos-(6-3)], $this->semStack[$stackPos-(6-6)], $this->startAttributeStack[$stackPos-(6-1)] + $this->endAttributes); $this->fixupAlternativeElse($this->semValue); + $this->semStack[$stackPos-(2-1)][] = $this->semStack[$stackPos-(2-2)]; $this->semValue = $this->semStack[$stackPos-(2-1)]; }, 267 => function ($stackPos) { - $this->semValue = null; + $this->semValue = new Stmt\ElseIf_($this->semStack[$stackPos-(6-3)], $this->semStack[$stackPos-(6-6)], $this->startAttributeStack[$stackPos-(6-1)] + $this->endAttributes); $this->fixupAlternativeElse($this->semValue); }, 268 => function ($stackPos) { - $this->semValue = new Stmt\Else_(is_array($this->semStack[$stackPos-(2-2)]) ? $this->semStack[$stackPos-(2-2)] : array($this->semStack[$stackPos-(2-2)]), $this->startAttributeStack[$stackPos-(2-1)] + $this->endAttributes); - }, - 269 => function ($stackPos) { $this->semValue = null; }, + 269 => function ($stackPos) { + $this->semValue = new Stmt\Else_(is_array($this->semStack[$stackPos-(2-2)]) ? $this->semStack[$stackPos-(2-2)] : array($this->semStack[$stackPos-(2-2)]), $this->startAttributeStack[$stackPos-(2-1)] + $this->endAttributes); + }, 270 => function ($stackPos) { - $this->semValue = new Stmt\Else_($this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); $this->fixupAlternativeElse($this->semValue); + $this->semValue = null; }, 271 => function ($stackPos) { - $this->semValue = array($this->semStack[$stackPos-(1-1)], false); + $this->semValue = new Stmt\Else_($this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); $this->fixupAlternativeElse($this->semValue); }, 272 => function ($stackPos) { - $this->semValue = array($this->semStack[$stackPos-(2-2)], true); + $this->semValue = array($this->semStack[$stackPos-(1-1)], false); }, 273 => function ($stackPos) { - $this->semValue = array($this->semStack[$stackPos-(1-1)], false); + $this->semValue = array($this->semStack[$stackPos-(2-2)], true); }, 274 => function ($stackPos) { $this->semValue = array($this->semStack[$stackPos-(1-1)], false); }, 275 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos-(2-1)]; + $this->semValue = array($this->semStack[$stackPos-(1-1)], false); }, 276 => function ($stackPos) { - $this->semValue = array(); + $this->semValue = $this->semStack[$stackPos-(2-1)]; }, 277 => function ($stackPos) { - $this->semValue = array($this->semStack[$stackPos-(1-1)]); + $this->semValue = array(); }, 278 => function ($stackPos) { - $this->semStack[$stackPos-(3-1)][] = $this->semStack[$stackPos-(3-3)]; $this->semValue = $this->semStack[$stackPos-(3-1)]; + $this->semValue = array($this->semStack[$stackPos-(1-1)]); }, 279 => function ($stackPos) { - $this->semValue = 0; + $this->semStack[$stackPos-(3-1)][] = $this->semStack[$stackPos-(3-3)]; $this->semValue = $this->semStack[$stackPos-(3-1)]; }, 280 => function ($stackPos) { - $this->checkModifier($this->semStack[$stackPos-(2-1)], $this->semStack[$stackPos-(2-2)], $stackPos-(2-2)); $this->semValue = $this->semStack[$stackPos-(2-1)] | $this->semStack[$stackPos-(2-2)]; + $this->semValue = 0; }, 281 => function ($stackPos) { - $this->semValue = Stmt\Class_::MODIFIER_PUBLIC; + $this->checkModifier($this->semStack[$stackPos-(2-1)], $this->semStack[$stackPos-(2-2)], $stackPos-(2-2)); $this->semValue = $this->semStack[$stackPos-(2-1)] | $this->semStack[$stackPos-(2-2)]; }, 282 => function ($stackPos) { - $this->semValue = Stmt\Class_::MODIFIER_PROTECTED; + $this->semValue = Stmt\Class_::MODIFIER_PUBLIC; }, 283 => function ($stackPos) { - $this->semValue = Stmt\Class_::MODIFIER_PRIVATE; + $this->semValue = Stmt\Class_::MODIFIER_PROTECTED; }, 284 => function ($stackPos) { - $this->semValue = Stmt\Class_::MODIFIER_READONLY; + $this->semValue = Stmt\Class_::MODIFIER_PRIVATE; }, 285 => function ($stackPos) { + $this->semValue = Stmt\Class_::MODIFIER_READONLY; + }, + 286 => function ($stackPos) { $this->semValue = new Node\Param($this->semStack[$stackPos-(6-6)], null, $this->semStack[$stackPos-(6-3)], $this->semStack[$stackPos-(6-4)], $this->semStack[$stackPos-(6-5)], $this->startAttributeStack[$stackPos-(6-1)] + $this->endAttributes, $this->semStack[$stackPos-(6-2)], $this->semStack[$stackPos-(6-1)]); $this->checkParam($this->semValue); }, - 286 => function ($stackPos) { + 287 => function ($stackPos) { $this->semValue = new Node\Param($this->semStack[$stackPos-(8-6)], $this->semStack[$stackPos-(8-8)], $this->semStack[$stackPos-(8-3)], $this->semStack[$stackPos-(8-4)], $this->semStack[$stackPos-(8-5)], $this->startAttributeStack[$stackPos-(8-1)] + $this->endAttributes, $this->semStack[$stackPos-(8-2)], $this->semStack[$stackPos-(8-1)]); $this->checkParam($this->semValue); }, - 287 => function ($stackPos) { + 288 => function ($stackPos) { $this->semValue = new Node\Param(new Expr\Error($this->startAttributeStack[$stackPos-(6-1)] + $this->endAttributes), null, $this->semStack[$stackPos-(6-3)], $this->semStack[$stackPos-(6-4)], $this->semStack[$stackPos-(6-5)], $this->startAttributeStack[$stackPos-(6-1)] + $this->endAttributes, $this->semStack[$stackPos-(6-2)], $this->semStack[$stackPos-(6-1)]); }, - 288 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos-(1-1)]; - }, 289 => function ($stackPos) { - $this->semValue = new Node\NullableType($this->semStack[$stackPos-(2-2)], $this->startAttributeStack[$stackPos-(2-1)] + $this->endAttributes); + $this->semValue = $this->semStack[$stackPos-(1-1)]; }, 290 => function ($stackPos) { - $this->semValue = new Node\UnionType($this->semStack[$stackPos-(1-1)], $this->startAttributeStack[$stackPos-(1-1)] + $this->endAttributes); + $this->semValue = new Node\NullableType($this->semStack[$stackPos-(2-2)], $this->startAttributeStack[$stackPos-(2-1)] + $this->endAttributes); }, 291 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos-(1-1)]; + $this->semValue = new Node\UnionType($this->semStack[$stackPos-(1-1)], $this->startAttributeStack[$stackPos-(1-1)] + $this->endAttributes); }, 292 => function ($stackPos) { $this->semValue = $this->semStack[$stackPos-(1-1)]; }, 293 => function ($stackPos) { - $this->semValue = new Node\Name('static', $this->startAttributeStack[$stackPos-(1-1)] + $this->endAttributes); + $this->semValue = $this->semStack[$stackPos-(1-1)]; }, 294 => function ($stackPos) { - $this->semValue = $this->handleBuiltinTypes($this->semStack[$stackPos-(1-1)]); + $this->semValue = new Node\Name('static', $this->startAttributeStack[$stackPos-(1-1)] + $this->endAttributes); }, 295 => function ($stackPos) { - $this->semValue = new Node\Identifier('array', $this->startAttributeStack[$stackPos-(1-1)] + $this->endAttributes); + $this->semValue = $this->handleBuiltinTypes($this->semStack[$stackPos-(1-1)]); }, 296 => function ($stackPos) { - $this->semValue = new Node\Identifier('callable', $this->startAttributeStack[$stackPos-(1-1)] + $this->endAttributes); + $this->semValue = new Node\Identifier('array', $this->startAttributeStack[$stackPos-(1-1)] + $this->endAttributes); }, 297 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos-(1-1)]; + $this->semValue = new Node\Identifier('callable', $this->startAttributeStack[$stackPos-(1-1)] + $this->endAttributes); }, 298 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos-(3-2)]; + $this->semValue = $this->semStack[$stackPos-(1-1)]; }, 299 => function ($stackPos) { - $this->semValue = array($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)]); - }, - 300 => function ($stackPos) { - $this->semStack[$stackPos-(3-1)][] = $this->semStack[$stackPos-(3-3)]; $this->semValue = $this->semStack[$stackPos-(3-1)]; - }, - 301 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos-(1-1)]; - }, - 302 => function ($stackPos) { $this->semValue = $this->semStack[$stackPos-(3-2)]; }, - 303 => function ($stackPos) { + 300 => function ($stackPos) { $this->semValue = array($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)]); }, + 301 => function ($stackPos) { + $this->semStack[$stackPos-(3-1)][] = $this->semStack[$stackPos-(3-3)]; $this->semValue = $this->semStack[$stackPos-(3-1)]; + }, + 302 => function ($stackPos) { + $this->semValue = $this->semStack[$stackPos-(1-1)]; + }, + 303 => function ($stackPos) { + $this->semValue = $this->semStack[$stackPos-(3-2)]; + }, 304 => function ($stackPos) { - $this->semStack[$stackPos-(3-1)][] = $this->semStack[$stackPos-(3-3)]; $this->semValue = $this->semStack[$stackPos-(3-1)]; + $this->semValue = array($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)]); }, 305 => function ($stackPos) { - $this->semValue = array($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)]); + $this->semStack[$stackPos-(3-1)][] = $this->semStack[$stackPos-(3-3)]; $this->semValue = $this->semStack[$stackPos-(3-1)]; }, 306 => function ($stackPos) { - $this->semStack[$stackPos-(3-1)][] = $this->semStack[$stackPos-(3-3)]; $this->semValue = $this->semStack[$stackPos-(3-1)]; - }, - 307 => function ($stackPos) { - $this->semValue = new Node\IntersectionType($this->semStack[$stackPos-(1-1)], $this->startAttributeStack[$stackPos-(1-1)] + $this->endAttributes); - }, - 308 => function ($stackPos) { $this->semValue = array($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)]); }, - 309 => function ($stackPos) { + 307 => function ($stackPos) { $this->semStack[$stackPos-(3-1)][] = $this->semStack[$stackPos-(3-3)]; $this->semValue = $this->semStack[$stackPos-(3-1)]; }, - 310 => function ($stackPos) { + 308 => function ($stackPos) { $this->semValue = new Node\IntersectionType($this->semStack[$stackPos-(1-1)], $this->startAttributeStack[$stackPos-(1-1)] + $this->endAttributes); }, + 309 => function ($stackPos) { + $this->semValue = array($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)]); + }, + 310 => function ($stackPos) { + $this->semStack[$stackPos-(3-1)][] = $this->semStack[$stackPos-(3-3)]; $this->semValue = $this->semStack[$stackPos-(3-1)]; + }, 311 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos-(1-1)]; + $this->semValue = new Node\IntersectionType($this->semStack[$stackPos-(1-1)], $this->startAttributeStack[$stackPos-(1-1)] + $this->endAttributes); }, 312 => function ($stackPos) { - $this->semValue = new Node\NullableType($this->semStack[$stackPos-(2-2)], $this->startAttributeStack[$stackPos-(2-1)] + $this->endAttributes); + $this->semValue = $this->semStack[$stackPos-(1-1)]; }, 313 => function ($stackPos) { - $this->semValue = new Node\UnionType($this->semStack[$stackPos-(1-1)], $this->startAttributeStack[$stackPos-(1-1)] + $this->endAttributes); + $this->semValue = new Node\NullableType($this->semStack[$stackPos-(2-2)], $this->startAttributeStack[$stackPos-(2-1)] + $this->endAttributes); }, 314 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos-(1-1)]; + $this->semValue = new Node\UnionType($this->semStack[$stackPos-(1-1)], $this->startAttributeStack[$stackPos-(1-1)] + $this->endAttributes); }, 315 => function ($stackPos) { - $this->semValue = null; + $this->semValue = $this->semStack[$stackPos-(1-1)]; }, 316 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos-(1-1)]; + $this->semValue = null; }, 317 => function ($stackPos) { - $this->semValue = null; - }, - 318 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos-(2-2)]; - }, - 319 => function ($stackPos) { - $this->semValue = null; - }, - 320 => function ($stackPos) { - $this->semValue = array(); - }, - 321 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos-(4-2)]; - }, - 322 => function ($stackPos) { - $this->semValue = array($this->semStack[$stackPos-(3-2)]); - }, - 323 => function ($stackPos) { - $this->semValue = new Node\VariadicPlaceholder($this->startAttributeStack[$stackPos-(1-1)] + $this->endAttributes); - }, - 324 => function ($stackPos) { - $this->semValue = array($this->semStack[$stackPos-(1-1)]); - }, - 325 => function ($stackPos) { - $this->semStack[$stackPos-(3-1)][] = $this->semStack[$stackPos-(3-3)]; $this->semValue = $this->semStack[$stackPos-(3-1)]; - }, - 326 => function ($stackPos) { - $this->semValue = new Node\Arg($this->semStack[$stackPos-(1-1)], false, false, $this->startAttributeStack[$stackPos-(1-1)] + $this->endAttributes); - }, - 327 => function ($stackPos) { - $this->semValue = new Node\Arg($this->semStack[$stackPos-(2-2)], true, false, $this->startAttributeStack[$stackPos-(2-1)] + $this->endAttributes); - }, - 328 => function ($stackPos) { - $this->semValue = new Node\Arg($this->semStack[$stackPos-(2-2)], false, true, $this->startAttributeStack[$stackPos-(2-1)] + $this->endAttributes); - }, - 329 => function ($stackPos) { - $this->semValue = new Node\Arg($this->semStack[$stackPos-(3-3)], false, false, $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes, $this->semStack[$stackPos-(3-1)]); - }, - 330 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos-(2-1)]; - }, - 331 => function ($stackPos) { - $this->semStack[$stackPos-(3-1)][] = $this->semStack[$stackPos-(3-3)]; $this->semValue = $this->semStack[$stackPos-(3-1)]; - }, - 332 => function ($stackPos) { - $this->semValue = array($this->semStack[$stackPos-(1-1)]); - }, - 333 => function ($stackPos) { $this->semValue = $this->semStack[$stackPos-(1-1)]; }, - 334 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos-(2-1)]; + 318 => function ($stackPos) { + $this->semValue = null; }, - 335 => function ($stackPos) { - $this->semStack[$stackPos-(3-1)][] = $this->semStack[$stackPos-(3-3)]; $this->semValue = $this->semStack[$stackPos-(3-1)]; + 319 => function ($stackPos) { + $this->semValue = $this->semStack[$stackPos-(2-2)]; }, - 336 => function ($stackPos) { - $this->semValue = array($this->semStack[$stackPos-(1-1)]); + 320 => function ($stackPos) { + $this->semValue = null; }, - 337 => function ($stackPos) { - $this->semValue = new Stmt\StaticVar($this->semStack[$stackPos-(1-1)], null, $this->startAttributeStack[$stackPos-(1-1)] + $this->endAttributes); - }, - 338 => function ($stackPos) { - $this->semValue = new Stmt\StaticVar($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); - }, - 339 => function ($stackPos) { - if ($this->semStack[$stackPos-(2-2)] !== null) { $this->semStack[$stackPos-(2-1)][] = $this->semStack[$stackPos-(2-2)]; $this->semValue = $this->semStack[$stackPos-(2-1)]; } - }, - 340 => function ($stackPos) { + 321 => function ($stackPos) { $this->semValue = array(); }, + 322 => function ($stackPos) { + $this->semValue = $this->semStack[$stackPos-(4-2)]; + }, + 323 => function ($stackPos) { + $this->semValue = array($this->semStack[$stackPos-(3-2)]); + }, + 324 => function ($stackPos) { + $this->semValue = new Node\VariadicPlaceholder($this->startAttributeStack[$stackPos-(1-1)] + $this->endAttributes); + }, + 325 => function ($stackPos) { + $this->semValue = array($this->semStack[$stackPos-(1-1)]); + }, + 326 => function ($stackPos) { + $this->semStack[$stackPos-(3-1)][] = $this->semStack[$stackPos-(3-3)]; $this->semValue = $this->semStack[$stackPos-(3-1)]; + }, + 327 => function ($stackPos) { + $this->semValue = new Node\Arg($this->semStack[$stackPos-(1-1)], false, false, $this->startAttributeStack[$stackPos-(1-1)] + $this->endAttributes); + }, + 328 => function ($stackPos) { + $this->semValue = new Node\Arg($this->semStack[$stackPos-(2-2)], true, false, $this->startAttributeStack[$stackPos-(2-1)] + $this->endAttributes); + }, + 329 => function ($stackPos) { + $this->semValue = new Node\Arg($this->semStack[$stackPos-(2-2)], false, true, $this->startAttributeStack[$stackPos-(2-1)] + $this->endAttributes); + }, + 330 => function ($stackPos) { + $this->semValue = new Node\Arg($this->semStack[$stackPos-(3-3)], false, false, $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes, $this->semStack[$stackPos-(3-1)]); + }, + 331 => function ($stackPos) { + $this->semValue = $this->semStack[$stackPos-(2-1)]; + }, + 332 => function ($stackPos) { + $this->semStack[$stackPos-(3-1)][] = $this->semStack[$stackPos-(3-3)]; $this->semValue = $this->semStack[$stackPos-(3-1)]; + }, + 333 => function ($stackPos) { + $this->semValue = array($this->semStack[$stackPos-(1-1)]); + }, + 334 => function ($stackPos) { + $this->semValue = $this->semStack[$stackPos-(1-1)]; + }, + 335 => function ($stackPos) { + $this->semValue = $this->semStack[$stackPos-(2-1)]; + }, + 336 => function ($stackPos) { + $this->semStack[$stackPos-(3-1)][] = $this->semStack[$stackPos-(3-3)]; $this->semValue = $this->semStack[$stackPos-(3-1)]; + }, + 337 => function ($stackPos) { + $this->semValue = array($this->semStack[$stackPos-(1-1)]); + }, + 338 => function ($stackPos) { + $this->semValue = new Stmt\StaticVar($this->semStack[$stackPos-(1-1)], null, $this->startAttributeStack[$stackPos-(1-1)] + $this->endAttributes); + }, + 339 => function ($stackPos) { + $this->semValue = new Stmt\StaticVar($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); + }, + 340 => function ($stackPos) { + if ($this->semStack[$stackPos-(2-2)] !== null) { $this->semStack[$stackPos-(2-1)][] = $this->semStack[$stackPos-(2-2)]; $this->semValue = $this->semStack[$stackPos-(2-1)]; } else { $this->semValue = $this->semStack[$stackPos-(2-1)]; } + }, 341 => function ($stackPos) { + $this->semValue = array(); + }, + 342 => function ($stackPos) { $startAttributes = $this->lookaheadStartAttributes; if (isset($startAttributes['comments'])) { $nop = new Stmt\Nop($this->createCommentNopAttributes($startAttributes['comments'])); } else { $nop = null; }; if ($nop !== null) { $this->semStack[$stackPos-(1-1)][] = $nop; } $this->semValue = $this->semStack[$stackPos-(1-1)]; }, - 342 => function ($stackPos) { + 343 => function ($stackPos) { $this->semValue = new Stmt\Property($this->semStack[$stackPos-(5-2)], $this->semStack[$stackPos-(5-4)], $this->startAttributeStack[$stackPos-(5-1)] + $this->endAttributes, $this->semStack[$stackPos-(5-3)], $this->semStack[$stackPos-(5-1)]); $this->checkProperty($this->semValue, $stackPos-(5-2)); }, - 343 => function ($stackPos) { + 344 => function ($stackPos) { $this->semValue = new Stmt\ClassConst($this->semStack[$stackPos-(5-4)], $this->semStack[$stackPos-(5-2)], $this->startAttributeStack[$stackPos-(5-1)] + $this->endAttributes, $this->semStack[$stackPos-(5-1)]); $this->checkClassConst($this->semValue, $stackPos-(5-2)); }, - 344 => function ($stackPos) { + 345 => function ($stackPos) { + $this->semValue = new Stmt\ClassConst($this->semStack[$stackPos-(6-5)], $this->semStack[$stackPos-(6-2)], $this->startAttributeStack[$stackPos-(6-1)] + $this->endAttributes, $this->semStack[$stackPos-(6-1)], $this->semStack[$stackPos-(6-4)]); + $this->checkClassConst($this->semValue, $stackPos-(6-2)); + }, + 346 => function ($stackPos) { $this->semValue = new Stmt\ClassMethod($this->semStack[$stackPos-(10-5)], ['type' => $this->semStack[$stackPos-(10-2)], 'byRef' => $this->semStack[$stackPos-(10-4)], 'params' => $this->semStack[$stackPos-(10-7)], 'returnType' => $this->semStack[$stackPos-(10-9)], 'stmts' => $this->semStack[$stackPos-(10-10)], 'attrGroups' => $this->semStack[$stackPos-(10-1)]], $this->startAttributeStack[$stackPos-(10-1)] + $this->endAttributes); $this->checkClassMethod($this->semValue, $stackPos-(10-2)); }, - 345 => function ($stackPos) { + 347 => function ($stackPos) { $this->semValue = new Stmt\TraitUse($this->semStack[$stackPos-(3-2)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); }, - 346 => function ($stackPos) { + 348 => function ($stackPos) { $this->semValue = new Stmt\EnumCase($this->semStack[$stackPos-(5-3)], $this->semStack[$stackPos-(5-4)], $this->semStack[$stackPos-(5-1)], $this->startAttributeStack[$stackPos-(5-1)] + $this->endAttributes); }, - 347 => function ($stackPos) { - $this->semValue = null; /* will be skipped */ - }, - 348 => function ($stackPos) { - $this->semValue = array(); - }, 349 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos-(3-2)]; + $this->semValue = null; /* will be skipped */ }, 350 => function ($stackPos) { $this->semValue = array(); }, 351 => function ($stackPos) { - $this->semStack[$stackPos-(2-1)][] = $this->semStack[$stackPos-(2-2)]; $this->semValue = $this->semStack[$stackPos-(2-1)]; + $this->semValue = $this->semStack[$stackPos-(3-2)]; }, 352 => function ($stackPos) { - $this->semValue = new Stmt\TraitUseAdaptation\Precedence($this->semStack[$stackPos-(4-1)][0], $this->semStack[$stackPos-(4-1)][1], $this->semStack[$stackPos-(4-3)], $this->startAttributeStack[$stackPos-(4-1)] + $this->endAttributes); - }, - 353 => function ($stackPos) { - $this->semValue = new Stmt\TraitUseAdaptation\Alias($this->semStack[$stackPos-(5-1)][0], $this->semStack[$stackPos-(5-1)][1], $this->semStack[$stackPos-(5-3)], $this->semStack[$stackPos-(5-4)], $this->startAttributeStack[$stackPos-(5-1)] + $this->endAttributes); - }, - 354 => function ($stackPos) { - $this->semValue = new Stmt\TraitUseAdaptation\Alias($this->semStack[$stackPos-(4-1)][0], $this->semStack[$stackPos-(4-1)][1], $this->semStack[$stackPos-(4-3)], null, $this->startAttributeStack[$stackPos-(4-1)] + $this->endAttributes); - }, - 355 => function ($stackPos) { - $this->semValue = new Stmt\TraitUseAdaptation\Alias($this->semStack[$stackPos-(4-1)][0], $this->semStack[$stackPos-(4-1)][1], null, $this->semStack[$stackPos-(4-3)], $this->startAttributeStack[$stackPos-(4-1)] + $this->endAttributes); - }, - 356 => function ($stackPos) { - $this->semValue = new Stmt\TraitUseAdaptation\Alias($this->semStack[$stackPos-(4-1)][0], $this->semStack[$stackPos-(4-1)][1], null, $this->semStack[$stackPos-(4-3)], $this->startAttributeStack[$stackPos-(4-1)] + $this->endAttributes); - }, - 357 => function ($stackPos) { - $this->semValue = array($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)]); - }, - 358 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos-(1-1)]; - }, - 359 => function ($stackPos) { - $this->semValue = array(null, $this->semStack[$stackPos-(1-1)]); - }, - 360 => function ($stackPos) { - $this->semValue = null; - }, - 361 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos-(1-1)]; - }, - 362 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos-(1-1)]; - }, - 363 => function ($stackPos) { - $this->semValue = 0; - }, - 364 => function ($stackPos) { - $this->semValue = 0; - }, - 365 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos-(1-1)]; - }, - 366 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos-(1-1)]; - }, - 367 => function ($stackPos) { - $this->checkModifier($this->semStack[$stackPos-(2-1)], $this->semStack[$stackPos-(2-2)], $stackPos-(2-2)); $this->semValue = $this->semStack[$stackPos-(2-1)] | $this->semStack[$stackPos-(2-2)]; - }, - 368 => function ($stackPos) { - $this->semValue = Stmt\Class_::MODIFIER_PUBLIC; - }, - 369 => function ($stackPos) { - $this->semValue = Stmt\Class_::MODIFIER_PROTECTED; - }, - 370 => function ($stackPos) { - $this->semValue = Stmt\Class_::MODIFIER_PRIVATE; - }, - 371 => function ($stackPos) { - $this->semValue = Stmt\Class_::MODIFIER_STATIC; - }, - 372 => function ($stackPos) { - $this->semValue = Stmt\Class_::MODIFIER_ABSTRACT; - }, - 373 => function ($stackPos) { - $this->semValue = Stmt\Class_::MODIFIER_FINAL; - }, - 374 => function ($stackPos) { - $this->semValue = Stmt\Class_::MODIFIER_READONLY; - }, - 375 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos-(2-1)]; - }, - 376 => function ($stackPos) { - $this->semValue = array($this->semStack[$stackPos-(1-1)]); - }, - 377 => function ($stackPos) { - $this->semStack[$stackPos-(3-1)][] = $this->semStack[$stackPos-(3-3)]; $this->semValue = $this->semStack[$stackPos-(3-1)]; - }, - 378 => function ($stackPos) { - $this->semValue = new Node\VarLikeIdentifier(substr($this->semStack[$stackPos-(1-1)], 1), $this->startAttributeStack[$stackPos-(1-1)] + $this->endAttributes); - }, - 379 => function ($stackPos) { - $this->semValue = new Stmt\PropertyProperty($this->semStack[$stackPos-(1-1)], null, $this->startAttributeStack[$stackPos-(1-1)] + $this->endAttributes); - }, - 380 => function ($stackPos) { - $this->semValue = new Stmt\PropertyProperty($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); - }, - 381 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos-(2-1)]; - }, - 382 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos-(2-1)]; - }, - 383 => function ($stackPos) { - $this->semStack[$stackPos-(3-1)][] = $this->semStack[$stackPos-(3-3)]; $this->semValue = $this->semStack[$stackPos-(3-1)]; - }, - 384 => function ($stackPos) { - $this->semValue = array($this->semStack[$stackPos-(1-1)]); - }, - 385 => function ($stackPos) { $this->semValue = array(); }, - 386 => function ($stackPos) { + 353 => function ($stackPos) { + $this->semStack[$stackPos-(2-1)][] = $this->semStack[$stackPos-(2-2)]; $this->semValue = $this->semStack[$stackPos-(2-1)]; + }, + 354 => function ($stackPos) { + $this->semValue = new Stmt\TraitUseAdaptation\Precedence($this->semStack[$stackPos-(4-1)][0], $this->semStack[$stackPos-(4-1)][1], $this->semStack[$stackPos-(4-3)], $this->startAttributeStack[$stackPos-(4-1)] + $this->endAttributes); + }, + 355 => function ($stackPos) { + $this->semValue = new Stmt\TraitUseAdaptation\Alias($this->semStack[$stackPos-(5-1)][0], $this->semStack[$stackPos-(5-1)][1], $this->semStack[$stackPos-(5-3)], $this->semStack[$stackPos-(5-4)], $this->startAttributeStack[$stackPos-(5-1)] + $this->endAttributes); + }, + 356 => function ($stackPos) { + $this->semValue = new Stmt\TraitUseAdaptation\Alias($this->semStack[$stackPos-(4-1)][0], $this->semStack[$stackPos-(4-1)][1], $this->semStack[$stackPos-(4-3)], null, $this->startAttributeStack[$stackPos-(4-1)] + $this->endAttributes); + }, + 357 => function ($stackPos) { + $this->semValue = new Stmt\TraitUseAdaptation\Alias($this->semStack[$stackPos-(4-1)][0], $this->semStack[$stackPos-(4-1)][1], null, $this->semStack[$stackPos-(4-3)], $this->startAttributeStack[$stackPos-(4-1)] + $this->endAttributes); + }, + 358 => function ($stackPos) { + $this->semValue = new Stmt\TraitUseAdaptation\Alias($this->semStack[$stackPos-(4-1)][0], $this->semStack[$stackPos-(4-1)][1], null, $this->semStack[$stackPos-(4-3)], $this->startAttributeStack[$stackPos-(4-1)] + $this->endAttributes); + }, + 359 => function ($stackPos) { + $this->semValue = array($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)]); + }, + 360 => function ($stackPos) { $this->semValue = $this->semStack[$stackPos-(1-1)]; }, + 361 => function ($stackPos) { + $this->semValue = array(null, $this->semStack[$stackPos-(1-1)]); + }, + 362 => function ($stackPos) { + $this->semValue = null; + }, + 363 => function ($stackPos) { + $this->semValue = $this->semStack[$stackPos-(1-1)]; + }, + 364 => function ($stackPos) { + $this->semValue = $this->semStack[$stackPos-(1-1)]; + }, + 365 => function ($stackPos) { + $this->semValue = 0; + }, + 366 => function ($stackPos) { + $this->semValue = 0; + }, + 367 => function ($stackPos) { + $this->semValue = $this->semStack[$stackPos-(1-1)]; + }, + 368 => function ($stackPos) { + $this->semValue = $this->semStack[$stackPos-(1-1)]; + }, + 369 => function ($stackPos) { + $this->checkModifier($this->semStack[$stackPos-(2-1)], $this->semStack[$stackPos-(2-2)], $stackPos-(2-2)); $this->semValue = $this->semStack[$stackPos-(2-1)] | $this->semStack[$stackPos-(2-2)]; + }, + 370 => function ($stackPos) { + $this->semValue = Stmt\Class_::MODIFIER_PUBLIC; + }, + 371 => function ($stackPos) { + $this->semValue = Stmt\Class_::MODIFIER_PROTECTED; + }, + 372 => function ($stackPos) { + $this->semValue = Stmt\Class_::MODIFIER_PRIVATE; + }, + 373 => function ($stackPos) { + $this->semValue = Stmt\Class_::MODIFIER_STATIC; + }, + 374 => function ($stackPos) { + $this->semValue = Stmt\Class_::MODIFIER_ABSTRACT; + }, + 375 => function ($stackPos) { + $this->semValue = Stmt\Class_::MODIFIER_FINAL; + }, + 376 => function ($stackPos) { + $this->semValue = Stmt\Class_::MODIFIER_READONLY; + }, + 377 => function ($stackPos) { + $this->semValue = $this->semStack[$stackPos-(2-1)]; + }, + 378 => function ($stackPos) { + $this->semValue = array($this->semStack[$stackPos-(1-1)]); + }, + 379 => function ($stackPos) { + $this->semStack[$stackPos-(3-1)][] = $this->semStack[$stackPos-(3-3)]; $this->semValue = $this->semStack[$stackPos-(3-1)]; + }, + 380 => function ($stackPos) { + $this->semValue = new Node\VarLikeIdentifier(substr($this->semStack[$stackPos-(1-1)], 1), $this->startAttributeStack[$stackPos-(1-1)] + $this->endAttributes); + }, + 381 => function ($stackPos) { + $this->semValue = new Stmt\PropertyProperty($this->semStack[$stackPos-(1-1)], null, $this->startAttributeStack[$stackPos-(1-1)] + $this->endAttributes); + }, + 382 => function ($stackPos) { + $this->semValue = new Stmt\PropertyProperty($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); + }, + 383 => function ($stackPos) { + $this->semValue = $this->semStack[$stackPos-(2-1)]; + }, + 384 => function ($stackPos) { + $this->semValue = $this->semStack[$stackPos-(2-1)]; + }, + 385 => function ($stackPos) { + $this->semStack[$stackPos-(3-1)][] = $this->semStack[$stackPos-(3-3)]; $this->semValue = $this->semStack[$stackPos-(3-1)]; + }, + 386 => function ($stackPos) { + $this->semValue = array($this->semStack[$stackPos-(1-1)]); + }, 387 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos-(1-1)]; + $this->semValue = array(); }, 388 => function ($stackPos) { - $this->semValue = new Expr\Assign($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); + $this->semValue = $this->semStack[$stackPos-(1-1)]; }, 389 => function ($stackPos) { - $this->semValue = new Expr\Assign($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); + $this->semValue = $this->semStack[$stackPos-(1-1)]; }, 390 => function ($stackPos) { $this->semValue = new Expr\Assign($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); }, 391 => function ($stackPos) { - $this->semValue = new Expr\AssignRef($this->semStack[$stackPos-(4-1)], $this->semStack[$stackPos-(4-4)], $this->startAttributeStack[$stackPos-(4-1)] + $this->endAttributes); + $this->semValue = new Expr\Assign($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); }, 392 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos-(1-1)]; + $this->semValue = new Expr\Assign($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); }, 393 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos-(1-1)]; + $this->semValue = new Expr\AssignRef($this->semStack[$stackPos-(4-1)], $this->semStack[$stackPos-(4-4)], $this->startAttributeStack[$stackPos-(4-1)] + $this->endAttributes); }, 394 => function ($stackPos) { - $this->semValue = new Expr\Clone_($this->semStack[$stackPos-(2-2)], $this->startAttributeStack[$stackPos-(2-1)] + $this->endAttributes); + $this->semValue = $this->semStack[$stackPos-(1-1)]; }, 395 => function ($stackPos) { - $this->semValue = new Expr\AssignOp\Plus($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); + $this->semValue = $this->semStack[$stackPos-(1-1)]; }, 396 => function ($stackPos) { - $this->semValue = new Expr\AssignOp\Minus($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); + $this->semValue = new Expr\Clone_($this->semStack[$stackPos-(2-2)], $this->startAttributeStack[$stackPos-(2-1)] + $this->endAttributes); }, 397 => function ($stackPos) { - $this->semValue = new Expr\AssignOp\Mul($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); + $this->semValue = new Expr\AssignOp\Plus($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); }, 398 => function ($stackPos) { - $this->semValue = new Expr\AssignOp\Div($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); + $this->semValue = new Expr\AssignOp\Minus($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); }, 399 => function ($stackPos) { - $this->semValue = new Expr\AssignOp\Concat($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); + $this->semValue = new Expr\AssignOp\Mul($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); }, 400 => function ($stackPos) { - $this->semValue = new Expr\AssignOp\Mod($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); + $this->semValue = new Expr\AssignOp\Div($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); }, 401 => function ($stackPos) { - $this->semValue = new Expr\AssignOp\BitwiseAnd($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); + $this->semValue = new Expr\AssignOp\Concat($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); }, 402 => function ($stackPos) { - $this->semValue = new Expr\AssignOp\BitwiseOr($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); + $this->semValue = new Expr\AssignOp\Mod($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); }, 403 => function ($stackPos) { - $this->semValue = new Expr\AssignOp\BitwiseXor($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); + $this->semValue = new Expr\AssignOp\BitwiseAnd($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); }, 404 => function ($stackPos) { - $this->semValue = new Expr\AssignOp\ShiftLeft($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); + $this->semValue = new Expr\AssignOp\BitwiseOr($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); }, 405 => function ($stackPos) { - $this->semValue = new Expr\AssignOp\ShiftRight($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); + $this->semValue = new Expr\AssignOp\BitwiseXor($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); }, 406 => function ($stackPos) { - $this->semValue = new Expr\AssignOp\Pow($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); + $this->semValue = new Expr\AssignOp\ShiftLeft($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); }, 407 => function ($stackPos) { - $this->semValue = new Expr\AssignOp\Coalesce($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); + $this->semValue = new Expr\AssignOp\ShiftRight($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); }, 408 => function ($stackPos) { - $this->semValue = new Expr\PostInc($this->semStack[$stackPos-(2-1)], $this->startAttributeStack[$stackPos-(2-1)] + $this->endAttributes); + $this->semValue = new Expr\AssignOp\Pow($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); }, 409 => function ($stackPos) { - $this->semValue = new Expr\PreInc($this->semStack[$stackPos-(2-2)], $this->startAttributeStack[$stackPos-(2-1)] + $this->endAttributes); + $this->semValue = new Expr\AssignOp\Coalesce($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); }, 410 => function ($stackPos) { - $this->semValue = new Expr\PostDec($this->semStack[$stackPos-(2-1)], $this->startAttributeStack[$stackPos-(2-1)] + $this->endAttributes); + $this->semValue = new Expr\PostInc($this->semStack[$stackPos-(2-1)], $this->startAttributeStack[$stackPos-(2-1)] + $this->endAttributes); }, 411 => function ($stackPos) { - $this->semValue = new Expr\PreDec($this->semStack[$stackPos-(2-2)], $this->startAttributeStack[$stackPos-(2-1)] + $this->endAttributes); + $this->semValue = new Expr\PreInc($this->semStack[$stackPos-(2-2)], $this->startAttributeStack[$stackPos-(2-1)] + $this->endAttributes); }, 412 => function ($stackPos) { - $this->semValue = new Expr\BinaryOp\BooleanOr($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); + $this->semValue = new Expr\PostDec($this->semStack[$stackPos-(2-1)], $this->startAttributeStack[$stackPos-(2-1)] + $this->endAttributes); }, 413 => function ($stackPos) { - $this->semValue = new Expr\BinaryOp\BooleanAnd($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); + $this->semValue = new Expr\PreDec($this->semStack[$stackPos-(2-2)], $this->startAttributeStack[$stackPos-(2-1)] + $this->endAttributes); }, 414 => function ($stackPos) { - $this->semValue = new Expr\BinaryOp\LogicalOr($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); + $this->semValue = new Expr\BinaryOp\BooleanOr($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); }, 415 => function ($stackPos) { - $this->semValue = new Expr\BinaryOp\LogicalAnd($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); + $this->semValue = new Expr\BinaryOp\BooleanAnd($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); }, 416 => function ($stackPos) { - $this->semValue = new Expr\BinaryOp\LogicalXor($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); + $this->semValue = new Expr\BinaryOp\LogicalOr($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); }, 417 => function ($stackPos) { - $this->semValue = new Expr\BinaryOp\BitwiseOr($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); + $this->semValue = new Expr\BinaryOp\LogicalAnd($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); }, 418 => function ($stackPos) { - $this->semValue = new Expr\BinaryOp\BitwiseAnd($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); + $this->semValue = new Expr\BinaryOp\LogicalXor($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); }, 419 => function ($stackPos) { - $this->semValue = new Expr\BinaryOp\BitwiseAnd($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); + $this->semValue = new Expr\BinaryOp\BitwiseOr($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); }, 420 => function ($stackPos) { - $this->semValue = new Expr\BinaryOp\BitwiseXor($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); + $this->semValue = new Expr\BinaryOp\BitwiseAnd($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); }, 421 => function ($stackPos) { - $this->semValue = new Expr\BinaryOp\Concat($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); + $this->semValue = new Expr\BinaryOp\BitwiseAnd($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); }, 422 => function ($stackPos) { - $this->semValue = new Expr\BinaryOp\Plus($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); + $this->semValue = new Expr\BinaryOp\BitwiseXor($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); }, 423 => function ($stackPos) { - $this->semValue = new Expr\BinaryOp\Minus($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); + $this->semValue = new Expr\BinaryOp\Concat($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); }, 424 => function ($stackPos) { - $this->semValue = new Expr\BinaryOp\Mul($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); + $this->semValue = new Expr\BinaryOp\Plus($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); }, 425 => function ($stackPos) { - $this->semValue = new Expr\BinaryOp\Div($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); + $this->semValue = new Expr\BinaryOp\Minus($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); }, 426 => function ($stackPos) { - $this->semValue = new Expr\BinaryOp\Mod($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); + $this->semValue = new Expr\BinaryOp\Mul($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); }, 427 => function ($stackPos) { - $this->semValue = new Expr\BinaryOp\ShiftLeft($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); + $this->semValue = new Expr\BinaryOp\Div($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); }, 428 => function ($stackPos) { - $this->semValue = new Expr\BinaryOp\ShiftRight($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); + $this->semValue = new Expr\BinaryOp\Mod($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); }, 429 => function ($stackPos) { - $this->semValue = new Expr\BinaryOp\Pow($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); + $this->semValue = new Expr\BinaryOp\ShiftLeft($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); }, 430 => function ($stackPos) { - $this->semValue = new Expr\UnaryPlus($this->semStack[$stackPos-(2-2)], $this->startAttributeStack[$stackPos-(2-1)] + $this->endAttributes); + $this->semValue = new Expr\BinaryOp\ShiftRight($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); }, 431 => function ($stackPos) { - $this->semValue = new Expr\UnaryMinus($this->semStack[$stackPos-(2-2)], $this->startAttributeStack[$stackPos-(2-1)] + $this->endAttributes); + $this->semValue = new Expr\BinaryOp\Pow($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); }, 432 => function ($stackPos) { - $this->semValue = new Expr\BooleanNot($this->semStack[$stackPos-(2-2)], $this->startAttributeStack[$stackPos-(2-1)] + $this->endAttributes); + $this->semValue = new Expr\UnaryPlus($this->semStack[$stackPos-(2-2)], $this->startAttributeStack[$stackPos-(2-1)] + $this->endAttributes); }, 433 => function ($stackPos) { - $this->semValue = new Expr\BitwiseNot($this->semStack[$stackPos-(2-2)], $this->startAttributeStack[$stackPos-(2-1)] + $this->endAttributes); + $this->semValue = new Expr\UnaryMinus($this->semStack[$stackPos-(2-2)], $this->startAttributeStack[$stackPos-(2-1)] + $this->endAttributes); }, 434 => function ($stackPos) { - $this->semValue = new Expr\BinaryOp\Identical($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); + $this->semValue = new Expr\BooleanNot($this->semStack[$stackPos-(2-2)], $this->startAttributeStack[$stackPos-(2-1)] + $this->endAttributes); }, 435 => function ($stackPos) { - $this->semValue = new Expr\BinaryOp\NotIdentical($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); + $this->semValue = new Expr\BitwiseNot($this->semStack[$stackPos-(2-2)], $this->startAttributeStack[$stackPos-(2-1)] + $this->endAttributes); }, 436 => function ($stackPos) { - $this->semValue = new Expr\BinaryOp\Equal($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); + $this->semValue = new Expr\BinaryOp\Identical($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); }, 437 => function ($stackPos) { - $this->semValue = new Expr\BinaryOp\NotEqual($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); + $this->semValue = new Expr\BinaryOp\NotIdentical($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); }, 438 => function ($stackPos) { - $this->semValue = new Expr\BinaryOp\Spaceship($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); + $this->semValue = new Expr\BinaryOp\Equal($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); }, 439 => function ($stackPos) { - $this->semValue = new Expr\BinaryOp\Smaller($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); + $this->semValue = new Expr\BinaryOp\NotEqual($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); }, 440 => function ($stackPos) { - $this->semValue = new Expr\BinaryOp\SmallerOrEqual($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); + $this->semValue = new Expr\BinaryOp\Spaceship($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); }, 441 => function ($stackPos) { - $this->semValue = new Expr\BinaryOp\Greater($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); + $this->semValue = new Expr\BinaryOp\Smaller($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); }, 442 => function ($stackPos) { - $this->semValue = new Expr\BinaryOp\GreaterOrEqual($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); + $this->semValue = new Expr\BinaryOp\SmallerOrEqual($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); }, 443 => function ($stackPos) { - $this->semValue = new Expr\Instanceof_($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); + $this->semValue = new Expr\BinaryOp\Greater($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); }, 444 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos-(3-2)]; + $this->semValue = new Expr\BinaryOp\GreaterOrEqual($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); }, 445 => function ($stackPos) { - $this->semValue = new Expr\Ternary($this->semStack[$stackPos-(5-1)], $this->semStack[$stackPos-(5-3)], $this->semStack[$stackPos-(5-5)], $this->startAttributeStack[$stackPos-(5-1)] + $this->endAttributes); + $this->semValue = new Expr\Instanceof_($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); }, 446 => function ($stackPos) { - $this->semValue = new Expr\Ternary($this->semStack[$stackPos-(4-1)], null, $this->semStack[$stackPos-(4-4)], $this->startAttributeStack[$stackPos-(4-1)] + $this->endAttributes); + $this->semValue = $this->semStack[$stackPos-(3-2)]; }, 447 => function ($stackPos) { - $this->semValue = new Expr\BinaryOp\Coalesce($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); + $this->semValue = new Expr\Ternary($this->semStack[$stackPos-(5-1)], $this->semStack[$stackPos-(5-3)], $this->semStack[$stackPos-(5-5)], $this->startAttributeStack[$stackPos-(5-1)] + $this->endAttributes); }, 448 => function ($stackPos) { - $this->semValue = new Expr\Isset_($this->semStack[$stackPos-(4-3)], $this->startAttributeStack[$stackPos-(4-1)] + $this->endAttributes); + $this->semValue = new Expr\Ternary($this->semStack[$stackPos-(4-1)], null, $this->semStack[$stackPos-(4-4)], $this->startAttributeStack[$stackPos-(4-1)] + $this->endAttributes); }, 449 => function ($stackPos) { - $this->semValue = new Expr\Empty_($this->semStack[$stackPos-(4-3)], $this->startAttributeStack[$stackPos-(4-1)] + $this->endAttributes); + $this->semValue = new Expr\BinaryOp\Coalesce($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); }, 450 => function ($stackPos) { - $this->semValue = new Expr\Include_($this->semStack[$stackPos-(2-2)], Expr\Include_::TYPE_INCLUDE, $this->startAttributeStack[$stackPos-(2-1)] + $this->endAttributes); + $this->semValue = new Expr\Isset_($this->semStack[$stackPos-(4-3)], $this->startAttributeStack[$stackPos-(4-1)] + $this->endAttributes); }, 451 => function ($stackPos) { - $this->semValue = new Expr\Include_($this->semStack[$stackPos-(2-2)], Expr\Include_::TYPE_INCLUDE_ONCE, $this->startAttributeStack[$stackPos-(2-1)] + $this->endAttributes); + $this->semValue = new Expr\Empty_($this->semStack[$stackPos-(4-3)], $this->startAttributeStack[$stackPos-(4-1)] + $this->endAttributes); }, 452 => function ($stackPos) { - $this->semValue = new Expr\Eval_($this->semStack[$stackPos-(4-3)], $this->startAttributeStack[$stackPos-(4-1)] + $this->endAttributes); + $this->semValue = new Expr\Include_($this->semStack[$stackPos-(2-2)], Expr\Include_::TYPE_INCLUDE, $this->startAttributeStack[$stackPos-(2-1)] + $this->endAttributes); }, 453 => function ($stackPos) { - $this->semValue = new Expr\Include_($this->semStack[$stackPos-(2-2)], Expr\Include_::TYPE_REQUIRE, $this->startAttributeStack[$stackPos-(2-1)] + $this->endAttributes); + $this->semValue = new Expr\Include_($this->semStack[$stackPos-(2-2)], Expr\Include_::TYPE_INCLUDE_ONCE, $this->startAttributeStack[$stackPos-(2-1)] + $this->endAttributes); }, 454 => function ($stackPos) { - $this->semValue = new Expr\Include_($this->semStack[$stackPos-(2-2)], Expr\Include_::TYPE_REQUIRE_ONCE, $this->startAttributeStack[$stackPos-(2-1)] + $this->endAttributes); + $this->semValue = new Expr\Eval_($this->semStack[$stackPos-(4-3)], $this->startAttributeStack[$stackPos-(4-1)] + $this->endAttributes); }, 455 => function ($stackPos) { - $this->semValue = new Expr\Cast\Int_($this->semStack[$stackPos-(2-2)], $this->startAttributeStack[$stackPos-(2-1)] + $this->endAttributes); + $this->semValue = new Expr\Include_($this->semStack[$stackPos-(2-2)], Expr\Include_::TYPE_REQUIRE, $this->startAttributeStack[$stackPos-(2-1)] + $this->endAttributes); }, 456 => function ($stackPos) { + $this->semValue = new Expr\Include_($this->semStack[$stackPos-(2-2)], Expr\Include_::TYPE_REQUIRE_ONCE, $this->startAttributeStack[$stackPos-(2-1)] + $this->endAttributes); + }, + 457 => function ($stackPos) { + $this->semValue = new Expr\Cast\Int_($this->semStack[$stackPos-(2-2)], $this->startAttributeStack[$stackPos-(2-1)] + $this->endAttributes); + }, + 458 => function ($stackPos) { $attrs = $this->startAttributeStack[$stackPos-(2-1)] + $this->endAttributes; $attrs['kind'] = $this->getFloatCastKind($this->semStack[$stackPos-(2-1)]); $this->semValue = new Expr\Cast\Double($this->semStack[$stackPos-(2-2)], $attrs); }, - 457 => function ($stackPos) { + 459 => function ($stackPos) { $this->semValue = new Expr\Cast\String_($this->semStack[$stackPos-(2-2)], $this->startAttributeStack[$stackPos-(2-1)] + $this->endAttributes); }, - 458 => function ($stackPos) { + 460 => function ($stackPos) { $this->semValue = new Expr\Cast\Array_($this->semStack[$stackPos-(2-2)], $this->startAttributeStack[$stackPos-(2-1)] + $this->endAttributes); }, - 459 => function ($stackPos) { + 461 => function ($stackPos) { $this->semValue = new Expr\Cast\Object_($this->semStack[$stackPos-(2-2)], $this->startAttributeStack[$stackPos-(2-1)] + $this->endAttributes); }, - 460 => function ($stackPos) { + 462 => function ($stackPos) { $this->semValue = new Expr\Cast\Bool_($this->semStack[$stackPos-(2-2)], $this->startAttributeStack[$stackPos-(2-1)] + $this->endAttributes); }, - 461 => function ($stackPos) { + 463 => function ($stackPos) { $this->semValue = new Expr\Cast\Unset_($this->semStack[$stackPos-(2-2)], $this->startAttributeStack[$stackPos-(2-1)] + $this->endAttributes); }, - 462 => function ($stackPos) { + 464 => function ($stackPos) { $attrs = $this->startAttributeStack[$stackPos-(2-1)] + $this->endAttributes; $attrs['kind'] = strtolower($this->semStack[$stackPos-(2-1)]) === 'exit' ? Expr\Exit_::KIND_EXIT : Expr\Exit_::KIND_DIE; $this->semValue = new Expr\Exit_($this->semStack[$stackPos-(2-2)], $attrs); }, - 463 => function ($stackPos) { + 465 => function ($stackPos) { $this->semValue = new Expr\ErrorSuppress($this->semStack[$stackPos-(2-2)], $this->startAttributeStack[$stackPos-(2-1)] + $this->endAttributes); }, - 464 => function ($stackPos) { + 466 => function ($stackPos) { $this->semValue = $this->semStack[$stackPos-(1-1)]; }, - 465 => function ($stackPos) { + 467 => function ($stackPos) { $this->semValue = new Expr\ShellExec($this->semStack[$stackPos-(3-2)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); }, - 466 => function ($stackPos) { + 468 => function ($stackPos) { $this->semValue = new Expr\Print_($this->semStack[$stackPos-(2-2)], $this->startAttributeStack[$stackPos-(2-1)] + $this->endAttributes); }, - 467 => function ($stackPos) { + 469 => function ($stackPos) { $this->semValue = new Expr\Yield_(null, null, $this->startAttributeStack[$stackPos-(1-1)] + $this->endAttributes); }, - 468 => function ($stackPos) { + 470 => function ($stackPos) { $this->semValue = new Expr\Yield_($this->semStack[$stackPos-(2-2)], null, $this->startAttributeStack[$stackPos-(2-1)] + $this->endAttributes); }, - 469 => function ($stackPos) { + 471 => function ($stackPos) { $this->semValue = new Expr\Yield_($this->semStack[$stackPos-(4-4)], $this->semStack[$stackPos-(4-2)], $this->startAttributeStack[$stackPos-(4-1)] + $this->endAttributes); }, - 470 => function ($stackPos) { + 472 => function ($stackPos) { $this->semValue = new Expr\YieldFrom($this->semStack[$stackPos-(2-2)], $this->startAttributeStack[$stackPos-(2-1)] + $this->endAttributes); }, - 471 => function ($stackPos) { + 473 => function ($stackPos) { $this->semValue = new Expr\Throw_($this->semStack[$stackPos-(2-2)], $this->startAttributeStack[$stackPos-(2-1)] + $this->endAttributes); }, - 472 => function ($stackPos) { + 474 => function ($stackPos) { $this->semValue = new Expr\ArrowFunction(['static' => false, 'byRef' => $this->semStack[$stackPos-(8-2)], 'params' => $this->semStack[$stackPos-(8-4)], 'returnType' => $this->semStack[$stackPos-(8-6)], 'expr' => $this->semStack[$stackPos-(8-8)], 'attrGroups' => []], $this->startAttributeStack[$stackPos-(8-1)] + $this->endAttributes); }, - 473 => function ($stackPos) { + 475 => function ($stackPos) { $this->semValue = new Expr\ArrowFunction(['static' => true, 'byRef' => $this->semStack[$stackPos-(9-3)], 'params' => $this->semStack[$stackPos-(9-5)], 'returnType' => $this->semStack[$stackPos-(9-7)], 'expr' => $this->semStack[$stackPos-(9-9)], 'attrGroups' => []], $this->startAttributeStack[$stackPos-(9-1)] + $this->endAttributes); }, - 474 => function ($stackPos) { + 476 => function ($stackPos) { $this->semValue = new Expr\Closure(['static' => false, 'byRef' => $this->semStack[$stackPos-(8-2)], 'params' => $this->semStack[$stackPos-(8-4)], 'uses' => $this->semStack[$stackPos-(8-6)], 'returnType' => $this->semStack[$stackPos-(8-7)], 'stmts' => $this->semStack[$stackPos-(8-8)], 'attrGroups' => []], $this->startAttributeStack[$stackPos-(8-1)] + $this->endAttributes); }, - 475 => function ($stackPos) { + 477 => function ($stackPos) { $this->semValue = new Expr\Closure(['static' => true, 'byRef' => $this->semStack[$stackPos-(9-3)], 'params' => $this->semStack[$stackPos-(9-5)], 'uses' => $this->semStack[$stackPos-(9-7)], 'returnType' => $this->semStack[$stackPos-(9-8)], 'stmts' => $this->semStack[$stackPos-(9-9)], 'attrGroups' => []], $this->startAttributeStack[$stackPos-(9-1)] + $this->endAttributes); }, - 476 => function ($stackPos) { + 478 => function ($stackPos) { $this->semValue = new Expr\ArrowFunction(['static' => false, 'byRef' => $this->semStack[$stackPos-(9-3)], 'params' => $this->semStack[$stackPos-(9-5)], 'returnType' => $this->semStack[$stackPos-(9-7)], 'expr' => $this->semStack[$stackPos-(9-9)], 'attrGroups' => $this->semStack[$stackPos-(9-1)]], $this->startAttributeStack[$stackPos-(9-1)] + $this->endAttributes); }, - 477 => function ($stackPos) { + 479 => function ($stackPos) { $this->semValue = new Expr\ArrowFunction(['static' => true, 'byRef' => $this->semStack[$stackPos-(10-4)], 'params' => $this->semStack[$stackPos-(10-6)], 'returnType' => $this->semStack[$stackPos-(10-8)], 'expr' => $this->semStack[$stackPos-(10-10)], 'attrGroups' => $this->semStack[$stackPos-(10-1)]], $this->startAttributeStack[$stackPos-(10-1)] + $this->endAttributes); }, - 478 => function ($stackPos) { + 480 => function ($stackPos) { $this->semValue = new Expr\Closure(['static' => false, 'byRef' => $this->semStack[$stackPos-(9-3)], 'params' => $this->semStack[$stackPos-(9-5)], 'uses' => $this->semStack[$stackPos-(9-7)], 'returnType' => $this->semStack[$stackPos-(9-8)], 'stmts' => $this->semStack[$stackPos-(9-9)], 'attrGroups' => $this->semStack[$stackPos-(9-1)]], $this->startAttributeStack[$stackPos-(9-1)] + $this->endAttributes); }, - 479 => function ($stackPos) { + 481 => function ($stackPos) { $this->semValue = new Expr\Closure(['static' => true, 'byRef' => $this->semStack[$stackPos-(10-4)], 'params' => $this->semStack[$stackPos-(10-6)], 'uses' => $this->semStack[$stackPos-(10-8)], 'returnType' => $this->semStack[$stackPos-(10-9)], 'stmts' => $this->semStack[$stackPos-(10-10)], 'attrGroups' => $this->semStack[$stackPos-(10-1)]], $this->startAttributeStack[$stackPos-(10-1)] + $this->endAttributes); }, - 480 => function ($stackPos) { - $this->semValue = array(new Stmt\Class_(null, ['type' => 0, 'extends' => $this->semStack[$stackPos-(8-4)], 'implements' => $this->semStack[$stackPos-(8-5)], 'stmts' => $this->semStack[$stackPos-(8-7)], 'attrGroups' => $this->semStack[$stackPos-(8-1)]], $this->startAttributeStack[$stackPos-(8-1)] + $this->endAttributes), $this->semStack[$stackPos-(8-3)]); + 482 => function ($stackPos) { + $this->semValue = array(new Stmt\Class_(null, ['type' => $this->semStack[$stackPos-(8-2)], 'extends' => $this->semStack[$stackPos-(8-4)], 'implements' => $this->semStack[$stackPos-(8-5)], 'stmts' => $this->semStack[$stackPos-(8-7)], 'attrGroups' => $this->semStack[$stackPos-(8-1)]], $this->startAttributeStack[$stackPos-(8-1)] + $this->endAttributes), $this->semStack[$stackPos-(8-3)]); $this->checkClass($this->semValue[0], -1); }, - 481 => function ($stackPos) { + 483 => function ($stackPos) { $this->semValue = new Expr\New_($this->semStack[$stackPos-(3-2)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); }, - 482 => function ($stackPos) { + 484 => function ($stackPos) { list($class, $ctorArgs) = $this->semStack[$stackPos-(2-2)]; $this->semValue = new Expr\New_($class, $ctorArgs, $this->startAttributeStack[$stackPos-(2-1)] + $this->endAttributes); }, - 483 => function ($stackPos) { + 485 => function ($stackPos) { $this->semValue = array(); }, - 484 => function ($stackPos) { + 486 => function ($stackPos) { $this->semValue = $this->semStack[$stackPos-(4-3)]; }, - 485 => function ($stackPos) { + 487 => function ($stackPos) { $this->semValue = $this->semStack[$stackPos-(2-1)]; }, - 486 => function ($stackPos) { + 488 => function ($stackPos) { $this->semValue = array($this->semStack[$stackPos-(1-1)]); }, - 487 => function ($stackPos) { + 489 => function ($stackPos) { $this->semStack[$stackPos-(3-1)][] = $this->semStack[$stackPos-(3-3)]; $this->semValue = $this->semStack[$stackPos-(3-1)]; }, - 488 => function ($stackPos) { + 490 => function ($stackPos) { $this->semValue = new Expr\ClosureUse($this->semStack[$stackPos-(2-2)], $this->semStack[$stackPos-(2-1)], $this->startAttributeStack[$stackPos-(2-1)] + $this->endAttributes); }, - 489 => function ($stackPos) { - $this->semValue = new Name($this->semStack[$stackPos-(1-1)], $this->startAttributeStack[$stackPos-(1-1)] + $this->endAttributes); - }, - 490 => function ($stackPos) { - $this->semValue = new Expr\FuncCall($this->semStack[$stackPos-(2-1)], $this->semStack[$stackPos-(2-2)], $this->startAttributeStack[$stackPos-(2-1)] + $this->endAttributes); - }, 491 => function ($stackPos) { - $this->semValue = new Expr\FuncCall($this->semStack[$stackPos-(2-1)], $this->semStack[$stackPos-(2-2)], $this->startAttributeStack[$stackPos-(2-1)] + $this->endAttributes); + $this->semValue = new Name($this->semStack[$stackPos-(1-1)], $this->startAttributeStack[$stackPos-(1-1)] + $this->endAttributes); }, 492 => function ($stackPos) { $this->semValue = new Expr\FuncCall($this->semStack[$stackPos-(2-1)], $this->semStack[$stackPos-(2-2)], $this->startAttributeStack[$stackPos-(2-1)] + $this->endAttributes); }, 493 => function ($stackPos) { - $this->semValue = new Expr\StaticCall($this->semStack[$stackPos-(4-1)], $this->semStack[$stackPos-(4-3)], $this->semStack[$stackPos-(4-4)], $this->startAttributeStack[$stackPos-(4-1)] + $this->endAttributes); + $this->semValue = new Expr\FuncCall($this->semStack[$stackPos-(2-1)], $this->semStack[$stackPos-(2-2)], $this->startAttributeStack[$stackPos-(2-1)] + $this->endAttributes); }, 494 => function ($stackPos) { - $this->semValue = new Name($this->semStack[$stackPos-(1-1)], $this->startAttributeStack[$stackPos-(1-1)] + $this->endAttributes); + $this->semValue = new Expr\FuncCall($this->semStack[$stackPos-(2-1)], $this->semStack[$stackPos-(2-2)], $this->startAttributeStack[$stackPos-(2-1)] + $this->endAttributes); }, 495 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos-(1-1)]; + $this->semValue = new Expr\StaticCall($this->semStack[$stackPos-(4-1)], $this->semStack[$stackPos-(4-3)], $this->semStack[$stackPos-(4-4)], $this->startAttributeStack[$stackPos-(4-1)] + $this->endAttributes); }, 496 => function ($stackPos) { $this->semValue = new Name($this->semStack[$stackPos-(1-1)], $this->startAttributeStack[$stackPos-(1-1)] + $this->endAttributes); }, 497 => function ($stackPos) { - $this->semValue = new Name($this->semStack[$stackPos-(1-1)], $this->startAttributeStack[$stackPos-(1-1)] + $this->endAttributes); + $this->semValue = $this->semStack[$stackPos-(1-1)]; }, 498 => function ($stackPos) { - $this->semValue = new Name\FullyQualified(substr($this->semStack[$stackPos-(1-1)], 1), $this->startAttributeStack[$stackPos-(1-1)] + $this->endAttributes); + $this->semValue = new Name($this->semStack[$stackPos-(1-1)], $this->startAttributeStack[$stackPos-(1-1)] + $this->endAttributes); }, 499 => function ($stackPos) { - $this->semValue = new Name\Relative(substr($this->semStack[$stackPos-(1-1)], 10), $this->startAttributeStack[$stackPos-(1-1)] + $this->endAttributes); + $this->semValue = new Name($this->semStack[$stackPos-(1-1)], $this->startAttributeStack[$stackPos-(1-1)] + $this->endAttributes); }, 500 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos-(1-1)]; + $this->semValue = new Name\FullyQualified(substr($this->semStack[$stackPos-(1-1)], 1), $this->startAttributeStack[$stackPos-(1-1)] + $this->endAttributes); }, 501 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos-(1-1)]; + $this->semValue = new Name\Relative(substr($this->semStack[$stackPos-(1-1)], 10), $this->startAttributeStack[$stackPos-(1-1)] + $this->endAttributes); }, 502 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos-(3-2)]; + $this->semValue = $this->semStack[$stackPos-(1-1)]; }, 503 => function ($stackPos) { - $this->semValue = new Expr\Error($this->startAttributeStack[$stackPos-(1-1)] + $this->endAttributes); $this->errorState = 2; + $this->semValue = $this->semStack[$stackPos-(1-1)]; }, 504 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos-(1-1)]; - }, - 505 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos-(1-1)]; - }, - 506 => function ($stackPos) { - $this->semValue = null; - }, - 507 => function ($stackPos) { $this->semValue = $this->semStack[$stackPos-(3-2)]; }, - 508 => function ($stackPos) { - $this->semValue = array(); + 505 => function ($stackPos) { + $this->semValue = new Expr\Error($this->startAttributeStack[$stackPos-(1-1)] + $this->endAttributes); $this->errorState = 2; }, - 509 => function ($stackPos) { - $this->semValue = array(new Scalar\EncapsedStringPart(Scalar\String_::parseEscapeSequences($this->semStack[$stackPos-(1-1)], '`'), $this->startAttributeStack[$stackPos-(1-1)] + $this->endAttributes)); - }, - 510 => function ($stackPos) { - foreach ($this->semStack[$stackPos-(1-1)] as $s) { if ($s instanceof Node\Scalar\EncapsedStringPart) { $s->value = Node\Scalar\String_::parseEscapeSequences($s->value, '`', true); } }; $this->semValue = $this->semStack[$stackPos-(1-1)]; - }, - 511 => function ($stackPos) { - $this->semValue = array(); - }, - 512 => function ($stackPos) { + 506 => function ($stackPos) { $this->semValue = $this->semStack[$stackPos-(1-1)]; }, + 507 => function ($stackPos) { + $this->semValue = $this->semStack[$stackPos-(1-1)]; + }, + 508 => function ($stackPos) { + $this->semValue = null; + }, + 509 => function ($stackPos) { + $this->semValue = $this->semStack[$stackPos-(3-2)]; + }, + 510 => function ($stackPos) { + $this->semValue = array(); + }, + 511 => function ($stackPos) { + $this->semValue = array(new Scalar\EncapsedStringPart(Scalar\String_::parseEscapeSequences($this->semStack[$stackPos-(1-1)], '`'), $this->startAttributeStack[$stackPos-(1-1)] + $this->endAttributes)); + }, + 512 => function ($stackPos) { + foreach ($this->semStack[$stackPos-(1-1)] as $s) { if ($s instanceof Node\Scalar\EncapsedStringPart) { $s->value = Node\Scalar\String_::parseEscapeSequences($s->value, '`', true); } }; $this->semValue = $this->semStack[$stackPos-(1-1)]; + }, 513 => function ($stackPos) { - $this->semValue = new Expr\ConstFetch($this->semStack[$stackPos-(1-1)], $this->startAttributeStack[$stackPos-(1-1)] + $this->endAttributes); + $this->semValue = array(); }, 514 => function ($stackPos) { - $this->semValue = new Scalar\MagicConst\Line($this->startAttributeStack[$stackPos-(1-1)] + $this->endAttributes); + $this->semValue = $this->semStack[$stackPos-(1-1)]; }, 515 => function ($stackPos) { - $this->semValue = new Scalar\MagicConst\File($this->startAttributeStack[$stackPos-(1-1)] + $this->endAttributes); + $this->semValue = new Expr\ConstFetch($this->semStack[$stackPos-(1-1)], $this->startAttributeStack[$stackPos-(1-1)] + $this->endAttributes); }, 516 => function ($stackPos) { - $this->semValue = new Scalar\MagicConst\Dir($this->startAttributeStack[$stackPos-(1-1)] + $this->endAttributes); + $this->semValue = new Scalar\MagicConst\Line($this->startAttributeStack[$stackPos-(1-1)] + $this->endAttributes); }, 517 => function ($stackPos) { - $this->semValue = new Scalar\MagicConst\Class_($this->startAttributeStack[$stackPos-(1-1)] + $this->endAttributes); + $this->semValue = new Scalar\MagicConst\File($this->startAttributeStack[$stackPos-(1-1)] + $this->endAttributes); }, 518 => function ($stackPos) { - $this->semValue = new Scalar\MagicConst\Trait_($this->startAttributeStack[$stackPos-(1-1)] + $this->endAttributes); + $this->semValue = new Scalar\MagicConst\Dir($this->startAttributeStack[$stackPos-(1-1)] + $this->endAttributes); }, 519 => function ($stackPos) { - $this->semValue = new Scalar\MagicConst\Method($this->startAttributeStack[$stackPos-(1-1)] + $this->endAttributes); + $this->semValue = new Scalar\MagicConst\Class_($this->startAttributeStack[$stackPos-(1-1)] + $this->endAttributes); }, 520 => function ($stackPos) { - $this->semValue = new Scalar\MagicConst\Function_($this->startAttributeStack[$stackPos-(1-1)] + $this->endAttributes); + $this->semValue = new Scalar\MagicConst\Trait_($this->startAttributeStack[$stackPos-(1-1)] + $this->endAttributes); }, 521 => function ($stackPos) { - $this->semValue = new Scalar\MagicConst\Namespace_($this->startAttributeStack[$stackPos-(1-1)] + $this->endAttributes); + $this->semValue = new Scalar\MagicConst\Method($this->startAttributeStack[$stackPos-(1-1)] + $this->endAttributes); }, 522 => function ($stackPos) { - $this->semValue = new Expr\ClassConstFetch($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); + $this->semValue = new Scalar\MagicConst\Function_($this->startAttributeStack[$stackPos-(1-1)] + $this->endAttributes); }, 523 => function ($stackPos) { - $this->semValue = new Expr\ClassConstFetch($this->semStack[$stackPos-(3-1)], new Expr\Error($this->startAttributeStack[$stackPos-(3-3)] + $this->endAttributeStack[$stackPos-(3-3)]), $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); $this->errorState = 2; + $this->semValue = new Scalar\MagicConst\Namespace_($this->startAttributeStack[$stackPos-(1-1)] + $this->endAttributes); }, 524 => function ($stackPos) { + $this->semValue = new Expr\ClassConstFetch($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); + }, + 525 => function ($stackPos) { + $this->semValue = new Expr\ClassConstFetch($this->semStack[$stackPos-(5-1)], $this->semStack[$stackPos-(5-4)], $this->startAttributeStack[$stackPos-(5-1)] + $this->endAttributes); + }, + 526 => function ($stackPos) { + $this->semValue = new Expr\ClassConstFetch($this->semStack[$stackPos-(3-1)], new Expr\Error($this->startAttributeStack[$stackPos-(3-3)] + $this->endAttributeStack[$stackPos-(3-3)]), $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); $this->errorState = 2; + }, + 527 => function ($stackPos) { $attrs = $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes; $attrs['kind'] = Expr\Array_::KIND_SHORT; $this->semValue = new Expr\Array_($this->semStack[$stackPos-(3-2)], $attrs); }, - 525 => function ($stackPos) { + 528 => function ($stackPos) { $attrs = $this->startAttributeStack[$stackPos-(4-1)] + $this->endAttributes; $attrs['kind'] = Expr\Array_::KIND_LONG; $this->semValue = new Expr\Array_($this->semStack[$stackPos-(4-3)], $attrs); }, - 526 => function ($stackPos) { + 529 => function ($stackPos) { $this->semValue = $this->semStack[$stackPos-(1-1)]; }, - 527 => function ($stackPos) { + 530 => function ($stackPos) { $this->semValue = Scalar\String_::fromString($this->semStack[$stackPos-(1-1)], $this->startAttributeStack[$stackPos-(1-1)] + $this->endAttributes); }, - 528 => function ($stackPos) { + 531 => function ($stackPos) { $attrs = $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes; $attrs['kind'] = Scalar\String_::KIND_DOUBLE_QUOTED; foreach ($this->semStack[$stackPos-(3-2)] as $s) { if ($s instanceof Node\Scalar\EncapsedStringPart) { $s->value = Node\Scalar\String_::parseEscapeSequences($s->value, '"', true); } }; $this->semValue = new Scalar\Encapsed($this->semStack[$stackPos-(3-2)], $attrs); }, - 529 => function ($stackPos) { + 532 => function ($stackPos) { $this->semValue = $this->parseLNumber($this->semStack[$stackPos-(1-1)], $this->startAttributeStack[$stackPos-(1-1)] + $this->endAttributes); }, - 530 => function ($stackPos) { + 533 => function ($stackPos) { $this->semValue = Scalar\DNumber::fromString($this->semStack[$stackPos-(1-1)], $this->startAttributeStack[$stackPos-(1-1)] + $this->endAttributes); }, - 531 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos-(1-1)]; - }, - 532 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos-(1-1)]; - }, - 533 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos-(1-1)]; - }, 534 => function ($stackPos) { - $this->semValue = $this->parseDocString($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-2)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes, $this->startAttributeStack[$stackPos-(3-3)] + $this->endAttributeStack[$stackPos-(3-3)], true); + $this->semValue = $this->semStack[$stackPos-(1-1)]; }, 535 => function ($stackPos) { - $this->semValue = $this->parseDocString($this->semStack[$stackPos-(2-1)], '', $this->semStack[$stackPos-(2-2)], $this->startAttributeStack[$stackPos-(2-1)] + $this->endAttributes, $this->startAttributeStack[$stackPos-(2-2)] + $this->endAttributeStack[$stackPos-(2-2)], true); + $this->semValue = $this->semStack[$stackPos-(1-1)]; }, 536 => function ($stackPos) { - $this->semValue = $this->parseDocString($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-2)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes, $this->startAttributeStack[$stackPos-(3-3)] + $this->endAttributeStack[$stackPos-(3-3)], true); + $this->semValue = $this->semStack[$stackPos-(1-1)]; }, 537 => function ($stackPos) { - $this->semValue = null; + $this->semValue = $this->parseDocString($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-2)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes, $this->startAttributeStack[$stackPos-(3-3)] + $this->endAttributeStack[$stackPos-(3-3)], true); }, 538 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos-(1-1)]; + $this->semValue = $this->parseDocString($this->semStack[$stackPos-(2-1)], '', $this->semStack[$stackPos-(2-2)], $this->startAttributeStack[$stackPos-(2-1)] + $this->endAttributes, $this->startAttributeStack[$stackPos-(2-2)] + $this->endAttributeStack[$stackPos-(2-2)], true); }, 539 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos-(1-1)]; + $this->semValue = $this->parseDocString($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-2)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes, $this->startAttributeStack[$stackPos-(3-3)] + $this->endAttributeStack[$stackPos-(3-3)], true); }, 540 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos-(3-2)]; + $this->semValue = null; }, 541 => function ($stackPos) { $this->semValue = $this->semStack[$stackPos-(1-1)]; @@ -2671,7 +2679,7 @@ class Php7 extends \PhpParser\ParserAbstract $this->semValue = $this->semStack[$stackPos-(1-1)]; }, 543 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos-(1-1)]; + $this->semValue = $this->semStack[$stackPos-(3-2)]; }, 544 => function ($stackPos) { $this->semValue = $this->semStack[$stackPos-(1-1)]; @@ -2680,7 +2688,7 @@ class Php7 extends \PhpParser\ParserAbstract $this->semValue = $this->semStack[$stackPos-(1-1)]; }, 546 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos-(3-2)]; + $this->semValue = $this->semStack[$stackPos-(1-1)]; }, 547 => function ($stackPos) { $this->semValue = $this->semStack[$stackPos-(1-1)]; @@ -2689,85 +2697,85 @@ class Php7 extends \PhpParser\ParserAbstract $this->semValue = $this->semStack[$stackPos-(1-1)]; }, 549 => function ($stackPos) { - $this->semValue = new Expr\ArrayDimFetch($this->semStack[$stackPos-(4-1)], $this->semStack[$stackPos-(4-3)], $this->startAttributeStack[$stackPos-(4-1)] + $this->endAttributes); + $this->semValue = $this->semStack[$stackPos-(3-2)]; }, 550 => function ($stackPos) { - $this->semValue = new Expr\ArrayDimFetch($this->semStack[$stackPos-(4-1)], $this->semStack[$stackPos-(4-3)], $this->startAttributeStack[$stackPos-(4-1)] + $this->endAttributes); + $this->semValue = $this->semStack[$stackPos-(1-1)]; }, 551 => function ($stackPos) { $this->semValue = $this->semStack[$stackPos-(1-1)]; }, 552 => function ($stackPos) { - $this->semValue = new Expr\MethodCall($this->semStack[$stackPos-(4-1)], $this->semStack[$stackPos-(4-3)], $this->semStack[$stackPos-(4-4)], $this->startAttributeStack[$stackPos-(4-1)] + $this->endAttributes); + $this->semValue = new Expr\ArrayDimFetch($this->semStack[$stackPos-(4-1)], $this->semStack[$stackPos-(4-3)], $this->startAttributeStack[$stackPos-(4-1)] + $this->endAttributes); }, 553 => function ($stackPos) { - $this->semValue = new Expr\NullsafeMethodCall($this->semStack[$stackPos-(4-1)], $this->semStack[$stackPos-(4-3)], $this->semStack[$stackPos-(4-4)], $this->startAttributeStack[$stackPos-(4-1)] + $this->endAttributes); + $this->semValue = new Expr\ArrayDimFetch($this->semStack[$stackPos-(4-1)], $this->semStack[$stackPos-(4-3)], $this->startAttributeStack[$stackPos-(4-1)] + $this->endAttributes); }, 554 => function ($stackPos) { - $this->semValue = null; + $this->semValue = $this->semStack[$stackPos-(1-1)]; }, 555 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos-(1-1)]; + $this->semValue = new Expr\MethodCall($this->semStack[$stackPos-(4-1)], $this->semStack[$stackPos-(4-3)], $this->semStack[$stackPos-(4-4)], $this->startAttributeStack[$stackPos-(4-1)] + $this->endAttributes); }, 556 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos-(1-1)]; + $this->semValue = new Expr\NullsafeMethodCall($this->semStack[$stackPos-(4-1)], $this->semStack[$stackPos-(4-3)], $this->semStack[$stackPos-(4-4)], $this->startAttributeStack[$stackPos-(4-1)] + $this->endAttributes); }, 557 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos-(1-1)]; + $this->semValue = null; }, 558 => function ($stackPos) { - $this->semValue = new Expr\PropertyFetch($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); + $this->semValue = $this->semStack[$stackPos-(1-1)]; }, 559 => function ($stackPos) { - $this->semValue = new Expr\NullsafePropertyFetch($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); + $this->semValue = $this->semStack[$stackPos-(1-1)]; }, 560 => function ($stackPos) { $this->semValue = $this->semStack[$stackPos-(1-1)]; }, 561 => function ($stackPos) { - $this->semValue = new Expr\Variable($this->semStack[$stackPos-(4-3)], $this->startAttributeStack[$stackPos-(4-1)] + $this->endAttributes); - }, - 562 => function ($stackPos) { - $this->semValue = new Expr\Variable($this->semStack[$stackPos-(2-2)], $this->startAttributeStack[$stackPos-(2-1)] + $this->endAttributes); - }, - 563 => function ($stackPos) { - $this->semValue = new Expr\Variable(new Expr\Error($this->startAttributeStack[$stackPos-(2-1)] + $this->endAttributes), $this->startAttributeStack[$stackPos-(2-1)] + $this->endAttributes); $this->errorState = 2; - }, - 564 => function ($stackPos) { - $var = $this->semStack[$stackPos-(1-1)]->name; $this->semValue = \is_string($var) ? new Node\VarLikeIdentifier($var, $this->startAttributeStack[$stackPos-(1-1)] + $this->endAttributes) : $var; - }, - 565 => function ($stackPos) { - $this->semValue = new Expr\StaticPropertyFetch($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); - }, - 566 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos-(1-1)]; - }, - 567 => function ($stackPos) { - $this->semValue = new Expr\ArrayDimFetch($this->semStack[$stackPos-(4-1)], $this->semStack[$stackPos-(4-3)], $this->startAttributeStack[$stackPos-(4-1)] + $this->endAttributes); - }, - 568 => function ($stackPos) { - $this->semValue = new Expr\ArrayDimFetch($this->semStack[$stackPos-(4-1)], $this->semStack[$stackPos-(4-3)], $this->startAttributeStack[$stackPos-(4-1)] + $this->endAttributes); - }, - 569 => function ($stackPos) { $this->semValue = new Expr\PropertyFetch($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); }, - 570 => function ($stackPos) { + 562 => function ($stackPos) { $this->semValue = new Expr\NullsafePropertyFetch($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); }, - 571 => function ($stackPos) { + 563 => function ($stackPos) { + $this->semValue = $this->semStack[$stackPos-(1-1)]; + }, + 564 => function ($stackPos) { + $this->semValue = new Expr\Variable($this->semStack[$stackPos-(4-3)], $this->startAttributeStack[$stackPos-(4-1)] + $this->endAttributes); + }, + 565 => function ($stackPos) { + $this->semValue = new Expr\Variable($this->semStack[$stackPos-(2-2)], $this->startAttributeStack[$stackPos-(2-1)] + $this->endAttributes); + }, + 566 => function ($stackPos) { + $this->semValue = new Expr\Variable(new Expr\Error($this->startAttributeStack[$stackPos-(2-1)] + $this->endAttributes), $this->startAttributeStack[$stackPos-(2-1)] + $this->endAttributes); $this->errorState = 2; + }, + 567 => function ($stackPos) { + $var = $this->semStack[$stackPos-(1-1)]->name; $this->semValue = \is_string($var) ? new Node\VarLikeIdentifier($var, $this->startAttributeStack[$stackPos-(1-1)] + $this->endAttributes) : $var; + }, + 568 => function ($stackPos) { $this->semValue = new Expr\StaticPropertyFetch($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); }, + 569 => function ($stackPos) { + $this->semValue = $this->semStack[$stackPos-(1-1)]; + }, + 570 => function ($stackPos) { + $this->semValue = new Expr\ArrayDimFetch($this->semStack[$stackPos-(4-1)], $this->semStack[$stackPos-(4-3)], $this->startAttributeStack[$stackPos-(4-1)] + $this->endAttributes); + }, + 571 => function ($stackPos) { + $this->semValue = new Expr\ArrayDimFetch($this->semStack[$stackPos-(4-1)], $this->semStack[$stackPos-(4-3)], $this->startAttributeStack[$stackPos-(4-1)] + $this->endAttributes); + }, 572 => function ($stackPos) { - $this->semValue = new Expr\StaticPropertyFetch($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); + $this->semValue = new Expr\PropertyFetch($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); }, 573 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos-(1-1)]; + $this->semValue = new Expr\NullsafePropertyFetch($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); }, 574 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos-(3-2)]; + $this->semValue = new Expr\StaticPropertyFetch($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); }, 575 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos-(1-1)]; + $this->semValue = new Expr\StaticPropertyFetch($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); }, 576 => function ($stackPos) { $this->semValue = $this->semStack[$stackPos-(1-1)]; @@ -2779,102 +2787,111 @@ class Php7 extends \PhpParser\ParserAbstract $this->semValue = $this->semStack[$stackPos-(1-1)]; }, 579 => function ($stackPos) { - $this->semValue = new Expr\Error($this->startAttributeStack[$stackPos-(1-1)] + $this->endAttributes); $this->errorState = 2; - }, - 580 => function ($stackPos) { - $this->semValue = new Expr\List_($this->semStack[$stackPos-(4-3)], $this->startAttributeStack[$stackPos-(4-1)] + $this->endAttributes); - }, - 581 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos-(1-1)]; $end = count($this->semValue)-1; if ($this->semValue[$end] === null) array_pop($this->semValue); - }, - 582 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos]; - }, - 583 => function ($stackPos) { - /* do nothing -- prevent default action of $$=$this->semStack[$1]. See $551. */ - }, - 584 => function ($stackPos) { - $this->semStack[$stackPos-(3-1)][] = $this->semStack[$stackPos-(3-3)]; $this->semValue = $this->semStack[$stackPos-(3-1)]; - }, - 585 => function ($stackPos) { - $this->semValue = array($this->semStack[$stackPos-(1-1)]); - }, - 586 => function ($stackPos) { - $this->semValue = new Expr\ArrayItem($this->semStack[$stackPos-(1-1)], null, false, $this->startAttributeStack[$stackPos-(1-1)] + $this->endAttributes); - }, - 587 => function ($stackPos) { - $this->semValue = new Expr\ArrayItem($this->semStack[$stackPos-(2-2)], null, true, $this->startAttributeStack[$stackPos-(2-1)] + $this->endAttributes); - }, - 588 => function ($stackPos) { - $this->semValue = new Expr\ArrayItem($this->semStack[$stackPos-(1-1)], null, false, $this->startAttributeStack[$stackPos-(1-1)] + $this->endAttributes); - }, - 589 => function ($stackPos) { - $this->semValue = new Expr\ArrayItem($this->semStack[$stackPos-(3-3)], $this->semStack[$stackPos-(3-1)], false, $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); - }, - 590 => function ($stackPos) { - $this->semValue = new Expr\ArrayItem($this->semStack[$stackPos-(4-4)], $this->semStack[$stackPos-(4-1)], true, $this->startAttributeStack[$stackPos-(4-1)] + $this->endAttributes); - }, - 591 => function ($stackPos) { - $this->semValue = new Expr\ArrayItem($this->semStack[$stackPos-(3-3)], $this->semStack[$stackPos-(3-1)], false, $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); - }, - 592 => function ($stackPos) { - $this->semValue = new Expr\ArrayItem($this->semStack[$stackPos-(2-2)], null, false, $this->startAttributeStack[$stackPos-(2-1)] + $this->endAttributes, true, $this->startAttributeStack[$stackPos-(2-1)] + $this->endAttributes); - }, - 593 => function ($stackPos) { - $this->semValue = null; - }, - 594 => function ($stackPos) { - $this->semStack[$stackPos-(2-1)][] = $this->semStack[$stackPos-(2-2)]; $this->semValue = $this->semStack[$stackPos-(2-1)]; - }, - 595 => function ($stackPos) { - $this->semStack[$stackPos-(2-1)][] = $this->semStack[$stackPos-(2-2)]; $this->semValue = $this->semStack[$stackPos-(2-1)]; - }, - 596 => function ($stackPos) { - $this->semValue = array($this->semStack[$stackPos-(1-1)]); - }, - 597 => function ($stackPos) { - $this->semValue = array($this->semStack[$stackPos-(2-1)], $this->semStack[$stackPos-(2-2)]); - }, - 598 => function ($stackPos) { - $this->semValue = new Scalar\EncapsedStringPart($this->semStack[$stackPos-(1-1)], $this->startAttributeStack[$stackPos-(1-1)] + $this->endAttributes); - }, - 599 => function ($stackPos) { - $this->semValue = new Expr\Variable($this->semStack[$stackPos-(1-1)], $this->startAttributeStack[$stackPos-(1-1)] + $this->endAttributes); - }, - 600 => function ($stackPos) { $this->semValue = $this->semStack[$stackPos-(1-1)]; }, - 601 => function ($stackPos) { - $this->semValue = new Expr\ArrayDimFetch($this->semStack[$stackPos-(4-1)], $this->semStack[$stackPos-(4-3)], $this->startAttributeStack[$stackPos-(4-1)] + $this->endAttributes); - }, - 602 => function ($stackPos) { - $this->semValue = new Expr\PropertyFetch($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); - }, - 603 => function ($stackPos) { - $this->semValue = new Expr\NullsafePropertyFetch($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); - }, - 604 => function ($stackPos) { - $this->semValue = new Expr\Variable($this->semStack[$stackPos-(3-2)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); - }, - 605 => function ($stackPos) { - $this->semValue = new Expr\Variable($this->semStack[$stackPos-(3-2)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); - }, - 606 => function ($stackPos) { - $this->semValue = new Expr\ArrayDimFetch($this->semStack[$stackPos-(6-2)], $this->semStack[$stackPos-(6-4)], $this->startAttributeStack[$stackPos-(6-1)] + $this->endAttributes); - }, - 607 => function ($stackPos) { + 580 => function ($stackPos) { $this->semValue = $this->semStack[$stackPos-(3-2)]; }, + 581 => function ($stackPos) { + $this->semValue = $this->semStack[$stackPos-(1-1)]; + }, + 582 => function ($stackPos) { + $this->semValue = new Expr\Error($this->startAttributeStack[$stackPos-(1-1)] + $this->endAttributes); $this->errorState = 2; + }, + 583 => function ($stackPos) { + $this->semValue = new Expr\List_($this->semStack[$stackPos-(4-3)], $this->startAttributeStack[$stackPos-(4-1)] + $this->endAttributes); + }, + 584 => function ($stackPos) { + $this->semValue = $this->semStack[$stackPos-(1-1)]; $end = count($this->semValue)-1; if ($this->semValue[$end] === null) array_pop($this->semValue); + }, + 585 => function ($stackPos) { + $this->semValue = $this->semStack[$stackPos]; + }, + 586 => function ($stackPos) { + /* do nothing -- prevent default action of $$=$this->semStack[$1]. See $551. */ + }, + 587 => function ($stackPos) { + $this->semStack[$stackPos-(3-1)][] = $this->semStack[$stackPos-(3-3)]; $this->semValue = $this->semStack[$stackPos-(3-1)]; + }, + 588 => function ($stackPos) { + $this->semValue = array($this->semStack[$stackPos-(1-1)]); + }, + 589 => function ($stackPos) { + $this->semValue = new Expr\ArrayItem($this->semStack[$stackPos-(1-1)], null, false, $this->startAttributeStack[$stackPos-(1-1)] + $this->endAttributes); + }, + 590 => function ($stackPos) { + $this->semValue = new Expr\ArrayItem($this->semStack[$stackPos-(2-2)], null, true, $this->startAttributeStack[$stackPos-(2-1)] + $this->endAttributes); + }, + 591 => function ($stackPos) { + $this->semValue = new Expr\ArrayItem($this->semStack[$stackPos-(1-1)], null, false, $this->startAttributeStack[$stackPos-(1-1)] + $this->endAttributes); + }, + 592 => function ($stackPos) { + $this->semValue = new Expr\ArrayItem($this->semStack[$stackPos-(3-3)], $this->semStack[$stackPos-(3-1)], false, $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); + }, + 593 => function ($stackPos) { + $this->semValue = new Expr\ArrayItem($this->semStack[$stackPos-(4-4)], $this->semStack[$stackPos-(4-1)], true, $this->startAttributeStack[$stackPos-(4-1)] + $this->endAttributes); + }, + 594 => function ($stackPos) { + $this->semValue = new Expr\ArrayItem($this->semStack[$stackPos-(3-3)], $this->semStack[$stackPos-(3-1)], false, $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); + }, + 595 => function ($stackPos) { + $this->semValue = new Expr\ArrayItem($this->semStack[$stackPos-(2-2)], null, false, $this->startAttributeStack[$stackPos-(2-1)] + $this->endAttributes, true); + }, + 596 => function ($stackPos) { + $this->semValue = null; + }, + 597 => function ($stackPos) { + $this->semStack[$stackPos-(2-1)][] = $this->semStack[$stackPos-(2-2)]; $this->semValue = $this->semStack[$stackPos-(2-1)]; + }, + 598 => function ($stackPos) { + $this->semStack[$stackPos-(2-1)][] = $this->semStack[$stackPos-(2-2)]; $this->semValue = $this->semStack[$stackPos-(2-1)]; + }, + 599 => function ($stackPos) { + $this->semValue = array($this->semStack[$stackPos-(1-1)]); + }, + 600 => function ($stackPos) { + $this->semValue = array($this->semStack[$stackPos-(2-1)], $this->semStack[$stackPos-(2-2)]); + }, + 601 => function ($stackPos) { + $this->semValue = new Scalar\EncapsedStringPart($this->semStack[$stackPos-(1-1)], $this->startAttributeStack[$stackPos-(1-1)] + $this->endAttributes); + }, + 602 => function ($stackPos) { + $this->semValue = new Expr\Variable($this->semStack[$stackPos-(1-1)], $this->startAttributeStack[$stackPos-(1-1)] + $this->endAttributes); + }, + 603 => function ($stackPos) { + $this->semValue = $this->semStack[$stackPos-(1-1)]; + }, + 604 => function ($stackPos) { + $this->semValue = new Expr\ArrayDimFetch($this->semStack[$stackPos-(4-1)], $this->semStack[$stackPos-(4-3)], $this->startAttributeStack[$stackPos-(4-1)] + $this->endAttributes); + }, + 605 => function ($stackPos) { + $this->semValue = new Expr\PropertyFetch($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); + }, + 606 => function ($stackPos) { + $this->semValue = new Expr\NullsafePropertyFetch($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); + }, + 607 => function ($stackPos) { + $this->semValue = new Expr\Variable($this->semStack[$stackPos-(3-2)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); + }, 608 => function ($stackPos) { - $this->semValue = new Scalar\String_($this->semStack[$stackPos-(1-1)], $this->startAttributeStack[$stackPos-(1-1)] + $this->endAttributes); + $this->semValue = new Expr\Variable($this->semStack[$stackPos-(3-2)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); }, 609 => function ($stackPos) { - $this->semValue = $this->parseNumString($this->semStack[$stackPos-(1-1)], $this->startAttributeStack[$stackPos-(1-1)] + $this->endAttributes); + $this->semValue = new Expr\ArrayDimFetch($this->semStack[$stackPos-(6-2)], $this->semStack[$stackPos-(6-4)], $this->startAttributeStack[$stackPos-(6-1)] + $this->endAttributes); }, 610 => function ($stackPos) { - $this->semValue = $this->parseNumString('-' . $this->semStack[$stackPos-(2-2)], $this->startAttributeStack[$stackPos-(2-1)] + $this->endAttributes); + $this->semValue = $this->semStack[$stackPos-(3-2)]; }, 611 => function ($stackPos) { + $this->semValue = new Scalar\String_($this->semStack[$stackPos-(1-1)], $this->startAttributeStack[$stackPos-(1-1)] + $this->endAttributes); + }, + 612 => function ($stackPos) { + $this->semValue = $this->parseNumString($this->semStack[$stackPos-(1-1)], $this->startAttributeStack[$stackPos-(1-1)] + $this->endAttributes); + }, + 613 => function ($stackPos) { + $this->semValue = $this->parseNumString('-' . $this->semStack[$stackPos-(2-2)], $this->startAttributeStack[$stackPos-(2-1)] + $this->endAttributes); + }, + 614 => function ($stackPos) { $this->semValue = $this->semStack[$stackPos-(1-1)]; }, ]; diff --git a/vendor/nikic/php-parser/lib/PhpParser/ParserAbstract.php b/vendor/nikic/php-parser/lib/PhpParser/ParserAbstract.php index 9f9d00c7..567e09a9 100644 --- a/vendor/nikic/php-parser/lib/PhpParser/ParserAbstract.php +++ b/vendor/nikic/php-parser/lib/PhpParser/ParserAbstract.php @@ -155,7 +155,7 @@ abstract class ParserAbstract implements Parser * @return Node\Stmt[]|null Array of statements (or null non-throwing error handler is used and * the parser was unable to recover from an error). */ - public function parse(string $code, ErrorHandler $errorHandler = null) { + public function parse(string $code, ?ErrorHandler $errorHandler = null) { $this->errorHandler = $errorHandler ?: new ErrorHandler\Throwing; $this->lexer->startLexing($code, $this->errorHandler); diff --git a/vendor/nikic/php-parser/lib/PhpParser/ParserFactory.php b/vendor/nikic/php-parser/lib/PhpParser/ParserFactory.php index f041e7ff..98b0aee3 100644 --- a/vendor/nikic/php-parser/lib/PhpParser/ParserFactory.php +++ b/vendor/nikic/php-parser/lib/PhpParser/ParserFactory.php @@ -2,6 +2,9 @@ namespace PhpParser; +use PhpParser\Lexer\Emulative; +use PhpParser\Parser\Php7; + class ParserFactory { const PREFER_PHP7 = 1; @@ -18,7 +21,7 @@ class ParserFactory * * @return Parser The parser instance */ - public function create(int $kind, Lexer $lexer = null, array $parserOptions = []) : Parser { + public function create(int $kind, ?Lexer $lexer = null, array $parserOptions = []) : Parser { if (null === $lexer) { $lexer = new Lexer\Emulative(); } @@ -41,4 +44,33 @@ class ParserFactory ); } } + + /** + * Create a parser targeting the newest version supported by this library. Code for older + * versions will be accepted if there have been no relevant backwards-compatibility breaks in + * PHP. + * + * All supported lexer attributes (comments, startLine, endLine, startTokenPos, endTokenPos, + * startFilePos, endFilePos) will be enabled. + */ + public function createForNewestSupportedVersion(): Parser { + return new Php7(new Emulative($this->getLexerOptions())); + } + + /** + * Create a parser targeting the host PHP version, that is the PHP version we're currently + * running on. This parser will not use any token emulation. + * + * All supported lexer attributes (comments, startLine, endLine, startTokenPos, endTokenPos, + * startFilePos, endFilePos) will be enabled. + */ + public function createForHostVersion(): Parser { + return new Php7(new Lexer($this->getLexerOptions())); + } + + private function getLexerOptions(): array { + return ['usedAttributes' => [ + 'comments', 'startLine', 'endLine', 'startTokenPos', 'endTokenPos', 'startFilePos', 'endFilePos', + ]]; + } } diff --git a/vendor/nikic/php-parser/lib/PhpParser/PrettyPrinter/Standard.php b/vendor/nikic/php-parser/lib/PhpParser/PrettyPrinter/Standard.php index c256e897..b8115d00 100644 --- a/vendor/nikic/php-parser/lib/PhpParser/PrettyPrinter/Standard.php +++ b/vendor/nikic/php-parser/lib/PhpParser/PrettyPrinter/Standard.php @@ -223,7 +223,7 @@ class Standard extends PrettyPrinterAbstract // Try to find a short full-precision representation $stringValue = sprintf('%.16G', $node->value); - if ($node->value !== (double) $stringValue) { + if ($node->value !== (float) $stringValue) { $stringValue = sprintf('%.17G', $node->value); } @@ -529,7 +529,7 @@ class Standard extends PrettyPrinterAbstract } protected function pExpr_StaticCall(Expr\StaticCall $node) { - return $this->pDereferenceLhs($node->class) . '::' + return $this->pStaticDereferenceLhs($node->class) . '::' . ($node->name instanceof Expr ? ($node->name instanceof Expr\Variable ? $this->p($node->name) @@ -606,7 +606,7 @@ class Standard extends PrettyPrinterAbstract } protected function pExpr_ClassConstFetch(Expr\ClassConstFetch $node) { - return $this->pDereferenceLhs($node->class) . '::' . $this->p($node->name); + return $this->pStaticDereferenceLhs($node->class) . '::' . $this->pObjectProperty($node->name); } protected function pExpr_PropertyFetch(Expr\PropertyFetch $node) { @@ -618,7 +618,7 @@ class Standard extends PrettyPrinterAbstract } protected function pExpr_StaticPropertyFetch(Expr\StaticPropertyFetch $node) { - return $this->pDereferenceLhs($node->class) . '::$' . $this->pObjectProperty($node->name); + return $this->pStaticDereferenceLhs($node->class) . '::$' . $this->pObjectProperty($node->name); } protected function pExpr_ShellExec(Expr\ShellExec $node) { @@ -814,7 +814,9 @@ class Standard extends PrettyPrinterAbstract protected function pStmt_ClassConst(Stmt\ClassConst $node) { return $this->pAttrGroups($node->attrGroups) . $this->pModifiers($node->flags) - . 'const ' . $this->pCommaSeparated($node->consts) . ';'; + . 'const ' + . (null !== $node->type ? $this->p($node->type) . ' ' : '') + . $this->pCommaSeparated($node->consts) . ';'; } protected function pStmt_Function(Stmt\Function_ $node) { @@ -1067,6 +1069,14 @@ class Standard extends PrettyPrinterAbstract } } + protected function pStaticDereferenceLhs(Node $node) { + if (!$this->staticDereferenceLhsRequiresParens($node)) { + return $this->p($node); + } else { + return '(' . $this->p($node) . ')'; + } + } + protected function pCallLhs(Node $node) { if (!$this->callLhsRequiresParens($node)) { return $this->p($node); @@ -1075,9 +1085,12 @@ class Standard extends PrettyPrinterAbstract } } - protected function pNewVariable(Node $node) { - // TODO: This is not fully accurate. - return $this->pDereferenceLhs($node); + protected function pNewVariable(Node $node): string { + if (!$this->newOperandRequiresParens($node)) { + return $this->p($node); + } else { + return '(' . $this->p($node) . ')'; + } } /** diff --git a/vendor/nikic/php-parser/lib/PhpParser/PrettyPrinterAbstract.php b/vendor/nikic/php-parser/lib/PhpParser/PrettyPrinterAbstract.php index 6ed936fe..5d87e5ce 100644 --- a/vendor/nikic/php-parser/lib/PhpParser/PrettyPrinterAbstract.php +++ b/vendor/nikic/php-parser/lib/PhpParser/PrettyPrinterAbstract.php @@ -21,6 +21,8 @@ abstract class PrettyPrinterAbstract const FIXUP_BRACED_NAME = 4; // Name operand that may require bracing const FIXUP_VAR_BRACED_NAME = 5; // Name operand that may require ${} bracing const FIXUP_ENCAPSED = 6; // Encapsed string part + const FIXUP_NEW = 7; // New/instanceof operand + const FIXUP_STATIC_DEREF_LHS = 8; // LHS of static dereferencing operation protected $precedenceMap = [ // [precedence, associativity] @@ -656,7 +658,7 @@ abstract class PrettyPrinterAbstract $result .= $extraLeft; $origIndentLevel = $this->indentLevel; - $this->setIndentLevel($this->origTokens->getIndentationBefore($subStartPos) + $indentAdjustment); + $this->setIndentLevel(max($this->origTokens->getIndentationBefore($subStartPos) + $indentAdjustment, 0)); // If it's the same node that was previously in this position, it certainly doesn't // need fixup. It's important to check this here, because our fixup checks are more @@ -759,7 +761,7 @@ abstract class PrettyPrinterAbstract \assert($itemStartPos >= 0 && $itemEndPos >= 0 && $itemStartPos >= $pos); $origIndentLevel = $this->indentLevel; - $lastElemIndentLevel = $this->origTokens->getIndentationBefore($itemStartPos) + $indentAdjustment; + $lastElemIndentLevel = max($this->origTokens->getIndentationBefore($itemStartPos) + $indentAdjustment, 0); $this->setIndentLevel($lastElemIndentLevel); $comments = $arrItem->getComments(); @@ -977,6 +979,19 @@ abstract class PrettyPrinterAbstract return '(' . $this->p($subNode) . ')'; } break; + case self::FIXUP_STATIC_DEREF_LHS: + if ($this->staticDereferenceLhsRequiresParens($subNode) + && !$this->origTokens->haveParens($subStartPos, $subEndPos) + ) { + return '(' . $this->p($subNode) . ')'; + } + break; + case self::FIXUP_NEW: + if ($this->newOperandRequiresParens($subNode) + && !$this->origTokens->haveParens($subStartPos, $subEndPos)) { + return '(' . $this->p($subNode) . ')'; + } + break; case self::FIXUP_BRACED_NAME: case self::FIXUP_VAR_BRACED_NAME: if ($subNode instanceof Expr @@ -1047,13 +1062,26 @@ abstract class PrettyPrinterAbstract } /** - * Determines whether the LHS of a dereferencing operation must be wrapped in parenthesis. + * Determines whether the LHS of an array/object operation must be wrapped in parentheses. * * @param Node $node LHS of dereferencing operation * * @return bool Whether parentheses are required */ protected function dereferenceLhsRequiresParens(Node $node) : bool { + // A constant can occur on the LHS of an array/object deref, but not a static deref. + return $this->staticDereferenceLhsRequiresParens($node) + && !$node instanceof Expr\ConstFetch; + } + + /** + * Determines whether the LHS of a static operation must be wrapped in parentheses. + * + * @param Node $node LHS of dereferencing operation + * + * @return bool Whether parentheses are required + */ + protected function staticDereferenceLhsRequiresParens(Node $node): bool { return !($node instanceof Expr\Variable || $node instanceof Node\Name || $node instanceof Expr\ArrayDimFetch @@ -1066,10 +1094,31 @@ abstract class PrettyPrinterAbstract || $node instanceof Expr\StaticCall || $node instanceof Expr\Array_ || $node instanceof Scalar\String_ - || $node instanceof Expr\ConstFetch || $node instanceof Expr\ClassConstFetch); } + /** + * Determines whether an expression used in "new" or "instanceof" requires parentheses. + * + * @param Node $node New or instanceof operand + * + * @return bool Whether parentheses are required + */ + protected function newOperandRequiresParens(Node $node): bool { + if ($node instanceof Node\Name || $node instanceof Expr\Variable) { + return false; + } + if ($node instanceof Expr\ArrayDimFetch || $node instanceof Expr\PropertyFetch || + $node instanceof Expr\NullsafePropertyFetch + ) { + return $this->newOperandRequiresParens($node->var); + } + if ($node instanceof Expr\StaticPropertyFetch) { + return $this->newOperandRequiresParens($node->class); + } + return true; + } + /** * Print modifiers, including trailing whitespace. * @@ -1171,7 +1220,7 @@ abstract class PrettyPrinterAbstract Expr\PostDec::class => ['var' => self::FIXUP_PREC_LEFT], Expr\Instanceof_::class => [ 'expr' => self::FIXUP_PREC_LEFT, - 'class' => self::FIXUP_PREC_RIGHT, // TODO: FIXUP_NEW_VARIABLE + 'class' => self::FIXUP_NEW, ], Expr\Ternary::class => [ 'cond' => self::FIXUP_PREC_LEFT, @@ -1179,10 +1228,13 @@ abstract class PrettyPrinterAbstract ], Expr\FuncCall::class => ['name' => self::FIXUP_CALL_LHS], - Expr\StaticCall::class => ['class' => self::FIXUP_DEREF_LHS], + Expr\StaticCall::class => ['class' => self::FIXUP_STATIC_DEREF_LHS], Expr\ArrayDimFetch::class => ['var' => self::FIXUP_DEREF_LHS], - Expr\ClassConstFetch::class => ['var' => self::FIXUP_DEREF_LHS], - Expr\New_::class => ['class' => self::FIXUP_DEREF_LHS], // TODO: FIXUP_NEW_VARIABLE + Expr\ClassConstFetch::class => [ + 'class' => self::FIXUP_STATIC_DEREF_LHS, + 'name' => self::FIXUP_BRACED_NAME, + ], + Expr\New_::class => ['class' => self::FIXUP_NEW], Expr\MethodCall::class => [ 'var' => self::FIXUP_DEREF_LHS, 'name' => self::FIXUP_BRACED_NAME, @@ -1192,7 +1244,7 @@ abstract class PrettyPrinterAbstract 'name' => self::FIXUP_BRACED_NAME, ], Expr\StaticPropertyFetch::class => [ - 'class' => self::FIXUP_DEREF_LHS, + 'class' => self::FIXUP_STATIC_DEREF_LHS, 'name' => self::FIXUP_VAR_BRACED_NAME, ], Expr\PropertyFetch::class => [ @@ -1278,6 +1330,7 @@ abstract class PrettyPrinterAbstract 'Param->default' => $stripEquals, 'Stmt_Break->num' => $stripBoth, 'Stmt_Catch->var' => $stripLeft, + 'Stmt_ClassConst->type' => $stripRight, 'Stmt_ClassMethod->returnType' => $stripColon, 'Stmt_Class->extends' => ['left' => \T_EXTENDS], 'Stmt_Enum->scalarType' => $stripColon, @@ -1319,6 +1372,7 @@ abstract class PrettyPrinterAbstract 'Stmt_Break->num' => [\T_BREAK, false, ' ', null], 'Stmt_Catch->var' => [null, false, ' ', null], 'Stmt_ClassMethod->returnType' => [')', false, ' : ', null], + 'Stmt_ClassConst->type' => [\T_CONST, false, ' ', null], 'Stmt_Class->extends' => [null, false, ' extends ', null], 'Stmt_Enum->scalarType' => [null, false, ' : ', null], 'Stmt_EnumCase->expr' => [null, false, ' = ', null], @@ -1508,6 +1562,7 @@ abstract class PrettyPrinterAbstract 'Stmt_ClassMethod->flags' => \T_FUNCTION, 'Stmt_Class->flags' => \T_CLASS, 'Stmt_Property->flags' => \T_VARIABLE, + 'Expr_PrintableNewAnonClass->flags' => \T_CLASS, 'Param->flags' => \T_VARIABLE, //'Stmt_TraitUseAdaptation_Alias->newModifier' => 0, // TODO ]; diff --git a/vendor/phar-io/manifest/CHANGELOG.md b/vendor/phar-io/manifest/CHANGELOG.md index a403e093..f363b169 100644 --- a/vendor/phar-io/manifest/CHANGELOG.md +++ b/vendor/phar-io/manifest/CHANGELOG.md @@ -2,6 +2,14 @@ All notable changes to phar-io/manifest are documented in this file using the [Keep a CHANGELOG](http://keepachangelog.com/) principles. +## [2.0.4] - 03-03-2024 + +### Changed + +- Make `EMail` an optional attribute for author +- Stick with PHP 7.2 compatibilty +- Do not use implict nullable type (thanks @sebastianbergmann), this should make things work on PHP 8.4 + ## [2.0.3] - 20.07.2021 - Fixed PHP 7.2 / PHP 7.3 incompatibility introduced in previous release @@ -26,7 +34,8 @@ This release now requires PHP 7.2+ ### Unreleased -[Unreleased]: https://github.com/phar-io/manifest/compare/2.0.3...HEAD +[Unreleased]: https://github.com/phar-io/manifest/compare/2.1.0...HEAD +[2.1.0]: https://github.com/phar-io/manifest/compare/2.0.3...2.1.0 [2.0.3]: https://github.com/phar-io/manifest/compare/2.0.2...2.0.3 [2.0.2]: https://github.com/phar-io/manifest/compare/2.0.1...2.0.2 [2.0.1]: https://github.com/phar-io/manifest/compare/2.0.0...2.0.1 diff --git a/vendor/phar-io/manifest/README.md b/vendor/phar-io/manifest/README.md index e6d0b055..fae2c9a7 100644 --- a/vendor/phar-io/manifest/README.md +++ b/vendor/phar-io/manifest/README.md @@ -2,10 +2,6 @@ Component for reading [phar.io](https://phar.io/) manifest information from a [PHP Archive (PHAR)](http://php.net/phar). -[![Build Status](https://travis-ci.org/phar-io/manifest.svg?branch=master)](https://travis-ci.org/phar-io/manifest) -[![Scrutinizer Code Quality](https://scrutinizer-ci.com/g/phar-io/manifest/badges/quality-score.png?b=master)](https://scrutinizer-ci.com/g/phar-io/manifest/?branch=master) -[![SensioLabsInsight](https://insight.sensiolabs.com/projects/d8cc6035-69ad-477d-bd1a-ccc605480fd7/mini.png)](https://insight.sensiolabs.com/projects/d8cc6035-69ad-477d-bd1a-ccc605480fd7) - ## Installation You can add this library as a local, per-project dependency to your project using [Composer](https://getcomposer.org/): @@ -16,8 +12,9 @@ If you only need this library during development, for instance to run your proje composer require --dev phar-io/manifest -## Usage +## Usage Examples +### Read from `manifest.xml` ```php use PharIo\Manifest\ManifestLoader; use PharIo\Manifest\ManifestSerializer; @@ -28,3 +25,154 @@ var_dump($manifest); echo (new ManifestSerializer)->serializeToString($manifest); ``` + +
+ Output + +```shell +object(PharIo\Manifest\Manifest)#14 (6) { + ["name":"PharIo\Manifest\Manifest":private]=> + object(PharIo\Manifest\ApplicationName)#10 (1) { + ["name":"PharIo\Manifest\ApplicationName":private]=> + string(12) "some/library" + } + ["version":"PharIo\Manifest\Manifest":private]=> + object(PharIo\Version\Version)#12 (5) { + ["originalVersionString":"PharIo\Version\Version":private]=> + string(5) "1.0.0" + ["major":"PharIo\Version\Version":private]=> + object(PharIo\Version\VersionNumber)#13 (1) { + ["value":"PharIo\Version\VersionNumber":private]=> + int(1) + } + ["minor":"PharIo\Version\Version":private]=> + object(PharIo\Version\VersionNumber)#23 (1) { + ["value":"PharIo\Version\VersionNumber":private]=> + int(0) + } + ["patch":"PharIo\Version\Version":private]=> + object(PharIo\Version\VersionNumber)#22 (1) { + ["value":"PharIo\Version\VersionNumber":private]=> + int(0) + } + ["preReleaseSuffix":"PharIo\Version\Version":private]=> + NULL + } + ["type":"PharIo\Manifest\Manifest":private]=> + object(PharIo\Manifest\Library)#6 (0) { + } + ["copyrightInformation":"PharIo\Manifest\Manifest":private]=> + object(PharIo\Manifest\CopyrightInformation)#19 (2) { + ["authors":"PharIo\Manifest\CopyrightInformation":private]=> + object(PharIo\Manifest\AuthorCollection)#9 (1) { + ["authors":"PharIo\Manifest\AuthorCollection":private]=> + array(1) { + [0]=> + object(PharIo\Manifest\Author)#15 (2) { + ["name":"PharIo\Manifest\Author":private]=> + string(13) "Reiner Zufall" + ["email":"PharIo\Manifest\Author":private]=> + object(PharIo\Manifest\Email)#16 (1) { + ["email":"PharIo\Manifest\Email":private]=> + string(16) "reiner@zufall.de" + } + } + } + } + ["license":"PharIo\Manifest\CopyrightInformation":private]=> + object(PharIo\Manifest\License)#11 (2) { + ["name":"PharIo\Manifest\License":private]=> + string(12) "BSD-3-Clause" + ["url":"PharIo\Manifest\License":private]=> + object(PharIo\Manifest\Url)#18 (1) { + ["url":"PharIo\Manifest\Url":private]=> + string(26) "https://domain.tld/LICENSE" + } + } + } + ["requirements":"PharIo\Manifest\Manifest":private]=> + object(PharIo\Manifest\RequirementCollection)#17 (1) { + ["requirements":"PharIo\Manifest\RequirementCollection":private]=> + array(1) { + [0]=> + object(PharIo\Manifest\PhpVersionRequirement)#20 (1) { + ["versionConstraint":"PharIo\Manifest\PhpVersionRequirement":private]=> + object(PharIo\Version\SpecificMajorAndMinorVersionConstraint)#24 (3) { + ["originalValue":"PharIo\Version\AbstractVersionConstraint":private]=> + string(3) "7.0" + ["major":"PharIo\Version\SpecificMajorAndMinorVersionConstraint":private]=> + int(7) + ["minor":"PharIo\Version\SpecificMajorAndMinorVersionConstraint":private]=> + int(0) + } + } + } + } + ["bundledComponents":"PharIo\Manifest\Manifest":private]=> + object(PharIo\Manifest\BundledComponentCollection)#8 (1) { + ["bundledComponents":"PharIo\Manifest\BundledComponentCollection":private]=> + array(0) { + } + } +} + + + + + + + + + + + +``` +
+ +### Create via API +```php +$bundled = new \PharIo\Manifest\BundledComponentCollection(); +$bundled->add( + new \PharIo\Manifest\BundledComponent('vendor/packageA', new \PharIo\Version\Version('1.2.3-dev') + ) +); + +$manifest = new PharIo\Manifest\Manifest( + new \PharIo\Manifest\ApplicationName('vendor/package'), + new \PharIo\Version\Version('1.0.0'), + new \PharIo\Manifest\Library(), + new \PharIo\Manifest\CopyrightInformation( + new \PharIo\Manifest\AuthorCollection(), + new \PharIo\Manifest\License( + 'BSD-3-Clause', + new \PharIo\Manifest\Url('https://spdx.org/licenses/BSD-3-Clause.html') + ) + ), + new \PharIo\Manifest\RequirementCollection(), + $bundled +); + +echo (new ManifestSerializer)->serializeToString($manifest); +``` + +
+ Output + +```xml + + + + + + + + + + + + + +``` + +
+ diff --git a/vendor/phar-io/manifest/composer.json b/vendor/phar-io/manifest/composer.json index a2521193..dc5fa458 100644 --- a/vendor/phar-io/manifest/composer.json +++ b/vendor/phar-io/manifest/composer.json @@ -26,6 +26,7 @@ "php": "^7.2 || ^8.0", "ext-dom": "*", "ext-phar": "*", + "ext-libxml": "*", "ext-xmlwriter": "*", "phar-io/version": "^3.0.1" }, diff --git a/vendor/phar-io/manifest/composer.lock b/vendor/phar-io/manifest/composer.lock index e0e6db76..fe18e08b 100644 --- a/vendor/phar-io/manifest/composer.lock +++ b/vendor/phar-io/manifest/composer.lock @@ -4,24 +4,24 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "f2ac4614ce4f7273fd54a64b65fd047a", + "content-hash": "279b3c4fe44357abd924fdcc0cfa5664", "packages": [ { "name": "phar-io/version", - "version": "3.0.1", + "version": "3.2.1", "source": { "type": "git", "url": "https://github.com/phar-io/version.git", - "reference": "d06a5000ac1a258a7d035295f0bd4ae7c859bc4f" + "reference": "4f7fd7836c6f332bb2933569e566a0d6c4cbed74" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phar-io/version/zipball/d06a5000ac1a258a7d035295f0bd4ae7c859bc4f", - "reference": "d06a5000ac1a258a7d035295f0bd4ae7c859bc4f", + "url": "https://api.github.com/repos/phar-io/version/zipball/4f7fd7836c6f332bb2933569e566a0d6c4cbed74", + "reference": "4f7fd7836c6f332bb2933569e566a0d6c4cbed74", "shasum": "" }, "require": { - "php": "^7.2" + "php": "^7.2 || ^8.0" }, "type": "library", "autoload": { @@ -51,7 +51,11 @@ } ], "description": "Library for handling version information and constraints", - "time": "2020-05-09T21:27:55+00:00" + "support": { + "issues": "https://github.com/phar-io/version/issues", + "source": "https://github.com/phar-io/version/tree/3.2.1" + }, + "time": "2022-02-21T01:04:05+00:00" } ], "packages-dev": [], @@ -61,10 +65,12 @@ "prefer-stable": false, "prefer-lowest": false, "platform": { - "php": "^7.2", + "php": "^7.2 || ^8.0", "ext-dom": "*", "ext-phar": "*", + "ext-libxml": "*", "ext-xmlwriter": "*" }, - "platform-dev": [] + "platform-dev": [], + "plugin-api-version": "2.3.0" } diff --git a/vendor/phar-io/manifest/src/ManifestDocumentMapper.php b/vendor/phar-io/manifest/src/ManifestDocumentMapper.php index 8e539d5f..3da6403f 100644 --- a/vendor/phar-io/manifest/src/ManifestDocumentMapper.php +++ b/vendor/phar-io/manifest/src/ManifestDocumentMapper.php @@ -2,16 +2,19 @@ /* * This file is part of PharIo\Manifest. * - * (c) Arne Blankerts , Sebastian Heuer , Sebastian Bergmann + * Copyright (c) Arne Blankerts , Sebastian Heuer , Sebastian Bergmann and contributors * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. + * */ namespace PharIo\Manifest; use PharIo\Version\Exception as VersionException; use PharIo\Version\Version; use PharIo\Version\VersionConstraintParser; +use Throwable; +use function sprintf; class ManifestDocumentMapper { public function map(ManifestDocument $document): Manifest { @@ -30,9 +33,7 @@ class ManifestDocumentMapper { $requirements, $bundledComponents ); - } catch (VersionException $e) { - throw new ManifestDocumentMapperException($e->getMessage(), (int)$e->getCode(), $e); - } catch (Exception $e) { + } catch (Throwable $e) { throw new ManifestDocumentMapperException($e->getMessage(), (int)$e->getCode(), $e); } } @@ -48,7 +49,7 @@ class ManifestDocumentMapper { } throw new ManifestDocumentMapperException( - \sprintf('Unsupported type %s', $contains->getType()) + sprintf('Unsupported type %s', $contains->getType()) ); } @@ -59,7 +60,7 @@ class ManifestDocumentMapper { $authors->add( new Author( $authorElement->getName(), - new Email($authorElement->getEmail()) + $authorElement->hasEMail() ? new Email($authorElement->getEmail()) : null ) ); } @@ -85,7 +86,7 @@ class ManifestDocumentMapper { $versionConstraint = $parser->parse($phpElement->getVersion()); } catch (VersionException $e) { throw new ManifestDocumentMapperException( - \sprintf('Unsupported version constraint - %s', $e->getMessage()), + sprintf('Unsupported version constraint - %s', $e->getMessage()), (int)$e->getCode(), $e ); @@ -141,7 +142,7 @@ class ManifestDocumentMapper { ); } catch (VersionException $e) { throw new ManifestDocumentMapperException( - \sprintf('Unsupported version constraint - %s', $e->getMessage()), + sprintf('Unsupported version constraint - %s', $e->getMessage()), (int)$e->getCode(), $e ); diff --git a/vendor/phar-io/manifest/src/ManifestLoader.php b/vendor/phar-io/manifest/src/ManifestLoader.php index ae884e49..f467d2d3 100644 --- a/vendor/phar-io/manifest/src/ManifestLoader.php +++ b/vendor/phar-io/manifest/src/ManifestLoader.php @@ -2,13 +2,16 @@ /* * This file is part of PharIo\Manifest. * - * (c) Arne Blankerts , Sebastian Heuer , Sebastian Bergmann + * Copyright (c) Arne Blankerts , Sebastian Heuer , Sebastian Bergmann and contributors * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. + * */ namespace PharIo\Manifest; +use function sprintf; + class ManifestLoader { public static function fromFile(string $filename): Manifest { try { @@ -17,7 +20,7 @@ class ManifestLoader { ); } catch (Exception $e) { throw new ManifestLoaderException( - \sprintf('Loading %s failed.', $filename), + sprintf('Loading %s failed.', $filename), (int)$e->getCode(), $e ); diff --git a/vendor/phar-io/manifest/src/ManifestSerializer.php b/vendor/phar-io/manifest/src/ManifestSerializer.php index e236b598..48b8efdd 100644 --- a/vendor/phar-io/manifest/src/ManifestSerializer.php +++ b/vendor/phar-io/manifest/src/ManifestSerializer.php @@ -2,10 +2,11 @@ /* * This file is part of PharIo\Manifest. * - * (c) Arne Blankerts , Sebastian Heuer , Sebastian Bergmann + * Copyright (c) Arne Blankerts , Sebastian Heuer , Sebastian Bergmann and contributors * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. + * */ namespace PharIo\Manifest; @@ -13,6 +14,9 @@ use PharIo\Version\AnyVersionConstraint; use PharIo\Version\Version; use PharIo\Version\VersionConstraint; use XMLWriter; +use function count; +use function file_put_contents; +use function str_repeat; /** @psalm-suppress MissingConstructor */ class ManifestSerializer { @@ -20,7 +24,7 @@ class ManifestSerializer { private $xmlWriter; public function serializeToFile(Manifest $manifest, string $filename): void { - \file_put_contents( + file_put_contents( $filename, $this->serializeToString($manifest) ); @@ -41,7 +45,7 @@ class ManifestSerializer { $xmlWriter = new XMLWriter(); $xmlWriter->openMemory(); $xmlWriter->setIndent(true); - $xmlWriter->setIndentString(\str_repeat(' ', 4)); + $xmlWriter->setIndentString(str_repeat(' ', 4)); $xmlWriter->startDocument('1.0', 'UTF-8'); $xmlWriter->startElement('phar'); $xmlWriter->writeAttribute('xmlns', 'https://phar.io/xml/manifest/1.0'); @@ -144,7 +148,7 @@ class ManifestSerializer { } private function addBundles(BundledComponentCollection $bundledComponentCollection): void { - if (\count($bundledComponentCollection) === 0) { + if (count($bundledComponentCollection) === 0) { return; } $this->xmlWriter->startElement('bundles'); diff --git a/vendor/phar-io/manifest/src/exceptions/ElementCollectionException.php b/vendor/phar-io/manifest/src/exceptions/ElementCollectionException.php index 766fc0e6..7528afc8 100644 --- a/vendor/phar-io/manifest/src/exceptions/ElementCollectionException.php +++ b/vendor/phar-io/manifest/src/exceptions/ElementCollectionException.php @@ -2,12 +2,15 @@ /* * This file is part of PharIo\Manifest. * - * (c) Arne Blankerts , Sebastian Heuer , Sebastian Bergmann + * Copyright (c) Arne Blankerts , Sebastian Heuer , Sebastian Bergmann and contributors * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. + * */ namespace PharIo\Manifest; -class ElementCollectionException extends \InvalidArgumentException implements Exception { +use InvalidArgumentException; + +class ElementCollectionException extends InvalidArgumentException implements Exception { } diff --git a/vendor/phar-io/manifest/src/exceptions/Exception.php b/vendor/phar-io/manifest/src/exceptions/Exception.php index e7f12209..0c135d3c 100644 --- a/vendor/phar-io/manifest/src/exceptions/Exception.php +++ b/vendor/phar-io/manifest/src/exceptions/Exception.php @@ -2,12 +2,15 @@ /* * This file is part of PharIo\Manifest. * - * (c) Arne Blankerts , Sebastian Heuer , Sebastian Bergmann + * Copyright (c) Arne Blankerts , Sebastian Heuer , Sebastian Bergmann and contributors * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. + * */ namespace PharIo\Manifest; -interface Exception extends \Throwable { +use Throwable; + +interface Exception extends Throwable { } diff --git a/vendor/phar-io/manifest/src/exceptions/InvalidApplicationNameException.php b/vendor/phar-io/manifest/src/exceptions/InvalidApplicationNameException.php index 952901eb..ecfe5142 100644 --- a/vendor/phar-io/manifest/src/exceptions/InvalidApplicationNameException.php +++ b/vendor/phar-io/manifest/src/exceptions/InvalidApplicationNameException.php @@ -2,13 +2,16 @@ /* * This file is part of PharIo\Manifest. * - * (c) Arne Blankerts , Sebastian Heuer , Sebastian Bergmann + * Copyright (c) Arne Blankerts , Sebastian Heuer , Sebastian Bergmann and contributors * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. + * */ namespace PharIo\Manifest; -class InvalidApplicationNameException extends \InvalidArgumentException implements Exception { +use InvalidArgumentException; + +class InvalidApplicationNameException extends InvalidArgumentException implements Exception { public const InvalidFormat = 2; } diff --git a/vendor/phar-io/manifest/src/exceptions/InvalidEmailException.php b/vendor/phar-io/manifest/src/exceptions/InvalidEmailException.php index 3cbe0822..24240551 100644 --- a/vendor/phar-io/manifest/src/exceptions/InvalidEmailException.php +++ b/vendor/phar-io/manifest/src/exceptions/InvalidEmailException.php @@ -2,12 +2,15 @@ /* * This file is part of PharIo\Manifest. * - * (c) Arne Blankerts , Sebastian Heuer , Sebastian Bergmann + * Copyright (c) Arne Blankerts , Sebastian Heuer , Sebastian Bergmann and contributors * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. + * */ namespace PharIo\Manifest; -class InvalidEmailException extends \InvalidArgumentException implements Exception { +use InvalidArgumentException; + +class InvalidEmailException extends InvalidArgumentException implements Exception { } diff --git a/vendor/phar-io/manifest/src/exceptions/InvalidUrlException.php b/vendor/phar-io/manifest/src/exceptions/InvalidUrlException.php index 8f77e294..c8b192b1 100644 --- a/vendor/phar-io/manifest/src/exceptions/InvalidUrlException.php +++ b/vendor/phar-io/manifest/src/exceptions/InvalidUrlException.php @@ -2,12 +2,15 @@ /* * This file is part of PharIo\Manifest. * - * (c) Arne Blankerts , Sebastian Heuer , Sebastian Bergmann + * Copyright (c) Arne Blankerts , Sebastian Heuer , Sebastian Bergmann and contributors * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. + * */ namespace PharIo\Manifest; -class InvalidUrlException extends \InvalidArgumentException implements Exception { +use InvalidArgumentException; + +class InvalidUrlException extends InvalidArgumentException implements Exception { } diff --git a/vendor/phar-io/manifest/src/exceptions/ManifestDocumentException.php b/vendor/phar-io/manifest/src/exceptions/ManifestDocumentException.php index cf1c314c..0a158e6e 100644 --- a/vendor/phar-io/manifest/src/exceptions/ManifestDocumentException.php +++ b/vendor/phar-io/manifest/src/exceptions/ManifestDocumentException.php @@ -1,5 +1,16 @@ , Sebastian Heuer , Sebastian Bergmann and contributors + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + * + */ namespace PharIo\Manifest; -class ManifestDocumentException extends \RuntimeException implements Exception { +use RuntimeException; + +class ManifestDocumentException extends RuntimeException implements Exception { } diff --git a/vendor/phar-io/manifest/src/exceptions/ManifestDocumentLoadingException.php b/vendor/phar-io/manifest/src/exceptions/ManifestDocumentLoadingException.php index 4676e354..816af120 100644 --- a/vendor/phar-io/manifest/src/exceptions/ManifestDocumentLoadingException.php +++ b/vendor/phar-io/manifest/src/exceptions/ManifestDocumentLoadingException.php @@ -2,14 +2,16 @@ /* * This file is part of PharIo\Manifest. * - * (c) Arne Blankerts , Sebastian Heuer , Sebastian Bergmann + * Copyright (c) Arne Blankerts , Sebastian Heuer , Sebastian Bergmann and contributors * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. + * */ namespace PharIo\Manifest; use LibXMLError; +use function sprintf; class ManifestDocumentLoadingException extends \Exception implements Exception { /** @var LibXMLError[] */ @@ -25,7 +27,7 @@ class ManifestDocumentLoadingException extends \Exception implements Exception { $first = $this->libxmlErrors[0]; parent::__construct( - \sprintf( + sprintf( '%s (Line: %d / Column: %d / File: %s)', $first->message, $first->line, diff --git a/vendor/phar-io/manifest/src/exceptions/ManifestDocumentMapperException.php b/vendor/phar-io/manifest/src/exceptions/ManifestDocumentMapperException.php index 43373bd3..0d1a5f5a 100644 --- a/vendor/phar-io/manifest/src/exceptions/ManifestDocumentMapperException.php +++ b/vendor/phar-io/manifest/src/exceptions/ManifestDocumentMapperException.php @@ -1,5 +1,16 @@ , Sebastian Heuer , Sebastian Bergmann and contributors + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + * + */ namespace PharIo\Manifest; -class ManifestDocumentMapperException extends \RuntimeException implements Exception { +use RuntimeException; + +class ManifestDocumentMapperException extends RuntimeException implements Exception { } diff --git a/vendor/phar-io/manifest/src/exceptions/ManifestElementException.php b/vendor/phar-io/manifest/src/exceptions/ManifestElementException.php index a4e77236..46f82e32 100644 --- a/vendor/phar-io/manifest/src/exceptions/ManifestElementException.php +++ b/vendor/phar-io/manifest/src/exceptions/ManifestElementException.php @@ -1,5 +1,16 @@ , Sebastian Heuer , Sebastian Bergmann and contributors + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + * + */ namespace PharIo\Manifest; -class ManifestElementException extends \RuntimeException implements Exception { +use RuntimeException; + +class ManifestElementException extends RuntimeException implements Exception { } diff --git a/vendor/phar-io/manifest/src/exceptions/ManifestLoaderException.php b/vendor/phar-io/manifest/src/exceptions/ManifestLoaderException.php index df0971ed..d00ed190 100644 --- a/vendor/phar-io/manifest/src/exceptions/ManifestLoaderException.php +++ b/vendor/phar-io/manifest/src/exceptions/ManifestLoaderException.php @@ -1,4 +1,13 @@ , Sebastian Heuer , Sebastian Bergmann and contributors + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + * + */ namespace PharIo\Manifest; class ManifestLoaderException extends \Exception implements Exception { diff --git a/vendor/phar-io/manifest/src/values/Application.php b/vendor/phar-io/manifest/src/values/Application.php index 5420bcb8..11a44d9c 100644 --- a/vendor/phar-io/manifest/src/values/Application.php +++ b/vendor/phar-io/manifest/src/values/Application.php @@ -2,10 +2,11 @@ /* * This file is part of PharIo\Manifest. * - * (c) Arne Blankerts , Sebastian Heuer , Sebastian Bergmann + * Copyright (c) Arne Blankerts , Sebastian Heuer , Sebastian Bergmann and contributors * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. + * */ namespace PharIo\Manifest; diff --git a/vendor/phar-io/manifest/src/values/ApplicationName.php b/vendor/phar-io/manifest/src/values/ApplicationName.php index d71744ab..1a0ad1e2 100644 --- a/vendor/phar-io/manifest/src/values/ApplicationName.php +++ b/vendor/phar-io/manifest/src/values/ApplicationName.php @@ -2,13 +2,17 @@ /* * This file is part of PharIo\Manifest. * - * (c) Arne Blankerts , Sebastian Heuer , Sebastian Bergmann + * Copyright (c) Arne Blankerts , Sebastian Heuer , Sebastian Bergmann and contributors * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. + * */ namespace PharIo\Manifest; +use function preg_match; +use function sprintf; + class ApplicationName { /** @var string */ private $name; @@ -27,9 +31,9 @@ class ApplicationName { } private function ensureValidFormat(string $name): void { - if (!\preg_match('#\w/\w#', $name)) { + if (!preg_match('#\w/\w#', $name)) { throw new InvalidApplicationNameException( - \sprintf('Format of name "%s" is not valid - expected: vendor/packagename', $name), + sprintf('Format of name "%s" is not valid - expected: vendor/packagename', $name), InvalidApplicationNameException::InvalidFormat ); } diff --git a/vendor/phar-io/manifest/src/values/Author.php b/vendor/phar-io/manifest/src/values/Author.php index 82b666e7..7b243aac 100644 --- a/vendor/phar-io/manifest/src/values/Author.php +++ b/vendor/phar-io/manifest/src/values/Author.php @@ -2,27 +2,34 @@ /* * This file is part of PharIo\Manifest. * - * (c) Arne Blankerts , Sebastian Heuer , Sebastian Bergmann + * Copyright (c) Arne Blankerts , Sebastian Heuer , Sebastian Bergmann and contributors * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. + * */ namespace PharIo\Manifest; +use function sprintf; + class Author { /** @var string */ private $name; - /** @var Email */ + /** @var null|Email */ private $email; - public function __construct(string $name, Email $email) { + public function __construct(string $name, ?Email $email = null) { $this->name = $name; $this->email = $email; } public function asString(): string { - return \sprintf( + if (!$this->hasEmail()) { + return $this->name; + } + + return sprintf( '%s <%s>', $this->name, $this->email->asString() @@ -33,7 +40,18 @@ class Author { return $this->name; } + /** + * @psalm-assert-if-true Email $this->email + */ + public function hasEmail(): bool { + return $this->email !== null; + } + public function getEmail(): Email { + if (!$this->hasEmail()) { + throw new NoEmailAddressException(); + } + return $this->email; } } diff --git a/vendor/phar-io/manifest/src/values/AuthorCollection.php b/vendor/phar-io/manifest/src/values/AuthorCollection.php index 27e50ad8..549876da 100644 --- a/vendor/phar-io/manifest/src/values/AuthorCollection.php +++ b/vendor/phar-io/manifest/src/values/AuthorCollection.php @@ -2,14 +2,20 @@ /* * This file is part of PharIo\Manifest. * - * (c) Arne Blankerts , Sebastian Heuer , Sebastian Bergmann + * Copyright (c) Arne Blankerts , Sebastian Heuer , Sebastian Bergmann and contributors * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. + * */ namespace PharIo\Manifest; -class AuthorCollection implements \Countable, \IteratorAggregate { +use Countable; +use IteratorAggregate; +use function count; + +/** @template-implements IteratorAggregate */ +class AuthorCollection implements Countable, IteratorAggregate { /** @var Author[] */ private $authors = []; @@ -25,7 +31,7 @@ class AuthorCollection implements \Countable, \IteratorAggregate { } public function count(): int { - return \count($this->authors); + return count($this->authors); } public function getIterator(): AuthorCollectionIterator { diff --git a/vendor/phar-io/manifest/src/values/AuthorCollectionIterator.php b/vendor/phar-io/manifest/src/values/AuthorCollectionIterator.php index 4ff3c394..36fee9f7 100644 --- a/vendor/phar-io/manifest/src/values/AuthorCollectionIterator.php +++ b/vendor/phar-io/manifest/src/values/AuthorCollectionIterator.php @@ -2,14 +2,19 @@ /* * This file is part of PharIo\Manifest. * - * (c) Arne Blankerts , Sebastian Heuer , Sebastian Bergmann + * Copyright (c) Arne Blankerts , Sebastian Heuer , Sebastian Bergmann and contributors * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. + * */ namespace PharIo\Manifest; -class AuthorCollectionIterator implements \Iterator { +use Iterator; +use function count; + +/** @template-implements Iterator */ +class AuthorCollectionIterator implements Iterator { /** @var Author[] */ private $authors; @@ -25,7 +30,7 @@ class AuthorCollectionIterator implements \Iterator { } public function valid(): bool { - return $this->position < \count($this->authors); + return $this->position < count($this->authors); } public function key(): int { diff --git a/vendor/phar-io/manifest/src/values/BundledComponent.php b/vendor/phar-io/manifest/src/values/BundledComponent.php index ea77b440..58170368 100644 --- a/vendor/phar-io/manifest/src/values/BundledComponent.php +++ b/vendor/phar-io/manifest/src/values/BundledComponent.php @@ -2,10 +2,11 @@ /* * This file is part of PharIo\Manifest. * - * (c) Arne Blankerts , Sebastian Heuer , Sebastian Bergmann + * Copyright (c) Arne Blankerts , Sebastian Heuer , Sebastian Bergmann and contributors * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. + * */ namespace PharIo\Manifest; diff --git a/vendor/phar-io/manifest/src/values/BundledComponentCollection.php b/vendor/phar-io/manifest/src/values/BundledComponentCollection.php index b628eaa3..28aaa06c 100644 --- a/vendor/phar-io/manifest/src/values/BundledComponentCollection.php +++ b/vendor/phar-io/manifest/src/values/BundledComponentCollection.php @@ -2,14 +2,20 @@ /* * This file is part of PharIo\Manifest. * - * (c) Arne Blankerts , Sebastian Heuer , Sebastian Bergmann + * Copyright (c) Arne Blankerts , Sebastian Heuer , Sebastian Bergmann and contributors * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. + * */ namespace PharIo\Manifest; -class BundledComponentCollection implements \Countable, \IteratorAggregate { +use Countable; +use IteratorAggregate; +use function count; + +/** @template-implements IteratorAggregate */ +class BundledComponentCollection implements Countable, IteratorAggregate { /** @var BundledComponent[] */ private $bundledComponents = []; @@ -25,7 +31,7 @@ class BundledComponentCollection implements \Countable, \IteratorAggregate { } public function count(): int { - return \count($this->bundledComponents); + return count($this->bundledComponents); } public function getIterator(): BundledComponentCollectionIterator { diff --git a/vendor/phar-io/manifest/src/values/BundledComponentCollectionIterator.php b/vendor/phar-io/manifest/src/values/BundledComponentCollectionIterator.php index 462db45a..5c72817d 100644 --- a/vendor/phar-io/manifest/src/values/BundledComponentCollectionIterator.php +++ b/vendor/phar-io/manifest/src/values/BundledComponentCollectionIterator.php @@ -2,14 +2,19 @@ /* * This file is part of PharIo\Manifest. * - * (c) Arne Blankerts , Sebastian Heuer , Sebastian Bergmann + * Copyright (c) Arne Blankerts , Sebastian Heuer , Sebastian Bergmann and contributors * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. + * */ namespace PharIo\Manifest; -class BundledComponentCollectionIterator implements \Iterator { +use Iterator; +use function count; + +/** @template-implements Iterator */ +class BundledComponentCollectionIterator implements Iterator { /** @var BundledComponent[] */ private $bundledComponents; @@ -25,7 +30,7 @@ class BundledComponentCollectionIterator implements \Iterator { } public function valid(): bool { - return $this->position < \count($this->bundledComponents); + return $this->position < count($this->bundledComponents); } public function key(): int { diff --git a/vendor/phar-io/manifest/src/values/CopyrightInformation.php b/vendor/phar-io/manifest/src/values/CopyrightInformation.php index d26f9472..b4468ed7 100644 --- a/vendor/phar-io/manifest/src/values/CopyrightInformation.php +++ b/vendor/phar-io/manifest/src/values/CopyrightInformation.php @@ -2,10 +2,11 @@ /* * This file is part of PharIo\Manifest. * - * (c) Arne Blankerts , Sebastian Heuer , Sebastian Bergmann + * Copyright (c) Arne Blankerts , Sebastian Heuer , Sebastian Bergmann and contributors * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. + * */ namespace PharIo\Manifest; diff --git a/vendor/phar-io/manifest/src/values/Email.php b/vendor/phar-io/manifest/src/values/Email.php index 588348d8..dbaff84a 100644 --- a/vendor/phar-io/manifest/src/values/Email.php +++ b/vendor/phar-io/manifest/src/values/Email.php @@ -2,13 +2,17 @@ /* * This file is part of PharIo\Manifest. * - * (c) Arne Blankerts , Sebastian Heuer , Sebastian Bergmann + * Copyright (c) Arne Blankerts , Sebastian Heuer , Sebastian Bergmann and contributors * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. + * */ namespace PharIo\Manifest; +use const FILTER_VALIDATE_EMAIL; +use function filter_var; + class Email { /** @var string */ private $email; @@ -24,7 +28,7 @@ class Email { } private function ensureEmailIsValid(string $url): void { - if (\filter_var($url, \FILTER_VALIDATE_EMAIL) === false) { + if (filter_var($url, FILTER_VALIDATE_EMAIL) === false) { throw new InvalidEmailException; } } diff --git a/vendor/phar-io/manifest/src/values/Extension.php b/vendor/phar-io/manifest/src/values/Extension.php index 4c5726f8..abcd2f89 100644 --- a/vendor/phar-io/manifest/src/values/Extension.php +++ b/vendor/phar-io/manifest/src/values/Extension.php @@ -2,10 +2,11 @@ /* * This file is part of PharIo\Manifest. * - * (c) Arne Blankerts , Sebastian Heuer , Sebastian Bergmann + * Copyright (c) Arne Blankerts , Sebastian Heuer , Sebastian Bergmann and contributors * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. + * */ namespace PharIo\Manifest; diff --git a/vendor/phar-io/manifest/src/values/Library.php b/vendor/phar-io/manifest/src/values/Library.php index 21849e13..97c292dc 100644 --- a/vendor/phar-io/manifest/src/values/Library.php +++ b/vendor/phar-io/manifest/src/values/Library.php @@ -2,10 +2,11 @@ /* * This file is part of PharIo\Manifest. * - * (c) Arne Blankerts , Sebastian Heuer , Sebastian Bergmann + * Copyright (c) Arne Blankerts , Sebastian Heuer , Sebastian Bergmann and contributors * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. + * */ namespace PharIo\Manifest; diff --git a/vendor/phar-io/manifest/src/values/License.php b/vendor/phar-io/manifest/src/values/License.php index 39542fe8..c2d94299 100644 --- a/vendor/phar-io/manifest/src/values/License.php +++ b/vendor/phar-io/manifest/src/values/License.php @@ -2,10 +2,11 @@ /* * This file is part of PharIo\Manifest. * - * (c) Arne Blankerts , Sebastian Heuer , Sebastian Bergmann + * Copyright (c) Arne Blankerts , Sebastian Heuer , Sebastian Bergmann and contributors * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. + * */ namespace PharIo\Manifest; diff --git a/vendor/phar-io/manifest/src/values/Manifest.php b/vendor/phar-io/manifest/src/values/Manifest.php index 0140b842..36466820 100644 --- a/vendor/phar-io/manifest/src/values/Manifest.php +++ b/vendor/phar-io/manifest/src/values/Manifest.php @@ -2,10 +2,11 @@ /* * This file is part of PharIo\Manifest. * - * (c) Arne Blankerts , Sebastian Heuer , Sebastian Bergmann + * Copyright (c) Arne Blankerts , Sebastian Heuer , Sebastian Bergmann and contributors * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. + * */ namespace PharIo\Manifest; @@ -75,7 +76,7 @@ class Manifest { return $this->type->isExtension(); } - public function isExtensionFor(ApplicationName $application, Version $version = null): bool { + public function isExtensionFor(ApplicationName $application, ?Version $version = null): bool { if (!$this->isExtension()) { return false; } diff --git a/vendor/phar-io/manifest/src/values/PhpExtensionRequirement.php b/vendor/phar-io/manifest/src/values/PhpExtensionRequirement.php index 088f3858..f81bd259 100644 --- a/vendor/phar-io/manifest/src/values/PhpExtensionRequirement.php +++ b/vendor/phar-io/manifest/src/values/PhpExtensionRequirement.php @@ -2,10 +2,11 @@ /* * This file is part of PharIo\Manifest. * - * (c) Arne Blankerts , Sebastian Heuer , Sebastian Bergmann + * Copyright (c) Arne Blankerts , Sebastian Heuer , Sebastian Bergmann and contributors * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. + * */ namespace PharIo\Manifest; diff --git a/vendor/phar-io/manifest/src/values/PhpVersionRequirement.php b/vendor/phar-io/manifest/src/values/PhpVersionRequirement.php index f8d6f6d1..fb30c3b8 100644 --- a/vendor/phar-io/manifest/src/values/PhpVersionRequirement.php +++ b/vendor/phar-io/manifest/src/values/PhpVersionRequirement.php @@ -2,10 +2,11 @@ /* * This file is part of PharIo\Manifest. * - * (c) Arne Blankerts , Sebastian Heuer , Sebastian Bergmann + * Copyright (c) Arne Blankerts , Sebastian Heuer , Sebastian Bergmann and contributors * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. + * */ namespace PharIo\Manifest; diff --git a/vendor/phar-io/manifest/src/values/Requirement.php b/vendor/phar-io/manifest/src/values/Requirement.php index 8b845d6a..d4b46401 100644 --- a/vendor/phar-io/manifest/src/values/Requirement.php +++ b/vendor/phar-io/manifest/src/values/Requirement.php @@ -2,10 +2,11 @@ /* * This file is part of PharIo\Manifest. * - * (c) Arne Blankerts , Sebastian Heuer , Sebastian Bergmann + * Copyright (c) Arne Blankerts , Sebastian Heuer , Sebastian Bergmann and contributors * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. + * */ namespace PharIo\Manifest; diff --git a/vendor/phar-io/manifest/src/values/RequirementCollection.php b/vendor/phar-io/manifest/src/values/RequirementCollection.php index b82cd955..e4fe2a11 100644 --- a/vendor/phar-io/manifest/src/values/RequirementCollection.php +++ b/vendor/phar-io/manifest/src/values/RequirementCollection.php @@ -2,14 +2,20 @@ /* * This file is part of PharIo\Manifest. * - * (c) Arne Blankerts , Sebastian Heuer , Sebastian Bergmann + * Copyright (c) Arne Blankerts , Sebastian Heuer , Sebastian Bergmann and contributors * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. + * */ namespace PharIo\Manifest; -class RequirementCollection implements \Countable, \IteratorAggregate { +use Countable; +use IteratorAggregate; +use function count; + +/** @template-implements IteratorAggregate */ +class RequirementCollection implements Countable, IteratorAggregate { /** @var Requirement[] */ private $requirements = []; @@ -25,7 +31,7 @@ class RequirementCollection implements \Countable, \IteratorAggregate { } public function count(): int { - return \count($this->requirements); + return count($this->requirements); } public function getIterator(): RequirementCollectionIterator { diff --git a/vendor/phar-io/manifest/src/values/RequirementCollectionIterator.php b/vendor/phar-io/manifest/src/values/RequirementCollectionIterator.php index 5614eaf7..a587468c 100644 --- a/vendor/phar-io/manifest/src/values/RequirementCollectionIterator.php +++ b/vendor/phar-io/manifest/src/values/RequirementCollectionIterator.php @@ -2,14 +2,19 @@ /* * This file is part of PharIo\Manifest. * - * (c) Arne Blankerts , Sebastian Heuer , Sebastian Bergmann + * Copyright (c) Arne Blankerts , Sebastian Heuer , Sebastian Bergmann and contributors * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. + * */ namespace PharIo\Manifest; -class RequirementCollectionIterator implements \Iterator { +use Iterator; +use function count; + +/** @template-implements Iterator */ +class RequirementCollectionIterator implements Iterator { /** @var Requirement[] */ private $requirements; @@ -25,7 +30,7 @@ class RequirementCollectionIterator implements \Iterator { } public function valid(): bool { - return $this->position < \count($this->requirements); + return $this->position < count($this->requirements); } public function key(): int { diff --git a/vendor/phar-io/manifest/src/values/Type.php b/vendor/phar-io/manifest/src/values/Type.php index 23b28980..231e7fd9 100644 --- a/vendor/phar-io/manifest/src/values/Type.php +++ b/vendor/phar-io/manifest/src/values/Type.php @@ -2,10 +2,11 @@ /* * This file is part of PharIo\Manifest. * - * (c) Arne Blankerts , Sebastian Heuer , Sebastian Bergmann + * Copyright (c) Arne Blankerts , Sebastian Heuer , Sebastian Bergmann and contributors * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. + * */ namespace PharIo\Manifest; diff --git a/vendor/phar-io/manifest/src/values/Url.php b/vendor/phar-io/manifest/src/values/Url.php index 63952533..98061554 100644 --- a/vendor/phar-io/manifest/src/values/Url.php +++ b/vendor/phar-io/manifest/src/values/Url.php @@ -2,13 +2,17 @@ /* * This file is part of PharIo\Manifest. * - * (c) Arne Blankerts , Sebastian Heuer , Sebastian Bergmann + * Copyright (c) Arne Blankerts , Sebastian Heuer , Sebastian Bergmann and contributors * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. + * */ namespace PharIo\Manifest; +use const FILTER_VALIDATE_URL; +use function filter_var; + class Url { /** @var string */ private $url; @@ -24,12 +28,10 @@ class Url { } /** - * @param string $url - * * @throws InvalidUrlException */ - private function ensureUrlIsValid($url): void { - if (\filter_var($url, \FILTER_VALIDATE_URL) === false) { + private function ensureUrlIsValid(string $url): void { + if (filter_var($url, FILTER_VALIDATE_URL) === false) { throw new InvalidUrlException; } } diff --git a/vendor/phar-io/manifest/src/xml/AuthorElement.php b/vendor/phar-io/manifest/src/xml/AuthorElement.php index c454b271..b33eb3ca 100644 --- a/vendor/phar-io/manifest/src/xml/AuthorElement.php +++ b/vendor/phar-io/manifest/src/xml/AuthorElement.php @@ -2,10 +2,11 @@ /* * This file is part of PharIo\Manifest. * - * (c) Arne Blankerts , Sebastian Heuer , Sebastian Bergmann + * Copyright (c) Arne Blankerts , Sebastian Heuer , Sebastian Bergmann and contributors * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. + * */ namespace PharIo\Manifest; @@ -17,4 +18,8 @@ class AuthorElement extends ManifestElement { public function getEmail(): string { return $this->getAttributeValue('email'); } + + public function hasEMail(): bool { + return $this->hasAttribute('email'); + } } diff --git a/vendor/phar-io/manifest/src/xml/AuthorElementCollection.php b/vendor/phar-io/manifest/src/xml/AuthorElementCollection.php index a54147eb..0a2a2a38 100644 --- a/vendor/phar-io/manifest/src/xml/AuthorElementCollection.php +++ b/vendor/phar-io/manifest/src/xml/AuthorElementCollection.php @@ -2,10 +2,11 @@ /* * This file is part of PharIo\Manifest. * - * (c) Arne Blankerts , Sebastian Heuer , Sebastian Bergmann + * Copyright (c) Arne Blankerts , Sebastian Heuer , Sebastian Bergmann and contributors * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. + * */ namespace PharIo\Manifest; diff --git a/vendor/phar-io/manifest/src/xml/BundlesElement.php b/vendor/phar-io/manifest/src/xml/BundlesElement.php index eb2105ac..ef721a66 100644 --- a/vendor/phar-io/manifest/src/xml/BundlesElement.php +++ b/vendor/phar-io/manifest/src/xml/BundlesElement.php @@ -2,10 +2,11 @@ /* * This file is part of PharIo\Manifest. * - * (c) Arne Blankerts , Sebastian Heuer , Sebastian Bergmann + * Copyright (c) Arne Blankerts , Sebastian Heuer , Sebastian Bergmann and contributors * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. + * */ namespace PharIo\Manifest; diff --git a/vendor/phar-io/manifest/src/xml/ComponentElement.php b/vendor/phar-io/manifest/src/xml/ComponentElement.php index 7f6a5ec9..84373c47 100644 --- a/vendor/phar-io/manifest/src/xml/ComponentElement.php +++ b/vendor/phar-io/manifest/src/xml/ComponentElement.php @@ -2,10 +2,11 @@ /* * This file is part of PharIo\Manifest. * - * (c) Arne Blankerts , Sebastian Heuer , Sebastian Bergmann + * Copyright (c) Arne Blankerts , Sebastian Heuer , Sebastian Bergmann and contributors * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. + * */ namespace PharIo\Manifest; diff --git a/vendor/phar-io/manifest/src/xml/ComponentElementCollection.php b/vendor/phar-io/manifest/src/xml/ComponentElementCollection.php index 23bcbd2f..cd9ad5dd 100644 --- a/vendor/phar-io/manifest/src/xml/ComponentElementCollection.php +++ b/vendor/phar-io/manifest/src/xml/ComponentElementCollection.php @@ -2,10 +2,11 @@ /* * This file is part of PharIo\Manifest. * - * (c) Arne Blankerts , Sebastian Heuer , Sebastian Bergmann + * Copyright (c) Arne Blankerts , Sebastian Heuer , Sebastian Bergmann and contributors * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. + * */ namespace PharIo\Manifest; diff --git a/vendor/phar-io/manifest/src/xml/ContainsElement.php b/vendor/phar-io/manifest/src/xml/ContainsElement.php index ebef49d9..55a9c605 100644 --- a/vendor/phar-io/manifest/src/xml/ContainsElement.php +++ b/vendor/phar-io/manifest/src/xml/ContainsElement.php @@ -2,10 +2,11 @@ /* * This file is part of PharIo\Manifest. * - * (c) Arne Blankerts , Sebastian Heuer , Sebastian Bergmann + * Copyright (c) Arne Blankerts , Sebastian Heuer , Sebastian Bergmann and contributors * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. + * */ namespace PharIo\Manifest; diff --git a/vendor/phar-io/manifest/src/xml/CopyrightElement.php b/vendor/phar-io/manifest/src/xml/CopyrightElement.php index 3debe7dc..c11415a5 100644 --- a/vendor/phar-io/manifest/src/xml/CopyrightElement.php +++ b/vendor/phar-io/manifest/src/xml/CopyrightElement.php @@ -2,10 +2,11 @@ /* * This file is part of PharIo\Manifest. * - * (c) Arne Blankerts , Sebastian Heuer , Sebastian Bergmann + * Copyright (c) Arne Blankerts , Sebastian Heuer , Sebastian Bergmann and contributors * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. + * */ namespace PharIo\Manifest; diff --git a/vendor/phar-io/manifest/src/xml/ElementCollection.php b/vendor/phar-io/manifest/src/xml/ElementCollection.php index 26d9250f..9e1de569 100644 --- a/vendor/phar-io/manifest/src/xml/ElementCollection.php +++ b/vendor/phar-io/manifest/src/xml/ElementCollection.php @@ -2,17 +2,24 @@ /* * This file is part of PharIo\Manifest. * - * (c) Arne Blankerts , Sebastian Heuer , Sebastian Bergmann + * Copyright (c) Arne Blankerts , Sebastian Heuer , Sebastian Bergmann and contributors * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. + * */ namespace PharIo\Manifest; use DOMElement; use DOMNodeList; +use Iterator; +use ReturnTypeWillChange; +use function count; +use function get_class; +use function sprintf; -abstract class ElementCollection implements \Iterator { +/** @template-implements Iterator */ +abstract class ElementCollection implements Iterator { /** @var DOMElement[] */ private $nodes = []; @@ -24,7 +31,7 @@ abstract class ElementCollection implements \Iterator { $this->importNodes($nodeList); } - #[\ReturnTypeWillChange] + #[ReturnTypeWillChange] abstract public function current(); public function next(): void { @@ -36,7 +43,7 @@ abstract class ElementCollection implements \Iterator { } public function valid(): bool { - return $this->position < \count($this->nodes); + return $this->position < count($this->nodes); } public function rewind(): void { @@ -51,7 +58,7 @@ abstract class ElementCollection implements \Iterator { foreach ($nodeList as $node) { if (!$node instanceof DOMElement) { throw new ElementCollectionException( - \sprintf('\DOMElement expected, got \%s', \get_class($node)) + sprintf('\DOMElement expected, got \%s', get_class($node)) ); } diff --git a/vendor/phar-io/manifest/src/xml/ExtElement.php b/vendor/phar-io/manifest/src/xml/ExtElement.php index 257853c4..6a88a05d 100644 --- a/vendor/phar-io/manifest/src/xml/ExtElement.php +++ b/vendor/phar-io/manifest/src/xml/ExtElement.php @@ -2,10 +2,11 @@ /* * This file is part of PharIo\Manifest. * - * (c) Arne Blankerts , Sebastian Heuer , Sebastian Bergmann + * Copyright (c) Arne Blankerts , Sebastian Heuer , Sebastian Bergmann and contributors * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. + * */ namespace PharIo\Manifest; diff --git a/vendor/phar-io/manifest/src/xml/ExtElementCollection.php b/vendor/phar-io/manifest/src/xml/ExtElementCollection.php index 05977349..3eec9463 100644 --- a/vendor/phar-io/manifest/src/xml/ExtElementCollection.php +++ b/vendor/phar-io/manifest/src/xml/ExtElementCollection.php @@ -2,10 +2,11 @@ /* * This file is part of PharIo\Manifest. * - * (c) Arne Blankerts , Sebastian Heuer , Sebastian Bergmann + * Copyright (c) Arne Blankerts , Sebastian Heuer , Sebastian Bergmann and contributors * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. + * */ namespace PharIo\Manifest; diff --git a/vendor/phar-io/manifest/src/xml/ExtensionElement.php b/vendor/phar-io/manifest/src/xml/ExtensionElement.php index db067f99..22016a01 100644 --- a/vendor/phar-io/manifest/src/xml/ExtensionElement.php +++ b/vendor/phar-io/manifest/src/xml/ExtensionElement.php @@ -2,10 +2,11 @@ /* * This file is part of PharIo\Manifest. * - * (c) Arne Blankerts , Sebastian Heuer , Sebastian Bergmann + * Copyright (c) Arne Blankerts , Sebastian Heuer , Sebastian Bergmann and contributors * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. + * */ namespace PharIo\Manifest; diff --git a/vendor/phar-io/manifest/src/xml/LicenseElement.php b/vendor/phar-io/manifest/src/xml/LicenseElement.php index 658c3d1c..d9f4cb26 100644 --- a/vendor/phar-io/manifest/src/xml/LicenseElement.php +++ b/vendor/phar-io/manifest/src/xml/LicenseElement.php @@ -2,10 +2,11 @@ /* * This file is part of PharIo\Manifest. * - * (c) Arne Blankerts , Sebastian Heuer , Sebastian Bergmann + * Copyright (c) Arne Blankerts , Sebastian Heuer , Sebastian Bergmann and contributors * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. + * */ namespace PharIo\Manifest; diff --git a/vendor/phar-io/manifest/src/xml/ManifestDocument.php b/vendor/phar-io/manifest/src/xml/ManifestDocument.php index f88b2829..87458686 100644 --- a/vendor/phar-io/manifest/src/xml/ManifestDocument.php +++ b/vendor/phar-io/manifest/src/xml/ManifestDocument.php @@ -2,15 +2,24 @@ /* * This file is part of PharIo\Manifest. * - * (c) Arne Blankerts , Sebastian Heuer , Sebastian Bergmann + * Copyright (c) Arne Blankerts , Sebastian Heuer , Sebastian Bergmann and contributors * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. + * */ namespace PharIo\Manifest; use DOMDocument; use DOMElement; +use Throwable; +use function count; +use function file_get_contents; +use function is_file; +use function libxml_clear_errors; +use function libxml_get_errors; +use function libxml_use_internal_errors; +use function sprintf; class ManifestDocument { public const XMLNS = 'https://phar.io/xml/manifest/1.0'; @@ -19,28 +28,31 @@ class ManifestDocument { private $dom; public static function fromFile(string $filename): ManifestDocument { - if (!\file_exists($filename)) { + if (!is_file($filename)) { throw new ManifestDocumentException( - \sprintf('File "%s" not found', $filename) + sprintf('File "%s" not found', $filename) ); } return self::fromString( - \file_get_contents($filename) + file_get_contents($filename) ); } public static function fromString(string $xmlString): ManifestDocument { - $prev = \libxml_use_internal_errors(true); - \libxml_clear_errors(); + $prev = libxml_use_internal_errors(true); + libxml_clear_errors(); - $dom = new DOMDocument(); - $dom->loadXML($xmlString); + try { + $dom = new DOMDocument(); + $dom->loadXML($xmlString); + $errors = libxml_get_errors(); + libxml_use_internal_errors($prev); + } catch (Throwable $t) { + throw new ManifestDocumentException($t->getMessage(), 0, $t); + } - $errors = \libxml_get_errors(); - \libxml_use_internal_errors($prev); - - if (\count($errors) !== 0) { + if (count($errors) !== 0) { throw new ManifestDocumentLoadingException($errors); } @@ -94,7 +106,7 @@ class ManifestDocument { if (!$element instanceof DOMElement) { throw new ManifestDocumentException( - \sprintf('Element %s missing', $elementName) + sprintf('Element %s missing', $elementName) ); } diff --git a/vendor/phar-io/manifest/src/xml/ManifestElement.php b/vendor/phar-io/manifest/src/xml/ManifestElement.php index 1f57f547..461ba0c9 100644 --- a/vendor/phar-io/manifest/src/xml/ManifestElement.php +++ b/vendor/phar-io/manifest/src/xml/ManifestElement.php @@ -2,15 +2,17 @@ /* * This file is part of PharIo\Manifest. * - * (c) Arne Blankerts , Sebastian Heuer , Sebastian Bergmann + * Copyright (c) Arne Blankerts , Sebastian Heuer , Sebastian Bergmann and contributors * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. + * */ namespace PharIo\Manifest; use DOMElement; use DOMNodeList; +use function sprintf; class ManifestElement { public const XMLNS = 'https://phar.io/xml/manifest/1.0'; @@ -25,7 +27,7 @@ class ManifestElement { protected function getAttributeValue(string $name): string { if (!$this->element->hasAttribute($name)) { throw new ManifestElementException( - \sprintf( + sprintf( 'Attribute %s not set on element %s', $name, $this->element->localName @@ -36,12 +38,16 @@ class ManifestElement { return $this->element->getAttribute($name); } + protected function hasAttribute(string $name): bool { + return $this->element->hasAttribute($name); + } + protected function getChildByName(string $elementName): DOMElement { $element = $this->element->getElementsByTagNameNS(self::XMLNS, $elementName)->item(0); if (!$element instanceof DOMElement) { throw new ManifestElementException( - \sprintf('Element %s missing', $elementName) + sprintf('Element %s missing', $elementName) ); } @@ -53,7 +59,7 @@ class ManifestElement { if ($elementList->length === 0) { throw new ManifestElementException( - \sprintf('Element(s) %s missing', $elementName) + sprintf('Element(s) %s missing', $elementName) ); } diff --git a/vendor/phar-io/manifest/src/xml/PhpElement.php b/vendor/phar-io/manifest/src/xml/PhpElement.php index c5c906c9..9340c2e6 100644 --- a/vendor/phar-io/manifest/src/xml/PhpElement.php +++ b/vendor/phar-io/manifest/src/xml/PhpElement.php @@ -2,10 +2,11 @@ /* * This file is part of PharIo\Manifest. * - * (c) Arne Blankerts , Sebastian Heuer , Sebastian Bergmann + * Copyright (c) Arne Blankerts , Sebastian Heuer , Sebastian Bergmann and contributors * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. + * */ namespace PharIo\Manifest; diff --git a/vendor/phar-io/manifest/src/xml/RequiresElement.php b/vendor/phar-io/manifest/src/xml/RequiresElement.php index b7cd41ef..73ba54ca 100644 --- a/vendor/phar-io/manifest/src/xml/RequiresElement.php +++ b/vendor/phar-io/manifest/src/xml/RequiresElement.php @@ -2,10 +2,11 @@ /* * This file is part of PharIo\Manifest. * - * (c) Arne Blankerts , Sebastian Heuer , Sebastian Bergmann + * Copyright (c) Arne Blankerts , Sebastian Heuer , Sebastian Bergmann and contributors * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. + * */ namespace PharIo\Manifest; diff --git a/vendor/phpunit/php-code-coverage/ChangeLog-10.0.md b/vendor/phpunit/php-code-coverage/ChangeLog-10.0.md deleted file mode 100644 index 4516a2f5..00000000 --- a/vendor/phpunit/php-code-coverage/ChangeLog-10.0.md +++ /dev/null @@ -1,37 +0,0 @@ -# ChangeLog - -All notable changes are documented in this file using the [Keep a CHANGELOG](http://keepachangelog.com/) principles. - -## [10.0.2] - 2023-03-06 - -### Changed - -* Improved the legend on the file pages of the HTML code coverage report - -## [10.0.1] - 2023-02-25 - -### Fixed - -* [#981](https://github.com/sebastianbergmann/php-code-coverage/issues/981): `CodeUnitFindingVisitor` does not support DNF types - -## [10.0.0] - 2023-02-03 - -### Added - -* [#556](https://github.com/sebastianbergmann/php-code-coverage/issues/556): Make colors in HTML report configurable -* The path to `custom.css` for the HTML report can now be configured - -### Changed - -* [#856](https://github.com/sebastianbergmann/php-code-coverage/issues/856): Do not include (and execute) uncovered files - -### Removed - -* The deprecated methods `SebastianBergmann\CodeCoverage\Driver::forLineCoverage()` and `SebastianBergmann\CodeCoverage\Driver::forLineAndPathCoverage()` have been removed -* This component is no longer supported on PHP 7.3, PHP 7.4 and PHP 8.0 -* This component no longer supports PHPDBG -* This component no longer supports Xdebug 2 - -[10.0.2]: https://github.com/sebastianbergmann/php-code-coverage/compare/10.0.1...10.0.2 -[10.0.1]: https://github.com/sebastianbergmann/php-code-coverage/compare/10.0.0...10.0.1 -[10.0.0]: https://github.com/sebastianbergmann/php-code-coverage/compare/9.2...10.0.0 diff --git a/vendor/phpunit/php-code-coverage/LICENSE b/vendor/phpunit/php-code-coverage/LICENSE index 80e09f7b..89f05309 100644 --- a/vendor/phpunit/php-code-coverage/LICENSE +++ b/vendor/phpunit/php-code-coverage/LICENSE @@ -1,6 +1,6 @@ BSD 3-Clause License -Copyright (c) 2009-2023, Sebastian Bergmann +Copyright (c) 2009-2024, Sebastian Bergmann All rights reserved. Redistribution and use in source and binary forms, with or without diff --git a/vendor/phpunit/php-code-coverage/README.md b/vendor/phpunit/php-code-coverage/README.md index 5228f135..26807a8d 100644 --- a/vendor/phpunit/php-code-coverage/README.md +++ b/vendor/phpunit/php-code-coverage/README.md @@ -31,7 +31,13 @@ use SebastianBergmann\CodeCoverage\CodeCoverage; use SebastianBergmann\CodeCoverage\Report\Html\Facade as HtmlReport; $filter = new Filter; -$filter->includeDirectory('/path/to/directory'); + +$filter->includeFiles( + [ + '/path/to/file.php', + '/path/to/another_file.php', + ] +); $coverage = new CodeCoverage( (new Selector)->forLineCoverage($filter), diff --git a/vendor/phpunit/php-code-coverage/SECURITY.md b/vendor/phpunit/php-code-coverage/SECURITY.md index 778f018b..d88ff001 100644 --- a/vendor/phpunit/php-code-coverage/SECURITY.md +++ b/vendor/phpunit/php-code-coverage/SECURITY.md @@ -4,7 +4,7 @@ If you believe you have found a security vulnerability in the library that is de **Please do not report security vulnerabilities through public GitHub issues, discussions, or pull requests.** -Instead, please send an email to `sebastian@phpunit.de`. +Instead, please email `sebastian@phpunit.de`. Please include as much of the information listed below as you can to help us better understand and resolve the issue: @@ -22,9 +22,9 @@ This information will help us triage your report more quickly. The library that is developed in this repository was either extracted from [PHPUnit](https://github.com/sebastianbergmann/phpunit) or developed specifically as a dependency for PHPUnit. -The library is developed with a focus on development environments and the command-line. No specific testing or hardening with regard to using the library in a HTTP or web context or with untrusted input data is performed. The library might also contain functionality that intentionally exposes internal application data for debugging purposes. +The library is developed with a focus on development environments and the command-line. No specific testing or hardening with regard to using the library in an HTTP or web context or with untrusted input data is performed. The library might also contain functionality that intentionally exposes internal application data for debugging purposes. If the library is used in a web application, the application developer is responsible for filtering inputs or escaping outputs as necessary and for verifying that the used functionality is safe for use within the intended context. -Vulnerabilities specific to the use outside of a development context will be fixed as applicable, provided that the fix does not have an averse effect on the primary use case for development purposes. +Vulnerabilities specific to the use outside a development context will be fixed as applicable, provided that the fix does not have an averse effect on the primary use case for development purposes. diff --git a/vendor/phpunit/php-code-coverage/composer.json b/vendor/phpunit/php-code-coverage/composer.json index 1a1bad2f..855b369e 100644 --- a/vendor/phpunit/php-code-coverage/composer.json +++ b/vendor/phpunit/php-code-coverage/composer.json @@ -17,7 +17,8 @@ } ], "support": { - "issues": "https://github.com/sebastianbergmann/php-code-coverage/issues" + "issues": "https://github.com/sebastianbergmann/php-code-coverage/issues", + "security": "https://github.com/sebastianbergmann/php-code-coverage/security/policy" }, "config": { "platform": { @@ -32,18 +33,18 @@ "ext-dom": "*", "ext-libxml": "*", "ext-xmlwriter": "*", - "nikic/php-parser": "^4.15", - "phpunit/php-file-iterator": "^4.0", - "phpunit/php-text-template": "^3.0", - "sebastian/code-unit-reverse-lookup": "^3.0", - "sebastian/complexity": "^3.0", - "sebastian/environment": "^6.0", - "sebastian/lines-of-code": "^2.0", - "sebastian/version": "^4.0", - "theseer/tokenizer": "^1.2.0" + "nikic/php-parser": "^4.19.1 || ^5.1.0", + "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": "^10.0" + "phpunit/phpunit": "^10.1" }, "suggest": { "ext-pcov": "PHP extension that provides line coverage", @@ -62,7 +63,7 @@ }, "extra": { "branch-alias": { - "dev-main": "10.0-dev" + "dev-main": "10.1.x-dev" } } } diff --git a/vendor/phpunit/php-code-coverage/src/CodeCoverage.php b/vendor/phpunit/php-code-coverage/src/CodeCoverage.php index 6a8ea970..805fd822 100644 --- a/vendor/phpunit/php-code-coverage/src/CodeCoverage.php +++ b/vendor/phpunit/php-code-coverage/src/CodeCoverage.php @@ -14,6 +14,7 @@ use function array_diff_key; use function array_flip; use function array_keys; use function array_merge; +use function array_merge_recursive; use function array_unique; use function count; use function explode; @@ -35,6 +36,11 @@ use SebastianBergmann\CodeUnitReverseLookup\Wizard; /** * Provides collection functionality for PHP code coverage information. + * + * @psalm-type TestType = array{ + * size: string, + * status: string, + * } */ final class CodeCoverage { @@ -51,7 +57,12 @@ final class CodeCoverage private bool $useAnnotationsForIgnoringCode = true; /** - * @psalm-var array + * @psalm-var array> + */ + private array $linesToBeIgnored = []; + + /** + * @psalm-var array */ private array $tests = []; @@ -61,6 +72,7 @@ final class CodeCoverage private array $parentClassesExcludedFromUnintentionallyCoveredCodeCheck = []; private ?FileAnalyser $analyser = null; private ?string $cacheDirectory = null; + private ?Directory $cachedReport = null; public function __construct(Driver $driver, Filter $filter) { @@ -75,7 +87,11 @@ final class CodeCoverage */ public function getReport(): Directory { - return (new Builder($this->analyser()))->build($this); + if ($this->cachedReport === null) { + $this->cachedReport = (new Builder($this->analyser()))->build($this); + } + + return $this->cachedReport; } /** @@ -83,10 +99,19 @@ final class CodeCoverage */ public function clear(): void { - $this->currentId = null; - $this->currentSize = null; - $this->data = new ProcessedCodeCoverageData; - $this->tests = []; + $this->currentId = null; + $this->currentSize = null; + $this->data = new ProcessedCodeCoverageData; + $this->tests = []; + $this->cachedReport = null; + } + + /** + * @internal + */ + public function clearCache(): void + { + $this->cachedReport = null; } /** @@ -120,7 +145,7 @@ final class CodeCoverage } /** - * @psalm-return array + * @psalm-return array */ public function getTests(): array { @@ -128,14 +153,14 @@ final class CodeCoverage } /** - * @psalm-param array $tests + * @psalm-param array $tests */ public function setTests(array $tests): void { $this->tests = $tests; } - public function start(string $id, TestSize $size = null, bool $clear = false): void + public function start(string $id, ?TestSize $size = null, bool $clear = false): void { if ($clear) { $this->clear(); @@ -145,26 +170,39 @@ final class CodeCoverage $this->currentSize = $size; $this->driver->start(); + + $this->cachedReport = null; } - public function stop(bool $append = true, TestStatus $status = null, array|false $linesToBeCovered = [], array $linesToBeUsed = []): RawCodeCoverageData + /** + * @psalm-param array> $linesToBeIgnored + */ + public function stop(bool $append = true, ?TestStatus $status = null, array|false $linesToBeCovered = [], array $linesToBeUsed = [], array $linesToBeIgnored = []): RawCodeCoverageData { $data = $this->driver->stop(); - $this->append($data, null, $append, $status, $linesToBeCovered, $linesToBeUsed); + $this->linesToBeIgnored = array_merge_recursive( + $this->linesToBeIgnored, + $linesToBeIgnored, + ); - $this->currentId = null; - $this->currentSize = null; + $this->append($data, null, $append, $status, $linesToBeCovered, $linesToBeUsed, $linesToBeIgnored); + + $this->currentId = null; + $this->currentSize = null; + $this->cachedReport = null; return $data; } /** + * @psalm-param array> $linesToBeIgnored + * * @throws ReflectionException * @throws TestIdMissingException * @throws UnintentionallyCoveredCodeException */ - public function append(RawCodeCoverageData $rawData, string $id = null, bool $append = true, TestStatus $status = null, array|false $linesToBeCovered = [], array $linesToBeUsed = []): void + public function append(RawCodeCoverageData $rawData, ?string $id = null, bool $append = true, ?TestStatus $status = null, array|false $linesToBeCovered = [], array $linesToBeUsed = [], array $linesToBeIgnored = []): void { if ($id === null) { $id = $this->currentId; @@ -174,6 +212,8 @@ final class CodeCoverage throw new TestIdMissingException; } + $this->cachedReport = null; + if ($status === null) { $status = TestStatus::unknown(); } @@ -189,7 +229,7 @@ final class CodeCoverage $this->applyExecutableLinesFilter($rawData); if ($this->useAnnotationsForIgnoringCode) { - $this->applyIgnoredLinesFilter($rawData); + $this->applyIgnoredLinesFilter($rawData, $linesToBeIgnored); } $this->data->initializeUnseenData($rawData); @@ -198,25 +238,27 @@ final class CodeCoverage return; } - if ($id !== self::UNCOVERED_FILES) { - $this->applyCoversAndUsesFilter( - $rawData, - $linesToBeCovered, - $linesToBeUsed, - $size - ); - - if (empty($rawData->lineCoverage())) { - return; - } - - $this->tests[$id] = [ - 'size' => $size->asString(), - 'status' => $status->asString(), - ]; - - $this->data->markCodeAsExecutedByTestCase($id, $rawData); + if ($id === self::UNCOVERED_FILES) { + return; } + + $this->applyCoversAndUsesFilter( + $rawData, + $linesToBeCovered, + $linesToBeUsed, + $size, + ); + + if (empty($rawData->lineCoverage())) { + return; + } + + $this->tests[$id] = [ + 'size' => $size->asString(), + 'status' => $status->asString(), + ]; + + $this->data->markCodeAsExecutedByTestCase($id, $rawData); } /** @@ -225,12 +267,14 @@ final class CodeCoverage public function merge(self $that): void { $this->filter->includeFiles( - $that->filter()->files() + $that->filter()->files(), ); $this->data->merge($that->data); $this->tests = array_merge($this->tests, $that->getTests()); + + $this->cachedReport = null; } public function enableCheckForUnintentionallyCoveredCode(): void @@ -298,7 +342,7 @@ final class CodeCoverage { if (!$this->cachesStaticAnalysis()) { throw new StaticAnalysisCacheNotConfiguredException( - 'The static analysis cache is not configured' + 'The static analysis cache is not configured', ); } @@ -392,26 +436,36 @@ final class CodeCoverage $data->keepLineCoverageDataOnlyForLines( $filename, - array_keys($linesToBranchMap) + array_keys($linesToBranchMap), ); $data->markExecutableLineByBranch( $filename, - $linesToBranchMap + $linesToBranchMap, ); } } - private function applyIgnoredLinesFilter(RawCodeCoverageData $data): void + /** + * @psalm-param array> $linesToBeIgnored + */ + private function applyIgnoredLinesFilter(RawCodeCoverageData $data, array $linesToBeIgnored): void { foreach (array_keys($data->lineCoverage()) as $filename) { if (!$this->filter->isFile($filename)) { continue; } + if (isset($linesToBeIgnored[$filename])) { + $data->removeCoverageDataForLines( + $filename, + $linesToBeIgnored[$filename], + ); + } + $data->removeCoverageDataForLines( $filename, - $this->analyser()->ignoredLinesFor($filename) + $this->analyser()->ignoredLinesFor($filename), ); } } @@ -423,7 +477,7 @@ final class CodeCoverage { $uncoveredFiles = array_diff( $this->filter->files(), - $this->data->coveredFiles() + $this->data->coveredFiles(), ); foreach ($uncoveredFiles as $uncoveredFile) { @@ -431,9 +485,10 @@ final class CodeCoverage $this->append( RawCodeCoverageData::fromUncoveredFile( $uncoveredFile, - $this->analyser() + $this->analyser(), ), - self::UNCOVERED_FILES + self::UNCOVERED_FILES, + linesToBeIgnored: $this->linesToBeIgnored, ); } } @@ -447,7 +502,7 @@ final class CodeCoverage { $allowedLines = $this->getAllowedLines( $linesToBeCovered, - $linesToBeUsed + $linesToBeUsed, ); $unintentionallyCoveredUnits = []; @@ -464,7 +519,7 @@ final class CodeCoverage if (!empty($unintentionallyCoveredUnits)) { throw new UnintentionallyCoveredCodeException( - $unintentionallyCoveredUnits + $unintentionallyCoveredUnits, ); } } @@ -480,7 +535,7 @@ final class CodeCoverage $allowedLines[$file] = array_merge( $allowedLines[$file], - $linesToBeCovered[$file] + $linesToBeCovered[$file], ); } @@ -491,13 +546,13 @@ final class CodeCoverage $allowedLines[$file] = array_merge( $allowedLines[$file], - $linesToBeUsed[$file] + $linesToBeUsed[$file], ); } foreach (array_keys($allowedLines) as $file) { $allowedLines[$file] = array_flip( - array_unique($allowedLines[$file]) + array_unique($allowedLines[$file]), ); } @@ -537,7 +592,7 @@ final class CodeCoverage throw new ReflectionException( $e->getMessage(), $e->getCode(), - $e + $e, ); } @@ -559,13 +614,15 @@ final class CodeCoverage $this->analyser = new ParsingFileAnalyser( $this->useAnnotationsForIgnoringCode, - $this->ignoreDeprecatedCode + $this->ignoreDeprecatedCode, ); if ($this->cachesStaticAnalysis()) { $this->analyser = new CachingFileAnalyser( $this->cacheDirectory, - $this->analyser + $this->analyser, + $this->useAnnotationsForIgnoringCode, + $this->ignoreDeprecatedCode, ); } diff --git a/vendor/phpunit/php-code-coverage/src/Data/ProcessedCodeCoverageData.php b/vendor/phpunit/php-code-coverage/src/Data/ProcessedCodeCoverageData.php index 49d7acb0..28834c24 100644 --- a/vendor/phpunit/php-code-coverage/src/Data/ProcessedCodeCoverageData.php +++ b/vendor/phpunit/php-code-coverage/src/Data/ProcessedCodeCoverageData.php @@ -20,12 +20,18 @@ use SebastianBergmann\CodeCoverage\Driver\Driver; /** * @internal This class is not covered by the backward compatibility promise for phpunit/php-code-coverage + * + * @psalm-import-type XdebugFunctionCoverageType from \SebastianBergmann\CodeCoverage\Driver\XdebugDriver + * + * @psalm-type TestIdType = string */ final class ProcessedCodeCoverageData { /** * Line coverage data. * An array of filenames, each having an array of linenumbers, each executable line having an array of testcase ids. + * + * @psalm-var array>> */ private array $lineCoverage = []; @@ -33,6 +39,23 @@ final class ProcessedCodeCoverageData * Function coverage data. * Maintains base format of raw data (@see https://xdebug.org/docs/code_coverage), but each 'hit' entry is an array * of testcase ids. + * + * @psalm-var array, + * out: array, + * out_hit: array, + * }>, + * paths: array, + * hit: list, + * }>, + * hit: list + * }>> */ private array $functionCoverage = []; @@ -141,8 +164,8 @@ final class ProcessedCodeCoverageData $compareLineNumbers = array_unique( array_merge( array_keys($this->lineCoverage[$file]), - array_keys($newData->lineCoverage[$file]) - ) + array_keys($newData->lineCoverage[$file]), + ), ); foreach ($compareLineNumbers as $line) { @@ -153,7 +176,7 @@ final class ProcessedCodeCoverageData $this->lineCoverage[$file][$line] = $newData->lineCoverage[$file][$line]; } elseif ($thatPriority === $thisPriority && is_array($this->lineCoverage[$file][$line])) { $this->lineCoverage[$file][$line] = array_unique( - array_merge($this->lineCoverage[$file][$line], $newData->lineCoverage[$file][$line]) + array_merge($this->lineCoverage[$file][$line], $newData->lineCoverage[$file][$line]), ); } } @@ -213,6 +236,8 @@ final class ProcessedCodeCoverageData /** * For a function we have never seen before, copy all data over and simply init the 'hit' array. + * + * @psalm-param XdebugFunctionCoverageType $functionData */ private function initPreviouslyUnseenFunction(string $file, string $functionName, array $functionData): void { @@ -231,6 +256,8 @@ final class ProcessedCodeCoverageData * For a function we have seen before, only copy over and init the 'hit' array for any unseen branches and paths. * Techniques such as mocking and where the contents of a file are different vary during tests (e.g. compiling * containers) mean that the functions inside a file cannot be relied upon to be static. + * + * @psalm-param XdebugFunctionCoverageType $functionData */ private function initPreviouslySeenFunction(string $file, string $functionName, array $functionData): void { diff --git a/vendor/phpunit/php-code-coverage/src/Data/RawCodeCoverageData.php b/vendor/phpunit/php-code-coverage/src/Data/RawCodeCoverageData.php index c261faff..49cefbbe 100644 --- a/vendor/phpunit/php-code-coverage/src/Data/RawCodeCoverageData.php +++ b/vendor/phpunit/php-code-coverage/src/Data/RawCodeCoverageData.php @@ -19,13 +19,20 @@ use function explode; use function file_get_contents; use function in_array; use function is_file; +use function preg_replace; use function range; +use function str_ends_with; +use function str_starts_with; use function trim; use SebastianBergmann\CodeCoverage\Driver\Driver; use SebastianBergmann\CodeCoverage\StaticAnalysis\FileAnalyser; /** * @internal This class is not covered by the backward compatibility promise for phpunit/php-code-coverage + * + * @psalm-import-type XdebugFunctionsCoverageType from \SebastianBergmann\CodeCoverage\Driver\XdebugDriver + * @psalm-import-type XdebugCodeCoverageWithoutPathCoverageType from \SebastianBergmann\CodeCoverage\Driver\XdebugDriver + * @psalm-import-type XdebugCodeCoverageWithPathCoverageType from \SebastianBergmann\CodeCoverage\Driver\XdebugDriver */ final class RawCodeCoverageData { @@ -35,26 +42,41 @@ final class RawCodeCoverageData private static array $emptyLineCache = []; /** - * @see https://xdebug.org/docs/code_coverage for format + * @psalm-var XdebugCodeCoverageWithoutPathCoverageType */ private array $lineCoverage; /** - * @see https://xdebug.org/docs/code_coverage for format + * @psalm-var array */ private array $functionCoverage; + /** + * @psalm-param XdebugCodeCoverageWithoutPathCoverageType $rawCoverage + */ public static function fromXdebugWithoutPathCoverage(array $rawCoverage): self { return new self($rawCoverage, []); } + /** + * @psalm-param XdebugCodeCoverageWithPathCoverageType $rawCoverage + */ public static function fromXdebugWithPathCoverage(array $rawCoverage): self { $lineCoverage = []; $functionCoverage = []; foreach ($rawCoverage as $file => $fileCoverageData) { + // Xdebug annotates the function name of traits, strip that off + foreach ($fileCoverageData['functions'] as $existingKey => $data) { + if (str_ends_with($existingKey, '}') && !str_starts_with($existingKey, '{')) { // don't want to catch {main} + $newKey = preg_replace('/\{.*}$/', '', $existingKey); + $fileCoverageData['functions'][$newKey] = $data; + unset($fileCoverageData['functions'][$existingKey]); + } + } + $lineCoverage[$file] = $fileCoverageData['lines']; $functionCoverage[$file] = $fileCoverageData['functions']; } @@ -73,6 +95,10 @@ final class RawCodeCoverageData return new self([$filename => $lineCoverage], []); } + /** + * @psalm-param XdebugCodeCoverageWithoutPathCoverageType $lineCoverage + * @psalm-param array $functionCoverage + */ private function __construct(array $lineCoverage, array $functionCoverage) { $this->lineCoverage = $lineCoverage; @@ -86,11 +112,17 @@ final class RawCodeCoverageData $this->lineCoverage = $this->functionCoverage = []; } + /** + * @psalm-return XdebugCodeCoverageWithoutPathCoverageType + */ public function lineCoverage(): array { return $this->lineCoverage; } + /** + * @psalm-return array + */ public function functionCoverage(): array { return $this->functionCoverage; @@ -112,7 +144,7 @@ final class RawCodeCoverageData $this->lineCoverage[$filename] = array_intersect_key( $this->lineCoverage[$filename], - array_flip($lines) + array_flip($lines), ); } @@ -191,7 +223,7 @@ final class RawCodeCoverageData $this->lineCoverage[$filename] = array_diff_key( $this->lineCoverage[$filename], - array_flip($lines) + array_flip($lines), ); if (isset($this->functionCoverage[$filename])) { diff --git a/vendor/phpunit/php-code-coverage/src/Driver/Driver.php b/vendor/phpunit/php-code-coverage/src/Driver/Driver.php index 31c4e644..cfbed9cf 100644 --- a/vendor/phpunit/php-code-coverage/src/Driver/Driver.php +++ b/vendor/phpunit/php-code-coverage/src/Driver/Driver.php @@ -75,8 +75,8 @@ abstract class Driver throw new BranchAndPathCoverageNotSupportedException( sprintf( '%s does not support branch and path coverage', - $this->nameAndVersion() - ) + $this->nameAndVersion(), + ), ); } @@ -107,8 +107,8 @@ abstract class Driver throw new DeadCodeDetectionNotSupportedException( sprintf( '%s does not support dead code detection', - $this->nameAndVersion() - ) + $this->nameAndVersion(), + ), ); } diff --git a/vendor/phpunit/php-code-coverage/src/Driver/XdebugDriver.php b/vendor/phpunit/php-code-coverage/src/Driver/XdebugDriver.php index 3a06c11f..37f4572d 100644 --- a/vendor/phpunit/php-code-coverage/src/Driver/XdebugDriver.php +++ b/vendor/phpunit/php-code-coverage/src/Driver/XdebugDriver.php @@ -31,6 +31,34 @@ use SebastianBergmann\CodeCoverage\Filter; /** * @internal This class is not covered by the backward compatibility promise for phpunit/php-code-coverage + * + * @see https://xdebug.org/docs/code_coverage#xdebug_get_code_coverage + * + * @psalm-type XdebugLinesCoverageType = array + * @psalm-type XdebugBranchCoverageType = array{ + * op_start: int, + * op_end: int, + * line_start: int, + * line_end: int, + * hit: int, + * out: array, + * out_hit: array, + * } + * @psalm-type XdebugPathCoverageType = array{ + * path: array, + * hit: int, + * } + * @psalm-type XdebugFunctionCoverageType = array{ + * branches: array, + * paths: array, + * } + * @psalm-type XdebugFunctionsCoverageType = array + * @psalm-type XdebugPathAndBranchesCoverageType = array{ + * lines: XdebugLinesCoverageType, + * functions: XdebugFunctionsCoverageType, + * } + * @psalm-type XdebugCodeCoverageWithoutPathCoverageType = array + * @psalm-type XdebugCodeCoverageWithPathCoverageType = array */ final class XdebugDriver extends Driver { @@ -47,7 +75,7 @@ final class XdebugDriver extends Driver xdebug_set_filter( XDEBUG_FILTER_CODE_COVERAGE, XDEBUG_PATH_INCLUDE, - $filter->files() + $filter->files(), ); } } @@ -84,9 +112,11 @@ final class XdebugDriver extends Driver xdebug_stop_code_coverage(); if ($this->collectsBranchAndPathCoverage()) { + /* @var XdebugCodeCoverageWithPathCoverageType $data */ return RawCodeCoverageData::fromXdebugWithPathCoverage($data); } + /* @var XdebugCodeCoverageWithoutPathCoverageType $data */ return RawCodeCoverageData::fromXdebugWithoutPathCoverage($data); } diff --git a/vendor/phpunit/php-code-coverage/src/Exception/XdebugNotEnabledException.php b/vendor/phpunit/php-code-coverage/src/Exception/XdebugNotEnabledException.php index b070ed5a..a8df4645 100644 --- a/vendor/phpunit/php-code-coverage/src/Exception/XdebugNotEnabledException.php +++ b/vendor/phpunit/php-code-coverage/src/Exception/XdebugNotEnabledException.php @@ -16,6 +16,6 @@ final class XdebugNotEnabledException extends RuntimeException implements Except { public function __construct() { - parent::__construct('XDEBUG_MODE=coverage or xdebug.mode=coverage has to be set'); + parent::__construct('XDEBUG_MODE=coverage (environment variable) or xdebug.mode=coverage (PHP configuration setting) has to be set'); } } diff --git a/vendor/phpunit/php-code-coverage/src/Filter.php b/vendor/phpunit/php-code-coverage/src/Filter.php index 162efe9f..f51eb3e1 100644 --- a/vendor/phpunit/php-code-coverage/src/Filter.php +++ b/vendor/phpunit/php-code-coverage/src/Filter.php @@ -28,6 +28,9 @@ final class Filter */ private array $isFileCache = []; + /** + * @deprecated + */ public function includeDirectory(string $directory, string $suffix = '.php', string $prefix = ''): void { foreach ((new FileIteratorFacade)->getFilesAsArray($directory, $suffix, $prefix) as $file) { @@ -56,6 +59,9 @@ final class Filter $this->files[$filename] = true; } + /** + * @deprecated + */ public function excludeDirectory(string $directory, string $suffix = '.php', string $prefix = ''): void { foreach ((new FileIteratorFacade)->getFilesAsArray($directory, $suffix, $prefix) as $file) { @@ -63,6 +69,9 @@ final class Filter } } + /** + * @deprecated + */ public function excludeFile(string $filename): void { $filename = realpath($filename); diff --git a/vendor/phpunit/php-code-coverage/src/Node/AbstractNode.php b/vendor/phpunit/php-code-coverage/src/Node/AbstractNode.php index a53d6e88..3f21a50e 100644 --- a/vendor/phpunit/php-code-coverage/src/Node/AbstractNode.php +++ b/vendor/phpunit/php-code-coverage/src/Node/AbstractNode.php @@ -19,6 +19,11 @@ use SebastianBergmann\CodeCoverage\Util\Percentage; /** * @internal This class is not covered by the backward compatibility promise for phpunit/php-code-coverage + * + * @psalm-import-type LinesOfCodeType from \SebastianBergmann\CodeCoverage\StaticAnalysis\FileAnalyser + * @psalm-import-type ProcessedFunctionType from \SebastianBergmann\CodeCoverage\Node\File + * @psalm-import-type ProcessedClassType from \SebastianBergmann\CodeCoverage\Node\File + * @psalm-import-type ProcessedTraitType from \SebastianBergmann\CodeCoverage\Node\File */ abstract class AbstractNode implements Countable { @@ -28,7 +33,7 @@ abstract class AbstractNode implements Countable private readonly ?AbstractNode $parent; private string $id; - public function __construct(string $name, self $parent = null) + public function __construct(string $name, ?self $parent = null) { if (str_ends_with($name, DIRECTORY_SEPARATOR)) { $name = substr($name, 0, -1); @@ -126,7 +131,7 @@ abstract class AbstractNode implements Countable { return Percentage::fromFractionAndTotal( $this->numberOfExecutedBranches(), - $this->numberOfExecutableBranches() + $this->numberOfExecutableBranches(), ); } @@ -134,7 +139,7 @@ abstract class AbstractNode implements Countable { return Percentage::fromFractionAndTotal( $this->numberOfExecutedPaths(), - $this->numberOfExecutablePaths() + $this->numberOfExecutablePaths(), ); } @@ -163,14 +168,23 @@ abstract class AbstractNode implements Countable return $this->numberOfTestedFunctions() + $this->numberOfTestedMethods(); } + /** + * @psalm-return array + */ abstract public function classes(): array; + /** + * @psalm-return array + */ abstract public function traits(): array; + /** + * @psalm-return array + */ abstract public function functions(): array; /** - * @psalm-return array{linesOfCode: int, commentLinesOfCode: int, nonCommentLinesOfCode: int} + * @psalm-return LinesOfCodeType */ abstract public function linesOfCode(): array; diff --git a/vendor/phpunit/php-code-coverage/src/Node/Builder.php b/vendor/phpunit/php-code-coverage/src/Node/Builder.php index f5edda89..5ed6f866 100644 --- a/vendor/phpunit/php-code-coverage/src/Node/Builder.php +++ b/vendor/phpunit/php-code-coverage/src/Node/Builder.php @@ -27,6 +27,8 @@ use SebastianBergmann\CodeCoverage\StaticAnalysis\FileAnalyser; /** * @internal This class is not covered by the backward compatibility promise for phpunit/php-code-coverage + * + * @psalm-import-type TestType from \SebastianBergmann\CodeCoverage\CodeCoverage */ final class Builder { @@ -43,20 +45,20 @@ final class Builder $commonPath = $this->reducePaths($data); $root = new Directory( $commonPath, - null + null, ); $this->addItems( $root, $this->buildDirectoryStructure($data), - $coverage->getTests() + $coverage->getTests(), ); return $root; } /** - * @psalm-param array $tests + * @psalm-param array $tests */ private function addItems(Directory $root, array $items, array $tests): void { @@ -78,8 +80,8 @@ final class Builder $this->analyser->classesIn($filename), $this->analyser->traitsIn($filename), $this->analyser->functionsIn($filename), - $this->analyser->linesOfCodeFor($filename) - ) + $this->analyser->linesOfCodeFor($filename), + ), ); } } else { @@ -129,6 +131,8 @@ final class Builder * ) * ) *
+ * + * @psalm-return array, functionCoverage: array>}>> */ private function buildDirectoryStructure(ProcessedCodeCoverageData $data): array { diff --git a/vendor/phpunit/php-code-coverage/src/Node/CrapIndex.php b/vendor/phpunit/php-code-coverage/src/Node/CrapIndex.php index 8992346c..7173276c 100644 --- a/vendor/phpunit/php-code-coverage/src/Node/CrapIndex.php +++ b/vendor/phpunit/php-code-coverage/src/Node/CrapIndex.php @@ -37,7 +37,7 @@ final class CrapIndex return sprintf( '%01.2F', - $this->cyclomaticComplexity ** 2 * (1 - $this->codeCoverage / 100) ** 3 + $this->cyclomaticComplexity + $this->cyclomaticComplexity ** 2 * (1 - $this->codeCoverage / 100) ** 3 + $this->cyclomaticComplexity, ); } } diff --git a/vendor/phpunit/php-code-coverage/src/Node/Directory.php b/vendor/phpunit/php-code-coverage/src/Node/Directory.php index 0e430264..176318bd 100644 --- a/vendor/phpunit/php-code-coverage/src/Node/Directory.php +++ b/vendor/phpunit/php-code-coverage/src/Node/Directory.php @@ -16,6 +16,8 @@ use RecursiveIteratorIterator; /** * @internal This class is not covered by the backward compatibility promise for phpunit/php-code-coverage + * + * @psalm-import-type LinesOfCodeType from \SebastianBergmann\CodeCoverage\StaticAnalysis\FileAnalyser */ final class Directory extends AbstractNode implements IteratorAggregate { @@ -38,7 +40,7 @@ final class Directory extends AbstractNode implements IteratorAggregate private ?array $functions = null; /** - * @psalm-var null|array{linesOfCode: int, commentLinesOfCode: int, nonCommentLinesOfCode: int} + * @psalm-var null|LinesOfCodeType */ private ?array $linesOfCode = null; private int $numFiles = -1; @@ -74,7 +76,7 @@ final class Directory extends AbstractNode implements IteratorAggregate { return new RecursiveIteratorIterator( new Iterator($this), - RecursiveIteratorIterator::SELF_FIRST + RecursiveIteratorIterator::SELF_FIRST, ); } @@ -120,7 +122,7 @@ final class Directory extends AbstractNode implements IteratorAggregate foreach ($this->children as $child) { $this->classes = array_merge( $this->classes, - $child->classes() + $child->classes(), ); } } @@ -136,7 +138,7 @@ final class Directory extends AbstractNode implements IteratorAggregate foreach ($this->children as $child) { $this->traits = array_merge( $this->traits, - $child->traits() + $child->traits(), ); } } @@ -152,7 +154,7 @@ final class Directory extends AbstractNode implements IteratorAggregate foreach ($this->children as $child) { $this->functions = array_merge( $this->functions, - $child->functions() + $child->functions(), ); } } @@ -161,7 +163,7 @@ final class Directory extends AbstractNode implements IteratorAggregate } /** - * @psalm-return array{linesOfCode: int, commentLinesOfCode: int, nonCommentLinesOfCode: int} + * @psalm-return LinesOfCodeType */ public function linesOfCode(): array { @@ -175,8 +177,8 @@ final class Directory extends AbstractNode implements IteratorAggregate foreach ($this->children as $child) { $childLinesOfCode = $child->linesOfCode(); - $this->linesOfCode['linesOfCode'] += $childLinesOfCode['linesOfCode']; - $this->linesOfCode['commentLinesOfCode'] += $childLinesOfCode['commentLinesOfCode']; + $this->linesOfCode['linesOfCode'] += $childLinesOfCode['linesOfCode']; + $this->linesOfCode['commentLinesOfCode'] += $childLinesOfCode['commentLinesOfCode']; $this->linesOfCode['nonCommentLinesOfCode'] += $childLinesOfCode['nonCommentLinesOfCode']; } } diff --git a/vendor/phpunit/php-code-coverage/src/Node/File.php b/vendor/phpunit/php-code-coverage/src/Node/File.php index 1d00d6f7..7029e8a5 100644 --- a/vendor/phpunit/php-code-coverage/src/Node/File.php +++ b/vendor/phpunit/php-code-coverage/src/Node/File.php @@ -15,9 +15,86 @@ use function range; /** * @internal This class is not covered by the backward compatibility promise for phpunit/php-code-coverage + * + * @psalm-import-type CodeUnitFunctionType from \SebastianBergmann\CodeCoverage\StaticAnalysis\CodeUnitFindingVisitor + * @psalm-import-type CodeUnitMethodType from \SebastianBergmann\CodeCoverage\StaticAnalysis\CodeUnitFindingVisitor + * @psalm-import-type CodeUnitClassType from \SebastianBergmann\CodeCoverage\StaticAnalysis\CodeUnitFindingVisitor + * @psalm-import-type CodeUnitTraitType from \SebastianBergmann\CodeCoverage\StaticAnalysis\CodeUnitFindingVisitor + * @psalm-import-type LinesOfCodeType from \SebastianBergmann\CodeCoverage\StaticAnalysis\FileAnalyser + * @psalm-import-type LinesType from \SebastianBergmann\CodeCoverage\StaticAnalysis\FileAnalyser + * + * @psalm-type ProcessedFunctionType = array{ + * functionName: string, + * namespace: string, + * signature: string, + * startLine: int, + * endLine: int, + * executableLines: int, + * executedLines: int, + * executableBranches: int, + * executedBranches: int, + * executablePaths: int, + * executedPaths: int, + * ccn: int, + * coverage: int|float, + * crap: int|string, + * link: string + * } + * @psalm-type ProcessedMethodType = array{ + * methodName: string, + * visibility: string, + * signature: string, + * startLine: int, + * endLine: int, + * executableLines: int, + * executedLines: int, + * executableBranches: int, + * executedBranches: int, + * executablePaths: int, + * executedPaths: int, + * ccn: int, + * coverage: float|int, + * crap: int|string, + * link: string + * } + * @psalm-type ProcessedClassType = array{ + * className: string, + * namespace: string, + * methods: array, + * startLine: int, + * executableLines: int, + * executedLines: int, + * executableBranches: int, + * executedBranches: int, + * executablePaths: int, + * executedPaths: int, + * ccn: int, + * coverage: int|float, + * crap: int|string, + * link: string + * } + * @psalm-type ProcessedTraitType = array{ + * traitName: string, + * namespace: string, + * methods: array, + * startLine: int, + * executableLines: int, + * executedLines: int, + * executableBranches: int, + * executedBranches: int, + * executablePaths: int, + * executedPaths: int, + * ccn: int, + * coverage: float|int, + * crap: int|string, + * link: string + * } */ final class File extends AbstractNode { + /** + * @psalm-var array> + */ private array $lineCoverageData; private array $functionCoverageData; private readonly array $testData; @@ -27,12 +104,24 @@ final class File extends AbstractNode private int $numExecutedBranches = 0; private int $numExecutablePaths = 0; private int $numExecutedPaths = 0; - private array $classes = []; - private array $traits = []; - private array $functions = []; /** - * @psalm-return array{linesOfCode: int, commentLinesOfCode: int, nonCommentLinesOfCode: int} + * @psalm-var array + */ + private array $classes = []; + + /** + * @psalm-var array + */ + private array $traits = []; + + /** + * @psalm-var array + */ + private array $functions = []; + + /** + * @psalm-var LinesOfCodeType */ private readonly array $linesOfCode; private ?int $numClasses = null; @@ -42,10 +131,18 @@ final class File extends AbstractNode private ?int $numMethods = null; private ?int $numTestedMethods = null; private ?int $numTestedFunctions = null; - private array $codeUnitsByLine = []; /** - * @psalm-param array{linesOfCode: int, commentLinesOfCode: int, nonCommentLinesOfCode: int} $linesOfCode + * @var array + */ + private array $codeUnitsByLine = []; + + /** + * @psalm-param array> $lineCoverageData + * @psalm-param LinesOfCodeType $linesOfCode + * @psalm-param array $classes + * @psalm-param array $traits + * @psalm-param array $functions */ public function __construct(string $name, AbstractNode $parent, array $lineCoverageData, array $functionCoverageData, array $testData, array $classes, array $traits, array $functions, array $linesOfCode) { @@ -64,6 +161,9 @@ final class File extends AbstractNode return 1; } + /** + * @psalm-return array> + */ public function lineCoverageData(): array { return $this->lineCoverageData; @@ -94,9 +194,6 @@ final class File extends AbstractNode return $this->functions; } - /** - * @psalm-return array{linesOfCode: int, commentLinesOfCode: int, nonCommentLinesOfCode: int} - */ public function linesOfCode(): array { return $this->linesOfCode; @@ -253,6 +350,11 @@ final class File extends AbstractNode return $this->numTestedFunctions; } + /** + * @psalm-param array $classes + * @psalm-param array $traits + * @psalm-param array $functions + */ private function calculateStatistics(array $classes, array $traits, array $functions): void { foreach (range(1, $this->linesOfCode['linesOfCode']) as $lineNumber) { @@ -355,6 +457,9 @@ final class File extends AbstractNode } } + /** + * @psalm-param array $classes + */ private function processClasses(array $classes): void { $link = $this->id() . '.html#'; @@ -382,14 +487,14 @@ final class File extends AbstractNode $this->classes[$className]['methods'][$methodName] = $methodData; $this->classes[$className]['executableBranches'] += $methodData['executableBranches']; - $this->classes[$className]['executedBranches'] += $methodData['executedBranches']; - $this->classes[$className]['executablePaths'] += $methodData['executablePaths']; - $this->classes[$className]['executedPaths'] += $methodData['executedPaths']; + $this->classes[$className]['executedBranches'] += $methodData['executedBranches']; + $this->classes[$className]['executablePaths'] += $methodData['executablePaths']; + $this->classes[$className]['executedPaths'] += $methodData['executedPaths']; $this->numExecutableBranches += $methodData['executableBranches']; - $this->numExecutedBranches += $methodData['executedBranches']; - $this->numExecutablePaths += $methodData['executablePaths']; - $this->numExecutedPaths += $methodData['executedPaths']; + $this->numExecutedBranches += $methodData['executedBranches']; + $this->numExecutablePaths += $methodData['executablePaths']; + $this->numExecutedPaths += $methodData['executedPaths']; foreach (range($method['startLine'], $method['endLine']) as $lineNumber) { $this->codeUnitsByLine[$lineNumber] = [ @@ -401,6 +506,9 @@ final class File extends AbstractNode } } + /** + * @psalm-param array $traits + */ private function processTraits(array $traits): void { $link = $this->id() . '.html#'; @@ -428,14 +536,14 @@ final class File extends AbstractNode $this->traits[$traitName]['methods'][$methodName] = $methodData; $this->traits[$traitName]['executableBranches'] += $methodData['executableBranches']; - $this->traits[$traitName]['executedBranches'] += $methodData['executedBranches']; - $this->traits[$traitName]['executablePaths'] += $methodData['executablePaths']; - $this->traits[$traitName]['executedPaths'] += $methodData['executedPaths']; + $this->traits[$traitName]['executedBranches'] += $methodData['executedBranches']; + $this->traits[$traitName]['executablePaths'] += $methodData['executablePaths']; + $this->traits[$traitName]['executedPaths'] += $methodData['executedPaths']; $this->numExecutableBranches += $methodData['executableBranches']; - $this->numExecutedBranches += $methodData['executedBranches']; - $this->numExecutablePaths += $methodData['executablePaths']; - $this->numExecutedPaths += $methodData['executedPaths']; + $this->numExecutedBranches += $methodData['executedBranches']; + $this->numExecutablePaths += $methodData['executablePaths']; + $this->numExecutedPaths += $methodData['executedPaths']; foreach (range($method['startLine'], $method['endLine']) as $lineNumber) { $this->codeUnitsByLine[$lineNumber] = [ @@ -447,6 +555,9 @@ final class File extends AbstractNode } } + /** + * @psalm-param array $functions + */ private function processFunctions(array $functions): void { $link = $this->id() . '.html#'; @@ -476,7 +587,7 @@ final class File extends AbstractNode if (isset($this->functionCoverageData[$functionName]['branches'])) { $this->functions[$functionName]['executableBranches'] = count( - $this->functionCoverageData[$functionName]['branches'] + $this->functionCoverageData[$functionName]['branches'], ); $this->functions[$functionName]['executedBranches'] = count( @@ -485,14 +596,14 @@ final class File extends AbstractNode static function (array $branch) { return (bool) $branch['hit']; - } - ) + }, + ), ); } if (isset($this->functionCoverageData[$functionName]['paths'])) { $this->functions[$functionName]['executablePaths'] = count( - $this->functionCoverageData[$functionName]['paths'] + $this->functionCoverageData[$functionName]['paths'], ); $this->functions[$functionName]['executedPaths'] = count( @@ -501,18 +612,23 @@ final class File extends AbstractNode static function (array $path) { return (bool) $path['hit']; - } - ) + }, + ), ); } $this->numExecutableBranches += $this->functions[$functionName]['executableBranches']; - $this->numExecutedBranches += $this->functions[$functionName]['executedBranches']; - $this->numExecutablePaths += $this->functions[$functionName]['executablePaths']; - $this->numExecutedPaths += $this->functions[$functionName]['executedPaths']; + $this->numExecutedBranches += $this->functions[$functionName]['executedBranches']; + $this->numExecutablePaths += $this->functions[$functionName]['executablePaths']; + $this->numExecutedPaths += $this->functions[$functionName]['executedPaths']; } } + /** + * @psalm-param CodeUnitMethodType $method + * + * @psalm-return ProcessedMethodType + */ private function newMethod(string $className, string $methodName, array $method, string $link): array { $methodData = [ @@ -537,7 +653,7 @@ final class File extends AbstractNode if (isset($this->functionCoverageData[$key]['branches'])) { $methodData['executableBranches'] = count( - $this->functionCoverageData[$key]['branches'] + $this->functionCoverageData[$key]['branches'], ); $methodData['executedBranches'] = count( @@ -546,14 +662,14 @@ final class File extends AbstractNode static function (array $branch) { return (bool) $branch['hit']; - } - ) + }, + ), ); } if (isset($this->functionCoverageData[$key]['paths'])) { $methodData['executablePaths'] = count( - $this->functionCoverageData[$key]['paths'] + $this->functionCoverageData[$key]['paths'], ); $methodData['executedPaths'] = count( @@ -562,8 +678,8 @@ final class File extends AbstractNode static function (array $path) { return (bool) $path['hit']; - } - ) + }, + ), ); } diff --git a/vendor/phpunit/php-code-coverage/src/Report/Clover.php b/vendor/phpunit/php-code-coverage/src/Report/Clover.php index 75c731bb..8a24236f 100644 --- a/vendor/phpunit/php-code-coverage/src/Report/Clover.php +++ b/vendor/phpunit/php-code-coverage/src/Report/Clover.php @@ -16,6 +16,7 @@ use function is_string; use function ksort; use function max; use function range; +use function str_contains; use function time; use DOMDocument; use SebastianBergmann\CodeCoverage\CodeCoverage; @@ -78,7 +79,7 @@ final class Clover } $classMethods++; - $classStatements += $method['executableLines']; + $classStatements += $method['executableLines']; $coveredClassStatements += $method['executedLines']; if ($method['coverage'] == 100) { @@ -88,7 +89,7 @@ final class Clover $methodCount = 0; foreach (range($method['startLine'], $method['endLine']) as $line) { - if (isset($coverageData[$line]) && ($coverageData[$line] !== null)) { + if (isset($coverageData[$line])) { $methodCount = max($methodCount, count($coverageData[$line])); } } @@ -114,28 +115,28 @@ final class Clover if (!empty($class['package']['fullPackage'])) { $xmlClass->setAttribute( 'fullPackage', - $class['package']['fullPackage'] + $class['package']['fullPackage'], ); } if (!empty($class['package']['category'])) { $xmlClass->setAttribute( 'category', - $class['package']['category'] + $class['package']['category'], ); } if (!empty($class['package']['package'])) { $xmlClass->setAttribute( 'package', - $class['package']['package'] + $class['package']['package'], ); } if (!empty($class['package']['subpackage'])) { $xmlClass->setAttribute( 'subpackage', - $class['package']['subpackage'] + $class['package']['subpackage'], ); } @@ -212,7 +213,7 @@ final class Clover } else { if (!isset($packages[$namespace])) { $packages[$namespace] = $xmlDocument->createElement( - 'package' + 'package', ); $packages[$namespace]->setAttribute('name', $namespace); @@ -243,7 +244,9 @@ final class Clover $buffer = $xmlDocument->saveXML(); if ($target !== null) { - Filesystem::createDirectory(dirname($target)); + if (!str_contains($target, '://')) { + Filesystem::createDirectory(dirname($target)); + } if (@file_put_contents($target, $buffer) === false) { throw new WriteOperationFailedException($target); diff --git a/vendor/phpunit/php-code-coverage/src/Report/Cobertura.php b/vendor/phpunit/php-code-coverage/src/Report/Cobertura.php index 0d1dde76..7ff5582d 100644 --- a/vendor/phpunit/php-code-coverage/src/Report/Cobertura.php +++ b/vendor/phpunit/php-code-coverage/src/Report/Cobertura.php @@ -15,6 +15,7 @@ use function dirname; use function file_put_contents; use function preg_match; use function range; +use function str_contains; use function str_replace; use function time; use DOMImplementation; @@ -39,7 +40,7 @@ final class Cobertura $documentType = $implementation->createDocumentType( 'coverage', '', - 'http://cobertura.sourceforge.net/xml/coverage-04.dtd' + 'http://cobertura.sourceforge.net/xml/coverage-04.dtd', ); $document = $implementation->createDocument('', '', $documentType); @@ -113,7 +114,7 @@ final class Cobertura $coverageData = $item->lineCoverageData(); foreach ($classes as $className => $class) { - $complexity += $class['ccn']; + $complexity += $class['ccn']; $packageComplexity += $class['ccn']; if (!empty($class['package']['namespace'])) { @@ -174,7 +175,7 @@ final class Cobertura $methodElement->appendChild($methodLinesElement); foreach (range($method['startLine'], $method['endLine']) as $line) { - if (!isset($coverageData[$line]) || $coverageData[$line] === null) { + if (!isset($coverageData[$line])) { continue; } $methodLineElement = $document->createElement('line'); @@ -193,7 +194,7 @@ final class Cobertura } } - if ($report->numberOfFunctions() === 0) { + if ($item->numberOfFunctions() === 0) { $packageElement->setAttribute('complexity', (string) $packageComplexity); continue; @@ -217,29 +218,29 @@ final class Cobertura $classElement->appendChild($classLinesElement); - $functions = $report->functions(); + $functions = $item->functions(); foreach ($functions as $functionName => $function) { if ($function['executableLines'] === 0) { continue; } - $complexity += $function['ccn']; - $packageComplexity += $function['ccn']; + $complexity += $function['ccn']; + $packageComplexity += $function['ccn']; $functionsComplexity += $function['ccn']; $linesValid = $function['executableLines']; $linesCovered = $function['executedLines']; $lineRate = $linesValid === 0 ? 0 : ($linesCovered / $linesValid); - $functionsLinesValid += $linesValid; + $functionsLinesValid += $linesValid; $functionsLinesCovered += $linesCovered; $branchesValid = $function['executableBranches']; $branchesCovered = $function['executedBranches']; $branchRate = $branchesValid === 0 ? 0 : ($branchesCovered / $branchesValid); - $functionsBranchesValid += $branchesValid; + $functionsBranchesValid += $branchesValid; $functionsBranchesCovered += $branchesValid; $methodElement = $document->createElement('method'); @@ -255,7 +256,7 @@ final class Cobertura $methodElement->appendChild($methodLinesElement); foreach (range($function['startLine'], $function['endLine']) as $line) { - if (!isset($coverageData[$line]) || $coverageData[$line] === null) { + if (!isset($coverageData[$line])) { continue; } $methodLineElement = $document->createElement('line'); @@ -294,7 +295,9 @@ final class Cobertura $buffer = $document->saveXML(); if ($target !== null) { - Filesystem::createDirectory(dirname($target)); + if (!str_contains($target, '://')) { + Filesystem::createDirectory(dirname($target)); + } if (@file_put_contents($target, $buffer) === false) { throw new WriteOperationFailedException($target); diff --git a/vendor/phpunit/php-code-coverage/src/Report/Crap4j.php b/vendor/phpunit/php-code-coverage/src/Report/Crap4j.php index 59a8f712..cb1bde60 100644 --- a/vendor/phpunit/php-code-coverage/src/Report/Crap4j.php +++ b/vendor/phpunit/php-code-coverage/src/Report/Crap4j.php @@ -15,6 +15,7 @@ use function file_put_contents; use function htmlspecialchars; use function is_string; use function round; +use function str_contains; use DOMDocument; use SebastianBergmann\CodeCoverage\CodeCoverage; use SebastianBergmann\CodeCoverage\Driver\WriteOperationFailedException; @@ -72,7 +73,7 @@ final class Crap4j foreach ($class['methods'] as $methodName => $method) { $crapLoad = $this->crapLoad((float) $method['crap'], $method['ccn'], $method['coverage']); - $fullCrap += $method['crap']; + $fullCrap += $method['crap']; $fullCrapLoad += $crapLoad; $fullMethodCount++; @@ -121,7 +122,9 @@ final class Crap4j $buffer = $document->saveXML(); if ($target !== null) { - Filesystem::createDirectory(dirname($target)); + if (!str_contains($target, '://')) { + Filesystem::createDirectory(dirname($target)); + } if (@file_put_contents($target, $buffer) === false) { throw new WriteOperationFailedException($target); diff --git a/vendor/phpunit/php-code-coverage/src/Report/Html/CustomCssFile.php b/vendor/phpunit/php-code-coverage/src/Report/Html/CustomCssFile.php index 2e0a4fef..70a7230c 100644 --- a/vendor/phpunit/php-code-coverage/src/Report/Html/CustomCssFile.php +++ b/vendor/phpunit/php-code-coverage/src/Report/Html/CustomCssFile.php @@ -31,7 +31,7 @@ final class CustomCssFile { if (!is_file($path)) { throw new InvalidArgumentException( - '$path does not exist' + '$path does not exist', ); } diff --git a/vendor/phpunit/php-code-coverage/src/Report/Html/Facade.php b/vendor/phpunit/php-code-coverage/src/Report/Html/Facade.php index 8a4f3203..b376eb5d 100644 --- a/vendor/phpunit/php-code-coverage/src/Report/Html/Facade.php +++ b/vendor/phpunit/php-code-coverage/src/Report/Html/Facade.php @@ -15,9 +15,11 @@ use function date; use function dirname; use function str_ends_with; use SebastianBergmann\CodeCoverage\CodeCoverage; +use SebastianBergmann\CodeCoverage\FileCouldNotBeWrittenException; use SebastianBergmann\CodeCoverage\Node\Directory as DirectoryNode; use SebastianBergmann\CodeCoverage\Report\Thresholds; use SebastianBergmann\CodeCoverage\Util\Filesystem; +use SebastianBergmann\Template\Exception; use SebastianBergmann\Template\Template; final class Facade @@ -48,7 +50,7 @@ final class Facade $this->generator, $date, $this->thresholds, - $coverage->collectsBranchAndPathCoverage() + $coverage->collectsBranchAndPathCoverage(), ); $directory = new Directory( @@ -56,7 +58,7 @@ final class Facade $this->generator, $date, $this->thresholds, - $coverage->collectsBranchAndPathCoverage() + $coverage->collectsBranchAndPathCoverage(), ); $file = new File( @@ -64,7 +66,7 @@ final class Facade $this->generator, $date, $this->thresholds, - $coverage->collectsBranchAndPathCoverage() + $coverage->collectsBranchAndPathCoverage(), ); $directory->render($report, $target . 'index.html'); @@ -124,10 +126,18 @@ final class Facade 'success-high' => $this->colors->successHigh(), 'warning' => $this->colors->warning(), 'danger' => $this->colors->danger(), - ] + ], ); - $template->renderTo($this->directory($target . '_css') . 'style.css'); + try { + $template->renderTo($this->directory($target . '_css') . 'style.css'); + } catch (Exception $e) { + throw new FileCouldNotBeWrittenException( + $e->getMessage(), + $e->getCode(), + $e, + ); + } } private function directory(string $directory): string diff --git a/vendor/phpunit/php-code-coverage/src/Report/Html/Renderer.php b/vendor/phpunit/php-code-coverage/src/Report/Html/Renderer.php index cfc403e8..6ce7b8fe 100644 --- a/vendor/phpunit/php-code-coverage/src/Report/Html/Renderer.php +++ b/vendor/phpunit/php-code-coverage/src/Report/Html/Renderer.php @@ -55,7 +55,7 @@ abstract class Renderer $data['numClasses']; $classesBar = $this->coverageBar( - $data['testedClassesPercent'] + $data['testedClassesPercent'], ); } else { $classesLevel = ''; @@ -71,7 +71,7 @@ abstract class Renderer $data['numMethods']; $methodsBar = $this->coverageBar( - $data['testedMethodsPercent'] + $data['testedMethodsPercent'], ); } else { $methodsLevel = ''; @@ -87,7 +87,7 @@ abstract class Renderer $data['numExecutableLines']; $linesBar = $this->coverageBar( - $data['linesExecutedPercent'] + $data['linesExecutedPercent'], ); } else { $linesLevel = ''; @@ -103,7 +103,7 @@ abstract class Renderer $data['numExecutablePaths']; $pathsBar = $this->coverageBar( - $data['pathsExecutedPercent'] + $data['pathsExecutedPercent'], ); } else { $pathsLevel = ''; @@ -119,7 +119,7 @@ abstract class Renderer $data['numExecutableBranches']; $branchesBar = $this->coverageBar( - $data['branchesExecutedPercent'] + $data['branchesExecutedPercent'], ); } else { $branchesLevel = ''; @@ -153,7 +153,7 @@ abstract class Renderer 'classes_tested_percent' => $data['testedClassesPercentAsString'] ?? '', 'classes_level' => $classesLevel, 'classes_number' => $classesNumber, - ] + ], ); return $template->render(); @@ -173,7 +173,7 @@ abstract class Renderer 'generator' => $this->generator, 'low_upper_bound' => $this->thresholds->lowUpperBound(), 'high_lower_bound' => $this->thresholds->highLowerBound(), - ] + ], ); } @@ -196,7 +196,7 @@ abstract class Renderer if ($step !== $node) { $breadcrumbs .= $this->inactiveBreadcrumb( $step, - array_pop($pathToRoot) + array_pop($pathToRoot), ); } else { $breadcrumbs .= $this->activeBreadcrumb($step); @@ -210,7 +210,7 @@ abstract class Renderer { $buffer = sprintf( ' ' . "\n", - $node->name() + $node->name(), ); if ($node instanceof DirectoryNode) { @@ -225,7 +225,7 @@ abstract class Renderer return sprintf( ' ' . "\n", $pathToRoot, - $node->name() + $node->name(), ); } @@ -250,7 +250,7 @@ abstract class Renderer $template = new Template( $templateName, '{{', - '}}' + '}}', ); $template->setVar(['level' => $level, 'percent' => sprintf('%.2F', $percent)]); @@ -280,7 +280,7 @@ abstract class Renderer '%s %s', $runtime->getVendorUrl(), $runtime->getName(), - $runtime->getVersion() + $runtime->getVersion(), ); } } diff --git a/vendor/phpunit/php-code-coverage/src/Report/Html/Renderer/Dashboard.php b/vendor/phpunit/php-code-coverage/src/Report/Html/Renderer/Dashboard.php index ab2b221c..cf21cf9d 100644 --- a/vendor/phpunit/php-code-coverage/src/Report/Html/Renderer/Dashboard.php +++ b/vendor/phpunit/php-code-coverage/src/Report/Html/Renderer/Dashboard.php @@ -18,8 +18,10 @@ use function floor; use function json_encode; use function sprintf; use function str_replace; +use SebastianBergmann\CodeCoverage\FileCouldNotBeWrittenException; use SebastianBergmann\CodeCoverage\Node\AbstractNode; use SebastianBergmann\CodeCoverage\Node\Directory as DirectoryNode; +use SebastianBergmann\Template\Exception; use SebastianBergmann\Template\Template; /** @@ -34,7 +36,7 @@ final class Dashboard extends Renderer $template = new Template( $templateName, '{{', - '}}' + '}}', ); $this->setCommonTemplateVariables($template, $node); @@ -55,10 +57,18 @@ final class Dashboard extends Renderer 'complexity_method' => $complexity['method'], 'class_coverage_distribution' => $coverageDistribution['class'], 'method_coverage_distribution' => $coverageDistribution['method'], - ] + ], ); - $template->renderTo($file); + try { + $template->renderTo($file); + } catch (Exception $e) { + throw new FileCouldNotBeWrittenException( + $e->getMessage(), + $e->getCode(), + $e, + ); + } } protected function activeBreadcrumb(AbstractNode $node): string @@ -66,7 +76,7 @@ final class Dashboard extends Renderer return sprintf( ' ' . "\n" . ' ' . "\n", - $node->name() + $node->name(), ); } @@ -89,7 +99,7 @@ final class Dashboard extends Renderer sprintf( '%s', str_replace($baseLink, '', $method['link']), - $methodName + $methodName, ), ]; } @@ -100,7 +110,7 @@ final class Dashboard extends Renderer sprintf( '%s', str_replace($baseLink, '', $class['link']), - $className + $className, ), ]; } @@ -212,7 +222,7 @@ final class Dashboard extends Renderer ' %s%d%%' . "\n", str_replace($baseLink, '', $classes[$className]['link']), $className, - $coverage + $coverage, ); } @@ -224,7 +234,7 @@ final class Dashboard extends Renderer str_replace($baseLink, '', $classes[$class]['methods'][$method]['link']), $methodName, $method, - $coverage + $coverage, ); } @@ -267,7 +277,7 @@ final class Dashboard extends Renderer ' %s%d' . "\n", str_replace($baseLink, '', $classes[$className]['link']), $className, - $crap + $crap, ); } @@ -279,7 +289,7 @@ final class Dashboard extends Renderer str_replace($baseLink, '', $classes[$class]['methods'][$method]['link']), $methodName, $method, - $crap + $crap, ); } diff --git a/vendor/phpunit/php-code-coverage/src/Report/Html/Renderer/Directory.php b/vendor/phpunit/php-code-coverage/src/Report/Html/Renderer/Directory.php index faacbc31..1d7334b3 100644 --- a/vendor/phpunit/php-code-coverage/src/Report/Html/Renderer/Directory.php +++ b/vendor/phpunit/php-code-coverage/src/Report/Html/Renderer/Directory.php @@ -12,8 +12,10 @@ namespace SebastianBergmann\CodeCoverage\Report\Html; use function count; use function sprintf; use function str_repeat; +use SebastianBergmann\CodeCoverage\FileCouldNotBeWrittenException; use SebastianBergmann\CodeCoverage\Node\AbstractNode as Node; use SebastianBergmann\CodeCoverage\Node\Directory as DirectoryNode; +use SebastianBergmann\Template\Exception; use SebastianBergmann\Template\Template; /** @@ -42,10 +44,18 @@ final class Directory extends Renderer [ 'id' => $node->id(), 'items' => $items, - ] + ], ); - $template->renderTo($file); + try { + $template->renderTo($file); + } catch (Exception $e) { + throw new FileCouldNotBeWrittenException( + $e->getMessage(), + $e->getCode(), + $e, + ); + } } private function renderItem(Node $node, bool $total = false): string @@ -83,7 +93,7 @@ final class Directory extends Renderer $data['name'] = sprintf( '%s', $node->name(), - $node->name() + $node->name(), ); $data['icon'] = sprintf('', $up); } elseif ($this->hasBranchCoverage) { @@ -92,13 +102,13 @@ final class Directory extends Renderer $node->name(), $node->name(), $node->name(), - $node->name() + $node->name(), ); } else { $data['name'] = sprintf( '%s', $node->name(), - $node->name() + $node->name(), ); } } @@ -107,7 +117,7 @@ final class Directory extends Renderer return $this->renderItemTemplate( new Template($templateName, '{{', '}}'), - $data + $data, ); } } diff --git a/vendor/phpunit/php-code-coverage/src/Report/Html/Renderer/File.php b/vendor/phpunit/php-code-coverage/src/Report/Html/Renderer/File.php index 5f6532fd..005c1db3 100644 --- a/vendor/phpunit/php-code-coverage/src/Report/Html/Renderer/File.php +++ b/vendor/phpunit/php-code-coverage/src/Report/Html/Renderer/File.php @@ -84,9 +84,7 @@ use function array_keys; use function array_merge; use function array_pop; use function array_unique; -use function constant; use function count; -use function defined; use function explode; use function file_get_contents; use function htmlspecialchars; @@ -99,8 +97,10 @@ use function str_ends_with; use function str_replace; use function token_get_all; use function trim; +use SebastianBergmann\CodeCoverage\FileCouldNotBeWrittenException; use SebastianBergmann\CodeCoverage\Node\File as FileNode; use SebastianBergmann\CodeCoverage\Util\Percentage; +use SebastianBergmann\Template\Exception; use SebastianBergmann\Template\Template; /** @@ -111,7 +111,76 @@ final class File extends Renderer /** * @psalm-var array */ - private static array $keywordTokens = []; + private const KEYWORD_TOKENS = [ + T_ABSTRACT => true, + T_ARRAY => true, + T_AS => true, + T_BREAK => true, + T_CALLABLE => true, + T_CASE => true, + T_CATCH => true, + T_CLASS => true, + T_CLONE => true, + T_CONST => true, + T_CONTINUE => true, + T_DECLARE => true, + T_DEFAULT => true, + T_DO => true, + T_ECHO => true, + T_ELSE => true, + T_ELSEIF => true, + T_EMPTY => true, + T_ENDDECLARE => true, + T_ENDFOR => true, + T_ENDFOREACH => true, + T_ENDIF => true, + T_ENDSWITCH => true, + T_ENDWHILE => true, + T_ENUM => true, + T_EVAL => true, + T_EXIT => true, + T_EXTENDS => true, + T_FINAL => true, + T_FINALLY => true, + T_FN => true, + T_FOR => true, + T_FOREACH => true, + T_FUNCTION => true, + T_GLOBAL => true, + T_GOTO => true, + T_HALT_COMPILER => true, + T_IF => true, + T_IMPLEMENTS => true, + T_INCLUDE => true, + T_INCLUDE_ONCE => true, + T_INSTANCEOF => true, + T_INSTEADOF => true, + T_INTERFACE => true, + T_ISSET => true, + T_LIST => true, + T_MATCH => true, + T_NAMESPACE => true, + T_NEW => true, + T_PRINT => true, + T_PRIVATE => true, + T_PROTECTED => true, + T_PUBLIC => true, + T_READONLY => true, + T_REQUIRE => true, + T_REQUIRE_ONCE => true, + T_RETURN => true, + T_STATIC => true, + T_SWITCH => true, + T_THROW => true, + T_TRAIT => true, + T_TRY => true, + T_UNSET => true, + T_USE => true, + T_VAR => true, + T_WHILE => true, + T_YIELD => true, + T_YIELD_FROM => true, + ]; private static array $formattedSourceCache = []; private int $htmlSpecialCharsFlags = ENT_COMPAT | ENT_HTML401 | ENT_SUBSTITUTE; @@ -127,10 +196,18 @@ final class File extends Renderer 'lines' => $this->renderSourceWithLineCoverage($node), 'legend' => '

Covered by small (and larger) testsCovered by medium (and large) testsCovered by large tests (and tests of unknown size)Not coveredNot coverable

', 'structure' => '', - ] + ], ); - $template->renderTo($file . '.html'); + try { + $template->renderTo($file . '.html'); + } catch (Exception $e) { + throw new FileCouldNotBeWrittenException( + $e->getMessage(), + $e->getCode(), + $e, + ); + } if ($this->hasBranchCoverage) { $template->setVar( @@ -139,10 +216,18 @@ final class File extends Renderer 'lines' => $this->renderSourceWithBranchCoverage($node), 'legend' => '

Fully coveredPartially coveredNot covered

', 'structure' => $this->renderBranchStructure($node), - ] + ], ); - $template->renderTo($file . '_branch.html'); + try { + $template->renderTo($file . '_branch.html'); + } catch (Exception $e) { + throw new FileCouldNotBeWrittenException( + $e->getMessage(), + $e->getCode(), + $e, + ); + } $template->setVar( [ @@ -150,10 +235,18 @@ final class File extends Renderer 'lines' => $this->renderSourceWithPathCoverage($node), 'legend' => '

Fully coveredPartially coveredNot covered

', 'structure' => $this->renderPathStructure($node), - ] + ], ); - $template->renderTo($file . '_path.html'); + try { + $template->renderTo($file . '_path.html'); + } catch (Exception $e) { + throw new FileCouldNotBeWrittenException( + $e->getMessage(), + $e->getCode(), + $e, + ); + } } } @@ -166,7 +259,7 @@ final class File extends Renderer $methodItemTemplate = new Template( $methodTemplateName, '{{', - '}}' + '}}', ); $items = $this->renderItemTemplate( @@ -194,24 +287,24 @@ final class File extends Renderer 'testedClassesPercent' => $node->percentageOfTestedClassesAndTraits()->asFloat(), 'testedClassesPercentAsString' => $node->percentageOfTestedClassesAndTraits()->asString(), 'crap' => 'CRAP', - ] + ], ); $items .= $this->renderFunctionItems( $node->functions(), - $methodItemTemplate + $methodItemTemplate, ); $items .= $this->renderTraitOrClassItems( $node->traits(), $template, - $methodItemTemplate + $methodItemTemplate, ); $items .= $this->renderTraitOrClassItems( $node->classes(), $template, - $methodItemTemplate + $methodItemTemplate, ); return $items; @@ -244,15 +337,15 @@ final class File extends Renderer $numTestedClasses = $numTestedMethods === $numMethods ? 1 : 0; $linesExecutedPercentAsString = Percentage::fromFractionAndTotal( $item['executedLines'], - $item['executableLines'] + $item['executableLines'], )->asString(); $branchesExecutedPercentAsString = Percentage::fromFractionAndTotal( $item['executedBranches'], - $item['executableBranches'] + $item['executableBranches'], )->asString(); $pathsExecutedPercentAsString = Percentage::fromFractionAndTotal( $item['executedPaths'], - $item['executablePaths'] + $item['executablePaths'], )->asString(); } else { $numClasses = 0; @@ -264,12 +357,12 @@ final class File extends Renderer $testedMethodsPercentage = Percentage::fromFractionAndTotal( $numTestedMethods, - $numMethods + $numMethods, ); $testedClassesPercentage = Percentage::fromFractionAndTotal( $numTestedMethods === $numMethods ? 1 : 0, - 1 + 1, ); $buffer .= $this->renderItemTemplate( @@ -296,7 +389,7 @@ final class File extends Renderer 'numExecutableBranches' => $item['executableBranches'], 'pathsExecutedPercent' => Percentage::fromFractionAndTotal( $item['executedPaths'], - $item['executablePaths'] + $item['executablePaths'], )->asFloat(), 'pathsExecutedPercentAsString' => $pathsExecutedPercentAsString, 'numExecutedPaths' => $item['executedPaths'], @@ -306,14 +399,14 @@ final class File extends Renderer 'testedClassesPercent' => $testedClassesPercentage->asFloat(), 'testedClassesPercentAsString' => $testedClassesPercentage->asString(), 'crap' => $item['crap'], - ] + ], ); foreach ($item['methods'] as $method) { $buffer .= $this->renderFunctionOrMethodItem( $methodItemTemplate, $method, - ' ' + ' ', ); } } @@ -332,7 +425,7 @@ final class File extends Renderer foreach ($functions as $function) { $buffer .= $this->renderFunctionOrMethodItem( $template, - $function + $function, ); } @@ -354,22 +447,22 @@ final class File extends Renderer $executedLinesPercentage = Percentage::fromFractionAndTotal( $item['executedLines'], - $item['executableLines'] + $item['executableLines'], ); $executedBranchesPercentage = Percentage::fromFractionAndTotal( $item['executedBranches'], - $item['executableBranches'] + $item['executableBranches'], ); $executedPathsPercentage = Percentage::fromFractionAndTotal( $item['executedPaths'], - $item['executablePaths'] + $item['executablePaths'], ); $testedMethodsPercentage = Percentage::fromFractionAndTotal( $numTestedMethods, - 1 + 1, ); return $this->renderItemTemplate( @@ -380,7 +473,7 @@ final class File extends Renderer $indent, $item['startLine'], htmlspecialchars($item['signature'], $this->htmlSpecialCharsFlags), - $item['functionName'] ?? $item['methodName'] + $item['functionName'] ?? $item['methodName'], ), 'numMethods' => $numMethods, 'numTestedMethods' => $numTestedMethods, @@ -399,7 +492,7 @@ final class File extends Renderer 'testedMethodsPercent' => $testedMethodsPercentage->asFloat(), 'testedMethodsPercentAsString' => $testedMethodsPercentage->asString(), 'crap' => $item['crap'], - ] + ], ); } @@ -457,7 +550,7 @@ final class File extends Renderer $popover = sprintf( ' data-title="%s" data-content="%s" data-placement="top" data-html="true"', $popoverTitle, - htmlspecialchars($popoverContent, $this->htmlSpecialCharsFlags) + htmlspecialchars($popoverContent, $this->htmlSpecialCharsFlags), ); } @@ -544,7 +637,7 @@ final class File extends Renderer $popover = sprintf( ' data-title="%s" data-content="%s" data-placement="top" data-html="true"', $popoverTitle, - htmlspecialchars($popoverContent, $this->htmlSpecialCharsFlags) + htmlspecialchars($popoverContent, $this->htmlSpecialCharsFlags), ); } @@ -634,7 +727,7 @@ final class File extends Renderer $popover = sprintf( ' data-title="%s" data-content="%s" data-placement="top" data-html="true"', $popoverTitle, - htmlspecialchars($popoverContent, $this->htmlSpecialCharsFlags) + htmlspecialchars($popoverContent, $this->htmlSpecialCharsFlags), ); } @@ -732,7 +825,7 @@ final class File extends Renderer $popover = sprintf( ' data-title="%s" data-content="%s" data-placement="top" data-html="true"', $popoverTitle, - htmlspecialchars($popoverContent, $this->htmlSpecialCharsFlags) + htmlspecialchars($popoverContent, $this->htmlSpecialCharsFlags), ); } @@ -847,7 +940,7 @@ final class File extends Renderer $popover = sprintf( ' data-title="%s" data-content="%s" data-placement="top" data-html="true"', $popoverTitle, - htmlspecialchars($popoverContent, $this->htmlSpecialCharsFlags) + htmlspecialchars($popoverContent, $this->htmlSpecialCharsFlags), ); } @@ -872,7 +965,7 @@ final class File extends Renderer 'lineContent' => $lineContent, 'class' => $class, 'popover' => $popover, - ] + ], ); return $template->render(); @@ -898,14 +991,14 @@ final class File extends Renderer if ($token === '"' && $tokens[$j - 1] !== '\\') { $result[$i] .= sprintf( '%s', - htmlspecialchars($token, $this->htmlSpecialCharsFlags) + htmlspecialchars($token, $this->htmlSpecialCharsFlags), ); $stringFlag = !$stringFlag; } else { $result[$i] .= sprintf( '%s', - htmlspecialchars($token, $this->htmlSpecialCharsFlags) + htmlspecialchars($token, $this->htmlSpecialCharsFlags), ); } @@ -917,7 +1010,7 @@ final class File extends Renderer $value = str_replace( ["\t", ' '], ['    ', ' '], - htmlspecialchars($value, $this->htmlSpecialCharsFlags) + htmlspecialchars($value, $this->htmlSpecialCharsFlags), ); if ($value === "\n") { @@ -946,7 +1039,7 @@ final class File extends Renderer $result[$i] .= sprintf( '%s', $colour, - $line + $line, ); } @@ -974,7 +1067,7 @@ final class File extends Renderer $className = sprintf( '%s', $className, - array_pop($tmp) + array_pop($tmp), ); } @@ -1016,7 +1109,7 @@ final class File extends Renderer return sprintf( '%s', $testCSS, - htmlspecialchars($test, $this->htmlSpecialCharsFlags) + htmlspecialchars($test, $this->htmlSpecialCharsFlags), ); } @@ -1032,101 +1125,6 @@ final class File extends Renderer private function isKeyword(int $token): bool { - return isset(self::keywordTokens()[$token]); - } - - /** - * @psalm-return array - */ - private static function keywordTokens(): array - { - if (self::$keywordTokens !== []) { - return self::$keywordTokens; - } - - self::$keywordTokens = [ - T_ABSTRACT => true, - T_ARRAY => true, - T_AS => true, - T_BREAK => true, - T_CALLABLE => true, - T_CASE => true, - T_CATCH => true, - T_CLASS => true, - T_CLONE => true, - T_CONST => true, - T_CONTINUE => true, - T_DECLARE => true, - T_DEFAULT => true, - T_DO => true, - T_ECHO => true, - T_ELSE => true, - T_ELSEIF => true, - T_EMPTY => true, - T_ENDDECLARE => true, - T_ENDFOR => true, - T_ENDFOREACH => true, - T_ENDIF => true, - T_ENDSWITCH => true, - T_ENDWHILE => true, - T_EVAL => true, - T_EXIT => true, - T_EXTENDS => true, - T_FINAL => true, - T_FINALLY => true, - T_FOR => true, - T_FOREACH => true, - T_FUNCTION => true, - T_GLOBAL => true, - T_GOTO => true, - T_HALT_COMPILER => true, - T_IF => true, - T_IMPLEMENTS => true, - T_INCLUDE => true, - T_INCLUDE_ONCE => true, - T_INSTANCEOF => true, - T_INSTEADOF => true, - T_INTERFACE => true, - T_ISSET => true, - T_LIST => true, - T_NAMESPACE => true, - T_NEW => true, - T_PRINT => true, - T_PRIVATE => true, - T_PROTECTED => true, - T_PUBLIC => true, - T_REQUIRE => true, - T_REQUIRE_ONCE => true, - T_RETURN => true, - T_STATIC => true, - T_SWITCH => true, - T_THROW => true, - T_TRAIT => true, - T_TRY => true, - T_UNSET => true, - T_USE => true, - T_VAR => true, - T_WHILE => true, - T_YIELD => true, - T_YIELD_FROM => true, - ]; - - if (defined('T_FN')) { - self::$keywordTokens[constant('T_FN')] = true; - } - - if (defined('T_MATCH')) { - self::$keywordTokens[constant('T_MATCH')] = true; - } - - if (defined('T_ENUM')) { - self::$keywordTokens[constant('T_ENUM')] = true; - } - - if (defined('T_READONLY')) { - self::$keywordTokens[constant('T_READONLY')] = true; - } - - return self::$keywordTokens; + return isset(self::KEYWORD_TOKENS[$token]); } } diff --git a/vendor/phpunit/php-code-coverage/src/Report/Html/Renderer/Template/css/style.css b/vendor/phpunit/php-code-coverage/src/Report/Html/Renderer/Template/css/style.css index 2e3ece54..04ebcd89 100644 --- a/vendor/phpunit/php-code-coverage/src/Report/Html/Renderer/Template/css/style.css +++ b/vendor/phpunit/php-code-coverage/src/Report/Html/Renderer/Template/css/style.css @@ -120,7 +120,7 @@ svg text { .scrollbox { height:245px; - overflow-x:hidden; + overflow-x:scroll; overflow-y:scroll; } diff --git a/vendor/phpunit/php-code-coverage/src/Report/PHP.php b/vendor/phpunit/php-code-coverage/src/Report/PHP.php index ccb104ce..6f46f990 100644 --- a/vendor/phpunit/php-code-coverage/src/Report/PHP.php +++ b/vendor/phpunit/php-code-coverage/src/Report/PHP.php @@ -12,6 +12,7 @@ namespace SebastianBergmann\CodeCoverage\Report; use function dirname; use function file_put_contents; use function serialize; +use function str_contains; use SebastianBergmann\CodeCoverage\CodeCoverage; use SebastianBergmann\CodeCoverage\Driver\WriteOperationFailedException; use SebastianBergmann\CodeCoverage\Util\Filesystem; @@ -20,11 +21,15 @@ final class PHP { public function process(CodeCoverage $coverage, ?string $target = null): string { + $coverage->clearCache(); + $buffer = "coverageColor( $report->numberOfTestedClassesAndTraits(), - $report->numberOfClassesAndTraits() + $report->numberOfClassesAndTraits(), ); $colors['methods'] = $this->coverageColor( $report->numberOfTestedMethods(), - $report->numberOfMethods() + $report->numberOfMethods(), ); $colors['lines'] = $this->coverageColor( $report->numberOfExecutedLines(), - $report->numberOfExecutableLines() + $report->numberOfExecutableLines(), ); $colors['branches'] = $this->coverageColor( $report->numberOfExecutedBranches(), - $report->numberOfExecutableBranches() + $report->numberOfExecutableBranches(), ); $colors['paths'] = $this->coverageColor( $report->numberOfExecutedPaths(), - $report->numberOfExecutablePaths() + $report->numberOfExecutablePaths(), ); $colors['reset'] = self::COLOR_RESET; @@ -109,10 +109,10 @@ final class Text ' Classes: %6s (%d/%d)', Percentage::fromFractionAndTotal( $report->numberOfTestedClassesAndTraits(), - $report->numberOfClassesAndTraits() + $report->numberOfClassesAndTraits(), )->asString(), $report->numberOfTestedClassesAndTraits(), - $report->numberOfClassesAndTraits() + $report->numberOfClassesAndTraits(), ); $methods = sprintf( @@ -122,7 +122,7 @@ final class Text $report->numberOfMethods(), )->asString(), $report->numberOfTestedMethods(), - $report->numberOfMethods() + $report->numberOfMethods(), ); $paths = ''; @@ -136,7 +136,7 @@ final class Text $report->numberOfExecutablePaths(), )->asString(), $report->numberOfExecutedPaths(), - $report->numberOfExecutablePaths() + $report->numberOfExecutablePaths(), ); $branches = sprintf( @@ -146,7 +146,7 @@ final class Text $report->numberOfExecutableBranches(), )->asString(), $report->numberOfExecutedBranches(), - $report->numberOfExecutableBranches() + $report->numberOfExecutableBranches(), ); } @@ -157,7 +157,7 @@ final class Text $report->numberOfExecutableLines(), )->asString(), $report->numberOfExecutedLines(), - $report->numberOfExecutableLines() + $report->numberOfExecutableLines(), ); $padding = max(array_map('strlen', [$classes, $methods, $lines])); @@ -215,12 +215,12 @@ final class Text } $classMethods++; - $classExecutableLines += $method['executableLines']; - $classExecutedLines += $method['executedLines']; + $classExecutableLines += $method['executableLines']; + $classExecutedLines += $method['executedLines']; $classExecutableBranches += $method['executableBranches']; - $classExecutedBranches += $method['executedBranches']; - $classExecutablePaths += $method['executablePaths']; - $classExecutedPaths += $method['executedPaths']; + $classExecutedBranches += $method['executedBranches']; + $classExecutablePaths += $method['executablePaths']; + $classExecutedPaths += $method['executedPaths']; if ($method['coverage'] == 100) { $coveredMethods++; @@ -278,7 +278,7 @@ final class Text { $coverage = Percentage::fromFractionAndTotal( $numberOfCoveredElements, - $totalNumberOfElements + $totalNumberOfElements, ); if ($coverage->asFloat() >= $this->thresholds->highLowerBound()) { @@ -298,16 +298,18 @@ final class Text return Percentage::fromFractionAndTotal( $numberOfCoveredElements, - $totalNumberOfElements + $totalNumberOfElements, )->asFixedWidthString() . ' (' . sprintf($format, $numberOfCoveredElements) . '/' . sprintf($format, $totalNumberOfElements) . ')'; } - private function format(string $color, int $padding, string|false $string): string + private function format(string $color, int $padding, false|string $string): string { - $reset = $color ? self::COLOR_RESET : ''; + if ($color === '') { + return (string) $string . PHP_EOL; + } - return $color . str_pad((string) $string, $padding) . $reset . PHP_EOL; + return $color . str_pad((string) $string, $padding) . self::COLOR_RESET . PHP_EOL; } } diff --git a/vendor/phpunit/php-code-coverage/src/Report/Thresholds.php b/vendor/phpunit/php-code-coverage/src/Report/Thresholds.php index a1fa6e9f..af6c6ce5 100644 --- a/vendor/phpunit/php-code-coverage/src/Report/Thresholds.php +++ b/vendor/phpunit/php-code-coverage/src/Report/Thresholds.php @@ -31,7 +31,7 @@ final class Thresholds { if ($lowUpperBound > $highLowerBound) { throw new InvalidArgumentException( - '$lowUpperBound must not be larger than $highLowerBound' + '$lowUpperBound must not be larger than $highLowerBound', ); } diff --git a/vendor/phpunit/php-code-coverage/src/Report/Xml/BuildInformation.php b/vendor/phpunit/php-code-coverage/src/Report/Xml/BuildInformation.php index fac06ff4..264bf713 100644 --- a/vendor/phpunit/php-code-coverage/src/Report/Xml/BuildInformation.php +++ b/vendor/phpunit/php-code-coverage/src/Report/Xml/BuildInformation.php @@ -62,15 +62,15 @@ final class BuildInformation { $node = $this->contextNode->getElementsByTagNameNS( 'https://schema.phpunit.de/coverage/1.0', - $name + $name, )->item(0); if (!$node) { $node = $this->contextNode->appendChild( $this->contextNode->ownerDocument->createElementNS( 'https://schema.phpunit.de/coverage/1.0', - $name - ) + $name, + ), ); } diff --git a/vendor/phpunit/php-code-coverage/src/Report/Xml/Coverage.php b/vendor/phpunit/php-code-coverage/src/Report/Xml/Coverage.php index 9c853ec2..bb41dfb5 100644 --- a/vendor/phpunit/php-code-coverage/src/Report/Xml/Coverage.php +++ b/vendor/phpunit/php-code-coverage/src/Report/Xml/Coverage.php @@ -55,7 +55,7 @@ final class Coverage $this->contextNode->parentNode->replaceChild( $fragment, - $this->contextNode + $this->contextNode, ); $this->finalized = true; diff --git a/vendor/phpunit/php-code-coverage/src/Report/Xml/Facade.php b/vendor/phpunit/php-code-coverage/src/Report/Xml/Facade.php index 8788200c..3264718c 100644 --- a/vendor/phpunit/php-code-coverage/src/Report/Xml/Facade.php +++ b/vendor/phpunit/php-code-coverage/src/Report/Xml/Facade.php @@ -64,7 +64,7 @@ final class Facade $report = $coverage->getReport(); $this->project = new Project( - $coverage->getReport()->name() + $coverage->getReport()->name(), ); $this->setBuildInformation(); @@ -132,14 +132,14 @@ final class Facade { $fileObject = $context->addFile( $file->name(), - $file->id() . '.xml' + $file->id() . '.xml', ); $this->setTotals($file, $fileObject->totals()); $path = substr( $file->pathAsString(), - strlen($this->project->projectSourceDirectory()) + strlen($this->project->projectSourceDirectory()), ); $fileReport = new Report($path); @@ -169,7 +169,7 @@ final class Facade } $fileReport->source()->setSourceCode( - file_get_contents($file->pathAsString()) + file_get_contents($file->pathAsString()), ); $this->saveDocument($fileReport->asDom(), $file->id()); @@ -186,7 +186,7 @@ final class Facade $unitObject->setLines( $unit['startLine'], $unit['executableLines'], - $unit['executedLines'] + $unit['executedLines'], ); $unitObject->setCrap((float) $unit['crap']); @@ -200,7 +200,7 @@ final class Facade $methodObject->setTotals( (string) $method['executableLines'], (string) $method['executedLines'], - (string) $method['coverage'] + (string) $method['coverage'], ); } } @@ -233,27 +233,27 @@ final class Facade $loc['commentLinesOfCode'], $loc['nonCommentLinesOfCode'], $node->numberOfExecutableLines(), - $node->numberOfExecutedLines() + $node->numberOfExecutedLines(), ); $totals->setNumClasses( $node->numberOfClasses(), - $node->numberOfTestedClasses() + $node->numberOfTestedClasses(), ); $totals->setNumTraits( $node->numberOfTraits(), - $node->numberOfTestedTraits() + $node->numberOfTestedTraits(), ); $totals->setNumMethods( $node->numberOfMethods(), - $node->numberOfTestedMethods() + $node->numberOfTestedMethods(), ); $totals->setNumFunctions( $node->numberOfFunctions(), - $node->numberOfTestedFunctions() + $node->numberOfTestedFunctions(), ); } diff --git a/vendor/phpunit/php-code-coverage/src/Report/Xml/File.php b/vendor/phpunit/php-code-coverage/src/Report/Xml/File.php index a1da30a7..69b27510 100644 --- a/vendor/phpunit/php-code-coverage/src/Report/Xml/File.php +++ b/vendor/phpunit/php-code-coverage/src/Report/Xml/File.php @@ -34,8 +34,8 @@ class File $totalsContainer = $this->contextNode->appendChild( $this->dom->createElementNS( 'https://schema.phpunit.de/coverage/1.0', - 'totals' - ) + 'totals', + ), ); } @@ -46,23 +46,23 @@ class File { $coverage = $this->contextNode->getElementsByTagNameNS( 'https://schema.phpunit.de/coverage/1.0', - 'coverage' + 'coverage', )->item(0); if (!$coverage) { $coverage = $this->contextNode->appendChild( $this->dom->createElementNS( 'https://schema.phpunit.de/coverage/1.0', - 'coverage' - ) + 'coverage', + ), ); } $lineNode = $coverage->appendChild( $this->dom->createElementNS( 'https://schema.phpunit.de/coverage/1.0', - 'line' - ) + 'line', + ), ); return new Coverage($lineNode, $line); diff --git a/vendor/phpunit/php-code-coverage/src/Report/Xml/Node.php b/vendor/phpunit/php-code-coverage/src/Report/Xml/Node.php index bd14c8d6..b2ba54b2 100644 --- a/vendor/phpunit/php-code-coverage/src/Report/Xml/Node.php +++ b/vendor/phpunit/php-code-coverage/src/Report/Xml/Node.php @@ -38,8 +38,8 @@ abstract class Node $totalsContainer = $this->contextNode()->appendChild( $this->dom->createElementNS( 'https://schema.phpunit.de/coverage/1.0', - 'totals' - ) + 'totals', + ), ); } @@ -50,7 +50,7 @@ abstract class Node { $dirNode = $this->dom()->createElementNS( 'https://schema.phpunit.de/coverage/1.0', - 'directory' + 'directory', ); $dirNode->setAttribute('name', $name); @@ -63,7 +63,7 @@ abstract class Node { $fileNode = $this->dom()->createElementNS( 'https://schema.phpunit.de/coverage/1.0', - 'file' + 'file', ); $fileNode->setAttribute('name', $name); diff --git a/vendor/phpunit/php-code-coverage/src/Report/Xml/Project.php b/vendor/phpunit/php-code-coverage/src/Report/Xml/Project.php index b566bce0..b450beb4 100644 --- a/vendor/phpunit/php-code-coverage/src/Report/Xml/Project.php +++ b/vendor/phpunit/php-code-coverage/src/Report/Xml/Project.php @@ -31,15 +31,15 @@ final class Project extends Node { $buildNode = $this->dom()->getElementsByTagNameNS( 'https://schema.phpunit.de/coverage/1.0', - 'build' + 'build', )->item(0); if (!$buildNode) { $buildNode = $this->dom()->documentElement->appendChild( $this->dom()->createElementNS( 'https://schema.phpunit.de/coverage/1.0', - 'build' - ) + 'build', + ), ); } @@ -50,15 +50,15 @@ final class Project extends Node { $testsNode = $this->contextNode()->getElementsByTagNameNS( 'https://schema.phpunit.de/coverage/1.0', - 'tests' + 'tests', )->item(0); if (!$testsNode) { $testsNode = $this->contextNode()->appendChild( $this->dom()->createElementNS( 'https://schema.phpunit.de/coverage/1.0', - 'tests' - ) + 'tests', + ), ); } @@ -78,8 +78,8 @@ final class Project extends Node $this->setContextNode( $dom->getElementsByTagNameNS( 'https://schema.phpunit.de/coverage/1.0', - 'project' - )->item(0) + 'project', + )->item(0), ); } diff --git a/vendor/phpunit/php-code-coverage/src/Report/Xml/Report.php b/vendor/phpunit/php-code-coverage/src/Report/Xml/Report.php index 7f2badae..09d10341 100644 --- a/vendor/phpunit/php-code-coverage/src/Report/Xml/Report.php +++ b/vendor/phpunit/php-code-coverage/src/Report/Xml/Report.php @@ -25,7 +25,7 @@ final class Report extends File $contextNode = $dom->getElementsByTagNameNS( 'https://schema.phpunit.de/coverage/1.0', - 'file' + 'file', )->item(0); parent::__construct($contextNode); @@ -43,8 +43,8 @@ final class Report extends File $node = $this->contextNode()->appendChild( $this->dom()->createElementNS( 'https://schema.phpunit.de/coverage/1.0', - 'function' - ) + 'function', + ), ); return new Method($node, $name); @@ -64,15 +64,15 @@ final class Report extends File { $source = $this->contextNode()->getElementsByTagNameNS( 'https://schema.phpunit.de/coverage/1.0', - 'source' + 'source', )->item(0); if (!$source) { $source = $this->contextNode()->appendChild( $this->dom()->createElementNS( 'https://schema.phpunit.de/coverage/1.0', - 'source' - ) + 'source', + ), ); } @@ -90,8 +90,8 @@ final class Report extends File $node = $this->contextNode()->appendChild( $this->dom()->createElementNS( 'https://schema.phpunit.de/coverage/1.0', - $tagName - ) + $tagName, + ), ); return new Unit($node, $name); diff --git a/vendor/phpunit/php-code-coverage/src/Report/Xml/Source.php b/vendor/phpunit/php-code-coverage/src/Report/Xml/Source.php index f6171f8e..cd1fb90c 100644 --- a/vendor/phpunit/php-code-coverage/src/Report/Xml/Source.php +++ b/vendor/phpunit/php-code-coverage/src/Report/Xml/Source.php @@ -35,7 +35,7 @@ final class Source $context->parentNode->replaceChild( $context->ownerDocument->importNode($srcDom->documentElement, true), - $context + $context, ); } } diff --git a/vendor/phpunit/php-code-coverage/src/Report/Xml/Tests.php b/vendor/phpunit/php-code-coverage/src/Report/Xml/Tests.php index b4061049..44d6010b 100644 --- a/vendor/phpunit/php-code-coverage/src/Report/Xml/Tests.php +++ b/vendor/phpunit/php-code-coverage/src/Report/Xml/Tests.php @@ -13,6 +13,8 @@ use DOMElement; /** * @internal This class is not covered by the backward compatibility promise for phpunit/php-code-coverage + * + * @psalm-import-type TestType from \SebastianBergmann\CodeCoverage\CodeCoverage */ final class Tests { @@ -23,13 +25,16 @@ final class Tests $this->contextNode = $context; } + /** + * @param TestType $result + */ public function addTest(string $test, array $result): void { $node = $this->contextNode->appendChild( $this->contextNode->ownerDocument->createElementNS( 'https://schema.phpunit.de/coverage/1.0', - 'test' - ) + 'test', + ), ); $node->setAttribute('name', $test); diff --git a/vendor/phpunit/php-code-coverage/src/Report/Xml/Totals.php b/vendor/phpunit/php-code-coverage/src/Report/Xml/Totals.php index d4f8f795..239f6d43 100644 --- a/vendor/phpunit/php-code-coverage/src/Report/Xml/Totals.php +++ b/vendor/phpunit/php-code-coverage/src/Report/Xml/Totals.php @@ -33,27 +33,27 @@ final class Totals $this->linesNode = $dom->createElementNS( 'https://schema.phpunit.de/coverage/1.0', - 'lines' + 'lines', ); $this->methodsNode = $dom->createElementNS( 'https://schema.phpunit.de/coverage/1.0', - 'methods' + 'methods', ); $this->functionsNode = $dom->createElementNS( 'https://schema.phpunit.de/coverage/1.0', - 'functions' + 'functions', ); $this->classesNode = $dom->createElementNS( 'https://schema.phpunit.de/coverage/1.0', - 'classes' + 'classes', ); $this->traitsNode = $dom->createElementNS( 'https://schema.phpunit.de/coverage/1.0', - 'traits' + 'traits', ); $container->appendChild($this->linesNode); @@ -77,7 +77,7 @@ final class Totals $this->linesNode->setAttribute('executed', (string) $executed); $this->linesNode->setAttribute( 'percent', - $executable === 0 ? '0' : sprintf('%01.2F', Percentage::fromFractionAndTotal($executed, $executable)->asFloat()) + $executable === 0 ? '0' : sprintf('%01.2F', Percentage::fromFractionAndTotal($executed, $executable)->asFloat()), ); } @@ -87,7 +87,7 @@ final class Totals $this->classesNode->setAttribute('tested', (string) $tested); $this->classesNode->setAttribute( 'percent', - $count === 0 ? '0' : sprintf('%01.2F', Percentage::fromFractionAndTotal($tested, $count)->asFloat()) + $count === 0 ? '0' : sprintf('%01.2F', Percentage::fromFractionAndTotal($tested, $count)->asFloat()), ); } @@ -97,7 +97,7 @@ final class Totals $this->traitsNode->setAttribute('tested', (string) $tested); $this->traitsNode->setAttribute( 'percent', - $count === 0 ? '0' : sprintf('%01.2F', Percentage::fromFractionAndTotal($tested, $count)->asFloat()) + $count === 0 ? '0' : sprintf('%01.2F', Percentage::fromFractionAndTotal($tested, $count)->asFloat()), ); } @@ -107,7 +107,7 @@ final class Totals $this->methodsNode->setAttribute('tested', (string) $tested); $this->methodsNode->setAttribute( 'percent', - $count === 0 ? '0' : sprintf('%01.2F', Percentage::fromFractionAndTotal($tested, $count)->asFloat()) + $count === 0 ? '0' : sprintf('%01.2F', Percentage::fromFractionAndTotal($tested, $count)->asFloat()), ); } @@ -117,7 +117,7 @@ final class Totals $this->functionsNode->setAttribute('tested', (string) $tested); $this->functionsNode->setAttribute( 'percent', - $count === 0 ? '0' : sprintf('%01.2F', Percentage::fromFractionAndTotal($tested, $count)->asFloat()) + $count === 0 ? '0' : sprintf('%01.2F', Percentage::fromFractionAndTotal($tested, $count)->asFloat()), ); } } diff --git a/vendor/phpunit/php-code-coverage/src/Report/Xml/Unit.php b/vendor/phpunit/php-code-coverage/src/Report/Xml/Unit.php index 2a4feb99..ea1a47f2 100644 --- a/vendor/phpunit/php-code-coverage/src/Report/Xml/Unit.php +++ b/vendor/phpunit/php-code-coverage/src/Report/Xml/Unit.php @@ -41,15 +41,15 @@ final class Unit { $node = $this->contextNode->getElementsByTagNameNS( 'https://schema.phpunit.de/coverage/1.0', - 'namespace' + 'namespace', )->item(0); if (!$node) { $node = $this->contextNode->appendChild( $this->contextNode->ownerDocument->createElementNS( 'https://schema.phpunit.de/coverage/1.0', - 'namespace' - ) + 'namespace', + ), ); } @@ -61,8 +61,8 @@ final class Unit $node = $this->contextNode->appendChild( $this->contextNode->ownerDocument->createElementNS( 'https://schema.phpunit.de/coverage/1.0', - 'method' - ) + 'method', + ), ); return new Method($node, $name); diff --git a/vendor/phpunit/php-code-coverage/src/StaticAnalysis/CacheWarmer.php b/vendor/phpunit/php-code-coverage/src/StaticAnalysis/CacheWarmer.php index 00a6d8df..47cc756c 100644 --- a/vendor/phpunit/php-code-coverage/src/StaticAnalysis/CacheWarmer.php +++ b/vendor/phpunit/php-code-coverage/src/StaticAnalysis/CacheWarmer.php @@ -19,8 +19,10 @@ final class CacheWarmer $cacheDirectory, new ParsingFileAnalyser( $useAnnotationsForIgnoringCode, - $ignoreDeprecatedCode - ) + $ignoreDeprecatedCode, + ), + $useAnnotationsForIgnoringCode, + $ignoreDeprecatedCode, ); foreach ($filter->files() as $file) { diff --git a/vendor/phpunit/php-code-coverage/src/StaticAnalysis/CachingFileAnalyser.php b/vendor/phpunit/php-code-coverage/src/StaticAnalysis/CachingFileAnalyser.php index 511a9fa4..2ce4d604 100644 --- a/vendor/phpunit/php-code-coverage/src/StaticAnalysis/CachingFileAnalyser.php +++ b/vendor/phpunit/php-code-coverage/src/StaticAnalysis/CachingFileAnalyser.php @@ -21,20 +21,26 @@ use SebastianBergmann\FileIterator\Facade as FileIteratorFacade; /** * @internal This class is not covered by the backward compatibility promise for phpunit/php-code-coverage + * + * @psalm-import-type LinesOfCodeType from \SebastianBergmann\CodeCoverage\StaticAnalysis\FileAnalyser */ final class CachingFileAnalyser implements FileAnalyser { private static ?string $cacheVersion = null; - private readonly FileAnalyser $analyser; - private array $cache = []; private readonly string $directory; + private readonly FileAnalyser $analyser; + private readonly bool $useAnnotationsForIgnoringCode; + private readonly bool $ignoreDeprecatedCode; + private array $cache = []; - public function __construct(string $directory, FileAnalyser $analyser) + public function __construct(string $directory, FileAnalyser $analyser, bool $useAnnotationsForIgnoringCode, bool $ignoreDeprecatedCode) { Filesystem::createDirectory($directory); - $this->analyser = $analyser; - $this->directory = $directory; + $this->analyser = $analyser; + $this->directory = $directory; + $this->useAnnotationsForIgnoringCode = $useAnnotationsForIgnoringCode; + $this->ignoreDeprecatedCode = $ignoreDeprecatedCode; } public function classesIn(string $filename): array @@ -65,7 +71,7 @@ final class CachingFileAnalyser implements FileAnalyser } /** - * @psalm-return array{linesOfCode: int, commentLinesOfCode: int, nonCommentLinesOfCode: int} + * @psalm-return LinesOfCodeType */ public function linesOfCodeFor(string $filename): array { @@ -126,7 +132,7 @@ final class CachingFileAnalyser implements FileAnalyser return unserialize( file_get_contents($cacheFile), - ['allowed_classes' => false] + ['allowed_classes' => false], ); } @@ -134,13 +140,26 @@ final class CachingFileAnalyser implements FileAnalyser { file_put_contents( $this->cacheFile($filename), - serialize($data) + serialize($data), ); } private function cacheFile(string $filename): string { - return $this->directory . DIRECTORY_SEPARATOR . md5($filename . "\0" . file_get_contents($filename) . "\0" . self::cacheVersion()); + $cacheKey = md5( + implode( + "\0", + [ + $filename, + file_get_contents($filename), + self::cacheVersion(), + $this->useAnnotationsForIgnoringCode, + $this->ignoreDeprecatedCode, + ], + ), + ); + + return $this->directory . DIRECTORY_SEPARATOR . $cacheKey; } private static function cacheVersion(): string diff --git a/vendor/phpunit/php-code-coverage/src/StaticAnalysis/CodeUnitFindingVisitor.php b/vendor/phpunit/php-code-coverage/src/StaticAnalysis/CodeUnitFindingVisitor.php index 019b70b5..5530221d 100644 --- a/vendor/phpunit/php-code-coverage/src/StaticAnalysis/CodeUnitFindingVisitor.php +++ b/vendor/phpunit/php-code-coverage/src/StaticAnalysis/CodeUnitFindingVisitor.php @@ -32,21 +32,55 @@ use SebastianBergmann\Complexity\CyclomaticComplexityCalculatingVisitor; /** * @internal This class is not covered by the backward compatibility promise for phpunit/php-code-coverage + * + * @psalm-type CodeUnitFunctionType = array{ + * name: string, + * namespacedName: string, + * namespace: string, + * signature: string, + * startLine: int, + * endLine: int, + * ccn: int + * } + * @psalm-type CodeUnitMethodType = array{ + * methodName: string, + * signature: string, + * visibility: string, + * startLine: int, + * endLine: int, + * ccn: int + * } + * @psalm-type CodeUnitClassType = array{ + * name: string, + * namespacedName: string, + * namespace: string, + * startLine: int, + * endLine: int, + * methods: array + * } + * @psalm-type CodeUnitTraitType = array{ + * name: string, + * namespacedName: string, + * namespace: string, + * startLine: int, + * endLine: int, + * methods: array + * } */ final class CodeUnitFindingVisitor extends NodeVisitorAbstract { /** - * @psalm-var array}> + * @psalm-var array */ private array $classes = []; /** - * @psalm-var array}> + * @psalm-var array */ private array $traits = []; /** - * @psalm-var array + * @psalm-var array */ private array $functions = []; @@ -84,7 +118,7 @@ final class CodeUnitFindingVisitor extends NodeVisitorAbstract } /** - * @psalm-return array}> + * @psalm-return array */ public function classes(): array { @@ -92,7 +126,7 @@ final class CodeUnitFindingVisitor extends NodeVisitorAbstract } /** - * @psalm-return array}> + * @psalm-return array */ public function traits(): array { @@ -100,7 +134,7 @@ final class CodeUnitFindingVisitor extends NodeVisitorAbstract } /** - * @psalm-return array + * @psalm-return array */ public function functions(): array { @@ -159,7 +193,7 @@ final class CodeUnitFindingVisitor extends NodeVisitorAbstract return $signature; } - private function type(Identifier|Name|ComplexType $type): string + private function type(ComplexType|Identifier|Name $type): string { if ($type instanceof NullableType) { return '?' . $type->type; diff --git a/vendor/phpunit/php-code-coverage/src/StaticAnalysis/ExecutableLinesFindingVisitor.php b/vendor/phpunit/php-code-coverage/src/StaticAnalysis/ExecutableLinesFindingVisitor.php index 2dbddd8d..a15894da 100644 --- a/vendor/phpunit/php-code-coverage/src/StaticAnalysis/ExecutableLinesFindingVisitor.php +++ b/vendor/phpunit/php-code-coverage/src/StaticAnalysis/ExecutableLinesFindingVisitor.php @@ -26,6 +26,8 @@ use PhpParser\NodeVisitorAbstract; /** * @internal This class is not covered by the backward compatibility promise for phpunit/php-code-coverage + * + * @psalm-import-type LinesType from \SebastianBergmann\CodeCoverage\StaticAnalysis\FileAnalyser */ final class ExecutableLinesFindingVisitor extends NodeVisitorAbstract { @@ -33,7 +35,7 @@ final class ExecutableLinesFindingVisitor extends NodeVisitorAbstract private readonly string $source; /** - * @psalm-var array + * @psalm-var LinesType */ private array $executableLinesGroupedByBranch = []; @@ -94,6 +96,7 @@ final class ExecutableLinesFindingVisitor extends NodeVisitorAbstract $node instanceof Node\Stmt\Else_ || $node instanceof Node\Stmt\EnumCase || $node instanceof Node\Stmt\Finally_ || + $node instanceof Node\Stmt\GroupUse || $node instanceof Node\Stmt\Label || $node instanceof Node\Stmt\Namespace_ || $node instanceof Node\Stmt\Nop || @@ -102,8 +105,8 @@ final class ExecutableLinesFindingVisitor extends NodeVisitorAbstract $node instanceof Node\Stmt\Use_ || $node instanceof Node\Stmt\UseUse || $node instanceof Node\Expr\ConstFetch || - $node instanceof Node\Expr\Match_ || $node instanceof Node\Expr\Variable || + $node instanceof Node\Expr\Throw_ || $node instanceof Node\ComplexType || $node instanceof Node\Const_ || $node instanceof Node\Identifier || @@ -113,18 +116,59 @@ final class ExecutableLinesFindingVisitor extends NodeVisitorAbstract return; } + if ($node instanceof Node\Expr\Match_) { + foreach ($node->arms as $arm) { + $this->setLineBranch( + $arm->body->getStartLine(), + $arm->body->getEndLine(), + ++$this->nextBranch, + ); + } + + return; + } + + /* + * nikic/php-parser ^4.18 represents throw statements + * as Stmt\Throw_ objects + */ if ($node instanceof Node\Stmt\Throw_) { $this->setLineBranch($node->expr->getEndLine(), $node->expr->getEndLine(), ++$this->nextBranch); return; } + /* + * nikic/php-parser ^5 represents throw statements + * as Stmt\Expression objects that contain an + * Expr\Throw_ object + */ + if ($node instanceof Node\Stmt\Expression && $node->expr instanceof Node\Expr\Throw_) { + $this->setLineBranch($node->expr->expr->getEndLine(), $node->expr->expr->getEndLine(), ++$this->nextBranch); + + return; + } + if ($node instanceof Node\Stmt\Enum_ || $node instanceof Node\Stmt\Function_ || $node instanceof Node\Stmt\Class_ || $node instanceof Node\Stmt\ClassMethod || $node instanceof Node\Expr\Closure || $node instanceof Node\Stmt\Trait_) { + if ($node instanceof Node\Stmt\Function_ || $node instanceof Node\Stmt\ClassMethod) { + $unsets = []; + + foreach ($node->getParams() as $param) { + foreach (range($param->getStartLine(), $param->getEndLine()) as $line) { + $unsets[$line] = true; + } + } + + unset($unsets[$node->getEndLine()]); + + $this->unsets += $unsets; + } + $isConcreteClassLike = $node instanceof Node\Stmt\Enum_ || $node instanceof Node\Stmt\Class_ || $node instanceof Node\Stmt\Trait_; if (null !== $node->stmts) { @@ -158,7 +202,7 @@ final class ExecutableLinesFindingVisitor extends NodeVisitorAbstract ); if ($hasEmptyBody) { - if ($node->getEndLine() === $node->getStartLine()) { + if ($node->getEndLine() === $node->getStartLine() && isset($this->executableLinesGroupedByBranch[$node->getStartLine()])) { return; } @@ -173,7 +217,7 @@ final class ExecutableLinesFindingVisitor extends NodeVisitorAbstract if ($node instanceof Node\Expr\ArrowFunction) { $startLine = max( $node->getStartLine() + 1, - $node->expr->getStartLine() + $node->expr->getStartLine(), ); $endLine = $node->expr->getEndLine(); @@ -218,7 +262,7 @@ final class ExecutableLinesFindingVisitor extends NodeVisitorAbstract $this->setLineBranch( $node->cond->getStartLine(), $node->cond->getStartLine(), - ++$this->nextBranch + ++$this->nextBranch, ); return; @@ -269,7 +313,7 @@ final class ExecutableLinesFindingVisitor extends NodeVisitorAbstract $this->setLineBranch( $startLine, $endLine, - ++$this->nextBranch + ++$this->nextBranch, ); return; @@ -279,7 +323,7 @@ final class ExecutableLinesFindingVisitor extends NodeVisitorAbstract $this->setLineBranch( $node->expr->getStartLine(), $node->valueVar->getEndLine(), - ++$this->nextBranch + ++$this->nextBranch, ); return; @@ -290,7 +334,7 @@ final class ExecutableLinesFindingVisitor extends NodeVisitorAbstract $this->setLineBranch( $node->cond->getStartLine(), $node->cond->getEndLine(), - ++$this->nextBranch + ++$this->nextBranch, ); return; @@ -305,7 +349,7 @@ final class ExecutableLinesFindingVisitor extends NodeVisitorAbstract $this->setLineBranch( $startLine, $endLine, - ++$this->nextBranch + ++$this->nextBranch, ); return; @@ -348,10 +392,13 @@ final class ExecutableLinesFindingVisitor extends NodeVisitorAbstract $this->executableLinesGroupedByBranch = array_diff_key( $this->executableLinesGroupedByBranch, - $this->unsets + $this->unsets, ); } + /** + * @psalm-return LinesType + */ public function executableLinesGroupedByBranch(): array { return $this->executableLinesGroupedByBranch; diff --git a/vendor/phpunit/php-code-coverage/src/StaticAnalysis/FileAnalyser.php b/vendor/phpunit/php-code-coverage/src/StaticAnalysis/FileAnalyser.php index 3dbcf68f..f260341b 100644 --- a/vendor/phpunit/php-code-coverage/src/StaticAnalysis/FileAnalyser.php +++ b/vendor/phpunit/php-code-coverage/src/StaticAnalysis/FileAnalyser.php @@ -11,21 +11,50 @@ namespace SebastianBergmann\CodeCoverage\StaticAnalysis; /** * @internal This class is not covered by the backward compatibility promise for phpunit/php-code-coverage + * + * @psalm-import-type CodeUnitFunctionType from \SebastianBergmann\CodeCoverage\StaticAnalysis\CodeUnitFindingVisitor + * @psalm-import-type CodeUnitMethodType from \SebastianBergmann\CodeCoverage\StaticAnalysis\CodeUnitFindingVisitor + * @psalm-import-type CodeUnitClassType from \SebastianBergmann\CodeCoverage\StaticAnalysis\CodeUnitFindingVisitor + * @psalm-import-type CodeUnitTraitType from \SebastianBergmann\CodeCoverage\StaticAnalysis\CodeUnitFindingVisitor + * @psalm-import-type LinesOfCodeType from \SebastianBergmann\CodeCoverage\StaticAnalysis\FileAnalyser + * @psalm-import-type LinesType from \SebastianBergmann\CodeCoverage\StaticAnalysis\FileAnalyser + * + * @psalm-type LinesOfCodeType = array{ + * linesOfCode: int, + * commentLinesOfCode: int, + * nonCommentLinesOfCode: int + * } + * @psalm-type LinesType = array */ interface FileAnalyser { + /** + * @psalm-return array + */ public function classesIn(string $filename): array; + /** + * @psalm-return array + */ public function traitsIn(string $filename): array; + /** + * @psalm-return array + */ public function functionsIn(string $filename): array; /** - * @psalm-return array{linesOfCode: int, commentLinesOfCode: int, nonCommentLinesOfCode: int} + * @psalm-return LinesOfCodeType */ public function linesOfCodeFor(string $filename): array; + /** + * @psalm-return LinesType + */ public function executableLinesIn(string $filename): array; + /** + * @psalm-return LinesType + */ public function ignoredLinesFor(string $filename): array; } diff --git a/vendor/phpunit/php-code-coverage/src/StaticAnalysis/IgnoredLinesFindingVisitor.php b/vendor/phpunit/php-code-coverage/src/StaticAnalysis/IgnoredLinesFindingVisitor.php index 7480e6fb..a3be120b 100644 --- a/vendor/phpunit/php-code-coverage/src/StaticAnalysis/IgnoredLinesFindingVisitor.php +++ b/vendor/phpunit/php-code-coverage/src/StaticAnalysis/IgnoredLinesFindingVisitor.php @@ -15,6 +15,7 @@ use PhpParser\Node; use PhpParser\Node\Attribute; use PhpParser\Node\Stmt\Class_; use PhpParser\Node\Stmt\ClassMethod; +use PhpParser\Node\Stmt\Enum_; use PhpParser\Node\Stmt\Function_; use PhpParser\Node\Stmt\Interface_; use PhpParser\Node\Stmt\Trait_; @@ -43,6 +44,7 @@ final class IgnoredLinesFindingVisitor extends NodeVisitorAbstract if (!$node instanceof Class_ && !$node instanceof Trait_ && !$node instanceof Interface_ && + !$node instanceof Enum_ && !$node instanceof ClassMethod && !$node instanceof Function_ && !$node instanceof Attribute) { diff --git a/vendor/phpunit/php-code-coverage/src/StaticAnalysis/ParsingFileAnalyser.php b/vendor/phpunit/php-code-coverage/src/StaticAnalysis/ParsingFileAnalyser.php index dec907b7..ae2619fa 100644 --- a/vendor/phpunit/php-code-coverage/src/StaticAnalysis/ParsingFileAnalyser.php +++ b/vendor/phpunit/php-code-coverage/src/StaticAnalysis/ParsingFileAnalyser.php @@ -22,7 +22,6 @@ use function substr_count; use function token_get_all; use function trim; use PhpParser\Error; -use PhpParser\Lexer; use PhpParser\NodeTraverser; use PhpParser\NodeVisitor\NameResolver; use PhpParser\NodeVisitor\ParentConnectingVisitor; @@ -32,18 +31,44 @@ use SebastianBergmann\LinesOfCode\LineCountingVisitor; /** * @internal This class is not covered by the backward compatibility promise for phpunit/php-code-coverage + * + * @psalm-import-type CodeUnitFunctionType from \SebastianBergmann\CodeCoverage\StaticAnalysis\CodeUnitFindingVisitor + * @psalm-import-type CodeUnitMethodType from \SebastianBergmann\CodeCoverage\StaticAnalysis\CodeUnitFindingVisitor + * @psalm-import-type CodeUnitClassType from \SebastianBergmann\CodeCoverage\StaticAnalysis\CodeUnitFindingVisitor + * @psalm-import-type CodeUnitTraitType from \SebastianBergmann\CodeCoverage\StaticAnalysis\CodeUnitFindingVisitor + * @psalm-import-type LinesOfCodeType from \SebastianBergmann\CodeCoverage\StaticAnalysis\FileAnalyser + * @psalm-import-type LinesType from \SebastianBergmann\CodeCoverage\StaticAnalysis\FileAnalyser */ final class ParsingFileAnalyser implements FileAnalyser { - private array $classes = []; - private array $traits = []; + /** + * @psalm-var array> + */ + private array $classes = []; + + /** + * @psalm-var array> + */ + private array $traits = []; + + /** + * @psalm-var array> + */ private array $functions = []; /** - * @var array + * @var array + */ + private array $linesOfCode = []; + + /** + * @var array + */ + private array $ignoredLines = []; + + /** + * @var array */ - private array $linesOfCode = []; - private array $ignoredLines = []; private array $executableLines = []; private readonly bool $useAnnotationsForIgnoringCode; private readonly bool $ignoreDeprecatedCode; @@ -75,9 +100,6 @@ final class ParsingFileAnalyser implements FileAnalyser return $this->functions[$filename]; } - /** - * @psalm-return array{linesOfCode: int, commentLinesOfCode: int, nonCommentLinesOfCode: int} - */ public function linesOfCodeFor(string $filename): array { $this->analyse($filename); @@ -115,10 +137,9 @@ final class ParsingFileAnalyser implements FileAnalyser $linesOfCode = 1; } - $parser = (new ParserFactory)->create( - ParserFactory::PREFER_PHP7, - new Lexer - ); + assert($linesOfCode > 0); + + $parser = (new ParserFactory)->createForHostVersion(); try { $nodes = $parser->parse($source); @@ -146,10 +167,10 @@ final class ParsingFileAnalyser implements FileAnalyser sprintf( 'Cannot parse %s: %s', $filename, - $error->getMessage() + $error->getMessage(), ), $error->getCode(), - $error + $error, ); } // @codeCoverageIgnoreEnd @@ -165,8 +186,8 @@ final class ParsingFileAnalyser implements FileAnalyser $this->ignoredLines[$filename] = array_unique( array_merge( $this->ignoredLines[$filename], - $ignoredLinesFindingVisitor->ignoredLines() - ) + $ignoredLinesFindingVisitor->ignoredLines(), + ), ); sort($this->ignoredLines[$filename]); @@ -218,7 +239,7 @@ final class ParsingFileAnalyser implements FileAnalyser $this->ignoredLines[$filename] = array_merge( $this->ignoredLines[$filename], - range($start, $token[2]) + range($start, $token[2]), ); } } diff --git a/vendor/phpunit/php-code-coverage/src/Util/Filesystem.php b/vendor/phpunit/php-code-coverage/src/Util/Filesystem.php index ff0e16ae..0e99b159 100644 --- a/vendor/phpunit/php-code-coverage/src/Util/Filesystem.php +++ b/vendor/phpunit/php-code-coverage/src/Util/Filesystem.php @@ -23,14 +23,14 @@ final class Filesystem */ public static function createDirectory(string $directory): void { - $success = !(!is_dir($directory) && !@mkdir($directory, 0777, true) && !is_dir($directory)); + $success = !(!is_dir($directory) && !@mkdir($directory, 0o777, true) && !is_dir($directory)); if (!$success) { throw new DirectoryCouldNotBeCreatedException( sprintf( 'Directory "%s" could not be created', - $directory - ) + $directory, + ), ); } } diff --git a/vendor/phpunit/php-code-coverage/src/Version.php b/vendor/phpunit/php-code-coverage/src/Version.php index b868a639..80b27f4d 100644 --- a/vendor/phpunit/php-code-coverage/src/Version.php +++ b/vendor/phpunit/php-code-coverage/src/Version.php @@ -19,7 +19,7 @@ final class Version public static function id(): string { if (self::$version === '') { - self::$version = (new VersionId('10.0.2', dirname(__DIR__)))->asString(); + self::$version = (new VersionId('10.1.16', dirname(__DIR__)))->asString(); } return self::$version; diff --git a/vendor/phpunit/php-file-iterator/ChangeLog.md b/vendor/phpunit/php-file-iterator/ChangeLog.md index 57efb528..e2ddc646 100644 --- a/vendor/phpunit/php-file-iterator/ChangeLog.md +++ b/vendor/phpunit/php-file-iterator/ChangeLog.md @@ -2,6 +2,18 @@ All notable changes to this project will be documented in this file. This project adheres to [Semantic Versioning](http://semver.org/). +## [4.1.0] - 2023-08-31 + +### Added + +* [#81](https://github.com/sebastianbergmann/php-file-iterator/issues/81): Accept `array|string $paths` in `Facade::getFilesAsArray()` + +## [4.0.2] - 2023-05-07 + +### Fixed + +* [#80](https://github.com/sebastianbergmann/php-file-iterator/pull/80): Ignore unresolvable symbolic link + ## [4.0.1] - 2023-02-10 ### Fixed @@ -138,6 +150,8 @@ No changes * [#23](https://github.com/sebastianbergmann/php-file-iterator/pull/23): Added support for wildcards (glob) in exclude +[4.1.0]: https://github.com/sebastianbergmann/php-file-iterator/compare/4.0.2...4.1.0 +[4.0.2]: https://github.com/sebastianbergmann/php-file-iterator/compare/4.0.1...4.0.2 [4.0.1]: https://github.com/sebastianbergmann/php-file-iterator/compare/4.0.0...4.0.1 [4.0.0]: https://github.com/sebastianbergmann/php-file-iterator/compare/3.0.6...4.0.0 [3.0.6]: https://github.com/sebastianbergmann/php-file-iterator/compare/3.0.5...3.0.6 diff --git a/vendor/phpunit/php-file-iterator/SECURITY.md b/vendor/phpunit/php-file-iterator/SECURITY.md index 778f018b..d88ff001 100644 --- a/vendor/phpunit/php-file-iterator/SECURITY.md +++ b/vendor/phpunit/php-file-iterator/SECURITY.md @@ -4,7 +4,7 @@ If you believe you have found a security vulnerability in the library that is de **Please do not report security vulnerabilities through public GitHub issues, discussions, or pull requests.** -Instead, please send an email to `sebastian@phpunit.de`. +Instead, please email `sebastian@phpunit.de`. Please include as much of the information listed below as you can to help us better understand and resolve the issue: @@ -22,9 +22,9 @@ This information will help us triage your report more quickly. The library that is developed in this repository was either extracted from [PHPUnit](https://github.com/sebastianbergmann/phpunit) or developed specifically as a dependency for PHPUnit. -The library is developed with a focus on development environments and the command-line. No specific testing or hardening with regard to using the library in a HTTP or web context or with untrusted input data is performed. The library might also contain functionality that intentionally exposes internal application data for debugging purposes. +The library is developed with a focus on development environments and the command-line. No specific testing or hardening with regard to using the library in an HTTP or web context or with untrusted input data is performed. The library might also contain functionality that intentionally exposes internal application data for debugging purposes. If the library is used in a web application, the application developer is responsible for filtering inputs or escaping outputs as necessary and for verifying that the used functionality is safe for use within the intended context. -Vulnerabilities specific to the use outside of a development context will be fixed as applicable, provided that the fix does not have an averse effect on the primary use case for development purposes. +Vulnerabilities specific to the use outside a development context will be fixed as applicable, provided that the fix does not have an averse effect on the primary use case for development purposes. diff --git a/vendor/phpunit/php-file-iterator/composer.json b/vendor/phpunit/php-file-iterator/composer.json index e2bef2ae..3f0089c2 100644 --- a/vendor/phpunit/php-file-iterator/composer.json +++ b/vendor/phpunit/php-file-iterator/composer.json @@ -16,7 +16,8 @@ } ], "support": { - "issues": "https://github.com/sebastianbergmann/php-file-iterator/issues" + "issues": "https://github.com/sebastianbergmann/php-file-iterator/issues", + "security": "https://github.com/sebastianbergmann/php-file-iterator/security/policy" }, "config": { "platform": { diff --git a/vendor/phpunit/php-file-iterator/src/ExcludeIterator.php b/vendor/phpunit/php-file-iterator/src/ExcludeIterator.php index eec0595b..a928b4ba 100644 --- a/vendor/phpunit/php-file-iterator/src/ExcludeIterator.php +++ b/vendor/phpunit/php-file-iterator/src/ExcludeIterator.php @@ -43,6 +43,10 @@ final class ExcludeIterator extends RecursiveFilterIterator $path = $current->getRealPath(); + if ($path === false) { + return false; + } + foreach ($this->exclude as $exclude) { if (str_starts_with($path, $exclude)) { return false; diff --git a/vendor/phpunit/php-file-iterator/src/Facade.php b/vendor/phpunit/php-file-iterator/src/Facade.php index b0f9fc0a..b782bf96 100644 --- a/vendor/phpunit/php-file-iterator/src/Facade.php +++ b/vendor/phpunit/php-file-iterator/src/Facade.php @@ -20,15 +20,16 @@ use SplFileInfo; final class Facade { /** - * @psalm-param list|string $suffixes - * @psalm-param list|string $prefixes - * @psalm-param list $exclude + * @psalm-param list|non-empty-string $paths + * @psalm-param list|string $suffixes + * @psalm-param list|string $prefixes + * @psalm-param list $exclude * - * @psalm-return list + * @psalm-return list */ - public function getFilesAsArray(string $path, array|string $suffixes = '', array|string $prefixes = '', array $exclude = []): array + public function getFilesAsArray(array|string $paths, array|string $suffixes = '', array|string $prefixes = '', array $exclude = []): array { - $iterator = (new Factory)->getFileIterator($path, $suffixes, $prefixes, $exclude); + $iterator = (new Factory)->getFileIterator($paths, $suffixes, $prefixes, $exclude); $files = []; diff --git a/vendor/phpunit/php-file-iterator/src/Factory.php b/vendor/phpunit/php-file-iterator/src/Factory.php index db4edefe..35f9ca08 100644 --- a/vendor/phpunit/php-file-iterator/src/Factory.php +++ b/vendor/phpunit/php-file-iterator/src/Factory.php @@ -29,10 +29,10 @@ use RecursiveIteratorIterator; final class Factory { /** - * @psalm-param list|string $paths - * @psalm-param list|string $suffixes - * @psalm-param list|string $prefixes - * @psalm-param list $exclude + * @psalm-param list|non-empty-string $paths + * @psalm-param list|string $suffixes + * @psalm-param list|string $prefixes + * @psalm-param list $exclude */ public function getFileIterator(array|string $paths, array|string $suffixes = '', array|string $prefixes = '', array $exclude = []): AppendIterator { @@ -83,9 +83,9 @@ final class Factory } /** - * @psalm-param list $paths + * @psalm-param list $paths * - * @psalm-return list + * @psalm-return list */ private function resolveWildcards(array $paths): array { diff --git a/vendor/phpunit/php-file-iterator/src/Iterator.php b/vendor/phpunit/php-file-iterator/src/Iterator.php index aaadb885..d071205a 100644 --- a/vendor/phpunit/php-file-iterator/src/Iterator.php +++ b/vendor/phpunit/php-file-iterator/src/Iterator.php @@ -27,7 +27,6 @@ use SplFileInfo; final class Iterator extends FilterIterator { public const PREFIX = 0; - public const SUFFIX = 1; private string|false $basePath; diff --git a/vendor/phpunit/php-text-template/ChangeLog.md b/vendor/phpunit/php-text-template/ChangeLog.md index d8aa72ba..012f02b2 100644 --- a/vendor/phpunit/php-text-template/ChangeLog.md +++ b/vendor/phpunit/php-text-template/ChangeLog.md @@ -2,6 +2,12 @@ All notable changes are documented in this file using the [Keep a CHANGELOG](http://keepachangelog.com/) principles. +## [3.0.1] - 2023-08-31 + +### Changed + +* Warnings from `file_put_contents()` are now suppressed + ## [3.0.0] - 2023-02-03 ### Removed @@ -42,6 +48,7 @@ All notable changes are documented in this file using the [Keep a CHANGELOG](htt * Removed support for PHP 5.3, PHP 5.4, PHP 5.5, PHP 5.6, PHP 7.0, PHP 7.1, and PHP 7.2 +[3.0.1]: https://github.com/sebastianbergmann/php-text-template/compare/3.0.0...3.0.1 [3.0.0]: https://github.com/sebastianbergmann/php-text-template/compare/2.0.4...3.0.0 [2.0.4]: https://github.com/sebastianbergmann/php-text-template/compare/2.0.3...2.0.4 [2.0.3]: https://github.com/sebastianbergmann/php-text-template/compare/2.0.2...2.0.3 diff --git a/vendor/phpunit/php-text-template/SECURITY.md b/vendor/phpunit/php-text-template/SECURITY.md index d4ee967b..d88ff001 100644 --- a/vendor/phpunit/php-text-template/SECURITY.md +++ b/vendor/phpunit/php-text-template/SECURITY.md @@ -1,9 +1,30 @@ # Security Policy -This library is intended to be used in development environments only. For instance, it is used by the testing framework PHPUnit. There is no reason why this library should be installed on a webserver. +If you believe you have found a security vulnerability in the library that is developed in this repository, please report it to us through coordinated disclosure. -**If you upload this library to a webserver then your deployment process is broken. On a more general note, if your `vendor` directory is publicly accessible on your webserver then your deployment process is also broken.** +**Please do not report security vulnerabilities through public GitHub issues, discussions, or pull requests.** -## Security Contact Information +Instead, please email `sebastian@phpunit.de`. + +Please include as much of the information listed below as you can to help us better understand and resolve the issue: + +* The type of issue +* Full paths of source file(s) related to the manifestation of the issue +* The location of the affected source code (tag/branch/commit or direct URL) +* Any special configuration required to reproduce the issue +* Step-by-step instructions to reproduce the issue +* Proof-of-concept or exploit code (if possible) +* Impact of the issue, including how an attacker might exploit the issue + +This information will help us triage your report more quickly. + +## Web Context + +The library that is developed in this repository was either extracted from [PHPUnit](https://github.com/sebastianbergmann/phpunit) or developed specifically as a dependency for PHPUnit. + +The library is developed with a focus on development environments and the command-line. No specific testing or hardening with regard to using the library in an HTTP or web context or with untrusted input data is performed. The library might also contain functionality that intentionally exposes internal application data for debugging purposes. + +If the library is used in a web application, the application developer is responsible for filtering inputs or escaping outputs as necessary and for verifying that the used functionality is safe for use within the intended context. + +Vulnerabilities specific to the use outside a development context will be fixed as applicable, provided that the fix does not have an averse effect on the primary use case for development purposes. -After the above, if you still would like to report a security vulnerability, please email `sebastian@phpunit.de`. diff --git a/vendor/phpunit/php-text-template/composer.json b/vendor/phpunit/php-text-template/composer.json index 8cb50c27..cd6cf754 100644 --- a/vendor/phpunit/php-text-template/composer.json +++ b/vendor/phpunit/php-text-template/composer.json @@ -15,7 +15,8 @@ } ], "support": { - "issues": "https://github.com/sebastianbergmann/php-text-template/issues" + "issues": "https://github.com/sebastianbergmann/php-text-template/issues", + "security": "https://github.com/sebastianbergmann/php-text-template/security/policy" }, "config": { "platform": { diff --git a/vendor/phpunit/php-text-template/src/Template.php b/vendor/phpunit/php-text-template/src/Template.php index 91bb2387..167e2385 100644 --- a/vendor/phpunit/php-text-template/src/Template.php +++ b/vendor/phpunit/php-text-template/src/Template.php @@ -96,7 +96,7 @@ final class Template */ public function renderTo(string $target): void { - if (!file_put_contents($target, $this->render())) { + if (!@file_put_contents($target, $this->render())) { throw new RuntimeException( sprintf( 'Writing rendered result to "%s" failed', diff --git a/vendor/phpunit/phpunit/.phpstorm.meta.php b/vendor/phpunit/phpunit/.phpstorm.meta.php deleted file mode 100644 index b69ff789..00000000 --- a/vendor/phpunit/phpunit/.phpstorm.meta.php +++ /dev/null @@ -1,33 +0,0 @@ -"$0"]) - ); - - override( - \PHPUnit\Framework\TestCase::createStub(0), - map([""=>"$0"]) - ); - - override( - \PHPUnit\Framework\TestCase::createConfiguredMock(0), - map([""=>"$0"]) - ); - - override( - \PHPUnit\Framework\TestCase::createPartialMock(0), - map([""=>"$0"]) - ); - - override( - \PHPUnit\Framework\TestCase::createTestProxy(0), - map([""=>"$0"]) - ); - - override( - \PHPUnit\Framework\TestCase::getMockForAbstractClass(0), - map([""=>"$0"]) - ); -} diff --git a/vendor/phpunit/phpunit/ChangeLog-10.0.md b/vendor/phpunit/phpunit/ChangeLog-10.0.md deleted file mode 100644 index ba508d8b..00000000 --- a/vendor/phpunit/phpunit/ChangeLog-10.0.md +++ /dev/null @@ -1,280 +0,0 @@ -# Changes in PHPUnit 10.0 - -All notable changes of the PHPUnit 10.0 release series are documented in this file using the [Keep a CHANGELOG](https://keepachangelog.com/) principles. - -## [10.0.16] - 2023-03-13 - -### Added - -* `PHPUnit\Event\Test\PrintedUnexpectedOutput` and `PHPUnit\Event\Test\PrintedUnexpectedOutputSubscriber` (required for the fixing [#5278](https://github.com/sebastianbergmann/phpunit/issues/5278)) - -### Changed - -* [#5276](https://github.com/sebastianbergmann/phpunit/issues/5276): Restore display of summary and warnings when `--teamcity` is used - -### Fixed - -* [#5278](https://github.com/sebastianbergmann/phpunit/issues/5278): Test Runner swallows output made during test -* [#5279](https://github.com/sebastianbergmann/phpunit/pull/5279): `StringContains` constraint does not correctly handle option for ignoring line endings - -## [10.0.15] - 2023-03-09 - -### Changed - -* Improved the HTML and CSS for the output of `--testdox-html` - -### Fixed - -* Fixed some inconsistencies in expectation failure messages -* Restored errors when multiple `@coversDefaultClass` and/or `@usesDefaultClass` annotations are used - -## [10.0.14] - 2023-03-01 - -### Changed - -* The `PHPUnit\Event\Test\AssertionSucceeded` and `PHPUnit\Event\Test\AssertionFailed` events are no longer emitted when they have no subscribers -* The `PHPUnit\Event\Test\AssertionSucceeded::value()` method is no longer deprecated and returns the exported value again - -## [10.0.13] - 2023-02-27 - -### Fixed - -* [#5186](https://github.com/sebastianbergmann/phpunit/issues/5186): SBOM does not validate -* [#5258](https://github.com/sebastianbergmann/phpunit/issues/5258): JUnit logger crashes when test is skipped by missing PHP extension when running in separate process - -## [10.0.12] - 2023-02-25 - -### Changed - -* Values of other types than `array` may now be passed to `assertIsList()` - -### Fixed - -* [#5234](https://github.com/sebastianbergmann/phpunit/issues/5234): Constants defined in configuration file are not defined in bootstrap file when test is run in separate process -* [#5251](https://github.com/sebastianbergmann/phpunit/pull/5251): JUnit XML logger does not properly handle errors on unprepared tests - -## [10.0.11] - 2023-02-20 - -### Fixed - -* [#5192](https://github.com/sebastianbergmann/phpunit/issues/5192): Running an empty test shows help screen -* [#5224](https://github.com/sebastianbergmann/phpunit/issues/5224): PHPUnit looks "at the clock" and trusts `$_SERVER['REQUEST_TIME_FLOAT']` - -## [10.0.10] - 2023-02-20 - -### Fixed - -* [#5218](https://github.com/sebastianbergmann/phpunit/issues/5218): Code Coverage does not work for tests run in separate process(es) -* [#5219](https://github.com/sebastianbergmann/phpunit/issues/5219): Exceptions thrown in event subscribers affect how tests are run and/or how their outcome is evaluated - -## [10.0.9] - 2023-02-19 - -### Fixed - -* Corrected the fix for [#5210](https://github.com/sebastianbergmann/phpunit/issues/5210) - -## [10.0.8] - 2023-02-18 - -### Fixed - -* [#5210](https://github.com/sebastianbergmann/phpunit/issues/5210): Exceptions raised in `TestCase::tearDown()` are not handled correctly - -## [10.0.7] - 2023-02-08 - -### Changed - -* The `PHPUnit\Event\Test\AssertionSucceeded::value()` method is now deprecated and always returns `''` (reverted in PHPUnit 10.0.14) - -### Fixed - -* [#5183](https://github.com/sebastianbergmann/phpunit/issues/5183): Values used in assertions are exported for `Test\AssertionSucceeded` events - -## [10.0.6] - 2023-02-08 - -### Fixed - -* [#5178](https://github.com/sebastianbergmann/phpunit/issues/5178): Test depending on a test with data provider is always skipped - -## [10.0.5] - 2023-02-07 - -### Fixed - -* [#5172](https://github.com/sebastianbergmann/phpunit/issues/5172): Test Runner does not display test runner warnings when TestDox result printer is used -* [#5176](https://github.com/sebastianbergmann/phpunit/issues/5176): Silenced `E_DEPRECATED` errors are reported - -## [10.0.4] - 2023-02-05 - -### Fixed - -* [#5169](https://github.com/sebastianbergmann/phpunit/issues/5169): Parameter type for constructor of `GreaterThan` and `LessThan` constraints does not match parameter type for `Assert::greaterThan()` and `Assert::lessThan()` -* [#5171](https://github.com/sebastianbergmann/phpunit/issues/5171): `@backupStaticProperties` and `@backupStaticAttributes` trigger an error - -## [10.0.3] - 2023-02-04 - -### Added - -* `PHPUnit\Event\TestSuite\Skipped` and `PHPUnit\Event\TestSuite\SkippedSubscriber` (required for the fixing [#5165](https://github.com/sebastianbergmann/phpunit/issues/5165)) - -### Fixed - -* [#5165](https://github.com/sebastianbergmann/phpunit/issues/5165): `markTestSkipped()` not handled correctly when called in "before first test" method -* [#5166](https://github.com/sebastianbergmann/phpunit/issues/5166): Error when generating TestDox output for risky test - -## [10.0.2] - 2023-02-04 - -### Changed - -* The `PHPUnit\TextUI\Configuration\Configuration::loadPharExtensions()` method has been deprecated in favour of `PHPUnit\TextUI\Configuration\Configuration::noExtensions()` - -### Fixed - -* [#5073](https://github.com/sebastianbergmann/phpunit/issues/5073): `--no-extensions` CLI option only prevents extension PHARs from being loaded -* `assertNotCount()`, `assertEmpty()`, `assertNotEmpty()`, `assertSameSize()`, and `assertNotSameSize()` now reject `Generator` arguments just as `assertCount()` does - -## [10.0.1] - 2023-02-03 - -### Fixed - -* [#5157](https://github.com/sebastianbergmann/phpunit/issues/5157): Test Runner tries to run hook methods for `TestSuite` objects that do not collect `TestCase` objects - -## [10.0.0] - 2023-02-03 - -### Added - -* [#4676](https://github.com/sebastianbergmann/phpunit/issues/4676): Event System for extending PHPUnit's test runner -* [#4502](https://github.com/sebastianbergmann/phpunit/issues/4502): Support PHP 8 attributes for adding metadata to test classes and test methods as well as tested code units -* [#4641](https://github.com/sebastianbergmann/phpunit/issues/4641): `assertStringEqualsStringIgnoringLineEndings()` and `assertStringContainsStringIgnoringLineEndings()` -* [#4650](https://github.com/sebastianbergmann/phpunit/issues/4650): Support dist file name `phpunit.dist.xml` -* [#4657](https://github.com/sebastianbergmann/phpunit/pull/4657): `--exclude-testsuite` option -* [#4818](https://github.com/sebastianbergmann/phpunit/pull/4818): `assertIsList()` -* [#4892](https://github.com/sebastianbergmann/phpunit/issues/4892): Make colors used in HTML code coverage report configurable -* [#4893](https://github.com/sebastianbergmann/phpunit/issues/4893): Make path to custom.css for HTML code coverage report configurable -* [#5097](https://github.com/sebastianbergmann/phpunit/issues/5097): Support for `enum` values in TestDox placeholder replacements -* `TestCase::createStubForIntersectionOfInterfaces()` and `TestCase::createMockForIntersectionOfInterfaces()` -* `#[ExcludeGlobalVariableFromBackup('variable')]` attribute for excluding a global variable from the backup/restore of global and super-global variables -* `#[ExcludeStaticPropertyFromBackup('className', 'propertyName')]` attribute for excluding a static property from the backup/restore of static properties in user-defined classes -* `--log-events-text ` option that controls streaming of event information (without event telemetry) in text format to a file -* `--log-events-verbose-text ` option that controls streaming of event information (with event telemetry) in text format to a file -* `--no-progress` option to disable test execution progress output -* `--no-results` option to disable test result output -* `--no-output` option to disable all output -* `--display-incomplete` option and `displayDetailsOnIncompleteTests` XML configuration attribute to control whether details on incomplete tests should be displayed -* `--display-skipped` option and `displayDetailsOnSkippedTests` XML configuration attribute to control whether details on skipped tests should be displayed -* `--display-deprecations` option and `displayDetailsOnTestsThatTriggerDeprecations` XML configuration attribute to control whether details on tests that trigger `E_DEPRECATED` or `E_USER_DEPRECATED` should be displayed -* `--display-errors` option and `displayDetailsOnTestsThatTriggerErrors` XML configuration attribute to control whether details on tests that trigger `E_ERROR` or `E_USER_ERROR` should be displayed -* `--display-notices` option and `displayDetailsOnTestsThatTriggerNotices` XML configuration attribute to control whether details on tests that trigger `E_STRING`, `E_NOTICE`, or `E_USER_NOTICE` should be displayed -* `--display-warnings` option and `displayDetailsOnTestsThatTriggerWarnings` XML configuration attribute to control whether details on tests that trigger `E_WARNING` or `E_USER_WARNING` should be displayed - -### Changed - -* [#3871](https://github.com/sebastianbergmann/phpunit/issues/3871): Declare return types for `InvocationStubber` methods -* [#3954](https://github.com/sebastianbergmann/phpunit/issues/3954): Disable global state preservation for process isolation by default -* [#4599](https://github.com/sebastianbergmann/phpunit/issues/4599): Unify cache configuration -* [#4603](https://github.com/sebastianbergmann/phpunit/issues/4603): Use "property" instead of "attribute" for configuring the backup of static fields -* [#4656](https://github.com/sebastianbergmann/phpunit/issues/4656): Prevent doubling of `__destruct()` -* Expectations configured on test stubs created using `PHPUnit\Framework\TestCase::createStub()` are no longer evaluated, you need to create a mock object using `PHPUnit\Framework\TestCase::createMock()` instead -* Using a non-static method as a data provider is now deprecated -* Using a non-public method as a data provider is now deprecated -* Declaring a data provider method to require an argument is now deprecated -* A test method now continues execution after test(ed) code triggered `E_(USER_)DEPRECATED`, `E_(USER_)NOTICE`, `E_STRICT`, or `E_(USER_)WARNING` -* PHPUnit no longer invokes a static method named `suite` on a class that is declared in a file that is passed as an argument to the CLI test runner -* PHPUnit no longer promotes variables that are global in the bootstrap script's scope to global variables in the test runner's scope (use `$GLOBALS['variable'] = 'value'` instead of `$variable = 'value'` in your bootstrap script) -* `PHPUnit\Framework\TestCase::$backupGlobals` can no longer be used to enable or disable the backup/restore of global and super-global variables for a test case class -* `PHPUnit\Framework\TestCase::$backupStaticAttributes` can no longer be used to enable or disable the backup/restore of static properties in user-defined classes for a test case class -* `@author` is no longer an alias for `@group` -* The JUnit XML logfile now has both `name` and `file` attributes on `` elements for PHPT tests -* The JUnit XML logfile no longer has `` elements that contain the output printed to `stdout` by a test -* The JUnit XML logfile now only reports test outcome (errored, failed, incomplete, skipped, or passed) and no longer test issues (considered risky, for instance) -* The `forceCoversAnnotation` attribute of the `` element of PHPUnit's XML configuration file has been renamed to `requireCoverageMetadata` -* The `beStrictAboutCoversAnnotation` attribute of the `` element of PHPUnit's XML configuration file has been renamed to `beStrictAboutCoverageMetadata` -* The public methods of `PHPUnit\Framework\Assert` and `PHPUnit\Framework\TestCase` are now `final` -* The `PHPUnit\Framework\TestCase::onNotSuccessfulTest()` method can no longer manipulate the outcome of a test -* The `--testdox` CLI option no longer replaces the default progress output, but only the default result output -* The CLI test runner now only stops after a test errored when `--stop-on-error` or `--stop-on-defect` is used -* The CLI test runner now only stops after a test failed when `--stop-on-failure` or `--stop-on-defect` is used -* The CLI test runner now only stops after a test triggered a warning when `--stop-on-warning` or `--stop-on-defect` is used -* The CLI test runner now only stops after a test was marked as risky when `--stop-on-risky` or `--stop-on-defect` is used -* The CLI test runner now only stops after a test was skipped when `--stop-on-skipped` is used -* The CLI test runner now only stops after a test was marked as incomplete when `--stop-on-incomplete` is used - -### Removed - -* [#3389](https://github.com/sebastianbergmann/phpunit/issues/3389): Remove `PHPUnit\Framework\TestListener` and `PHPUnit\Framework\TestListenerDefaultImplementation` -* [#3631](https://github.com/sebastianbergmann/phpunit/issues/3631): Remove support for `"ClassName<*>"` as values for `@covers` and `@uses` annotations -* [#3769](https://github.com/sebastianbergmann/phpunit/issues/3769): Remove `MockBuilder::setMethods()` and `MockBuilder::setMethodsExcept()` -* [#3777](https://github.com/sebastianbergmann/phpunit/issues/3777): Remove `PHPUnit\Framework\Error\*` classes -* [#4063](https://github.com/sebastianbergmann/phpunit/issues/4063): Remove `assertNotIsReadable()` -* [#4066](https://github.com/sebastianbergmann/phpunit/issues/4066): Remove `assertNotIsWritable()` -* [#4069](https://github.com/sebastianbergmann/phpunit/issues/4069): Remove `assertDirectoryNotExists()` -* [#4072](https://github.com/sebastianbergmann/phpunit/issues/4072): Remove `assertDirectoryNotIsReadable()` -* [#4075](https://github.com/sebastianbergmann/phpunit/issues/4075): Remove `assertDirectoryNotIsWritable()` -* [#4078](https://github.com/sebastianbergmann/phpunit/issues/4078): Remove `assertFileNotExists()` -* [#4081](https://github.com/sebastianbergmann/phpunit/issues/4081): Remove `assertFileNotIsReadable()` -* [#4087](https://github.com/sebastianbergmann/phpunit/issues/4087): Remove `assertRegExp()` -* [#4090](https://github.com/sebastianbergmann/phpunit/issues/4090): Remove `assertNotRegExp()` -* [#4092](https://github.com/sebastianbergmann/phpunit/issues/4092): Remove `assertEqualXMLStructure()` -* [#4142](https://github.com/sebastianbergmann/phpunit/issues/4142): Remove Prophecy integration -* [#4227](https://github.com/sebastianbergmann/phpunit/issues/4227): Remove `--dump-xdebug-filter` and `--prepend` -* [#4272](https://github.com/sebastianbergmann/phpunit/issues/4272): Remove `PHPUnit\Util\Blacklist` -* [#4273](https://github.com/sebastianbergmann/phpunit/issues/4273): Remove `PHPUnit\Framework\TestCase::$backupGlobalsBlacklist` -* [#4274](https://github.com/sebastianbergmann/phpunit/issues/4274): Remove `PHPUnit\Framework\TestCase::$backupStaticAttributesBlacklist` -* [#4278](https://github.com/sebastianbergmann/phpunit/issues/4278): Remove `--whitelist` option -* [#4279](https://github.com/sebastianbergmann/phpunit/issues/4279): Remove support for old code coverage configuration -* [#4286](https://github.com/sebastianbergmann/phpunit/issues/4286): Remove support for old logging configuration -* [#4298](https://github.com/sebastianbergmann/phpunit/issues/4298): Remove `at()` matcher -* [#4397](https://github.com/sebastianbergmann/phpunit/issues/4397): Remove confusing parameter options for XML assertions -* [#4531](https://github.com/sebastianbergmann/phpunit/pull/4531): Remove `--loader` option as well as `testSuiteLoaderClass` and `testSuiteLoaderFile` XML configuration settings -* [#4536](https://github.com/sebastianbergmann/phpunit/issues/4536): Remove `assertFileNotIsWritable()` -* [#4596](https://github.com/sebastianbergmann/phpunit/issues/4595): Remove Test Hooks -* [#4564](https://github.com/sebastianbergmann/phpunit/issues/4564): Remove `withConsecutive()` -* [#4567](https://github.com/sebastianbergmann/phpunit/issues/4567): Remove support for generators in `assertCount()` and `Count` constraint -* [#4601](https://github.com/sebastianbergmann/phpunit/issues/4601): Remove assertions that operate on class/object properties -* Removed the `expectDeprecation()`, `expectDeprecationMessage()`, and `expectDeprecationMessageMatches()` methods -* Removed the `expectError()`, `expectErrorMessage()`, and `expectErrorMessageMatches()` methods -* Removed the `expectNotice()`, `expectNoticeMessage()`, and `expectNoticeMessageMatches()` methods -* Removed the `expectWarning()`, `expectWarningMessage()`, and `expectWarningMessageMatches()` methods -* Removed the `PHPUnit\Runner\TestSuiteLoader` interface -* Removed the `` XML configuration element and its children -* Removed the `beStrictAboutResourceUsageDuringSmallTests` attribute on the `` XML configuration element and the `--disallow-resource-usage` option as well as the feature they used to control -* Removed the `beStrictAboutTodoAnnotatedTests` attribute on the `` XML configuration element and the `--disallow-todo-tests` option as well as the feature they used to control -* Removed the `convertDeprecationsToExceptions` attribute on the `` XML configuration element as well as the feature it used to control -* Removed the `convertErrorsToExceptions` attribute on the `` XML configuration element as well as the feature it used to control -* Removed the `convertNoticesToExceptions` attribute on the `` XML configuration element as well as the feature it used to control -* Removed the `convertWarningsToExceptions` attribute on the `` XML configuration element as well as the feature it used to control -* Removed the `noInteraction` attribute on the `` XML configuration element and `--no-interaction` option as well as the feature they used to control -* Removed the `processUncoveredFiles` attribute on the `` XML configuration element -* Removed the `testdoxGroups` XML configuration element, the `--testdox-group` option, and the `--testdox-exclude-group` option as well as the feature they used to control -* Removed the `PHPUnit\Framework\TestCase::getMockClass()` method -* Removed the `PHPUnit\Framework\TestCase::$backupGlobalsExcludeList` property, use the `#[ExcludeGlobalVariableFromBackup('variable')]` attribute instead for excluding a global variable from the backup/restore of global and super-global variables -* Removed the `PHPUnit\Framework\TestCase::$backupStaticAttributesExcludeList` property, use the `#[ExcludeStaticPropertyFromBackup('className', 'propertyName')]` attribute instead for excluding a static property from the backup/restore of static properties in user-defined classes -* Removed the `PHPUnit\Framework\TestCase::$preserveGlobalState` property, use the `@preserveGlobalState enabled` annotation or the `#[PreserveGlobalState(true)]` attribute instead for enabling the preservation of global state when running tests in isolation -* Removed the `--repeat` option -* Removed the `--debug` option -* Removed the `--extensions` option -* Removed the `--printer` option -* Removed the `printerClass` and `printerFile` attributes on the `` XML configuration element -* Removed the `--testdox-xml` option and the `` XML configuration element as well as the feature they used to control -* Removed the `--verbose` option -* Removed the `verbose` attribute on the `` XML configuration element -* Removed the `` XML configuration element (child of ``) -* The CLI test runner can no longer be extended through inheritance, the `PHPUnit\TextUI\Command` class has been removed -* PHP 7.3, PHP 7.4, and PHP 8.0 are no longer supported -* `phpunit/php-code-coverage` [no longer supports PHPDBG and Xdebug 2](https://github.com/sebastianbergmann/php-code-coverage/blob/10.0.0/ChangeLog.md#1000---2023-02-03) - -[10.0.16]: https://github.com/sebastianbergmann/phpunit/compare/10.0.15...10.0.16 -[10.0.15]: https://github.com/sebastianbergmann/phpunit/compare/10.0.14...10.0.15 -[10.0.14]: https://github.com/sebastianbergmann/phpunit/compare/10.0.13...10.0.14 -[10.0.13]: https://github.com/sebastianbergmann/phpunit/compare/10.0.12...10.0.13 -[10.0.12]: https://github.com/sebastianbergmann/phpunit/compare/10.0.11...10.0.12 -[10.0.11]: https://github.com/sebastianbergmann/phpunit/compare/10.0.10...10.0.11 -[10.0.10]: https://github.com/sebastianbergmann/phpunit/compare/10.0.9...10.0.10 -[10.0.9]: https://github.com/sebastianbergmann/phpunit/compare/10.0.8...10.0.9 -[10.0.8]: https://github.com/sebastianbergmann/phpunit/compare/10.0.7...10.0.8 -[10.0.7]: https://github.com/sebastianbergmann/phpunit/compare/10.0.6...10.0.7 -[10.0.6]: https://github.com/sebastianbergmann/phpunit/compare/10.0.5...10.0.6 -[10.0.5]: https://github.com/sebastianbergmann/phpunit/compare/10.0.4...10.0.5 -[10.0.4]: https://github.com/sebastianbergmann/phpunit/compare/10.0.3...10.0.4 -[10.0.3]: https://github.com/sebastianbergmann/phpunit/compare/10.0.2...10.0.3 -[10.0.2]: https://github.com/sebastianbergmann/phpunit/compare/10.0.1...10.0.2 -[10.0.1]: https://github.com/sebastianbergmann/phpunit/compare/10.0.0...10.0.1 -[10.0.0]: https://github.com/sebastianbergmann/phpunit/compare/9.6...10.0.0 diff --git a/vendor/phpunit/phpunit/ChangeLog-8.5.md b/vendor/phpunit/phpunit/ChangeLog-8.5.md deleted file mode 100644 index a65e6a61..00000000 --- a/vendor/phpunit/phpunit/ChangeLog-8.5.md +++ /dev/null @@ -1,304 +0,0 @@ -# Changes in PHPUnit 8.5 - -All notable changes of the PHPUnit 8.5 release series are documented in this file using the [Keep a CHANGELOG](https://keepachangelog.com/) principles. - -## [8.5.33] - 2023-02-27 - -### Fixed - -* [#5186](https://github.com/sebastianbergmann/phpunit/issues/5186): SBOM does not validate - -## [8.5.32] - 2023-01-26 - -### Fixed - -* [#5120](https://github.com/sebastianbergmann/phpunit/issues/5120): Test Runner incorrectly treats `--testsuite` and `--list-tests` as not combinable options - -## [8.5.31] - 2022-10-28 - -### Fixed - -* [#5076](https://github.com/sebastianbergmann/phpunit/issues/5076): Test Runner does not warn about conflicting options - -## [8.5.30] - 2022-09-25 - -### Changed - -* The configuration generator now asks for a cache directory - -### Fixed - -* [#4913](https://github.com/sebastianbergmann/phpunit/issues/4913): Failed `assert()` should show a backtrace -* [#4966](https://github.com/sebastianbergmann/phpunit/issues/4966): `TestCase::assertSame()` (and related exact comparisons) must compare `float` exactly - -## [8.5.29] - 2022-08-22 - -### Changed - -* [#5033](https://github.com/sebastianbergmann/phpunit/issues/5033): Do not depend on phpspec/prophecy - -## [8.5.28] - 2022-07-29 - -### Fixed - -* [#5015](https://github.com/sebastianbergmann/phpunit/pull/5015): Ukraine banner unreadable on black background -* [#5016](https://github.com/sebastianbergmann/phpunit/issues/5016): PHPUnit 8.5.27 does not work on PHP 7.2.0-7.2.18 and PHP 7.3.0-7.3.5 - -## [8.5.27] - 2022-06-19 - -### Fixed - -* [#4950](https://github.com/sebastianbergmann/phpunit/issues/4950): False error on `atMost()` invocation rule without call -* [#4962](https://github.com/sebastianbergmann/phpunit/issues/4962): Ukraine banner unreadable on white background - -## [8.5.26] - 2022-04-01 - -### Fixed - -* [#4938](https://github.com/sebastianbergmann/phpunit/issues/4938): Test Double code generator does not handle `void` return type declaration on `__clone()` methods - -## [8.5.25] - 2022-03-16 - -### Fixed - -* [#4934](https://github.com/sebastianbergmann/phpunit/issues/4934): Code Coverage does not work with PHPUnit 8.5.24 PHAR on PHP 7 - -## [8.5.24] - 2022-03-05 - #StandWithUkraine - -### Changed - -* [#4874](https://github.com/sebastianbergmann/phpunit/pull/4874): `PHP_FLOAT_EPSILON` is now used instead of hardcoded `0.0000000001` in `PHPUnit\Framework\Constraint\IsIdentical` - -### Fixed - -* When the HTML code coverage report's configured low upper bound is larger than the high lower bound then the default values are used instead - -## [8.5.23] - 2022-01-21 - -### Fixed - -* [#4799](https://github.com/sebastianbergmann/phpunit/pull/4799): Memory leaks in `PHPUnit\Framework\TestSuite` class -* [#4857](https://github.com/sebastianbergmann/phpunit/pull/4857): Result of `debug_backtrace()` is not used correctly - -## [8.5.22] - 2021-12-25 - -### Changed - -* [#4812](https://github.com/sebastianbergmann/phpunit/issues/4812): Do not enforce time limits when a debugging session through DBGp is active -* [#4835](https://github.com/sebastianbergmann/phpunit/issues/4835): Support for `$GLOBALS['_composer_autoload_path']` introduced in Composer 2.2 - -### Fixed - -* [#4840](https://github.com/sebastianbergmann/phpunit/pull/4840): TestDox prettifying for class names does not correctly handle diacritics -* [#4846](https://github.com/sebastianbergmann/phpunit/pull/4846): Composer proxy script is not ignored - -## [8.5.21] - 2021-09-25 - -### Changed - -* PHPUnit no longer converts PHP deprecations to exceptions by default (configure `convertDeprecationsToExceptions="true"` to enable this) -* The PHPUnit XML configuration file generator now configures `convertDeprecationsToExceptions="true"` - -### Fixed - -* [#4772](https://github.com/sebastianbergmann/phpunit/pull/4772): TestDox HTML report not displayed correctly when browser has custom colour settings - -## [8.5.20] - 2021-08-31 - -### Fixed - -* [#4751](https://github.com/sebastianbergmann/phpunit/issues/4751): Configuration validation fails when using brackets in glob pattern - -## [8.5.19] - 2021-07-31 - -### Fixed - -* [#4740](https://github.com/sebastianbergmann/phpunit/issues/4740): `phpunit.phar` does not work with PHP 8.1 - -## [8.5.18] - 2021-07-19 - -### Fixed - -* [#4720](https://github.com/sebastianbergmann/phpunit/issues/4720): PHPUnit does not verify its own PHP extension requirements - -## [8.5.17] - 2021-06-23 - -### Changed - -* PHPUnit now errors out on startup when `PHP_VERSION` contains a value that is not compatible with `version_compare()`, for instance `X.Y.Z-(to be removed in future macOS)` - -## [8.5.16] - 2021-06-05 - -### Changed - -* The test result cache (the storage for which is implemented in `PHPUnit\Runner\DefaultTestResultCache`) no longer uses PHP's `serialize()` and `unserialize()` functions for persistence. It now uses a versioned JSON format instead that is independent of PHP implementation details (see [#3581](https://github.com/sebastianbergmann/phpunit/issues/3581) and [#4662](https://github.com/sebastianbergmann/phpunit/pull/4662) for examples why this is a problem). When PHPUnit tries to load the test result cache from a file that does not exist, or from a file that does not contain data in JSON format, or from a file that contains data in a JSON format version other than the one used by the currently running PHPUnit version, then this is considered to be a "cache miss". An empty `DefaultTestResultCache` object is created in this case. This should also prevent PHPUnit from crashing when trying to load a test result cache file created by a different version of PHPUnit (see [#4580](https://github.com/sebastianbergmann/phpunit/issues/4580) for example). - -### Fixed - -* [#4663](https://github.com/sebastianbergmann/phpunit/issues/4663): `TestCase::expectError()` works on PHP 7.3, but not on PHP >= 7.4 -* [#4678](https://github.com/sebastianbergmann/phpunit/pull/4678): Stubbed methods with `iterable` return types should return empty array by default -* [#4692](https://github.com/sebastianbergmann/phpunit/issues/4692): Annotations in single-line doc-comments are not handled correctly -* [#4694](https://github.com/sebastianbergmann/phpunit/issues/4694): `TestCase::getMockFromWsdl()` does not work with PHP 8.1-dev - -## [8.5.15] - 2021-03-17 - -### Fixed - -* [#4591](https://github.com/sebastianbergmann/phpunit/issues/4591): TeamCity logger logs warnings as test failures - -## [8.5.14] - 2021-01-17 - -### Fixed - -* [#4535](https://github.com/sebastianbergmann/phpunit/issues/4535): `getMockFromWsdl()` does not handle methods that do not have parameters correctly -* [#4572](https://github.com/sebastianbergmann/phpunit/issues/4572): Schema validation does not work with `%xx` sequences in path to `phpunit.xsd` -* [#4575](https://github.com/sebastianbergmann/phpunit/issues/4575): PHPUnit 8.5 incompatibility with PHP 8.1 - -## [8.5.13] - 2020-12-01 - -### Fixed - -* Running tests in isolated processes did not work with PHP 8 on Windows - -## [8.5.12] - 2020-11-30 - -### Changed - -* Changed PHP version constraint in `composer.json` from `^7.2` to `>=7.2` to allow the installation of PHPUnit 8.5 on PHP 8. Please note that the code coverage functionality is not available for PHPUnit 8.5 on PHP 8. - -### Fixed - -* [#4529](https://github.com/sebastianbergmann/phpunit/issues/4529): Debug mode of Xdebug 2 is not disabled for PHPT tests - -## [8.5.11] - 2020-11-27 - -### Changed - -* Bumped required version of `phpunit/php-code-coverage` - -## [8.5.10] - 2020-11-27 - -### Added - -* Support for Xdebug 3 - -### Fixed - -* [#4516](https://github.com/sebastianbergmann/phpunit/issues/4516): `phpunit/phpunit-selenium` does not work with PHPUnit 8.5.9 - -## [8.5.9] - 2020-11-10 - -### Fixed - -* [#3965](https://github.com/sebastianbergmann/phpunit/issues/3965): Process Isolation throws exceptions when PHPDBG is used -* [#4470](https://github.com/sebastianbergmann/phpunit/pull/4470): Infinite recursion when `--static-backup --strict-global-state` is used - -## [8.5.8] - 2020-06-22 - -### Fixed - -* [#4312](https://github.com/sebastianbergmann/phpunit/issues/4312): Fix for [#4299](https://github.com/sebastianbergmann/phpunit/issues/4299) breaks backward compatibility - -## [8.5.7] - 2020-06-21 - -### Fixed - -* [#4299](https://github.com/sebastianbergmann/phpunit/issues/4299): "No tests executed" does not always result in exit code `1` -* [#4306](https://github.com/sebastianbergmann/phpunit/issues/4306): Exceptions during code coverage driver initialization are not handled correctly - -## [8.5.6] - 2020-06-15 - -### Fixed - -* [#4211](https://github.com/sebastianbergmann/phpunit/issues/4211): `phpdbg_*()` functions are scoped to `PHPUnit\phpdbg_*()` - -## [8.5.5] - 2020-05-22 - -### Fixed - -* [#4033](https://github.com/sebastianbergmann/phpunit/issues/4033): Unexpected behaviour when `$GLOBALS` is deleted - -## [8.5.4] - 2020-04-23 - -### Changed - -* Changed how `PHPUnit\TextUI\Command` passes warnings to `PHPUnit\TextUI\TestRunner` - -## [8.5.3] - 2020-03-31 - -### Fixed - -* [#4017](https://github.com/sebastianbergmann/phpunit/issues/4017): Do not suggest refactoring to something that is also deprecated -* [#4133](https://github.com/sebastianbergmann/phpunit/issues/4133): `expectExceptionMessageRegExp()` has been removed in PHPUnit 9 without a deprecation warning being given in PHPUnit 8 -* [#4139](https://github.com/sebastianbergmann/phpunit/issues/4139): Cannot double interfaces that declare a constructor with PHP 8 -* [#4144](https://github.com/sebastianbergmann/phpunit/issues/4144): Empty objects are converted to empty arrays in JSON comparison failure diff - -## [8.5.2] - 2020-01-08 - -### Removed - -* `eval-stdin.php` has been removed, it was not used anymore since PHPUnit 7.2.7 - -## [8.5.1] - 2019-12-25 - -### Changed - -* `eval-stdin.php` can now only be executed with `cli` and `phpdbg` - -### Fixed - -* [#3983](https://github.com/sebastianbergmann/phpunit/issues/3983): Deprecation warning given too eagerly - -## [8.5.0] - 2019-12-06 - -### Added - -* [#3911](https://github.com/sebastianbergmann/phpunit/issues/3911): Support combined use of `addMethods()` and `onlyMethods()` -* [#3949](https://github.com/sebastianbergmann/phpunit/issues/3949): Introduce specialized assertions `assertFileEqualsCanonicalizing()`, `assertFileEqualsIgnoringCase()`, `assertStringEqualsFileCanonicalizing()`, `assertStringEqualsFileIgnoringCase()`, `assertFileNotEqualsCanonicalizing()`, `assertFileNotEqualsIgnoringCase()`, `assertStringNotEqualsFileCanonicalizing()`, and `assertStringNotEqualsFileIgnoringCase()` as alternative to using `assertFileEquals()` etc. with optional parameters - -### Changed - -* [#3860](https://github.com/sebastianbergmann/phpunit/pull/3860): Deprecate invoking PHPUnit commandline test runner with just a class name -* [#3950](https://github.com/sebastianbergmann/phpunit/issues/3950): Deprecate optional parameters of `assertFileEquals()` etc. -* [#3955](https://github.com/sebastianbergmann/phpunit/issues/3955): Deprecate support for doubling multiple interfaces - -### Fixed - -* [#3953](https://github.com/sebastianbergmann/phpunit/issues/3953): Code Coverage for test executed in isolation does not work when the PHAR is used -* [#3967](https://github.com/sebastianbergmann/phpunit/issues/3967): Cannot double interface that extends interface that extends `\Throwable` -* [#3968](https://github.com/sebastianbergmann/phpunit/pull/3968): Test class run in a separate PHP process are passing when `exit` called inside - -[8.5.33]: https://github.com/sebastianbergmann/phpunit/compare/8.5.32...8.5.33 -[8.5.32]: https://github.com/sebastianbergmann/phpunit/compare/8.5.31...8.5.32 -[8.5.31]: https://github.com/sebastianbergmann/phpunit/compare/8.5.30...8.5.31 -[8.5.30]: https://github.com/sebastianbergmann/phpunit/compare/8.5.29...8.5.30 -[8.5.29]: https://github.com/sebastianbergmann/phpunit/compare/8.5.28...8.5.29 -[8.5.28]: https://github.com/sebastianbergmann/phpunit/compare/8.5.27...8.5.28 -[8.5.27]: https://github.com/sebastianbergmann/phpunit/compare/8.5.26...8.5.27 -[8.5.26]: https://github.com/sebastianbergmann/phpunit/compare/8.5.25...8.5.26 -[8.5.25]: https://github.com/sebastianbergmann/phpunit/compare/8.5.24...8.5.25 -[8.5.24]: https://github.com/sebastianbergmann/phpunit/compare/8.5.23...8.5.24 -[8.5.23]: https://github.com/sebastianbergmann/phpunit/compare/8.5.22...8.5.23 -[8.5.22]: https://github.com/sebastianbergmann/phpunit/compare/8.5.21...8.5.22 -[8.5.21]: https://github.com/sebastianbergmann/phpunit/compare/8.5.20...8.5.21 -[8.5.20]: https://github.com/sebastianbergmann/phpunit/compare/8.5.19...8.5.20 -[8.5.19]: https://github.com/sebastianbergmann/phpunit/compare/8.5.18...8.5.19 -[8.5.18]: https://github.com/sebastianbergmann/phpunit/compare/8.5.17...8.5.18 -[8.5.17]: https://github.com/sebastianbergmann/phpunit/compare/8.5.16...8.5.17 -[8.5.16]: https://github.com/sebastianbergmann/phpunit/compare/8.5.15...8.5.16 -[8.5.15]: https://github.com/sebastianbergmann/phpunit/compare/8.5.14...8.5.15 -[8.5.14]: https://github.com/sebastianbergmann/phpunit/compare/8.5.13...8.5.14 -[8.5.13]: https://github.com/sebastianbergmann/phpunit/compare/8.5.12...8.5.13 -[8.5.12]: https://github.com/sebastianbergmann/phpunit/compare/8.5.11...8.5.12 -[8.5.11]: https://github.com/sebastianbergmann/phpunit/compare/8.5.10...8.5.11 -[8.5.10]: https://github.com/sebastianbergmann/phpunit/compare/8.5.9...8.5.10 -[8.5.9]: https://github.com/sebastianbergmann/phpunit/compare/8.5.8...8.5.9 -[8.5.8]: https://github.com/sebastianbergmann/phpunit/compare/8.5.7...8.5.8 -[8.5.7]: https://github.com/sebastianbergmann/phpunit/compare/8.5.6...8.5.7 -[8.5.6]: https://github.com/sebastianbergmann/phpunit/compare/8.5.5...8.5.6 -[8.5.5]: https://github.com/sebastianbergmann/phpunit/compare/8.5.4...8.5.5 -[8.5.4]: https://github.com/sebastianbergmann/phpunit/compare/8.5.3...8.5.4 -[8.5.3]: https://github.com/sebastianbergmann/phpunit/compare/8.5.2...8.5.3 -[8.5.2]: https://github.com/sebastianbergmann/phpunit/compare/8.5.1...8.5.2 -[8.5.1]: https://github.com/sebastianbergmann/phpunit/compare/8.5.0...8.5.1 -[8.5.0]: https://github.com/sebastianbergmann/phpunit/compare/8.4.3...8.5.0 diff --git a/vendor/phpunit/phpunit/ChangeLog-9.6.md b/vendor/phpunit/phpunit/ChangeLog-9.6.md deleted file mode 100644 index 30aa32ea..00000000 --- a/vendor/phpunit/phpunit/ChangeLog-9.6.md +++ /dev/null @@ -1,54 +0,0 @@ -# Changes in PHPUnit 9.6 - -All notable changes of the PHPUnit 9.6 release series are documented in this file using the [Keep a CHANGELOG](https://keepachangelog.com/) principles. - -## [9.6.5] - 2023-03-09 - -### Changed - -* Backported the HTML and CSS improvements made to the `--testdox-html` from PHPUnit 10 - -### Fixed - -* [#5205](https://github.com/sebastianbergmann/phpunit/issues/5205): Wrong default value for optional parameter of `PHPUnit\Util\Test::parseTestMethodAnnotations()` causes `ReflectionException` - -## [9.6.4] - 2023-02-27 - -### Fixed - -* [#5186](https://github.com/sebastianbergmann/phpunit/issues/5186): SBOM does not validate - -## [9.6.3] - 2023-02-04 - -### Fixed - -* [#5164](https://github.com/sebastianbergmann/phpunit/issues/5164): `markTestSkipped()` not handled correctly when called in "before first test" method - -## [9.6.2] - 2023-02-04 - -### Fixed - -* [#4618](https://github.com/sebastianbergmann/phpunit/issues/4618): Support for generators in `assertCount()` etc. is not marked as deprecated in PHPUnit 9.6 - -## [9.6.1] - 2023-02-03 - -### Fixed - -* [#5073](https://github.com/sebastianbergmann/phpunit/issues/5073): `--no-extensions` CLI option only prevents extension PHARs from being loaded -* [#5160](https://github.com/sebastianbergmann/phpunit/issues/5160): Deprecate `assertClassHasAttribute()`, `assertClassNotHasAttribute()`, `assertClassHasStaticAttribute()`, `assertClassNotHasStaticAttribute()`, `assertObjectHasAttribute()`, `assertObjectNotHasAttribute()`, `classHasAttribute()`, `classHasStaticAttribute()`, and `objectHasAttribute()` - -## [9.6.0] - 2023-02-03 - -### Changed - -* [#5062](https://github.com/sebastianbergmann/phpunit/issues/5062): Deprecate `expectDeprecation()`, `expectDeprecationMessage()`, `expectDeprecationMessageMatches()`, `expectError()`, `expectErrorMessage()`, `expectErrorMessageMatches()`, `expectNotice()`, `expectNoticeMessage()`, `expectNoticeMessageMatches()`, `expectWarning()`, `expectWarningMessage()`, and `expectWarningMessageMatches()` -* [#5063](https://github.com/sebastianbergmann/phpunit/issues/5063): Deprecate `withConsecutive()` -* [#5064](https://github.com/sebastianbergmann/phpunit/issues/5064): Deprecate `PHPUnit\Framework\TestCase::getMockClass()` -* [#5132](https://github.com/sebastianbergmann/phpunit/issues/5132): Deprecate `Test` suffix for abstract test case classes - -[9.6.5]: https://github.com/sebastianbergmann/phpunit/compare/9.6.4...9.6.5 -[9.6.4]: https://github.com/sebastianbergmann/phpunit/compare/9.6.3...9.6.4 -[9.6.3]: https://github.com/sebastianbergmann/phpunit/compare/9.6.2...9.6.3 -[9.6.2]: https://github.com/sebastianbergmann/phpunit/compare/9.6.1...9.6.2 -[9.6.1]: https://github.com/sebastianbergmann/phpunit/compare/9.6.0...9.6.1 -[9.6.0]: https://github.com/sebastianbergmann/phpunit/compare/9.5.28...9.6.0 diff --git a/vendor/phpunit/phpunit/LICENSE b/vendor/phpunit/phpunit/LICENSE index 73e95512..83489d63 100644 --- a/vendor/phpunit/phpunit/LICENSE +++ b/vendor/phpunit/phpunit/LICENSE @@ -1,6 +1,6 @@ BSD 3-Clause License -Copyright (c) 2001-2023, Sebastian Bergmann +Copyright (c) 2001-2026, Sebastian Bergmann All rights reserved. Redistribution and use in source and binary forms, with or without diff --git a/vendor/phpunit/phpunit/README.md b/vendor/phpunit/phpunit/README.md index 0e4789a0..1ca144ae 100644 --- a/vendor/phpunit/phpunit/README.md +++ b/vendor/phpunit/phpunit/README.md @@ -1,10 +1,7 @@ -

🇺🇦 UKRAINE NEEDS YOUR HELP NOW!

- # PHPUnit -[![Latest Stable Version](https://poser.pugx.org/phpunit/phpunit/v/stable.png)](https://packagist.org/packages/phpunit/phpunit) +[![Latest Stable Version](https://poser.pugx.org/phpunit/phpunit/v)](https://packagist.org/packages/phpunit/phpunit) [![CI Status](https://github.com/sebastianbergmann/phpunit/workflows/CI/badge.svg)](https://github.com/sebastianbergmann/phpunit/actions) -[![Type Coverage](https://shepherd.dev/github/sebastianbergmann/phpunit/coverage.svg)](https://shepherd.dev/github/sebastianbergmann/phpunit) [![codecov](https://codecov.io/gh/sebastianbergmann/phpunit/branch/main/graph/badge.svg)](https://codecov.io/gh/sebastianbergmann/phpunit) PHPUnit is a programmer-oriented testing framework for PHP. It is an instance of the xUnit architecture for unit testing frameworks. @@ -21,7 +18,7 @@ $ php phpunit-X.Y.phar --version Please replace `X.Y` with the version of PHPUnit you are interested in. -Alternatively, you may use [Composer](https://getcomposer.org/) to download and install PHPUnit as well as its dependencies. Please refer to the "[Getting Started](https://phpunit.de/getting-started-with-phpunit.html)" guide for details on how to install PHPUnit. +Alternatively, you may use [Composer](https://getcomposer.org/) to download and install PHPUnit as well as its dependencies. Please refer to the [documentation](https://phpunit.de/documentation.html) for details on how to install PHPUnit. ## Contribute diff --git a/vendor/phpunit/phpunit/SECURITY.md b/vendor/phpunit/phpunit/SECURITY.md index 965e5ed2..44dd9d2a 100644 --- a/vendor/phpunit/phpunit/SECURITY.md +++ b/vendor/phpunit/phpunit/SECURITY.md @@ -1,12 +1,36 @@ # Security Policy -If you believe you have found a security vulnerability in PHPUnit, please report it to us through coordinated disclosure. +## Supported versions + +Security issues are fixed for versions of PHPUnit that are in the Bugfix Support phase. +Versions in the Life Support phase only receive changes required for compatibility with new versions of PHP; they do not receive bug or security fixes. +Versions that have reached End-of-Life do not receive any changes. + +| Version | Phase | End of Bugfix Support | +|------------|----------------|-----------------------| +| PHPUnit 13 | Bugfix Support | February 4, 2028 | +| PHPUnit 12 | Bugfix Support | February 5, 2027 | +| PHPUnit 11 | Life Support | February 6, 2026 | +| PHPUnit 10 | Life Support | February 7, 2025 | +| PHPUnit 9 | Life Support | February 2, 2024 | +| PHPUnit 8 | Life Support | February 3, 2023 | + +PHPUnit 7 and earlier have reached End-of-Life. + +See [Supported Versions of PHPUnit](https://phpunit.de/supported-versions.html) for the authoritative list and for the definitions of the support phases. + +## Reporting a vulnerability + +If you believe you have found a security vulnerability in PHPUnit, please report it to me through coordinated disclosure. +Please report vulnerabilities in bundled libraries to their respective repositories. **Please do not report security vulnerabilities through public GitHub issues, discussions, or pull requests.** Instead, please email `sebastian@phpunit.de`. -Please include as much of the information listed below as you can to help us better understand and resolve the issue: +Use my [PGP key](https://sebastian-bergmann.de/gpg.asc) for encrypted email, for example when your report includes proof-of-concept exploits against third-party systems. + +Please include as much of the information listed below as you can to help me better understand and resolve the issue: * The type of issue * Full paths of source file(s) related to the manifestation of the issue @@ -16,18 +40,68 @@ Please include as much of the information listed below as you can to help us bet * Proof-of-concept or exploit code (if possible) * Impact of the issue, including how an attacker might exploit the issue -This information will help us triage your report more quickly. +This information will help me triage your report more quickly. -## Web Context +If you used an AI assistant (LLM, coding agent, or similar) to find, reproduce, or write up the issue, please say so and describe how it was used. +This does not disqualify a report, but it changes how I triage it. -PHPUnit is a framework for writing as well as a command-line tool for running tests. Writing and running tests is a development-time activity. There is no reason why PHPUnit should be installed on a webserver and/or in a production environment. +## How reports are handled -**If you upload PHPUnit to a webserver then your deployment process is broken. On a more general note, if your `vendor` directory is publicly accessible on your webserver then your deployment process is also broken.** +I do not operate a bug bounty program. +There is no monetary reward for reporting a vulnerability. -Please note that if you upload PHPUnit to a webserver "bad things" may happen. [You have been warned.](https://thephp.cc/articles/phpunit-a-security-risk) +I will acknowledge receipt of a vulnerability report within 7 days. -PHPUnit is developed with a focus on development environments and the command-line. No specific testing or hardening with regard to using PHPUnit in an HTTP or web context or with untrusted input data is performed. PHPUnit might also contain functionality that intentionally exposes internal application data for debugging purposes. +A confirmed security issue is handled like any other bug. +It is not prioritized ahead of other work. +It is fixed when I have the time to fix it. +I will fix and release before a public advisory is published, but I will not agree to fixed-date embargoes, multi-vendor coordination, or NDAs. +I do not optimize for metrics such as the OpenSSF Scorecard. + +Once a vulnerability has been fixed and a release with the fix is available, I publish a public advisory on GitHub. +I give credit in the advisory when I know the reporter's GitHub user name. + +## Scope + +PHPUnit is a framework for writing as well as a command-line tool for running tests. +Writing and running tests is a development-time activity. +PHPUnit is developed with a focus on development environments and the command-line. + +### In scope + +I treat a bug as a security issue when a documented, intended use of PHPUnit, or a reasonable extrapolation of it, causes PHPUnit itself to compromise the confidentiality, integrity, or availability of the environment it runs in. Examples: + +* PHPUnit's console output, logfiles, and reports in any format contain a vulnerability that allows an attacker to extract secrets from or otherwise compromise the environment in which the output is viewed or processed. +* A regular test run, against trusted test code, trusted production code, and a trusted configuration, causes PHPUnit to transmit data from the environment to a third party. +* A regular test run, against trusted test code, trusted production code, and a trusted configuration, causes PHPUnit to write secrets from the environment to its own output, log files, or reports. + +### Not in scope + +No specific testing or hardening with regard to using PHPUnit in an HTTP or web context, in a CI/CD context, or with untrusted input data is performed. +The following classes of issue are explicitly not in scope. + +#### CI/CD Pipelines + +Running tests in a CI/CD pipeline is a legitimate and common use of PHPUnit. +However, a CI/CD pipeline is not a sandbox, and PHPUnit is not designed to defend one. +Executing test code, production code, or a configuration for PHPUnit or PHP that has not been reviewed is equivalent to executing arbitrary code on the infrastructure that hosts the pipeline. +This class of risk is documented as [CICD-SEC-04: Poisoned Pipeline Execution](https://owasp.org/www-project-top-10-ci-cd-security-risks/CICD-SEC-04-Poisoned-Pipeline-Execution) in the OWASP Top 10 CI/CD Security Risks. + +**If your CI/CD pipeline automatically runs PHPUnit against a configuration for PHPUnit or PHP, test code, and/or production code from third parties without those changes having been reviewed first, then your development process is broken.** + +Running code from a pull request on your infrastructure is, by definition, remote code execution. + +Protecting the pipeline is the responsibility of the operator of the pipeline: +limit which events trigger workflows, require review before workflows run on contributions from outside collaborators, isolate jobs that run untrusted code, and do not expose secrets to such jobs. + +#### Webserver + +There is no reason why PHPUnit should be installed on a webserver and/or in a production environment. + +**If you upload PHPUnit to a webserver then your deployment process is broken.** + +On a more general note, if your `vendor` directory is publicly accessible on your webserver then your deployment process is also broken. + +PHPUnit might contain functionality that intentionally exposes internal application data for debugging purposes. If PHPUnit is used in a web application, the application developer is responsible for filtering inputs or escaping outputs as necessary and for verifying that the used functionality is safe for use within the intended context. - -Vulnerabilities specific to the use outside a development context will be fixed as applicable, provided that the fix does not have an averse effect on the primary use case for development purposes. diff --git a/vendor/phpunit/phpunit/composer.json b/vendor/phpunit/phpunit/composer.json index 165c61f2..c8cca55a 100644 --- a/vendor/phpunit/phpunit/composer.json +++ b/vendor/phpunit/phpunit/composer.json @@ -16,42 +16,61 @@ "role": "lead" } ], + "funding": [ + { + "type": "other", + "url": "https://phpunit.de/sponsoring.html" + } + ], "support": { - "issues": "https://github.com/sebastianbergmann/phpunit/issues" + "issues": "https://github.com/sebastianbergmann/phpunit/issues", + "security": "https://github.com/sebastianbergmann/phpunit/security/policy" }, "prefer-stable": true, "require": { "php": ">=8.1", "ext-dom": "*", + "ext-filter": "*", "ext-json": "*", "ext-libxml": "*", "ext-mbstring": "*", - "ext-xml": "*", "ext-xmlwriter": "*", - "myclabs/deep-copy": "^1.10.1", - "phar-io/manifest": "^2.0.3", - "phar-io/version": "^3.0.2", - "phpunit/php-code-coverage": "^10.0", - "phpunit/php-file-iterator": "^4.0", - "phpunit/php-invoker": "^4.0", - "phpunit/php-text-template": "^3.0", - "phpunit/php-timer": "^6.0", - "sebastian/cli-parser": "^2.0", - "sebastian/code-unit": "^2.0", - "sebastian/comparator": "^5.0", - "sebastian/diff": "^5.0", - "sebastian/environment": "^6.0", - "sebastian/exporter": "^5.0", - "sebastian/global-state": "^6.0", - "sebastian/object-enumerator": "^5.0", - "sebastian/recursion-context": "^5.0", - "sebastian/type": "^4.0", - "sebastian/version": "^4.0" + "myclabs/deep-copy": "^1.13.4", + "phar-io/manifest": "^2.0.4", + "phar-io/version": "^3.2.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.5", + "sebastian/diff": "^5.1.1", + "sebastian/environment": "^6.1.0", + "sebastian/exporter": "^5.1.4", + "sebastian/global-state": "^6.0.2", + "sebastian/object-enumerator": "^5.0.0", + "sebastian/recursion-context": "^5.0.1", + "sebastian/type": "^4.0.0", + "sebastian/version": "^4.0.1" }, "config": { "platform": { "php": "8.1.0" }, + "policy": { + "malware": { + "audit": "fail" + }, + "security-advisory": { + "audit": "fail" + }, + "abandoned": { + "audit": "fail" + } + }, + "classmap-authoritative": true, "optimize-autoloader": true, "sort-packages": true }, @@ -71,17 +90,23 @@ }, "autoload-dev": { "classmap": [ - "tests/" + "tests/_files" ], "files": [ + "tests/unit/Event/AbstractEventTestCase.php", + "tests/unit/Framework/MockObject/TestDoubleTestCase.php", + "tests/unit/Metadata/Parser/AnnotationParserTestCase.php", + "tests/unit/Metadata/Parser/AttributeParserTestCase.php", "tests/_files/CoverageNamespacedFunctionTest.php", "tests/_files/CoveredFunction.php", - "tests/_files/NamespaceCoveredFunction.php" + "tests/_files/Generator.php", + "tests/_files/NamespaceCoveredFunction.php", + "tests/end-to-end/code-coverage/ignore-function-using-attribute/src/CoveredFunction.php" ] }, "extra": { "branch-alias": { - "dev-main": "10.0-dev" + "dev-main": "10.5-dev" } } } diff --git a/vendor/phpunit/phpunit/phpunit b/vendor/phpunit/phpunit/phpunit index 62ab6325..b164c8f9 100644 --- a/vendor/phpunit/phpunit/phpunit +++ b/vendor/phpunit/phpunit/phpunit @@ -38,22 +38,6 @@ if (version_compare('8.1.0', PHP_VERSION, '>')) { die(1); } -foreach (['dom', 'json', 'libxml', 'mbstring', 'tokenizer', 'xml', 'xmlwriter'] as $extension) { - if (extension_loaded($extension)) { - continue; - } - - fwrite( - STDERR, - sprintf( - 'PHPUnit requires the "%s" extension.' . PHP_EOL, - $extension - ) - ); - - die(1); -} - if (!ini_get('date.timezone')) { ini_set('date.timezone', 'UTC'); } @@ -87,4 +71,34 @@ if (!defined('PHPUNIT_COMPOSER_INSTALL')) { require PHPUNIT_COMPOSER_INSTALL; +$requiredExtensions = ['dom', 'filter', 'json', 'libxml', 'mbstring', 'tokenizer', 'xmlwriter']; + +$unavailableExtensions = array_filter( + $requiredExtensions, + static function ($extension) { + return !extension_loaded($extension); + } +); + +// Workaround for https://github.com/sebastianbergmann/phpunit/issues/5662 +if (!function_exists('ctype_alnum')) { + $unavailableExtensions[] = 'ctype'; +} + +if ([] !== $unavailableExtensions) { + fwrite( + STDERR, + sprintf( + 'PHPUnit requires the "%s" extensions, but the "%s" %s not available.' . PHP_EOL, + implode('", "', $requiredExtensions), + implode('", "', $unavailableExtensions), + count($unavailableExtensions) === 1 ? 'extension is' : 'extensions are' + ) + ); + + die(1); +} + +unset($requiredExtensions, $unavailableExtensions); + exit((new PHPUnit\TextUI\Application)->run($_SERVER['argv'])); diff --git a/vendor/phpunit/phpunit/phpunit.xsd b/vendor/phpunit/phpunit/phpunit.xsd index 480d54de..284820b0 100644 --- a/vendor/phpunit/phpunit/phpunit.xsd +++ b/vendor/phpunit/phpunit/phpunit.xsd @@ -2,7 +2,7 @@ - This Schema file defines the rules by which the XML configuration file of PHPUnit 10.0 may be structured. + This Schema file defines the rules by which the XML configuration file of PHPUnit 10.5 may be structured. @@ -11,18 +11,49 @@ Root Element - + - + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -56,7 +87,7 @@ - + @@ -81,27 +112,11 @@ - - - - - - - - - - - - - - - - - + @@ -120,17 +135,6 @@ - - - - - - - - - - - @@ -170,24 +174,32 @@ + + - - - - - - - + + + + + + + + + + + + + + - @@ -202,9 +214,11 @@ + + @@ -213,6 +227,7 @@ + @@ -230,12 +245,40 @@ - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/vendor/phpunit/phpunit/schema/8.5.xsd b/vendor/phpunit/phpunit/schema/8.5.xsd index 5881bafe..75e22289 100644 --- a/vendor/phpunit/phpunit/schema/8.5.xsd +++ b/vendor/phpunit/phpunit/schema/8.5.xsd @@ -244,7 +244,7 @@ - + @@ -309,8 +309,10 @@ - - + + + + diff --git a/vendor/phpunit/phpunit/schema/9.2.xsd b/vendor/phpunit/phpunit/schema/9.2.xsd index 883f21bc..d770e8b0 100644 --- a/vendor/phpunit/phpunit/schema/9.2.xsd +++ b/vendor/phpunit/phpunit/schema/9.2.xsd @@ -163,7 +163,7 @@ - + @@ -248,7 +248,7 @@ - + @@ -282,7 +282,7 @@ - + @@ -310,7 +310,7 @@ - + diff --git a/vendor/phpunit/phpunit/schema/9.5.xsd b/vendor/phpunit/phpunit/schema/9.5.xsd index a25d683a..eabefac3 100644 --- a/vendor/phpunit/phpunit/schema/9.5.xsd +++ b/vendor/phpunit/phpunit/schema/9.5.xsd @@ -213,7 +213,7 @@ - + @@ -279,8 +279,10 @@ - - + + + + diff --git a/vendor/phpunit/phpunit/src/Event/Dispatcher/CollectingDispatcher.php b/vendor/phpunit/phpunit/src/Event/Dispatcher/CollectingDispatcher.php index 39433fe3..c431b93e 100644 --- a/vendor/phpunit/phpunit/src/Event/Dispatcher/CollectingDispatcher.php +++ b/vendor/phpunit/phpunit/src/Event/Dispatcher/CollectingDispatcher.php @@ -10,6 +10,8 @@ namespace PHPUnit\Event; /** + * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit + * * @internal This class is not covered by the backward compatibility promise for PHPUnit */ final class CollectingDispatcher implements Dispatcher diff --git a/vendor/phpunit/phpunit/src/Event/Dispatcher/DeferringDispatcher.php b/vendor/phpunit/phpunit/src/Event/Dispatcher/DeferringDispatcher.php index 16c91659..6895facb 100644 --- a/vendor/phpunit/phpunit/src/Event/Dispatcher/DeferringDispatcher.php +++ b/vendor/phpunit/phpunit/src/Event/Dispatcher/DeferringDispatcher.php @@ -10,6 +10,8 @@ namespace PHPUnit\Event; /** + * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit + * * @internal This class is not covered by the backward compatibility promise for PHPUnit */ final class DeferringDispatcher implements SubscribableDispatcher @@ -34,14 +36,6 @@ final class DeferringDispatcher implements SubscribableDispatcher $this->dispatcher->registerSubscriber($subscriber); } - /** - * @psalm-param class-string $className - */ - public function hasSubscriberFor(string $className): bool - { - return $this->dispatcher->hasSubscriberFor($className); - } - public function dispatch(Event $event): void { if ($this->recording) { diff --git a/vendor/phpunit/phpunit/src/Event/Dispatcher/DirectDispatcher.php b/vendor/phpunit/phpunit/src/Event/Dispatcher/DirectDispatcher.php index 685d22ca..dc1da616 100644 --- a/vendor/phpunit/phpunit/src/Event/Dispatcher/DirectDispatcher.php +++ b/vendor/phpunit/phpunit/src/Event/Dispatcher/DirectDispatcher.php @@ -9,6 +9,7 @@ */ namespace PHPUnit\Event; +use const PHP_EOL; use function array_key_exists; use function dirname; use function sprintf; @@ -16,6 +17,8 @@ use function str_starts_with; use Throwable; /** + * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit + * * @internal This class is not covered by the backward compatibility promise for PHPUnit */ final class DirectDispatcher implements SubscribableDispatcher @@ -52,8 +55,8 @@ final class DirectDispatcher implements SubscribableDispatcher throw new UnknownSubscriberTypeException( sprintf( 'Subscriber "%s" does not implement any known interface - did you forget to register it?', - $subscriber::class - ) + $subscriber::class, + ), ); } @@ -67,22 +70,7 @@ final class DirectDispatcher implements SubscribableDispatcher } /** - * @psalm-param class-string $className - */ - public function hasSubscriberFor(string $className): bool - { - if ($this->tracers !== []) { - return true; - } - - if (isset($this->subscribers[$className])) { - return true; - } - - return false; - } - - /** + * @throws Throwable * @throws UnknownEventTypeException */ public function dispatch(Event $event): void @@ -93,17 +81,19 @@ final class DirectDispatcher implements SubscribableDispatcher throw new UnknownEventTypeException( sprintf( 'Unknown event type "%s"', - $eventClassName - ) + $eventClassName, + ), ); } foreach ($this->tracers as $tracer) { try { $tracer->trace($event); + // @codeCoverageIgnoreStart } catch (Throwable $t) { - $this->ignoreThrowablesFromThirdPartySubscribers($t); + $this->handleThrowable($t); } + // @codeCoverageIgnoreEnd } if (!array_key_exists($eventClassName, $this->subscribers)) { @@ -114,7 +104,7 @@ final class DirectDispatcher implements SubscribableDispatcher try { $subscriber->notify($event); } catch (Throwable $t) { - $this->ignoreThrowablesFromThirdPartySubscribers($t); + $this->handleThrowable($t); } } } @@ -122,10 +112,28 @@ final class DirectDispatcher implements SubscribableDispatcher /** * @throws Throwable */ - private function ignoreThrowablesFromThirdPartySubscribers(Throwable $t): void + public function handleThrowable(Throwable $t): void { - if (str_starts_with($t->getFile(), dirname(__DIR__, 2))) { - throw $t; + if ($this->isThrowableFromThirdPartySubscriber($t)) { + Facade::emitter()->testRunnerTriggeredPhpunitWarning( + sprintf( + 'Exception in third-party event subscriber: %s%s%s', + $t->getMessage(), + PHP_EOL, + $t->getTraceAsString(), + ), + ); + + return; } + + // @codeCoverageIgnoreStart + throw $t; + // @codeCoverageIgnoreEnd + } + + private function isThrowableFromThirdPartySubscriber(Throwable $t): bool + { + return !str_starts_with($t->getFile(), dirname(__DIR__, 2)); } } diff --git a/vendor/phpunit/phpunit/src/Event/Dispatcher/Dispatcher.php b/vendor/phpunit/phpunit/src/Event/Dispatcher/Dispatcher.php index 35691be7..e7086539 100644 --- a/vendor/phpunit/phpunit/src/Event/Dispatcher/Dispatcher.php +++ b/vendor/phpunit/phpunit/src/Event/Dispatcher/Dispatcher.php @@ -10,6 +10,8 @@ namespace PHPUnit\Event; /** + * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit + * * @internal This interface is not covered by the backward compatibility promise for PHPUnit */ interface Dispatcher diff --git a/vendor/phpunit/phpunit/src/Event/Dispatcher/SubscribableDispatcher.php b/vendor/phpunit/phpunit/src/Event/Dispatcher/SubscribableDispatcher.php index 997d0e2a..c4393da1 100644 --- a/vendor/phpunit/phpunit/src/Event/Dispatcher/SubscribableDispatcher.php +++ b/vendor/phpunit/phpunit/src/Event/Dispatcher/SubscribableDispatcher.php @@ -10,6 +10,8 @@ namespace PHPUnit\Event; /** + * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit + * * @internal This interface is not covered by the backward compatibility promise for PHPUnit */ interface SubscribableDispatcher extends Dispatcher @@ -20,9 +22,4 @@ interface SubscribableDispatcher extends Dispatcher public function registerSubscriber(Subscriber $subscriber): void; public function registerTracer(Tracer\Tracer $tracer): void; - - /** - * @psalm-param class-string $className - */ - public function hasSubscriberFor(string $className): bool; } diff --git a/vendor/phpunit/phpunit/src/Event/Emitter/DispatchingEmitter.php b/vendor/phpunit/phpunit/src/Event/Emitter/DispatchingEmitter.php index b7f22b34..e2960609 100644 --- a/vendor/phpunit/phpunit/src/Event/Emitter/DispatchingEmitter.php +++ b/vendor/phpunit/phpunit/src/Event/Emitter/DispatchingEmitter.php @@ -9,8 +9,11 @@ */ namespace PHPUnit\Event; +use PHPUnit\Event\Code\ClassMethod; use PHPUnit\Event\Code\ComparisonFailure; use PHPUnit\Event\Code\Throwable; +use PHPUnit\Event\Test\DataProviderMethodCalled; +use PHPUnit\Event\Test\DataProviderMethodFinished; use PHPUnit\Event\TestSuite\Filtered as TestSuiteFiltered; use PHPUnit\Event\TestSuite\Finished as TestSuiteFinished; use PHPUnit\Event\TestSuite\Loaded as TestSuiteLoaded; @@ -20,9 +23,11 @@ use PHPUnit\Event\TestSuite\Started as TestSuiteStarted; use PHPUnit\Event\TestSuite\TestSuite; use PHPUnit\Framework\Constraint; use PHPUnit\TextUI\Configuration\Configuration; -use SebastianBergmann\Exporter\Exporter; +use PHPUnit\Util\Exporter; /** + * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit + * * @internal This class is not covered by the backward compatibility promise for PHPUnit */ final class DispatchingEmitter implements Emitter @@ -31,6 +36,7 @@ final class DispatchingEmitter implements Emitter private readonly Telemetry\System $system; private readonly Telemetry\Snapshot $startSnapshot; private Telemetry\Snapshot $previousSnapshot; + private bool $exportObjects = false; public function __construct(Dispatcher $dispatcher, Telemetry\System $system) { @@ -38,7 +44,23 @@ final class DispatchingEmitter implements Emitter $this->system = $system; $this->startSnapshot = $system->snapshot(); - $this->previousSnapshot = $system->snapshot(); + $this->previousSnapshot = $this->startSnapshot; + } + + /** + * @deprecated + */ + public function exportObjects(): void + { + $this->exportObjects = true; + } + + /** + * @deprecated + */ + public function exportsObjects(): bool + { + return $this->exportObjects; } /** @@ -50,8 +72,8 @@ final class DispatchingEmitter implements Emitter $this->dispatcher->dispatch( new Application\Started( $this->telemetryInfo(), - new Runtime\Runtime - ) + new Runtime\Runtime, + ), ); } @@ -63,8 +85,8 @@ final class DispatchingEmitter implements Emitter { $this->dispatcher->dispatch( new TestRunner\Started( - $this->telemetryInfo() - ) + $this->telemetryInfo(), + ), ); } @@ -77,8 +99,8 @@ final class DispatchingEmitter implements Emitter $this->dispatcher->dispatch( new TestRunner\Configured( $this->telemetryInfo(), - $configuration - ) + $configuration, + ), ); } @@ -91,8 +113,8 @@ final class DispatchingEmitter implements Emitter $this->dispatcher->dispatch( new TestRunner\BootstrapFinished( $this->telemetryInfo(), - $filename - ) + $filename, + ), ); } @@ -107,8 +129,8 @@ final class DispatchingEmitter implements Emitter $this->telemetryInfo(), $filename, $name, - $version - ) + $version, + ), ); } @@ -125,8 +147,38 @@ final class DispatchingEmitter implements Emitter new TestRunner\ExtensionBootstrapped( $this->telemetryInfo(), $className, - $parameters - ) + $parameters, + ), + ); + } + + /** + * @throws InvalidArgumentException + * @throws UnknownEventTypeException + */ + public function dataProviderMethodCalled(ClassMethod $testMethod, ClassMethod $dataProviderMethod): void + { + $this->dispatcher->dispatch( + new DataProviderMethodCalled( + $this->telemetryInfo(), + $testMethod, + $dataProviderMethod, + ), + ); + } + + /** + * @throws InvalidArgumentException + * @throws UnknownEventTypeException + */ + public function dataProviderMethodFinished(ClassMethod $testMethod, ClassMethod ...$calledMethods): void + { + $this->dispatcher->dispatch( + new DataProviderMethodFinished( + $this->telemetryInfo(), + $testMethod, + ...$calledMethods, + ), ); } @@ -139,8 +191,8 @@ final class DispatchingEmitter implements Emitter $this->dispatcher->dispatch( new TestSuiteLoaded( $this->telemetryInfo(), - $testSuite - ) + $testSuite, + ), ); } @@ -153,8 +205,8 @@ final class DispatchingEmitter implements Emitter $this->dispatcher->dispatch( new TestSuiteFiltered( $this->telemetryInfo(), - $testSuite - ) + $testSuite, + ), ); } @@ -169,8 +221,8 @@ final class DispatchingEmitter implements Emitter $this->telemetryInfo(), $executionOrder, $executionOrderDefects, - $resolveDependencies - ) + $resolveDependencies, + ), ); } @@ -182,8 +234,8 @@ final class DispatchingEmitter implements Emitter { $this->dispatcher->dispatch( new TestRunner\EventFacadeSealed( - $this->telemetryInfo() - ) + $this->telemetryInfo(), + ), ); } @@ -196,8 +248,30 @@ final class DispatchingEmitter implements Emitter $this->dispatcher->dispatch( new TestRunner\ExecutionStarted( $this->telemetryInfo(), - $testSuite - ) + $testSuite, + ), + ); + } + + /** + * @throws InvalidArgumentException + * @throws UnknownEventTypeException + */ + public function testRunnerDisabledGarbageCollection(): void + { + $this->dispatcher->dispatch( + new TestRunner\GarbageCollectionDisabled($this->telemetryInfo()), + ); + } + + /** + * @throws InvalidArgumentException + * @throws UnknownEventTypeException + */ + public function testRunnerTriggeredGarbageCollection(): void + { + $this->dispatcher->dispatch( + new TestRunner\GarbageCollectionTriggered($this->telemetryInfo()), ); } @@ -211,8 +285,8 @@ final class DispatchingEmitter implements Emitter new TestSuiteSkipped( $this->telemetryInfo(), $testSuite, - $message - ) + $message, + ), ); } @@ -225,8 +299,8 @@ final class DispatchingEmitter implements Emitter $this->dispatcher->dispatch( new TestSuiteStarted( $this->telemetryInfo(), - $testSuite - ) + $testSuite, + ), ); } @@ -239,8 +313,22 @@ final class DispatchingEmitter implements Emitter $this->dispatcher->dispatch( new Test\PreparationStarted( $this->telemetryInfo(), - $test - ) + $test, + ), + ); + } + + /** + * @throws InvalidArgumentException + * @throws UnknownEventTypeException + */ + public function testPreparationFailed(Code\Test $test): void + { + $this->dispatcher->dispatch( + new Test\PreparationFailed( + $this->telemetryInfo(), + $test, + ), ); } @@ -250,14 +338,14 @@ final class DispatchingEmitter implements Emitter * @throws InvalidArgumentException * @throws UnknownEventTypeException */ - public function testBeforeFirstTestMethodCalled(string $testClassName, Code\ClassMethod $calledMethod): void + public function beforeFirstTestMethodCalled(string $testClassName, ClassMethod $calledMethod): void { $this->dispatcher->dispatch( new Test\BeforeFirstTestMethodCalled( $this->telemetryInfo(), $testClassName, - $calledMethod - ) + $calledMethod, + ), ); } @@ -267,15 +355,15 @@ final class DispatchingEmitter implements Emitter * @throws InvalidArgumentException * @throws UnknownEventTypeException */ - public function testBeforeFirstTestMethodErrored(string $testClassName, Code\ClassMethod $calledMethod, Throwable $throwable): void + public function beforeFirstTestMethodErrored(string $testClassName, ClassMethod $calledMethod, Throwable $throwable): void { $this->dispatcher->dispatch( new Test\BeforeFirstTestMethodErrored( $this->telemetryInfo(), $testClassName, $calledMethod, - $throwable - ) + $throwable, + ), ); } @@ -285,14 +373,14 @@ final class DispatchingEmitter implements Emitter * @throws InvalidArgumentException * @throws UnknownEventTypeException */ - public function testBeforeFirstTestMethodFinished(string $testClassName, Code\ClassMethod ...$calledMethods): void + public function beforeFirstTestMethodFinished(string $testClassName, ClassMethod ...$calledMethods): void { $this->dispatcher->dispatch( new Test\BeforeFirstTestMethodFinished( $this->telemetryInfo(), $testClassName, - ...$calledMethods - ) + ...$calledMethods, + ), ); } @@ -302,14 +390,14 @@ final class DispatchingEmitter implements Emitter * @throws InvalidArgumentException * @throws UnknownEventTypeException */ - public function testBeforeTestMethodCalled(string $testClassName, Code\ClassMethod $calledMethod): void + public function beforeTestMethodCalled(string $testClassName, ClassMethod $calledMethod): void { $this->dispatcher->dispatch( new Test\BeforeTestMethodCalled( $this->telemetryInfo(), $testClassName, - $calledMethod - ) + $calledMethod, + ), ); } @@ -319,14 +407,32 @@ final class DispatchingEmitter implements Emitter * @throws InvalidArgumentException * @throws UnknownEventTypeException */ - public function testBeforeTestMethodFinished(string $testClassName, Code\ClassMethod ...$calledMethods): void + public function beforeTestMethodErrored(string $testClassName, ClassMethod $calledMethod, Throwable $throwable): void + { + $this->dispatcher->dispatch( + new Test\BeforeTestMethodErrored( + $this->telemetryInfo(), + $testClassName, + $calledMethod, + $throwable, + ), + ); + } + + /** + * @psalm-param class-string $testClassName + * + * @throws InvalidArgumentException + * @throws UnknownEventTypeException + */ + public function beforeTestMethodFinished(string $testClassName, ClassMethod ...$calledMethods): void { $this->dispatcher->dispatch( new Test\BeforeTestMethodFinished( $this->telemetryInfo(), $testClassName, - ...$calledMethods - ) + ...$calledMethods, + ), ); } @@ -336,14 +442,14 @@ final class DispatchingEmitter implements Emitter * @throws InvalidArgumentException * @throws UnknownEventTypeException */ - public function testPreConditionCalled(string $testClassName, Code\ClassMethod $calledMethod): void + public function preConditionCalled(string $testClassName, ClassMethod $calledMethod): void { $this->dispatcher->dispatch( new Test\PreConditionCalled( $this->telemetryInfo(), $testClassName, - $calledMethod - ) + $calledMethod, + ), ); } @@ -353,14 +459,32 @@ final class DispatchingEmitter implements Emitter * @throws InvalidArgumentException * @throws UnknownEventTypeException */ - public function testPreConditionFinished(string $testClassName, Code\ClassMethod ...$calledMethods): void + public function preConditionErrored(string $testClassName, ClassMethod $calledMethod, Throwable $throwable): void + { + $this->dispatcher->dispatch( + new Test\PreConditionErrored( + $this->telemetryInfo(), + $testClassName, + $calledMethod, + $throwable, + ), + ); + } + + /** + * @psalm-param class-string $testClassName + * + * @throws InvalidArgumentException + * @throws UnknownEventTypeException + */ + public function preConditionFinished(string $testClassName, ClassMethod ...$calledMethods): void { $this->dispatcher->dispatch( new Test\PreConditionFinished( $this->telemetryInfo(), $testClassName, - ...$calledMethods - ) + ...$calledMethods, + ), ); } @@ -373,8 +497,8 @@ final class DispatchingEmitter implements Emitter $this->dispatcher->dispatch( new Test\Prepared( $this->telemetryInfo(), - $test - ) + $test, + ), ); } @@ -389,50 +513,46 @@ final class DispatchingEmitter implements Emitter $this->dispatcher->dispatch( new Test\ComparatorRegistered( $this->telemetryInfo(), - $className - ) + $className, + ), ); } /** * @throws InvalidArgumentException * @throws UnknownEventTypeException + * + * @deprecated */ public function testAssertionSucceeded(mixed $value, Constraint\Constraint $constraint, string $message): void { - if (!$this->hasSubscriberFor(Test\AssertionSucceeded::class)) { - return; - } - $this->dispatcher->dispatch( new Test\AssertionSucceeded( $this->telemetryInfo(), - (new Exporter)->export($value), - $constraint->toString(), + Exporter::export($value, $this->exportObjects), + $constraint->toString($this->exportObjects), $constraint->count(), $message, - ) + ), ); } /** * @throws InvalidArgumentException * @throws UnknownEventTypeException + * + * @deprecated */ public function testAssertionFailed(mixed $value, Constraint\Constraint $constraint, string $message): void { - if (!$this->hasSubscriberFor(Test\AssertionFailed::class)) { - return; - } - $this->dispatcher->dispatch( new Test\AssertionFailed( $this->telemetryInfo(), - (new Exporter)->export($value), - $constraint->toString(), + Exporter::export($value, $this->exportObjects), + $constraint->toString($this->exportObjects), $constraint->count(), $message, - ) + ), ); } @@ -447,8 +567,8 @@ final class DispatchingEmitter implements Emitter $this->dispatcher->dispatch( new Test\MockObjectCreated( $this->telemetryInfo(), - $className - ) + $className, + ), ); } @@ -463,8 +583,8 @@ final class DispatchingEmitter implements Emitter $this->dispatcher->dispatch( new Test\MockObjectForIntersectionOfInterfacesCreated( $this->telemetryInfo(), - $interfaces - ) + $interfaces, + ), ); } @@ -479,8 +599,8 @@ final class DispatchingEmitter implements Emitter $this->dispatcher->dispatch( new Test\MockObjectForTraitCreated( $this->telemetryInfo(), - $traitName - ) + $traitName, + ), ); } @@ -495,8 +615,8 @@ final class DispatchingEmitter implements Emitter $this->dispatcher->dispatch( new Test\MockObjectForAbstractClassCreated( $this->telemetryInfo(), - $className - ) + $className, + ), ); } @@ -517,8 +637,8 @@ final class DispatchingEmitter implements Emitter $mockClassName, $methods, $callOriginalConstructor, - $options - ) + $options, + ), ); } @@ -534,8 +654,8 @@ final class DispatchingEmitter implements Emitter new Test\PartialMockObjectCreated( $this->telemetryInfo(), $className, - ...$methodNames - ) + ...$methodNames, + ), ); } @@ -551,8 +671,8 @@ final class DispatchingEmitter implements Emitter new Test\TestProxyCreated( $this->telemetryInfo(), $className, - (new Exporter)->export($constructorArguments) - ) + Exporter::export($constructorArguments, $this->exportObjects), + ), ); } @@ -567,8 +687,8 @@ final class DispatchingEmitter implements Emitter $this->dispatcher->dispatch( new Test\TestStubCreated( $this->telemetryInfo(), - $className - ) + $className, + ), ); } @@ -583,8 +703,8 @@ final class DispatchingEmitter implements Emitter $this->dispatcher->dispatch( new Test\TestStubForIntersectionOfInterfacesCreated( $this->telemetryInfo(), - $interfaces - ) + $interfaces, + ), ); } @@ -598,8 +718,8 @@ final class DispatchingEmitter implements Emitter new Test\Errored( $this->telemetryInfo(), $test, - $throwable - ) + $throwable, + ), ); } @@ -614,8 +734,8 @@ final class DispatchingEmitter implements Emitter $this->telemetryInfo(), $test, $throwable, - $comparisonFailure - ) + $comparisonFailure, + ), ); } @@ -629,7 +749,7 @@ final class DispatchingEmitter implements Emitter new Test\Passed( $this->telemetryInfo(), $test, - ) + ), ); } @@ -643,8 +763,8 @@ final class DispatchingEmitter implements Emitter new Test\ConsideredRisky( $this->telemetryInfo(), $test, - $message - ) + $message, + ), ); } @@ -658,8 +778,8 @@ final class DispatchingEmitter implements Emitter new Test\MarkedIncomplete( $this->telemetryInfo(), $test, - $throwable - ) + $throwable, + ), ); } @@ -673,12 +793,14 @@ final class DispatchingEmitter implements Emitter new Test\Skipped( $this->telemetryInfo(), $test, - $message - ) + $message, + ), ); } /** + * @psalm-param non-empty-string $message + * * @throws InvalidArgumentException * @throws UnknownEventTypeException */ @@ -688,16 +810,20 @@ final class DispatchingEmitter implements Emitter new Test\PhpunitDeprecationTriggered( $this->telemetryInfo(), $test, - $message - ) + $message, + ), ); } /** + * @psalm-param non-empty-string $message + * @psalm-param non-empty-string $file + * @psalm-param positive-int $line + * * @throws InvalidArgumentException * @throws UnknownEventTypeException */ - public function testTriggeredPhpDeprecation(Code\Test $test, string $message, string $file, int $line): void + public function testTriggeredPhpDeprecation(Code\Test $test, string $message, string $file, int $line, bool $suppressed, bool $ignoredByBaseline, bool $ignoredByTest): void { $this->dispatcher->dispatch( new Test\PhpDeprecationTriggered( @@ -705,16 +831,23 @@ final class DispatchingEmitter implements Emitter $test, $message, $file, - $line - ) + $line, + $suppressed, + $ignoredByBaseline, + $ignoredByTest, + ), ); } /** + * @psalm-param non-empty-string $message + * @psalm-param non-empty-string $file + * @psalm-param positive-int $line + * * @throws InvalidArgumentException * @throws UnknownEventTypeException */ - public function testTriggeredDeprecation(Code\Test $test, string $message, string $file, int $line): void + public function testTriggeredDeprecation(Code\Test $test, string $message, string $file, int $line, bool $suppressed, bool $ignoredByBaseline, bool $ignoredByTest): void { $this->dispatcher->dispatch( new Test\DeprecationTriggered( @@ -722,16 +855,23 @@ final class DispatchingEmitter implements Emitter $test, $message, $file, - $line - ) + $line, + $suppressed, + $ignoredByBaseline, + $ignoredByTest, + ), ); } /** + * @psalm-param non-empty-string $message + * @psalm-param non-empty-string $file + * @psalm-param positive-int $line + * * @throws InvalidArgumentException * @throws UnknownEventTypeException */ - public function testTriggeredError(Code\Test $test, string $message, string $file, int $line): void + public function testTriggeredError(Code\Test $test, string $message, string $file, int $line, bool $suppressed): void { $this->dispatcher->dispatch( new Test\ErrorTriggered( @@ -739,16 +879,21 @@ final class DispatchingEmitter implements Emitter $test, $message, $file, - $line - ) + $line, + $suppressed, + ), ); } /** + * @psalm-param non-empty-string $message + * @psalm-param non-empty-string $file + * @psalm-param positive-int $line + * * @throws InvalidArgumentException * @throws UnknownEventTypeException */ - public function testTriggeredNotice(Code\Test $test, string $message, string $file, int $line): void + public function testTriggeredNotice(Code\Test $test, string $message, string $file, int $line, bool $suppressed, bool $ignoredByBaseline): void { $this->dispatcher->dispatch( new Test\NoticeTriggered( @@ -756,16 +901,22 @@ final class DispatchingEmitter implements Emitter $test, $message, $file, - $line - ) + $line, + $suppressed, + $ignoredByBaseline, + ), ); } /** + * @psalm-param non-empty-string $message + * @psalm-param non-empty-string $file + * @psalm-param positive-int $line + * * @throws InvalidArgumentException * @throws UnknownEventTypeException */ - public function testTriggeredPhpNotice(Code\Test $test, string $message, string $file, int $line): void + public function testTriggeredPhpNotice(Code\Test $test, string $message, string $file, int $line, bool $suppressed, bool $ignoredByBaseline): void { $this->dispatcher->dispatch( new Test\PhpNoticeTriggered( @@ -773,16 +924,22 @@ final class DispatchingEmitter implements Emitter $test, $message, $file, - $line - ) + $line, + $suppressed, + $ignoredByBaseline, + ), ); } /** + * @psalm-param non-empty-string $message + * @psalm-param non-empty-string $file + * @psalm-param positive-int $line + * * @throws InvalidArgumentException * @throws UnknownEventTypeException */ - public function testTriggeredWarning(Code\Test $test, string $message, string $file, int $line): void + public function testTriggeredWarning(Code\Test $test, string $message, string $file, int $line, bool $suppressed, bool $ignoredByBaseline): void { $this->dispatcher->dispatch( new Test\WarningTriggered( @@ -790,16 +947,22 @@ final class DispatchingEmitter implements Emitter $test, $message, $file, - $line - ) + $line, + $suppressed, + $ignoredByBaseline, + ), ); } /** + * @psalm-param non-empty-string $message + * @psalm-param non-empty-string $file + * @psalm-param positive-int $line + * * @throws InvalidArgumentException * @throws UnknownEventTypeException */ - public function testTriggeredPhpWarning(Code\Test $test, string $message, string $file, int $line): void + public function testTriggeredPhpWarning(Code\Test $test, string $message, string $file, int $line, bool $suppressed, bool $ignoredByBaseline): void { $this->dispatcher->dispatch( new Test\PhpWarningTriggered( @@ -807,12 +970,16 @@ final class DispatchingEmitter implements Emitter $test, $message, $file, - $line - ) + $line, + $suppressed, + $ignoredByBaseline, + ), ); } /** + * @psalm-param non-empty-string $message + * * @throws InvalidArgumentException * @throws UnknownEventTypeException */ @@ -823,11 +990,13 @@ final class DispatchingEmitter implements Emitter $this->telemetryInfo(), $test, $message, - ) + ), ); } /** + * @psalm-param non-empty-string $message + * * @throws InvalidArgumentException * @throws UnknownEventTypeException */ @@ -838,7 +1007,7 @@ final class DispatchingEmitter implements Emitter $this->telemetryInfo(), $test, $message, - ) + ), ); } @@ -853,8 +1022,8 @@ final class DispatchingEmitter implements Emitter $this->dispatcher->dispatch( new Test\PrintedUnexpectedOutput( $this->telemetryInfo(), - $output - ) + $output, + ), ); } @@ -868,8 +1037,8 @@ final class DispatchingEmitter implements Emitter new Test\Finished( $this->telemetryInfo(), $test, - $numberOfAssertionsPerformed - ) + $numberOfAssertionsPerformed, + ), ); } @@ -879,14 +1048,14 @@ final class DispatchingEmitter implements Emitter * @throws InvalidArgumentException * @throws UnknownEventTypeException */ - public function testPostConditionCalled(string $testClassName, Code\ClassMethod $calledMethod): void + public function postConditionCalled(string $testClassName, ClassMethod $calledMethod): void { $this->dispatcher->dispatch( new Test\PostConditionCalled( $this->telemetryInfo(), $testClassName, - $calledMethod - ) + $calledMethod, + ), ); } @@ -896,14 +1065,32 @@ final class DispatchingEmitter implements Emitter * @throws InvalidArgumentException * @throws UnknownEventTypeException */ - public function testPostConditionFinished(string $testClassName, Code\ClassMethod ...$calledMethods): void + public function postConditionErrored(string $testClassName, ClassMethod $calledMethod, Throwable $throwable): void + { + $this->dispatcher->dispatch( + new Test\PostConditionErrored( + $this->telemetryInfo(), + $testClassName, + $calledMethod, + $throwable, + ), + ); + } + + /** + * @psalm-param class-string $testClassName + * + * @throws InvalidArgumentException + * @throws UnknownEventTypeException + */ + public function postConditionFinished(string $testClassName, ClassMethod ...$calledMethods): void { $this->dispatcher->dispatch( new Test\PostConditionFinished( $this->telemetryInfo(), $testClassName, - ...$calledMethods - ) + ...$calledMethods, + ), ); } @@ -913,14 +1100,14 @@ final class DispatchingEmitter implements Emitter * @throws InvalidArgumentException * @throws UnknownEventTypeException */ - public function testAfterTestMethodCalled(string $testClassName, Code\ClassMethod $calledMethod): void + public function afterTestMethodCalled(string $testClassName, ClassMethod $calledMethod): void { $this->dispatcher->dispatch( new Test\AfterTestMethodCalled( $this->telemetryInfo(), $testClassName, - $calledMethod - ) + $calledMethod, + ), ); } @@ -930,14 +1117,32 @@ final class DispatchingEmitter implements Emitter * @throws InvalidArgumentException * @throws UnknownEventTypeException */ - public function testAfterTestMethodFinished(string $testClassName, Code\ClassMethod ...$calledMethods): void + public function afterTestMethodErrored(string $testClassName, ClassMethod $calledMethod, Throwable $throwable): void + { + $this->dispatcher->dispatch( + new Test\AfterTestMethodErrored( + $this->telemetryInfo(), + $testClassName, + $calledMethod, + $throwable, + ), + ); + } + + /** + * @psalm-param class-string $testClassName + * + * @throws InvalidArgumentException + * @throws UnknownEventTypeException + */ + public function afterTestMethodFinished(string $testClassName, ClassMethod ...$calledMethods): void { $this->dispatcher->dispatch( new Test\AfterTestMethodFinished( $this->telemetryInfo(), $testClassName, - ...$calledMethods - ) + ...$calledMethods, + ), ); } @@ -947,14 +1152,14 @@ final class DispatchingEmitter implements Emitter * @throws InvalidArgumentException * @throws UnknownEventTypeException */ - public function testAfterLastTestMethodCalled(string $testClassName, Code\ClassMethod $calledMethod): void + public function afterLastTestMethodCalled(string $testClassName, ClassMethod $calledMethod): void { $this->dispatcher->dispatch( new Test\AfterLastTestMethodCalled( $this->telemetryInfo(), $testClassName, - $calledMethod - ) + $calledMethod, + ), ); } @@ -964,14 +1169,32 @@ final class DispatchingEmitter implements Emitter * @throws InvalidArgumentException * @throws UnknownEventTypeException */ - public function testAfterLastTestMethodFinished(string $testClassName, Code\ClassMethod ...$calledMethods): void + public function afterLastTestMethodErrored(string $testClassName, ClassMethod $calledMethod, Throwable $throwable): void + { + $this->dispatcher->dispatch( + new Test\AfterLastTestMethodErrored( + $this->telemetryInfo(), + $testClassName, + $calledMethod, + $throwable, + ), + ); + } + + /** + * @psalm-param class-string $testClassName + * + * @throws InvalidArgumentException + * @throws UnknownEventTypeException + */ + public function afterLastTestMethodFinished(string $testClassName, ClassMethod ...$calledMethods): void { $this->dispatcher->dispatch( new Test\AfterLastTestMethodFinished( $this->telemetryInfo(), $testClassName, - ...$calledMethods - ) + ...$calledMethods, + ), ); } @@ -985,7 +1208,7 @@ final class DispatchingEmitter implements Emitter new TestSuiteFinished( $this->telemetryInfo(), $testSuite, - ) + ), ); } @@ -993,13 +1216,13 @@ final class DispatchingEmitter implements Emitter * @throws InvalidArgumentException * @throws UnknownEventTypeException */ - public function testRunnerTriggeredDeprecation(string $message): void + public function testRunnerTriggeredPhpunitDeprecation(string $message): void { $this->dispatcher->dispatch( new TestRunner\DeprecationTriggered( $this->telemetryInfo(), - $message - ) + $message, + ), ); } @@ -1007,13 +1230,35 @@ final class DispatchingEmitter implements Emitter * @throws InvalidArgumentException * @throws UnknownEventTypeException */ - public function testRunnerTriggeredWarning(string $message): void + public function testRunnerTriggeredPhpunitWarning(string $message): void { $this->dispatcher->dispatch( new TestRunner\WarningTriggered( $this->telemetryInfo(), - $message - ) + $message, + ), + ); + } + + /** + * @throws InvalidArgumentException + * @throws UnknownEventTypeException + */ + public function testRunnerEnabledGarbageCollection(): void + { + $this->dispatcher->dispatch( + new TestRunner\GarbageCollectionEnabled($this->telemetryInfo()), + ); + } + + /** + * @throws InvalidArgumentException + * @throws UnknownEventTypeException + */ + public function testRunnerExecutionAborted(): void + { + $this->dispatcher->dispatch( + new TestRunner\ExecutionAborted($this->telemetryInfo()), ); } @@ -1024,7 +1269,7 @@ final class DispatchingEmitter implements Emitter public function testRunnerExecutionFinished(): void { $this->dispatcher->dispatch( - new TestRunner\ExecutionFinished($this->telemetryInfo()) + new TestRunner\ExecutionFinished($this->telemetryInfo()), ); } @@ -1035,7 +1280,7 @@ final class DispatchingEmitter implements Emitter public function testRunnerFinished(): void { $this->dispatcher->dispatch( - new TestRunner\Finished($this->telemetryInfo()) + new TestRunner\Finished($this->telemetryInfo()), ); } @@ -1048,8 +1293,8 @@ final class DispatchingEmitter implements Emitter $this->dispatcher->dispatch( new Application\Finished( $this->telemetryInfo(), - $shellExitCode - ) + $shellExitCode, + ), ); } @@ -1072,16 +1317,4 @@ final class DispatchingEmitter implements Emitter return $info; } - - /** - * @psalm-param class-string $className - */ - private function hasSubscriberFor(string $className): bool - { - if (!$this->dispatcher instanceof SubscribableDispatcher) { - return true; - } - - return $this->dispatcher->hasSubscriberFor($className); - } } diff --git a/vendor/phpunit/phpunit/src/Event/Emitter/Emitter.php b/vendor/phpunit/phpunit/src/Event/Emitter/Emitter.php index 19d7b955..4aaae398 100644 --- a/vendor/phpunit/phpunit/src/Event/Emitter/Emitter.php +++ b/vendor/phpunit/phpunit/src/Event/Emitter/Emitter.php @@ -9,6 +9,7 @@ */ namespace PHPUnit\Event; +use PHPUnit\Event\Code\ClassMethod; use PHPUnit\Event\Code\ComparisonFailure; use PHPUnit\Event\Code\Throwable; use PHPUnit\Event\TestSuite\TestSuite; @@ -16,10 +17,22 @@ use PHPUnit\Framework\Constraint; use PHPUnit\TextUI\Configuration\Configuration; /** - * @internal This class is not covered by the backward compatibility promise for PHPUnit + * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit + * + * @internal This interface is not covered by the backward compatibility promise for PHPUnit */ interface Emitter { + /** + * @deprecated + */ + public function exportObjects(): void; + + /** + * @deprecated + */ + public function exportsObjects(): bool; + public function applicationStarted(): void; public function testRunnerStarted(): void; @@ -36,6 +49,10 @@ interface Emitter */ public function testRunnerBootstrappedExtension(string $className, array $parameters): void; + public function dataProviderMethodCalled(ClassMethod $testMethod, ClassMethod $dataProviderMethod): void; + + public function dataProviderMethodFinished(ClassMethod $testMethod, ClassMethod ...$calledMethods): void; + public function testSuiteLoaded(TestSuite $testSuite): void; public function testSuiteFiltered(TestSuite $testSuite): void; @@ -46,46 +63,62 @@ interface Emitter public function testRunnerExecutionStarted(TestSuite $testSuite): void; + public function testRunnerDisabledGarbageCollection(): void; + + public function testRunnerTriggeredGarbageCollection(): void; + public function testSuiteSkipped(TestSuite $testSuite, string $message): void; public function testSuiteStarted(TestSuite $testSuite): void; public function testPreparationStarted(Code\Test $test): void; - /** - * @psalm-param class-string $testClassName - */ - public function testBeforeFirstTestMethodCalled(string $testClassName, Code\ClassMethod $calledMethod): void; + public function testPreparationFailed(Code\Test $test): void; /** * @psalm-param class-string $testClassName */ - public function testBeforeFirstTestMethodErrored(string $testClassName, Code\ClassMethod $calledMethod, Throwable $throwable): void; + public function beforeFirstTestMethodCalled(string $testClassName, ClassMethod $calledMethod): void; /** * @psalm-param class-string $testClassName */ - public function testBeforeFirstTestMethodFinished(string $testClassName, Code\ClassMethod ...$calledMethods): void; + public function beforeFirstTestMethodErrored(string $testClassName, ClassMethod $calledMethod, Throwable $throwable): void; /** * @psalm-param class-string $testClassName */ - public function testBeforeTestMethodCalled(string $testClassName, Code\ClassMethod $calledMethod): void; + public function beforeFirstTestMethodFinished(string $testClassName, ClassMethod ...$calledMethods): void; /** * @psalm-param class-string $testClassName */ - public function testBeforeTestMethodFinished(string $testClassName, Code\ClassMethod ...$calledMethods): void; + public function beforeTestMethodCalled(string $testClassName, ClassMethod $calledMethod): void; /** * @psalm-param class-string $testClassName */ - public function testPreConditionCalled(string $testClassName, Code\ClassMethod $calledMethod): void; + public function beforeTestMethodErrored(string $testClassName, ClassMethod $calledMethod, Throwable $throwable): void; /** * @psalm-param class-string $testClassName */ - public function testPreConditionFinished(string $testClassName, Code\ClassMethod ...$calledMethods): void; + public function beforeTestMethodFinished(string $testClassName, ClassMethod ...$calledMethods): void; + + /** + * @psalm-param class-string $testClassName + */ + public function preConditionCalled(string $testClassName, ClassMethod $calledMethod): void; + + /** + * @psalm-param class-string $testClassName + */ + public function preConditionErrored(string $testClassName, ClassMethod $calledMethod, Throwable $throwable): void; + + /** + * @psalm-param class-string $testClassName + */ + public function preConditionFinished(string $testClassName, ClassMethod ...$calledMethods): void; public function testPrepared(Code\Test $test): void; @@ -94,8 +127,14 @@ interface Emitter */ public function testRegisteredComparator(string $className): void; + /** + * @deprecated + */ public function testAssertionSucceeded(mixed $value, Constraint\Constraint $constraint, string $message): void; + /** + * @deprecated + */ public function testAssertionFailed(mixed $value, Constraint\Constraint $constraint, string $message): void; /** @@ -150,30 +189,80 @@ interface Emitter public function testPassed(Code\Test $test): void; + /** + * @psalm-param non-empty-string $message + */ public function testConsideredRisky(Code\Test $test, string $message): void; public function testMarkedAsIncomplete(Code\Test $test, Throwable $throwable): void; + /** + * @psalm-param non-empty-string $message + */ public function testSkipped(Code\Test $test, string $message): void; + /** + * @psalm-param non-empty-string $message + */ public function testTriggeredPhpunitDeprecation(Code\Test $test, string $message): void; - public function testTriggeredPhpDeprecation(Code\Test $test, string $message, string $file, int $line): void; + /** + * @psalm-param non-empty-string $message + * @psalm-param non-empty-string $file + * @psalm-param positive-int $line + */ + public function testTriggeredPhpDeprecation(Code\Test $test, string $message, string $file, int $line, bool $suppressed, bool $ignoredByBaseline, bool $ignoredByTest): void; - public function testTriggeredDeprecation(Code\Test $test, string $message, string $file, int $line): void; + /** + * @psalm-param non-empty-string $message + * @psalm-param non-empty-string $file + * @psalm-param positive-int $line + */ + public function testTriggeredDeprecation(Code\Test $test, string $message, string $file, int $line, bool $suppressed, bool $ignoredByBaseline, bool $ignoredByTest): void; - public function testTriggeredError(Code\Test $test, string $message, string $file, int $line): void; + /** + * @psalm-param non-empty-string $message + * @psalm-param non-empty-string $file + * @psalm-param positive-int $line + */ + public function testTriggeredError(Code\Test $test, string $message, string $file, int $line, bool $suppressed): void; - public function testTriggeredNotice(Code\Test $test, string $message, string $file, int $line): void; + /** + * @psalm-param non-empty-string $message + * @psalm-param non-empty-string $file + * @psalm-param positive-int $line + */ + public function testTriggeredNotice(Code\Test $test, string $message, string $file, int $line, bool $suppressed, bool $ignoredByBaseline): void; - public function testTriggeredPhpNotice(Code\Test $test, string $message, string $file, int $line): void; + /** + * @psalm-param non-empty-string $message + * @psalm-param non-empty-string $file + * @psalm-param positive-int $line + */ + public function testTriggeredPhpNotice(Code\Test $test, string $message, string $file, int $line, bool $suppressed, bool $ignoredByBaseline): void; - public function testTriggeredWarning(Code\Test $test, string $message, string $file, int $line): void; + /** + * @psalm-param non-empty-string $message + * @psalm-param non-empty-string $file + * @psalm-param positive-int $line + */ + public function testTriggeredWarning(Code\Test $test, string $message, string $file, int $line, bool $suppressed, bool $ignoredByBaseline): void; - public function testTriggeredPhpWarning(Code\Test $test, string $message, string $file, int $line): void; + /** + * @psalm-param non-empty-string $message + * @psalm-param non-empty-string $file + * @psalm-param positive-int $line + */ + public function testTriggeredPhpWarning(Code\Test $test, string $message, string $file, int $line, bool $suppressed, bool $ignoredByBaseline): void; + /** + * @psalm-param non-empty-string $message + */ public function testTriggeredPhpunitError(Code\Test $test, string $message): void; + /** + * @psalm-param non-empty-string $message + */ public function testTriggeredPhpunitWarning(Code\Test $test, string $message): void; /** @@ -186,38 +275,57 @@ interface Emitter /** * @psalm-param class-string $testClassName */ - public function testPostConditionCalled(string $testClassName, Code\ClassMethod $calledMethod): void; + public function postConditionCalled(string $testClassName, ClassMethod $calledMethod): void; /** * @psalm-param class-string $testClassName */ - public function testPostConditionFinished(string $testClassName, Code\ClassMethod ...$calledMethods): void; + public function postConditionErrored(string $testClassName, ClassMethod $calledMethod, Throwable $throwable): void; /** * @psalm-param class-string $testClassName */ - public function testAfterTestMethodCalled(string $testClassName, Code\ClassMethod $calledMethod): void; + public function postConditionFinished(string $testClassName, ClassMethod ...$calledMethods): void; /** * @psalm-param class-string $testClassName */ - public function testAfterTestMethodFinished(string $testClassName, Code\ClassMethod ...$calledMethods): void; + public function afterTestMethodCalled(string $testClassName, ClassMethod $calledMethod): void; /** * @psalm-param class-string $testClassName */ - public function testAfterLastTestMethodCalled(string $testClassName, Code\ClassMethod $calledMethod): void; + public function afterTestMethodErrored(string $testClassName, ClassMethod $calledMethod, Throwable $throwable): void; /** * @psalm-param class-string $testClassName */ - public function testAfterLastTestMethodFinished(string $testClassName, Code\ClassMethod ...$calledMethods): void; + public function afterTestMethodFinished(string $testClassName, ClassMethod ...$calledMethods): void; + + /** + * @psalm-param class-string $testClassName + */ + public function afterLastTestMethodCalled(string $testClassName, ClassMethod $calledMethod): void; + + /** + * @psalm-param class-string $testClassName + */ + public function afterLastTestMethodErrored(string $testClassName, ClassMethod $calledMethod, Throwable $throwable): void; + + /** + * @psalm-param class-string $testClassName + */ + public function afterLastTestMethodFinished(string $testClassName, ClassMethod ...$calledMethods): void; public function testSuiteFinished(TestSuite $testSuite): void; - public function testRunnerTriggeredDeprecation(string $message): void; + public function testRunnerTriggeredPhpunitDeprecation(string $message): void; - public function testRunnerTriggeredWarning(string $message): void; + public function testRunnerTriggeredPhpunitWarning(string $message): void; + + public function testRunnerEnabledGarbageCollection(): void; + + public function testRunnerExecutionAborted(): void; public function testRunnerExecutionFinished(): void; diff --git a/vendor/phpunit/phpunit/src/Event/Events/Application/Finished.php b/vendor/phpunit/phpunit/src/Event/Events/Application/Finished.php index e4b1e3d4..e196c4f6 100644 --- a/vendor/phpunit/phpunit/src/Event/Events/Application/Finished.php +++ b/vendor/phpunit/phpunit/src/Event/Events/Application/Finished.php @@ -43,7 +43,7 @@ final class Finished implements Event { return sprintf( 'PHPUnit Finished (Shell Exit Code: %d)', - $this->shellExitCode + $this->shellExitCode, ); } } diff --git a/vendor/phpunit/phpunit/src/Event/Events/Application/Started.php b/vendor/phpunit/phpunit/src/Event/Events/Application/Started.php index 04dfb5f6..da570a02 100644 --- a/vendor/phpunit/phpunit/src/Event/Events/Application/Started.php +++ b/vendor/phpunit/phpunit/src/Event/Events/Application/Started.php @@ -44,7 +44,7 @@ final class Started implements Event { return sprintf( 'PHPUnit Started (%s)', - $this->runtime->asString() + $this->runtime->asString(), ); } } diff --git a/vendor/phpunit/phpunit/src/Event/Events/Test/Assertion/AssertionFailed.php b/vendor/phpunit/phpunit/src/Event/Events/Test/Assertion/AssertionFailed.php index d9eec86e..68954f20 100644 --- a/vendor/phpunit/phpunit/src/Event/Events/Test/Assertion/AssertionFailed.php +++ b/vendor/phpunit/phpunit/src/Event/Events/Test/Assertion/AssertionFailed.php @@ -15,6 +15,8 @@ use PHPUnit\Event\Telemetry; /** * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit + * + * @deprecated */ final class AssertionFailed implements Event { @@ -60,7 +62,7 @@ final class AssertionFailed implements Event if (!empty($this->message)) { $message = sprintf( ', Message: %s', - $this->message + $this->message, ); } @@ -68,7 +70,7 @@ final class AssertionFailed implements Event 'Assertion Failed (Constraint: %s, Value: %s%s)', $this->constraint, $this->value, - $message + $message, ); } } diff --git a/vendor/phpunit/phpunit/src/Event/Events/Test/Assertion/AssertionFailedSubscriber.php b/vendor/phpunit/phpunit/src/Event/Events/Test/Assertion/AssertionFailedSubscriber.php index a14cd5f5..c569bcc2 100644 --- a/vendor/phpunit/phpunit/src/Event/Events/Test/Assertion/AssertionFailedSubscriber.php +++ b/vendor/phpunit/phpunit/src/Event/Events/Test/Assertion/AssertionFailedSubscriber.php @@ -13,6 +13,8 @@ use PHPUnit\Event\Subscriber; /** * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit + * + * @deprecated */ interface AssertionFailedSubscriber extends Subscriber { diff --git a/vendor/phpunit/phpunit/src/Event/Events/Test/Assertion/AssertionSucceeded.php b/vendor/phpunit/phpunit/src/Event/Events/Test/Assertion/AssertionSucceeded.php index b91a7a79..d4f85484 100644 --- a/vendor/phpunit/phpunit/src/Event/Events/Test/Assertion/AssertionSucceeded.php +++ b/vendor/phpunit/phpunit/src/Event/Events/Test/Assertion/AssertionSucceeded.php @@ -15,6 +15,8 @@ use PHPUnit\Event\Telemetry; /** * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit + * + * @deprecated */ final class AssertionSucceeded implements Event { @@ -60,7 +62,7 @@ final class AssertionSucceeded implements Event if (!empty($this->message)) { $message = sprintf( ', Message: %s', - $this->message + $this->message, ); } @@ -68,7 +70,7 @@ final class AssertionSucceeded implements Event 'Assertion Succeeded (Constraint: %s, Value: %s%s)', $this->constraint, $this->value, - $message + $message, ); } } diff --git a/vendor/phpunit/phpunit/src/Event/Events/Test/Assertion/AssertionSucceededSubscriber.php b/vendor/phpunit/phpunit/src/Event/Events/Test/Assertion/AssertionSucceededSubscriber.php index 535860a3..59d72c0f 100644 --- a/vendor/phpunit/phpunit/src/Event/Events/Test/Assertion/AssertionSucceededSubscriber.php +++ b/vendor/phpunit/phpunit/src/Event/Events/Test/Assertion/AssertionSucceededSubscriber.php @@ -13,6 +13,8 @@ use PHPUnit\Event\Subscriber; /** * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit + * + * @deprecated */ interface AssertionSucceededSubscriber extends Subscriber { diff --git a/vendor/phpunit/phpunit/src/Event/Events/Test/ComparatorRegistered.php b/vendor/phpunit/phpunit/src/Event/Events/Test/ComparatorRegistered.php index e3ec59e4..9e83d3d2 100644 --- a/vendor/phpunit/phpunit/src/Event/Events/Test/ComparatorRegistered.php +++ b/vendor/phpunit/phpunit/src/Event/Events/Test/ComparatorRegistered.php @@ -53,7 +53,7 @@ final class ComparatorRegistered implements Event { return sprintf( 'Comparator Registered (%s)', - $this->className + $this->className, ); } } diff --git a/vendor/phpunit/phpunit/src/Event/Events/Test/HookMethod/AfterLastTestMethodCalled.php b/vendor/phpunit/phpunit/src/Event/Events/Test/HookMethod/AfterLastTestMethodCalled.php index 9883a23a..fec2a79e 100644 --- a/vendor/phpunit/phpunit/src/Event/Events/Test/HookMethod/AfterLastTestMethodCalled.php +++ b/vendor/phpunit/phpunit/src/Event/Events/Test/HookMethod/AfterLastTestMethodCalled.php @@ -62,7 +62,7 @@ final class AfterLastTestMethodCalled implements Event return sprintf( 'After Last Test Method Called (%s::%s)', $this->calledMethod->className(), - $this->calledMethod->methodName() + $this->calledMethod->methodName(), ); } } diff --git a/vendor/phpunit/phpunit/src/Event/Events/Test/HookMethod/AfterLastTestMethodFinished.php b/vendor/phpunit/phpunit/src/Event/Events/Test/HookMethod/AfterLastTestMethodFinished.php index 5ebbe142..40a6c9fc 100644 --- a/vendor/phpunit/phpunit/src/Event/Events/Test/HookMethod/AfterLastTestMethodFinished.php +++ b/vendor/phpunit/phpunit/src/Event/Events/Test/HookMethod/AfterLastTestMethodFinished.php @@ -73,7 +73,7 @@ final class AfterLastTestMethodFinished implements Event $buffer .= sprintf( PHP_EOL . '- %s::%s', $calledMethod->className(), - $calledMethod->methodName() + $calledMethod->methodName(), ); } diff --git a/vendor/phpunit/phpunit/src/Event/Events/Test/HookMethod/AfterTestMethodCalled.php b/vendor/phpunit/phpunit/src/Event/Events/Test/HookMethod/AfterTestMethodCalled.php index c6412206..52afc14c 100644 --- a/vendor/phpunit/phpunit/src/Event/Events/Test/HookMethod/AfterTestMethodCalled.php +++ b/vendor/phpunit/phpunit/src/Event/Events/Test/HookMethod/AfterTestMethodCalled.php @@ -62,7 +62,7 @@ final class AfterTestMethodCalled implements Event return sprintf( 'After Test Method Called (%s::%s)', $this->calledMethod->className(), - $this->calledMethod->methodName() + $this->calledMethod->methodName(), ); } } diff --git a/vendor/phpunit/phpunit/src/Event/Events/Test/HookMethod/AfterTestMethodFinished.php b/vendor/phpunit/phpunit/src/Event/Events/Test/HookMethod/AfterTestMethodFinished.php index bc326668..e934eea8 100644 --- a/vendor/phpunit/phpunit/src/Event/Events/Test/HookMethod/AfterTestMethodFinished.php +++ b/vendor/phpunit/phpunit/src/Event/Events/Test/HookMethod/AfterTestMethodFinished.php @@ -73,7 +73,7 @@ final class AfterTestMethodFinished implements Event $buffer .= sprintf( PHP_EOL . '- %s::%s', $calledMethod->className(), - $calledMethod->methodName() + $calledMethod->methodName(), ); } diff --git a/vendor/phpunit/phpunit/src/Event/Events/Test/HookMethod/BeforeFirstTestMethodCalled.php b/vendor/phpunit/phpunit/src/Event/Events/Test/HookMethod/BeforeFirstTestMethodCalled.php index c1fc9043..da28f2bf 100644 --- a/vendor/phpunit/phpunit/src/Event/Events/Test/HookMethod/BeforeFirstTestMethodCalled.php +++ b/vendor/phpunit/phpunit/src/Event/Events/Test/HookMethod/BeforeFirstTestMethodCalled.php @@ -62,7 +62,7 @@ final class BeforeFirstTestMethodCalled implements Event return sprintf( 'Before First Test Method Called (%s::%s)', $this->calledMethod->className(), - $this->calledMethod->methodName() + $this->calledMethod->methodName(), ); } } diff --git a/vendor/phpunit/phpunit/src/Event/Events/Test/HookMethod/BeforeFirstTestMethodErrored.php b/vendor/phpunit/phpunit/src/Event/Events/Test/HookMethod/BeforeFirstTestMethodErrored.php index 9f6f0686..959b1350 100644 --- a/vendor/phpunit/phpunit/src/Event/Events/Test/HookMethod/BeforeFirstTestMethodErrored.php +++ b/vendor/phpunit/phpunit/src/Event/Events/Test/HookMethod/BeforeFirstTestMethodErrored.php @@ -9,6 +9,7 @@ */ namespace PHPUnit\Event\Test; +use const PHP_EOL; use function sprintf; use PHPUnit\Event\Code; use PHPUnit\Event\Code\Throwable; @@ -77,7 +78,7 @@ final class BeforeFirstTestMethodErrored implements Event 'Before First Test Method Errored (%s::%s)%s', $this->calledMethod->className(), $this->calledMethod->methodName(), - $message + $message, ); } } diff --git a/vendor/phpunit/phpunit/src/Event/Events/Test/HookMethod/BeforeFirstTestMethodFinished.php b/vendor/phpunit/phpunit/src/Event/Events/Test/HookMethod/BeforeFirstTestMethodFinished.php index 0f3ff2b7..fba563d7 100644 --- a/vendor/phpunit/phpunit/src/Event/Events/Test/HookMethod/BeforeFirstTestMethodFinished.php +++ b/vendor/phpunit/phpunit/src/Event/Events/Test/HookMethod/BeforeFirstTestMethodFinished.php @@ -73,7 +73,7 @@ final class BeforeFirstTestMethodFinished implements Event $buffer .= sprintf( PHP_EOL . '- %s::%s', $calledMethod->className(), - $calledMethod->methodName() + $calledMethod->methodName(), ); } diff --git a/vendor/phpunit/phpunit/src/Event/Events/Test/HookMethod/BeforeTestMethodCalled.php b/vendor/phpunit/phpunit/src/Event/Events/Test/HookMethod/BeforeTestMethodCalled.php index dca36109..3b300fa3 100644 --- a/vendor/phpunit/phpunit/src/Event/Events/Test/HookMethod/BeforeTestMethodCalled.php +++ b/vendor/phpunit/phpunit/src/Event/Events/Test/HookMethod/BeforeTestMethodCalled.php @@ -62,7 +62,7 @@ final class BeforeTestMethodCalled implements Event return sprintf( 'Before Test Method Called (%s::%s)', $this->calledMethod->className(), - $this->calledMethod->methodName() + $this->calledMethod->methodName(), ); } } diff --git a/vendor/phpunit/phpunit/src/Event/Events/Test/HookMethod/BeforeTestMethodFinished.php b/vendor/phpunit/phpunit/src/Event/Events/Test/HookMethod/BeforeTestMethodFinished.php index ded4b0b0..f84b51bb 100644 --- a/vendor/phpunit/phpunit/src/Event/Events/Test/HookMethod/BeforeTestMethodFinished.php +++ b/vendor/phpunit/phpunit/src/Event/Events/Test/HookMethod/BeforeTestMethodFinished.php @@ -73,7 +73,7 @@ final class BeforeTestMethodFinished implements Event $buffer .= sprintf( PHP_EOL . '- %s::%s', $calledMethod->className(), - $calledMethod->methodName() + $calledMethod->methodName(), ); } diff --git a/vendor/phpunit/phpunit/src/Event/Events/Test/HookMethod/PostConditionCalled.php b/vendor/phpunit/phpunit/src/Event/Events/Test/HookMethod/PostConditionCalled.php index 2cc2c9a8..e7b6c435 100644 --- a/vendor/phpunit/phpunit/src/Event/Events/Test/HookMethod/PostConditionCalled.php +++ b/vendor/phpunit/phpunit/src/Event/Events/Test/HookMethod/PostConditionCalled.php @@ -62,7 +62,7 @@ final class PostConditionCalled implements Event return sprintf( 'Post Condition Method Called (%s::%s)', $this->calledMethod->className(), - $this->calledMethod->methodName() + $this->calledMethod->methodName(), ); } } diff --git a/vendor/phpunit/phpunit/src/Event/Events/Test/HookMethod/PostConditionFinished.php b/vendor/phpunit/phpunit/src/Event/Events/Test/HookMethod/PostConditionFinished.php index 6e5d45e8..fff07ce7 100644 --- a/vendor/phpunit/phpunit/src/Event/Events/Test/HookMethod/PostConditionFinished.php +++ b/vendor/phpunit/phpunit/src/Event/Events/Test/HookMethod/PostConditionFinished.php @@ -73,7 +73,7 @@ final class PostConditionFinished implements Event $buffer .= sprintf( PHP_EOL . '- %s::%s', $calledMethod->className(), - $calledMethod->methodName() + $calledMethod->methodName(), ); } diff --git a/vendor/phpunit/phpunit/src/Event/Events/Test/HookMethod/PreConditionCalled.php b/vendor/phpunit/phpunit/src/Event/Events/Test/HookMethod/PreConditionCalled.php index f6bb4c87..93752546 100644 --- a/vendor/phpunit/phpunit/src/Event/Events/Test/HookMethod/PreConditionCalled.php +++ b/vendor/phpunit/phpunit/src/Event/Events/Test/HookMethod/PreConditionCalled.php @@ -62,7 +62,7 @@ final class PreConditionCalled implements Event return sprintf( 'Pre Condition Method Called (%s::%s)', $this->calledMethod->className(), - $this->calledMethod->methodName() + $this->calledMethod->methodName(), ); } } diff --git a/vendor/phpunit/phpunit/src/Event/Events/Test/HookMethod/PreConditionFinished.php b/vendor/phpunit/phpunit/src/Event/Events/Test/HookMethod/PreConditionFinished.php index a70973af..05340796 100644 --- a/vendor/phpunit/phpunit/src/Event/Events/Test/HookMethod/PreConditionFinished.php +++ b/vendor/phpunit/phpunit/src/Event/Events/Test/HookMethod/PreConditionFinished.php @@ -73,7 +73,7 @@ final class PreConditionFinished implements Event $buffer .= sprintf( PHP_EOL . '- %s::%s', $calledMethod->className(), - $calledMethod->methodName() + $calledMethod->methodName(), ); } diff --git a/vendor/phpunit/phpunit/src/Event/Events/Test/Issue/ConsideredRisky.php b/vendor/phpunit/phpunit/src/Event/Events/Test/Issue/ConsideredRisky.php index 6cd79480..5b90d1bf 100644 --- a/vendor/phpunit/phpunit/src/Event/Events/Test/Issue/ConsideredRisky.php +++ b/vendor/phpunit/phpunit/src/Event/Events/Test/Issue/ConsideredRisky.php @@ -24,8 +24,15 @@ final class ConsideredRisky implements Event { private readonly Telemetry\Info $telemetryInfo; private readonly Code\Test $test; + + /** + * @psalm-var non-empty-string + */ private readonly string $message; + /** + * @psalm-param non-empty-string $message + */ public function __construct(Telemetry\Info $telemetryInfo, Code\Test $test, string $message) { $this->telemetryInfo = $telemetryInfo; @@ -43,6 +50,9 @@ final class ConsideredRisky implements Event return $this->test; } + /** + * @psalm-return non-empty-string + */ public function message(): string { return $this->message; diff --git a/vendor/phpunit/phpunit/src/Event/Events/Test/Issue/DeprecationTriggered.php b/vendor/phpunit/phpunit/src/Event/Events/Test/Issue/DeprecationTriggered.php index 08c109dc..b776732c 100644 --- a/vendor/phpunit/phpunit/src/Event/Events/Test/Issue/DeprecationTriggered.php +++ b/vendor/phpunit/phpunit/src/Event/Events/Test/Issue/DeprecationTriggered.php @@ -24,17 +24,40 @@ final class DeprecationTriggered implements Event { private readonly Telemetry\Info $telemetryInfo; private readonly Test $test; - private readonly string $message; - private readonly string $file; - private readonly int $line; - public function __construct(Telemetry\Info $telemetryInfo, Test $test, string $message, string $file, int $line) + /** + * @psalm-var non-empty-string + */ + private readonly string $message; + + /** + * @psalm-var non-empty-string + */ + private readonly string $file; + + /** + * @psalm-var positive-int + */ + private readonly int $line; + private readonly bool $suppressed; + private readonly bool $ignoredByBaseline; + private readonly bool $ignoredByTest; + + /** + * @psalm-param non-empty-string $message + * @psalm-param non-empty-string $file + * @psalm-param positive-int $line + */ + public function __construct(Telemetry\Info $telemetryInfo, Test $test, string $message, string $file, int $line, bool $suppressed, bool $ignoredByBaseline, bool $ignoredByTest) { - $this->telemetryInfo = $telemetryInfo; - $this->test = $test; - $this->message = $message; - $this->file = $file; - $this->line = $line; + $this->telemetryInfo = $telemetryInfo; + $this->test = $test; + $this->message = $message; + $this->file = $file; + $this->line = $line; + $this->suppressed = $suppressed; + $this->ignoredByBaseline = $ignoredByBaseline; + $this->ignoredByTest = $ignoredByTest; } public function telemetryInfo(): Telemetry\Info @@ -47,21 +70,45 @@ final class DeprecationTriggered implements Event return $this->test; } + /** + * @psalm-return non-empty-string + */ public function message(): string { return $this->message; } + /** + * @psalm-return non-empty-string + */ public function file(): string { return $this->file; } + /** + * @psalm-return positive-int + */ public function line(): int { return $this->line; } + public function wasSuppressed(): bool + { + return $this->suppressed; + } + + public function ignoredByBaseline(): bool + { + return $this->ignoredByBaseline; + } + + public function ignoredByTest(): bool + { + return $this->ignoredByTest; + } + public function asString(): string { $message = $this->message; @@ -70,10 +117,23 @@ final class DeprecationTriggered implements Event $message = PHP_EOL . $message; } + $status = ''; + + if ($this->ignoredByTest) { + $status = 'Test-Ignored '; + } elseif ($this->ignoredByBaseline) { + $status = 'Baseline-Ignored '; + } elseif ($this->suppressed) { + $status = 'Suppressed '; + } + return sprintf( - 'Test Triggered Deprecation (%s)%s', + 'Test Triggered %sDeprecation (%s) in %s:%d%s', + $status, $this->test->id(), - $message + $this->file, + $this->line, + $message, ); } } diff --git a/vendor/phpunit/phpunit/src/Event/Events/Test/Issue/ErrorTriggered.php b/vendor/phpunit/phpunit/src/Event/Events/Test/Issue/ErrorTriggered.php index 8668a98d..8dcca1f2 100644 --- a/vendor/phpunit/phpunit/src/Event/Events/Test/Issue/ErrorTriggered.php +++ b/vendor/phpunit/phpunit/src/Event/Events/Test/Issue/ErrorTriggered.php @@ -24,17 +24,36 @@ final class ErrorTriggered implements Event { private readonly Telemetry\Info $telemetryInfo; private readonly Test $test; - private readonly string $message; - private readonly string $file; - private readonly int $line; - public function __construct(Telemetry\Info $telemetryInfo, Test $test, string $message, string $file, int $line) + /** + * @psalm-var non-empty-string + */ + private readonly string $message; + + /** + * @psalm-var non-empty-string + */ + private readonly string $file; + + /** + * @psalm-var positive-int + */ + private readonly int $line; + private readonly bool $suppressed; + + /** + * @psalm-param non-empty-string $message + * @psalm-param non-empty-string $file + * @psalm-param positive-int $line + */ + public function __construct(Telemetry\Info $telemetryInfo, Test $test, string $message, string $file, int $line, bool $suppressed) { $this->telemetryInfo = $telemetryInfo; $this->test = $test; $this->message = $message; $this->file = $file; $this->line = $line; + $this->suppressed = $suppressed; } public function telemetryInfo(): Telemetry\Info @@ -47,21 +66,35 @@ final class ErrorTriggered implements Event return $this->test; } + /** + * @psalm-return non-empty-string + */ public function message(): string { return $this->message; } + /** + * @psalm-return non-empty-string + */ public function file(): string { return $this->file; } + /** + * @psalm-return positive-int + */ public function line(): int { return $this->line; } + public function wasSuppressed(): bool + { + return $this->suppressed; + } + public function asString(): string { $message = $this->message; @@ -71,9 +104,12 @@ final class ErrorTriggered implements Event } return sprintf( - 'Test Triggered Error (%s)%s', + 'Test Triggered %sError (%s) in %s:%d%s', + $this->wasSuppressed() ? 'Suppressed ' : '', $this->test->id(), - $message + $this->file, + $this->line, + $message, ); } } diff --git a/vendor/phpunit/phpunit/src/Event/Events/Test/Issue/NoticeTriggered.php b/vendor/phpunit/phpunit/src/Event/Events/Test/Issue/NoticeTriggered.php index 8baaff95..501af12b 100644 --- a/vendor/phpunit/phpunit/src/Event/Events/Test/Issue/NoticeTriggered.php +++ b/vendor/phpunit/phpunit/src/Event/Events/Test/Issue/NoticeTriggered.php @@ -24,17 +24,38 @@ final class NoticeTriggered implements Event { private readonly Telemetry\Info $telemetryInfo; private readonly Test $test; - private readonly string $message; - private readonly string $file; - private readonly int $line; - public function __construct(Telemetry\Info $telemetryInfo, Test $test, string $message, string $file, int $line) + /** + * @psalm-var non-empty-string + */ + private readonly string $message; + + /** + * @psalm-var non-empty-string + */ + private readonly string $file; + + /** + * @psalm-var positive-int + */ + private readonly int $line; + private readonly bool $suppressed; + private readonly bool $ignoredByBaseline; + + /** + * @psalm-param non-empty-string $message + * @psalm-param non-empty-string $file + * @psalm-param positive-int $line + */ + public function __construct(Telemetry\Info $telemetryInfo, Test $test, string $message, string $file, int $line, bool $suppressed, bool $ignoredByBaseline) { - $this->telemetryInfo = $telemetryInfo; - $this->test = $test; - $this->message = $message; - $this->file = $file; - $this->line = $line; + $this->telemetryInfo = $telemetryInfo; + $this->test = $test; + $this->message = $message; + $this->file = $file; + $this->line = $line; + $this->suppressed = $suppressed; + $this->ignoredByBaseline = $ignoredByBaseline; } public function telemetryInfo(): Telemetry\Info @@ -47,21 +68,40 @@ final class NoticeTriggered implements Event return $this->test; } + /** + * @psalm-return non-empty-string + */ public function message(): string { return $this->message; } + /** + * @psalm-return non-empty-string + */ public function file(): string { return $this->file; } + /** + * @psalm-return positive-int + */ public function line(): int { return $this->line; } + public function wasSuppressed(): bool + { + return $this->suppressed; + } + + public function ignoredByBaseline(): bool + { + return $this->ignoredByBaseline; + } + public function asString(): string { $message = $this->message; @@ -70,10 +110,21 @@ final class NoticeTriggered implements Event $message = PHP_EOL . $message; } + $status = ''; + + if ($this->ignoredByBaseline) { + $status = 'Baseline-Ignored '; + } elseif ($this->suppressed) { + $status = 'Suppressed '; + } + return sprintf( - 'Test Triggered Notice (%s)%s', + 'Test Triggered %sNotice (%s) in %s:%d%s', + $status, $this->test->id(), - $message + $this->file, + $this->line, + $message, ); } } diff --git a/vendor/phpunit/phpunit/src/Event/Events/Test/Issue/PhpDeprecationTriggered.php b/vendor/phpunit/phpunit/src/Event/Events/Test/Issue/PhpDeprecationTriggered.php index 1d80f89e..a9105e00 100644 --- a/vendor/phpunit/phpunit/src/Event/Events/Test/Issue/PhpDeprecationTriggered.php +++ b/vendor/phpunit/phpunit/src/Event/Events/Test/Issue/PhpDeprecationTriggered.php @@ -24,17 +24,40 @@ final class PhpDeprecationTriggered implements Event { private readonly Telemetry\Info $telemetryInfo; private readonly Test $test; - private readonly string $message; - private readonly string $file; - private readonly int $line; - public function __construct(Telemetry\Info $telemetryInfo, Test $test, string $message, string $file, int $line) + /** + * @psalm-var non-empty-string + */ + private readonly string $message; + + /** + * @psalm-var non-empty-string + */ + private readonly string $file; + + /** + * @psalm-var positive-int + */ + private readonly int $line; + private readonly bool $suppressed; + private readonly bool $ignoredByBaseline; + private readonly bool $ignoredByTest; + + /** + * @psalm-param non-empty-string $message + * @psalm-param non-empty-string $file + * @psalm-param positive-int $line + */ + public function __construct(Telemetry\Info $telemetryInfo, Test $test, string $message, string $file, int $line, bool $suppressed, bool $ignoredByBaseline, bool $ignoredByTest) { - $this->telemetryInfo = $telemetryInfo; - $this->test = $test; - $this->message = $message; - $this->file = $file; - $this->line = $line; + $this->telemetryInfo = $telemetryInfo; + $this->test = $test; + $this->message = $message; + $this->file = $file; + $this->line = $line; + $this->suppressed = $suppressed; + $this->ignoredByBaseline = $ignoredByBaseline; + $this->ignoredByTest = $ignoredByTest; } public function telemetryInfo(): Telemetry\Info @@ -47,21 +70,45 @@ final class PhpDeprecationTriggered implements Event return $this->test; } + /** + * @psalm-return non-empty-string + */ public function message(): string { return $this->message; } + /** + * @psalm-return non-empty-string + */ public function file(): string { return $this->file; } + /** + * @psalm-return positive-int + */ public function line(): int { return $this->line; } + public function wasSuppressed(): bool + { + return $this->suppressed; + } + + public function ignoredByBaseline(): bool + { + return $this->ignoredByBaseline; + } + + public function ignoredByTest(): bool + { + return $this->ignoredByTest; + } + public function asString(): string { $message = $this->message; @@ -70,10 +117,23 @@ final class PhpDeprecationTriggered implements Event $message = PHP_EOL . $message; } + $status = ''; + + if ($this->ignoredByTest) { + $status = 'Test-Ignored '; + } elseif ($this->ignoredByBaseline) { + $status = 'Baseline-Ignored '; + } elseif ($this->suppressed) { + $status = 'Suppressed '; + } + return sprintf( - 'Test Triggered PHP Deprecation (%s)%s', + 'Test Triggered %sPHP Deprecation (%s) in %s:%d%s', + $status, $this->test->id(), - $message + $this->file, + $this->line, + $message, ); } } diff --git a/vendor/phpunit/phpunit/src/Event/Events/Test/Issue/PhpNoticeTriggered.php b/vendor/phpunit/phpunit/src/Event/Events/Test/Issue/PhpNoticeTriggered.php index 7acbcc34..045c5efe 100644 --- a/vendor/phpunit/phpunit/src/Event/Events/Test/Issue/PhpNoticeTriggered.php +++ b/vendor/phpunit/phpunit/src/Event/Events/Test/Issue/PhpNoticeTriggered.php @@ -24,17 +24,38 @@ final class PhpNoticeTriggered implements Event { private readonly Telemetry\Info $telemetryInfo; private readonly Test $test; - private readonly string $message; - private readonly string $file; - private readonly int $line; - public function __construct(Telemetry\Info $telemetryInfo, Test $test, string $message, string $file, int $line) + /** + * @psalm-var non-empty-string + */ + private readonly string $message; + + /** + * @psalm-var non-empty-string + */ + private readonly string $file; + + /** + * @psalm-var positive-int + */ + private readonly int $line; + private readonly bool $suppressed; + private readonly bool $ignoredByBaseline; + + /** + * @psalm-param non-empty-string $message + * @psalm-param non-empty-string $file + * @psalm-param positive-int $line + */ + public function __construct(Telemetry\Info $telemetryInfo, Test $test, string $message, string $file, int $line, bool $suppressed, bool $ignoredByBaseline) { - $this->telemetryInfo = $telemetryInfo; - $this->test = $test; - $this->message = $message; - $this->file = $file; - $this->line = $line; + $this->telemetryInfo = $telemetryInfo; + $this->test = $test; + $this->message = $message; + $this->file = $file; + $this->line = $line; + $this->suppressed = $suppressed; + $this->ignoredByBaseline = $ignoredByBaseline; } public function telemetryInfo(): Telemetry\Info @@ -47,21 +68,40 @@ final class PhpNoticeTriggered implements Event return $this->test; } + /** + * @psalm-return non-empty-string + */ public function message(): string { return $this->message; } + /** + * @psalm-return non-empty-string + */ public function file(): string { return $this->file; } + /** + * @psalm-return positive-int + */ public function line(): int { return $this->line; } + public function wasSuppressed(): bool + { + return $this->suppressed; + } + + public function ignoredByBaseline(): bool + { + return $this->ignoredByBaseline; + } + public function asString(): string { $message = $this->message; @@ -70,10 +110,21 @@ final class PhpNoticeTriggered implements Event $message = PHP_EOL . $message; } + $status = ''; + + if ($this->ignoredByBaseline) { + $status = 'Baseline-Ignored '; + } elseif ($this->suppressed) { + $status = 'Suppressed '; + } + return sprintf( - 'Test Triggered PHP Notice (%s)%s', + 'Test Triggered %sPHP Notice (%s) in %s:%d%s', + $status, $this->test->id(), - $message + $this->file, + $this->line, + $message, ); } } diff --git a/vendor/phpunit/phpunit/src/Event/Events/Test/Issue/PhpWarningTriggered.php b/vendor/phpunit/phpunit/src/Event/Events/Test/Issue/PhpWarningTriggered.php index f3423375..9d2c2f29 100644 --- a/vendor/phpunit/phpunit/src/Event/Events/Test/Issue/PhpWarningTriggered.php +++ b/vendor/phpunit/phpunit/src/Event/Events/Test/Issue/PhpWarningTriggered.php @@ -24,17 +24,38 @@ final class PhpWarningTriggered implements Event { private readonly Telemetry\Info $telemetryInfo; private readonly Test $test; - private readonly string $message; - private readonly string $file; - private readonly int $line; - public function __construct(Telemetry\Info $telemetryInfo, Test $test, string $message, string $file, int $line) + /** + * @psalm-var non-empty-string + */ + private readonly string $message; + + /** + * @psalm-var non-empty-string + */ + private readonly string $file; + + /** + * @psalm-var positive-int + */ + private readonly int $line; + private readonly bool $suppressed; + private readonly bool $ignoredByBaseline; + + /** + * @psalm-param non-empty-string $message + * @psalm-param non-empty-string $file + * @psalm-param positive-int $line + */ + public function __construct(Telemetry\Info $telemetryInfo, Test $test, string $message, string $file, int $line, bool $suppressed, bool $ignoredByBaseline) { - $this->telemetryInfo = $telemetryInfo; - $this->test = $test; - $this->message = $message; - $this->file = $file; - $this->line = $line; + $this->telemetryInfo = $telemetryInfo; + $this->test = $test; + $this->message = $message; + $this->file = $file; + $this->line = $line; + $this->suppressed = $suppressed; + $this->ignoredByBaseline = $ignoredByBaseline; } public function telemetryInfo(): Telemetry\Info @@ -47,21 +68,40 @@ final class PhpWarningTriggered implements Event return $this->test; } + /** + * @psalm-return non-empty-string + */ public function message(): string { return $this->message; } + /** + * @psalm-return non-empty-string + */ public function file(): string { return $this->file; } + /** + * @psalm-return positive-int + */ public function line(): int { return $this->line; } + public function wasSuppressed(): bool + { + return $this->suppressed; + } + + public function ignoredByBaseline(): bool + { + return $this->ignoredByBaseline; + } + public function asString(): string { $message = $this->message; @@ -70,10 +110,21 @@ final class PhpWarningTriggered implements Event $message = PHP_EOL . $message; } + $status = ''; + + if ($this->ignoredByBaseline) { + $status = 'Baseline-Ignored '; + } elseif ($this->suppressed) { + $status = 'Suppressed '; + } + return sprintf( - 'Test Triggered PHP Warning (%s)%s', + 'Test Triggered %sPHP Warning (%s) in %s:%d%s', + $status, $this->test->id(), - $message + $this->file, + $this->line, + $message, ); } } diff --git a/vendor/phpunit/phpunit/src/Event/Events/Test/Issue/PhpunitDeprecationTriggered.php b/vendor/phpunit/phpunit/src/Event/Events/Test/Issue/PhpunitDeprecationTriggered.php index a70e1e6b..3b1162f4 100644 --- a/vendor/phpunit/phpunit/src/Event/Events/Test/Issue/PhpunitDeprecationTriggered.php +++ b/vendor/phpunit/phpunit/src/Event/Events/Test/Issue/PhpunitDeprecationTriggered.php @@ -24,8 +24,15 @@ final class PhpunitDeprecationTriggered implements Event { private readonly Telemetry\Info $telemetryInfo; private readonly Test $test; + + /** + * @psalm-var non-empty-string + */ private readonly string $message; + /** + * @psalm-param non-empty-string $message + */ public function __construct(Telemetry\Info $telemetryInfo, Test $test, string $message) { $this->telemetryInfo = $telemetryInfo; @@ -43,6 +50,9 @@ final class PhpunitDeprecationTriggered implements Event return $this->test; } + /** + * @psalm-return non-empty-string + */ public function message(): string { return $this->message; @@ -59,7 +69,7 @@ final class PhpunitDeprecationTriggered implements Event return sprintf( 'Test Triggered PHPUnit Deprecation (%s)%s', $this->test->id(), - $message + $message, ); } } diff --git a/vendor/phpunit/phpunit/src/Event/Events/Test/Issue/PhpunitErrorTriggered.php b/vendor/phpunit/phpunit/src/Event/Events/Test/Issue/PhpunitErrorTriggered.php index a86207f4..8e7d7d4d 100644 --- a/vendor/phpunit/phpunit/src/Event/Events/Test/Issue/PhpunitErrorTriggered.php +++ b/vendor/phpunit/phpunit/src/Event/Events/Test/Issue/PhpunitErrorTriggered.php @@ -11,6 +11,7 @@ namespace PHPUnit\Event\Test; use const PHP_EOL; use function sprintf; +use function trim; use PHPUnit\Event\Code\Test; use PHPUnit\Event\Event; use PHPUnit\Event\Telemetry; @@ -24,8 +25,15 @@ final class PhpunitErrorTriggered implements Event { private readonly Telemetry\Info $telemetryInfo; private readonly Test $test; + + /** + * @psalm-var non-empty-string + */ private readonly string $message; + /** + * @psalm-param non-empty-string $message + */ public function __construct(Telemetry\Info $telemetryInfo, Test $test, string $message) { $this->telemetryInfo = $telemetryInfo; @@ -43,6 +51,9 @@ final class PhpunitErrorTriggered implements Event return $this->test; } + /** + * @psalm-return non-empty-string + */ public function message(): string { return $this->message; @@ -50,7 +61,7 @@ final class PhpunitErrorTriggered implements Event public function asString(): string { - $message = $this->message; + $message = trim($this->message); if (!empty($message)) { $message = PHP_EOL . $message; @@ -59,7 +70,7 @@ final class PhpunitErrorTriggered implements Event return sprintf( 'Test Triggered PHPUnit Error (%s)%s', $this->test->id(), - $message + $message, ); } } diff --git a/vendor/phpunit/phpunit/src/Event/Events/Test/Issue/PhpunitWarningTriggered.php b/vendor/phpunit/phpunit/src/Event/Events/Test/Issue/PhpunitWarningTriggered.php index 2c6c083c..164c6eb1 100644 --- a/vendor/phpunit/phpunit/src/Event/Events/Test/Issue/PhpunitWarningTriggered.php +++ b/vendor/phpunit/phpunit/src/Event/Events/Test/Issue/PhpunitWarningTriggered.php @@ -24,8 +24,15 @@ final class PhpunitWarningTriggered implements Event { private readonly Telemetry\Info $telemetryInfo; private readonly Test $test; + + /** + * @psalm-var non-empty-string + */ private readonly string $message; + /** + * @psalm-param non-empty-string $message + */ public function __construct(Telemetry\Info $telemetryInfo, Test $test, string $message) { $this->telemetryInfo = $telemetryInfo; @@ -43,6 +50,9 @@ final class PhpunitWarningTriggered implements Event return $this->test; } + /** + * @psalm-return non-empty-string + */ public function message(): string { return $this->message; @@ -59,7 +69,7 @@ final class PhpunitWarningTriggered implements Event return sprintf( 'Test Triggered PHPUnit Warning (%s)%s', $this->test->id(), - $message + $message, ); } } diff --git a/vendor/phpunit/phpunit/src/Event/Events/Test/Issue/WarningTriggered.php b/vendor/phpunit/phpunit/src/Event/Events/Test/Issue/WarningTriggered.php index f36877df..839af384 100644 --- a/vendor/phpunit/phpunit/src/Event/Events/Test/Issue/WarningTriggered.php +++ b/vendor/phpunit/phpunit/src/Event/Events/Test/Issue/WarningTriggered.php @@ -24,17 +24,38 @@ final class WarningTriggered implements Event { private readonly Telemetry\Info $telemetryInfo; private readonly Test $test; - private readonly string $message; - private readonly string $file; - private readonly int $line; - public function __construct(Telemetry\Info $telemetryInfo, Test $test, string $message, string $file, int $line) + /** + * @psalm-var non-empty-string + */ + private readonly string $message; + + /** + * @psalm-var non-empty-string + */ + private readonly string $file; + + /** + * @psalm-var positive-int + */ + private readonly int $line; + private readonly bool $suppressed; + private readonly bool $ignoredByBaseline; + + /** + * @psalm-param non-empty-string $message + * @psalm-param non-empty-string $file + * @psalm-param positive-int $line + */ + public function __construct(Telemetry\Info $telemetryInfo, Test $test, string $message, string $file, int $line, bool $suppressed, bool $ignoredByBaseline) { - $this->telemetryInfo = $telemetryInfo; - $this->test = $test; - $this->message = $message; - $this->file = $file; - $this->line = $line; + $this->telemetryInfo = $telemetryInfo; + $this->test = $test; + $this->message = $message; + $this->file = $file; + $this->line = $line; + $this->suppressed = $suppressed; + $this->ignoredByBaseline = $ignoredByBaseline; } public function telemetryInfo(): Telemetry\Info @@ -47,21 +68,40 @@ final class WarningTriggered implements Event return $this->test; } + /** + * @psalm-return non-empty-string + */ public function message(): string { return $this->message; } + /** + * @psalm-return non-empty-string + */ public function file(): string { return $this->file; } + /** + * @psalm-return positive-int + */ public function line(): int { return $this->line; } + public function wasSuppressed(): bool + { + return $this->suppressed; + } + + public function ignoredByBaseline(): bool + { + return $this->ignoredByBaseline; + } + public function asString(): string { $message = $this->message; @@ -70,10 +110,21 @@ final class WarningTriggered implements Event $message = PHP_EOL . $message; } + $status = ''; + + if ($this->ignoredByBaseline) { + $status = 'Baseline-Ignored '; + } elseif ($this->suppressed) { + $status = 'Suppressed '; + } + return sprintf( - 'Test Triggered Warning (%s)%s', + 'Test Triggered %sWarning (%s) in %s:%d%s', + $status, $this->test->id(), - $message + $this->file, + $this->line, + $message, ); } } diff --git a/vendor/phpunit/phpunit/src/Event/Events/Test/Outcome/Errored.php b/vendor/phpunit/phpunit/src/Event/Events/Test/Outcome/Errored.php index ca18ccf1..0c3f4aa2 100644 --- a/vendor/phpunit/phpunit/src/Event/Events/Test/Outcome/Errored.php +++ b/vendor/phpunit/phpunit/src/Event/Events/Test/Outcome/Errored.php @@ -11,6 +11,7 @@ namespace PHPUnit\Event\Test; use const PHP_EOL; use function sprintf; +use function trim; use PHPUnit\Event\Code; use PHPUnit\Event\Code\Throwable; use PHPUnit\Event\Event; @@ -51,7 +52,7 @@ final class Errored implements Event public function asString(): string { - $message = $this->throwable->message(); + $message = trim($this->throwable->message()); if (!empty($message)) { $message = PHP_EOL . $message; @@ -60,7 +61,7 @@ final class Errored implements Event return sprintf( 'Test Errored (%s)%s', $this->test->id(), - $message + $message, ); } } diff --git a/vendor/phpunit/phpunit/src/Event/Events/Test/Outcome/Failed.php b/vendor/phpunit/phpunit/src/Event/Events/Test/Outcome/Failed.php index 2709d015..0bce79ef 100644 --- a/vendor/phpunit/phpunit/src/Event/Events/Test/Outcome/Failed.php +++ b/vendor/phpunit/phpunit/src/Event/Events/Test/Outcome/Failed.php @@ -11,6 +11,7 @@ namespace PHPUnit\Event\Test; use const PHP_EOL; use function sprintf; +use function trim; use PHPUnit\Event\Code; use PHPUnit\Event\Code\ComparisonFailure; use PHPUnit\Event\Code\Throwable; @@ -74,7 +75,7 @@ final class Failed implements Event public function asString(): string { - $message = $this->throwable->message(); + $message = trim($this->throwable->message()); if (!empty($message)) { $message = PHP_EOL . $message; @@ -83,7 +84,7 @@ final class Failed implements Event return sprintf( 'Test Failed (%s)%s', $this->test->id(), - $message + $message, ); } } diff --git a/vendor/phpunit/phpunit/src/Event/Events/Test/Outcome/MarkedIncomplete.php b/vendor/phpunit/phpunit/src/Event/Events/Test/Outcome/MarkedIncomplete.php index ffd0fa2f..c501fa46 100644 --- a/vendor/phpunit/phpunit/src/Event/Events/Test/Outcome/MarkedIncomplete.php +++ b/vendor/phpunit/phpunit/src/Event/Events/Test/Outcome/MarkedIncomplete.php @@ -11,6 +11,7 @@ namespace PHPUnit\Event\Test; use const PHP_EOL; use function sprintf; +use function trim; use PHPUnit\Event\Code; use PHPUnit\Event\Code\Throwable; use PHPUnit\Event\Event; @@ -51,7 +52,7 @@ final class MarkedIncomplete implements Event public function asString(): string { - $message = $this->throwable->message(); + $message = trim($this->throwable->message()); if (!empty($message)) { $message = PHP_EOL . $message; @@ -60,7 +61,7 @@ final class MarkedIncomplete implements Event return sprintf( 'Test Marked Incomplete (%s)%s', $this->test->id(), - $message + $message, ); } } diff --git a/vendor/phpunit/phpunit/src/Event/Events/Test/Outcome/Skipped.php b/vendor/phpunit/phpunit/src/Event/Events/Test/Outcome/Skipped.php index fd8da8da..14501058 100644 --- a/vendor/phpunit/phpunit/src/Event/Events/Test/Outcome/Skipped.php +++ b/vendor/phpunit/phpunit/src/Event/Events/Test/Outcome/Skipped.php @@ -59,7 +59,7 @@ final class Skipped implements Event return sprintf( 'Test Skipped (%s)%s', $this->test->id(), - $message + $message, ); } } diff --git a/vendor/phpunit/phpunit/src/Event/Events/Test/PrintedUnexpectedOutput.php b/vendor/phpunit/phpunit/src/Event/Events/Test/PrintedUnexpectedOutput.php index d947cfc4..308332e8 100644 --- a/vendor/phpunit/phpunit/src/Event/Events/Test/PrintedUnexpectedOutput.php +++ b/vendor/phpunit/phpunit/src/Event/Events/Test/PrintedUnexpectedOutput.php @@ -9,6 +9,7 @@ */ namespace PHPUnit\Event\Test; +use const PHP_EOL; use function sprintf; use PHPUnit\Event\Event; use PHPUnit\Event\Telemetry; @@ -54,7 +55,7 @@ final class PrintedUnexpectedOutput implements Event return sprintf( 'Test Printed Unexpected Output%s%s', PHP_EOL, - $this->output + $this->output, ); } } diff --git a/vendor/phpunit/phpunit/src/Event/Events/Test/TestDouble/MockObjectCreated.php b/vendor/phpunit/phpunit/src/Event/Events/Test/TestDouble/MockObjectCreated.php index b67a5b74..ad462440 100644 --- a/vendor/phpunit/phpunit/src/Event/Events/Test/TestDouble/MockObjectCreated.php +++ b/vendor/phpunit/phpunit/src/Event/Events/Test/TestDouble/MockObjectCreated.php @@ -53,7 +53,7 @@ final class MockObjectCreated implements Event { return sprintf( 'Mock Object Created (%s)', - $this->className + $this->className, ); } } diff --git a/vendor/phpunit/phpunit/src/Event/Events/Test/TestDouble/MockObjectForAbstractClassCreated.php b/vendor/phpunit/phpunit/src/Event/Events/Test/TestDouble/MockObjectForAbstractClassCreated.php index 3b960d3a..7976a1c9 100644 --- a/vendor/phpunit/phpunit/src/Event/Events/Test/TestDouble/MockObjectForAbstractClassCreated.php +++ b/vendor/phpunit/phpunit/src/Event/Events/Test/TestDouble/MockObjectForAbstractClassCreated.php @@ -53,7 +53,7 @@ final class MockObjectForAbstractClassCreated implements Event { return sprintf( 'Mock Object Created (%s)', - $this->className + $this->className, ); } } diff --git a/vendor/phpunit/phpunit/src/Event/Events/Test/TestDouble/MockObjectForIntersectionOfInterfacesCreated.php b/vendor/phpunit/phpunit/src/Event/Events/Test/TestDouble/MockObjectForIntersectionOfInterfacesCreated.php index 08ae1ca4..deb7ec75 100644 --- a/vendor/phpunit/phpunit/src/Event/Events/Test/TestDouble/MockObjectForIntersectionOfInterfacesCreated.php +++ b/vendor/phpunit/phpunit/src/Event/Events/Test/TestDouble/MockObjectForIntersectionOfInterfacesCreated.php @@ -54,7 +54,7 @@ final class MockObjectForIntersectionOfInterfacesCreated implements Event { return sprintf( 'Mock Object Created (%s)', - implode('&', $this->interfaces) + implode('&', $this->interfaces), ); } } diff --git a/vendor/phpunit/phpunit/src/Event/Events/Test/TestDouble/MockObjectForTraitCreated.php b/vendor/phpunit/phpunit/src/Event/Events/Test/TestDouble/MockObjectForTraitCreated.php index 35818168..fd09d594 100644 --- a/vendor/phpunit/phpunit/src/Event/Events/Test/TestDouble/MockObjectForTraitCreated.php +++ b/vendor/phpunit/phpunit/src/Event/Events/Test/TestDouble/MockObjectForTraitCreated.php @@ -53,7 +53,7 @@ final class MockObjectForTraitCreated implements Event { return sprintf( 'Mock Object Created (%s)', - $this->traitName + $this->traitName, ); } } diff --git a/vendor/phpunit/phpunit/src/Event/Events/Test/TestDouble/MockObjectFromWsdlCreated.php b/vendor/phpunit/phpunit/src/Event/Events/Test/TestDouble/MockObjectFromWsdlCreated.php index 640a68dc..09992831 100644 --- a/vendor/phpunit/phpunit/src/Event/Events/Test/TestDouble/MockObjectFromWsdlCreated.php +++ b/vendor/phpunit/phpunit/src/Event/Events/Test/TestDouble/MockObjectFromWsdlCreated.php @@ -103,7 +103,7 @@ final class MockObjectFromWsdlCreated implements Event { return sprintf( 'Mock Object Created (%s)', - $this->wsdlFile + $this->wsdlFile, ); } } diff --git a/vendor/phpunit/phpunit/src/Event/Events/Test/TestDouble/PartialMockObjectCreated.php b/vendor/phpunit/phpunit/src/Event/Events/Test/TestDouble/PartialMockObjectCreated.php index 397fdeb2..604ba3ce 100644 --- a/vendor/phpunit/phpunit/src/Event/Events/Test/TestDouble/PartialMockObjectCreated.php +++ b/vendor/phpunit/phpunit/src/Event/Events/Test/TestDouble/PartialMockObjectCreated.php @@ -67,7 +67,7 @@ final class PartialMockObjectCreated implements Event { return sprintf( 'Partial Mock Object Created (%s)', - $this->className + $this->className, ); } } diff --git a/vendor/phpunit/phpunit/src/Event/Events/Test/TestDouble/TestProxyCreated.php b/vendor/phpunit/phpunit/src/Event/Events/Test/TestDouble/TestProxyCreated.php index deabf820..3f089412 100644 --- a/vendor/phpunit/phpunit/src/Event/Events/Test/TestDouble/TestProxyCreated.php +++ b/vendor/phpunit/phpunit/src/Event/Events/Test/TestDouble/TestProxyCreated.php @@ -60,7 +60,7 @@ final class TestProxyCreated implements Event { return sprintf( 'Test Proxy Created (%s)', - $this->className + $this->className, ); } } diff --git a/vendor/phpunit/phpunit/src/Event/Events/Test/TestDouble/TestStubCreated.php b/vendor/phpunit/phpunit/src/Event/Events/Test/TestDouble/TestStubCreated.php index 0dae6d88..9d0330f6 100644 --- a/vendor/phpunit/phpunit/src/Event/Events/Test/TestDouble/TestStubCreated.php +++ b/vendor/phpunit/phpunit/src/Event/Events/Test/TestDouble/TestStubCreated.php @@ -53,7 +53,7 @@ final class TestStubCreated implements Event { return sprintf( 'Test Stub Created (%s)', - $this->className + $this->className, ); } } diff --git a/vendor/phpunit/phpunit/src/Event/Events/Test/TestDouble/TestStubForIntersectionOfInterfacesCreated.php b/vendor/phpunit/phpunit/src/Event/Events/Test/TestDouble/TestStubForIntersectionOfInterfacesCreated.php index 0e36534b..4aded8c8 100644 --- a/vendor/phpunit/phpunit/src/Event/Events/Test/TestDouble/TestStubForIntersectionOfInterfacesCreated.php +++ b/vendor/phpunit/phpunit/src/Event/Events/Test/TestDouble/TestStubForIntersectionOfInterfacesCreated.php @@ -54,7 +54,7 @@ final class TestStubForIntersectionOfInterfacesCreated implements Event { return sprintf( 'Test Stub Created (%s)', - implode('&', $this->interfaces) + implode('&', $this->interfaces), ); } } diff --git a/vendor/phpunit/phpunit/src/Event/Events/TestRunner/BootstrapFinished.php b/vendor/phpunit/phpunit/src/Event/Events/TestRunner/BootstrapFinished.php index 406506a3..9ec3f348 100644 --- a/vendor/phpunit/phpunit/src/Event/Events/TestRunner/BootstrapFinished.php +++ b/vendor/phpunit/phpunit/src/Event/Events/TestRunner/BootstrapFinished.php @@ -43,7 +43,7 @@ final class BootstrapFinished implements Event { return sprintf( 'Bootstrap Finished (%s)', - $this->filename + $this->filename, ); } } diff --git a/vendor/phpunit/phpunit/src/Event/Events/TestRunner/DeprecationTriggered.php b/vendor/phpunit/phpunit/src/Event/Events/TestRunner/DeprecationTriggered.php index c5f15ab3..31d27e28 100644 --- a/vendor/phpunit/phpunit/src/Event/Events/TestRunner/DeprecationTriggered.php +++ b/vendor/phpunit/phpunit/src/Event/Events/TestRunner/DeprecationTriggered.php @@ -43,7 +43,7 @@ final class DeprecationTriggered implements Event { return sprintf( 'Test Runner Triggered Deprecation (%s)', - $this->message + $this->message, ); } } diff --git a/vendor/phpunit/phpunit/src/Event/Events/TestRunner/ExecutionStarted.php b/vendor/phpunit/phpunit/src/Event/Events/TestRunner/ExecutionStarted.php index 3085bc40..77fd570d 100644 --- a/vendor/phpunit/phpunit/src/Event/Events/TestRunner/ExecutionStarted.php +++ b/vendor/phpunit/phpunit/src/Event/Events/TestRunner/ExecutionStarted.php @@ -45,7 +45,7 @@ final class ExecutionStarted implements Event return sprintf( 'Test Runner Execution Started (%d test%s)', $this->testSuite->count(), - $this->testSuite->count() !== 1 ? 's' : '' + $this->testSuite->count() !== 1 ? 's' : '', ); } } diff --git a/vendor/phpunit/phpunit/src/Event/Events/TestRunner/ExtensionLoadedFromPhar.php b/vendor/phpunit/phpunit/src/Event/Events/TestRunner/ExtensionLoadedFromPhar.php index c9c321ce..a2f1f147 100644 --- a/vendor/phpunit/phpunit/src/Event/Events/TestRunner/ExtensionLoadedFromPhar.php +++ b/vendor/phpunit/phpunit/src/Event/Events/TestRunner/ExtensionLoadedFromPhar.php @@ -58,7 +58,7 @@ final class ExtensionLoadedFromPhar implements Event return sprintf( 'Extension Loaded from PHAR (%s %s)', $this->name, - $this->version + $this->version, ); } } diff --git a/vendor/phpunit/phpunit/src/Event/Events/TestRunner/WarningTriggered.php b/vendor/phpunit/phpunit/src/Event/Events/TestRunner/WarningTriggered.php index b690f2f6..cb80a07b 100644 --- a/vendor/phpunit/phpunit/src/Event/Events/TestRunner/WarningTriggered.php +++ b/vendor/phpunit/phpunit/src/Event/Events/TestRunner/WarningTriggered.php @@ -43,7 +43,7 @@ final class WarningTriggered implements Event { return sprintf( 'Test Runner Triggered Warning (%s)', - $this->message + $this->message, ); } } diff --git a/vendor/phpunit/phpunit/src/Event/Events/TestSuite/Filtered.php b/vendor/phpunit/phpunit/src/Event/Events/TestSuite/Filtered.php index 85a3bce7..1beadde5 100644 --- a/vendor/phpunit/phpunit/src/Event/Events/TestSuite/Filtered.php +++ b/vendor/phpunit/phpunit/src/Event/Events/TestSuite/Filtered.php @@ -44,7 +44,7 @@ final class Filtered implements Event return sprintf( 'Test Suite Filtered (%d test%s)', $this->testSuite->count(), - $this->testSuite->count() !== 1 ? 's' : '' + $this->testSuite->count() !== 1 ? 's' : '', ); } } diff --git a/vendor/phpunit/phpunit/src/Event/Events/TestSuite/Finished.php b/vendor/phpunit/phpunit/src/Event/Events/TestSuite/Finished.php index b3801eaf..e89076c1 100644 --- a/vendor/phpunit/phpunit/src/Event/Events/TestSuite/Finished.php +++ b/vendor/phpunit/phpunit/src/Event/Events/TestSuite/Finished.php @@ -41,17 +41,11 @@ final class Finished implements Event public function asString(): string { - $name = ''; - - if (!empty($this->testSuite->name())) { - $name = $this->testSuite->name() . ', '; - } - return sprintf( - 'Test Suite Finished (%s%d test%s)', - $name, + 'Test Suite Finished (%s, %d test%s)', + $this->testSuite->name(), $this->testSuite->count(), - $this->testSuite->count() !== 1 ? 's' : '' + $this->testSuite->count() !== 1 ? 's' : '', ); } } diff --git a/vendor/phpunit/phpunit/src/Event/Events/TestSuite/Loaded.php b/vendor/phpunit/phpunit/src/Event/Events/TestSuite/Loaded.php index 7cd5f091..271ab37f 100644 --- a/vendor/phpunit/phpunit/src/Event/Events/TestSuite/Loaded.php +++ b/vendor/phpunit/phpunit/src/Event/Events/TestSuite/Loaded.php @@ -44,7 +44,7 @@ final class Loaded implements Event return sprintf( 'Test Suite Loaded (%d test%s)', $this->testSuite->count(), - $this->testSuite->count() !== 1 ? 's' : '' + $this->testSuite->count() !== 1 ? 's' : '', ); } } diff --git a/vendor/phpunit/phpunit/src/Event/Events/TestSuite/Skipped.php b/vendor/phpunit/phpunit/src/Event/Events/TestSuite/Skipped.php index 31664353..9a8f5230 100644 --- a/vendor/phpunit/phpunit/src/Event/Events/TestSuite/Skipped.php +++ b/vendor/phpunit/phpunit/src/Event/Events/TestSuite/Skipped.php @@ -48,16 +48,10 @@ final class Skipped implements Event public function asString(): string { - $name = ''; - - if (!empty($this->testSuite->name())) { - $name = $this->testSuite->name() . ', '; - } - return sprintf( - 'Test Suite Skipped (%s%s)', - $name, - $this->message + 'Test Suite Skipped (%s, %s)', + $this->testSuite->name(), + $this->message, ); } } diff --git a/vendor/phpunit/phpunit/src/Event/Events/TestSuite/Started.php b/vendor/phpunit/phpunit/src/Event/Events/TestSuite/Started.php index acc83811..1e34aa7d 100644 --- a/vendor/phpunit/phpunit/src/Event/Events/TestSuite/Started.php +++ b/vendor/phpunit/phpunit/src/Event/Events/TestSuite/Started.php @@ -41,17 +41,11 @@ final class Started implements Event public function asString(): string { - $name = ''; - - if (!empty($this->testSuite->name())) { - $name = $this->testSuite->name() . ', '; - } - return sprintf( - 'Test Suite Started (%s%d test%s)', - $name, + 'Test Suite Started (%s, %d test%s)', + $this->testSuite->name(), $this->testSuite->count(), - $this->testSuite->count() !== 1 ? 's' : '' + $this->testSuite->count() !== 1 ? 's' : '', ); } } diff --git a/vendor/phpunit/phpunit/src/Event/Facade.php b/vendor/phpunit/phpunit/src/Event/Facade.php index e050a5b5..0a256449 100644 --- a/vendor/phpunit/phpunit/src/Event/Facade.php +++ b/vendor/phpunit/phpunit/src/Event/Facade.php @@ -9,154 +9,179 @@ */ namespace PHPUnit\Event; +use function gc_status; use PHPUnit\Event\Telemetry\HRTime; +use PHPUnit\Event\Telemetry\Php81GarbageCollectorStatusProvider; +use PHPUnit\Event\Telemetry\Php83GarbageCollectorStatusProvider; /** + * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit + * * @internal This class is not covered by the backward compatibility promise for PHPUnit */ final class Facade { - private static ?TypeMap $typeMap = null; - private static ?Emitter $emitter = null; - private static ?Emitter $suspended = null; - private static ?DeferringDispatcher $deferringDispatcher = null; - private static bool $sealed = false; + private static ?self $instance = null; + private Emitter $emitter; + private ?TypeMap $typeMap = null; + private ?DeferringDispatcher $deferringDispatcher = null; + private bool $sealed = false; - /** - * @throws EventFacadeIsSealedException - * @throws UnknownSubscriberTypeException - */ - public static function registerSubscribers(Subscriber ...$subscribers): void + public static function instance(): self { - foreach ($subscribers as $subscriber) { - self::registerSubscriber($subscriber); - } - } - - /** - * @throws EventFacadeIsSealedException - * @throws UnknownSubscriberTypeException - */ - public static function registerSubscriber(Subscriber $subscriber): void - { - if (self::$sealed) { - throw new EventFacadeIsSealedException; + if (self::$instance === null) { + self::$instance = new self; } - self::deferredDispatcher()->registerSubscriber($subscriber); - } - - /** - * @throws EventFacadeIsSealedException - */ - public static function registerTracer(Tracer\Tracer $tracer): void - { - if (self::$sealed) { - throw new EventFacadeIsSealedException; - } - - self::deferredDispatcher()->registerTracer($tracer); + return self::$instance; } public static function emitter(): Emitter { - if (self::$emitter === null) { - self::$emitter = self::createDispatchingEmitter(); - } - - return self::$emitter; + return self::instance()->emitter; } - /** @noinspection PhpUnused */ - public static function initForIsolation(HRTime $offset): CollectingDispatcher + public function __construct() + { + $this->emitter = $this->createDispatchingEmitter(); + } + + /** + * @throws EventFacadeIsSealedException + * @throws UnknownSubscriberTypeException + */ + public function registerSubscribers(Subscriber ...$subscribers): void + { + foreach ($subscribers as $subscriber) { + $this->registerSubscriber($subscriber); + } + } + + /** + * @throws EventFacadeIsSealedException + * @throws UnknownSubscriberTypeException + */ + public function registerSubscriber(Subscriber $subscriber): void + { + if ($this->sealed) { + throw new EventFacadeIsSealedException; + } + + $this->deferredDispatcher()->registerSubscriber($subscriber); + } + + /** + * @throws EventFacadeIsSealedException + */ + public function registerTracer(Tracer\Tracer $tracer): void + { + if ($this->sealed) { + throw new EventFacadeIsSealedException; + } + + $this->deferredDispatcher()->registerTracer($tracer); + } + + /** + * @codeCoverageIgnore + * + * @noinspection PhpUnused + */ + public function initForIsolation(HRTime $offset, bool $exportObjects): CollectingDispatcher { $dispatcher = new CollectingDispatcher; - self::$emitter = new DispatchingEmitter( + $this->emitter = new DispatchingEmitter( $dispatcher, new Telemetry\System( new Telemetry\SystemStopWatchWithOffset($offset), - new Telemetry\SystemMemoryMeter - ) + new Telemetry\SystemMemoryMeter, + $this->garbageCollectorStatusProvider(), + ), ); - self::$sealed = true; + if ($exportObjects) { + $this->emitter->exportObjects(); + } + + $this->sealed = true; return $dispatcher; } - public static function forward(EventCollection $events): void + public function forward(EventCollection $events): void { - if (self::$suspended !== null) { - return; - } - - $dispatcher = self::deferredDispatcher(); + $dispatcher = $this->deferredDispatcher(); foreach ($events as $event) { $dispatcher->dispatch($event); } } - public static function seal(): void + public function seal(): void { - self::deferredDispatcher()->flush(); + $this->deferredDispatcher()->flush(); - self::$sealed = true; + $this->sealed = true; - self::emitter()->testRunnerEventFacadeSealed(); + $this->emitter->testRunnerEventFacadeSealed(); } - private static function createDispatchingEmitter(): DispatchingEmitter + private function createDispatchingEmitter(): DispatchingEmitter { return new DispatchingEmitter( - self::deferredDispatcher(), - self::createTelemetrySystem() + $this->deferredDispatcher(), + $this->createTelemetrySystem(), ); } - private static function createTelemetrySystem(): Telemetry\System + private function createTelemetrySystem(): Telemetry\System { return new Telemetry\System( new Telemetry\SystemStopWatch, - new Telemetry\SystemMemoryMeter + new Telemetry\SystemMemoryMeter, + $this->garbageCollectorStatusProvider(), ); } - private static function deferredDispatcher(): DeferringDispatcher + private function deferredDispatcher(): DeferringDispatcher { - if (self::$deferringDispatcher === null) { - self::$deferringDispatcher = new DeferringDispatcher( - new DirectDispatcher(self::typeMap()) + if ($this->deferringDispatcher === null) { + $this->deferringDispatcher = new DeferringDispatcher( + new DirectDispatcher($this->typeMap()), ); } - return self::$deferringDispatcher; + return $this->deferringDispatcher; } - private static function typeMap(): TypeMap + private function typeMap(): TypeMap { - if (self::$typeMap === null) { + if ($this->typeMap === null) { $typeMap = new TypeMap; - self::registerDefaultTypes($typeMap); + $this->registerDefaultTypes($typeMap); - self::$typeMap = $typeMap; + $this->typeMap = $typeMap; } - return self::$typeMap; + return $this->typeMap; } - private static function registerDefaultTypes(TypeMap $typeMap): void + private function registerDefaultTypes(TypeMap $typeMap): void { $defaultEvents = [ Application\Started::class, Application\Finished::class, + Test\DataProviderMethodCalled::class, + Test\DataProviderMethodFinished::class, Test\MarkedIncomplete::class, Test\AfterLastTestMethodCalled::class, + Test\AfterLastTestMethodErrored::class, Test\AfterLastTestMethodFinished::class, Test\AfterTestMethodCalled::class, + Test\AfterTestMethodErrored::class, Test\AfterTestMethodFinished::class, Test\AssertionSucceeded::class, Test\AssertionFailed::class, @@ -164,6 +189,7 @@ final class Facade Test\BeforeFirstTestMethodErrored::class, Test\BeforeFirstTestMethodFinished::class, Test\BeforeTestMethodCalled::class, + Test\BeforeTestMethodErrored::class, Test\BeforeTestMethodFinished::class, Test\ComparatorRegistered::class, Test\ConsideredRisky::class, @@ -181,11 +207,14 @@ final class Facade Test\PhpunitWarningTriggered::class, Test\PhpWarningTriggered::class, Test\PostConditionCalled::class, + Test\PostConditionErrored::class, Test\PostConditionFinished::class, Test\PreConditionCalled::class, + Test\PreConditionErrored::class, Test\PreConditionFinished::class, Test\PreparationStarted::class, Test\Prepared::class, + Test\PreparationFailed::class, Test\PrintedUnexpectedOutput::class, Test\Skipped::class, Test\WarningTriggered::class, @@ -203,6 +232,7 @@ final class Facade TestRunner\BootstrapFinished::class, TestRunner\Configured::class, TestRunner\EventFacadeSealed::class, + TestRunner\ExecutionAborted::class, TestRunner\ExecutionFinished::class, TestRunner\ExecutionStarted::class, TestRunner\ExtensionLoadedFromPhar::class, @@ -211,6 +241,9 @@ final class Facade TestRunner\Started::class, TestRunner\DeprecationTriggered::class, TestRunner\WarningTriggered::class, + TestRunner\GarbageCollectionDisabled::class, + TestRunner\GarbageCollectionTriggered::class, + TestRunner\GarbageCollectionEnabled::class, TestSuite\Filtered::class, TestSuite\Finished::class, @@ -223,8 +256,19 @@ final class Facade foreach ($defaultEvents as $eventClass) { $typeMap->addMapping( $eventClass . 'Subscriber', - $eventClass + $eventClass, ); } } + + private function garbageCollectorStatusProvider(): Telemetry\GarbageCollectorStatusProvider + { + if (!isset(gc_status()['running'])) { + // @codeCoverageIgnoreStart + return new Php81GarbageCollectorStatusProvider; + // @codeCoverageIgnoreEnd + } + + return new Php83GarbageCollectorStatusProvider; + } } diff --git a/vendor/phpunit/phpunit/src/Event/TypeMap.php b/vendor/phpunit/phpunit/src/Event/TypeMap.php index feddda0d..f808c9bb 100644 --- a/vendor/phpunit/phpunit/src/Event/TypeMap.php +++ b/vendor/phpunit/phpunit/src/Event/TypeMap.php @@ -17,6 +17,8 @@ use function interface_exists; use function sprintf; /** + * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit + * * @internal This class is not covered by the backward compatibility promise for PHPUnit */ final class TypeMap @@ -39,59 +41,12 @@ final class TypeMap */ public function addMapping(string $subscriberInterface, string $eventClass): void { - if (!interface_exists($subscriberInterface)) { - throw new UnknownSubscriberException( - sprintf( - 'Subscriber "%s" does not exist or is not an interface', - $subscriberInterface - ) - ); - } - - if (!class_exists($eventClass)) { - throw new UnknownEventException( - sprintf( - 'Event class "%s" does not exist', - $eventClass - ) - ); - } - - if (!in_array(Subscriber::class, class_implements($subscriberInterface), true)) { - throw new InvalidSubscriberException( - sprintf( - 'Subscriber "%s" does not implement Subscriber interface', - $subscriberInterface - ) - ); - } - - if (!in_array(Event::class, class_implements($eventClass), true)) { - throw new InvalidEventException( - sprintf( - 'Event "%s" does not implement Event interface', - $eventClass - ) - ); - } - - if (array_key_exists($subscriberInterface, $this->mapping)) { - throw new SubscriberTypeAlreadyRegisteredException( - sprintf( - 'Subscriber type "%s" already registered - cannot overwrite', - $subscriberInterface - ) - ); - } - - if (in_array($eventClass, $this->mapping, true)) { - throw new EventAlreadyAssignedException( - sprintf( - 'Event "%s" already assigned - cannot add multiple subscriber types for an event type', - $eventClass - ) - ); - } + $this->ensureSubscriberInterfaceExists($subscriberInterface); + $this->ensureSubscriberInterfaceExtendsInterface($subscriberInterface); + $this->ensureEventClassExists($eventClass); + $this->ensureEventClassImplementsEventInterface($eventClass); + $this->ensureSubscriberWasNotAlreadyRegistered($subscriberInterface); + $this->ensureEventWasNotAlreadyAssigned($eventClass); $this->mapping[$subscriberInterface] = $eventClass; } @@ -113,9 +68,9 @@ final class TypeMap } /** - * @psalm-return class-string - * * @throws MapError + * + * @psalm-return class-string */ public function map(Subscriber $subscriber): string { @@ -128,8 +83,110 @@ final class TypeMap throw new MapError( sprintf( 'Subscriber "%s" does not implement a known interface', - $subscriber::class - ) + $subscriber::class, + ), ); } + + /** + * @psalm-param class-string $subscriberInterface + * + * @throws UnknownSubscriberException + */ + private function ensureSubscriberInterfaceExists(string $subscriberInterface): void + { + if (!interface_exists($subscriberInterface)) { + throw new UnknownSubscriberException( + sprintf( + 'Subscriber "%s" does not exist or is not an interface', + $subscriberInterface, + ), + ); + } + } + + /** + * @psalm-param class-string $eventClass + * + * @throws UnknownEventException + */ + private function ensureEventClassExists(string $eventClass): void + { + if (!class_exists($eventClass)) { + throw new UnknownEventException( + sprintf( + 'Event class "%s" does not exist', + $eventClass, + ), + ); + } + } + + /** + * @psalm-param class-string $subscriberInterface + * + * @throws InvalidSubscriberException + */ + private function ensureSubscriberInterfaceExtendsInterface(string $subscriberInterface): void + { + if (!in_array(Subscriber::class, class_implements($subscriberInterface), true)) { + throw new InvalidSubscriberException( + sprintf( + 'Subscriber "%s" does not extend Subscriber interface', + $subscriberInterface, + ), + ); + } + } + + /** + * @psalm-param class-string $eventClass + * + * @throws InvalidEventException + */ + private function ensureEventClassImplementsEventInterface(string $eventClass): void + { + if (!in_array(Event::class, class_implements($eventClass), true)) { + throw new InvalidEventException( + sprintf( + 'Event "%s" does not implement Event interface', + $eventClass, + ), + ); + } + } + + /** + * @psalm-param class-string $subscriberInterface + * + * @throws SubscriberTypeAlreadyRegisteredException + */ + private function ensureSubscriberWasNotAlreadyRegistered(string $subscriberInterface): void + { + if (array_key_exists($subscriberInterface, $this->mapping)) { + throw new SubscriberTypeAlreadyRegisteredException( + sprintf( + 'Subscriber type "%s" already registered', + $subscriberInterface, + ), + ); + } + } + + /** + * @psalm-param class-string $eventClass + * + * @throws EventAlreadyAssignedException + */ + private function ensureEventWasNotAlreadyAssigned(string $eventClass): void + { + if (in_array($eventClass, $this->mapping, true)) { + throw new EventAlreadyAssignedException( + sprintf( + 'Event "%s" already assigned', + $eventClass, + ), + ); + } + } } diff --git a/vendor/phpunit/phpunit/src/Event/Value/ComparisonFailureBuilder.php b/vendor/phpunit/phpunit/src/Event/Value/ComparisonFailureBuilder.php index 44745ed5..ece03427 100644 --- a/vendor/phpunit/phpunit/src/Event/Value/ComparisonFailureBuilder.php +++ b/vendor/phpunit/phpunit/src/Event/Value/ComparisonFailureBuilder.php @@ -16,6 +16,8 @@ use PHPUnit\Framework\ExpectationFailedException; use Throwable; /** + * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit + * * @internal This class is not covered by the backward compatibility promise for PHPUnit */ final class ComparisonFailureBuilder @@ -45,7 +47,7 @@ final class ComparisonFailureBuilder return new ComparisonFailure( $expectedAsString, $actualAsString, - $t->getComparisonFailure()->getDiff() + $t->getComparisonFailure()->getDiff(), ); } diff --git a/vendor/phpunit/phpunit/src/Event/Value/Runtime/PHP.php b/vendor/phpunit/phpunit/src/Event/Value/Runtime/PHP.php index 0da3c5d2..717f3c12 100644 --- a/vendor/phpunit/phpunit/src/Event/Value/Runtime/PHP.php +++ b/vendor/phpunit/phpunit/src/Event/Value/Runtime/PHP.php @@ -52,7 +52,7 @@ final class PHP $extensions = array_merge( get_loaded_extensions(true), - get_loaded_extensions() + get_loaded_extensions(), ); sort($extensions); diff --git a/vendor/phpunit/phpunit/src/Event/Value/Runtime/Runtime.php b/vendor/phpunit/phpunit/src/Event/Value/Runtime/Runtime.php index a4fa9516..cea7ba32 100644 --- a/vendor/phpunit/phpunit/src/Event/Value/Runtime/Runtime.php +++ b/vendor/phpunit/phpunit/src/Event/Value/Runtime/Runtime.php @@ -38,7 +38,7 @@ final class Runtime $this->phpunit()->versionId(), $php->version(), $php->sapi(), - $this->operatingSystem()->operatingSystem() + $this->operatingSystem()->operatingSystem(), ); } diff --git a/vendor/phpunit/phpunit/src/Event/Value/Telemetry/Duration.php b/vendor/phpunit/phpunit/src/Event/Value/Telemetry/Duration.php index 3d826cb4..000216cd 100644 --- a/vendor/phpunit/phpunit/src/Event/Value/Telemetry/Duration.php +++ b/vendor/phpunit/phpunit/src/Event/Value/Telemetry/Duration.php @@ -30,7 +30,7 @@ final class Duration { return new self( $seconds, - $nanoseconds + $nanoseconds, ); } @@ -65,8 +65,8 @@ final class Duration public function asString(): string { $seconds = $this->seconds(); - $minutes = 00; - $hours = 00; + $minutes = 0; + $hours = 0; if ($seconds > 60 * 60) { $hours = floor($seconds / 60 / 60); @@ -83,7 +83,7 @@ final class Duration $hours, $minutes, $seconds, - $this->nanoseconds() + $this->nanoseconds(), ); } @@ -128,8 +128,8 @@ final class Duration throw new InvalidArgumentException( sprintf( 'Value for %s must not be negative.', - $type - ) + $type, + ), ); } } @@ -141,7 +141,7 @@ final class Duration { if ($nanoseconds > 999999999) { throw new InvalidArgumentException( - 'Value for nanoseconds must not be greater than 999999999.' + 'Value for nanoseconds must not be greater than 999999999.', ); } } diff --git a/vendor/phpunit/phpunit/src/Event/Value/Telemetry/HRTime.php b/vendor/phpunit/phpunit/src/Event/Value/Telemetry/HRTime.php index 5fe864f5..df2aa656 100644 --- a/vendor/phpunit/phpunit/src/Event/Value/Telemetry/HRTime.php +++ b/vendor/phpunit/phpunit/src/Event/Value/Telemetry/HRTime.php @@ -29,7 +29,7 @@ final class HRTime { return new self( $seconds, - $nanoseconds + $nanoseconds, ); } @@ -56,9 +56,6 @@ final class HRTime return $this->nanoseconds; } - /** - * @throws InvalidArgumentException - */ public function duration(self $start): Duration { $seconds = $this->seconds - $start->seconds(); @@ -71,12 +68,12 @@ final class HRTime } if ($seconds < 0) { - throw new InvalidArgumentException('Start needs to be smaller.'); + return Duration::fromSecondsAndNanoseconds(0, 0); } return Duration::fromSecondsAndNanoseconds( $seconds, - $nanoseconds + $nanoseconds, ); } @@ -89,8 +86,8 @@ final class HRTime throw new InvalidArgumentException( sprintf( 'Value for %s must not be negative.', - $type - ) + $type, + ), ); } } @@ -102,7 +99,7 @@ final class HRTime { if ($nanoseconds > 999999999) { throw new InvalidArgumentException( - 'Value for nanoseconds must not be greater than 999999999.' + 'Value for nanoseconds must not be greater than 999999999.', ); } } diff --git a/vendor/phpunit/phpunit/src/Event/Value/Telemetry/Info.php b/vendor/phpunit/phpunit/src/Event/Value/Telemetry/Info.php index cf631b84..1546d940 100644 --- a/vendor/phpunit/phpunit/src/Event/Value/Telemetry/Info.php +++ b/vendor/phpunit/phpunit/src/Event/Value/Telemetry/Info.php @@ -68,13 +68,18 @@ final class Info return $this->memorySincePrevious; } + public function garbageCollectorStatus(): GarbageCollectorStatus + { + return $this->current->garbageCollectorStatus(); + } + public function asString(): string { return sprintf( '[%s / %s] [%d bytes]', $this->durationSinceStart()->asString(), $this->durationSincePrevious()->asString(), - $this->memoryUsage()->bytes() + $this->memoryUsage()->bytes(), ); } } diff --git a/vendor/phpunit/phpunit/src/Event/Value/Telemetry/MemoryMeter.php b/vendor/phpunit/phpunit/src/Event/Value/Telemetry/MemoryMeter.php index db6d8fd7..4d116ff3 100644 --- a/vendor/phpunit/phpunit/src/Event/Value/Telemetry/MemoryMeter.php +++ b/vendor/phpunit/phpunit/src/Event/Value/Telemetry/MemoryMeter.php @@ -10,7 +10,9 @@ namespace PHPUnit\Event\Telemetry; /** - * @internal This class is not covered by the backward compatibility promise for PHPUnit + * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit + * + * @internal This interface is not covered by the backward compatibility promise for PHPUnit */ interface MemoryMeter { diff --git a/vendor/phpunit/phpunit/src/Event/Value/Telemetry/MemoryUsage.php b/vendor/phpunit/phpunit/src/Event/Value/Telemetry/MemoryUsage.php index 95185b53..7e8bc699 100644 --- a/vendor/phpunit/phpunit/src/Event/Value/Telemetry/MemoryUsage.php +++ b/vendor/phpunit/phpunit/src/Event/Value/Telemetry/MemoryUsage.php @@ -1,6 +1,4 @@ -time = $time; - $this->memoryUsage = $memoryUsage; - $this->peakMemoryUsage = $peakMemoryUsage; + $this->time = $time; + $this->memoryUsage = $memoryUsage; + $this->peakMemoryUsage = $peakMemoryUsage; + $this->garbageCollectorStatus = $garbageCollectorStatus; } public function time(): HRTime @@ -41,4 +43,9 @@ final class Snapshot { return $this->peakMemoryUsage; } + + public function garbageCollectorStatus(): GarbageCollectorStatus + { + return $this->garbageCollectorStatus; + } } diff --git a/vendor/phpunit/phpunit/src/Event/Value/Telemetry/StopWatch.php b/vendor/phpunit/phpunit/src/Event/Value/Telemetry/StopWatch.php index c19796ed..07ce5227 100644 --- a/vendor/phpunit/phpunit/src/Event/Value/Telemetry/StopWatch.php +++ b/vendor/phpunit/phpunit/src/Event/Value/Telemetry/StopWatch.php @@ -10,7 +10,9 @@ namespace PHPUnit\Event\Telemetry; /** - * @internal This class is not covered by the backward compatibility promise for PHPUnit + * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit + * + * @internal This interface is not covered by the backward compatibility promise for PHPUnit */ interface StopWatch { diff --git a/vendor/phpunit/phpunit/src/Event/Value/Telemetry/System.php b/vendor/phpunit/phpunit/src/Event/Value/Telemetry/System.php index 00f1b150..368054de 100644 --- a/vendor/phpunit/phpunit/src/Event/Value/Telemetry/System.php +++ b/vendor/phpunit/phpunit/src/Event/Value/Telemetry/System.php @@ -11,16 +11,20 @@ namespace PHPUnit\Event\Telemetry; /** * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit + * + * @internal This class is not covered by the backward compatibility promise for PHPUnit */ final class System { private readonly StopWatch $stopWatch; private readonly MemoryMeter $memoryMeter; + private readonly GarbageCollectorStatusProvider $garbageCollectorStatusProvider; - public function __construct(StopWatch $stopWatch, MemoryMeter $memoryMeter) + public function __construct(StopWatch $stopWatch, MemoryMeter $memoryMeter, GarbageCollectorStatusProvider $garbageCollectorStatusProvider) { - $this->stopWatch = $stopWatch; - $this->memoryMeter = $memoryMeter; + $this->stopWatch = $stopWatch; + $this->memoryMeter = $memoryMeter; + $this->garbageCollectorStatusProvider = $garbageCollectorStatusProvider; } public function snapshot(): Snapshot @@ -28,7 +32,8 @@ final class System return new Snapshot( $this->stopWatch->current(), $this->memoryMeter->memoryUsage(), - $this->memoryMeter->peakMemoryUsage() + $this->memoryMeter->peakMemoryUsage(), + $this->garbageCollectorStatusProvider->status(), ); } } diff --git a/vendor/phpunit/phpunit/src/Event/Value/Telemetry/SystemMemoryMeter.php b/vendor/phpunit/phpunit/src/Event/Value/Telemetry/SystemMemoryMeter.php index f052f6f4..f5256650 100644 --- a/vendor/phpunit/phpunit/src/Event/Value/Telemetry/SystemMemoryMeter.php +++ b/vendor/phpunit/phpunit/src/Event/Value/Telemetry/SystemMemoryMeter.php @@ -13,6 +13,8 @@ use function memory_get_peak_usage; use function memory_get_usage; /** + * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit + * * @internal This class is not covered by the backward compatibility promise for PHPUnit */ final class SystemMemoryMeter implements MemoryMeter diff --git a/vendor/phpunit/phpunit/src/Event/Value/Telemetry/SystemStopWatch.php b/vendor/phpunit/phpunit/src/Event/Value/Telemetry/SystemStopWatch.php index bf37fb4e..9c9373e5 100644 --- a/vendor/phpunit/phpunit/src/Event/Value/Telemetry/SystemStopWatch.php +++ b/vendor/phpunit/phpunit/src/Event/Value/Telemetry/SystemStopWatch.php @@ -13,6 +13,8 @@ use function hrtime; use PHPUnit\Event\InvalidArgumentException; /** + * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit + * * @internal This class is not covered by the backward compatibility promise for PHPUnit */ final class SystemStopWatch implements StopWatch diff --git a/vendor/phpunit/phpunit/src/Event/Value/Telemetry/SystemStopWatchWithOffset.php b/vendor/phpunit/phpunit/src/Event/Value/Telemetry/SystemStopWatchWithOffset.php index f4515787..d27fd98c 100644 --- a/vendor/phpunit/phpunit/src/Event/Value/Telemetry/SystemStopWatchWithOffset.php +++ b/vendor/phpunit/phpunit/src/Event/Value/Telemetry/SystemStopWatchWithOffset.php @@ -13,7 +13,11 @@ use function hrtime; use PHPUnit\Event\InvalidArgumentException; /** + * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit + * * @internal This class is not covered by the backward compatibility promise for PHPUnit + * + * @codeCoverageIgnore */ final class SystemStopWatchWithOffset implements StopWatch { diff --git a/vendor/phpunit/phpunit/src/Event/Value/Test/Phpt.php b/vendor/phpunit/phpunit/src/Event/Value/Test/Phpt.php index 187b32bd..10567871 100644 --- a/vendor/phpunit/phpunit/src/Event/Value/Test/Phpt.php +++ b/vendor/phpunit/phpunit/src/Event/Value/Test/Phpt.php @@ -16,11 +16,6 @@ namespace PHPUnit\Event\Code; */ final class Phpt extends Test { - public function __construct(string $file) - { - parent::__construct($file); - } - /** * @psalm-assert-if-true Phpt $this */ @@ -29,11 +24,17 @@ final class Phpt extends Test return true; } + /** + * @psalm-return non-empty-string + */ public function id(): string { return $this->file(); } + /** + * @psalm-return non-empty-string + */ public function name(): string { return $this->file(); diff --git a/vendor/phpunit/phpunit/src/Event/Value/Test/Test.php b/vendor/phpunit/phpunit/src/Event/Value/Test/Test.php index db4fbd45..6ec899c6 100644 --- a/vendor/phpunit/phpunit/src/Event/Value/Test/Test.php +++ b/vendor/phpunit/phpunit/src/Event/Value/Test/Test.php @@ -16,13 +16,22 @@ namespace PHPUnit\Event\Code; */ abstract class Test { + /** + * @psalm-var non-empty-string + */ private readonly string $file; + /** + * @psalm-param non-empty-string $file + */ public function __construct(string $file) { $this->file = $file; } + /** + * @psalm-return non-empty-string + */ public function file(): string { return $this->file; @@ -44,7 +53,13 @@ abstract class Test return false; } + /** + * @psalm-return non-empty-string + */ abstract public function id(): string; + /** + * @psalm-return non-empty-string + */ abstract public function name(): string; } diff --git a/vendor/phpunit/phpunit/src/Event/Value/Test/TestData/DataFromDataProvider.php b/vendor/phpunit/phpunit/src/Event/Value/Test/TestData/DataFromDataProvider.php index 7ca96dd0..fb7d5610 100644 --- a/vendor/phpunit/phpunit/src/Event/Value/Test/TestData/DataFromDataProvider.php +++ b/vendor/phpunit/phpunit/src/Event/Value/Test/TestData/DataFromDataProvider.php @@ -17,15 +17,17 @@ namespace PHPUnit\Event\TestData; final class DataFromDataProvider extends TestData { private readonly int|string $dataSetName; + private readonly string $dataAsStringForResultOutput; - public static function from(int|string $dataSetName, string $data): self + public static function from(int|string $dataSetName, string $data, string $dataAsStringForResultOutput): self { - return new self($dataSetName, $data); + return new self($dataSetName, $data, $dataAsStringForResultOutput); } - protected function __construct(int|string $dataSetName, string $data) + protected function __construct(int|string $dataSetName, string $data, string $dataAsStringForResultOutput) { - $this->dataSetName = $dataSetName; + $this->dataSetName = $dataSetName; + $this->dataAsStringForResultOutput = $dataAsStringForResultOutput; parent::__construct($data); } @@ -35,6 +37,14 @@ final class DataFromDataProvider extends TestData return $this->dataSetName; } + /** + * @internal This method is not covered by the backward compatibility promise for PHPUnit + */ + public function dataAsStringForResultOutput(): string + { + return $this->dataAsStringForResultOutput; + } + /** * @psalm-assert-if-true DataFromDataProvider $this */ diff --git a/vendor/phpunit/phpunit/src/Event/Value/Test/TestDoxBuilder.php b/vendor/phpunit/phpunit/src/Event/Value/Test/TestDoxBuilder.php index 2c174698..e5919797 100644 --- a/vendor/phpunit/phpunit/src/Event/Value/Test/TestDoxBuilder.php +++ b/vendor/phpunit/phpunit/src/Event/Value/Test/TestDoxBuilder.php @@ -14,6 +14,8 @@ use PHPUnit\Framework\TestCase; use PHPUnit\Logging\TestDox\NamePrettifier; /** + * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit + * * @internal This class is not covered by the backward compatibility promise for PHPUnit */ final class TestDoxBuilder @@ -40,10 +42,12 @@ final class TestDoxBuilder { $prettifier = new NamePrettifier; + $prettifiedMethodName = $prettifier->prettifyTestMethodName($methodName); + return new TestDox( $prettifier->prettifyTestClassName($className), - $prettifier->prettifyTestMethodName($methodName), - $prettifier->prettifyTestMethodName($methodName), + $prettifiedMethodName, + $prettifiedMethodName, ); } } diff --git a/vendor/phpunit/phpunit/src/Event/Value/Test/TestMethod.php b/vendor/phpunit/phpunit/src/Event/Value/Test/TestMethod.php index 36184fc6..40330891 100644 --- a/vendor/phpunit/phpunit/src/Event/Value/Test/TestMethod.php +++ b/vendor/phpunit/phpunit/src/Event/Value/Test/TestMethod.php @@ -12,7 +12,6 @@ namespace PHPUnit\Event\Code; use function assert; use function is_int; use function sprintf; -use PHPUnit\Event\TestData\NoDataSetFromDataProviderException; use PHPUnit\Event\TestData\TestDataCollection; use PHPUnit\Metadata\MetadataCollection; @@ -32,6 +31,10 @@ final class TestMethod extends Test * @psalm-var non-empty-string */ private readonly string $methodName; + + /** + * @psalm-var non-negative-int + */ private readonly int $line; private readonly TestDox $testDox; private readonly MetadataCollection $metadata; @@ -40,6 +43,8 @@ final class TestMethod extends Test /** * @psalm-param class-string $className * @psalm-param non-empty-string $methodName + * @psalm-param non-empty-string $file + * @psalm-param non-negative-int $line */ public function __construct(string $className, string $methodName, string $file, int $line, TestDox $testDox, MetadataCollection $metadata, TestDataCollection $testData) { @@ -69,6 +74,9 @@ final class TestMethod extends Test return $this->methodName; } + /** + * @psalm-return non-negative-int + */ public function line(): int { return $this->line; @@ -98,7 +106,7 @@ final class TestMethod extends Test } /** - * @throws NoDataSetFromDataProviderException + * @psalm-return non-empty-string */ public function id(): string { @@ -112,7 +120,7 @@ final class TestMethod extends Test } /** - * @throws NoDataSetFromDataProviderException + * @psalm-return non-empty-string */ public function nameWithClass(): string { @@ -120,7 +128,7 @@ final class TestMethod extends Test } /** - * @throws NoDataSetFromDataProviderException + * @psalm-return non-empty-string */ public function name(): string { @@ -133,12 +141,12 @@ final class TestMethod extends Test if (is_int($dataSetName)) { $dataSetName = sprintf( ' with data set #%d', - $dataSetName + $dataSetName, ); } else { $dataSetName = sprintf( ' with data set "%s"', - $dataSetName + $dataSetName, ); } diff --git a/vendor/phpunit/phpunit/src/Event/Value/Test/TestMethodBuilder.php b/vendor/phpunit/phpunit/src/Event/Value/Test/TestMethodBuilder.php index 11ecf850..25ccf02f 100644 --- a/vendor/phpunit/phpunit/src/Event/Value/Test/TestMethodBuilder.php +++ b/vendor/phpunit/phpunit/src/Event/Value/Test/TestMethodBuilder.php @@ -9,18 +9,24 @@ */ namespace PHPUnit\Event\Code; +use const DEBUG_BACKTRACE_IGNORE_ARGS; +use const DEBUG_BACKTRACE_PROVIDE_OBJECT; use function assert; +use function debug_backtrace; use function is_numeric; +use PHPUnit\Event\Facade as EventFacade; use PHPUnit\Event\TestData\DataFromDataProvider; use PHPUnit\Event\TestData\DataFromTestDependency; use PHPUnit\Event\TestData\MoreThanOneDataSetFromDataProviderException; use PHPUnit\Event\TestData\TestDataCollection; use PHPUnit\Framework\TestCase; use PHPUnit\Metadata\Parser\Registry as MetadataRegistry; +use PHPUnit\Util\Exporter; use PHPUnit\Util\Reflection; -use SebastianBergmann\Exporter\Exporter; /** + * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit + * * @internal This class is not covered by the backward compatibility promise for PHPUnit */ final class TestMethodBuilder @@ -42,11 +48,25 @@ final class TestMethodBuilder $location['file'], $location['line'], TestDoxBuilder::fromTestCase($testCase), - MetadataRegistry::parser()->for($testCase::class, $methodName), + MetadataRegistry::parser()->forClassAndMethod($testCase::class, $methodName), self::dataFor($testCase), ); } + /** + * @throws NoTestCaseObjectOnCallStackException + */ + public static function fromCallStack(): TestMethod + { + foreach (debug_backtrace(DEBUG_BACKTRACE_PROVIDE_OBJECT | DEBUG_BACKTRACE_IGNORE_ARGS) as $frame) { + if (isset($frame['object']) && $frame['object'] instanceof TestCase) { + return $frame['object']->valueObjectForEvents(); + } + } + + throw new NoTestCaseObjectOnCallStackException; + } + /** * @throws MoreThanOneDataSetFromDataProviderException */ @@ -63,13 +83,14 @@ final class TestMethodBuilder $testData[] = DataFromDataProvider::from( $dataSetName, - (new Exporter)->export($testCase->providedData()) + Exporter::export($testCase->providedData(), EventFacade::emitter()->exportsObjects()), + $testCase->dataSetAsStringWithData(), ); } if ($testCase->hasDependencyInput()) { $testData[] = DataFromTestDependency::from( - (new Exporter)->export($testCase->dependencyInput()) + Exporter::export($testCase->dependencyInput(), EventFacade::emitter()->exportsObjects()), ); } diff --git a/vendor/phpunit/phpunit/src/Event/Value/TestSuite/TestSuite.php b/vendor/phpunit/phpunit/src/Event/Value/TestSuite/TestSuite.php index 88218764..744f7095 100644 --- a/vendor/phpunit/phpunit/src/Event/Value/TestSuite/TestSuite.php +++ b/vendor/phpunit/phpunit/src/Event/Value/TestSuite/TestSuite.php @@ -18,10 +18,16 @@ use PHPUnit\Event\Code\TestCollection; */ abstract class TestSuite { + /** + * @psalm-var non-empty-string + */ private readonly string $name; private readonly int $count; private readonly TestCollection $tests; + /** + * @psalm-param non-empty-string $name + */ public function __construct(string $name, int $size, TestCollection $tests) { $this->name = $name; @@ -29,6 +35,9 @@ abstract class TestSuite $this->tests = $tests; } + /** + * @psalm-return non-empty-string + */ public function name(): string { return $this->name; diff --git a/vendor/phpunit/phpunit/src/Event/Value/TestSuite/TestSuiteBuilder.php b/vendor/phpunit/phpunit/src/Event/Value/TestSuite/TestSuiteBuilder.php index 52d8984e..96a29375 100644 --- a/vendor/phpunit/phpunit/src/Event/Value/TestSuite/TestSuiteBuilder.php +++ b/vendor/phpunit/phpunit/src/Event/Value/TestSuite/TestSuiteBuilder.php @@ -10,6 +10,7 @@ namespace PHPUnit\Event\TestSuite; use function explode; +use PHPUnit\Event\Code\Test; use PHPUnit\Event\Code\TestCollection; use PHPUnit\Event\RuntimeException; use PHPUnit\Framework\DataProviderTestSuite; @@ -21,6 +22,8 @@ use ReflectionException; use ReflectionMethod; /** + * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit + * * @internal This class is not covered by the backward compatibility promise for PHPUnit */ final class TestSuiteBuilder @@ -30,34 +33,18 @@ final class TestSuiteBuilder */ public static function from(FrameworkTestSuite $testSuite): TestSuite { - $groups = []; - - foreach ($testSuite->getGroupDetails() as $groupName => $tests) { - if (!isset($groups[$groupName])) { - $groups[$groupName] = []; - } - - foreach ($tests as $test) { - $groups[$groupName][] = $test::class; - } - } - $tests = []; - foreach ($testSuite->tests() as $test) { - if ($test instanceof TestCase || $test instanceof PhptTestCase) { - $tests[] = $test->valueObjectForEvents(); - } - } + self::process($testSuite, $tests); if ($testSuite instanceof DataProviderTestSuite) { - [$className, $methodName] = explode('::', $testSuite->getName()); + [$className, $methodName] = explode('::', $testSuite->name()); try { $reflector = new ReflectionMethod($className, $methodName); return new TestSuiteForTestMethodWithDataProvider( - $testSuite->getName(), + $testSuite->name(), $testSuite->count(), TestCollection::fromArray($tests), $className, @@ -70,7 +57,7 @@ final class TestSuiteBuilder throw new RuntimeException( $e->getMessage(), $e->getCode(), - $e + $e, ); } // @codeCoverageIgnoreEnd @@ -78,10 +65,10 @@ final class TestSuiteBuilder if ($testSuite->isForTestClass()) { try { - $reflector = new ReflectionClass($testSuite->getName()); + $reflector = new ReflectionClass($testSuite->name()); return new TestSuiteForTestClass( - $testSuite->getName(), + $testSuite->name(), $testSuite->count(), TestCollection::fromArray($tests), $reflector->getFileName(), @@ -92,16 +79,34 @@ final class TestSuiteBuilder throw new RuntimeException( $e->getMessage(), $e->getCode(), - $e + $e, ); } // @codeCoverageIgnoreEnd } return new TestSuiteWithName( - $testSuite->getName(), + $testSuite->name(), $testSuite->count(), TestCollection::fromArray($tests), ); } + + /** + * @psalm-param list $tests + */ + private static function process(FrameworkTestSuite $testSuite, array &$tests): void + { + foreach ($testSuite->getIterator() as $test) { + if ($test instanceof FrameworkTestSuite) { + self::process($test, $tests); + + continue; + } + + if ($test instanceof TestCase || $test instanceof PhptTestCase) { + $tests[] = $test->valueObjectForEvents(); + } + } + } } diff --git a/vendor/phpunit/phpunit/src/Event/Value/TestSuite/TestSuiteForTestMethodWithDataProvider.php b/vendor/phpunit/phpunit/src/Event/Value/TestSuite/TestSuiteForTestMethodWithDataProvider.php index 17d3ea1f..29bebc6f 100644 --- a/vendor/phpunit/phpunit/src/Event/Value/TestSuite/TestSuiteForTestMethodWithDataProvider.php +++ b/vendor/phpunit/phpunit/src/Event/Value/TestSuite/TestSuiteForTestMethodWithDataProvider.php @@ -31,6 +31,7 @@ final class TestSuiteForTestMethodWithDataProvider extends TestSuite private readonly int $line; /** + * @psalm-param non-empty-string $name * @psalm-param class-string $className * @psalm-param non-empty-string $methodName */ diff --git a/vendor/phpunit/phpunit/src/Event/Value/ThrowableBuilder.php b/vendor/phpunit/phpunit/src/Event/Value/ThrowableBuilder.php index 3e8afb91..4c12b6ed 100644 --- a/vendor/phpunit/phpunit/src/Event/Value/ThrowableBuilder.php +++ b/vendor/phpunit/phpunit/src/Event/Value/ThrowableBuilder.php @@ -15,6 +15,8 @@ use PHPUnit\Util\Filter; use PHPUnit\Util\ThrowableToStringMapper; /** + * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit + * * @internal This class is not covered by the backward compatibility promise for PHPUnit */ final class ThrowableBuilder @@ -35,8 +37,8 @@ final class ThrowableBuilder $t::class, $t->getMessage(), ThrowableToStringMapper::map($t), - Filter::getFilteredStacktrace($t), - $previous + Filter::getFilteredStacktrace($t, false), + $previous, ); } } diff --git a/vendor/phpunit/phpunit/src/Framework/Assert.php b/vendor/phpunit/phpunit/src/Framework/Assert.php index 41430cfc..d775a578 100644 --- a/vendor/phpunit/phpunit/src/Framework/Assert.php +++ b/vendor/phpunit/phpunit/src/Framework/Assert.php @@ -51,6 +51,7 @@ use PHPUnit\Framework\Constraint\LogicalNot; use PHPUnit\Framework\Constraint\LogicalOr; use PHPUnit\Framework\Constraint\LogicalXor; use PHPUnit\Framework\Constraint\ObjectEquals; +use PHPUnit\Framework\Constraint\ObjectHasProperty; use PHPUnit\Framework\Constraint\RegularExpression; use PHPUnit\Framework\Constraint\SameSize; use PHPUnit\Framework\Constraint\StringContains; @@ -61,7 +62,6 @@ use PHPUnit\Framework\Constraint\StringStartsWith; use PHPUnit\Framework\Constraint\TraversableContainsEqual; use PHPUnit\Framework\Constraint\TraversableContainsIdentical; use PHPUnit\Framework\Constraint\TraversableContainsOnly; -use PHPUnit\Util\Type; use PHPUnit\Util\Xml\Loader as XmlLoader; use PHPUnit\Util\Xml\XmlException; @@ -78,7 +78,7 @@ abstract class Assert * @throws Exception * @throws ExpectationFailedException */ - final public static function assertArrayHasKey(int|string $key, array|ArrayAccess $array, string $message = ''): void + final public static function assertArrayHasKey(mixed $key, array|ArrayAccess $array, string $message = ''): void { $constraint = new ArrayHasKey($key); @@ -91,10 +91,10 @@ abstract class Assert * @throws Exception * @throws ExpectationFailedException */ - final public static function assertArrayNotHasKey(int|string $key, array|ArrayAccess $array, string $message = ''): void + final public static function assertArrayNotHasKey(mixed $key, array|ArrayAccess $array, string $message = ''): void { $constraint = new LogicalNot( - new ArrayHasKey($key) + new ArrayHasKey($key), ); static::assertThat($array, $constraint, $message); @@ -108,7 +108,7 @@ abstract class Assert static::assertThat( $array, new IsList, - $message + $message, ); } @@ -144,7 +144,7 @@ abstract class Assert final public static function assertNotContains(mixed $needle, iterable $haystack, string $message = ''): void { $constraint = new LogicalNot( - new TraversableContainsIdentical($needle) + new TraversableContainsIdentical($needle), ); static::assertThat($haystack, $constraint, $message); @@ -176,9 +176,9 @@ abstract class Assert $haystack, new TraversableContainsOnly( $type, - $isNativeType + $isNativeType, ), - $message + $message, ); } @@ -194,9 +194,9 @@ abstract class Assert $haystack, new TraversableContainsOnly( $className, - false + false, ), - $message + $message, ); } @@ -217,10 +217,10 @@ abstract class Assert new LogicalNot( new TraversableContainsOnly( $type, - $isNativeType - ) + $isNativeType, + ), ), - $message + $message, ); } @@ -240,7 +240,7 @@ abstract class Assert static::assertThat( $haystack, new Count($expectedCount), - $message + $message, ); } @@ -258,7 +258,7 @@ abstract class Assert } $constraint = new LogicalNot( - new Count($expectedCount) + new Count($expectedCount), ); static::assertThat($haystack, $constraint, $message); @@ -309,7 +309,7 @@ abstract class Assert { $constraint = new IsEqualWithDelta( $expected, - $delta + $delta, ); static::assertThat($actual, $constraint, $message); @@ -323,7 +323,7 @@ abstract class Assert final public static function assertNotEquals(mixed $expected, mixed $actual, string $message = ''): void { $constraint = new LogicalNot( - new IsEqual($expected) + new IsEqual($expected), ); static::assertThat($actual, $constraint, $message); @@ -337,7 +337,7 @@ abstract class Assert final public static function assertNotEqualsCanonicalizing(mixed $expected, mixed $actual, string $message = ''): void { $constraint = new LogicalNot( - new IsEqualCanonicalizing($expected) + new IsEqualCanonicalizing($expected), ); static::assertThat($actual, $constraint, $message); @@ -351,7 +351,7 @@ abstract class Assert final public static function assertNotEqualsIgnoringCase(mixed $expected, mixed $actual, string $message = ''): void { $constraint = new LogicalNot( - new IsEqualIgnoringCase($expected) + new IsEqualIgnoringCase($expected), ); static::assertThat($actual, $constraint, $message); @@ -367,8 +367,8 @@ abstract class Assert $constraint = new LogicalNot( new IsEqualWithDelta( $expected, - $delta - ) + $delta, + ), ); static::assertThat($actual, $constraint, $message); @@ -382,7 +382,7 @@ abstract class Assert static::assertThat( $actual, static::objectEquals($expected, $method), - $message + $message, ); } @@ -440,7 +440,7 @@ abstract class Assert static::assertThat( $actual, static::greaterThanOrEqual($expected), - $message + $message, ); } @@ -492,7 +492,7 @@ abstract class Assert static::assertFileExists($actual, $message); $constraint = new IsEqualCanonicalizing( - file_get_contents($expected) + file_get_contents($expected), ); static::assertThat(file_get_contents($actual), $constraint, $message); @@ -526,7 +526,7 @@ abstract class Assert static::assertFileExists($actual, $message); $constraint = new LogicalNot( - new IsEqual(file_get_contents($expected)) + new IsEqual(file_get_contents($expected)), ); static::assertThat(file_get_contents($actual), $constraint, $message); @@ -544,7 +544,7 @@ abstract class Assert static::assertFileExists($actual, $message); $constraint = new LogicalNot( - new IsEqualCanonicalizing(file_get_contents($expected)) + new IsEqualCanonicalizing(file_get_contents($expected)), ); static::assertThat(file_get_contents($actual), $constraint, $message); @@ -562,7 +562,7 @@ abstract class Assert static::assertFileExists($actual, $message); $constraint = new LogicalNot( - new IsEqualIgnoringCase(file_get_contents($expected)) + new IsEqualIgnoringCase(file_get_contents($expected)), ); static::assertThat(file_get_contents($actual), $constraint, $message); @@ -624,7 +624,7 @@ abstract class Assert static::assertFileExists($expectedFile, $message); $constraint = new LogicalNot( - new IsEqual(file_get_contents($expectedFile)) + new IsEqual(file_get_contents($expectedFile)), ); static::assertThat($actualString, $constraint, $message); @@ -641,7 +641,7 @@ abstract class Assert static::assertFileExists($expectedFile, $message); $constraint = new LogicalNot( - new IsEqualCanonicalizing(file_get_contents($expectedFile)) + new IsEqualCanonicalizing(file_get_contents($expectedFile)), ); static::assertThat($actualString, $constraint, $message); @@ -658,7 +658,7 @@ abstract class Assert static::assertFileExists($expectedFile, $message); $constraint = new LogicalNot( - new IsEqualIgnoringCase(file_get_contents($expectedFile)) + new IsEqualIgnoringCase(file_get_contents($expectedFile)), ); static::assertThat($actualString, $constraint, $message); @@ -934,17 +934,47 @@ abstract class Assert static::assertThat($actual, static::isNan(), $message); } + /** + * Asserts that an object has a specified property. + * + * @throws ExpectationFailedException + */ + final public static function assertObjectHasProperty(string $propertyName, object $object, string $message = ''): void + { + static::assertThat( + $object, + new ObjectHasProperty($propertyName), + $message, + ); + } + + /** + * Asserts that an object does not have a specified property. + * + * @throws ExpectationFailedException + */ + final public static function assertObjectNotHasProperty(string $propertyName, object $object, string $message = ''): void + { + static::assertThat( + $object, + new LogicalNot( + new ObjectHasProperty($propertyName), + ), + $message, + ); + } + /** * Asserts that two variables have the same type and value. * Used on objects, it asserts that two variables reference * the same object. * - * @throws ExpectationFailedException - * * @psalm-template ExpectedType * * @psalm-param ExpectedType $expected * + * @throws ExpectationFailedException + * * @psalm-assert =ExpectedType $actual */ final public static function assertSame(mixed $expected, mixed $actual, string $message = ''): void @@ -952,7 +982,7 @@ abstract class Assert static::assertThat( $actual, new IsIdentical($expected), - $message + $message, ); } @@ -972,23 +1002,23 @@ abstract class Assert static::assertThat( $actual, new LogicalNot( - new IsIdentical($expected) + new IsIdentical($expected), ), - $message + $message, ); } /** * Asserts that a variable is of a given type. * - * @throws Exception - * @throws ExpectationFailedException - * @throws UnknownClassOrInterfaceException - * * @psalm-template ExpectedType of object * * @psalm-param class-string $expected * + * @throws Exception + * @throws ExpectationFailedException + * @throws UnknownClassOrInterfaceException + * * @psalm-assert =ExpectedType $actual */ final public static function assertInstanceOf(string $expected, mixed $actual, string $message = ''): void @@ -1000,20 +1030,20 @@ abstract class Assert static::assertThat( $actual, new IsInstanceOf($expected), - $message + $message, ); } /** * Asserts that a variable is not of a given type. * - * @throws Exception - * @throws ExpectationFailedException - * * @psalm-template ExpectedType of object * * @psalm-param class-string $expected * + * @throws Exception + * @throws ExpectationFailedException + * * @psalm-assert !ExpectedType $actual */ final public static function assertNotInstanceOf(string $expected, mixed $actual, string $message = ''): void @@ -1025,9 +1055,9 @@ abstract class Assert static::assertThat( $actual, new LogicalNot( - new IsInstanceOf($expected) + new IsInstanceOf($expected), ), - $message + $message, ); } @@ -1044,7 +1074,7 @@ abstract class Assert static::assertThat( $actual, new IsType(IsType::TYPE_ARRAY), - $message + $message, ); } @@ -1061,7 +1091,7 @@ abstract class Assert static::assertThat( $actual, new IsType(IsType::TYPE_BOOL), - $message + $message, ); } @@ -1078,7 +1108,7 @@ abstract class Assert static::assertThat( $actual, new IsType(IsType::TYPE_FLOAT), - $message + $message, ); } @@ -1095,7 +1125,7 @@ abstract class Assert static::assertThat( $actual, new IsType(IsType::TYPE_INT), - $message + $message, ); } @@ -1112,7 +1142,7 @@ abstract class Assert static::assertThat( $actual, new IsType(IsType::TYPE_NUMERIC), - $message + $message, ); } @@ -1129,7 +1159,7 @@ abstract class Assert static::assertThat( $actual, new IsType(IsType::TYPE_OBJECT), - $message + $message, ); } @@ -1146,7 +1176,7 @@ abstract class Assert static::assertThat( $actual, new IsType(IsType::TYPE_RESOURCE), - $message + $message, ); } @@ -1163,7 +1193,7 @@ abstract class Assert static::assertThat( $actual, new IsType(IsType::TYPE_CLOSED_RESOURCE), - $message + $message, ); } @@ -1180,7 +1210,7 @@ abstract class Assert static::assertThat( $actual, new IsType(IsType::TYPE_STRING), - $message + $message, ); } @@ -1197,7 +1227,7 @@ abstract class Assert static::assertThat( $actual, new IsType(IsType::TYPE_SCALAR), - $message + $message, ); } @@ -1214,7 +1244,7 @@ abstract class Assert static::assertThat( $actual, new IsType(IsType::TYPE_CALLABLE), - $message + $message, ); } @@ -1231,7 +1261,7 @@ abstract class Assert static::assertThat( $actual, new IsType(IsType::TYPE_ITERABLE), - $message + $message, ); } @@ -1248,7 +1278,7 @@ abstract class Assert static::assertThat( $actual, new LogicalNot(new IsType(IsType::TYPE_ARRAY)), - $message + $message, ); } @@ -1265,7 +1295,7 @@ abstract class Assert static::assertThat( $actual, new LogicalNot(new IsType(IsType::TYPE_BOOL)), - $message + $message, ); } @@ -1282,7 +1312,7 @@ abstract class Assert static::assertThat( $actual, new LogicalNot(new IsType(IsType::TYPE_FLOAT)), - $message + $message, ); } @@ -1299,7 +1329,7 @@ abstract class Assert static::assertThat( $actual, new LogicalNot(new IsType(IsType::TYPE_INT)), - $message + $message, ); } @@ -1316,7 +1346,7 @@ abstract class Assert static::assertThat( $actual, new LogicalNot(new IsType(IsType::TYPE_NUMERIC)), - $message + $message, ); } @@ -1333,7 +1363,7 @@ abstract class Assert static::assertThat( $actual, new LogicalNot(new IsType(IsType::TYPE_OBJECT)), - $message + $message, ); } @@ -1350,7 +1380,7 @@ abstract class Assert static::assertThat( $actual, new LogicalNot(new IsType(IsType::TYPE_RESOURCE)), - $message + $message, ); } @@ -1367,7 +1397,7 @@ abstract class Assert static::assertThat( $actual, new LogicalNot(new IsType(IsType::TYPE_CLOSED_RESOURCE)), - $message + $message, ); } @@ -1384,7 +1414,7 @@ abstract class Assert static::assertThat( $actual, new LogicalNot(new IsType(IsType::TYPE_STRING)), - $message + $message, ); } @@ -1401,7 +1431,7 @@ abstract class Assert static::assertThat( $actual, new LogicalNot(new IsType(IsType::TYPE_SCALAR)), - $message + $message, ); } @@ -1418,7 +1448,7 @@ abstract class Assert static::assertThat( $actual, new LogicalNot(new IsType(IsType::TYPE_CALLABLE)), - $message + $message, ); } @@ -1435,7 +1465,7 @@ abstract class Assert static::assertThat( $actual, new LogicalNot(new IsType(IsType::TYPE_ITERABLE)), - $message + $message, ); } @@ -1459,9 +1489,9 @@ abstract class Assert static::assertThat( $string, new LogicalNot( - new RegularExpression($pattern) + new RegularExpression($pattern), ), - $message + $message, ); } @@ -1486,7 +1516,7 @@ abstract class Assert static::assertThat( $actual, new SameSize($expected), - $message + $message, ); } @@ -1511,9 +1541,9 @@ abstract class Assert static::assertThat( $actual, new LogicalNot( - new SameSize($expected) + new SameSize($expected), ), - $message + $message, ); } @@ -1535,6 +1565,39 @@ abstract class Assert static::assertThat($actual, new StringEqualsStringIgnoringLineEndings($expected), $message); } + /** + * Asserts that a string matches a given format string. + * + * @throws ExpectationFailedException + */ + final public static function assertFileMatchesFormat(string $format, string $actualFile, string $message = ''): void + { + static::assertFileExists($actualFile, $message); + + static::assertThat( + file_get_contents($actualFile), + new StringMatchesFormatDescription($format), + $message, + ); + } + + /** + * Asserts that a string matches a given format string. + * + * @throws ExpectationFailedException + */ + final public static function assertFileMatchesFormatFile(string $formatFile, string $actualFile, string $message = ''): void + { + static::assertFileExists($formatFile, $message); + static::assertFileExists($actualFile, $message); + + static::assertThat( + file_get_contents($actualFile), + new StringMatchesFormatDescription(file_get_contents($formatFile)), + $message, + ); + } + /** * Asserts that a string matches a given format string. * @@ -1549,15 +1612,17 @@ abstract class Assert * Asserts that a string does not match a given format string. * * @throws ExpectationFailedException + * + * @deprecated https://github.com/sebastianbergmann/phpunit/issues/5472 */ final public static function assertStringNotMatchesFormat(string $format, string $string, string $message = ''): void { static::assertThat( $string, new LogicalNot( - new StringMatchesFormatDescription($format) + new StringMatchesFormatDescription($format), ), - $message + $message, ); } @@ -1573,9 +1638,9 @@ abstract class Assert static::assertThat( $string, new StringMatchesFormatDescription( - file_get_contents($formatFile) + file_get_contents($formatFile), ), - $message + $message, ); } @@ -1583,6 +1648,8 @@ abstract class Assert * Asserts that a string does not match a given format string. * * @throws ExpectationFailedException + * + * @deprecated https://github.com/sebastianbergmann/phpunit/issues/5472 */ final public static function assertStringNotMatchesFormatFile(string $formatFile, string $string, string $message = ''): void { @@ -1592,10 +1659,10 @@ abstract class Assert $string, new LogicalNot( new StringMatchesFormatDescription( - file_get_contents($formatFile) - ) + file_get_contents($formatFile), + ), ), - $message + $message, ); } @@ -1625,9 +1692,9 @@ abstract class Assert static::assertThat( $string, new LogicalNot( - new StringStartsWith($prefix) + new StringStartsWith($prefix), ), - $message + $message, ); } @@ -1697,9 +1764,9 @@ abstract class Assert static::assertThat( $string, new LogicalNot( - new StringEndsWith($suffix) + new StringEndsWith($suffix), ), - $message + $message, ); } @@ -1856,9 +1923,9 @@ abstract class Assert static::assertThat( $actualJson, new LogicalNot( - new JsonMatches($expectedJson) + new JsonMatches($expectedJson), ), - $message + $message, ); } @@ -1894,9 +1961,9 @@ abstract class Assert static::assertThat( $actualJson, new LogicalNot( - new JsonMatches($expectedJson) + new JsonMatches($expectedJson), ), - $message + $message, ); } @@ -1917,7 +1984,7 @@ abstract class Assert static::assertJson($actualJson, $message); $constraintExpected = new JsonMatches( - $expectedJson + $expectedJson, ); $constraintActual = new JsonMatches($actualJson); @@ -1943,7 +2010,7 @@ abstract class Assert static::assertJson($actualJson, $message); $constraintExpected = new JsonMatches( - $expectedJson + $expectedJson, ); $constraintActual = new JsonMatches($actualJson); @@ -2053,7 +2120,7 @@ abstract class Assert return new TraversableContainsOnly($className, false); } - final public static function arrayHasKey(int|string $key): ArrayHasKey + final public static function arrayHasKey(mixed $key): ArrayHasKey { return new ArrayHasKey($key); } @@ -2117,7 +2184,7 @@ abstract class Assert { return static::logicalOr( new IsEqual($value), - new GreaterThan($value) + new GreaterThan($value), ); } @@ -2135,6 +2202,8 @@ abstract class Assert } /** + * @psalm-param 'array'|'boolean'|'bool'|'double'|'float'|'integer'|'int'|'null'|'numeric'|'object'|'real'|'resource'|'resource (closed)'|'string'|'scalar'|'callable'|'iterable' $type + * * @throws Exception */ final public static function isType(string $type): IsType @@ -2151,7 +2220,7 @@ abstract class Assert { return static::logicalOr( new IsEqual($value), - new LessThan($value) + new LessThan($value), ); } @@ -2257,7 +2326,7 @@ abstract class Assert { return match ($type) { 'numeric', 'integer', 'int', 'iterable', 'float', 'string', 'boolean', 'bool', 'null', 'array', 'object', 'resource', 'scalar' => true, - default => false, + default => false, }; } } diff --git a/vendor/phpunit/phpunit/src/Framework/Assert/Functions.php b/vendor/phpunit/phpunit/src/Framework/Assert/Functions.php index ad9a62c7..b686eab3 100644 --- a/vendor/phpunit/phpunit/src/Framework/Assert/Functions.php +++ b/vendor/phpunit/phpunit/src/Framework/Assert/Functions.php @@ -80,7 +80,7 @@ if (!function_exists('PHPUnit\Framework\assertArrayHasKey')) { * * @see Assert::assertArrayHasKey */ - function assertArrayHasKey(int|string $key, array|ArrayAccess $array, string $message = ''): void + function assertArrayHasKey(mixed $key, array|ArrayAccess $array, string $message = ''): void { Assert::assertArrayHasKey(...func_get_args()); } @@ -97,7 +97,7 @@ if (!function_exists('PHPUnit\Framework\assertArrayNotHasKey')) { * * @see Assert::assertArrayNotHasKey */ - function assertArrayNotHasKey(int|string $key, array|ArrayAccess $array, string $message = ''): void + function assertArrayNotHasKey(mixed $key, array|ArrayAccess $array, string $message = ''): void { Assert::assertArrayNotHasKey(...func_get_args()); } @@ -1126,18 +1126,50 @@ if (!function_exists('PHPUnit\Framework\assertNan')) { } } +if (!function_exists('PHPUnit\Framework\assertObjectHasProperty')) { + /** + * Asserts that an object has a specified property. + * + * @throws ExpectationFailedException + * + * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit + * + * @see Assert::assertObjectHasProperty + */ + function assertObjectHasProperty(string $propertyName, object $object, string $message = ''): void + { + Assert::assertObjectHasProperty(...func_get_args()); + } +} + +if (!function_exists('PHPUnit\Framework\assertObjectNotHasProperty')) { + /** + * Asserts that an object does not have a specified property. + * + * @throws ExpectationFailedException + * + * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit + * + * @see Assert::assertObjectNotHasProperty + */ + function assertObjectNotHasProperty(string $propertyName, object $object, string $message = ''): void + { + Assert::assertObjectNotHasProperty(...func_get_args()); + } +} + if (!function_exists('PHPUnit\Framework\assertSame')) { /** * Asserts that two variables have the same type and value. * Used on objects, it asserts that two variables reference * the same object. * - * @throws ExpectationFailedException - * * @psalm-template ExpectedType * * @psalm-param ExpectedType $expected * + * @throws ExpectationFailedException + * * @psalm-assert =ExpectedType $actual * * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit @@ -1172,13 +1204,14 @@ if (!function_exists('PHPUnit\Framework\assertInstanceOf')) { /** * Asserts that a variable is of a given type. * - * @throws Exception - * @throws ExpectationFailedException - * * @psalm-template ExpectedType of object * * @psalm-param class-string $expected * + * @throws Exception + * @throws ExpectationFailedException + * @throws UnknownClassOrInterfaceException + * * @psalm-assert =ExpectedType $actual * * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit @@ -1195,13 +1228,13 @@ if (!function_exists('PHPUnit\Framework\assertNotInstanceOf')) { /** * Asserts that a variable is not of a given type. * - * @throws Exception - * @throws ExpectationFailedException - * * @psalm-template ExpectedType of object * * @psalm-param class-string $expected * + * @throws Exception + * @throws ExpectationFailedException + * * @psalm-assert !ExpectedType $actual * * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit @@ -1770,6 +1803,38 @@ if (!function_exists('PHPUnit\Framework\assertStringEqualsStringIgnoringLineEndi } } +if (!function_exists('PHPUnit\Framework\assertFileMatchesFormat')) { + /** + * Asserts that a string matches a given format string. + * + * @throws ExpectationFailedException + * + * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit + * + * @see Assert::assertFileMatchesFormat + */ + function assertFileMatchesFormat(string $format, string $actualFile, string $message = ''): void + { + Assert::assertFileMatchesFormat(...func_get_args()); + } +} + +if (!function_exists('PHPUnit\Framework\assertFileMatchesFormatFile')) { + /** + * Asserts that a string matches a given format string. + * + * @throws ExpectationFailedException + * + * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit + * + * @see Assert::assertFileMatchesFormatFile + */ + function assertFileMatchesFormatFile(string $formatFile, string $actualFile, string $message = ''): void + { + Assert::assertFileMatchesFormatFile(...func_get_args()); + } +} + if (!function_exists('PHPUnit\Framework\assertStringMatchesFormat')) { /** * Asserts that a string matches a given format string. @@ -1792,6 +1857,8 @@ if (!function_exists('PHPUnit\Framework\assertStringNotMatchesFormat')) { * * @throws ExpectationFailedException * + * @deprecated https://github.com/sebastianbergmann/phpunit/issues/5472 + * * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit * * @see Assert::assertStringNotMatchesFormat @@ -1824,6 +1891,8 @@ if (!function_exists('PHPUnit\Framework\assertStringNotMatchesFormatFile')) { * * @throws ExpectationFailedException * + * @deprecated https://github.com/sebastianbergmann/phpunit/issues/5472 + * * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit * * @see Assert::assertStringNotMatchesFormatFile @@ -2198,9 +2267,6 @@ if (!function_exists('PHPUnit\Framework\assertJsonFileNotEqualsJsonFile')) { } if (!function_exists('PHPUnit\Framework\logicalAnd')) { - /** - * @throws Exception - */ function logicalAnd(mixed ...$constraints): LogicalAnd { return Assert::logicalAnd(...func_get_args()); @@ -2242,13 +2308,6 @@ if (!function_exists('PHPUnit\Framework\isTrue')) { } } -if (!function_exists('PHPUnit\Framework\callback')) { - function callback(callable $callback): Callback - { - return Assert::callback(...func_get_args()); - } -} - if (!function_exists('PHPUnit\Framework\isFalse')) { function isFalse(): IsFalse { @@ -2306,9 +2365,6 @@ if (!function_exists('PHPUnit\Framework\containsIdentical')) { } if (!function_exists('PHPUnit\Framework\containsOnly')) { - /** - * @throws Exception - */ function containsOnly(string $type): TraversableContainsOnly { return Assert::containsOnly(...func_get_args()); @@ -2316,9 +2372,6 @@ if (!function_exists('PHPUnit\Framework\containsOnly')) { } if (!function_exists('PHPUnit\Framework\containsOnlyInstancesOf')) { - /** - * @throws Exception - */ function containsOnlyInstancesOf(string $className): TraversableContainsOnly { return Assert::containsOnlyInstancesOf(...func_get_args()); @@ -2326,7 +2379,7 @@ if (!function_exists('PHPUnit\Framework\containsOnlyInstancesOf')) { } if (!function_exists('PHPUnit\Framework\arrayHasKey')) { - function arrayHasKey(int|string $key): ArrayHasKey + function arrayHasKey(mixed $key): ArrayHasKey { return Assert::arrayHasKey(...func_get_args()); } @@ -2424,9 +2477,6 @@ if (!function_exists('PHPUnit\Framework\identicalTo')) { } if (!function_exists('PHPUnit\Framework\isInstanceOf')) { - /** - * @throws UnknownClassOrInterfaceException - */ function isInstanceOf(string $className): IsInstanceOf { return Assert::isInstanceOf(...func_get_args()); @@ -2434,9 +2484,6 @@ if (!function_exists('PHPUnit\Framework\isInstanceOf')) { } if (!function_exists('PHPUnit\Framework\isType')) { - /** - * @throws Exception - */ function isType(string $type): IsType { return Assert::isType(...func_get_args()); @@ -2472,9 +2519,6 @@ if (!function_exists('PHPUnit\Framework\matches')) { } if (!function_exists('PHPUnit\Framework\stringStartsWith')) { - /** - * @throws InvalidArgumentException - */ function stringStartsWith(string $prefix): StringStartsWith { return Assert::stringStartsWith(...func_get_args()); @@ -2482,9 +2526,6 @@ if (!function_exists('PHPUnit\Framework\stringStartsWith')) { } if (!function_exists('PHPUnit\Framework\stringContains')) { - /** - * @throws InvalidArgumentException - */ function stringContains(string $string, bool $case = true): StringContains { return Assert::stringContains(...func_get_args()); @@ -2492,9 +2533,6 @@ if (!function_exists('PHPUnit\Framework\stringContains')) { } if (!function_exists('PHPUnit\Framework\stringEndsWith')) { - /** - * @throws InvalidArgumentException - */ function stringEndsWith(string $suffix): StringEndsWith { return Assert::stringEndsWith(...func_get_args()); @@ -2522,6 +2560,20 @@ if (!function_exists('PHPUnit\Framework\objectEquals')) { } } +if (!function_exists('PHPUnit\Framework\callback')) { + /** + * @psalm-template CallbackInput of mixed + * + * @psalm-param callable(CallbackInput $callback): bool $callback + * + * @psalm-return Callback + */ + function callback(callable $callback): Callback + { + return Assert::callback($callback); + } +} + if (!function_exists('PHPUnit\Framework\any')) { /** * Returns a matcher that matches when the method is executed @@ -2551,7 +2603,7 @@ if (!function_exists('PHPUnit\Framework\atLeast')) { function atLeast(int $requiredInvocations): InvokedAtLeastCountMatcher { return new InvokedAtLeastCountMatcher( - $requiredInvocations + $requiredInvocations, ); } } diff --git a/vendor/phpunit/phpunit/src/Framework/Attributes/CodeCoverageIgnore.php b/vendor/phpunit/phpunit/src/Framework/Attributes/CodeCoverageIgnore.php index 235177ee..38ec37ad 100644 --- a/vendor/phpunit/phpunit/src/Framework/Attributes/CodeCoverageIgnore.php +++ b/vendor/phpunit/phpunit/src/Framework/Attributes/CodeCoverageIgnore.php @@ -15,6 +15,8 @@ use Attribute; * @psalm-immutable * * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit + * + * @deprecated https://github.com/sebastianbergmann/phpunit/issues/5236 */ #[Attribute(Attribute::TARGET_CLASS | Attribute::TARGET_METHOD)] final class CodeCoverageIgnore diff --git a/vendor/phpunit/phpunit/src/Framework/Constraint/Callback.php b/vendor/phpunit/phpunit/src/Framework/Constraint/Callback.php index 665ed543..8a0e1b8a 100644 --- a/vendor/phpunit/phpunit/src/Framework/Constraint/Callback.php +++ b/vendor/phpunit/phpunit/src/Framework/Constraint/Callback.php @@ -9,6 +9,9 @@ */ namespace PHPUnit\Framework\Constraint; +use Closure; +use ReflectionFunction; + /** * @psalm-template CallbackInput of mixed * @@ -37,14 +40,34 @@ final class Callback extends Constraint return 'is accepted by specified callback'; } + /** + * @psalm-suppress ArgumentTypeCoercion + */ + public function isVariadic(): bool + { + foreach ((new ReflectionFunction(Closure::fromCallable($this->callback)))->getParameters() as $parameter) { + if ($parameter->isVariadic()) { + return true; + } + } + + return false; + } + /** * Evaluates the constraint for parameter $value. Returns true if the * constraint is met, false otherwise. * * @psalm-param CallbackInput $other + * + * @psalm-suppress InvalidArgument */ protected function matches(mixed $other): bool { + if ($this->isVariadic()) { + return ($this->callback)(...$other); + } + return ($this->callback)($other); } } diff --git a/vendor/phpunit/phpunit/src/Framework/Constraint/Cardinality/Count.php b/vendor/phpunit/phpunit/src/Framework/Constraint/Cardinality/Count.php index 512013ce..2ec012a0 100644 --- a/vendor/phpunit/phpunit/src/Framework/Constraint/Cardinality/Count.php +++ b/vendor/phpunit/phpunit/src/Framework/Constraint/Cardinality/Count.php @@ -37,7 +37,7 @@ class Count extends Constraint { return sprintf( 'count matches %d', - $this->expectedCount + $this->expectedCount, ); } @@ -73,7 +73,7 @@ class Count extends Constraint throw new Exception( $e->getMessage(), $e->getCode(), - $e + $e, ); } } @@ -120,7 +120,7 @@ class Count extends Constraint return sprintf( 'actual size %d matches expected size %d', (int) $this->getCountOf($other), - $this->expectedCount + $this->expectedCount, ); } } diff --git a/vendor/phpunit/phpunit/src/Framework/Constraint/Cardinality/GreaterThan.php b/vendor/phpunit/phpunit/src/Framework/Constraint/Cardinality/GreaterThan.php index aea9f061..7e8f0ee6 100644 --- a/vendor/phpunit/phpunit/src/Framework/Constraint/Cardinality/GreaterThan.php +++ b/vendor/phpunit/phpunit/src/Framework/Constraint/Cardinality/GreaterThan.php @@ -9,6 +9,8 @@ */ namespace PHPUnit\Framework\Constraint; +use PHPUnit\Util\Exporter; + /** * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit */ @@ -24,9 +26,9 @@ final class GreaterThan extends Constraint /** * Returns a string representation of the constraint. */ - public function toString(): string + public function toString(bool $exportObjects = false): string { - return 'is greater than ' . $this->exporter()->export($this->value); + return 'is greater than ' . Exporter::export($this->value, $exportObjects); } /** diff --git a/vendor/phpunit/phpunit/src/Framework/Constraint/Cardinality/IsEmpty.php b/vendor/phpunit/phpunit/src/Framework/Constraint/Cardinality/IsEmpty.php index 6710db3a..ddf4a9f7 100644 --- a/vendor/phpunit/phpunit/src/Framework/Constraint/Cardinality/IsEmpty.php +++ b/vendor/phpunit/phpunit/src/Framework/Constraint/Cardinality/IsEmpty.php @@ -60,7 +60,7 @@ final class IsEmpty extends Constraint '%s %s %s', str_starts_with($type, 'a') || str_starts_with($type, 'o') ? 'an' : 'a', $type, - $this->toString() + $this->toString(true), ); } } diff --git a/vendor/phpunit/phpunit/src/Framework/Constraint/Cardinality/LessThan.php b/vendor/phpunit/phpunit/src/Framework/Constraint/Cardinality/LessThan.php index 9cc5e45c..cc3ec344 100644 --- a/vendor/phpunit/phpunit/src/Framework/Constraint/Cardinality/LessThan.php +++ b/vendor/phpunit/phpunit/src/Framework/Constraint/Cardinality/LessThan.php @@ -9,6 +9,8 @@ */ namespace PHPUnit\Framework\Constraint; +use PHPUnit\Util\Exporter; + /** * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit */ @@ -24,9 +26,9 @@ final class LessThan extends Constraint /** * Returns a string representation of the constraint. */ - public function toString(): string + public function toString(bool $exportObjects = false): string { - return 'is less than ' . $this->exporter()->export($this->value); + return 'is less than ' . Exporter::export($this->value, $exportObjects); } /** diff --git a/vendor/phpunit/phpunit/src/Framework/Constraint/Cardinality/SameSize.php b/vendor/phpunit/phpunit/src/Framework/Constraint/Cardinality/SameSize.php index e4e9f3c9..f3cd3c3d 100644 --- a/vendor/phpunit/phpunit/src/Framework/Constraint/Cardinality/SameSize.php +++ b/vendor/phpunit/phpunit/src/Framework/Constraint/Cardinality/SameSize.php @@ -9,6 +9,7 @@ */ namespace PHPUnit\Framework\Constraint; +use Countable; use PHPUnit\Framework\Exception; /** @@ -17,7 +18,7 @@ use PHPUnit\Framework\Exception; final class SameSize extends Count { /** - * @psalm-param \Countable|iterable $expected + * @psalm-param Countable|iterable $expected * * @throws Exception */ diff --git a/vendor/phpunit/phpunit/src/Framework/Constraint/Constraint.php b/vendor/phpunit/phpunit/src/Framework/Constraint/Constraint.php index 01045c6d..6c1c0472 100644 --- a/vendor/phpunit/phpunit/src/Framework/Constraint/Constraint.php +++ b/vendor/phpunit/phpunit/src/Framework/Constraint/Constraint.php @@ -9,20 +9,20 @@ */ namespace PHPUnit\Framework\Constraint; +use function gettype; use function sprintf; +use function strtolower; use Countable; use PHPUnit\Framework\ExpectationFailedException; use PHPUnit\Framework\SelfDescribing; +use PHPUnit\Util\Exporter; use SebastianBergmann\Comparator\ComparisonFailure; -use SebastianBergmann\Exporter\Exporter; /** * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit */ abstract class Constraint implements Countable, SelfDescribing { - private ?Exporter $exporter = null; - /** * Evaluates the constraint for parameter $other. * @@ -62,13 +62,12 @@ abstract class Constraint implements Countable, SelfDescribing return 1; } - protected function exporter(): Exporter + /** + * @deprecated + */ + protected function exporter(): \SebastianBergmann\Exporter\Exporter { - if ($this->exporter === null) { - $this->exporter = new Exporter; - } - - return $this->exporter; + return new \SebastianBergmann\Exporter\Exporter; } /** @@ -76,8 +75,6 @@ abstract class Constraint implements Countable, SelfDescribing * constraint is met, false otherwise. * * This method can be overridden to implement the evaluation algorithm. - * - * @codeCoverageIgnore */ protected function matches(mixed $other): bool { @@ -89,11 +86,11 @@ abstract class Constraint implements Countable, SelfDescribing * * @throws ExpectationFailedException */ - protected function fail(mixed $other, string $description, ComparisonFailure $comparisonFailure = null): never + protected function fail(mixed $other, string $description, ?ComparisonFailure $comparisonFailure = null): never { $failureDescription = sprintf( 'Failed asserting that %s.', - $this->failureDescription($other) + $this->failureDescription($other), ); $additionalFailureDescription = $this->additionalFailureDescription($other); @@ -108,7 +105,7 @@ abstract class Constraint implements Countable, SelfDescribing throw new ExpectationFailedException( $failureDescription, - $comparisonFailure + $comparisonFailure, ); } @@ -134,7 +131,7 @@ abstract class Constraint implements Countable, SelfDescribing */ protected function failureDescription(mixed $other): string { - return $this->exporter()->export($other) . ' ' . $this->toString(); + return Exporter::export($other, true) . ' ' . $this->toString(true); } /** @@ -174,7 +171,7 @@ abstract class Constraint implements Countable, SelfDescribing return ''; } - return $this->exporter()->export($other) . ' ' . $string; + return Exporter::export($other, true) . ' ' . $string; } /** @@ -241,4 +238,27 @@ abstract class Constraint implements Countable, SelfDescribing { return $this; } + + /** + * @psalm-return non-empty-string + */ + protected function valueToTypeStringFragment(mixed $value): string + { + $type = strtolower(gettype($value)); + + if ($type === 'double') { + $type = 'float'; + } + + if ($type === 'resource (closed)') { + $type = 'closed resource'; + } + + return match ($type) { + 'array', 'integer', 'object' => 'an ' . $type . ' ', + 'boolean', 'closed resource', 'float', 'resource', 'string' => 'a ' . $type . ' ', + 'null' => 'null ', + default => 'a value of ' . $type . ' ', + }; + } } diff --git a/vendor/phpunit/phpunit/src/Framework/Constraint/Equality/IsEqual.php b/vendor/phpunit/phpunit/src/Framework/Constraint/Equality/IsEqual.php index 217a9074..2238475d 100644 --- a/vendor/phpunit/phpunit/src/Framework/Constraint/Equality/IsEqual.php +++ b/vendor/phpunit/phpunit/src/Framework/Constraint/Equality/IsEqual.php @@ -14,6 +14,7 @@ use function sprintf; use function str_contains; use function trim; use PHPUnit\Framework\ExpectationFailedException; +use PHPUnit\Util\Exporter; use SebastianBergmann\Comparator\ComparisonFailure; use SebastianBergmann\Comparator\Factory as ComparatorFactory; @@ -61,7 +62,7 @@ final class IsEqual extends Constraint try { $comparator = $comparatorFactory->getComparatorFor( $this->value, - $other + $other, ); $comparator->assertEquals( @@ -69,7 +70,7 @@ final class IsEqual extends Constraint $other, $this->delta, $this->canonicalize, - $this->ignoreCase + $this->ignoreCase, ); } catch (ComparisonFailure $f) { if ($returnResult) { @@ -78,7 +79,7 @@ final class IsEqual extends Constraint throw new ExpectationFailedException( trim($description . "\n" . $f->getMessage()), - $f + $f, ); } @@ -88,7 +89,7 @@ final class IsEqual extends Constraint /** * Returns a string representation of the constraint. */ - public function toString(): string + public function toString(bool $exportObjects = false): string { $delta = ''; @@ -99,21 +100,21 @@ final class IsEqual extends Constraint return sprintf( "is equal to '%s'", - $this->value + $this->value, ); } if ($this->delta != 0) { $delta = sprintf( ' with delta <%F>', - $this->delta + $this->delta, ); } return sprintf( 'is equal to %s%s', - $this->exporter()->export($this->value), - $delta + Exporter::export($this->value, $exportObjects), + $delta, ); } } diff --git a/vendor/phpunit/phpunit/src/Framework/Constraint/Equality/IsEqualCanonicalizing.php b/vendor/phpunit/phpunit/src/Framework/Constraint/Equality/IsEqualCanonicalizing.php index 5d5eab5c..425569d1 100644 --- a/vendor/phpunit/phpunit/src/Framework/Constraint/Equality/IsEqualCanonicalizing.php +++ b/vendor/phpunit/phpunit/src/Framework/Constraint/Equality/IsEqualCanonicalizing.php @@ -14,6 +14,7 @@ use function sprintf; use function str_contains; use function trim; use PHPUnit\Framework\ExpectationFailedException; +use PHPUnit\Util\Exporter; use SebastianBergmann\Comparator\ComparisonFailure; use SebastianBergmann\Comparator\Factory as ComparatorFactory; @@ -55,7 +56,7 @@ final class IsEqualCanonicalizing extends Constraint try { $comparator = $comparatorFactory->getComparatorFor( $this->value, - $other + $other, ); $comparator->assertEquals( @@ -63,7 +64,6 @@ final class IsEqualCanonicalizing extends Constraint $other, 0.0, true, - false ); } catch (ComparisonFailure $f) { if ($returnResult) { @@ -72,7 +72,7 @@ final class IsEqualCanonicalizing extends Constraint throw new ExpectationFailedException( trim($description . "\n" . $f->getMessage()), - $f + $f, ); } @@ -82,7 +82,7 @@ final class IsEqualCanonicalizing extends Constraint /** * Returns a string representation of the constraint. */ - public function toString(): string + public function toString(bool $exportObjects = false): string { if (is_string($this->value)) { if (str_contains($this->value, "\n")) { @@ -91,13 +91,13 @@ final class IsEqualCanonicalizing extends Constraint return sprintf( "is equal to '%s'", - $this->value + $this->value, ); } return sprintf( 'is equal to %s', - $this->exporter()->export($this->value) + Exporter::export($this->value, $exportObjects), ); } } diff --git a/vendor/phpunit/phpunit/src/Framework/Constraint/Equality/IsEqualIgnoringCase.php b/vendor/phpunit/phpunit/src/Framework/Constraint/Equality/IsEqualIgnoringCase.php index d6fc31c1..f5b9b99d 100644 --- a/vendor/phpunit/phpunit/src/Framework/Constraint/Equality/IsEqualIgnoringCase.php +++ b/vendor/phpunit/phpunit/src/Framework/Constraint/Equality/IsEqualIgnoringCase.php @@ -14,6 +14,7 @@ use function sprintf; use function str_contains; use function trim; use PHPUnit\Framework\ExpectationFailedException; +use PHPUnit\Util\Exporter; use SebastianBergmann\Comparator\ComparisonFailure; use SebastianBergmann\Comparator\Factory as ComparatorFactory; @@ -55,7 +56,7 @@ final class IsEqualIgnoringCase extends Constraint try { $comparator = $comparatorFactory->getComparatorFor( $this->value, - $other + $other, ); $comparator->assertEquals( @@ -63,7 +64,7 @@ final class IsEqualIgnoringCase extends Constraint $other, 0.0, false, - true + true, ); } catch (ComparisonFailure $f) { if ($returnResult) { @@ -72,7 +73,7 @@ final class IsEqualIgnoringCase extends Constraint throw new ExpectationFailedException( trim($description . "\n" . $f->getMessage()), - $f + $f, ); } @@ -82,7 +83,7 @@ final class IsEqualIgnoringCase extends Constraint /** * Returns a string representation of the constraint. */ - public function toString(): string + public function toString(bool $exportObjects = false): string { if (is_string($this->value)) { if (str_contains($this->value, "\n")) { @@ -91,13 +92,13 @@ final class IsEqualIgnoringCase extends Constraint return sprintf( "is equal to '%s'", - $this->value + $this->value, ); } return sprintf( 'is equal to %s', - $this->exporter()->export($this->value) + Exporter::export($this->value, $exportObjects), ); } } diff --git a/vendor/phpunit/phpunit/src/Framework/Constraint/Equality/IsEqualWithDelta.php b/vendor/phpunit/phpunit/src/Framework/Constraint/Equality/IsEqualWithDelta.php index 43ddb312..d587f6f7 100644 --- a/vendor/phpunit/phpunit/src/Framework/Constraint/Equality/IsEqualWithDelta.php +++ b/vendor/phpunit/phpunit/src/Framework/Constraint/Equality/IsEqualWithDelta.php @@ -12,6 +12,7 @@ namespace PHPUnit\Framework\Constraint; use function sprintf; use function trim; use PHPUnit\Framework\ExpectationFailedException; +use PHPUnit\Util\Exporter; use SebastianBergmann\Comparator\ComparisonFailure; use SebastianBergmann\Comparator\Factory as ComparatorFactory; @@ -55,13 +56,13 @@ final class IsEqualWithDelta extends Constraint try { $comparator = $comparatorFactory->getComparatorFor( $this->value, - $other + $other, ); $comparator->assertEquals( $this->value, $other, - $this->delta + $this->delta, ); } catch (ComparisonFailure $f) { if ($returnResult) { @@ -70,7 +71,7 @@ final class IsEqualWithDelta extends Constraint throw new ExpectationFailedException( trim($description . "\n" . $f->getMessage()), - $f + $f, ); } @@ -80,12 +81,12 @@ final class IsEqualWithDelta extends Constraint /** * Returns a string representation of the constraint. */ - public function toString(): string + public function toString(bool $exportObjects = false): string { return sprintf( 'is equal to %s with delta <%F>', - $this->exporter()->export($this->value), - $this->delta + Exporter::export($this->value, $exportObjects), + $this->delta, ); } } diff --git a/vendor/phpunit/phpunit/src/Framework/Constraint/Exception/Exception.php b/vendor/phpunit/phpunit/src/Framework/Constraint/Exception/Exception.php index dc79f157..3bbae762 100644 --- a/vendor/phpunit/phpunit/src/Framework/Constraint/Exception/Exception.php +++ b/vendor/phpunit/phpunit/src/Framework/Constraint/Exception/Exception.php @@ -14,6 +14,8 @@ use PHPUnit\Util\Filter; use Throwable; /** + * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit + * * @internal This class is not covered by the backward compatibility promise for PHPUnit */ final class Exception extends Constraint @@ -32,7 +34,7 @@ final class Exception extends Constraint { return sprintf( 'exception of type "%s"', - $this->className + $this->className, ); } @@ -58,7 +60,7 @@ final class Exception extends Constraint if ($other === null) { return sprintf( 'exception of type "%s" is thrown', - $this->className + $this->className, ); } @@ -73,7 +75,7 @@ final class Exception extends Constraint 'exception of type "%s" matches expected exception "%s"%s', $other::class, $this->className, - $message + $message, ); } } diff --git a/vendor/phpunit/phpunit/src/Framework/Constraint/Exception/ExceptionCode.php b/vendor/phpunit/phpunit/src/Framework/Constraint/Exception/ExceptionCode.php index 4d882e3b..338588ee 100644 --- a/vendor/phpunit/phpunit/src/Framework/Constraint/Exception/ExceptionCode.php +++ b/vendor/phpunit/phpunit/src/Framework/Constraint/Exception/ExceptionCode.php @@ -10,8 +10,11 @@ namespace PHPUnit\Framework\Constraint; use function sprintf; +use PHPUnit\Util\Exporter; /** + * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit + * * @internal This class is not covered by the backward compatibility promise for PHPUnit */ final class ExceptionCode extends Constraint @@ -47,8 +50,8 @@ final class ExceptionCode extends Constraint { return sprintf( '%s is equal to expected exception code %s', - $this->exporter()->export($other), - $this->exporter()->export($this->expectedCode) + Exporter::export($other, true), + Exporter::export($this->expectedCode, true), ); } } diff --git a/vendor/phpunit/phpunit/src/Framework/Constraint/Exception/ExceptionMessageIsOrContains.php b/vendor/phpunit/phpunit/src/Framework/Constraint/Exception/ExceptionMessageIsOrContains.php index 0b84f044..ae920903 100644 --- a/vendor/phpunit/phpunit/src/Framework/Constraint/Exception/ExceptionMessageIsOrContains.php +++ b/vendor/phpunit/phpunit/src/Framework/Constraint/Exception/ExceptionMessageIsOrContains.php @@ -11,8 +11,11 @@ namespace PHPUnit\Framework\Constraint; use function sprintf; use function str_contains; +use PHPUnit\Util\Exporter; /** + * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit + * * @internal This class is not covered by the backward compatibility promise for PHPUnit */ final class ExceptionMessageIsOrContains extends Constraint @@ -30,7 +33,7 @@ final class ExceptionMessageIsOrContains extends Constraint return 'exception message is empty'; } - return 'exception message contains ' . $this->exporter()->export($this->expectedMessage); + return 'exception message contains ' . Exporter::export($this->expectedMessage); } protected function matches(mixed $other): bool @@ -53,14 +56,14 @@ final class ExceptionMessageIsOrContains extends Constraint if ($this->expectedMessage === '') { return sprintf( "exception message is empty but is '%s'", - $other + $other, ); } return sprintf( "exception message '%s' contains '%s'", $other, - $this->expectedMessage + $this->expectedMessage, ); } } diff --git a/vendor/phpunit/phpunit/src/Framework/Constraint/Exception/ExceptionMessageMatchesRegularExpression.php b/vendor/phpunit/phpunit/src/Framework/Constraint/Exception/ExceptionMessageMatchesRegularExpression.php index 7a425583..611af037 100644 --- a/vendor/phpunit/phpunit/src/Framework/Constraint/Exception/ExceptionMessageMatchesRegularExpression.php +++ b/vendor/phpunit/phpunit/src/Framework/Constraint/Exception/ExceptionMessageMatchesRegularExpression.php @@ -12,8 +12,11 @@ namespace PHPUnit\Framework\Constraint; use function preg_match; use function sprintf; use Exception; +use PHPUnit\Util\Exporter; /** + * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit + * * @internal This class is not covered by the backward compatibility promise for PHPUnit */ final class ExceptionMessageMatchesRegularExpression extends Constraint @@ -27,7 +30,7 @@ final class ExceptionMessageMatchesRegularExpression extends Constraint public function toString(): string { - return 'exception message matches ' . $this->exporter()->export($this->regularExpression); + return 'exception message matches ' . Exporter::export($this->regularExpression); } /** @@ -45,8 +48,8 @@ final class ExceptionMessageMatchesRegularExpression extends Constraint throw new \PHPUnit\Framework\Exception( sprintf( 'Invalid expected exception message regular expression given: %s', - $this->regularExpression - ) + $this->regularExpression, + ), ); } @@ -64,7 +67,7 @@ final class ExceptionMessageMatchesRegularExpression extends Constraint return sprintf( "exception message '%s' matches '%s'", $other, - $this->regularExpression + $this->regularExpression, ); } } diff --git a/vendor/phpunit/phpunit/src/Framework/Constraint/Filesystem/DirectoryExists.php b/vendor/phpunit/phpunit/src/Framework/Constraint/Filesystem/DirectoryExists.php index f0da8f69..83b991e1 100644 --- a/vendor/phpunit/phpunit/src/Framework/Constraint/Filesystem/DirectoryExists.php +++ b/vendor/phpunit/phpunit/src/Framework/Constraint/Filesystem/DirectoryExists.php @@ -44,7 +44,7 @@ final class DirectoryExists extends Constraint { return sprintf( 'directory "%s" exists', - $other + $other, ); } } diff --git a/vendor/phpunit/phpunit/src/Framework/Constraint/Filesystem/FileExists.php b/vendor/phpunit/phpunit/src/Framework/Constraint/Filesystem/FileExists.php index 24bdb42b..cfc3b1b6 100644 --- a/vendor/phpunit/phpunit/src/Framework/Constraint/Filesystem/FileExists.php +++ b/vendor/phpunit/phpunit/src/Framework/Constraint/Filesystem/FileExists.php @@ -44,7 +44,7 @@ final class FileExists extends Constraint { return sprintf( 'file "%s" exists', - $other + $other, ); } } diff --git a/vendor/phpunit/phpunit/src/Framework/Constraint/Filesystem/IsReadable.php b/vendor/phpunit/phpunit/src/Framework/Constraint/Filesystem/IsReadable.php index d4ad4911..1a32546c 100644 --- a/vendor/phpunit/phpunit/src/Framework/Constraint/Filesystem/IsReadable.php +++ b/vendor/phpunit/phpunit/src/Framework/Constraint/Filesystem/IsReadable.php @@ -44,7 +44,7 @@ final class IsReadable extends Constraint { return sprintf( '"%s" is readable', - $other + $other, ); } } diff --git a/vendor/phpunit/phpunit/src/Framework/Constraint/Filesystem/IsWritable.php b/vendor/phpunit/phpunit/src/Framework/Constraint/Filesystem/IsWritable.php index 64d5acc7..24e94f82 100644 --- a/vendor/phpunit/phpunit/src/Framework/Constraint/Filesystem/IsWritable.php +++ b/vendor/phpunit/phpunit/src/Framework/Constraint/Filesystem/IsWritable.php @@ -44,7 +44,7 @@ final class IsWritable extends Constraint { return sprintf( '"%s" is writable', - $other + $other, ); } } diff --git a/vendor/phpunit/phpunit/src/Framework/Constraint/IsIdentical.php b/vendor/phpunit/phpunit/src/Framework/Constraint/IsIdentical.php index 67e10e70..48ef3d64 100644 --- a/vendor/phpunit/phpunit/src/Framework/Constraint/IsIdentical.php +++ b/vendor/phpunit/phpunit/src/Framework/Constraint/IsIdentical.php @@ -9,12 +9,16 @@ */ namespace PHPUnit\Framework\Constraint; +use function explode; +use function gettype; use function is_array; use function is_object; use function is_string; use function sprintf; use PHPUnit\Framework\ExpectationFailedException; +use PHPUnit\Util\Exporter; use SebastianBergmann\Comparator\ComparisonFailure; +use UnitEnum; /** * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit @@ -57,17 +61,17 @@ final class IsIdentical extends Constraint $this->value, $other, sprintf("'%s'", $this->value), - sprintf("'%s'", $other) + sprintf("'%s'", $other), ); } - // if both values are array, make sure a diff is generated - if (is_array($this->value) && is_array($other)) { + // if both values are array or enums, make sure a diff is generated + if ((is_array($this->value) && is_array($other)) || ($this->value instanceof UnitEnum && $other instanceof UnitEnum)) { $f = new ComparisonFailure( $this->value, $other, - $this->exporter()->export($this->value), - $this->exporter()->export($other) + Exporter::export($this->value, true), + Exporter::export($other, true), ); } @@ -80,14 +84,14 @@ final class IsIdentical extends Constraint /** * Returns a string representation of the constraint. */ - public function toString(): string + public function toString(bool $exportObjects = false): string { if (is_object($this->value)) { return 'is identical to an object of class "' . $this->value::class . '"'; } - return 'is identical to ' . $this->exporter()->export($this->value); + return 'is identical to ' . Exporter::export($this->value, $exportObjects); } /** @@ -102,6 +106,10 @@ final class IsIdentical extends Constraint return 'two variables reference the same object'; } + if (explode(' ', gettype($this->value), 2)[0] === 'resource' && explode(' ', gettype($other), 2)[0] === 'resource') { + return 'two variables reference the same resource'; + } + if (is_string($this->value) && is_string($other)) { return 'two strings are identical'; } diff --git a/vendor/phpunit/phpunit/src/Framework/Constraint/JsonMatches.php b/vendor/phpunit/phpunit/src/Framework/Constraint/JsonMatches.php index 23bce7e7..dc3be3b4 100644 --- a/vendor/phpunit/phpunit/src/Framework/Constraint/JsonMatches.php +++ b/vendor/phpunit/phpunit/src/Framework/Constraint/JsonMatches.php @@ -35,7 +35,7 @@ final class JsonMatches extends Constraint { return sprintf( 'matches JSON string "%s"', - $this->value + $this->value, ); } @@ -68,7 +68,7 @@ final class JsonMatches extends Constraint * @throws ExpectationFailedException * @throws InvalidJsonException */ - protected function fail(mixed $other, string $description, ComparisonFailure $comparisonFailure = null): never + protected function fail(mixed $other, string $description, ?ComparisonFailure $comparisonFailure = null): never { if ($comparisonFailure === null) { [$error, $recodedOther] = Json::canonicalize($other); @@ -88,7 +88,7 @@ final class JsonMatches extends Constraint json_decode($other), Json::prettify($recodedValue), Json::prettify($recodedOther), - 'Failed asserting that two json values are equal.' + 'Failed asserting that two json values are equal.', ); } diff --git a/vendor/phpunit/phpunit/src/Framework/Constraint/ObjectEquals.php b/vendor/phpunit/phpunit/src/Framework/Constraint/ObjectEquals.php deleted file mode 100644 index 70ace344..00000000 --- a/vendor/phpunit/phpunit/src/Framework/Constraint/ObjectEquals.php +++ /dev/null @@ -1,142 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace PHPUnit\Framework\Constraint; - -use function is_object; -use PHPUnit\Framework\ActualValueIsNotAnObjectException; -use PHPUnit\Framework\ComparisonMethodDoesNotAcceptParameterTypeException; -use PHPUnit\Framework\ComparisonMethodDoesNotDeclareBoolReturnTypeException; -use PHPUnit\Framework\ComparisonMethodDoesNotDeclareExactlyOneParameterException; -use PHPUnit\Framework\ComparisonMethodDoesNotDeclareParameterTypeException; -use PHPUnit\Framework\ComparisonMethodDoesNotExistException; -use ReflectionNamedType; -use ReflectionObject; - -/** - * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit - */ -final class ObjectEquals extends Constraint -{ - private readonly object $expected; - private readonly string $method; - - public function __construct(object $object, string $method = 'equals') - { - $this->expected = $object; - $this->method = $method; - } - - public function toString(): string - { - return 'two objects are equal'; - } - - /** - * @throws ActualValueIsNotAnObjectException - * @throws ComparisonMethodDoesNotAcceptParameterTypeException - * @throws ComparisonMethodDoesNotDeclareBoolReturnTypeException - * @throws ComparisonMethodDoesNotDeclareExactlyOneParameterException - * @throws ComparisonMethodDoesNotDeclareParameterTypeException - * @throws ComparisonMethodDoesNotExistException - */ - protected function matches(mixed $other): bool - { - if (!is_object($other)) { - throw new ActualValueIsNotAnObjectException; - } - - $object = new ReflectionObject($other); - - if (!$object->hasMethod($this->method)) { - throw new ComparisonMethodDoesNotExistException( - $other::class, - $this->method - ); - } - - $method = $object->getMethod($this->method); - - if (!$method->hasReturnType()) { - throw new ComparisonMethodDoesNotDeclareBoolReturnTypeException( - $other::class, - $this->method - ); - } - - $returnType = $method->getReturnType(); - - if (!$returnType instanceof ReflectionNamedType) { - throw new ComparisonMethodDoesNotDeclareBoolReturnTypeException( - $other::class, - $this->method - ); - } - - if ($returnType->allowsNull()) { - throw new ComparisonMethodDoesNotDeclareBoolReturnTypeException( - $other::class, - $this->method - ); - } - - if ($returnType->getName() !== 'bool') { - throw new ComparisonMethodDoesNotDeclareBoolReturnTypeException( - $other::class, - $this->method - ); - } - - if ($method->getNumberOfParameters() !== 1 || $method->getNumberOfRequiredParameters() !== 1) { - throw new ComparisonMethodDoesNotDeclareExactlyOneParameterException( - $other::class, - $this->method - ); - } - - $parameter = $method->getParameters()[0]; - - if (!$parameter->hasType()) { - throw new ComparisonMethodDoesNotDeclareParameterTypeException( - $other::class, - $this->method - ); - } - - $type = $parameter->getType(); - - if (!$type instanceof ReflectionNamedType) { - throw new ComparisonMethodDoesNotDeclareParameterTypeException( - $other::class, - $this->method - ); - } - - $typeName = $type->getName(); - - if ($typeName === 'self') { - $typeName = $other::class; - } - - if (!$this->expected instanceof $typeName) { - throw new ComparisonMethodDoesNotAcceptParameterTypeException( - $other::class, - $this->method, - $this->expected::class - ); - } - - return $other->{$this->method}($this->expected); - } - - protected function failureDescription(mixed $other): string - { - return $this->toString(); - } -} diff --git a/vendor/phpunit/phpunit/src/Framework/Constraint/Operator/BinaryOperator.php b/vendor/phpunit/phpunit/src/Framework/Constraint/Operator/BinaryOperator.php index dec2effd..4c3d8e4b 100644 --- a/vendor/phpunit/phpunit/src/Framework/Constraint/Operator/BinaryOperator.php +++ b/vendor/phpunit/phpunit/src/Framework/Constraint/Operator/BinaryOperator.php @@ -26,7 +26,7 @@ abstract class BinaryOperator extends Operator { $this->constraints = array_map( fn ($constraint): Constraint => $this->checkConstraint($constraint), - $constraints + $constraints, ); } diff --git a/vendor/phpunit/phpunit/src/Framework/Constraint/Operator/LogicalNot.php b/vendor/phpunit/phpunit/src/Framework/Constraint/Operator/LogicalNot.php index f79f140c..837e3a50 100644 --- a/vendor/phpunit/phpunit/src/Framework/Constraint/Operator/LogicalNot.php +++ b/vendor/phpunit/phpunit/src/Framework/Constraint/Operator/LogicalNot.php @@ -51,9 +51,13 @@ final class LogicalNot extends UnaryOperator preg_match('/(\'[\w\W]*\')([\w\W]*)("[\w\W]*")/i', $string, $matches); + if (count($matches) === 0) { + preg_match('/(\'[\w\W]*\')([\w\W]*)(\'[\w\W]*\')/i', $string, $matches); + } + $positives = array_map( static fn (string $s) => '/\\b' . preg_quote($s, '/') . '/', - $positives + $positives, ); if (count($matches) > 0) { @@ -64,15 +68,15 @@ final class LogicalNot extends UnaryOperator preg_replace( $positives, $negatives, - $nonInput + $nonInput, ), - $string + $string, ); } else { $negatedString = preg_replace( $positives, $negatives, - $string + $string, ); } diff --git a/vendor/phpunit/phpunit/src/Framework/Constraint/Operator/LogicalXor.php b/vendor/phpunit/phpunit/src/Framework/Constraint/Operator/LogicalXor.php index f5b2b7df..e8ffc34d 100644 --- a/vendor/phpunit/phpunit/src/Framework/Constraint/Operator/LogicalXor.php +++ b/vendor/phpunit/phpunit/src/Framework/Constraint/Operator/LogicalXor.php @@ -60,7 +60,7 @@ final class LogicalXor extends BinaryOperator return array_reduce( $constraints, static fn (bool $matches, Constraint $constraint): bool => $matches xor $constraint->evaluate($other, '', true), - $initial->evaluate($other, '', true) + $initial->evaluate($other, '', true), ); } } diff --git a/vendor/phpunit/phpunit/src/Framework/Constraint/Operator/UnaryOperator.php b/vendor/phpunit/phpunit/src/Framework/Constraint/Operator/UnaryOperator.php index 10b0cc62..d6ac6e3f 100644 --- a/vendor/phpunit/phpunit/src/Framework/Constraint/Operator/UnaryOperator.php +++ b/vendor/phpunit/phpunit/src/Framework/Constraint/Operator/UnaryOperator.php @@ -95,7 +95,7 @@ abstract class UnaryOperator extends Operator } /** - * Transforms string returned by the memeber constraint's toString() or + * Transforms string returned by the member constraint's toString() or * failureDescription() such that it reflects constraint's participation in * this expression. * diff --git a/vendor/phpunit/phpunit/src/Framework/Constraint/String/IsJson.php b/vendor/phpunit/phpunit/src/Framework/Constraint/String/IsJson.php index 21241652..79b2c704 100644 --- a/vendor/phpunit/phpunit/src/Framework/Constraint/String/IsJson.php +++ b/vendor/phpunit/phpunit/src/Framework/Constraint/String/IsJson.php @@ -9,6 +9,13 @@ */ namespace PHPUnit\Framework\Constraint; +use const JSON_ERROR_CTRL_CHAR; +use const JSON_ERROR_DEPTH; +use const JSON_ERROR_NONE; +use const JSON_ERROR_STATE_MISMATCH; +use const JSON_ERROR_SYNTAX; +use const JSON_ERROR_UTF8; +use function is_string; use function json_decode; use function json_last_error; use function sprintf; @@ -32,7 +39,7 @@ final class IsJson extends Constraint */ protected function matches(mixed $other): bool { - if ($other === '') { + if (!is_string($other) || $other === '') { return false; } @@ -53,22 +60,25 @@ final class IsJson extends Constraint */ protected function failureDescription(mixed $other): string { + if (!is_string($other)) { + return $this->valueToTypeStringFragment($other) . 'is valid JSON'; + } + if ($other === '') { return 'an empty string is valid JSON'; } - json_decode($other); - return sprintf( - '%s is valid JSON (%s)', - $this->exporter()->shortenedExport($other), - $this->determineJsonError(json_last_error()) + 'a string is valid JSON (%s)', + $this->determineJsonError($other), ); } - private function determineJsonError(int $error): string + private function determineJsonError(string $json): string { - return match ($error) { + json_decode($json); + + return match (json_last_error()) { JSON_ERROR_NONE => '', JSON_ERROR_DEPTH => 'Maximum stack depth exceeded', JSON_ERROR_STATE_MISMATCH => 'Underflow or the modes mismatch', diff --git a/vendor/phpunit/phpunit/src/Framework/Constraint/String/RegularExpression.php b/vendor/phpunit/phpunit/src/Framework/Constraint/String/RegularExpression.php index b550aaf4..03b0e4ea 100644 --- a/vendor/phpunit/phpunit/src/Framework/Constraint/String/RegularExpression.php +++ b/vendor/phpunit/phpunit/src/Framework/Constraint/String/RegularExpression.php @@ -31,7 +31,7 @@ final class RegularExpression extends Constraint { return sprintf( 'matches PCRE pattern "%s"', - $this->pattern + $this->pattern, ); } diff --git a/vendor/phpunit/phpunit/src/Framework/Constraint/String/StringContains.php b/vendor/phpunit/phpunit/src/Framework/Constraint/String/StringContains.php index aa48286f..7a805edd 100644 --- a/vendor/phpunit/phpunit/src/Framework/Constraint/String/StringContains.php +++ b/vendor/phpunit/phpunit/src/Framework/Constraint/String/StringContains.php @@ -10,28 +10,31 @@ namespace PHPUnit\Framework\Constraint; use function is_string; +use function mb_detect_encoding; use function mb_stripos; use function mb_strtolower; use function sprintf; use function str_contains; +use function strlen; use function strtr; +use PHPUnit\Util\Exporter; /** * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit */ final class StringContains extends Constraint { - private readonly string $string; + private readonly string $needle; private readonly bool $ignoreCase; private readonly bool $ignoreLineEndings; - public function __construct(string $string, bool $ignoreCase = false, bool $ignoreLineEndings = false) + public function __construct(string $needle, bool $ignoreCase = false, bool $ignoreLineEndings = false) { if ($ignoreLineEndings) { - $string = $this->normalizeLineEndings($string); + $needle = $this->normalizeLineEndings($needle); } - $this->string = $string; + $this->needle = $needle; $this->ignoreCase = $ignoreCase; $this->ignoreLineEndings = $ignoreLineEndings; } @@ -41,53 +44,107 @@ final class StringContains extends Constraint */ public function toString(): string { - $string = $this->string; + $needle = $this->needle; if ($this->ignoreCase) { - $string = mb_strtolower($this->string, 'UTF-8'); + $needle = mb_strtolower($this->needle, 'UTF-8'); } return sprintf( - 'contains "%s"', - $string + 'contains "%s" [%s](length: %s)', + $needle, + $this->getDetectedEncoding($needle), + strlen($needle), ); } + public function failureDescription(mixed $other): string + { + $stringifiedHaystack = Exporter::export($other, true); + $haystackEncoding = $this->getDetectedEncoding($other); + $haystackLength = $this->getHaystackLength($other); + + $haystackInformation = sprintf( + '%s [%s](length: %s) ', + $stringifiedHaystack, + $haystackEncoding, + $haystackLength, + ); + + $needleInformation = $this->toString(true); + + return $haystackInformation . $needleInformation; + } + /** * Evaluates the constraint for parameter $other. Returns true if the * constraint is met, false otherwise. */ protected function matches(mixed $other): bool { - if ('' === $this->string) { + $haystack = $other; + + if ('' === $this->needle) { return true; } - if (!is_string($other)) { + if (!is_string($haystack)) { return false; } if ($this->ignoreLineEndings) { - $other = $this->normalizeLineEndings($other); + $haystack = $this->normalizeLineEndings($haystack); } if ($this->ignoreCase) { /* - * We must use the multi byte safe version so we can accurately compare non latin upper characters with + * We must use the multibyte-safe version, so we can accurately compare non-latin uppercase characters with * their lowercase equivalents. */ - return mb_stripos($other, $this->string, 0, 'UTF-8') !== false; + return mb_stripos($haystack, $this->needle, 0, 'UTF-8') !== false; } /* - * Use the non multi byte safe functions to see if the string is contained in $other. + * Use the non-multibyte safe functions to see if the string is contained in $other. * - * This function is very fast and we don't care about the character position in the string. + * This function is very fast, and we don't care about the character position in the string. * - * Additionally, we want this method to be binary safe so we can check if some binary data is in other binary + * Additionally, we want this method to be binary safe, so we can check if some binary data is in other binary * data. */ - return str_contains($other, $this->string); + return str_contains($haystack, $this->needle); + } + + private function getDetectedEncoding(mixed $other): string + { + if ($this->ignoreCase) { + return 'Encoding ignored'; + } + + if (!is_string($other)) { + return 'Encoding detection failed'; + } + + $detectedEncoding = mb_detect_encoding($other, null, true); + + if ($detectedEncoding === false) { + return 'Encoding detection failed'; + } + + return $detectedEncoding; + } + + private function getHaystackLength(mixed $haystack): int + { + if (!is_string($haystack)) { + return 0; + } + + if ($this->ignoreLineEndings) { + $haystack = $this->normalizeLineEndings($haystack); + } + + return strlen($haystack); } private function normalizeLineEndings(string $string): string @@ -97,7 +154,7 @@ final class StringContains extends Constraint [ "\r\n" => "\n", "\r" => "\n", - ] + ], ); } } diff --git a/vendor/phpunit/phpunit/src/Framework/Constraint/String/StringEqualsStringIgnoringLineEndings.php b/vendor/phpunit/phpunit/src/Framework/Constraint/String/StringEqualsStringIgnoringLineEndings.php index 82b150f3..56c59943 100644 --- a/vendor/phpunit/phpunit/src/Framework/Constraint/String/StringEqualsStringIgnoringLineEndings.php +++ b/vendor/phpunit/phpunit/src/Framework/Constraint/String/StringEqualsStringIgnoringLineEndings.php @@ -31,7 +31,7 @@ final class StringEqualsStringIgnoringLineEndings extends Constraint { return sprintf( 'is equal to "%s" ignoring line endings', - $this->string + $this->string, ); } @@ -51,7 +51,7 @@ final class StringEqualsStringIgnoringLineEndings extends Constraint [ "\r\n" => "\n", "\r" => "\n", - ] + ], ); } } diff --git a/vendor/phpunit/phpunit/src/Framework/Constraint/String/StringMatchesFormatDescription.php b/vendor/phpunit/phpunit/src/Framework/Constraint/String/StringMatchesFormatDescription.php index 1f84d92f..f9659e2e 100644 --- a/vendor/phpunit/phpunit/src/Framework/Constraint/String/StringMatchesFormatDescription.php +++ b/vendor/phpunit/phpunit/src/Framework/Constraint/String/StringMatchesFormatDescription.php @@ -10,6 +10,7 @@ namespace PHPUnit\Framework\Constraint; use const DIRECTORY_SEPARATOR; +use const PHP_EOL; use function explode; use function implode; use function preg_match; @@ -46,9 +47,9 @@ final class StringMatchesFormatDescription extends Constraint $matches = preg_match( $this->regularExpressionForFormatDescription( - $this->convertNewlines($this->formatDescription) + $this->convertNewlines($this->formatDescription), ), - $other + $other, ); return $matches > 0; @@ -86,18 +87,19 @@ final class StringMatchesFormatDescription extends Constraint preg_quote($string, '/'), [ '%%' => '%', - '%e' => '\\' . DIRECTORY_SEPARATOR, + '%e' => preg_quote(DIRECTORY_SEPARATOR, '/'), '%s' => '[^\r\n]+', '%S' => '[^\r\n]*', - '%a' => '.+', - '%A' => '.*', + '%a' => '.+?', + '%A' => '.*?', '%w' => '\s*', '%i' => '[+-]?\d+', '%d' => '\d+', '%x' => '[0-9a-fA-F]+', - '%f' => '[+-]?\.?\d+\.?\d*(?:[Ee][+-]?\d+)?', + '%f' => '[+-]?(?:\d+|(?=\.\d))(?:\.\d+)?(?:[Ee][+-]?\d+)?', '%c' => '.', - ] + '%0' => '\x00', + ], ); return '/^' . $string . '$/s'; diff --git a/vendor/phpunit/phpunit/src/Framework/Constraint/Traversable/ArrayHasKey.php b/vendor/phpunit/phpunit/src/Framework/Constraint/Traversable/ArrayHasKey.php index fff8597e..db8251e1 100644 --- a/vendor/phpunit/phpunit/src/Framework/Constraint/Traversable/ArrayHasKey.php +++ b/vendor/phpunit/phpunit/src/Framework/Constraint/Traversable/ArrayHasKey.php @@ -12,15 +12,16 @@ namespace PHPUnit\Framework\Constraint; use function array_key_exists; use function is_array; use ArrayAccess; +use PHPUnit\Util\Exporter; /** * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit */ final class ArrayHasKey extends Constraint { - private readonly int|string $key; + private readonly mixed $key; - public function __construct(int|string $key) + public function __construct(mixed $key) { $this->key = $key; } @@ -30,7 +31,7 @@ final class ArrayHasKey extends Constraint */ public function toString(): string { - return 'has the key ' . $this->exporter()->export($this->key); + return 'has the key ' . Exporter::export($this->key); } /** @@ -58,6 +59,6 @@ final class ArrayHasKey extends Constraint */ protected function failureDescription(mixed $other): string { - return 'an array ' . $this->toString(); + return 'an array ' . $this->toString(true); } } diff --git a/vendor/phpunit/phpunit/src/Framework/Constraint/Traversable/IsList.php b/vendor/phpunit/phpunit/src/Framework/Constraint/Traversable/IsList.php index 3d67fa4f..2e2f60cb 100644 --- a/vendor/phpunit/phpunit/src/Framework/Constraint/Traversable/IsList.php +++ b/vendor/phpunit/phpunit/src/Framework/Constraint/Traversable/IsList.php @@ -10,9 +10,7 @@ namespace PHPUnit\Framework\Constraint; use function array_is_list; -use function gettype; use function is_array; -use function strtolower; /** * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit @@ -48,21 +46,6 @@ final class IsList extends Constraint */ protected function failureDescription(mixed $other): string { - $type = strtolower(gettype($other)); - - if ($type === 'double') { - $type = 'float'; - } - - if ($type === 'resource (closed)') { - $type = 'closed resource'; - } - - return match ($type) { - 'array', 'integer', 'object' => 'an ' . $type . ' ' . $this->toString(), - 'boolean', 'closed resource', 'float', 'resource', 'string' => 'a ' . $type . ' ' . $this->toString(), - 'null' => 'null ' . $this->toString(), - default => 'a value of ' . $type . ' ' . $this->toString(), - }; + return $this->valueToTypeStringFragment($other) . $this->toString(true); } } diff --git a/vendor/phpunit/phpunit/src/Framework/Constraint/Traversable/TraversableContains.php b/vendor/phpunit/phpunit/src/Framework/Constraint/Traversable/TraversableContains.php index 32ddc342..770bdb8a 100644 --- a/vendor/phpunit/phpunit/src/Framework/Constraint/Traversable/TraversableContains.php +++ b/vendor/phpunit/phpunit/src/Framework/Constraint/Traversable/TraversableContains.php @@ -11,6 +11,7 @@ namespace PHPUnit\Framework\Constraint; use function is_array; use function sprintf; +use PHPUnit\Util\Exporter; /** * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit @@ -27,9 +28,9 @@ abstract class TraversableContains extends Constraint /** * Returns a string representation of the constraint. */ - public function toString(): string + public function toString(bool $exportObjects = false): string { - return 'contains ' . $this->exporter()->export($this->value); + return 'contains ' . Exporter::export($this->value, $exportObjects); } /** @@ -43,7 +44,7 @@ abstract class TraversableContains extends Constraint return sprintf( '%s %s', is_array($other) ? 'an array' : 'a traversable', - $this->toString() + $this->toString(true), ); } diff --git a/vendor/phpunit/phpunit/src/Framework/Constraint/Traversable/TraversableContainsEqual.php b/vendor/phpunit/phpunit/src/Framework/Constraint/Traversable/TraversableContainsEqual.php index 9bb0f3c0..0877bc2f 100644 --- a/vendor/phpunit/phpunit/src/Framework/Constraint/Traversable/TraversableContainsEqual.php +++ b/vendor/phpunit/phpunit/src/Framework/Constraint/Traversable/TraversableContainsEqual.php @@ -23,7 +23,7 @@ final class TraversableContainsEqual extends TraversableContains protected function matches(mixed $other): bool { if ($other instanceof SplObjectStorage) { - return $other->contains($this->value()); + return $other->offsetExists($this->value()); } foreach ($other as $element) { diff --git a/vendor/phpunit/phpunit/src/Framework/Constraint/Traversable/TraversableContainsIdentical.php b/vendor/phpunit/phpunit/src/Framework/Constraint/Traversable/TraversableContainsIdentical.php index fc070358..b4e29537 100644 --- a/vendor/phpunit/phpunit/src/Framework/Constraint/Traversable/TraversableContainsIdentical.php +++ b/vendor/phpunit/phpunit/src/Framework/Constraint/Traversable/TraversableContainsIdentical.php @@ -23,7 +23,7 @@ final class TraversableContainsIdentical extends TraversableContains protected function matches(mixed $other): bool { if ($other instanceof SplObjectStorage) { - return $other->contains($this->value()); + return $other->offsetExists($this->value()); } foreach ($other as $element) { diff --git a/vendor/phpunit/phpunit/src/Framework/Constraint/Traversable/TraversableContainsOnly.php b/vendor/phpunit/phpunit/src/Framework/Constraint/Traversable/TraversableContainsOnly.php index 72e3ccc0..274d76ff 100644 --- a/vendor/phpunit/phpunit/src/Framework/Constraint/Traversable/TraversableContainsOnly.php +++ b/vendor/phpunit/phpunit/src/Framework/Constraint/Traversable/TraversableContainsOnly.php @@ -9,6 +9,7 @@ */ namespace PHPUnit\Framework\Constraint; +use PHPUnit\Framework\Exception; use PHPUnit\Framework\ExpectationFailedException; /** @@ -20,7 +21,7 @@ final class TraversableContainsOnly extends Constraint private readonly string $type; /** - * @throws \PHPUnit\Framework\Exception + * @throws Exception */ public function __construct(string $type, bool $isNativeType = true) { diff --git a/vendor/phpunit/phpunit/src/Framework/Constraint/Type/IsInstanceOf.php b/vendor/phpunit/phpunit/src/Framework/Constraint/Type/IsInstanceOf.php index aeaca784..e69f4f86 100644 --- a/vendor/phpunit/phpunit/src/Framework/Constraint/Type/IsInstanceOf.php +++ b/vendor/phpunit/phpunit/src/Framework/Constraint/Type/IsInstanceOf.php @@ -19,7 +19,14 @@ use PHPUnit\Framework\UnknownClassOrInterfaceException; */ final class IsInstanceOf extends Constraint { + /** + * @psalm-var class-string + */ private readonly string $name; + + /** + * @psalm-var 'class'|'interface' + */ private readonly string $type; /** @@ -46,7 +53,7 @@ final class IsInstanceOf extends Constraint return sprintf( 'is an instance of %s %s', $this->type, - $this->name + $this->name, ); } @@ -67,11 +74,6 @@ final class IsInstanceOf extends Constraint */ protected function failureDescription(mixed $other): string { - return sprintf( - '%s is an instance of %s %s', - $this->exporter()->shortenedExport($other), - $this->type, - $this->name - ); + return $this->valueToTypeStringFragment($other) . $this->toString(true); } } diff --git a/vendor/phpunit/phpunit/src/Framework/Constraint/Type/IsType.php b/vendor/phpunit/phpunit/src/Framework/Constraint/Type/IsType.php index ca44a489..80726b6e 100644 --- a/vendor/phpunit/phpunit/src/Framework/Constraint/Type/IsType.php +++ b/vendor/phpunit/phpunit/src/Framework/Constraint/Type/IsType.php @@ -115,9 +115,15 @@ final class IsType extends Constraint 'callable' => true, 'iterable' => true, ]; + + /** + * @psalm-var 'array'|'bool'|'boolean'|'callable'|'double'|'float'|'int'|'integer'|'iterable'|'null'|'numeric'|'object'|'real'|'resource (closed)'|'resource'|'scalar'|'string' + */ private readonly string $type; /** + * @psalm-param 'array'|'boolean'|'bool'|'double'|'float'|'integer'|'int'|'null'|'numeric'|'object'|'real'|'resource'|'resource (closed)'|'string'|'scalar'|'callable'|'iterable' $type + * * @throws UnknownTypeException */ public function __construct(string $type) @@ -136,7 +142,7 @@ final class IsType extends Constraint { return sprintf( 'is of type %s', - $this->type + $this->type, ); } diff --git a/vendor/phpunit/phpunit/src/Framework/DataProviderTestSuite.php b/vendor/phpunit/phpunit/src/Framework/DataProviderTestSuite.php index 5607d0b4..e506cec4 100644 --- a/vendor/phpunit/phpunit/src/Framework/DataProviderTestSuite.php +++ b/vendor/phpunit/phpunit/src/Framework/DataProviderTestSuite.php @@ -14,6 +14,8 @@ use PHPUnit\Framework\TestSize\TestSize; use PHPUnit\Metadata\Api\Groups; /** + * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit + * * @internal This class is not covered by the backward compatibility promise for PHPUnit */ final class DataProviderTestSuite extends TestSuite @@ -33,10 +35,9 @@ final class DataProviderTestSuite extends TestSuite foreach ($this->tests() as $test) { if (!$test instanceof TestCase) { - // @codeCoverageIgnoreStart continue; - // @codeCoverageIgnoreStart } + $test->setDependencies($dependencies); } } @@ -47,7 +48,7 @@ final class DataProviderTestSuite extends TestSuite public function provides(): array { if ($this->providedTests === null) { - $this->providedTests = [new ExecutionOrderDependency($this->getName())]; + $this->providedTests = [new ExecutionOrderDependency($this->name())]; } return $this->providedTests; @@ -68,7 +69,7 @@ final class DataProviderTestSuite extends TestSuite */ public function size(): TestSize { - [$className, $methodName] = explode('::', $this->getName()); + [$className, $methodName] = explode('::', $this->name()); return (new Groups)->size($className, $methodName); } diff --git a/vendor/phpunit/phpunit/src/Framework/Exception/AssertionFailedError.php b/vendor/phpunit/phpunit/src/Framework/Exception/AssertionFailedError.php index 0ba25286..6bd59c4a 100644 --- a/vendor/phpunit/phpunit/src/Framework/Exception/AssertionFailedError.php +++ b/vendor/phpunit/phpunit/src/Framework/Exception/AssertionFailedError.php @@ -10,6 +10,8 @@ namespace PHPUnit\Framework; /** + * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit + * * @internal This class is not covered by the backward compatibility promise for PHPUnit */ class AssertionFailedError extends Exception implements SelfDescribing diff --git a/vendor/phpunit/phpunit/src/Framework/Exception/CodeCoverageException.php b/vendor/phpunit/phpunit/src/Framework/Exception/CodeCoverageException.php index 36b07231..41169ff1 100644 --- a/vendor/phpunit/phpunit/src/Framework/Exception/CodeCoverageException.php +++ b/vendor/phpunit/phpunit/src/Framework/Exception/CodeCoverageException.php @@ -10,6 +10,8 @@ namespace PHPUnit\Framework; /** + * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit + * * @internal This class is not covered by the backward compatibility promise for PHPUnit */ class CodeCoverageException extends Exception diff --git a/vendor/phpunit/phpunit/src/Framework/Exception/EmptyStringException.php b/vendor/phpunit/phpunit/src/Framework/Exception/EmptyStringException.php index e7f4fa9f..f5980cd7 100644 --- a/vendor/phpunit/phpunit/src/Framework/Exception/EmptyStringException.php +++ b/vendor/phpunit/phpunit/src/Framework/Exception/EmptyStringException.php @@ -10,6 +10,8 @@ namespace PHPUnit\Framework; /** + * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit + * * @internal This class is not covered by the backward compatibility promise for PHPUnit */ final class EmptyStringException extends InvalidArgumentException diff --git a/vendor/phpunit/phpunit/src/Framework/Exception/Error.php b/vendor/phpunit/phpunit/src/Framework/Exception/Error.php deleted file mode 100644 index d43e4218..00000000 --- a/vendor/phpunit/phpunit/src/Framework/Exception/Error.php +++ /dev/null @@ -1,24 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace PHPUnit\Framework; - -/** - * @internal This class is not covered by the backward compatibility promise for PHPUnit - */ -final class Error extends Exception implements SelfDescribing -{ - /** - * Wrapper for getMessage() which is declared as final. - */ - public function toString(): string - { - return $this->getMessage(); - } -} diff --git a/vendor/phpunit/phpunit/src/Framework/Exception/Exception.php b/vendor/phpunit/phpunit/src/Framework/Exception/Exception.php index 42be3e1b..2ee4e983 100644 --- a/vendor/phpunit/phpunit/src/Framework/Exception/Exception.php +++ b/vendor/phpunit/phpunit/src/Framework/Exception/Exception.php @@ -11,10 +11,9 @@ namespace PHPUnit\Framework; use function array_keys; use function get_object_vars; -use PHPUnit\Util\Filter; -use PHPUnit\Util\ThrowableToStringMapper; +use function is_int; +use function sprintf; use RuntimeException; -use Stringable; use Throwable; /** @@ -37,14 +36,28 @@ use Throwable; * * @see http://fabien.potencier.org/article/9/php-serialization-stack-traces-and-exceptions * + * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit + * * @internal This class is not covered by the backward compatibility promise for PHPUnit */ -class Exception extends RuntimeException implements \PHPUnit\Exception, Stringable +class Exception extends RuntimeException implements \PHPUnit\Exception { protected array $serializableTrace; - public function __construct(string $message = '', int $code = 0, Throwable $previous = null) + public function __construct(string $message = '', int|string $code = 0, ?Throwable $previous = null) { + /** + * @see https://github.com/sebastianbergmann/phpunit/issues/5965 + */ + if (!is_int($code)) { + $message .= sprintf( + ' (exception code: %s)', + $code, + ); + + $code = 0; + } + parent::__construct($message, $code, $previous); $this->serializableTrace = $this->getTrace(); @@ -54,23 +67,9 @@ class Exception extends RuntimeException implements \PHPUnit\Exception, Stringab } } - /** - * @throws Exception - */ - public function __toString(): string + public function __serialize(): array { - $string = ThrowableToStringMapper::map($this); - - if ($trace = Filter::getFilteredStacktrace($this)) { - $string .= "\n" . $trace; - } - - return $string; - } - - public function __sleep(): array - { - return array_keys(get_object_vars($this)); + return get_object_vars($this); } /** diff --git a/vendor/phpunit/phpunit/src/Framework/Exception/ExpectationFailedException.php b/vendor/phpunit/phpunit/src/Framework/Exception/ExpectationFailedException.php index c1a4c043..c46a27be 100644 --- a/vendor/phpunit/phpunit/src/Framework/Exception/ExpectationFailedException.php +++ b/vendor/phpunit/phpunit/src/Framework/Exception/ExpectationFailedException.php @@ -19,13 +19,13 @@ use SebastianBergmann\Comparator\ComparisonFailure; * SebastianBergmann\Comparator\ComparisonFailure which is used to * generate diff output of the failed expectations. * - * @internal This class is not covered by the backward compatibility promise for PHPUnit + * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit */ final class ExpectationFailedException extends AssertionFailedError { protected ?ComparisonFailure $comparisonFailure = null; - public function __construct(string $message, ComparisonFailure $comparisonFailure = null, Exception $previous = null) + public function __construct(string $message, ?ComparisonFailure $comparisonFailure = null, ?Exception $previous = null) { $this->comparisonFailure = $comparisonFailure; diff --git a/vendor/phpunit/phpunit/src/Framework/Exception/GeneratorNotSupportedException.php b/vendor/phpunit/phpunit/src/Framework/Exception/GeneratorNotSupportedException.php index 7e2b38bd..b3b17953 100644 --- a/vendor/phpunit/phpunit/src/Framework/Exception/GeneratorNotSupportedException.php +++ b/vendor/phpunit/phpunit/src/Framework/Exception/GeneratorNotSupportedException.php @@ -12,6 +12,8 @@ namespace PHPUnit\Framework; use function sprintf; /** + * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit + * * @internal This class is not covered by the backward compatibility promise for PHPUnit */ final class GeneratorNotSupportedException extends InvalidArgumentException @@ -21,8 +23,8 @@ final class GeneratorNotSupportedException extends InvalidArgumentException return new self( sprintf( 'Passing an argument of type Generator for the %s parameter is not supported', - $parameterName - ) + $parameterName, + ), ); } } diff --git a/vendor/phpunit/phpunit/src/Framework/Exception/Incomplete/IncompleteTest.php b/vendor/phpunit/phpunit/src/Framework/Exception/Incomplete/IncompleteTest.php index b77b1aff..39637fc0 100644 --- a/vendor/phpunit/phpunit/src/Framework/Exception/Incomplete/IncompleteTest.php +++ b/vendor/phpunit/phpunit/src/Framework/Exception/Incomplete/IncompleteTest.php @@ -12,7 +12,9 @@ namespace PHPUnit\Framework; use Throwable; /** - * @internal This class is not covered by the backward compatibility promise for PHPUnit + * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit + * + * @internal This interface is not covered by the backward compatibility promise for PHPUnit */ interface IncompleteTest extends Throwable { diff --git a/vendor/phpunit/phpunit/src/Framework/Exception/Incomplete/IncompleteTestError.php b/vendor/phpunit/phpunit/src/Framework/Exception/Incomplete/IncompleteTestError.php index 65f9c8bc..a45564da 100644 --- a/vendor/phpunit/phpunit/src/Framework/Exception/Incomplete/IncompleteTestError.php +++ b/vendor/phpunit/phpunit/src/Framework/Exception/Incomplete/IncompleteTestError.php @@ -10,6 +10,8 @@ namespace PHPUnit\Framework; /** + * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit + * * @internal This class is not covered by the backward compatibility promise for PHPUnit */ final class IncompleteTestError extends AssertionFailedError implements IncompleteTest diff --git a/vendor/phpunit/phpunit/src/Framework/Exception/InvalidArgumentException.php b/vendor/phpunit/phpunit/src/Framework/Exception/InvalidArgumentException.php index 12a94ec1..700abf03 100644 --- a/vendor/phpunit/phpunit/src/Framework/Exception/InvalidArgumentException.php +++ b/vendor/phpunit/phpunit/src/Framework/Exception/InvalidArgumentException.php @@ -10,6 +10,8 @@ namespace PHPUnit\Framework; /** + * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit + * * @internal This class is not covered by the backward compatibility promise for PHPUnit */ abstract class InvalidArgumentException extends Exception diff --git a/vendor/phpunit/phpunit/src/Framework/Exception/InvalidCoversTargetException.php b/vendor/phpunit/phpunit/src/Framework/Exception/InvalidCoversTargetException.php index ebf2994a..c6300d9e 100644 --- a/vendor/phpunit/phpunit/src/Framework/Exception/InvalidCoversTargetException.php +++ b/vendor/phpunit/phpunit/src/Framework/Exception/InvalidCoversTargetException.php @@ -10,6 +10,8 @@ namespace PHPUnit\Framework; /** + * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit + * * @internal This class is not covered by the backward compatibility promise for PHPUnit */ final class InvalidCoversTargetException extends CodeCoverageException diff --git a/vendor/phpunit/phpunit/src/Framework/Exception/InvalidDataProviderException.php b/vendor/phpunit/phpunit/src/Framework/Exception/InvalidDataProviderException.php index 7e2ef24c..a29f4bde 100644 --- a/vendor/phpunit/phpunit/src/Framework/Exception/InvalidDataProviderException.php +++ b/vendor/phpunit/phpunit/src/Framework/Exception/InvalidDataProviderException.php @@ -10,6 +10,8 @@ namespace PHPUnit\Framework; /** + * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit + * * @internal This class is not covered by the backward compatibility promise for PHPUnit */ final class InvalidDataProviderException extends Exception diff --git a/vendor/phpunit/phpunit/src/Framework/Exception/InvalidDependencyException.php b/vendor/phpunit/phpunit/src/Framework/Exception/InvalidDependencyException.php index 3a949554..8a636fd4 100644 --- a/vendor/phpunit/phpunit/src/Framework/Exception/InvalidDependencyException.php +++ b/vendor/phpunit/phpunit/src/Framework/Exception/InvalidDependencyException.php @@ -10,6 +10,8 @@ namespace PHPUnit\Framework; /** + * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit + * * @internal This class is not covered by the backward compatibility promise for PHPUnit */ final class InvalidDependencyException extends AssertionFailedError implements SkippedTest diff --git a/vendor/phpunit/phpunit/src/Framework/Exception/NoChildTestSuiteException.php b/vendor/phpunit/phpunit/src/Framework/Exception/NoChildTestSuiteException.php index 7ef4153b..e59df81d 100644 --- a/vendor/phpunit/phpunit/src/Framework/Exception/NoChildTestSuiteException.php +++ b/vendor/phpunit/phpunit/src/Framework/Exception/NoChildTestSuiteException.php @@ -10,6 +10,8 @@ namespace PHPUnit\Framework; /** + * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit + * * @internal This class is not covered by the backward compatibility promise for PHPUnit */ final class NoChildTestSuiteException extends Exception diff --git a/vendor/phpunit/phpunit/src/Framework/Exception/ObjectEquals/ActualValueIsNotAnObjectException.php b/vendor/phpunit/phpunit/src/Framework/Exception/ObjectEquals/ActualValueIsNotAnObjectException.php index 5c89b0c2..258b940a 100644 --- a/vendor/phpunit/phpunit/src/Framework/Exception/ObjectEquals/ActualValueIsNotAnObjectException.php +++ b/vendor/phpunit/phpunit/src/Framework/Exception/ObjectEquals/ActualValueIsNotAnObjectException.php @@ -10,6 +10,8 @@ namespace PHPUnit\Framework; /** + * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit + * * @internal This class is not covered by the backward compatibility promise for PHPUnit */ final class ActualValueIsNotAnObjectException extends Exception @@ -17,7 +19,7 @@ final class ActualValueIsNotAnObjectException extends Exception public function __construct() { parent::__construct( - 'Actual value is not an object' + 'Actual value is not an object', ); } } diff --git a/vendor/phpunit/phpunit/src/Framework/Exception/ObjectEquals/ComparisonMethodDoesNotAcceptParameterTypeException.php b/vendor/phpunit/phpunit/src/Framework/Exception/ObjectEquals/ComparisonMethodDoesNotAcceptParameterTypeException.php index 2696c756..74d00a17 100644 --- a/vendor/phpunit/phpunit/src/Framework/Exception/ObjectEquals/ComparisonMethodDoesNotAcceptParameterTypeException.php +++ b/vendor/phpunit/phpunit/src/Framework/Exception/ObjectEquals/ComparisonMethodDoesNotAcceptParameterTypeException.php @@ -12,6 +12,8 @@ namespace PHPUnit\Framework; use function sprintf; /** + * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit + * * @internal This class is not covered by the backward compatibility promise for PHPUnit */ final class ComparisonMethodDoesNotAcceptParameterTypeException extends Exception @@ -23,8 +25,8 @@ final class ComparisonMethodDoesNotAcceptParameterTypeException extends Exceptio '%s is not an accepted argument type for comparison method %s::%s().', $type, $className, - $methodName - ) + $methodName, + ), ); } } diff --git a/vendor/phpunit/phpunit/src/Framework/Exception/ObjectEquals/ComparisonMethodDoesNotDeclareBoolReturnTypeException.php b/vendor/phpunit/phpunit/src/Framework/Exception/ObjectEquals/ComparisonMethodDoesNotDeclareBoolReturnTypeException.php index 0a08386d..62dc7e8c 100644 --- a/vendor/phpunit/phpunit/src/Framework/Exception/ObjectEquals/ComparisonMethodDoesNotDeclareBoolReturnTypeException.php +++ b/vendor/phpunit/phpunit/src/Framework/Exception/ObjectEquals/ComparisonMethodDoesNotDeclareBoolReturnTypeException.php @@ -12,6 +12,8 @@ namespace PHPUnit\Framework; use function sprintf; /** + * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit + * * @internal This class is not covered by the backward compatibility promise for PHPUnit */ final class ComparisonMethodDoesNotDeclareBoolReturnTypeException extends Exception @@ -22,8 +24,8 @@ final class ComparisonMethodDoesNotDeclareBoolReturnTypeException extends Except sprintf( 'Comparison method %s::%s() does not declare bool return type.', $className, - $methodName - ) + $methodName, + ), ); } } diff --git a/vendor/phpunit/phpunit/src/Framework/Exception/ObjectEquals/ComparisonMethodDoesNotDeclareExactlyOneParameterException.php b/vendor/phpunit/phpunit/src/Framework/Exception/ObjectEquals/ComparisonMethodDoesNotDeclareExactlyOneParameterException.php index df6f3768..d5760744 100644 --- a/vendor/phpunit/phpunit/src/Framework/Exception/ObjectEquals/ComparisonMethodDoesNotDeclareExactlyOneParameterException.php +++ b/vendor/phpunit/phpunit/src/Framework/Exception/ObjectEquals/ComparisonMethodDoesNotDeclareExactlyOneParameterException.php @@ -12,6 +12,8 @@ namespace PHPUnit\Framework; use function sprintf; /** + * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit + * * @internal This class is not covered by the backward compatibility promise for PHPUnit */ final class ComparisonMethodDoesNotDeclareExactlyOneParameterException extends Exception @@ -22,8 +24,8 @@ final class ComparisonMethodDoesNotDeclareExactlyOneParameterException extends E sprintf( 'Comparison method %s::%s() does not declare exactly one parameter.', $className, - $methodName - ) + $methodName, + ), ); } } diff --git a/vendor/phpunit/phpunit/src/Framework/Exception/ObjectEquals/ComparisonMethodDoesNotDeclareParameterTypeException.php b/vendor/phpunit/phpunit/src/Framework/Exception/ObjectEquals/ComparisonMethodDoesNotDeclareParameterTypeException.php index 535da842..65718682 100644 --- a/vendor/phpunit/phpunit/src/Framework/Exception/ObjectEquals/ComparisonMethodDoesNotDeclareParameterTypeException.php +++ b/vendor/phpunit/phpunit/src/Framework/Exception/ObjectEquals/ComparisonMethodDoesNotDeclareParameterTypeException.php @@ -12,6 +12,8 @@ namespace PHPUnit\Framework; use function sprintf; /** + * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit + * * @internal This class is not covered by the backward compatibility promise for PHPUnit */ final class ComparisonMethodDoesNotDeclareParameterTypeException extends Exception @@ -22,8 +24,8 @@ final class ComparisonMethodDoesNotDeclareParameterTypeException extends Excepti sprintf( 'Parameter of comparison method %s::%s() does not have a declared type.', $className, - $methodName - ) + $methodName, + ), ); } } diff --git a/vendor/phpunit/phpunit/src/Framework/Exception/ObjectEquals/ComparisonMethodDoesNotExistException.php b/vendor/phpunit/phpunit/src/Framework/Exception/ObjectEquals/ComparisonMethodDoesNotExistException.php index 7711d5cb..94590b51 100644 --- a/vendor/phpunit/phpunit/src/Framework/Exception/ObjectEquals/ComparisonMethodDoesNotExistException.php +++ b/vendor/phpunit/phpunit/src/Framework/Exception/ObjectEquals/ComparisonMethodDoesNotExistException.php @@ -12,6 +12,8 @@ namespace PHPUnit\Framework; use function sprintf; /** + * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit + * * @internal This class is not covered by the backward compatibility promise for PHPUnit */ final class ComparisonMethodDoesNotExistException extends Exception @@ -22,8 +24,8 @@ final class ComparisonMethodDoesNotExistException extends Exception sprintf( 'Comparison method %s::%s() does not exist.', $className, - $methodName - ) + $methodName, + ), ); } } diff --git a/vendor/phpunit/phpunit/src/Framework/Exception/PhptAssertionFailedError.php b/vendor/phpunit/phpunit/src/Framework/Exception/PhptAssertionFailedError.php index e645e69f..73f602aa 100644 --- a/vendor/phpunit/phpunit/src/Framework/Exception/PhptAssertionFailedError.php +++ b/vendor/phpunit/phpunit/src/Framework/Exception/PhptAssertionFailedError.php @@ -12,6 +12,8 @@ namespace PHPUnit\Framework; /** * @psalm-immutable * + * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit + * * @internal This class is not covered by the backward compatibility promise for PHPUnit */ final class PhptAssertionFailedError extends AssertionFailedError diff --git a/vendor/phpunit/phpunit/src/Framework/Exception/ProcessIsolationException.php b/vendor/phpunit/phpunit/src/Framework/Exception/ProcessIsolationException.php index c4086fbb..e59c9c60 100644 --- a/vendor/phpunit/phpunit/src/Framework/Exception/ProcessIsolationException.php +++ b/vendor/phpunit/phpunit/src/Framework/Exception/ProcessIsolationException.php @@ -10,6 +10,8 @@ namespace PHPUnit\Framework; /** + * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit + * * @internal This class is not covered by the backward compatibility promise for PHPUnit */ final class ProcessIsolationException extends Exception diff --git a/vendor/phpunit/phpunit/src/Framework/Exception/Skipped/SkippedTest.php b/vendor/phpunit/phpunit/src/Framework/Exception/Skipped/SkippedTest.php index a12aa402..3678b601 100644 --- a/vendor/phpunit/phpunit/src/Framework/Exception/Skipped/SkippedTest.php +++ b/vendor/phpunit/phpunit/src/Framework/Exception/Skipped/SkippedTest.php @@ -12,7 +12,9 @@ namespace PHPUnit\Framework; use Throwable; /** - * @internal This class is not covered by the backward compatibility promise for PHPUnit + * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit + * + * @internal This interface is not covered by the backward compatibility promise for PHPUnit */ interface SkippedTest extends Throwable { diff --git a/vendor/phpunit/phpunit/src/Framework/Exception/Skipped/SkippedTestSuiteError.php b/vendor/phpunit/phpunit/src/Framework/Exception/Skipped/SkippedTestSuiteError.php index 5448508a..d3a4788b 100644 --- a/vendor/phpunit/phpunit/src/Framework/Exception/Skipped/SkippedTestSuiteError.php +++ b/vendor/phpunit/phpunit/src/Framework/Exception/Skipped/SkippedTestSuiteError.php @@ -10,6 +10,8 @@ namespace PHPUnit\Framework; /** + * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit + * * @internal This class is not covered by the backward compatibility promise for PHPUnit */ final class SkippedTestSuiteError extends AssertionFailedError implements SkippedTest diff --git a/vendor/phpunit/phpunit/src/Framework/Exception/Skipped/SkippedWithMessageException.php b/vendor/phpunit/phpunit/src/Framework/Exception/Skipped/SkippedWithMessageException.php index 22b73a1c..d09a760a 100644 --- a/vendor/phpunit/phpunit/src/Framework/Exception/Skipped/SkippedWithMessageException.php +++ b/vendor/phpunit/phpunit/src/Framework/Exception/Skipped/SkippedWithMessageException.php @@ -10,6 +10,8 @@ namespace PHPUnit\Framework; /** + * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit + * * @internal This class is not covered by the backward compatibility promise for PHPUnit */ final class SkippedWithMessageException extends AssertionFailedError implements SkippedTest diff --git a/vendor/phpunit/phpunit/src/Framework/Exception/UnknownClassException.php b/vendor/phpunit/phpunit/src/Framework/Exception/UnknownClassException.php deleted file mode 100644 index 69ffe808..00000000 --- a/vendor/phpunit/phpunit/src/Framework/Exception/UnknownClassException.php +++ /dev/null @@ -1,28 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace PHPUnit\Framework; - -use function sprintf; - -/** - * @internal This class is not covered by the backward compatibility promise for PHPUnit - */ -final class UnknownClassException extends InvalidArgumentException -{ - public function __construct(string $name) - { - parent::__construct( - sprintf( - 'Class "%s" does not exist', - $name - ) - ); - } -} diff --git a/vendor/phpunit/phpunit/src/Framework/Exception/UnknownClassOrInterfaceException.php b/vendor/phpunit/phpunit/src/Framework/Exception/UnknownClassOrInterfaceException.php index 4de87809..6a10f97f 100644 --- a/vendor/phpunit/phpunit/src/Framework/Exception/UnknownClassOrInterfaceException.php +++ b/vendor/phpunit/phpunit/src/Framework/Exception/UnknownClassOrInterfaceException.php @@ -12,6 +12,8 @@ namespace PHPUnit\Framework; use function sprintf; /** + * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit + * * @internal This class is not covered by the backward compatibility promise for PHPUnit */ final class UnknownClassOrInterfaceException extends InvalidArgumentException @@ -21,8 +23,8 @@ final class UnknownClassOrInterfaceException extends InvalidArgumentException parent::__construct( sprintf( 'Class or interface "%s" does not exist', - $name - ) + $name, + ), ); } } diff --git a/vendor/phpunit/phpunit/src/Framework/Exception/UnknownTypeException.php b/vendor/phpunit/phpunit/src/Framework/Exception/UnknownTypeException.php index 7039d7e5..b58b695c 100644 --- a/vendor/phpunit/phpunit/src/Framework/Exception/UnknownTypeException.php +++ b/vendor/phpunit/phpunit/src/Framework/Exception/UnknownTypeException.php @@ -12,6 +12,8 @@ namespace PHPUnit\Framework; use function sprintf; /** + * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit + * * @internal This class is not covered by the backward compatibility promise for PHPUnit */ final class UnknownTypeException extends InvalidArgumentException @@ -21,8 +23,8 @@ final class UnknownTypeException extends InvalidArgumentException parent::__construct( sprintf( 'Type "%s" is not known', - $name - ) + $name, + ), ); } } diff --git a/vendor/phpunit/phpunit/src/Framework/ExecutionOrderDependency.php b/vendor/phpunit/phpunit/src/Framework/ExecutionOrderDependency.php index 1f0a20f2..091628cc 100644 --- a/vendor/phpunit/phpunit/src/Framework/ExecutionOrderDependency.php +++ b/vendor/phpunit/phpunit/src/Framework/ExecutionOrderDependency.php @@ -20,6 +20,8 @@ use PHPUnit\Metadata\DependsOnMethod; use Stringable; /** + * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit + * * @internal This class is not covered by the backward compatibility promise for PHPUnit */ final class ExecutionOrderDependency implements Stringable @@ -35,7 +37,7 @@ final class ExecutionOrderDependency implements Stringable '', '', false, - false + false, ); } @@ -45,7 +47,7 @@ final class ExecutionOrderDependency implements Stringable $metadata->className(), 'class', $metadata->deepClone(), - $metadata->shallowClone() + $metadata->shallowClone(), ); } @@ -55,7 +57,7 @@ final class ExecutionOrderDependency implements Stringable $metadata->className(), $metadata->methodName(), $metadata->deepClone(), - $metadata->shallowClone() + $metadata->shallowClone(), ); } @@ -69,8 +71,8 @@ final class ExecutionOrderDependency implements Stringable return array_values( array_filter( $dependencies, - static fn (self $d) => $d->isValid() - ) + static fn (self $d) => $d->isValid(), + ), ); } @@ -84,15 +86,17 @@ final class ExecutionOrderDependency implements Stringable { $existingTargets = array_map( static fn ($dependency) => $dependency->getTarget(), - $existing + $existing, ); foreach ($additional as $dependency) { - if (in_array($dependency->getTarget(), $existingTargets, true)) { + $additionalTarget = $dependency->getTarget(); + + if (in_array($additionalTarget, $existingTargets, true)) { continue; } - $existingTargets[] = $dependency->getTarget(); + $existingTargets[] = $additionalTarget; $existing[] = $dependency; } @@ -118,7 +122,7 @@ final class ExecutionOrderDependency implements Stringable $diff = []; $rightTargets = array_map( static fn ($dependency) => $dependency->getTarget(), - $right + $right, ); foreach ($left as $dependency) { @@ -134,6 +138,9 @@ final class ExecutionOrderDependency implements Stringable public function __construct(string $classOrCallableName, ?string $methodName = null, bool $deepClone = false, bool $shallowClone = false) { + $this->deepClone = $deepClone; + $this->shallowClone = $shallowClone; + if ($classOrCallableName === '') { return; } @@ -144,9 +151,6 @@ final class ExecutionOrderDependency implements Stringable $this->className = $classOrCallableName; $this->methodName = !empty($methodName) ? $methodName : 'class'; } - - $this->deepClone = $deepClone; - $this->shallowClone = $shallowClone; } public function __toString(): string diff --git a/vendor/phpunit/phpunit/src/Framework/MockObject/Api/Api.php b/vendor/phpunit/phpunit/src/Framework/MockObject/Api/Api.php deleted file mode 100644 index ce1fb3d9..00000000 --- a/vendor/phpunit/phpunit/src/Framework/MockObject/Api/Api.php +++ /dev/null @@ -1,85 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace PHPUnit\Framework\MockObject; - -use PHPUnit\Framework\MockObject\Builder\InvocationMocker as InvocationMockerBuilder; -use PHPUnit\Framework\MockObject\Rule\InvocationOrder; - -/** - * @internal This trait is not covered by the backward compatibility promise for PHPUnit - */ -trait Api -{ - /** - * @psalm-var list - */ - private static array $__phpunit_configurableMethods; - private object $__phpunit_originalObject; - private bool $__phpunit_returnValueGeneration = true; - private ?InvocationHandler $__phpunit_invocationMocker = null; - - /** @noinspection MagicMethodsValidityInspection */ - public static function __phpunit_initConfigurableMethods(ConfigurableMethod ...$configurableMethods): void - { - if (isset(static::$__phpunit_configurableMethods)) { - throw new ConfigurableMethodsAlreadyInitializedException( - 'Configurable methods is already initialized and can not be reinitialized' - ); - } - - static::$__phpunit_configurableMethods = $configurableMethods; - } - - /** @noinspection MagicMethodsValidityInspection */ - public function __phpunit_setOriginalObject(object $originalObject): void - { - $this->__phpunit_originalObject = $originalObject; - } - - /** @noinspection MagicMethodsValidityInspection */ - public function __phpunit_setReturnValueGeneration(bool $returnValueGeneration): void - { - $this->__phpunit_returnValueGeneration = $returnValueGeneration; - } - - /** @noinspection MagicMethodsValidityInspection */ - public function __phpunit_getInvocationHandler(): InvocationHandler - { - if ($this->__phpunit_invocationMocker === null) { - $this->__phpunit_invocationMocker = new InvocationHandler( - static::$__phpunit_configurableMethods, - $this->__phpunit_returnValueGeneration - ); - } - - return $this->__phpunit_invocationMocker; - } - - /** @noinspection MagicMethodsValidityInspection */ - public function __phpunit_hasMatchers(): bool - { - return $this->__phpunit_getInvocationHandler()->hasMatchers(); - } - - /** @noinspection MagicMethodsValidityInspection */ - public function __phpunit_verify(bool $unsetInvocationMocker = true): void - { - $this->__phpunit_getInvocationHandler()->verify(); - - if ($unsetInvocationMocker) { - $this->__phpunit_invocationMocker = null; - } - } - - public function expects(InvocationOrder $matcher): InvocationMockerBuilder - { - return $this->__phpunit_getInvocationHandler()->expects($matcher); - } -} diff --git a/vendor/phpunit/phpunit/src/Framework/MockObject/Api/Method.php b/vendor/phpunit/phpunit/src/Framework/MockObject/Api/Method.php deleted file mode 100644 index 5507d0fd..00000000 --- a/vendor/phpunit/phpunit/src/Framework/MockObject/Api/Method.php +++ /dev/null @@ -1,31 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace PHPUnit\Framework\MockObject; - -use function call_user_func_array; -use function func_get_args; -use PHPUnit\Framework\MockObject\Builder\InvocationMocker; -use PHPUnit\Framework\MockObject\Rule\AnyInvokedCount; - -/** - * @internal This trait is not covered by the backward compatibility promise for PHPUnit - */ -trait Method -{ - public function method(): InvocationMocker - { - $expects = $this->expects(new AnyInvokedCount); - - return call_user_func_array( - [$expects, 'method'], - func_get_args() - ); - } -} diff --git a/vendor/phpunit/phpunit/src/Framework/MockObject/Api/MockedCloneMethod.php b/vendor/phpunit/phpunit/src/Framework/MockObject/Api/MockedCloneMethod.php deleted file mode 100644 index 41e5b315..00000000 --- a/vendor/phpunit/phpunit/src/Framework/MockObject/Api/MockedCloneMethod.php +++ /dev/null @@ -1,21 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace PHPUnit\Framework\MockObject; - -/** - * @internal This trait is not covered by the backward compatibility promise for PHPUnit - */ -trait MockedCloneMethod -{ - public function __clone(): void - { - $this->__phpunit_invocationMocker = clone $this->__phpunit_getInvocationHandler(); - } -} diff --git a/vendor/phpunit/phpunit/src/Framework/MockObject/Api/UnmockedCloneMethod.php b/vendor/phpunit/phpunit/src/Framework/MockObject/Api/UnmockedCloneMethod.php deleted file mode 100644 index 9bca7000..00000000 --- a/vendor/phpunit/phpunit/src/Framework/MockObject/Api/UnmockedCloneMethod.php +++ /dev/null @@ -1,23 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace PHPUnit\Framework\MockObject; - -/** - * @internal This trait is not covered by the backward compatibility promise for PHPUnit - */ -trait UnmockedCloneMethod -{ - public function __clone(): void - { - $this->__phpunit_invocationMocker = clone $this->__phpunit_getInvocationHandler(); - - parent::__clone(); - } -} diff --git a/vendor/phpunit/phpunit/src/Framework/MockObject/Builder/Identity.php b/vendor/phpunit/phpunit/src/Framework/MockObject/Builder/Identity.php deleted file mode 100644 index 28c0bc03..00000000 --- a/vendor/phpunit/phpunit/src/Framework/MockObject/Builder/Identity.php +++ /dev/null @@ -1,23 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace PHPUnit\Framework\MockObject\Builder; - -/** - * @internal This class is not covered by the backward compatibility promise for PHPUnit - */ -interface Identity -{ - /** - * Sets the identification of the expectation to $id. - * - * @note The identifier is unique per mock object. - */ - public function id(string $id): self; -} diff --git a/vendor/phpunit/phpunit/src/Framework/MockObject/Builder/InvocationMocker.php b/vendor/phpunit/phpunit/src/Framework/MockObject/Builder/InvocationMocker.php deleted file mode 100644 index ac5415f7..00000000 --- a/vendor/phpunit/phpunit/src/Framework/MockObject/Builder/InvocationMocker.php +++ /dev/null @@ -1,279 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace PHPUnit\Framework\MockObject\Builder; - -use function array_flip; -use function array_key_exists; -use function array_map; -use function array_merge; -use function count; -use function is_string; -use function strtolower; -use PHPUnit\Framework\Constraint\Constraint; -use PHPUnit\Framework\MockObject\ConfigurableMethod; -use PHPUnit\Framework\MockObject\IncompatibleReturnValueException; -use PHPUnit\Framework\MockObject\InvocationHandler; -use PHPUnit\Framework\MockObject\Matcher; -use PHPUnit\Framework\MockObject\MatcherAlreadyRegisteredException; -use PHPUnit\Framework\MockObject\MethodCannotBeConfiguredException; -use PHPUnit\Framework\MockObject\MethodNameAlreadyConfiguredException; -use PHPUnit\Framework\MockObject\MethodNameNotConfiguredException; -use PHPUnit\Framework\MockObject\MethodParametersAlreadyConfiguredException; -use PHPUnit\Framework\MockObject\Rule; -use PHPUnit\Framework\MockObject\Stub\ConsecutiveCalls; -use PHPUnit\Framework\MockObject\Stub\Exception; -use PHPUnit\Framework\MockObject\Stub\ReturnArgument; -use PHPUnit\Framework\MockObject\Stub\ReturnCallback; -use PHPUnit\Framework\MockObject\Stub\ReturnReference; -use PHPUnit\Framework\MockObject\Stub\ReturnSelf; -use PHPUnit\Framework\MockObject\Stub\ReturnStub; -use PHPUnit\Framework\MockObject\Stub\ReturnValueMap; -use PHPUnit\Framework\MockObject\Stub\Stub; -use Throwable; - -/** - * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit - */ -final class InvocationMocker implements InvocationStubber, MethodNameMatch -{ - private readonly InvocationHandler $invocationHandler; - private readonly Matcher $matcher; - - /** - * @psalm-var list - */ - private readonly array $configurableMethods; - - /** - * @psalm-var ?array - */ - private ?array $configurableMethodNames = null; - - public function __construct(InvocationHandler $handler, Matcher $matcher, ConfigurableMethod ...$configurableMethods) - { - $this->invocationHandler = $handler; - $this->matcher = $matcher; - $this->configurableMethods = $configurableMethods; - } - - /** - * @throws MatcherAlreadyRegisteredException - * - * @return $this - */ - public function id(string $id): self - { - $this->invocationHandler->registerMatcher($id, $this->matcher); - - return $this; - } - - /** - * @return $this - */ - public function will(Stub $stub): Identity - { - $this->matcher->setStub($stub); - - return $this; - } - - /** - * @throws IncompatibleReturnValueException - */ - public function willReturn(mixed $value, mixed ...$nextValues): self - { - if (count($nextValues) === 0) { - $this->ensureTypeOfReturnValues([$value]); - - $stub = $value instanceof Stub ? $value : new ReturnStub($value); - } else { - $values = array_merge([$value], $nextValues); - - $this->ensureTypeOfReturnValues($values); - - $stub = new ConsecutiveCalls($values); - } - - return $this->will($stub); - } - - public function willReturnReference(mixed &$reference): self - { - $stub = new ReturnReference($reference); - - return $this->will($stub); - } - - public function willReturnMap(array $valueMap): self - { - $stub = new ReturnValueMap($valueMap); - - return $this->will($stub); - } - - public function willReturnArgument(int $argumentIndex): self - { - $stub = new ReturnArgument($argumentIndex); - - return $this->will($stub); - } - - public function willReturnCallback(callable $callback): self - { - $stub = new ReturnCallback($callback); - - return $this->will($stub); - } - - public function willReturnSelf(): self - { - $stub = new ReturnSelf; - - return $this->will($stub); - } - - public function willReturnOnConsecutiveCalls(mixed ...$values): self - { - $stub = new ConsecutiveCalls($values); - - return $this->will($stub); - } - - public function willThrowException(Throwable $exception): self - { - $stub = new Exception($exception); - - return $this->will($stub); - } - - /** - * @return $this - */ - public function after(string $id): self - { - $this->matcher->setAfterMatchBuilderId($id); - - return $this; - } - - /** - * @throws \PHPUnit\Framework\Exception - * @throws MethodNameNotConfiguredException - * @throws MethodParametersAlreadyConfiguredException - * - * @return $this - */ - public function with(mixed ...$arguments): self - { - $this->ensureParametersCanBeConfigured(); - - $this->matcher->setParametersRule(new Rule\Parameters($arguments)); - - return $this; - } - - /** - * @throws MethodNameNotConfiguredException - * @throws MethodParametersAlreadyConfiguredException - * - * @return $this - */ - public function withAnyParameters(): self - { - $this->ensureParametersCanBeConfigured(); - - $this->matcher->setParametersRule(new Rule\AnyParameters); - - return $this; - } - - /** - * @throws \PHPUnit\Framework\InvalidArgumentException - * @throws MethodCannotBeConfiguredException - * @throws MethodNameAlreadyConfiguredException - * - * @return $this - */ - public function method(Constraint|string $constraint): self - { - if ($this->matcher->hasMethodNameRule()) { - throw new MethodNameAlreadyConfiguredException; - } - - if (is_string($constraint)) { - $this->configurableMethodNames ??= array_flip(array_map( - static fn (ConfigurableMethod $configurable) => strtolower($configurable->name()), - $this->configurableMethods - )); - - if (!array_key_exists(strtolower($constraint), $this->configurableMethodNames)) { - throw new MethodCannotBeConfiguredException($constraint); - } - } - - $this->matcher->setMethodNameRule(new Rule\MethodName($constraint)); - - return $this; - } - - /** - * @throws MethodNameNotConfiguredException - * @throws MethodParametersAlreadyConfiguredException - */ - private function ensureParametersCanBeConfigured(): void - { - if (!$this->matcher->hasMethodNameRule()) { - throw new MethodNameNotConfiguredException; - } - - if ($this->matcher->hasParametersRule()) { - throw new MethodParametersAlreadyConfiguredException; - } - } - - private function configuredMethod(): ?ConfigurableMethod - { - $configuredMethod = null; - - foreach ($this->configurableMethods as $configurableMethod) { - if ($this->matcher->methodNameRule()->matchesName($configurableMethod->name())) { - if ($configuredMethod !== null) { - return null; - } - - $configuredMethod = $configurableMethod; - } - } - - return $configuredMethod; - } - - /** - * @throws IncompatibleReturnValueException - */ - private function ensureTypeOfReturnValues(array $values): void - { - $configuredMethod = $this->configuredMethod(); - - if ($configuredMethod === null) { - return; - } - - foreach ($values as $value) { - if (!$configuredMethod->mayReturn($value)) { - throw new IncompatibleReturnValueException( - $configuredMethod, - $value - ); - } - } - } -} diff --git a/vendor/phpunit/phpunit/src/Framework/MockObject/Builder/InvocationStubber.php b/vendor/phpunit/phpunit/src/Framework/MockObject/Builder/InvocationStubber.php deleted file mode 100644 index 9918b77f..00000000 --- a/vendor/phpunit/phpunit/src/Framework/MockObject/Builder/InvocationStubber.php +++ /dev/null @@ -1,40 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace PHPUnit\Framework\MockObject\Builder; - -use PHPUnit\Framework\MockObject\Stub\Stub; -use Throwable; - -/** - * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit - */ -interface InvocationStubber -{ - public function will(Stub $stub): Identity; - - public function willReturn(mixed $value, mixed ...$nextValues): self; - - public function willReturnReference(mixed &$reference): self; - - /** - * @psalm-param array> $valueMap - */ - public function willReturnMap(array $valueMap): self; - - public function willReturnArgument(int $argumentIndex): self; - - public function willReturnCallback(callable $callback): self; - - public function willReturnSelf(): self; - - public function willReturnOnConsecutiveCalls(mixed ...$values): self; - - public function willThrowException(Throwable $exception): self; -} diff --git a/vendor/phpunit/phpunit/src/Framework/MockObject/Builder/MethodNameMatch.php b/vendor/phpunit/phpunit/src/Framework/MockObject/Builder/MethodNameMatch.php deleted file mode 100644 index 46b35e62..00000000 --- a/vendor/phpunit/phpunit/src/Framework/MockObject/Builder/MethodNameMatch.php +++ /dev/null @@ -1,24 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace PHPUnit\Framework\MockObject\Builder; - -use PHPUnit\Framework\Constraint\Constraint; - -/** - * @internal This class is not covered by the backward compatibility promise for PHPUnit - */ -interface MethodNameMatch extends ParametersMatch -{ - /** - * Adds a new method name match and returns the parameter match object for - * further matching possibilities. - */ - public function method(Constraint|string $constraint): self; -} diff --git a/vendor/phpunit/phpunit/src/Framework/MockObject/Builder/ParametersMatch.php b/vendor/phpunit/phpunit/src/Framework/MockObject/Builder/ParametersMatch.php deleted file mode 100644 index 656d21b2..00000000 --- a/vendor/phpunit/phpunit/src/Framework/MockObject/Builder/ParametersMatch.php +++ /dev/null @@ -1,49 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace PHPUnit\Framework\MockObject\Builder; - -/** - * @internal This class is not covered by the backward compatibility promise for PHPUnit - */ -interface ParametersMatch extends Stub -{ - /** - * Defines the expectation which must occur before the current is valid. - */ - public function after(string $id): Stub; - - /** - * Sets the parameters to match for, each parameter to this function will - * be part of match. To perform specific matches or constraints create a - * new PHPUnit\Framework\Constraint\Constraint and use it for the parameter. - * If the parameter value is not a constraint it will use the - * PHPUnit\Framework\Constraint\IsEqual for the value. - * - * Some examples: - * - * // match first parameter with value 2 - * $b->with(2); - * // match first parameter with value 'smock' and second identical to 42 - * $b->with('smock', new PHPUnit\Framework\Constraint\IsEqual(42)); - * - */ - public function with(mixed ...$arguments): self; - - /** - * Sets a rule which allows any kind of parameters. - * - * Some examples: - * - * // match any number of parameters - * $b->withAnyParameters(); - * - */ - public function withAnyParameters(): self; -} diff --git a/vendor/phpunit/phpunit/src/Framework/MockObject/Builder/Stub.php b/vendor/phpunit/phpunit/src/Framework/MockObject/Builder/Stub.php deleted file mode 100644 index d7cb78fc..00000000 --- a/vendor/phpunit/phpunit/src/Framework/MockObject/Builder/Stub.php +++ /dev/null @@ -1,24 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace PHPUnit\Framework\MockObject\Builder; - -use PHPUnit\Framework\MockObject\Stub\Stub as BaseStub; - -/** - * @internal This class is not covered by the backward compatibility promise for PHPUnit - */ -interface Stub extends Identity -{ - /** - * Stubs the matching method with the stub object $stub. Any invocations of - * the matched method will now be handled by the stub instead. - */ - public function will(BaseStub $stub): Identity; -} diff --git a/vendor/phpunit/phpunit/src/Framework/MockObject/ConfigurableMethod.php b/vendor/phpunit/phpunit/src/Framework/MockObject/ConfigurableMethod.php index 9f96899b..54d408c0 100644 --- a/vendor/phpunit/phpunit/src/Framework/MockObject/ConfigurableMethod.php +++ b/vendor/phpunit/phpunit/src/Framework/MockObject/ConfigurableMethod.php @@ -12,30 +12,67 @@ namespace PHPUnit\Framework\MockObject; use SebastianBergmann\Type\Type; /** + * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit + * * @internal This class is not covered by the backward compatibility promise for PHPUnit */ final class ConfigurableMethod { + /** + * @psalm-var non-empty-string + */ private readonly string $name; + + /** + * @psalm-var array + */ + private readonly array $defaultParameterValues; + + /** + * @psalm-var non-negative-int + */ + private readonly int $numberOfParameters; private readonly Type $returnType; - public function __construct(string $name, Type $returnType) + /** + * @psalm-param non-empty-string $name + * @psalm-param array $defaultParameterValues + * @psalm-param non-negative-int $numberOfParameters + */ + public function __construct(string $name, array $defaultParameterValues, int $numberOfParameters, Type $returnType) { - $this->name = $name; - $this->returnType = $returnType; + $this->name = $name; + $this->defaultParameterValues = $defaultParameterValues; + $this->numberOfParameters = $numberOfParameters; + $this->returnType = $returnType; } + /** + * @psalm-return non-empty-string + */ public function name(): string { return $this->name; } + /** + * @psalm-return array + */ + public function defaultParameterValues(): array + { + return $this->defaultParameterValues; + } + + /** + * @psalm-return non-negative-int + */ + public function numberOfParameters(): int + { + return $this->numberOfParameters; + } + public function mayReturn(mixed $value): bool { - if ($value === null && $this->returnType->allowsNull()) { - return true; - } - return $this->returnType->isAssignable(Type::fromValue($value, false)); } diff --git a/vendor/phpunit/phpunit/src/Framework/MockObject/Exception/BadMethodCallException.php b/vendor/phpunit/phpunit/src/Framework/MockObject/Exception/BadMethodCallException.php index 7e655e23..e8ddadda 100644 --- a/vendor/phpunit/phpunit/src/Framework/MockObject/Exception/BadMethodCallException.php +++ b/vendor/phpunit/phpunit/src/Framework/MockObject/Exception/BadMethodCallException.php @@ -10,6 +10,8 @@ namespace PHPUnit\Framework\MockObject; /** + * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit + * * @internal This class is not covered by the backward compatibility promise for PHPUnit */ final class BadMethodCallException extends \BadMethodCallException implements Exception diff --git a/vendor/phpunit/phpunit/src/Framework/MockObject/Exception/CannotUseAddMethodsException.php b/vendor/phpunit/phpunit/src/Framework/MockObject/Exception/CannotUseAddMethodsException.php deleted file mode 100644 index 0698870b..00000000 --- a/vendor/phpunit/phpunit/src/Framework/MockObject/Exception/CannotUseAddMethodsException.php +++ /dev/null @@ -1,29 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace PHPUnit\Framework\MockObject; - -use function sprintf; - -/** - * @internal This class is not covered by the backward compatibility promise for PHPUnit - */ -final class CannotUseAddMethodsException extends \PHPUnit\Framework\Exception implements Exception -{ - public function __construct(string $type, string $methodName) - { - parent::__construct( - sprintf( - 'Trying to configure method "%s" with addMethods(), but it exists in class "%s". Use onlyMethods() for methods that exist in the class', - $methodName, - $type - ) - ); - } -} diff --git a/vendor/phpunit/phpunit/src/Framework/MockObject/Exception/CannotUseOnlyMethodsException.php b/vendor/phpunit/phpunit/src/Framework/MockObject/Exception/CannotUseOnlyMethodsException.php index 35a29b73..6cb399e5 100644 --- a/vendor/phpunit/phpunit/src/Framework/MockObject/Exception/CannotUseOnlyMethodsException.php +++ b/vendor/phpunit/phpunit/src/Framework/MockObject/Exception/CannotUseOnlyMethodsException.php @@ -12,6 +12,8 @@ namespace PHPUnit\Framework\MockObject; use function sprintf; /** + * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit + * * @internal This class is not covered by the backward compatibility promise for PHPUnit */ final class CannotUseOnlyMethodsException extends \PHPUnit\Framework\Exception implements Exception @@ -20,10 +22,10 @@ final class CannotUseOnlyMethodsException extends \PHPUnit\Framework\Exception i { parent::__construct( sprintf( - 'Trying to configure method "%s" with onlyMethods(), but it does not exist in class "%s". Use addMethods() for methods that do not exist in the class', + 'Trying to configure method "%s" with onlyMethods(), but it does not exist in class "%s"', $methodName, - $type - ) + $type, + ), ); } } diff --git a/vendor/phpunit/phpunit/src/Framework/MockObject/Exception/ClassAlreadyExistsException.php b/vendor/phpunit/phpunit/src/Framework/MockObject/Exception/ClassAlreadyExistsException.php deleted file mode 100644 index 0ba9a187..00000000 --- a/vendor/phpunit/phpunit/src/Framework/MockObject/Exception/ClassAlreadyExistsException.php +++ /dev/null @@ -1,28 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace PHPUnit\Framework\MockObject; - -use function sprintf; - -/** - * @internal This class is not covered by the backward compatibility promise for PHPUnit - */ -final class ClassAlreadyExistsException extends \PHPUnit\Framework\Exception implements Exception -{ - public function __construct(string $className) - { - parent::__construct( - sprintf( - 'Class "%s" already exists', - $className - ) - ); - } -} diff --git a/vendor/phpunit/phpunit/src/Framework/MockObject/Exception/ClassIsEnumerationException.php b/vendor/phpunit/phpunit/src/Framework/MockObject/Exception/ClassIsEnumerationException.php deleted file mode 100644 index 696c1905..00000000 --- a/vendor/phpunit/phpunit/src/Framework/MockObject/Exception/ClassIsEnumerationException.php +++ /dev/null @@ -1,28 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace PHPUnit\Framework\MockObject; - -use function sprintf; - -/** - * @internal This class is not covered by the backward compatibility promise for PHPUnit - */ -final class ClassIsEnumerationException extends \PHPUnit\Framework\Exception implements Exception -{ - public function __construct(string $className) - { - parent::__construct( - sprintf( - 'Class "%s" is an enumeration and cannot be doubled', - $className - ) - ); - } -} diff --git a/vendor/phpunit/phpunit/src/Framework/MockObject/Exception/ClassIsFinalException.php b/vendor/phpunit/phpunit/src/Framework/MockObject/Exception/ClassIsFinalException.php deleted file mode 100644 index e648f026..00000000 --- a/vendor/phpunit/phpunit/src/Framework/MockObject/Exception/ClassIsFinalException.php +++ /dev/null @@ -1,28 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace PHPUnit\Framework\MockObject; - -use function sprintf; - -/** - * @internal This class is not covered by the backward compatibility promise for PHPUnit - */ -final class ClassIsFinalException extends \PHPUnit\Framework\Exception implements Exception -{ - public function __construct(string $className) - { - parent::__construct( - sprintf( - 'Class "%s" is declared "final" and cannot be doubled', - $className - ) - ); - } -} diff --git a/vendor/phpunit/phpunit/src/Framework/MockObject/Exception/ClassIsReadonlyException.php b/vendor/phpunit/phpunit/src/Framework/MockObject/Exception/ClassIsReadonlyException.php deleted file mode 100644 index aa1a7451..00000000 --- a/vendor/phpunit/phpunit/src/Framework/MockObject/Exception/ClassIsReadonlyException.php +++ /dev/null @@ -1,28 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace PHPUnit\Framework\MockObject; - -use function sprintf; - -/** - * @internal This class is not covered by the backward compatibility promise for PHPUnit - */ -final class ClassIsReadonlyException extends \PHPUnit\Framework\Exception implements Exception -{ - public function __construct(string $className) - { - parent::__construct( - sprintf( - 'Class "%s" is declared "readonly" and cannot be doubled', - $className - ) - ); - } -} diff --git a/vendor/phpunit/phpunit/src/Framework/MockObject/Exception/ConfigurableMethodsAlreadyInitializedException.php b/vendor/phpunit/phpunit/src/Framework/MockObject/Exception/ConfigurableMethodsAlreadyInitializedException.php deleted file mode 100644 index d12ac997..00000000 --- a/vendor/phpunit/phpunit/src/Framework/MockObject/Exception/ConfigurableMethodsAlreadyInitializedException.php +++ /dev/null @@ -1,17 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace PHPUnit\Framework\MockObject; - -/** - * @internal This class is not covered by the backward compatibility promise for PHPUnit - */ -final class ConfigurableMethodsAlreadyInitializedException extends \PHPUnit\Framework\Exception implements Exception -{ -} diff --git a/vendor/phpunit/phpunit/src/Framework/MockObject/Exception/DuplicateMethodException.php b/vendor/phpunit/phpunit/src/Framework/MockObject/Exception/DuplicateMethodException.php deleted file mode 100644 index 1216b45d..00000000 --- a/vendor/phpunit/phpunit/src/Framework/MockObject/Exception/DuplicateMethodException.php +++ /dev/null @@ -1,35 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace PHPUnit\Framework\MockObject; - -use function array_diff_assoc; -use function array_unique; -use function implode; -use function sprintf; - -/** - * @internal This class is not covered by the backward compatibility promise for PHPUnit - */ -final class DuplicateMethodException extends \PHPUnit\Framework\Exception implements Exception -{ - /** - * @psalm-param list $methods - */ - public function __construct(array $methods) - { - parent::__construct( - sprintf( - 'Cannot double using a method list that contains duplicates: "%s" (duplicate: "%s")', - implode(', ', $methods), - implode(', ', array_unique(array_diff_assoc($methods, array_unique($methods)))) - ) - ); - } -} diff --git a/vendor/phpunit/phpunit/src/Framework/MockObject/Exception/Exception.php b/vendor/phpunit/phpunit/src/Framework/MockObject/Exception/Exception.php index 5880bc03..0d73a5fe 100644 --- a/vendor/phpunit/phpunit/src/Framework/MockObject/Exception/Exception.php +++ b/vendor/phpunit/phpunit/src/Framework/MockObject/Exception/Exception.php @@ -9,11 +9,11 @@ */ namespace PHPUnit\Framework\MockObject; -use Throwable; - /** - * @internal This class is not covered by the backward compatibility promise for PHPUnit + * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit + * + * @internal This interface is not covered by the backward compatibility promise for PHPUnit */ -interface Exception extends Throwable +interface Exception extends \PHPUnit\Exception { } diff --git a/vendor/phpunit/phpunit/src/Framework/MockObject/Exception/IncompatibleReturnValueException.php b/vendor/phpunit/phpunit/src/Framework/MockObject/Exception/IncompatibleReturnValueException.php index 803028df..faf8a498 100644 --- a/vendor/phpunit/phpunit/src/Framework/MockObject/Exception/IncompatibleReturnValueException.php +++ b/vendor/phpunit/phpunit/src/Framework/MockObject/Exception/IncompatibleReturnValueException.php @@ -13,6 +13,8 @@ use function get_debug_type; use function sprintf; /** + * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit + * * @internal This class is not covered by the backward compatibility promise for PHPUnit */ final class IncompatibleReturnValueException extends \PHPUnit\Framework\Exception implements Exception @@ -24,8 +26,8 @@ final class IncompatibleReturnValueException extends \PHPUnit\Framework\Exceptio 'Method %s may not return value of type %s, its declared return type is "%s"', $method->name(), get_debug_type($value), - $method->returnTypeDeclaration() - ) + $method->returnTypeDeclaration(), + ), ); } } diff --git a/vendor/phpunit/phpunit/src/Framework/MockObject/Exception/InvalidMethodNameException.php b/vendor/phpunit/phpunit/src/Framework/MockObject/Exception/InvalidMethodNameException.php deleted file mode 100644 index d2444cf1..00000000 --- a/vendor/phpunit/phpunit/src/Framework/MockObject/Exception/InvalidMethodNameException.php +++ /dev/null @@ -1,28 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace PHPUnit\Framework\MockObject; - -use function sprintf; - -/** - * @internal This class is not covered by the backward compatibility promise for PHPUnit - */ -final class InvalidMethodNameException extends \PHPUnit\Framework\Exception implements Exception -{ - public function __construct(string $method) - { - parent::__construct( - sprintf( - 'Cannot double method with invalid name "%s"', - $method - ) - ); - } -} diff --git a/vendor/phpunit/phpunit/src/Framework/MockObject/Exception/MatchBuilderNotFoundException.php b/vendor/phpunit/phpunit/src/Framework/MockObject/Exception/MatchBuilderNotFoundException.php index c05b2bce..8bf8967b 100644 --- a/vendor/phpunit/phpunit/src/Framework/MockObject/Exception/MatchBuilderNotFoundException.php +++ b/vendor/phpunit/phpunit/src/Framework/MockObject/Exception/MatchBuilderNotFoundException.php @@ -12,6 +12,8 @@ namespace PHPUnit\Framework\MockObject; use function sprintf; /** + * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit + * * @internal This class is not covered by the backward compatibility promise for PHPUnit */ final class MatchBuilderNotFoundException extends \PHPUnit\Framework\Exception implements Exception @@ -21,8 +23,8 @@ final class MatchBuilderNotFoundException extends \PHPUnit\Framework\Exception i parent::__construct( sprintf( 'No builder found for match builder identification <%s>', - $id - ) + $id, + ), ); } } diff --git a/vendor/phpunit/phpunit/src/Framework/MockObject/Exception/MatcherAlreadyRegisteredException.php b/vendor/phpunit/phpunit/src/Framework/MockObject/Exception/MatcherAlreadyRegisteredException.php index efcc13ed..de62b867 100644 --- a/vendor/phpunit/phpunit/src/Framework/MockObject/Exception/MatcherAlreadyRegisteredException.php +++ b/vendor/phpunit/phpunit/src/Framework/MockObject/Exception/MatcherAlreadyRegisteredException.php @@ -12,6 +12,8 @@ namespace PHPUnit\Framework\MockObject; use function sprintf; /** + * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit + * * @internal This class is not covered by the backward compatibility promise for PHPUnit */ final class MatcherAlreadyRegisteredException extends \PHPUnit\Framework\Exception implements Exception @@ -21,8 +23,8 @@ final class MatcherAlreadyRegisteredException extends \PHPUnit\Framework\Excepti parent::__construct( sprintf( 'Matcher with id <%s> is already registered', - $id - ) + $id, + ), ); } } diff --git a/vendor/phpunit/phpunit/src/Framework/MockObject/Exception/MethodCannotBeConfiguredException.php b/vendor/phpunit/phpunit/src/Framework/MockObject/Exception/MethodCannotBeConfiguredException.php index 70729043..4d39b5d9 100644 --- a/vendor/phpunit/phpunit/src/Framework/MockObject/Exception/MethodCannotBeConfiguredException.php +++ b/vendor/phpunit/phpunit/src/Framework/MockObject/Exception/MethodCannotBeConfiguredException.php @@ -12,6 +12,8 @@ namespace PHPUnit\Framework\MockObject; use function sprintf; /** + * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit + * * @internal This class is not covered by the backward compatibility promise for PHPUnit */ final class MethodCannotBeConfiguredException extends \PHPUnit\Framework\Exception implements Exception @@ -21,8 +23,8 @@ final class MethodCannotBeConfiguredException extends \PHPUnit\Framework\Excepti parent::__construct( sprintf( 'Trying to configure method "%s" which cannot be configured because it does not exist, has not been specified, is final, or is static', - $method - ) + $method, + ), ); } } diff --git a/vendor/phpunit/phpunit/src/Framework/MockObject/Exception/MethodNameAlreadyConfiguredException.php b/vendor/phpunit/phpunit/src/Framework/MockObject/Exception/MethodNameAlreadyConfiguredException.php index 1e9f2c04..e4a37592 100644 --- a/vendor/phpunit/phpunit/src/Framework/MockObject/Exception/MethodNameAlreadyConfiguredException.php +++ b/vendor/phpunit/phpunit/src/Framework/MockObject/Exception/MethodNameAlreadyConfiguredException.php @@ -10,6 +10,8 @@ namespace PHPUnit\Framework\MockObject; /** + * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit + * * @internal This class is not covered by the backward compatibility promise for PHPUnit */ final class MethodNameAlreadyConfiguredException extends \PHPUnit\Framework\Exception implements Exception diff --git a/vendor/phpunit/phpunit/src/Framework/MockObject/Exception/MethodNameNotConfiguredException.php b/vendor/phpunit/phpunit/src/Framework/MockObject/Exception/MethodNameNotConfiguredException.php index 89565b77..25c11341 100644 --- a/vendor/phpunit/phpunit/src/Framework/MockObject/Exception/MethodNameNotConfiguredException.php +++ b/vendor/phpunit/phpunit/src/Framework/MockObject/Exception/MethodNameNotConfiguredException.php @@ -10,6 +10,8 @@ namespace PHPUnit\Framework\MockObject; /** + * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit + * * @internal This class is not covered by the backward compatibility promise for PHPUnit */ final class MethodNameNotConfiguredException extends \PHPUnit\Framework\Exception implements Exception diff --git a/vendor/phpunit/phpunit/src/Framework/MockObject/Exception/MethodParametersAlreadyConfiguredException.php b/vendor/phpunit/phpunit/src/Framework/MockObject/Exception/MethodParametersAlreadyConfiguredException.php index 1609c6ff..fba96cf4 100644 --- a/vendor/phpunit/phpunit/src/Framework/MockObject/Exception/MethodParametersAlreadyConfiguredException.php +++ b/vendor/phpunit/phpunit/src/Framework/MockObject/Exception/MethodParametersAlreadyConfiguredException.php @@ -10,6 +10,8 @@ namespace PHPUnit\Framework\MockObject; /** + * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit + * * @internal This class is not covered by the backward compatibility promise for PHPUnit */ final class MethodParametersAlreadyConfiguredException extends \PHPUnit\Framework\Exception implements Exception diff --git a/vendor/phpunit/phpunit/src/Framework/MockObject/Exception/OriginalConstructorInvocationRequiredException.php b/vendor/phpunit/phpunit/src/Framework/MockObject/Exception/OriginalConstructorInvocationRequiredException.php deleted file mode 100644 index ecb9b63c..00000000 --- a/vendor/phpunit/phpunit/src/Framework/MockObject/Exception/OriginalConstructorInvocationRequiredException.php +++ /dev/null @@ -1,21 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace PHPUnit\Framework\MockObject; - -/** - * @internal This class is not covered by the backward compatibility promise for PHPUnit - */ -final class OriginalConstructorInvocationRequiredException extends \PHPUnit\Framework\Exception implements Exception -{ - public function __construct() - { - parent::__construct('Proxying to original methods requires invoking the original constructor'); - } -} diff --git a/vendor/phpunit/phpunit/src/Framework/MockObject/Exception/ReflectionException.php b/vendor/phpunit/phpunit/src/Framework/MockObject/Exception/ReflectionException.php deleted file mode 100644 index d6319c69..00000000 --- a/vendor/phpunit/phpunit/src/Framework/MockObject/Exception/ReflectionException.php +++ /dev/null @@ -1,19 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace PHPUnit\Framework\MockObject; - -use RuntimeException; - -/** - * @internal This class is not covered by the backward compatibility promise for PHPUnit - */ -final class ReflectionException extends RuntimeException implements Exception -{ -} diff --git a/vendor/phpunit/phpunit/src/Framework/MockObject/Exception/ReturnValueNotConfiguredException.php b/vendor/phpunit/phpunit/src/Framework/MockObject/Exception/ReturnValueNotConfiguredException.php index 21808989..cf193f10 100644 --- a/vendor/phpunit/phpunit/src/Framework/MockObject/Exception/ReturnValueNotConfiguredException.php +++ b/vendor/phpunit/phpunit/src/Framework/MockObject/Exception/ReturnValueNotConfiguredException.php @@ -12,6 +12,8 @@ namespace PHPUnit\Framework\MockObject; use function sprintf; /** + * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit + * * @internal This class is not covered by the backward compatibility promise for PHPUnit */ final class ReturnValueNotConfiguredException extends \PHPUnit\Framework\Exception implements Exception @@ -20,10 +22,10 @@ final class ReturnValueNotConfiguredException extends \PHPUnit\Framework\Excepti { parent::__construct( sprintf( - 'Return value inference disabled and no expectation set up for %s::%s()', + 'No return value is configured for %s::%s() and return value generation is disabled', $invocation->className(), - $invocation->methodName() - ) + $invocation->methodName(), + ), ); } } diff --git a/vendor/phpunit/phpunit/src/Framework/MockObject/Exception/RuntimeException.php b/vendor/phpunit/phpunit/src/Framework/MockObject/Exception/RuntimeException.php index 33b6a5be..b99a903e 100644 --- a/vendor/phpunit/phpunit/src/Framework/MockObject/Exception/RuntimeException.php +++ b/vendor/phpunit/phpunit/src/Framework/MockObject/Exception/RuntimeException.php @@ -10,6 +10,8 @@ namespace PHPUnit\Framework\MockObject; /** + * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit + * * @internal This class is not covered by the backward compatibility promise for PHPUnit */ final class RuntimeException extends \RuntimeException implements Exception diff --git a/vendor/phpunit/phpunit/src/Framework/MockObject/Exception/SoapExtensionNotAvailableException.php b/vendor/phpunit/phpunit/src/Framework/MockObject/Exception/SoapExtensionNotAvailableException.php deleted file mode 100644 index 98837c95..00000000 --- a/vendor/phpunit/phpunit/src/Framework/MockObject/Exception/SoapExtensionNotAvailableException.php +++ /dev/null @@ -1,23 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace PHPUnit\Framework\MockObject; - -/** - * @internal This class is not covered by the backward compatibility promise for PHPUnit - */ -final class SoapExtensionNotAvailableException extends \PHPUnit\Framework\Exception implements Exception -{ - public function __construct() - { - parent::__construct( - 'The SOAP extension is required to generate a test double from WSDL' - ); - } -} diff --git a/vendor/phpunit/phpunit/src/Framework/MockObject/Exception/UnknownClassException.php b/vendor/phpunit/phpunit/src/Framework/MockObject/Exception/UnknownClassException.php deleted file mode 100644 index e124f9b1..00000000 --- a/vendor/phpunit/phpunit/src/Framework/MockObject/Exception/UnknownClassException.php +++ /dev/null @@ -1,28 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace PHPUnit\Framework\MockObject; - -use function sprintf; - -/** - * @internal This class is not covered by the backward compatibility promise for PHPUnit - */ -final class UnknownClassException extends \PHPUnit\Framework\Exception implements Exception -{ - public function __construct(string $className) - { - parent::__construct( - sprintf( - 'Class "%s" does not exist', - $className - ) - ); - } -} diff --git a/vendor/phpunit/phpunit/src/Framework/MockObject/Exception/UnknownTraitException.php b/vendor/phpunit/phpunit/src/Framework/MockObject/Exception/UnknownTraitException.php deleted file mode 100644 index 90fc8d84..00000000 --- a/vendor/phpunit/phpunit/src/Framework/MockObject/Exception/UnknownTraitException.php +++ /dev/null @@ -1,28 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace PHPUnit\Framework\MockObject; - -use function sprintf; - -/** - * @internal This class is not covered by the backward compatibility promise for PHPUnit - */ -final class UnknownTraitException extends \PHPUnit\Framework\Exception implements Exception -{ - public function __construct(string $traitName) - { - parent::__construct( - sprintf( - 'Trait "%s" does not exist', - $traitName - ) - ); - } -} diff --git a/vendor/phpunit/phpunit/src/Framework/MockObject/Exception/UnknownTypeException.php b/vendor/phpunit/phpunit/src/Framework/MockObject/Exception/UnknownTypeException.php deleted file mode 100644 index b1a70edd..00000000 --- a/vendor/phpunit/phpunit/src/Framework/MockObject/Exception/UnknownTypeException.php +++ /dev/null @@ -1,28 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace PHPUnit\Framework\MockObject; - -use function sprintf; - -/** - * @internal This class is not covered by the backward compatibility promise for PHPUnit - */ -final class UnknownTypeException extends \PHPUnit\Framework\Exception implements Exception -{ - public function __construct(string $type) - { - parent::__construct( - sprintf( - 'Class or interface "%s" does not exist', - $type - ) - ); - } -} diff --git a/vendor/phpunit/phpunit/src/Framework/MockObject/Generator.php b/vendor/phpunit/phpunit/src/Framework/MockObject/Generator.php deleted file mode 100644 index e0177282..00000000 --- a/vendor/phpunit/phpunit/src/Framework/MockObject/Generator.php +++ /dev/null @@ -1,1071 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace PHPUnit\Framework\MockObject; - -use const PHP_EOL; -use const PREG_OFFSET_CAPTURE; -use const WSDL_CACHE_NONE; -use function array_merge; -use function array_pop; -use function array_unique; -use function assert; -use function class_exists; -use function count; -use function explode; -use function extension_loaded; -use function implode; -use function in_array; -use function interface_exists; -use function is_array; -use function is_object; -use function md5; -use function method_exists; -use function mt_rand; -use function preg_match; -use function preg_match_all; -use function range; -use function serialize; -use function sort; -use function sprintf; -use function str_contains; -use function str_replace; -use function strlen; -use function strpos; -use function substr; -use function trait_exists; -use Exception; -use Iterator; -use IteratorAggregate; -use PHPUnit\Framework\InvalidArgumentException; -use ReflectionClass; -use ReflectionMethod; -use SoapClient; -use SoapFault; -use Throwable; -use Traversable; - -/** - * @internal This class is not covered by the backward compatibility promise for PHPUnit - */ -final class Generator -{ - use TemplateLoader; - - /** - * @var array - */ - private const EXCLUDED_METHOD_NAMES = [ - '__CLASS__' => true, - '__DIR__' => true, - '__FILE__' => true, - '__FUNCTION__' => true, - '__LINE__' => true, - '__METHOD__' => true, - '__NAMESPACE__' => true, - '__TRAIT__' => true, - '__clone' => true, - '__halt_compiler' => true, - ]; - private static array $cache = []; - - /** - * Returns a mock object for the specified class. - * - * @psalm-template RealInstanceType of object - * - * @psalm-param class-string $type - * - * @psalm-return MockObject&RealInstanceType - * - * @throws ClassAlreadyExistsException - * @throws ClassIsEnumerationException - * @throws ClassIsFinalException - * @throws ClassIsReadonlyException - * @throws DuplicateMethodException - * @throws InvalidMethodNameException - * @throws OriginalConstructorInvocationRequiredException - * @throws ReflectionException - * @throws RuntimeException - * @throws UnknownTypeException - */ - public function getMock(string $type, ?array $methods = [], array $arguments = [], string $mockClassName = '', bool $callOriginalConstructor = true, bool $callOriginalClone = true, bool $callAutoload = true, bool $cloneArguments = true, bool $callOriginalMethods = false, object $proxyTarget = null, bool $allowMockingUnknownTypes = true, bool $returnValueGeneration = true): MockObject - { - if ($type === Traversable::class) { - $type = Iterator::class; - } - - if (!$allowMockingUnknownTypes) { - $this->ensureKnownType($type, $callAutoload); - } - - $this->ensureValidMethods($methods); - $this->ensureMockedClassDoesNotAlreadyExist($mockClassName); - - if (!$callOriginalConstructor && $callOriginalMethods) { - throw new OriginalConstructorInvocationRequiredException; - } - - $mock = $this->generate( - $type, - $methods, - $mockClassName, - $callOriginalClone, - $callAutoload, - $cloneArguments, - $callOriginalMethods - ); - - $object = $this->getObject( - $mock, - $type, - $callOriginalConstructor, - $arguments, - $callOriginalMethods, - $proxyTarget, - $returnValueGeneration - ); - - assert($object instanceof MockObject); - - return $object; - } - - /** - * @psalm-param list $interfaces - * - * @throws RuntimeException - * @throws UnknownTypeException - */ - public function getMockForInterfaces(array $interfaces, bool $callAutoload = true): MockObject - { - if (count($interfaces) < 2) { - throw new RuntimeException('At least two interfaces must be specified'); - } - - foreach ($interfaces as $interface) { - if (!interface_exists($interface, $callAutoload)) { - throw new UnknownTypeException($interface); - } - } - - sort($interfaces); - - $methods = []; - - foreach ($interfaces as $interface) { - $methods = array_merge($methods, $this->getClassMethods($interface)); - } - - if (count(array_unique($methods)) < count($methods)) { - throw new RuntimeException('Interfaces must not declare the same method'); - } - - $unqualifiedNames = []; - - foreach ($interfaces as $interface) { - $parts = explode('\\', $interface); - $unqualifiedNames[] = array_pop($parts); - } - - sort($unqualifiedNames); - - do { - $intersectionName = sprintf( - 'Intersection_%s_%s', - implode('_', $unqualifiedNames), - substr(md5((string) mt_rand()), 0, 8) - ); - } while (interface_exists($intersectionName, false)); - - $template = $this->loadTemplate('intersection.tpl'); - - $template->setVar( - [ - 'intersection' => $intersectionName, - 'interfaces' => implode(', ', $interfaces), - ] - ); - - eval($template->render()); - - return $this->getMock($intersectionName); - } - - /** - * Returns a mock object for the specified abstract class with all abstract - * methods of the class mocked. - * - * Concrete methods to mock can be specified with the $mockedMethods parameter. - * - * @psalm-template RealInstanceType of object - * - * @psalm-param class-string $originalClassName - * - * @psalm-return MockObject&RealInstanceType - * - * @throws ClassAlreadyExistsException - * @throws ClassIsEnumerationException - * @throws ClassIsFinalException - * @throws ClassIsReadonlyException - * @throws DuplicateMethodException - * @throws InvalidArgumentException - * @throws InvalidMethodNameException - * @throws OriginalConstructorInvocationRequiredException - * @throws ReflectionException - * @throws RuntimeException - * @throws UnknownClassException - * @throws UnknownTypeException - */ - public function getMockForAbstractClass(string $originalClassName, array $arguments = [], string $mockClassName = '', bool $callOriginalConstructor = true, bool $callOriginalClone = true, bool $callAutoload = true, array $mockedMethods = null, bool $cloneArguments = true): MockObject - { - if (class_exists($originalClassName, $callAutoload) || - interface_exists($originalClassName, $callAutoload)) { - try { - $reflector = new ReflectionClass($originalClassName); - // @codeCoverageIgnoreStart - } catch (\ReflectionException $e) { - throw new ReflectionException( - $e->getMessage(), - $e->getCode(), - $e - ); - } - // @codeCoverageIgnoreEnd - - $methods = $mockedMethods; - - foreach ($reflector->getMethods() as $method) { - if ($method->isAbstract() && !in_array($method->getName(), $methods ?? [], true)) { - $methods[] = $method->getName(); - } - } - - if (empty($methods)) { - $methods = null; - } - - return $this->getMock( - $originalClassName, - $methods, - $arguments, - $mockClassName, - $callOriginalConstructor, - $callOriginalClone, - $callAutoload, - $cloneArguments - ); - } - - throw new UnknownClassException($originalClassName); - } - - /** - * Returns a mock object for the specified trait with all abstract methods - * of the trait mocked. Concrete methods to mock can be specified with the - * `$mockedMethods` parameter. - * - * @psalm-param trait-string $traitName - * - * @throws ClassAlreadyExistsException - * @throws ClassIsEnumerationException - * @throws ClassIsFinalException - * @throws ClassIsReadonlyException - * @throws DuplicateMethodException - * @throws InvalidArgumentException - * @throws InvalidMethodNameException - * @throws OriginalConstructorInvocationRequiredException - * @throws ReflectionException - * @throws RuntimeException - * @throws UnknownClassException - * @throws UnknownTraitException - * @throws UnknownTypeException - */ - public function getMockForTrait(string $traitName, array $arguments = [], string $mockClassName = '', bool $callOriginalConstructor = true, bool $callOriginalClone = true, bool $callAutoload = true, array $mockedMethods = null, bool $cloneArguments = true): MockObject - { - if (!trait_exists($traitName, $callAutoload)) { - throw new UnknownTraitException($traitName); - } - - $className = $this->generateClassName( - $traitName, - '', - 'Trait_' - ); - - $classTemplate = $this->loadTemplate('trait_class.tpl'); - - $classTemplate->setVar( - [ - 'prologue' => 'abstract ', - 'class_name' => $className['className'], - 'trait_name' => $traitName, - ] - ); - - $mockTrait = new MockTrait($classTemplate->render(), $className['className']); - $mockTrait->generate(); - - return $this->getMockForAbstractClass($className['className'], $arguments, $mockClassName, $callOriginalConstructor, $callOriginalClone, $callAutoload, $mockedMethods, $cloneArguments); - } - - /** - * Returns an object for the specified trait. - * - * @psalm-param trait-string $traitName - * - * @throws ReflectionException - * @throws RuntimeException - * @throws UnknownTraitException - */ - public function getObjectForTrait(string $traitName, string $traitClassName = '', bool $callAutoload = true, bool $callOriginalConstructor = false, array $arguments = []): object - { - if (!trait_exists($traitName, $callAutoload)) { - throw new UnknownTraitException($traitName); - } - - $className = $this->generateClassName( - $traitName, - $traitClassName, - 'Trait_' - ); - - $classTemplate = $this->loadTemplate('trait_class.tpl'); - - $classTemplate->setVar( - [ - 'prologue' => '', - 'class_name' => $className['className'], - 'trait_name' => $traitName, - ] - ); - - return $this->getObject( - new MockTrait( - $classTemplate->render(), - $className['className'] - ), - '', - $callOriginalConstructor, - $arguments - ); - } - - /** - * @throws ClassIsEnumerationException - * @throws ClassIsFinalException - * @throws ClassIsReadonlyException - * @throws ReflectionException - * @throws RuntimeException - */ - public function generate(string $type, array $methods = null, string $mockClassName = '', bool $callOriginalClone = true, bool $callAutoload = true, bool $cloneArguments = true, bool $callOriginalMethods = false): MockClass - { - if ($mockClassName !== '') { - return $this->generateMock( - $type, - $methods, - $mockClassName, - $callOriginalClone, - $callAutoload, - $cloneArguments, - $callOriginalMethods - ); - } - - $key = md5( - $type . - serialize($methods) . - serialize($callOriginalClone) . - serialize($cloneArguments) . - serialize($callOriginalMethods) - ); - - if (!isset(self::$cache[$key])) { - self::$cache[$key] = $this->generateMock( - $type, - $methods, - $mockClassName, - $callOriginalClone, - $callAutoload, - $cloneArguments, - $callOriginalMethods - ); - } - - return self::$cache[$key]; - } - - /** - * @throws RuntimeException - * @throws SoapExtensionNotAvailableException - */ - public function generateClassFromWsdl(string $wsdlFile, string $className, array $methods = [], array $options = []): string - { - if (!extension_loaded('soap')) { - throw new SoapExtensionNotAvailableException; - } - - $options['cache_wsdl'] = WSDL_CACHE_NONE; - - try { - $client = new SoapClient($wsdlFile, $options); - $_methods = array_unique($client->__getFunctions()); - unset($client); - } catch (SoapFault $e) { - throw new RuntimeException( - $e->getMessage(), - $e->getCode(), - $e - ); - } - - sort($_methods); - - $methodTemplate = $this->loadTemplate('wsdl_method.tpl'); - $methodsBuffer = ''; - - foreach ($_methods as $method) { - preg_match_all('/[a-zA-Z_\x7f-\xff][a-zA-Z0-9_\x7f-\xff]*\(/', $method, $matches, PREG_OFFSET_CAPTURE); - $lastFunction = array_pop($matches[0]); - $nameStart = $lastFunction[1]; - $nameEnd = $nameStart + strlen($lastFunction[0]) - 1; - $name = str_replace('(', '', $lastFunction[0]); - - if (empty($methods) || in_array($name, $methods, true)) { - $arguments = explode( - ',', - str_replace(')', '', substr($method, $nameEnd + 1)) - ); - - foreach (range(0, count($arguments) - 1) as $i) { - $parameterStart = strpos($arguments[$i], '$'); - - if (!$parameterStart) { - continue; - } - - $arguments[$i] = substr($arguments[$i], $parameterStart); - } - - $methodTemplate->setVar( - [ - 'method_name' => $name, - 'arguments' => implode(', ', $arguments), - ] - ); - - $methodsBuffer .= $methodTemplate->render(); - } - } - - $optionsBuffer = '['; - - foreach ($options as $key => $value) { - $optionsBuffer .= $key . ' => ' . $value; - } - - $optionsBuffer .= ']'; - - $classTemplate = $this->loadTemplate('wsdl_class.tpl'); - $namespace = ''; - - if (str_contains($className, '\\')) { - $parts = explode('\\', $className); - $className = array_pop($parts); - $namespace = 'namespace ' . implode('\\', $parts) . ';' . "\n\n"; - } - - $classTemplate->setVar( - [ - 'namespace' => $namespace, - 'class_name' => $className, - 'wsdl' => $wsdlFile, - 'options' => $optionsBuffer, - 'methods' => $methodsBuffer, - ] - ); - - return $classTemplate->render(); - } - - /** - * @throws ReflectionException - * - * @psalm-return list - */ - public function getClassMethods(string $className): array - { - try { - $class = new ReflectionClass($className); - // @codeCoverageIgnoreStart - } catch (\ReflectionException $e) { - throw new ReflectionException( - $e->getMessage(), - $e->getCode(), - $e - ); - } - // @codeCoverageIgnoreEnd - - $methods = []; - - foreach ($class->getMethods() as $method) { - if ($method->isPublic() || $method->isAbstract()) { - $methods[] = $method->getName(); - } - } - - return $methods; - } - - /** - * @throws ReflectionException - * - * @psalm-return list - */ - public function mockClassMethods(string $className, bool $callOriginalMethods, bool $cloneArguments): array - { - try { - $class = new ReflectionClass($className); - // @codeCoverageIgnoreStart - } catch (\ReflectionException $e) { - throw new ReflectionException( - $e->getMessage(), - $e->getCode(), - $e - ); - } - // @codeCoverageIgnoreEnd - - $methods = []; - - foreach ($class->getMethods() as $method) { - if (($method->isPublic() || $method->isAbstract()) && $this->canMethodBeDoubled($method)) { - $methods[] = MockMethod::fromReflection($method, $callOriginalMethods, $cloneArguments); - } - } - - return $methods; - } - - /** - * @throws ReflectionException - * - * @psalm-return list - */ - public function mockInterfaceMethods(string $interfaceName, bool $cloneArguments): array - { - try { - $class = new ReflectionClass($interfaceName); - // @codeCoverageIgnoreStart - } catch (\ReflectionException $e) { - throw new ReflectionException( - $e->getMessage(), - $e->getCode(), - $e - ); - } - // @codeCoverageIgnoreEnd - - $methods = []; - - foreach ($class->getMethods() as $method) { - $methods[] = MockMethod::fromReflection($method, false, $cloneArguments); - } - - return $methods; - } - - /** - * @psalm-param class-string $interfaceName - * - * @throws ReflectionException - * - * @psalm-return list - */ - private function userDefinedInterfaceMethods(string $interfaceName): array - { - try { - // @codeCoverageIgnoreStart - $interface = new ReflectionClass($interfaceName); - } catch (\ReflectionException $e) { - throw new ReflectionException( - $e->getMessage(), - $e->getCode(), - $e - ); - } - // @codeCoverageIgnoreEnd - - $methods = []; - - foreach ($interface->getMethods() as $method) { - if (!$method->isUserDefined()) { - continue; - } - - $methods[] = $method; - } - - return $methods; - } - - /** - * @throws ReflectionException - * @throws RuntimeException - */ - private function getObject(MockType $mockClass, string $type = '', bool $callOriginalConstructor = false, array $arguments = [], bool $callOriginalMethods = false, object $proxyTarget = null, bool $returnValueGeneration = true): object - { - $className = $mockClass->generate(); - $object = $this->instantiate($className, $callOriginalConstructor, $arguments); - - if ($callOriginalMethods) { - $this->instantiateProxyTarget($proxyTarget, $object, $type, $arguments); - } - - if ($object instanceof MockObject) { - $object->__phpunit_setReturnValueGeneration($returnValueGeneration); - } - - return $object; - } - - /** - * @throws ClassIsEnumerationException - * @throws ClassIsFinalException - * @throws ClassIsReadonlyException - * @throws ReflectionException - * @throws RuntimeException - */ - private function generateMock(string $type, ?array $explicitMethods, string $mockClassName, bool $callOriginalClone, bool $callAutoload, bool $cloneArguments, bool $callOriginalMethods): MockClass - { - $classTemplate = $this->loadTemplate('mocked_class.tpl'); - $additionalInterfaces = []; - $mockedCloneMethod = false; - $unmockedCloneMethod = false; - $isClass = false; - $isInterface = false; - $class = null; - $mockMethods = new MockMethodSet; - - $_mockClassName = $this->generateClassName( - $type, - $mockClassName, - 'Mock_' - ); - - if (class_exists($_mockClassName['fullClassName'], $callAutoload)) { - $isClass = true; - } elseif (interface_exists($_mockClassName['fullClassName'], $callAutoload)) { - $isInterface = true; - } - - if (!$isClass && !$isInterface) { - $prologue = 'class ' . $_mockClassName['originalClassName'] . "\n{\n}\n\n"; - - if (!empty($_mockClassName['namespaceName'])) { - $prologue = 'namespace ' . $_mockClassName['namespaceName'] . - " {\n\n" . $prologue . "}\n\n" . - "namespace {\n\n"; - - $epilogue = "\n\n}"; - } - - $mockedCloneMethod = true; - } else { - try { - $class = new ReflectionClass($_mockClassName['fullClassName']); - // @codeCoverageIgnoreStart - } catch (\ReflectionException $e) { - throw new ReflectionException( - $e->getMessage(), - $e->getCode(), - $e - ); - } - // @codeCoverageIgnoreEnd - - if ($class->isEnum()) { - throw new ClassIsEnumerationException($_mockClassName['fullClassName']); - } - - if ($class->isFinal()) { - throw new ClassIsFinalException($_mockClassName['fullClassName']); - } - - if (method_exists($class, 'isReadOnly') && $class->isReadOnly()) { - throw new ClassIsReadonlyException($_mockClassName['fullClassName']); - } - - // @see https://github.com/sebastianbergmann/phpunit/issues/2995 - if ($isInterface && $class->implementsInterface(Throwable::class)) { - $actualClassName = Exception::class; - $additionalInterfaces[] = $class->getName(); - $isInterface = false; - - try { - $class = new ReflectionClass($actualClassName); - // @codeCoverageIgnoreStart - } catch (\ReflectionException $e) { - throw new ReflectionException( - $e->getMessage(), - $e->getCode(), - $e - ); - } - // @codeCoverageIgnoreEnd - - foreach ($this->userDefinedInterfaceMethods($_mockClassName['fullClassName']) as $method) { - $methodName = $method->getName(); - - if ($class->hasMethod($methodName)) { - $classMethod = $class->getMethod($methodName); - - if (!$this->canMethodBeDoubled($classMethod)) { - continue; - } - } - - $mockMethods->addMethods( - MockMethod::fromReflection($method, $callOriginalMethods, $cloneArguments) - ); - } - - $_mockClassName = $this->generateClassName( - $actualClassName, - $_mockClassName['className'], - 'Mock_' - ); - } - - // @see https://github.com/sebastianbergmann/phpunit-mock-objects/issues/103 - if ($isInterface && $class->implementsInterface(Traversable::class) && - !$class->implementsInterface(Iterator::class) && - !$class->implementsInterface(IteratorAggregate::class)) { - $additionalInterfaces[] = Iterator::class; - - $mockMethods->addMethods( - ...$this->mockClassMethods(Iterator::class, $callOriginalMethods, $cloneArguments) - ); - } - - if ($class->hasMethod('__clone')) { - $cloneMethod = $class->getMethod('__clone'); - - if (!$cloneMethod->isFinal()) { - if ($callOriginalClone && !$isInterface) { - $unmockedCloneMethod = true; - } else { - $mockedCloneMethod = true; - } - } - } else { - $mockedCloneMethod = true; - } - } - - if ($isClass && $explicitMethods === []) { - $mockMethods->addMethods( - ...$this->mockClassMethods($_mockClassName['fullClassName'], $callOriginalMethods, $cloneArguments) - ); - } - - if ($isInterface && ($explicitMethods === [] || $explicitMethods === null)) { - $mockMethods->addMethods( - ...$this->mockInterfaceMethods($_mockClassName['fullClassName'], $cloneArguments) - ); - } - - if (is_array($explicitMethods)) { - foreach ($explicitMethods as $methodName) { - if ($class !== null && $class->hasMethod($methodName)) { - $method = $class->getMethod($methodName); - - if ($this->canMethodBeDoubled($method)) { - $mockMethods->addMethods( - MockMethod::fromReflection($method, $callOriginalMethods, $cloneArguments) - ); - } - } else { - $mockMethods->addMethods( - MockMethod::fromName( - $_mockClassName['fullClassName'], - $methodName, - $cloneArguments - ) - ); - } - } - } - - $mockedMethods = ''; - $configurable = []; - - foreach ($mockMethods->asArray() as $mockMethod) { - $mockedMethods .= $mockMethod->generateCode(); - $configurable[] = new ConfigurableMethod($mockMethod->methodName(), $mockMethod->returnType()); - } - - $method = ''; - - if (!$mockMethods->hasMethod('method') && (!isset($class) || !$class->hasMethod('method'))) { - $method = PHP_EOL . ' use \PHPUnit\Framework\MockObject\Method;'; - } - - $cloneTrait = ''; - - if ($mockedCloneMethod) { - $cloneTrait = PHP_EOL . ' use \PHPUnit\Framework\MockObject\MockedCloneMethod;'; - } - - if ($unmockedCloneMethod) { - $cloneTrait = PHP_EOL . ' use \PHPUnit\Framework\MockObject\UnmockedCloneMethod;'; - } - - $classTemplate->setVar( - [ - 'prologue' => $prologue ?? '', - 'epilogue' => $epilogue ?? '', - 'class_declaration' => $this->generateMockClassDeclaration( - $_mockClassName, - $isInterface, - $additionalInterfaces - ), - 'clone' => $cloneTrait, - 'mock_class_name' => $_mockClassName['className'], - 'mocked_methods' => $mockedMethods, - 'method' => $method, - ] - ); - - return new MockClass( - $classTemplate->render(), - $_mockClassName['className'], - $configurable - ); - } - - private function generateClassName(string $type, string $className, string $prefix): array - { - if ($type[0] === '\\') { - $type = substr($type, 1); - } - - $classNameParts = explode('\\', $type); - - if (count($classNameParts) > 1) { - $type = array_pop($classNameParts); - $namespaceName = implode('\\', $classNameParts); - $fullClassName = $namespaceName . '\\' . $type; - } else { - $namespaceName = ''; - $fullClassName = $type; - } - - if ($className === '') { - do { - $className = $prefix . $type . '_' . - substr(md5((string) mt_rand()), 0, 8); - } while (class_exists($className, false)); - } - - return [ - 'className' => $className, - 'originalClassName' => $type, - 'fullClassName' => $fullClassName, - 'namespaceName' => $namespaceName, - ]; - } - - private function generateMockClassDeclaration(array $mockClassName, bool $isInterface, array $additionalInterfaces = []): string - { - $buffer = 'class '; - - $additionalInterfaces[] = MockObject::class; - $interfaces = implode(', ', $additionalInterfaces); - - if ($isInterface) { - $buffer .= sprintf( - '%s implements %s', - $mockClassName['className'], - $interfaces - ); - - if (!in_array($mockClassName['originalClassName'], $additionalInterfaces, true)) { - $buffer .= ', '; - - if (!empty($mockClassName['namespaceName'])) { - $buffer .= $mockClassName['namespaceName'] . '\\'; - } - - $buffer .= $mockClassName['originalClassName']; - } - } else { - $buffer .= sprintf( - '%s extends %s%s implements %s', - $mockClassName['className'], - !empty($mockClassName['namespaceName']) ? $mockClassName['namespaceName'] . '\\' : '', - $mockClassName['originalClassName'], - $interfaces - ); - } - - return $buffer; - } - - private function canMethodBeDoubled(ReflectionMethod $method): bool - { - if ($method->isConstructor()) { - return false; - } - - if ($method->isDestructor()) { - return false; - } - - if ($method->isFinal()) { - return false; - } - - if ($method->isPrivate()) { - return false; - } - - return !$this->isMethodNameExcluded($method->getName()); - } - - private function isMethodNameExcluded(string $name): bool - { - return isset(self::EXCLUDED_METHOD_NAMES[$name]); - } - - /** - * @throws UnknownTypeException - */ - private function ensureKnownType(string $type, bool $callAutoload): void - { - if (!class_exists($type, $callAutoload) && !interface_exists($type, $callAutoload)) { - throw new UnknownTypeException($type); - } - } - - /** - * @throws DuplicateMethodException - * @throws InvalidMethodNameException - */ - private function ensureValidMethods(?array $methods): void - { - if (null !== $methods) { - foreach ($methods as $method) { - if (!preg_match('~[a-zA-Z_\x7f-\xff][a-zA-Z0-9_\x7f-\xff]*~', (string) $method)) { - throw new InvalidMethodNameException((string) $method); - } - } - - if ($methods !== array_unique($methods)) { - throw new DuplicateMethodException($methods); - } - } - } - - /** - * @throws ClassAlreadyExistsException - * @throws ReflectionException - */ - private function ensureMockedClassDoesNotAlreadyExist(string $mockClassName): void - { - if ($mockClassName !== '' && class_exists($mockClassName, false)) { - try { - $reflector = new ReflectionClass($mockClassName); - // @codeCoverageIgnoreStart - } catch (\ReflectionException $e) { - throw new ReflectionException( - $e->getMessage(), - $e->getCode(), - $e - ); - } - // @codeCoverageIgnoreEnd - - if (!$reflector->implementsInterface(MockObject::class)) { - throw new ClassAlreadyExistsException($mockClassName); - } - } - } - - /** - * @psalm-param class-string $className - * - * @throws ReflectionException - */ - private function instantiate(string $className, bool $callOriginalConstructor, array $arguments): object - { - if ($callOriginalConstructor) { - if (count($arguments) === 0) { - return new $className; - } - - try { - return (new ReflectionClass($className))->newInstanceArgs($arguments); - // @codeCoverageIgnoreStart - } catch (\ReflectionException $e) { - throw new ReflectionException( - $e->getMessage(), - $e->getCode(), - $e - ); - } - // @codeCoverageIgnoreEnd - } - - try { - return (new ReflectionClass($className))->newInstanceWithoutConstructor(); - // @codeCoverageIgnoreStart - } catch (\ReflectionException $e) { - throw new ReflectionException( - $e->getMessage(), - $e->getCode(), - $e - ); - } - // @codeCoverageIgnoreEnd - } - - /** - * @psalm-param class-string $type - * - * @throws ReflectionException - */ - private function instantiateProxyTarget(?object $proxyTarget, object $object, string $type, array $arguments): void - { - if (!is_object($proxyTarget)) { - assert(class_exists($type)); - - if (count($arguments) === 0) { - $proxyTarget = new $type; - } else { - $class = new ReflectionClass($type); - - try { - $proxyTarget = $class->newInstanceArgs($arguments); - // @codeCoverageIgnoreStart - } catch (\ReflectionException $e) { - throw new ReflectionException( - $e->getMessage(), - $e->getCode(), - $e - ); - } - // @codeCoverageIgnoreEnd - } - } - - $object->__phpunit_setOriginalObject($proxyTarget); - } -} diff --git a/vendor/phpunit/phpunit/src/Framework/MockObject/Generator/deprecation.tpl b/vendor/phpunit/phpunit/src/Framework/MockObject/Generator/deprecation.tpl deleted file mode 100644 index 5bf06f52..00000000 --- a/vendor/phpunit/phpunit/src/Framework/MockObject/Generator/deprecation.tpl +++ /dev/null @@ -1,2 +0,0 @@ - - @trigger_error({deprecation}, E_USER_DEPRECATED); diff --git a/vendor/phpunit/phpunit/src/Framework/MockObject/Generator/intersection.tpl b/vendor/phpunit/phpunit/src/Framework/MockObject/Generator/intersection.tpl deleted file mode 100644 index 75cd27a6..00000000 --- a/vendor/phpunit/phpunit/src/Framework/MockObject/Generator/intersection.tpl +++ /dev/null @@ -1,5 +0,0 @@ -declare(strict_types=1); - -interface {intersection} extends {interfaces} -{ -} diff --git a/vendor/phpunit/phpunit/src/Framework/MockObject/Generator/mocked_class.tpl b/vendor/phpunit/phpunit/src/Framework/MockObject/Generator/mocked_class.tpl deleted file mode 100644 index 593119fb..00000000 --- a/vendor/phpunit/phpunit/src/Framework/MockObject/Generator/mocked_class.tpl +++ /dev/null @@ -1,6 +0,0 @@ -declare(strict_types=1); - -{prologue}{class_declaration} -{ - use \PHPUnit\Framework\MockObject\Api;{method}{clone} -{mocked_methods}}{epilogue} diff --git a/vendor/phpunit/phpunit/src/Framework/MockObject/Generator/mocked_method.tpl b/vendor/phpunit/phpunit/src/Framework/MockObject/Generator/mocked_method.tpl deleted file mode 100644 index 114ff8d0..00000000 --- a/vendor/phpunit/phpunit/src/Framework/MockObject/Generator/mocked_method.tpl +++ /dev/null @@ -1,22 +0,0 @@ - - {modifier} function {reference}{method_name}({arguments_decl}){return_declaration} - {{deprecation} - $__phpunit_arguments = [{arguments_call}]; - $__phpunit_count = func_num_args(); - - if ($__phpunit_count > {arguments_count}) { - $__phpunit_arguments_tmp = func_get_args(); - - for ($__phpunit_i = {arguments_count}; $__phpunit_i < $__phpunit_count; $__phpunit_i++) { - $__phpunit_arguments[] = $__phpunit_arguments_tmp[$__phpunit_i]; - } - } - - $__phpunit_result = $this->__phpunit_getInvocationHandler()->invoke( - new \PHPUnit\Framework\MockObject\Invocation( - '{class_name}', '{method_name}', $__phpunit_arguments, '{return_type}', $this, {clone_arguments} - ) - ); - - return $__phpunit_result; - } diff --git a/vendor/phpunit/phpunit/src/Framework/MockObject/Generator/mocked_method_never_or_void.tpl b/vendor/phpunit/phpunit/src/Framework/MockObject/Generator/mocked_method_never_or_void.tpl deleted file mode 100644 index 39020220..00000000 --- a/vendor/phpunit/phpunit/src/Framework/MockObject/Generator/mocked_method_never_or_void.tpl +++ /dev/null @@ -1,20 +0,0 @@ - - {modifier} function {reference}{method_name}({arguments_decl}){return_declaration} - {{deprecation} - $__phpunit_arguments = [{arguments_call}]; - $__phpunit_count = func_num_args(); - - if ($__phpunit_count > {arguments_count}) { - $__phpunit_arguments_tmp = func_get_args(); - - for ($__phpunit_i = {arguments_count}; $__phpunit_i < $__phpunit_count; $__phpunit_i++) { - $__phpunit_arguments[] = $__phpunit_arguments_tmp[$__phpunit_i]; - } - } - - $this->__phpunit_getInvocationHandler()->invoke( - new \PHPUnit\Framework\MockObject\Invocation( - '{class_name}', '{method_name}', $__phpunit_arguments, '{return_type}', $this, {clone_arguments} - ) - ); - } diff --git a/vendor/phpunit/phpunit/src/Framework/MockObject/Generator/mocked_static_method.tpl b/vendor/phpunit/phpunit/src/Framework/MockObject/Generator/mocked_static_method.tpl deleted file mode 100644 index 5e5cf23c..00000000 --- a/vendor/phpunit/phpunit/src/Framework/MockObject/Generator/mocked_static_method.tpl +++ /dev/null @@ -1,5 +0,0 @@ - - {modifier} function {reference}{method_name}({arguments_decl}){return_declaration} - { - throw new \PHPUnit\Framework\MockObject\BadMethodCallException('Static method "{method_name}" cannot be invoked on mock object'); - } diff --git a/vendor/phpunit/phpunit/src/Framework/MockObject/Generator/proxied_method.tpl b/vendor/phpunit/phpunit/src/Framework/MockObject/Generator/proxied_method.tpl deleted file mode 100644 index 91bef463..00000000 --- a/vendor/phpunit/phpunit/src/Framework/MockObject/Generator/proxied_method.tpl +++ /dev/null @@ -1,22 +0,0 @@ - - {modifier} function {reference}{method_name}({arguments_decl}){return_declaration} - { - $__phpunit_arguments = [{arguments_call}]; - $__phpunit_count = func_num_args(); - - if ($__phpunit_count > {arguments_count}) { - $__phpunit_arguments_tmp = func_get_args(); - - for ($__phpunit_i = {arguments_count}; $__phpunit_i < $__phpunit_count; $__phpunit_i++) { - $__phpunit_arguments[] = $__phpunit_arguments_tmp[$__phpunit_i]; - } - } - - $this->__phpunit_getInvocationHandler()->invoke( - new \PHPUnit\Framework\MockObject\Invocation( - '{class_name}', '{method_name}', $__phpunit_arguments, '{return_type}', $this, {clone_arguments}, true - ) - ); - - return call_user_func_array(array($this->__phpunit_originalObject, "{method_name}"), $__phpunit_arguments); - } diff --git a/vendor/phpunit/phpunit/src/Framework/MockObject/Generator/proxied_method_never_or_void.tpl b/vendor/phpunit/phpunit/src/Framework/MockObject/Generator/proxied_method_never_or_void.tpl deleted file mode 100644 index cce19882..00000000 --- a/vendor/phpunit/phpunit/src/Framework/MockObject/Generator/proxied_method_never_or_void.tpl +++ /dev/null @@ -1,22 +0,0 @@ - - {modifier} function {reference}{method_name}({arguments_decl}){return_declaration} - { - $__phpunit_arguments = [{arguments_call}]; - $__phpunit_count = func_num_args(); - - if ($__phpunit_count > {arguments_count}) { - $__phpunit_arguments_tmp = func_get_args(); - - for ($__phpunit_i = {arguments_count}; $__phpunit_i < $__phpunit_count; $__phpunit_i++) { - $__phpunit_arguments[] = $__phpunit_arguments_tmp[$__phpunit_i]; - } - } - - $this->__phpunit_getInvocationHandler()->invoke( - new \PHPUnit\Framework\MockObject\Invocation( - '{class_name}', '{method_name}', $__phpunit_arguments, '{return_type}', $this, {clone_arguments}, true - ) - ); - - call_user_func_array(array($this->__phpunit_originalObject, "{method_name}"), $__phpunit_arguments); - } diff --git a/vendor/phpunit/phpunit/src/Framework/MockObject/Generator/trait_class.tpl b/vendor/phpunit/phpunit/src/Framework/MockObject/Generator/trait_class.tpl deleted file mode 100644 index a8fe470f..00000000 --- a/vendor/phpunit/phpunit/src/Framework/MockObject/Generator/trait_class.tpl +++ /dev/null @@ -1,6 +0,0 @@ -declare(strict_types=1); - -{prologue}class {class_name} -{ - use {trait_name}; -} diff --git a/vendor/phpunit/phpunit/src/Framework/MockObject/Generator/wsdl_class.tpl b/vendor/phpunit/phpunit/src/Framework/MockObject/Generator/wsdl_class.tpl deleted file mode 100644 index b3100b41..00000000 --- a/vendor/phpunit/phpunit/src/Framework/MockObject/Generator/wsdl_class.tpl +++ /dev/null @@ -1,9 +0,0 @@ -declare(strict_types=1); - -{namespace}class {class_name} extends \SoapClient -{ - public function __construct($wsdl, array $options) - { - parent::__construct('{wsdl}', $options); - } -{methods}} diff --git a/vendor/phpunit/phpunit/src/Framework/MockObject/Generator/wsdl_method.tpl b/vendor/phpunit/phpunit/src/Framework/MockObject/Generator/wsdl_method.tpl deleted file mode 100644 index bb16e763..00000000 --- a/vendor/phpunit/phpunit/src/Framework/MockObject/Generator/wsdl_method.tpl +++ /dev/null @@ -1,4 +0,0 @@ - - public function {method_name}({arguments}) - { - } diff --git a/vendor/phpunit/phpunit/src/Framework/MockObject/Invocation.php b/vendor/phpunit/phpunit/src/Framework/MockObject/Invocation.php deleted file mode 100644 index 28aa57b3..00000000 --- a/vendor/phpunit/phpunit/src/Framework/MockObject/Invocation.php +++ /dev/null @@ -1,274 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace PHPUnit\Framework\MockObject; - -use function array_map; -use function explode; -use function implode; -use function in_array; -use function interface_exists; -use function is_object; -use function sprintf; -use function str_contains; -use function str_starts_with; -use function strtolower; -use function substr; -use PHPUnit\Framework\SelfDescribing; -use PHPUnit\Util\Cloner; -use ReflectionClass; -use SebastianBergmann\Exporter\Exporter; -use stdClass; -use Throwable; - -/** - * @internal This class is not covered by the backward compatibility promise for PHPUnit - */ -final class Invocation implements SelfDescribing -{ - private readonly string $className; - private readonly string $methodName; - private array $parameters; - private readonly string $returnType; - private bool $isReturnTypeNullable = false; - private readonly bool $proxiedCall; - private readonly object $object; - - public function __construct(string $className, string $methodName, array $parameters, string $returnType, object $object, bool $cloneObjects = false, bool $proxiedCall = false) - { - $this->className = $className; - $this->methodName = $methodName; - $this->parameters = $parameters; - $this->object = $object; - $this->proxiedCall = $proxiedCall; - - if (strtolower($methodName) === '__tostring') { - $returnType = 'string'; - } - - if (str_starts_with($returnType, '?')) { - $returnType = substr($returnType, 1); - $this->isReturnTypeNullable = true; - } - - $this->returnType = $returnType; - - if (!$cloneObjects) { - return; - } - - foreach ($this->parameters as $key => $value) { - if (is_object($value)) { - $this->parameters[$key] = Cloner::clone($value); - } - } - } - - public function className(): string - { - return $this->className; - } - - public function methodName(): string - { - return $this->methodName; - } - - public function parameters(): array - { - return $this->parameters; - } - - /** - * @throws Exception - */ - public function generateReturnValue(): mixed - { - if ($this->isReturnTypeNullable || $this->proxiedCall) { - return null; - } - - $intersection = false; - $union = false; - $unionContainsIntersections = false; - - if (str_contains($this->returnType, '|')) { - $types = explode('|', $this->returnType); - $union = true; - - if (str_contains($this->returnType, '(')) { - $unionContainsIntersections = true; - } - } elseif (str_contains($this->returnType, '&')) { - $types = explode('&', $this->returnType); - $intersection = true; - } else { - $types = [$this->returnType]; - } - - $types = array_map('strtolower', $types); - - if (!$intersection && !$unionContainsIntersections) { - if (in_array('', $types, true) || - in_array('null', $types, true) || - in_array('mixed', $types, true) || - in_array('void', $types, true)) { - return null; - } - - if (in_array('true', $types, true)) { - return true; - } - - if (in_array('false', $types, true) || - in_array('bool', $types, true)) { - return false; - } - - if (in_array('float', $types, true)) { - return 0.0; - } - - if (in_array('int', $types, true)) { - return 0; - } - - if (in_array('string', $types, true)) { - return ''; - } - - if (in_array('array', $types, true)) { - return []; - } - - if (in_array('static', $types, true)) { - try { - return (new ReflectionClass($this->object::class))->newInstanceWithoutConstructor(); - // @codeCoverageIgnoreStart - } catch (\ReflectionException $e) { - throw new ReflectionException( - $e->getMessage(), - $e->getCode(), - $e - ); - } - // @codeCoverageIgnoreEnd - } - - if (in_array('object', $types, true)) { - return new stdClass; - } - - if (in_array('callable', $types, true) || - in_array('closure', $types, true)) { - return static function (): void - { - }; - } - - if (in_array('traversable', $types, true) || - in_array('generator', $types, true) || - in_array('iterable', $types, true)) { - $generator = static function (): \Generator - { - yield from []; - }; - - return $generator(); - } - - if (!$union) { - try { - return (new Generator)->getMock($this->returnType, [], [], '', false); - } catch (Throwable $t) { - if ($t instanceof Exception) { - throw $t; - } - - throw new RuntimeException( - $t->getMessage(), - (int) $t->getCode(), - $t - ); - } - } - } - - if ($intersection && $this->onlyInterfaces($types)) { - try { - return (new Generator)->getMockForInterfaces($types); - } catch (Throwable $t) { - throw new RuntimeException( - sprintf( - 'Return value for %s::%s() cannot be generated: %s', - $this->className, - $this->methodName, - $t->getMessage(), - ), - (int) $t->getCode(), - ); - } - } - - $reason = ''; - - if ($union) { - $reason = ' because the declared return type is a union'; - } elseif ($intersection) { - $reason = ' because the declared return type is an intersection'; - } - - throw new RuntimeException( - sprintf( - 'Return value for %s::%s() cannot be generated%s, please configure a return value for this method', - $this->className, - $this->methodName, - $reason - ) - ); - } - - public function toString(): string - { - $exporter = new Exporter; - - return sprintf( - '%s::%s(%s)%s', - $this->className, - $this->methodName, - implode( - ', ', - array_map( - [$exporter, 'shortenedExport'], - $this->parameters - ) - ), - $this->returnType ? sprintf(': %s', $this->returnType) : '' - ); - } - - public function object(): object - { - return $this->object; - } - - /** - * @psalm-param non-empty-list $types - */ - private function onlyInterfaces(array $types): bool - { - foreach ($types as $type) { - if (!interface_exists($type)) { - return false; - } - } - - return true; - } -} diff --git a/vendor/phpunit/phpunit/src/Framework/MockObject/InvocationHandler.php b/vendor/phpunit/phpunit/src/Framework/MockObject/InvocationHandler.php deleted file mode 100644 index 2c4c5a86..00000000 --- a/vendor/phpunit/phpunit/src/Framework/MockObject/InvocationHandler.php +++ /dev/null @@ -1,172 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace PHPUnit\Framework\MockObject; - -use function strtolower; -use Exception; -use PHPUnit\Framework\MockObject\Builder\InvocationMocker; -use PHPUnit\Framework\MockObject\Rule\InvocationOrder; -use Throwable; - -/** - * @internal This class is not covered by the backward compatibility promise for PHPUnit - */ -final class InvocationHandler -{ - /** - * @psalm-var list - */ - private array $matchers = []; - - /** - * @psalm-var array - */ - private array $matcherMap = []; - - /** - * @psalm-var list - */ - private readonly array $configurableMethods; - private readonly bool $returnValueGeneration; - private ?ReturnValueNotConfiguredException $deferredError = null; - - /** - * @psalm-param list $configurableMethods - */ - public function __construct(array $configurableMethods, bool $returnValueGeneration) - { - $this->configurableMethods = $configurableMethods; - $this->returnValueGeneration = $returnValueGeneration; - } - - public function hasMatchers(): bool - { - foreach ($this->matchers as $matcher) { - if ($matcher->hasMatchers()) { - return true; - } - } - - return false; - } - - /** - * Looks up the match builder with identification $id and returns it. - */ - public function lookupMatcher(string $id): ?Matcher - { - return $this->matcherMap[$id] ?? null; - } - - /** - * Registers a matcher with the identification $id. The matcher can later be - * looked up using lookupMatcher() to figure out if it has been invoked. - * - * @throws MatcherAlreadyRegisteredException - */ - public function registerMatcher(string $id, Matcher $matcher): void - { - if (isset($this->matcherMap[$id])) { - throw new MatcherAlreadyRegisteredException($id); - } - - $this->matcherMap[$id] = $matcher; - } - - public function expects(InvocationOrder $rule): InvocationMocker - { - $matcher = new Matcher($rule); - $this->addMatcher($matcher); - - return new InvocationMocker( - $this, - $matcher, - ...$this->configurableMethods - ); - } - - /** - * @throws \PHPUnit\Framework\MockObject\Exception - * @throws Exception - */ - public function invoke(Invocation $invocation): mixed - { - $exception = null; - $hasReturnValue = false; - $returnValue = null; - - foreach ($this->matchers as $match) { - try { - if ($match->matches($invocation)) { - $value = $match->invoked($invocation); - - if (!$hasReturnValue) { - $returnValue = $value; - $hasReturnValue = true; - } - } - } catch (Exception $e) { - $exception = $e; - } - } - - if ($exception !== null) { - throw $exception; - } - - if ($hasReturnValue) { - return $returnValue; - } - - if (!$this->returnValueGeneration) { - $exception = new ReturnValueNotConfiguredException($invocation); - - if (strtolower($invocation->methodName()) === '__tostring') { - $this->deferredError = $exception; - - return ''; - } - - throw $exception; - } - - return $invocation->generateReturnValue(); - } - - public function matches(Invocation $invocation): bool - { - foreach ($this->matchers as $matcher) { - if (!$matcher->matches($invocation)) { - return false; - } - } - - return true; - } - - /** - * @throws Throwable - */ - public function verify(): void - { - foreach ($this->matchers as $matcher) { - $matcher->verify(); - } - - if ($this->deferredError) { - throw $this->deferredError; - } - } - - private function addMatcher(Matcher $matcher): void - { - $this->matchers[] = $matcher; - } -} diff --git a/vendor/phpunit/phpunit/src/Framework/MockObject/Matcher.php b/vendor/phpunit/phpunit/src/Framework/MockObject/Matcher.php deleted file mode 100644 index 55763024..00000000 --- a/vendor/phpunit/phpunit/src/Framework/MockObject/Matcher.php +++ /dev/null @@ -1,237 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace PHPUnit\Framework\MockObject; - -use function assert; -use function implode; -use function sprintf; -use PHPUnit\Framework\ExpectationFailedException; -use PHPUnit\Framework\MockObject\Rule\AnyInvokedCount; -use PHPUnit\Framework\MockObject\Rule\AnyParameters; -use PHPUnit\Framework\MockObject\Rule\InvocationOrder; -use PHPUnit\Framework\MockObject\Rule\InvokedAtMostCount; -use PHPUnit\Framework\MockObject\Rule\InvokedCount; -use PHPUnit\Framework\MockObject\Rule\MethodName; -use PHPUnit\Framework\MockObject\Rule\ParametersRule; -use PHPUnit\Framework\MockObject\Stub\Stub; -use PHPUnit\Util\ThrowableToStringMapper; - -/** - * @internal This class is not covered by the backward compatibility promise for PHPUnit - */ -final class Matcher -{ - private readonly InvocationOrder $invocationRule; - private ?string $afterMatchBuilderId = null; - private ?MethodName $methodNameRule = null; - private ?ParametersRule $parametersRule = null; - private ?Stub $stub = null; - - public function __construct(InvocationOrder $rule) - { - $this->invocationRule = $rule; - } - - public function hasMatchers(): bool - { - return !$this->invocationRule instanceof AnyInvokedCount; - } - - public function hasMethodNameRule(): bool - { - return $this->methodNameRule !== null; - } - - public function methodNameRule(): MethodName - { - return $this->methodNameRule; - } - - public function setMethodNameRule(MethodName $rule): void - { - $this->methodNameRule = $rule; - } - - public function hasParametersRule(): bool - { - return $this->parametersRule !== null; - } - - public function setParametersRule(ParametersRule $rule): void - { - $this->parametersRule = $rule; - } - - public function setStub(Stub $stub): void - { - $this->stub = $stub; - } - - public function setAfterMatchBuilderId(string $id): void - { - $this->afterMatchBuilderId = $id; - } - - /** - * @throws Exception - * @throws ExpectationFailedException - * @throws MatchBuilderNotFoundException - * @throws MethodNameNotConfiguredException - * @throws RuntimeException - */ - public function invoked(Invocation $invocation): mixed - { - if ($this->methodNameRule === null) { - throw new MethodNameNotConfiguredException; - } - - if ($this->afterMatchBuilderId !== null) { - $matcher = $invocation->object() - ->__phpunit_getInvocationHandler() - ->lookupMatcher($this->afterMatchBuilderId); - - if (!$matcher) { - throw new MatchBuilderNotFoundException($this->afterMatchBuilderId); - } - } - - $this->invocationRule->invoked($invocation); - - try { - $this->parametersRule?->apply($invocation); - } catch (ExpectationFailedException $e) { - throw new ExpectationFailedException( - sprintf( - "Expectation failed for %s when %s\n%s", - $this->methodNameRule->toString(), - $this->invocationRule->toString(), - $e->getMessage() - ), - $e->getComparisonFailure() - ); - } - - if ($this->stub) { - return $this->stub->invoke($invocation); - } - - return $invocation->generateReturnValue(); - } - - /** - * @throws ExpectationFailedException - * @throws MatchBuilderNotFoundException - * @throws MethodNameNotConfiguredException - * @throws RuntimeException - */ - public function matches(Invocation $invocation): bool - { - if ($this->afterMatchBuilderId !== null) { - $matcher = $invocation->object() - ->__phpunit_getInvocationHandler() - ->lookupMatcher($this->afterMatchBuilderId); - - if (!$matcher) { - throw new MatchBuilderNotFoundException($this->afterMatchBuilderId); - } - - assert($matcher instanceof self); - - if (!$matcher->invocationRule->hasBeenInvoked()) { - return false; - } - } - - if ($this->methodNameRule === null) { - throw new MethodNameNotConfiguredException; - } - - if (!$this->invocationRule->matches($invocation)) { - return false; - } - - try { - if (!$this->methodNameRule->matches($invocation)) { - return false; - } - } catch (ExpectationFailedException $e) { - throw new ExpectationFailedException( - sprintf( - "Expectation failed for %s when %s\n%s", - $this->methodNameRule->toString(), - $this->invocationRule->toString(), - $e->getMessage() - ), - $e->getComparisonFailure() - ); - } - - return true; - } - - /** - * @throws ExpectationFailedException - * @throws MethodNameNotConfiguredException - */ - public function verify(): void - { - if ($this->methodNameRule === null) { - throw new MethodNameNotConfiguredException; - } - - try { - $this->invocationRule->verify(); - - if ($this->parametersRule === null) { - $this->parametersRule = new AnyParameters; - } - - $invocationIsAny = $this->invocationRule instanceof AnyInvokedCount; - $invocationIsNever = $this->invocationRule instanceof InvokedCount && $this->invocationRule->isNever(); - $invocationIsAtMost = $this->invocationRule instanceof InvokedAtMostCount; - - if (!$invocationIsAny && !$invocationIsNever && !$invocationIsAtMost) { - $this->parametersRule->verify(); - } - } catch (ExpectationFailedException $e) { - throw new ExpectationFailedException( - sprintf( - "Expectation failed for %s when %s.\n%s", - $this->methodNameRule->toString(), - $this->invocationRule->toString(), - ThrowableToStringMapper::map($e) - ) - ); - } - } - - public function toString(): string - { - $list = [$this->invocationRule->toString()]; - - if ($this->methodNameRule !== null) { - $list[] = 'where ' . $this->methodNameRule->toString(); - } - - if ($this->parametersRule !== null) { - $list[] = 'and ' . $this->parametersRule->toString(); - } - - if ($this->afterMatchBuilderId !== null) { - $list[] = 'after ' . $this->afterMatchBuilderId; - } - - if ($this->stub !== null) { - $list[] = 'will ' . $this->stub->toString(); - } - - return implode(' ', $list); - } -} diff --git a/vendor/phpunit/phpunit/src/Framework/MockObject/MethodNameConstraint.php b/vendor/phpunit/phpunit/src/Framework/MockObject/MethodNameConstraint.php deleted file mode 100644 index 47da874b..00000000 --- a/vendor/phpunit/phpunit/src/Framework/MockObject/MethodNameConstraint.php +++ /dev/null @@ -1,45 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace PHPUnit\Framework\MockObject; - -use function is_string; -use function sprintf; -use function strtolower; -use PHPUnit\Framework\Constraint\Constraint; - -/** - * @internal This class is not covered by the backward compatibility promise for PHPUnit - */ -final class MethodNameConstraint extends Constraint -{ - private readonly string $methodName; - - public function __construct(string $methodName) - { - $this->methodName = $methodName; - } - - public function toString(): string - { - return sprintf( - 'is "%s"', - $this->methodName - ); - } - - protected function matches(mixed $other): bool - { - if (!is_string($other)) { - return false; - } - - return strtolower($this->methodName) === strtolower($other); - } -} diff --git a/vendor/phpunit/phpunit/src/Framework/MockObject/MockBuilder.php b/vendor/phpunit/phpunit/src/Framework/MockObject/MockBuilder.php index dd87cd72..547c5028 100644 --- a/vendor/phpunit/phpunit/src/Framework/MockObject/MockBuilder.php +++ b/vendor/phpunit/phpunit/src/Framework/MockObject/MockBuilder.php @@ -10,6 +10,22 @@ namespace PHPUnit\Framework\MockObject; use function array_merge; +use function assert; +use function trait_exists; +use PHPUnit\Framework\Exception; +use PHPUnit\Framework\InvalidArgumentException; +use PHPUnit\Framework\MockObject\Generator\CannotUseAddMethodsException; +use PHPUnit\Framework\MockObject\Generator\ClassIsEnumerationException; +use PHPUnit\Framework\MockObject\Generator\ClassIsFinalException; +use PHPUnit\Framework\MockObject\Generator\ClassIsReadonlyException; +use PHPUnit\Framework\MockObject\Generator\DuplicateMethodException; +use PHPUnit\Framework\MockObject\Generator\Generator; +use PHPUnit\Framework\MockObject\Generator\InvalidMethodNameException; +use PHPUnit\Framework\MockObject\Generator\NameAlreadyInUseException; +use PHPUnit\Framework\MockObject\Generator\OriginalConstructorInvocationRequiredException; +use PHPUnit\Framework\MockObject\Generator\ReflectionException; +use PHPUnit\Framework\MockObject\Generator\RuntimeException; +use PHPUnit\Framework\MockObject\Generator\UnknownTypeException; use PHPUnit\Framework\TestCase; use ReflectionClass; @@ -21,10 +37,22 @@ use ReflectionClass; final class MockBuilder { private readonly TestCase $testCase; + + /** + * @psalm-var class-string|trait-string + */ private readonly string $type; - private ?array $methods = []; - private bool $emptyMethodsArray = false; - private string $mockClassName = ''; + + /** + * @psalm-var list + */ + private array $methods = []; + private bool $emptyMethodsArray = false; + + /** + * @psalm-var ?class-string + */ + private ?string $mockClassName = null; private array $constructorArgs = []; private bool $originalConstructor = true; private bool $originalClone = true; @@ -37,7 +65,7 @@ final class MockBuilder private readonly Generator $generator; /** - * @psalm-param class-string $type + * @psalm-param class-string|trait-string $type */ public function __construct(TestCase $testCase, string $type) { @@ -49,13 +77,13 @@ final class MockBuilder /** * Creates a mock object using a fluent interface. * - * @throws \PHPUnit\Framework\InvalidArgumentException - * @throws ClassAlreadyExistsException * @throws ClassIsEnumerationException * @throws ClassIsFinalException * @throws ClassIsReadonlyException * @throws DuplicateMethodException + * @throws InvalidArgumentException * @throws InvalidMethodNameException + * @throws NameAlreadyInUseException * @throws OriginalConstructorInvocationRequiredException * @throws ReflectionException * @throws RuntimeException @@ -63,13 +91,14 @@ final class MockBuilder * * @psalm-return MockObject&MockedType */ - public function getMock(bool $register = true): MockObject + public function getMock(): MockObject { - $object = $this->generator->getMock( + $object = $this->generator->testDouble( $this->type, + true, !$this->emptyMethodsArray ? $this->methods : null, $this->constructorArgs, - $this->mockClassName, + $this->mockClassName ?? '', $this->originalConstructor, $this->originalClone, $this->autoload, @@ -77,12 +106,13 @@ final class MockBuilder $this->callOriginalMethods, $this->proxyTarget, $this->allowMockingUnknownTypes, - $this->returnValueGeneration + $this->returnValueGeneration, ); - if ($register) { - $this->testCase->registerMockObject($object); - } + assert($object instanceof $this->type); + assert($object instanceof MockObject); + + $this->testCase->registerMockObject($object); return $object; } @@ -90,25 +120,29 @@ final class MockBuilder /** * Creates a mock object for an abstract class using a fluent interface. * - * @psalm-return MockObject&MockedType - * - * @throws \PHPUnit\Framework\Exception + * @throws Exception * @throws ReflectionException * @throws RuntimeException + * + * @psalm-return MockObject&MockedType + * + * @deprecated https://github.com/sebastianbergmann/phpunit/issues/5305 */ public function getMockForAbstractClass(): MockObject { - $object = $this->generator->getMockForAbstractClass( + $object = $this->generator->mockObjectForAbstractClass( $this->type, $this->constructorArgs, - $this->mockClassName, + $this->mockClassName ?? '', $this->originalConstructor, $this->originalClone, $this->autoload, $this->methods, - $this->cloneArguments + $this->cloneArguments, ); + assert($object instanceof MockObject); + $this->testCase->registerMockObject($object); return $object; @@ -117,25 +151,31 @@ final class MockBuilder /** * Creates a mock object for a trait using a fluent interface. * - * @psalm-return MockObject&MockedType - * - * @throws \PHPUnit\Framework\Exception + * @throws Exception * @throws ReflectionException * @throws RuntimeException + * + * @psalm-return MockObject&MockedType + * + * @deprecated https://github.com/sebastianbergmann/phpunit/issues/5306 */ public function getMockForTrait(): MockObject { - $object = $this->generator->getMockForTrait( + assert(trait_exists($this->type)); + + $object = $this->generator->mockObjectForTrait( $this->type, $this->constructorArgs, - $this->mockClassName, + $this->mockClassName ?? '', $this->originalConstructor, $this->originalClone, $this->autoload, $this->methods, - $this->cloneArguments + $this->cloneArguments, ); + assert($object instanceof MockObject); + $this->testCase->registerMockObject($object); return $object; @@ -144,7 +184,7 @@ final class MockBuilder /** * Specifies the subset of methods to mock, requiring each to exist in the class. * - * @psalm-param list $methods + * @psalm-param list $methods * * @throws CannotUseOnlyMethodsException * @throws ReflectionException @@ -166,10 +206,10 @@ final class MockBuilder throw new ReflectionException( $e->getMessage(), $e->getCode(), - $e + $e, ); + // @codeCoverageIgnoreEnd } - // @codeCoverageIgnoreEnd foreach ($methods as $method) { if (!$reflector->hasMethod($method)) { @@ -177,7 +217,7 @@ final class MockBuilder } } - $this->methods = array_merge($this->methods ?? [], $methods); + $this->methods = array_merge($this->methods, $methods); return $this; } @@ -185,13 +225,15 @@ final class MockBuilder /** * Specifies methods that don't exist in the class which you want to mock. * - * @psalm-param list $methods + * @psalm-param list $methods * * @throws CannotUseAddMethodsException * @throws ReflectionException * @throws RuntimeException * * @return $this + * + * @deprecated https://github.com/sebastianbergmann/phpunit/issues/5320 */ public function addMethods(array $methods): self { @@ -208,10 +250,10 @@ final class MockBuilder throw new ReflectionException( $e->getMessage(), $e->getCode(), - $e + $e, ); + // @codeCoverageIgnoreEnd } - // @codeCoverageIgnoreEnd foreach ($methods as $method) { if ($reflector->hasMethod($method)) { @@ -219,7 +261,7 @@ final class MockBuilder } } - $this->methods = array_merge($this->methods ?? [], $methods); + $this->methods = array_merge($this->methods, $methods); return $this; } @@ -239,6 +281,8 @@ final class MockBuilder /** * Specifies the name for the mock class. * + * @psalm-param class-string $name + * * @return $this */ public function setMockClassName(string $name): self @@ -300,6 +344,10 @@ final class MockBuilder * Disables the use of class autoloading while creating the mock object. * * @return $this + * + * @deprecated https://github.com/sebastianbergmann/phpunit/issues/5309 + * + * @codeCoverageIgnore */ public function disableAutoload(): self { @@ -312,6 +360,8 @@ final class MockBuilder * Enables the use of class autoloading while creating the mock object. * * @return $this + * + * @deprecated https://github.com/sebastianbergmann/phpunit/issues/5309 */ public function enableAutoload(): self { @@ -324,6 +374,8 @@ final class MockBuilder * Disables the cloning of arguments passed to mocked methods. * * @return $this + * + * @deprecated https://github.com/sebastianbergmann/phpunit/issues/5315 */ public function disableArgumentCloning(): self { @@ -336,6 +388,8 @@ final class MockBuilder * Enables the cloning of arguments passed to mocked methods. * * @return $this + * + * @deprecated https://github.com/sebastianbergmann/phpunit/issues/5315 */ public function enableArgumentCloning(): self { @@ -348,6 +402,10 @@ final class MockBuilder * Enables the invocation of the original methods. * * @return $this + * + * @deprecated https://github.com/sebastianbergmann/phpunit/issues/5307 + * + * @codeCoverageIgnore */ public function enableProxyingToOriginalMethods(): self { @@ -360,6 +418,8 @@ final class MockBuilder * Disables the invocation of the original methods. * * @return $this + * + * @deprecated https://github.com/sebastianbergmann/phpunit/issues/5307 */ public function disableProxyingToOriginalMethods(): self { @@ -373,6 +433,10 @@ final class MockBuilder * Sets the proxy target. * * @return $this + * + * @deprecated https://github.com/sebastianbergmann/phpunit/issues/5307 + * + * @codeCoverageIgnore */ public function setProxyTarget(object $object): self { @@ -383,6 +447,8 @@ final class MockBuilder /** * @return $this + * + * @deprecated https://github.com/sebastianbergmann/phpunit/issues/5308 */ public function allowMockingUnknownTypes(): self { @@ -393,6 +459,8 @@ final class MockBuilder /** * @return $this + * + * @deprecated https://github.com/sebastianbergmann/phpunit/issues/5308 */ public function disallowMockingUnknownTypes(): self { diff --git a/vendor/phpunit/phpunit/src/Framework/MockObject/MockClass.php b/vendor/phpunit/phpunit/src/Framework/MockObject/MockClass.php deleted file mode 100644 index 69a9c542..00000000 --- a/vendor/phpunit/phpunit/src/Framework/MockObject/MockClass.php +++ /dev/null @@ -1,67 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace PHPUnit\Framework\MockObject; - -use function call_user_func; -use function class_exists; - -/** - * @internal This class is not covered by the backward compatibility promise for PHPUnit - */ -final class MockClass implements MockType -{ - private readonly string $classCode; - - /** - * @psalm-var class-string - */ - private readonly string $mockName; - - /** - * @psalm-var list - */ - private readonly array $configurableMethods; - - /** - * @psalm-param class-string $mockName - * @psalm-param list $configurableMethods - */ - public function __construct(string $classCode, string $mockName, array $configurableMethods) - { - $this->classCode = $classCode; - $this->mockName = $mockName; - $this->configurableMethods = $configurableMethods; - } - - /** - * @psalm-return class-string - */ - public function generate(): string - { - if (!class_exists($this->mockName, false)) { - eval($this->classCode); - - call_user_func( - [ - $this->mockName, - '__phpunit_initConfigurableMethods', - ], - ...$this->configurableMethods - ); - } - - return $this->mockName; - } - - public function classCode(): string - { - return $this->classCode; - } -} diff --git a/vendor/phpunit/phpunit/src/Framework/MockObject/MockMethod.php b/vendor/phpunit/phpunit/src/Framework/MockObject/MockMethod.php deleted file mode 100644 index d12690a5..00000000 --- a/vendor/phpunit/phpunit/src/Framework/MockObject/MockMethod.php +++ /dev/null @@ -1,308 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace PHPUnit\Framework\MockObject; - -use function explode; -use function implode; -use function is_object; -use function is_string; -use function preg_match; -use function preg_replace; -use function sprintf; -use function strlen; -use function strpos; -use function substr; -use function substr_count; -use function trim; -use function var_export; -use ReflectionMethod; -use ReflectionParameter; -use SebastianBergmann\Type\ReflectionMapper; -use SebastianBergmann\Type\Type; -use SebastianBergmann\Type\UnknownType; - -/** - * @internal This class is not covered by the backward compatibility promise for PHPUnit - */ -final class MockMethod -{ - use TemplateLoader; - private readonly string $className; - private readonly string $methodName; - private readonly bool $cloneArguments; - private readonly string $modifier; - private readonly string $argumentsForDeclaration; - private readonly string $argumentsForCall; - private readonly Type $returnType; - private readonly string $reference; - private readonly bool $callOriginalMethod; - private readonly bool $static; - private readonly ?string $deprecation; - - /** - * @throws ReflectionException - * @throws RuntimeException - */ - public static function fromReflection(ReflectionMethod $method, bool $callOriginalMethod, bool $cloneArguments): self - { - if ($method->isPrivate()) { - $modifier = 'private'; - } elseif ($method->isProtected()) { - $modifier = 'protected'; - } else { - $modifier = 'public'; - } - - if ($method->isStatic()) { - $modifier .= ' static'; - } - - if ($method->returnsReference()) { - $reference = '&'; - } else { - $reference = ''; - } - - $docComment = $method->getDocComment(); - - if (is_string($docComment) && - preg_match('#\*[ \t]*+@deprecated[ \t]*+(.*?)\r?+\n[ \t]*+\*(?:[ \t]*+@|/$)#s', $docComment, $deprecation)) { - $deprecation = trim(preg_replace('#[ \t]*\r?\n[ \t]*+\*[ \t]*+#', ' ', $deprecation[1])); - } else { - $deprecation = null; - } - - return new self( - $method->getDeclaringClass()->getName(), - $method->getName(), - $cloneArguments, - $modifier, - self::methodParametersForDeclaration($method), - self::methodParametersForCall($method), - (new ReflectionMapper)->fromReturnType($method), - $reference, - $callOriginalMethod, - $method->isStatic(), - $deprecation - ); - } - - public static function fromName(string $fullClassName, string $methodName, bool $cloneArguments): self - { - return new self( - $fullClassName, - $methodName, - $cloneArguments, - 'public', - '', - '', - new UnknownType, - '', - false, - false, - null - ); - } - - public function __construct(string $className, string $methodName, bool $cloneArguments, string $modifier, string $argumentsForDeclaration, string $argumentsForCall, Type $returnType, string $reference, bool $callOriginalMethod, bool $static, ?string $deprecation) - { - $this->className = $className; - $this->methodName = $methodName; - $this->cloneArguments = $cloneArguments; - $this->modifier = $modifier; - $this->argumentsForDeclaration = $argumentsForDeclaration; - $this->argumentsForCall = $argumentsForCall; - $this->returnType = $returnType; - $this->reference = $reference; - $this->callOriginalMethod = $callOriginalMethod; - $this->static = $static; - $this->deprecation = $deprecation; - } - - public function methodName(): string - { - return $this->methodName; - } - - /** - * @throws RuntimeException - */ - public function generateCode(): string - { - if ($this->static) { - $templateFile = 'mocked_static_method.tpl'; - } elseif ($this->returnType->isNever() || $this->returnType->isVoid()) { - $templateFile = sprintf( - '%s_method_never_or_void.tpl', - $this->callOriginalMethod ? 'proxied' : 'mocked' - ); - } else { - $templateFile = sprintf( - '%s_method.tpl', - $this->callOriginalMethod ? 'proxied' : 'mocked' - ); - } - - $deprecation = $this->deprecation; - - if (null !== $this->deprecation) { - $deprecation = "The {$this->className}::{$this->methodName} method is deprecated ({$this->deprecation})."; - $deprecationTemplate = $this->loadTemplate('deprecation.tpl'); - - $deprecationTemplate->setVar( - [ - 'deprecation' => var_export($deprecation, true), - ] - ); - - $deprecation = $deprecationTemplate->render(); - } - - $template = $this->loadTemplate($templateFile); - - $template->setVar( - [ - 'arguments_decl' => $this->argumentsForDeclaration, - 'arguments_call' => $this->argumentsForCall, - 'return_declaration' => !empty($this->returnType->asString()) ? (': ' . $this->returnType->asString()) : '', - 'return_type' => $this->returnType->asString(), - 'arguments_count' => !empty($this->argumentsForCall) ? substr_count($this->argumentsForCall, ',') + 1 : 0, - 'class_name' => $this->className, - 'method_name' => $this->methodName, - 'modifier' => $this->modifier, - 'reference' => $this->reference, - 'clone_arguments' => $this->cloneArguments ? 'true' : 'false', - 'deprecation' => $deprecation, - ] - ); - - return $template->render(); - } - - public function returnType(): Type - { - return $this->returnType; - } - - /** - * Returns the parameters of a function or method. - * - * @throws RuntimeException - */ - private static function methodParametersForDeclaration(ReflectionMethod $method): string - { - $parameters = []; - $types = (new ReflectionMapper)->fromParameterTypes($method); - - foreach ($method->getParameters() as $i => $parameter) { - $name = '$' . $parameter->getName(); - - /* Note: PHP extensions may use empty names for reference arguments - * or "..." for methods taking a variable number of arguments. - */ - if ($name === '$' || $name === '$...') { - $name = '$arg' . $i; - } - - $default = ''; - $reference = ''; - $typeDeclaration = ''; - - if (!$types[$i]->type()->isUnknown()) { - $typeDeclaration = $types[$i]->type()->asString() . ' '; - } - - if ($parameter->isPassedByReference()) { - $reference = '&'; - } - - if ($parameter->isVariadic()) { - $name = '...' . $name; - } elseif ($parameter->isDefaultValueAvailable()) { - $default = ' = ' . self::exportDefaultValue($parameter); - } elseif ($parameter->isOptional()) { - $default = ' = null'; - } - - $parameters[] = $typeDeclaration . $reference . $name . $default; - } - - return implode(', ', $parameters); - } - - /** - * Returns the parameters of a function or method. - * - * @throws ReflectionException - */ - private static function methodParametersForCall(ReflectionMethod $method): string - { - $parameters = []; - - foreach ($method->getParameters() as $i => $parameter) { - $name = '$' . $parameter->getName(); - - /* Note: PHP extensions may use empty names for reference arguments - * or "..." for methods taking a variable number of arguments. - */ - if ($name === '$' || $name === '$...') { - $name = '$arg' . $i; - } - - if ($parameter->isVariadic()) { - continue; - } - - if ($parameter->isPassedByReference()) { - $parameters[] = '&' . $name; - } else { - $parameters[] = $name; - } - } - - return implode(', ', $parameters); - } - - /** - * @throws ReflectionException - */ - private static function exportDefaultValue(ReflectionParameter $parameter): string - { - try { - $defaultValue = $parameter->getDefaultValue(); - - if (!is_object($defaultValue)) { - return var_export($defaultValue, true); - } - - $parameterAsString = $parameter->__toString(); - - return explode( - ' = ', - substr( - substr( - $parameterAsString, - strpos($parameterAsString, ' ') + strlen(' ') - ), - 0, - -2 - ) - )[1]; - // @codeCoverageIgnoreStart - } catch (\ReflectionException $e) { - throw new ReflectionException( - $e->getMessage(), - $e->getCode(), - $e - ); - } - // @codeCoverageIgnoreEnd - } -} diff --git a/vendor/phpunit/phpunit/src/Framework/MockObject/MockMethodSet.php b/vendor/phpunit/phpunit/src/Framework/MockObject/MockMethodSet.php deleted file mode 100644 index 7a1f533f..00000000 --- a/vendor/phpunit/phpunit/src/Framework/MockObject/MockMethodSet.php +++ /dev/null @@ -1,45 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace PHPUnit\Framework\MockObject; - -use function array_key_exists; -use function array_values; -use function strtolower; - -/** - * @internal This class is not covered by the backward compatibility promise for PHPUnit - */ -final class MockMethodSet -{ - /** - * @psalm-var array - */ - private array $methods = []; - - public function addMethods(MockMethod ...$methods): void - { - foreach ($methods as $method) { - $this->methods[strtolower($method->methodName())] = $method; - } - } - - /** - * @psalm-return list - */ - public function asArray(): array - { - return array_values($this->methods); - } - - public function hasMethod(string $methodName): bool - { - return array_key_exists(strtolower($methodName), $this->methods); - } -} diff --git a/vendor/phpunit/phpunit/src/Framework/MockObject/MockObject.php b/vendor/phpunit/phpunit/src/Framework/MockObject/MockObject.php deleted file mode 100644 index 5fc9687c..00000000 --- a/vendor/phpunit/phpunit/src/Framework/MockObject/MockObject.php +++ /dev/null @@ -1,27 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace PHPUnit\Framework\MockObject; - -use PHPUnit\Framework\MockObject\Builder\InvocationMocker as BuilderInvocationMocker; -use PHPUnit\Framework\MockObject\Rule\InvocationOrder; - -/** - * @method BuilderInvocationMocker method($constraint) - * - * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit - */ -interface MockObject extends Stub -{ - public function __phpunit_setOriginalObject(object $originalObject): void; - - public function __phpunit_verify(bool $unsetInvocationMocker = true): void; - - public function expects(InvocationOrder $invocationRule): BuilderInvocationMocker; -} diff --git a/vendor/phpunit/phpunit/src/Framework/MockObject/MockTrait.php b/vendor/phpunit/phpunit/src/Framework/MockObject/MockTrait.php deleted file mode 100644 index 030b4a47..00000000 --- a/vendor/phpunit/phpunit/src/Framework/MockObject/MockTrait.php +++ /dev/null @@ -1,51 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace PHPUnit\Framework\MockObject; - -use function class_exists; - -/** - * @internal This class is not covered by the backward compatibility promise for PHPUnit - */ -final class MockTrait implements MockType -{ - private readonly string $classCode; - - /** - * @psalm-var class-string - */ - private readonly string $mockName; - - /** - * @psalm-param class-string $mockName - */ - public function __construct(string $classCode, string $mockName) - { - $this->classCode = $classCode; - $this->mockName = $mockName; - } - - /** - * @psalm-return class-string - */ - public function generate(): string - { - if (!class_exists($this->mockName, false)) { - eval($this->classCode); - } - - return $this->mockName; - } - - public function classCode(): string - { - return $this->classCode; - } -} diff --git a/vendor/phpunit/phpunit/src/Framework/MockObject/MockType.php b/vendor/phpunit/phpunit/src/Framework/MockObject/MockType.php deleted file mode 100644 index 6a03fb51..00000000 --- a/vendor/phpunit/phpunit/src/Framework/MockObject/MockType.php +++ /dev/null @@ -1,21 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace PHPUnit\Framework\MockObject; - -/** - * @internal This class is not covered by the backward compatibility promise for PHPUnit - */ -interface MockType -{ - /** - * @psalm-return class-string - */ - public function generate(): string; -} diff --git a/vendor/phpunit/phpunit/src/Framework/MockObject/Rule/AnyInvokedCount.php b/vendor/phpunit/phpunit/src/Framework/MockObject/Rule/AnyInvokedCount.php deleted file mode 100644 index 1dd52081..00000000 --- a/vendor/phpunit/phpunit/src/Framework/MockObject/Rule/AnyInvokedCount.php +++ /dev/null @@ -1,32 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace PHPUnit\Framework\MockObject\Rule; - -use PHPUnit\Framework\MockObject\Invocation as BaseInvocation; - -/** - * @internal This class is not covered by the backward compatibility promise for PHPUnit - */ -final class AnyInvokedCount extends InvocationOrder -{ - public function toString(): string - { - return 'invoked zero or more times'; - } - - public function verify(): void - { - } - - public function matches(BaseInvocation $invocation): bool - { - return true; - } -} diff --git a/vendor/phpunit/phpunit/src/Framework/MockObject/Rule/AnyParameters.php b/vendor/phpunit/phpunit/src/Framework/MockObject/Rule/AnyParameters.php deleted file mode 100644 index 61de7887..00000000 --- a/vendor/phpunit/phpunit/src/Framework/MockObject/Rule/AnyParameters.php +++ /dev/null @@ -1,31 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace PHPUnit\Framework\MockObject\Rule; - -use PHPUnit\Framework\MockObject\Invocation as BaseInvocation; - -/** - * @internal This class is not covered by the backward compatibility promise for PHPUnit - */ -final class AnyParameters implements ParametersRule -{ - public function toString(): string - { - return 'with any parameters'; - } - - public function apply(BaseInvocation $invocation): void - { - } - - public function verify(): void - { - } -} diff --git a/vendor/phpunit/phpunit/src/Framework/MockObject/Rule/InvocationOrder.php b/vendor/phpunit/phpunit/src/Framework/MockObject/Rule/InvocationOrder.php deleted file mode 100644 index 62292288..00000000 --- a/vendor/phpunit/phpunit/src/Framework/MockObject/Rule/InvocationOrder.php +++ /dev/null @@ -1,49 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace PHPUnit\Framework\MockObject\Rule; - -use function count; -use PHPUnit\Framework\MockObject\Invocation as BaseInvocation; -use PHPUnit\Framework\MockObject\Verifiable; -use PHPUnit\Framework\SelfDescribing; - -/** - * @internal This class is not covered by the backward compatibility promise for PHPUnit - */ -abstract class InvocationOrder implements SelfDescribing, Verifiable -{ - /** - * @psalm-var list - */ - private array $invocations = []; - - public function numberOfInvocations(): int - { - return count($this->invocations); - } - - public function hasBeenInvoked(): bool - { - return count($this->invocations) > 0; - } - - final public function invoked(BaseInvocation $invocation): void - { - $this->invocations[] = $invocation; - - $this->invokedDo($invocation); - } - - abstract public function matches(BaseInvocation $invocation): bool; - - protected function invokedDo(BaseInvocation $invocation): void - { - } -} diff --git a/vendor/phpunit/phpunit/src/Framework/MockObject/Rule/InvokedAtLeastCount.php b/vendor/phpunit/phpunit/src/Framework/MockObject/Rule/InvokedAtLeastCount.php deleted file mode 100644 index 757b7f73..00000000 --- a/vendor/phpunit/phpunit/src/Framework/MockObject/Rule/InvokedAtLeastCount.php +++ /dev/null @@ -1,54 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace PHPUnit\Framework\MockObject\Rule; - -use PHPUnit\Framework\ExpectationFailedException; -use PHPUnit\Framework\MockObject\Invocation as BaseInvocation; - -/** - * @internal This class is not covered by the backward compatibility promise for PHPUnit - */ -final class InvokedAtLeastCount extends InvocationOrder -{ - private readonly int $requiredInvocations; - - public function __construct(int $requiredInvocations) - { - $this->requiredInvocations = $requiredInvocations; - } - - public function toString(): string - { - return 'invoked at least ' . $this->requiredInvocations . ' times'; - } - - /** - * Verifies that the current expectation is valid. If everything is OK the - * code should just return, if not it must throw an exception. - * - * @throws ExpectationFailedException - */ - public function verify(): void - { - $count = $this->numberOfInvocations(); - - if ($count < $this->requiredInvocations) { - throw new ExpectationFailedException( - 'Expected invocation at least ' . $this->requiredInvocations . - ' times but it occurred ' . $count . ' time(s).' - ); - } - } - - public function matches(BaseInvocation $invocation): bool - { - return true; - } -} diff --git a/vendor/phpunit/phpunit/src/Framework/MockObject/Rule/InvokedAtLeastOnce.php b/vendor/phpunit/phpunit/src/Framework/MockObject/Rule/InvokedAtLeastOnce.php deleted file mode 100644 index 19e1cff5..00000000 --- a/vendor/phpunit/phpunit/src/Framework/MockObject/Rule/InvokedAtLeastOnce.php +++ /dev/null @@ -1,46 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace PHPUnit\Framework\MockObject\Rule; - -use PHPUnit\Framework\ExpectationFailedException; -use PHPUnit\Framework\MockObject\Invocation as BaseInvocation; - -/** - * @internal This class is not covered by the backward compatibility promise for PHPUnit - */ -final class InvokedAtLeastOnce extends InvocationOrder -{ - public function toString(): string - { - return 'invoked at least once'; - } - - /** - * Verifies that the current expectation is valid. If everything is OK the - * code should just return, if not it must throw an exception. - * - * @throws ExpectationFailedException - */ - public function verify(): void - { - $count = $this->numberOfInvocations(); - - if ($count < 1) { - throw new ExpectationFailedException( - 'Expected invocation at least once but it never occurred.' - ); - } - } - - public function matches(BaseInvocation $invocation): bool - { - return true; - } -} diff --git a/vendor/phpunit/phpunit/src/Framework/MockObject/Rule/InvokedAtMostCount.php b/vendor/phpunit/phpunit/src/Framework/MockObject/Rule/InvokedAtMostCount.php deleted file mode 100644 index 6000c0b1..00000000 --- a/vendor/phpunit/phpunit/src/Framework/MockObject/Rule/InvokedAtMostCount.php +++ /dev/null @@ -1,54 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace PHPUnit\Framework\MockObject\Rule; - -use PHPUnit\Framework\ExpectationFailedException; -use PHPUnit\Framework\MockObject\Invocation as BaseInvocation; - -/** - * @internal This class is not covered by the backward compatibility promise for PHPUnit - */ -final class InvokedAtMostCount extends InvocationOrder -{ - private readonly int $allowedInvocations; - - public function __construct(int $allowedInvocations) - { - $this->allowedInvocations = $allowedInvocations; - } - - public function toString(): string - { - return 'invoked at most ' . $this->allowedInvocations . ' times'; - } - - /** - * Verifies that the current expectation is valid. If everything is OK the - * code should just return, if not it must throw an exception. - * - * @throws ExpectationFailedException - */ - public function verify(): void - { - $count = $this->numberOfInvocations(); - - if ($count > $this->allowedInvocations) { - throw new ExpectationFailedException( - 'Expected invocation at most ' . $this->allowedInvocations . - ' times but it occurred ' . $count . ' time(s).' - ); - } - } - - public function matches(BaseInvocation $invocation): bool - { - return true; - } -} diff --git a/vendor/phpunit/phpunit/src/Framework/MockObject/Rule/InvokedCount.php b/vendor/phpunit/phpunit/src/Framework/MockObject/Rule/InvokedCount.php deleted file mode 100644 index f80401a5..00000000 --- a/vendor/phpunit/phpunit/src/Framework/MockObject/Rule/InvokedCount.php +++ /dev/null @@ -1,87 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace PHPUnit\Framework\MockObject\Rule; - -use function sprintf; -use PHPUnit\Framework\ExpectationFailedException; -use PHPUnit\Framework\MockObject\Invocation as BaseInvocation; - -/** - * @internal This class is not covered by the backward compatibility promise for PHPUnit - */ -final class InvokedCount extends InvocationOrder -{ - private readonly int $expectedCount; - - public function __construct(int $expectedCount) - { - $this->expectedCount = $expectedCount; - } - - public function isNever(): bool - { - return $this->expectedCount === 0; - } - - public function toString(): string - { - return 'invoked ' . $this->expectedCount . ' time(s)'; - } - - public function matches(BaseInvocation $invocation): bool - { - return true; - } - - /** - * Verifies that the current expectation is valid. If everything is OK the - * code should just return, if not it must throw an exception. - * - * @throws ExpectationFailedException - */ - public function verify(): void - { - $count = $this->numberOfInvocations(); - - if ($count !== $this->expectedCount) { - throw new ExpectationFailedException( - sprintf( - 'Method was expected to be called %d times, ' . - 'actually called %d times.', - $this->expectedCount, - $count - ) - ); - } - } - - /** - * @throws ExpectationFailedException - */ - protected function invokedDo(BaseInvocation $invocation): void - { - $count = $this->numberOfInvocations(); - - if ($count > $this->expectedCount) { - $message = $invocation->toString() . ' '; - - $message .= match ($this->expectedCount) { - 0 => 'was not expected to be called.', - 1 => 'was not expected to be called more than once.', - default => sprintf( - 'was not expected to be called more than %d times.', - $this->expectedCount - ), - }; - - throw new ExpectationFailedException($message); - } - } -} diff --git a/vendor/phpunit/phpunit/src/Framework/MockObject/Rule/MethodName.php b/vendor/phpunit/phpunit/src/Framework/MockObject/Rule/MethodName.php deleted file mode 100644 index 3c410128..00000000 --- a/vendor/phpunit/phpunit/src/Framework/MockObject/Rule/MethodName.php +++ /dev/null @@ -1,57 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace PHPUnit\Framework\MockObject\Rule; - -use function is_string; -use PHPUnit\Framework\Constraint\Constraint; -use PHPUnit\Framework\InvalidArgumentException; -use PHPUnit\Framework\MockObject\Invocation as BaseInvocation; -use PHPUnit\Framework\MockObject\MethodNameConstraint; - -/** - * @internal This class is not covered by the backward compatibility promise for PHPUnit - */ -final class MethodName -{ - private readonly Constraint $constraint; - - /** - * @throws InvalidArgumentException - */ - public function __construct(Constraint|string $constraint) - { - if (is_string($constraint)) { - $constraint = new MethodNameConstraint($constraint); - } - - $this->constraint = $constraint; - } - - public function toString(): string - { - return 'method name ' . $this->constraint->toString(); - } - - /** - * @throws \PHPUnit\Framework\ExpectationFailedException - */ - public function matches(BaseInvocation $invocation): bool - { - return $this->matchesName($invocation->methodName()); - } - - /** - * @throws \PHPUnit\Framework\ExpectationFailedException - */ - public function matchesName(string $methodName): bool - { - return (bool) $this->constraint->evaluate($methodName, '', true); - } -} diff --git a/vendor/phpunit/phpunit/src/Framework/MockObject/Rule/Parameters.php b/vendor/phpunit/phpunit/src/Framework/MockObject/Rule/Parameters.php deleted file mode 100644 index 3761973c..00000000 --- a/vendor/phpunit/phpunit/src/Framework/MockObject/Rule/Parameters.php +++ /dev/null @@ -1,149 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace PHPUnit\Framework\MockObject\Rule; - -use function count; -use function sprintf; -use Exception; -use PHPUnit\Framework\Constraint\Constraint; -use PHPUnit\Framework\Constraint\IsAnything; -use PHPUnit\Framework\Constraint\IsEqual; -use PHPUnit\Framework\ExpectationFailedException; -use PHPUnit\Framework\MockObject\Invocation as BaseInvocation; - -/** - * @internal This class is not covered by the backward compatibility promise for PHPUnit - */ -final class Parameters implements ParametersRule -{ - /** - * @psalm-var list - */ - private array $parameters = []; - private ?BaseInvocation $invocation = null; - private null|bool|ExpectationFailedException $parameterVerificationResult; - - /** - * @throws \PHPUnit\Framework\Exception - */ - public function __construct(array $parameters) - { - foreach ($parameters as $parameter) { - if (!($parameter instanceof Constraint)) { - $parameter = new IsEqual( - $parameter - ); - } - - $this->parameters[] = $parameter; - } - } - - public function toString(): string - { - $text = 'with parameter'; - - foreach ($this->parameters as $index => $parameter) { - if ($index > 0) { - $text .= ' and'; - } - - $text .= ' ' . $index . ' ' . $parameter->toString(); - } - - return $text; - } - - /** - * @throws Exception - */ - public function apply(BaseInvocation $invocation): void - { - $this->invocation = $invocation; - $this->parameterVerificationResult = null; - - try { - $this->parameterVerificationResult = $this->doVerify(); - } catch (ExpectationFailedException $e) { - $this->parameterVerificationResult = $e; - - throw $this->parameterVerificationResult; - } - } - - /** - * Checks if the invocation $invocation matches the current rules. If it - * does the rule will get the invoked() method called which should check - * if an expectation is met. - * - * @throws ExpectationFailedException - */ - public function verify(): void - { - $this->doVerify(); - } - - /** - * @throws ExpectationFailedException - */ - private function doVerify(): bool - { - if (isset($this->parameterVerificationResult)) { - return $this->guardAgainstDuplicateEvaluationOfParameterConstraints(); - } - - if ($this->invocation === null) { - throw new ExpectationFailedException('Mocked method does not exist.'); - } - - if (count($this->invocation->parameters()) < count($this->parameters)) { - $message = 'Parameter count for invocation %s is too low.'; - - // The user called `->with($this->anything())`, but may have meant - // `->withAnyParameters()`. - // - // @see https://github.com/sebastianbergmann/phpunit-mock-objects/issues/199 - if (count($this->parameters) === 1 && - $this->parameters[0]::class === IsAnything::class) { - $message .= "\nTo allow 0 or more parameters with any value, omit ->with() or use ->withAnyParameters() instead."; - } - - throw new ExpectationFailedException( - sprintf($message, $this->invocation->toString()) - ); - } - - foreach ($this->parameters as $i => $parameter) { - $parameter->evaluate( - $this->invocation->parameters()[$i], - sprintf( - 'Parameter %s for invocation %s does not match expected ' . - 'value.', - $i, - $this->invocation->toString() - ) - ); - } - - return true; - } - - /** - * @throws ExpectationFailedException - */ - private function guardAgainstDuplicateEvaluationOfParameterConstraints(): bool - { - if ($this->parameterVerificationResult instanceof ExpectationFailedException) { - throw $this->parameterVerificationResult; - } - - return (bool) $this->parameterVerificationResult; - } -} diff --git a/vendor/phpunit/phpunit/src/Framework/MockObject/Rule/ParametersRule.php b/vendor/phpunit/phpunit/src/Framework/MockObject/Rule/ParametersRule.php deleted file mode 100644 index 70c47fe3..00000000 --- a/vendor/phpunit/phpunit/src/Framework/MockObject/Rule/ParametersRule.php +++ /dev/null @@ -1,28 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace PHPUnit\Framework\MockObject\Rule; - -use PHPUnit\Framework\ExpectationFailedException; -use PHPUnit\Framework\MockObject\Invocation as BaseInvocation; -use PHPUnit\Framework\MockObject\Verifiable; -use PHPUnit\Framework\SelfDescribing; - -/** - * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit - */ -interface ParametersRule extends SelfDescribing, Verifiable -{ - /** - * @throws ExpectationFailedException if the invocation violates the rule - */ - public function apply(BaseInvocation $invocation): void; - - public function verify(): void; -} diff --git a/vendor/phpunit/phpunit/src/Framework/MockObject/Stub.php b/vendor/phpunit/phpunit/src/Framework/MockObject/Stub.php deleted file mode 100644 index 2b032e2d..00000000 --- a/vendor/phpunit/phpunit/src/Framework/MockObject/Stub.php +++ /dev/null @@ -1,26 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace PHPUnit\Framework\MockObject; - -use PHPUnit\Framework\MockObject\Builder\InvocationStubber; - -/** - * @method InvocationStubber method($constraint) - * - * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit - */ -interface Stub -{ - public function __phpunit_getInvocationHandler(): InvocationHandler; - - public function __phpunit_hasMatchers(): bool; - - public function __phpunit_setReturnValueGeneration(bool $returnValueGeneration): void; -} diff --git a/vendor/phpunit/phpunit/src/Framework/MockObject/Stub/ConsecutiveCalls.php b/vendor/phpunit/phpunit/src/Framework/MockObject/Stub/ConsecutiveCalls.php deleted file mode 100644 index 164ebfa1..00000000 --- a/vendor/phpunit/phpunit/src/Framework/MockObject/Stub/ConsecutiveCalls.php +++ /dev/null @@ -1,50 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace PHPUnit\Framework\MockObject\Stub; - -use function array_shift; -use function sprintf; -use PHPUnit\Framework\MockObject\Invocation; -use SebastianBergmann\Exporter\Exporter; - -/** - * @internal This class is not covered by the backward compatibility promise for PHPUnit - */ -final class ConsecutiveCalls implements Stub -{ - private array $stack; - private mixed $value; - - public function __construct(array $stack) - { - $this->stack = $stack; - } - - public function invoke(Invocation $invocation): mixed - { - $this->value = array_shift($this->stack); - - if ($this->value instanceof Stub) { - $this->value = $this->value->invoke($invocation); - } - - return $this->value; - } - - public function toString(): string - { - $exporter = new Exporter; - - return sprintf( - 'return user-specified value %s', - $exporter->export($this->value) - ); - } -} diff --git a/vendor/phpunit/phpunit/src/Framework/MockObject/Stub/Exception.php b/vendor/phpunit/phpunit/src/Framework/MockObject/Stub/Exception.php deleted file mode 100644 index 228a4ae7..00000000 --- a/vendor/phpunit/phpunit/src/Framework/MockObject/Stub/Exception.php +++ /dev/null @@ -1,46 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace PHPUnit\Framework\MockObject\Stub; - -use function sprintf; -use PHPUnit\Framework\MockObject\Invocation; -use SebastianBergmann\Exporter\Exporter; -use Throwable; - -/** - * @internal This class is not covered by the backward compatibility promise for PHPUnit - */ -final class Exception implements Stub -{ - private readonly Throwable $exception; - - public function __construct(Throwable $exception) - { - $this->exception = $exception; - } - - /** - * @throws Throwable - */ - public function invoke(Invocation $invocation): never - { - throw $this->exception; - } - - public function toString(): string - { - $exporter = new Exporter; - - return sprintf( - 'raise user-specified exception %s', - $exporter->export($this->exception) - ); - } -} diff --git a/vendor/phpunit/phpunit/src/Framework/MockObject/Stub/ReturnArgument.php b/vendor/phpunit/phpunit/src/Framework/MockObject/Stub/ReturnArgument.php deleted file mode 100644 index d3cf7c3c..00000000 --- a/vendor/phpunit/phpunit/src/Framework/MockObject/Stub/ReturnArgument.php +++ /dev/null @@ -1,36 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace PHPUnit\Framework\MockObject\Stub; - -use function sprintf; -use PHPUnit\Framework\MockObject\Invocation; - -/** - * @internal This class is not covered by the backward compatibility promise for PHPUnit - */ -final class ReturnArgument implements Stub -{ - private readonly int $argumentIndex; - - public function __construct(int $argumentIndex) - { - $this->argumentIndex = $argumentIndex; - } - - public function invoke(Invocation $invocation): mixed - { - return $invocation->parameters()[$this->argumentIndex] ?? null; - } - - public function toString(): string - { - return sprintf('return argument #%d', $this->argumentIndex); - } -} diff --git a/vendor/phpunit/phpunit/src/Framework/MockObject/Stub/ReturnCallback.php b/vendor/phpunit/phpunit/src/Framework/MockObject/Stub/ReturnCallback.php deleted file mode 100644 index eb783c6a..00000000 --- a/vendor/phpunit/phpunit/src/Framework/MockObject/Stub/ReturnCallback.php +++ /dev/null @@ -1,61 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace PHPUnit\Framework\MockObject\Stub; - -use function call_user_func_array; -use function is_array; -use function is_object; -use function sprintf; -use PHPUnit\Framework\MockObject\Invocation; - -/** - * @internal This class is not covered by the backward compatibility promise for PHPUnit - */ -final class ReturnCallback implements Stub -{ - /** - * @var callable - */ - private $callback; - - public function __construct(callable $callback) - { - $this->callback = $callback; - } - - public function invoke(Invocation $invocation): mixed - { - return call_user_func_array($this->callback, $invocation->parameters()); - } - - public function toString(): string - { - if (is_array($this->callback)) { - if (is_object($this->callback[0])) { - $class = $this->callback[0]::class; - $type = '->'; - } else { - $class = $this->callback[0]; - $type = '::'; - } - - return sprintf( - 'return result of user defined callback %s%s%s() with the ' . - 'passed arguments', - $class, - $type, - $this->callback[1] - ); - } - - return 'return result of user defined callback ' . $this->callback . - ' with the passed arguments'; - } -} diff --git a/vendor/phpunit/phpunit/src/Framework/MockObject/Stub/ReturnReference.php b/vendor/phpunit/phpunit/src/Framework/MockObject/Stub/ReturnReference.php deleted file mode 100644 index 45bab37e..00000000 --- a/vendor/phpunit/phpunit/src/Framework/MockObject/Stub/ReturnReference.php +++ /dev/null @@ -1,42 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace PHPUnit\Framework\MockObject\Stub; - -use function sprintf; -use PHPUnit\Framework\MockObject\Invocation; -use SebastianBergmann\Exporter\Exporter; - -/** - * @internal This class is not covered by the backward compatibility promise for PHPUnit - */ -final class ReturnReference implements Stub -{ - private mixed $reference; - - public function __construct(mixed &$reference) - { - $this->reference = &$reference; - } - - public function invoke(Invocation $invocation): mixed - { - return $this->reference; - } - - public function toString(): string - { - $exporter = new Exporter; - - return sprintf( - 'return user-specified reference %s', - $exporter->export($this->reference) - ); - } -} diff --git a/vendor/phpunit/phpunit/src/Framework/MockObject/Stub/ReturnSelf.php b/vendor/phpunit/phpunit/src/Framework/MockObject/Stub/ReturnSelf.php deleted file mode 100644 index db5ed288..00000000 --- a/vendor/phpunit/phpunit/src/Framework/MockObject/Stub/ReturnSelf.php +++ /dev/null @@ -1,32 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace PHPUnit\Framework\MockObject\Stub; - -use PHPUnit\Framework\MockObject\Invocation; -use PHPUnit\Framework\MockObject\RuntimeException; - -/** - * @internal This class is not covered by the backward compatibility promise for PHPUnit - */ -final class ReturnSelf implements Stub -{ - /** - * @throws RuntimeException - */ - public function invoke(Invocation $invocation): object - { - return $invocation->object(); - } - - public function toString(): string - { - return 'return the current object'; - } -} diff --git a/vendor/phpunit/phpunit/src/Framework/MockObject/Stub/ReturnStub.php b/vendor/phpunit/phpunit/src/Framework/MockObject/Stub/ReturnStub.php deleted file mode 100644 index 01875436..00000000 --- a/vendor/phpunit/phpunit/src/Framework/MockObject/Stub/ReturnStub.php +++ /dev/null @@ -1,42 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace PHPUnit\Framework\MockObject\Stub; - -use function sprintf; -use PHPUnit\Framework\MockObject\Invocation; -use SebastianBergmann\Exporter\Exporter; - -/** - * @internal This class is not covered by the backward compatibility promise for PHPUnit - */ -final class ReturnStub implements Stub -{ - private readonly mixed $value; - - public function __construct(mixed $value) - { - $this->value = $value; - } - - public function invoke(Invocation $invocation): mixed - { - return $this->value; - } - - public function toString(): string - { - $exporter = new Exporter; - - return sprintf( - 'return user-specified value %s', - $exporter->export($this->value) - ); - } -} diff --git a/vendor/phpunit/phpunit/src/Framework/MockObject/Stub/ReturnValueMap.php b/vendor/phpunit/phpunit/src/Framework/MockObject/Stub/ReturnValueMap.php deleted file mode 100644 index b8fb66df..00000000 --- a/vendor/phpunit/phpunit/src/Framework/MockObject/Stub/ReturnValueMap.php +++ /dev/null @@ -1,52 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace PHPUnit\Framework\MockObject\Stub; - -use function array_pop; -use function count; -use function is_array; -use PHPUnit\Framework\MockObject\Invocation; - -/** - * @internal This class is not covered by the backward compatibility promise for PHPUnit - */ -final class ReturnValueMap implements Stub -{ - private readonly array $valueMap; - - public function __construct(array $valueMap) - { - $this->valueMap = $valueMap; - } - - public function invoke(Invocation $invocation): mixed - { - $parameterCount = count($invocation->parameters()); - - foreach ($this->valueMap as $map) { - if (!is_array($map) || $parameterCount !== (count($map) - 1)) { - continue; - } - - $return = array_pop($map); - - if ($invocation->parameters() === $map) { - return $return; - } - } - - return null; - } - - public function toString(): string - { - return 'return value from a map'; - } -} diff --git a/vendor/phpunit/phpunit/src/Framework/MockObject/Stub/Stub.php b/vendor/phpunit/phpunit/src/Framework/MockObject/Stub/Stub.php deleted file mode 100644 index 96958407..00000000 --- a/vendor/phpunit/phpunit/src/Framework/MockObject/Stub/Stub.php +++ /dev/null @@ -1,25 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace PHPUnit\Framework\MockObject\Stub; - -use PHPUnit\Framework\MockObject\Invocation; -use PHPUnit\Framework\SelfDescribing; - -/** - * @internal This class is not covered by the backward compatibility promise for PHPUnit - */ -interface Stub extends SelfDescribing -{ - /** - * Fakes the processing of the invocation $invocation by returning a - * specific value. - */ - public function invoke(Invocation $invocation): mixed; -} diff --git a/vendor/phpunit/phpunit/src/Framework/MockObject/TemplateLoader.php b/vendor/phpunit/phpunit/src/Framework/MockObject/TemplateLoader.php deleted file mode 100644 index c13dd870..00000000 --- a/vendor/phpunit/phpunit/src/Framework/MockObject/TemplateLoader.php +++ /dev/null @@ -1,37 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace PHPUnit\Framework\MockObject; - -use SebastianBergmann\Template\Template; - -/** - * @internal This trait is not covered by the backward compatibility promise for PHPUnit - */ -trait TemplateLoader -{ - /** - * @psalm-var array - */ - private static array $templates = []; - - /** - * @psalm-suppress MissingThrowsDocblock - */ - private function loadTemplate(string $template): Template - { - $filename = __DIR__ . '/Generator/' . $template; - - if (!isset(self::$templates[$filename])) { - self::$templates[$filename] = new Template($filename); - } - - return self::$templates[$filename]; - } -} diff --git a/vendor/phpunit/phpunit/src/Framework/MockObject/Verifiable.php b/vendor/phpunit/phpunit/src/Framework/MockObject/Verifiable.php deleted file mode 100644 index 8c9a82c5..00000000 --- a/vendor/phpunit/phpunit/src/Framework/MockObject/Verifiable.php +++ /dev/null @@ -1,26 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace PHPUnit\Framework\MockObject; - -use PHPUnit\Framework\ExpectationFailedException; - -/** - * @internal This class is not covered by the backward compatibility promise for PHPUnit - */ -interface Verifiable -{ - /** - * Verifies that the current expectation is valid. If everything is OK the - * code should just return, if not it must throw an exception. - * - * @throws ExpectationFailedException - */ - public function verify(): void; -} diff --git a/vendor/phpunit/phpunit/src/Framework/Reorderable.php b/vendor/phpunit/phpunit/src/Framework/Reorderable.php index a75e8b94..ed070d30 100644 --- a/vendor/phpunit/phpunit/src/Framework/Reorderable.php +++ b/vendor/phpunit/phpunit/src/Framework/Reorderable.php @@ -10,7 +10,9 @@ namespace PHPUnit\Framework; /** - * @internal This class is not covered by the backward compatibility promise for PHPUnit + * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit + * + * @internal This interface is not covered by the backward compatibility promise for PHPUnit */ interface Reorderable { diff --git a/vendor/phpunit/phpunit/src/Framework/SelfDescribing.php b/vendor/phpunit/phpunit/src/Framework/SelfDescribing.php index 73034f65..bdf91a4d 100644 --- a/vendor/phpunit/phpunit/src/Framework/SelfDescribing.php +++ b/vendor/phpunit/phpunit/src/Framework/SelfDescribing.php @@ -10,7 +10,9 @@ namespace PHPUnit\Framework; /** - * @internal This class is not covered by the backward compatibility promise for PHPUnit + * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit + * + * @internal This interface is not covered by the backward compatibility promise for PHPUnit */ interface SelfDescribing { diff --git a/vendor/phpunit/phpunit/src/Framework/TestBuilder.php b/vendor/phpunit/phpunit/src/Framework/TestBuilder.php index e8bd7594..9bf77b31 100644 --- a/vendor/phpunit/phpunit/src/Framework/TestBuilder.php +++ b/vendor/phpunit/phpunit/src/Framework/TestBuilder.php @@ -12,6 +12,7 @@ namespace PHPUnit\Framework; use function assert; use PHPUnit\Metadata\Api\DataProvider; use PHPUnit\Metadata\Api\Groups; +use PHPUnit\Metadata\Api\Requirements; use PHPUnit\Metadata\BackupGlobals; use PHPUnit\Metadata\BackupStaticProperties; use PHPUnit\Metadata\ExcludeGlobalVariableFromBackup; @@ -22,6 +23,8 @@ use PHPUnit\TextUI\Configuration\Registry as ConfigurationRegistry; use ReflectionClass; /** + * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit + * * @internal This class is not covered by the backward compatibility promise for PHPUnit */ final class TestBuilder @@ -35,34 +38,35 @@ final class TestBuilder { $className = $theClass->getName(); - $data = (new DataProvider)->providedData( - $className, - $methodName - ); + $data = null; + + if ($this->requirementsSatisfied($className, $methodName)) { + $data = (new DataProvider)->providedData($className, $methodName); + } if ($data !== null) { - $test = $this->buildDataProviderTestSuite( + return $this->buildDataProviderTestSuite( $methodName, $className, $data, $this->shouldTestMethodBeRunInSeparateProcess($className, $methodName), $this->shouldGlobalStateBePreserved($className, $methodName), $this->shouldAllTestMethodsOfTestClassBeRunInSingleSeparateProcess($className), - $this->backupSettings($className, $methodName) + $this->backupSettings($className, $methodName), ); - } else { - $test = new $className($methodName); } - if ($test instanceof TestCase) { - $this->configureTestCase( - $test, - $this->shouldTestMethodBeRunInSeparateProcess($className, $methodName), - $this->shouldGlobalStateBePreserved($className, $methodName), - $this->shouldAllTestMethodsOfTestClassBeRunInSingleSeparateProcess($className), - $this->backupSettings($className, $methodName) - ); - } + $test = new $className($methodName); + + assert($test instanceof TestCase); + + $this->configureTestCase( + $test, + $this->shouldTestMethodBeRunInSeparateProcess($className, $methodName), + $this->shouldGlobalStateBePreserved($className, $methodName), + $this->shouldAllTestMethodsOfTestClassBeRunInSingleSeparateProcess($className), + $this->backupSettings($className, $methodName), + ); return $test; } @@ -75,7 +79,7 @@ final class TestBuilder private function buildDataProviderTestSuite(string $methodName, string $className, array $data, bool $runTestInSeparateProcess, ?bool $preserveGlobalState, bool $runClassInSeparateProcess, array $backupSettings): DataProviderTestSuite { $dataProviderTestSuite = DataProviderTestSuite::empty( - $className . '::' . $methodName + $className . '::' . $methodName, ); $groups = (new Groups)->groups($className, $methodName); @@ -92,7 +96,7 @@ final class TestBuilder $runTestInSeparateProcess, $preserveGlobalState, $runClassInSeparateProcess, - $backupSettings + $backupSettings, ); $dataProviderTestSuite->addTest($_test, $groups); @@ -266,4 +270,13 @@ final class TestBuilder { return MetadataRegistry::parser()->forClass($className)->isRunClassInSeparateProcess()->isNotEmpty(); } + + /** + * @psalm-param class-string $className + * @psalm-param non-empty-string $methodName + */ + private function requirementsSatisfied(string $className, string $methodName): bool + { + return (new Requirements)->requirementsNotSatisfiedFor($className, $methodName) === []; + } } diff --git a/vendor/phpunit/phpunit/src/Framework/TestCase.php b/vendor/phpunit/phpunit/src/Framework/TestCase.php index 7adf0277..9cd9854b 100644 --- a/vendor/phpunit/phpunit/src/Framework/TestCase.php +++ b/vendor/phpunit/phpunit/src/Framework/TestCase.php @@ -18,8 +18,12 @@ use const LC_TIME; use const PATHINFO_FILENAME; use const PHP_EOL; use const PHP_URL_PATH; +use function array_is_list; +use function array_keys; +use function array_map; use function array_merge; use function array_values; +use function assert; use function basename; use function chdir; use function class_exists; @@ -54,19 +58,22 @@ use AssertionError; use DeepCopy\DeepCopy; use PHPUnit\Event; use PHPUnit\Event\NoPreviousThrowableException; +use PHPUnit\Event\RuntimeException; use PHPUnit\Event\TestData\MoreThanOneDataSetFromDataProviderException; -use PHPUnit\Event\TestData\NoDataSetFromDataProviderException; use PHPUnit\Framework\Constraint\Exception as ExceptionConstraint; use PHPUnit\Framework\Constraint\ExceptionCode; use PHPUnit\Framework\Constraint\ExceptionMessageIsOrContains; use PHPUnit\Framework\Constraint\ExceptionMessageMatchesRegularExpression; -use PHPUnit\Framework\MockObject\Generator as MockGenerator; +use PHPUnit\Framework\MockObject\Exception as MockObjectException; +use PHPUnit\Framework\MockObject\Generator\Generator as MockGenerator; use PHPUnit\Framework\MockObject\MockBuilder; use PHPUnit\Framework\MockObject\MockObject; +use PHPUnit\Framework\MockObject\MockObjectInternal; use PHPUnit\Framework\MockObject\Rule\AnyInvokedCount as AnyInvokedCountMatcher; use PHPUnit\Framework\MockObject\Rule\InvokedAtLeastCount as InvokedAtLeastCountMatcher; use PHPUnit\Framework\MockObject\Rule\InvokedAtLeastOnce as InvokedAtLeastOnceMatcher; use PHPUnit\Framework\MockObject\Rule\InvokedAtMostCount as InvokedAtMostCountMatcher; +use PHPUnit\Framework\MockObject\Rule\InvokedCount; use PHPUnit\Framework\MockObject\Rule\InvokedCount as InvokedCountMatcher; use PHPUnit\Framework\MockObject\Stub; use PHPUnit\Framework\MockObject\Stub\ConsecutiveCalls as ConsecutiveCallsStub; @@ -88,8 +95,9 @@ use PHPUnit\Util\Cloner; use PHPUnit\Util\Test as TestUtil; use ReflectionClass; use ReflectionException; +use ReflectionMethod; use ReflectionObject; -use SebastianBergmann\CodeCoverage\StaticAnalysisCacheNotConfiguredException; +use ReflectionParameter; use SebastianBergmann\CodeCoverage\UnintentionallyCoveredCodeException; use SebastianBergmann\Comparator\Comparator; use SebastianBergmann\Comparator\Factory as ComparatorFactory; @@ -158,12 +166,11 @@ abstract class TestCase extends Assert implements Reorderable, SelfDescribing, T /** * @psalm-var array */ - private array $iniSettings = []; - private array $locale = []; - private ?MockGenerator $mockObjectGenerator = null; + private array $iniSettings = []; + private array $locale = []; /** - * @psalm-var list + * @psalm-var list */ private array $mockObjects = []; private bool $registerMockObjectsFromTestArgumentsRecursively = false; @@ -185,6 +192,11 @@ abstract class TestCase extends Assert implements Reorderable, SelfDescribing, T private ?Event\Code\TestMethod $testValueObjectForEvents = null; private bool $wasPrepared = false; + /** + * @psalm-var array + */ + private array $failureTypes = []; + /** * Returns a matcher that matches when the method is executed * zero or more times. @@ -209,7 +221,7 @@ abstract class TestCase extends Assert implements Reorderable, SelfDescribing, T final public static function atLeast(int $requiredInvocations): InvokedAtLeastCountMatcher { return new InvokedAtLeastCountMatcher( - $requiredInvocations + $requiredInvocations, ); } @@ -247,30 +259,55 @@ abstract class TestCase extends Assert implements Reorderable, SelfDescribing, T return new InvokedAtMostCountMatcher($allowedInvocations); } + /** + * @deprecated Use $double->willReturn() instead of $double->will($this->returnValue()) + * @see https://github.com/sebastianbergmann/phpunit/issues/5423 + * + * @codeCoverageIgnore + */ final public static function returnValue(mixed $value): ReturnStub { return new ReturnStub($value); } + /** + * @deprecated Use $double->willReturnMap() instead of $double->will($this->returnValueMap()) + * @see https://github.com/sebastianbergmann/phpunit/issues/5423 + * + * @codeCoverageIgnore + */ final public static function returnValueMap(array $valueMap): ReturnValueMapStub { return new ReturnValueMapStub($valueMap); } + /** + * @deprecated Use $double->willReturnArgument() instead of $double->will($this->returnArgument()) + * @see https://github.com/sebastianbergmann/phpunit/issues/5423 + * + * @codeCoverageIgnore + */ final public static function returnArgument(int $argumentIndex): ReturnArgumentStub { return new ReturnArgumentStub($argumentIndex); } + /** + * @deprecated Use $double->willReturnCallback() instead of $double->will($this->returnCallback()) + * @see https://github.com/sebastianbergmann/phpunit/issues/5423 + * + * @codeCoverageIgnore + */ final public static function returnCallback(callable $callback): ReturnCallbackStub { return new ReturnCallbackStub($callback); } /** - * Returns the current object. + * @deprecated Use $double->willReturnSelf() instead of $double->will($this->returnSelf()) + * @see https://github.com/sebastianbergmann/phpunit/issues/5423 * - * This method is useful when mocking a fluent interface. + * @codeCoverageIgnore */ final public static function returnSelf(): ReturnSelfStub { @@ -282,6 +319,13 @@ abstract class TestCase extends Assert implements Reorderable, SelfDescribing, T return new ExceptionStub($exception); } + /** + * @deprecated Use $double->willReturn() instead of $double->will($this->onConsecutiveCalls()) + * @see https://github.com/sebastianbergmann/phpunit/issues/5423 + * @see https://github.com/sebastianbergmann/phpunit/issues/5425 + * + * @codeCoverageIgnore + */ final public static function onConsecutiveCalls(mixed ...$arguments): ConsecutiveCallsStub { return new ConsecutiveCallsStub($arguments); @@ -301,6 +345,8 @@ abstract class TestCase extends Assert implements Reorderable, SelfDescribing, T /** * This method is called before the first test of this test class is run. + * + * @codeCoverageIgnore */ public static function setUpBeforeClass(): void { @@ -308,6 +354,8 @@ abstract class TestCase extends Assert implements Reorderable, SelfDescribing, T /** * This method is called after the last test of this test class is run. + * + * @codeCoverageIgnore */ public static function tearDownAfterClass(): void { @@ -315,6 +363,8 @@ abstract class TestCase extends Assert implements Reorderable, SelfDescribing, T /** * This method is called before each test. + * + * @codeCoverageIgnore */ protected function setUp(): void { @@ -324,6 +374,8 @@ abstract class TestCase extends Assert implements Reorderable, SelfDescribing, T * Performs assertions shared by all tests of a test case. * * This method is called between setUp() and test. + * + * @codeCoverageIgnore */ protected function assertPreConditions(): void { @@ -333,6 +385,8 @@ abstract class TestCase extends Assert implements Reorderable, SelfDescribing, T * Performs assertions shared by all tests of a test case. * * This method is called between test and tearDown(). + * + * @codeCoverageIgnore */ protected function assertPostConditions(): void { @@ -340,6 +394,8 @@ abstract class TestCase extends Assert implements Reorderable, SelfDescribing, T /** * This method is called after each test. + * + * @codeCoverageIgnore */ protected function tearDown(): void { @@ -357,7 +413,7 @@ abstract class TestCase extends Assert implements Reorderable, SelfDescribing, T $buffer = sprintf( '%s::%s', (new ReflectionClass($this))->getName(), - $this->name + $this->name, ); return $buffer . $this->dataSetAsStringWithData(); @@ -444,10 +500,8 @@ abstract class TestCase extends Assert implements Reorderable, SelfDescribing, T * @throws CodeCoverageException * @throws Exception * @throws MoreThanOneDataSetFromDataProviderException - * @throws NoDataSetFromDataProviderException * @throws NoPreviousThrowableException * @throws ProcessIsolationException - * @throws StaticAnalysisCacheNotConfiguredException * @throws UnintentionallyCoveredCodeException * * @internal This method is not covered by the backward compatibility promise for PHPUnit @@ -458,13 +512,13 @@ abstract class TestCase extends Assert implements Reorderable, SelfDescribing, T return; } - if (!$this->shouldRunInSeparateProcess()) { + if (!$this->shouldRunInSeparateProcess() || $this->requirementsNotSatisfied()) { (new TestRunner)->run($this); } else { (new TestRunner)->runInSeparateProcess( $this, $this->runClassInSeparateProcess && !$this->runTestInSeparateProcess, - $this->preserveGlobalState + $this->preserveGlobalState, ); } } @@ -483,15 +537,6 @@ abstract class TestCase extends Assert implements Reorderable, SelfDescribing, T return new MockBuilder($this, $className); } - final public function registerComparator(Comparator $comparator): void - { - ComparatorFactory::getInstance()->register($comparator); - - Event\Facade::emitter()->testRegisteredComparator($comparator::class); - - $this->customComparators[] = $comparator; - } - /** * @internal This method is not covered by the backward compatibility promise for PHPUnit */ @@ -533,7 +578,7 @@ abstract class TestCase extends Assert implements Reorderable, SelfDescribing, T { return (new Groups)->size( static::class, - $this->name + $this->name, ); } @@ -546,7 +591,7 @@ abstract class TestCase extends Assert implements Reorderable, SelfDescribing, T return false; } - if ($this->hasExpectationOnOutput()) { + if ($this->expectsOutput()) { return false; } @@ -576,13 +621,17 @@ abstract class TestCase extends Assert implements Reorderable, SelfDescribing, T /** * @internal This method is not covered by the backward compatibility promise for PHPUnit */ - final public function hasExpectationOnOutput(): bool + final public function expectsOutput(): bool { - return is_string($this->outputExpectedString) || is_string($this->outputExpectedRegex) || $this->outputRetrievedForAssertion; + return $this->hasExpectationOnOutput() || $this->outputRetrievedForAssertion; } /** * @internal This method is not covered by the backward compatibility promise for PHPUnit + * + * @deprecated + * + * @codeCoverageIgnore */ final public function registerMockObjectsFromTestArgumentsRecursively(): void { @@ -599,7 +648,7 @@ abstract class TestCase extends Assert implements Reorderable, SelfDescribing, T $emitter = Event\Facade::emitter(); $emitter->testPreparationStarted( - $this->valueObjectForEvents() + $this->valueObjectForEvents(), ); $this->snapshotGlobalState(); @@ -616,11 +665,13 @@ abstract class TestCase extends Assert implements Reorderable, SelfDescribing, T $hasMetRequirements = true; if ($this->inIsolation) { + // @codeCoverageIgnoreStart $this->invokeBeforeClassHookMethods($hookMethods, $emitter); + // @codeCoverageIgnoreEnd } if (method_exists(static::class, $this->name) && - MetadataRegistry::parser()->forMethod(static::class, $this->name)->isDoesNotPerformAssertions()->isNotEmpty()) { + MetadataRegistry::parser()->forClassAndMethod(static::class, $this->name)->isDoesNotPerformAssertions()->isNotEmpty()) { $this->doesNotPerformAssertions = true; } @@ -628,7 +679,7 @@ abstract class TestCase extends Assert implements Reorderable, SelfDescribing, T $this->invokePreConditionHookMethods($hookMethods, $emitter); $emitter->testPrepared( - $this->valueObjectForEvents() + $this->valueObjectForEvents(), ); $this->wasPrepared = true; @@ -643,53 +694,86 @@ abstract class TestCase extends Assert implements Reorderable, SelfDescribing, T $emitter->testMarkedAsIncomplete( $this->valueObjectForEvents(), - Event\Code\ThrowableBuilder::from($e) + Event\Code\ThrowableBuilder::from($e), ); } catch (SkippedTest $e) { $this->status = TestStatus::skipped($e->getMessage()); $emitter->testSkipped( $this->valueObjectForEvents(), - $e->getMessage() + $e->getMessage(), ); } catch (AssertionError|AssertionFailedError $e) { + $this->handleExceptionFromInvokedCountMockObjectRule($e); + + if (!$this->wasPrepared) { + $this->wasPrepared = true; + + $emitter->testPreparationFailed( + $this->valueObjectForEvents(), + ); + } + $this->status = TestStatus::failure($e->getMessage()); $emitter->testFailed( $this->valueObjectForEvents(), Event\Code\ThrowableBuilder::from($e), - Event\Code\ComparisonFailureBuilder::from($e) + Event\Code\ComparisonFailureBuilder::from($e), ); } catch (TimeoutException $e) { - $this->status = TestStatus::risky($e->getMessage()); } catch (Throwable $_e) { - $e = $_e; - $this->status = TestStatus::error($_e->getMessage()); + if ($this->isRegisteredFailure($_e)) { + $this->status = TestStatus::failure($_e->getMessage()); - $emitter->testErrored( - $this->valueObjectForEvents(), - Event\Code\ThrowableBuilder::from($_e) - ); + $emitter->testFailed( + $this->valueObjectForEvents(), + Event\Code\ThrowableBuilder::from($_e), + null, + ); + } else { + $e = $this->transformException($_e); + + $this->status = TestStatus::error($e->getMessage()); + + $emitter->testErrored( + $this->valueObjectForEvents(), + Event\Code\ThrowableBuilder::from($e), + ); + } } - if ($this->stopOutputBuffering() && !isset($e)) { + $outputBufferingStopped = false; + + if (!isset($e) && + $this->hasExpectationOnOutput() && + $this->stopOutputBuffering()) { + $outputBufferingStopped = true; + $this->performAssertionsOnOutput(); } if ($this->status->isSuccess()) { - Event\Facade::emitter()->testPassed( + $emitter->testPassed( $this->valueObjectForEvents(), ); if (!$this->usesDataProvider()) { PassedTests::instance()->testMethodPassed( $this->valueObjectForEvents(), - $this->testResult + $this->testResult, ); } } - $this->mockObjects = []; + try { + $this->mockObjects = []; + } catch (Throwable $t) { + Event\Facade::emitter()->testErrored( + $this->valueObjectForEvents(), + Event\Code\ThrowableBuilder::from($t), + ); + } // Tear down the fixture. An exception raised in tearDown() will be // caught and passed on when no exception was raised before. @@ -698,9 +782,19 @@ abstract class TestCase extends Assert implements Reorderable, SelfDescribing, T $this->invokeAfterTestHookMethods($hookMethods, $emitter); if ($this->inIsolation) { + // @codeCoverageIgnoreStart $this->invokeAfterClassHookMethods($hookMethods, $emitter); + // @codeCoverageIgnoreEnd } } + } catch (AssertionError|AssertionFailedError $e) { + $this->status = TestStatus::failure($e->getMessage()); + + $emitter->testFailed( + $this->valueObjectForEvents(), + Event\Code\ThrowableBuilder::from($e), + Event\Code\ComparisonFailureBuilder::from($e), + ); } catch (Throwable $exceptionRaisedDuringTearDown) { if (!isset($e)) { $this->status = TestStatus::error($exceptionRaisedDuringTearDown->getMessage()); @@ -708,11 +802,15 @@ abstract class TestCase extends Assert implements Reorderable, SelfDescribing, T $emitter->testErrored( $this->valueObjectForEvents(), - Event\Code\ThrowableBuilder::from($exceptionRaisedDuringTearDown) + Event\Code\ThrowableBuilder::from($exceptionRaisedDuringTearDown), ); } } + if (!$outputBufferingStopped) { + $this->stopOutputBuffering(); + } + clearstatcache(); if ($currentWorkingDirectory !== getcwd()) { @@ -758,6 +856,8 @@ abstract class TestCase extends Assert implements Reorderable, SelfDescribing, T /** * @internal This method is not covered by the backward compatibility promise for PHPUnit + * + * @codeCoverageIgnore */ final public function setDependencyInput(array $dependencyInput): void { @@ -840,6 +940,8 @@ abstract class TestCase extends Assert implements Reorderable, SelfDescribing, T /** * @internal This method is not covered by the backward compatibility promise for PHPUnit + * + * @codeCoverageIgnore */ final public function setInIsolation(bool $inIsolation): void { @@ -848,14 +950,8 @@ abstract class TestCase extends Assert implements Reorderable, SelfDescribing, T /** * @internal This method is not covered by the backward compatibility promise for PHPUnit - */ - final public function isInIsolation(): bool - { - return $this->inIsolation; - } - - /** - * @internal This method is not covered by the backward compatibility promise for PHPUnit + * + * @codeCoverageIgnore */ final public function result(): mixed { @@ -875,6 +971,8 @@ abstract class TestCase extends Assert implements Reorderable, SelfDescribing, T */ final public function registerMockObject(MockObject $mockObject): void { + assert($mockObject instanceof MockObjectInternal); + $this->mockObjects[] = $mockObject; } @@ -939,7 +1037,7 @@ abstract class TestCase extends Assert implements Reorderable, SelfDescribing, T return $this->dataSetAsString() . sprintf( ' (%s)', - (new Exporter)->shortenedRecursiveExport($this->data) + (new Exporter)->shortenedRecursiveExport($this->data), ); } @@ -990,12 +1088,45 @@ abstract class TestCase extends Assert implements Reorderable, SelfDescribing, T } /** + * @throws RuntimeException + * * @internal This method is not covered by the backward compatibility promise for PHPUnit */ final public function setData(int|string $dataName, array $data): void { $this->dataName = $dataName; $this->data = $data; + + if (array_is_list($data)) { + return; + } + + try { + $reflector = new ReflectionMethod($this, $this->name); + $parameters = array_map(static fn (ReflectionParameter $parameter) => $parameter->name, $reflector->getParameters()); + + foreach (array_keys($data) as $parameter) { + if (is_string($parameter) && !in_array($parameter, $parameters, true)) { + Event\Facade::emitter()->testTriggeredPhpunitDeprecation( + $this->valueObjectForEvents(), + sprintf( + 'Providing invalid named argument $%s for method %s::%s() is deprecated and will not be supported in PHPUnit 11.0.', + $parameter, + $this::class, + $this->name, + ), + ); + } + } + // @codeCoverageIgnoreStart + } catch (ReflectionException $e) { + throw new RuntimeException( + $e->getMessage(), + $e->getCode(), + $e, + ); + } + // @codeCoverageIgnoreEnd } /** @@ -1022,15 +1153,392 @@ abstract class TestCase extends Assert implements Reorderable, SelfDescribing, T return $this->wasPrepared; } + final protected function registerComparator(Comparator $comparator): void + { + ComparatorFactory::getInstance()->register($comparator); + + Event\Facade::emitter()->testRegisteredComparator($comparator::class); + + $this->customComparators[] = $comparator; + } + + /** + * @psalm-param class-string $classOrInterface + */ + final protected function registerFailureType(string $classOrInterface): void + { + $this->failureTypes[$classOrInterface] = true; + } + + /** + * This method is a wrapper for the ini_set() function that automatically + * resets the modified php.ini setting to its original value after the + * test is run. + * + * @throws Exception + * + * @deprecated https://github.com/sebastianbergmann/phpunit/issues/5214 + * + * @codeCoverageIgnore + */ + protected function iniSet(string $varName, string $newValue): void + { + $currentValue = ini_set($varName, $newValue); + + if ($currentValue !== false) { + $this->iniSettings[$varName] = $currentValue; + } else { + throw new Exception( + sprintf( + 'INI setting "%s" could not be set to "%s".', + $varName, + $newValue, + ), + ); + } + } + + /** + * This method is a wrapper for the setlocale() function that automatically + * resets the locale to its original value after the test is run. + * + * @throws Exception + * + * @deprecated https://github.com/sebastianbergmann/phpunit/issues/5216 + * + * @codeCoverageIgnore + */ + protected function setLocale(mixed ...$arguments): void + { + if (count($arguments) < 2) { + throw new Exception; + } + + [$category, $locale] = $arguments; + + if (!in_array($category, self::LOCALE_CATEGORIES, true)) { + throw new Exception; + } + + if (!is_array($locale) && !is_string($locale)) { + throw new Exception; + } + + $this->locale[$category] = setlocale($category, '0'); + + $result = setlocale(...$arguments); + + if ($result === false) { + throw new Exception( + 'The locale functionality is not implemented on your platform, ' . + 'the specified locale does not exist or the category name is ' . + 'invalid.', + ); + } + } + + /** + * Creates a mock object for the specified interface or class. + * + * @psalm-template RealInstanceType of object + * + * @psalm-param class-string $originalClassName + * + * @throws InvalidArgumentException + * @throws MockObjectException + * @throws NoPreviousThrowableException + * + * @psalm-return MockObject&RealInstanceType + */ + protected function createMock(string $originalClassName): MockObject + { + $mock = (new MockGenerator)->testDouble( + $originalClassName, + true, + callOriginalConstructor: false, + callOriginalClone: false, + cloneArguments: false, + allowMockingUnknownTypes: false, + ); + + assert($mock instanceof $originalClassName); + assert($mock instanceof MockObject); + + $this->registerMockObject($mock); + + Event\Facade::emitter()->testCreatedMockObject($originalClassName); + + return $mock; + } + + /** + * @psalm-param list $interfaces + * + * @throws MockObjectException + */ + protected function createMockForIntersectionOfInterfaces(array $interfaces): MockObject + { + $mock = (new MockGenerator)->testDoubleForInterfaceIntersection($interfaces, true); + + assert($mock instanceof MockObject); + + $this->registerMockObject($mock); + + Event\Facade::emitter()->testCreatedMockObjectForIntersectionOfInterfaces($interfaces); + + return $mock; + } + + /** + * Creates (and configures) a mock object for the specified interface or class. + * + * @psalm-template RealInstanceType of object + * + * @psalm-param class-string $originalClassName + * + * @throws InvalidArgumentException + * @throws MockObjectException + * @throws NoPreviousThrowableException + * + * @psalm-return MockObject&RealInstanceType + */ + protected function createConfiguredMock(string $originalClassName, array $configuration): MockObject + { + $o = $this->createMock($originalClassName); + + foreach ($configuration as $method => $return) { + $o->method($method)->willReturn($return); + } + + return $o; + } + + /** + * Creates a partial mock object for the specified interface or class. + * + * @psalm-param list $methods + * + * @psalm-template RealInstanceType of object + * + * @psalm-param class-string $originalClassName + * + * @throws InvalidArgumentException + * @throws MockObjectException + * + * @psalm-return MockObject&RealInstanceType + */ + protected function createPartialMock(string $originalClassName, array $methods): MockObject + { + $partialMock = $this->getMockBuilder($originalClassName) + ->disableOriginalConstructor() + ->disableOriginalClone() + ->disableArgumentCloning() + ->disallowMockingUnknownTypes() + ->onlyMethods($methods) + ->getMock(); + + Event\Facade::emitter()->testCreatedPartialMockObject( + $originalClassName, + ...$methods, + ); + + return $partialMock; + } + + /** + * Creates a test proxy for the specified class. + * + * @psalm-template RealInstanceType of object + * + * @psalm-param class-string $originalClassName + * + * @throws InvalidArgumentException + * @throws MockObjectException + * + * @psalm-return MockObject&RealInstanceType + * + * @deprecated https://github.com/sebastianbergmann/phpunit/issues/5240 + */ + protected function createTestProxy(string $originalClassName, array $constructorArguments = []): MockObject + { + $testProxy = $this->getMockBuilder($originalClassName) + ->setConstructorArgs($constructorArguments) + ->enableProxyingToOriginalMethods() + ->getMock(); + + Event\Facade::emitter()->testCreatedTestProxy( + $originalClassName, + $constructorArguments, + ); + + return $testProxy; + } + + /** + * Creates a mock object for the specified abstract class with all abstract + * methods of the class mocked. Concrete methods are not mocked by default. + * To mock concrete methods, use the 7th parameter ($mockedMethods). + * + * @psalm-template RealInstanceType of object + * + * @psalm-param class-string $originalClassName + * + * @throws InvalidArgumentException + * @throws MockObjectException + * + * @psalm-return MockObject&RealInstanceType + * + * @deprecated https://github.com/sebastianbergmann/phpunit/issues/5241 + */ + protected function getMockForAbstractClass(string $originalClassName, array $arguments = [], string $mockClassName = '', bool $callOriginalConstructor = true, bool $callOriginalClone = true, bool $callAutoload = true, array $mockedMethods = [], bool $cloneArguments = false): MockObject + { + $mockObject = (new MockGenerator)->mockObjectForAbstractClass( + $originalClassName, + $arguments, + $mockClassName, + $callOriginalConstructor, + $callOriginalClone, + $callAutoload, + $mockedMethods, + $cloneArguments, + ); + + $this->registerMockObject($mockObject); + + Event\Facade::emitter()->testCreatedMockObjectForAbstractClass($originalClassName); + + assert($mockObject instanceof $originalClassName); + assert($mockObject instanceof MockObject); + + return $mockObject; + } + + /** + * Creates a mock object based on the given WSDL file. + * + * @throws MockObjectException + * + * @deprecated https://github.com/sebastianbergmann/phpunit/issues/5242 + */ + protected function getMockFromWsdl(string $wsdlFile, string $originalClassName = '', string $mockClassName = '', array $methods = [], bool $callOriginalConstructor = true, array $options = []): MockObject + { + if ($originalClassName === '') { + $fileName = pathinfo(basename(parse_url($wsdlFile, PHP_URL_PATH)), PATHINFO_FILENAME); + $originalClassName = preg_replace('/\W/', '', $fileName); + } + + if (!class_exists($originalClassName)) { + eval( + (new MockGenerator)->generateClassFromWsdl( + $wsdlFile, + $originalClassName, + $methods, + $options, + ) + ); + } + + $mockObject = (new MockGenerator)->testDouble( + $originalClassName, + true, + $methods, + ['', $options], + $mockClassName, + $callOriginalConstructor, + false, + false, + ); + + Event\Facade::emitter()->testCreatedMockObjectFromWsdl( + $wsdlFile, + $originalClassName, + $mockClassName, + $methods, + $callOriginalConstructor, + $options, + ); + + assert($mockObject instanceof MockObject); + + $this->registerMockObject($mockObject); + + return $mockObject; + } + + /** + * Creates a mock object for the specified trait with all abstract methods + * of the trait mocked. Concrete methods to mock can be specified with the + * `$mockedMethods` parameter. + * + * @psalm-param trait-string $traitName + * + * @throws InvalidArgumentException + * @throws MockObjectException + * + * @deprecated https://github.com/sebastianbergmann/phpunit/issues/5243 + */ + protected function getMockForTrait(string $traitName, array $arguments = [], string $mockClassName = '', bool $callOriginalConstructor = true, bool $callOriginalClone = true, bool $callAutoload = true, array $mockedMethods = [], bool $cloneArguments = false): MockObject + { + $mockObject = (new MockGenerator)->mockObjectForTrait( + $traitName, + $arguments, + $mockClassName, + $callOriginalConstructor, + $callOriginalClone, + $callAutoload, + $mockedMethods, + $cloneArguments, + ); + + $this->registerMockObject($mockObject); + + Event\Facade::emitter()->testCreatedMockObjectForTrait($traitName); + + return $mockObject; + } + + /** + * Creates an object that uses the specified trait. + * + * @psalm-param trait-string $traitName + * + * @throws MockObjectException + * + * @deprecated https://github.com/sebastianbergmann/phpunit/issues/5244 + */ + protected function getObjectForTrait(string $traitName, array $arguments = [], string $traitClassName = '', bool $callOriginalConstructor = true, bool $callOriginalClone = true, bool $callAutoload = true): object + { + return (new MockGenerator)->objectForTrait( + $traitName, + $traitClassName, + $callAutoload, + $callOriginalConstructor, + $arguments, + ); + } + + protected function transformException(Throwable $t): Throwable + { + return $t; + } + + /** + * This method is called when a test method did not execute successfully. + * + * @throws Throwable + */ + protected function onNotSuccessfulTest(Throwable $t): never + { + throw $t; + } + /** * @throws AssertionFailedError * @throws Exception * @throws ExpectationFailedException * @throws Throwable - * - * @internal This method is not covered by the backward compatibility promise for PHPUnit */ - protected function runTest(): mixed + private function runTest(): mixed { $testArguments = array_merge($this->data, $this->dependencyInput); @@ -1053,365 +1561,6 @@ abstract class TestCase extends Assert implements Reorderable, SelfDescribing, T return $testResult; } - /** - * This method is a wrapper for the ini_set() function that automatically - * resets the modified php.ini setting to its original value after the - * test is run. - * - * @throws Exception - */ - protected function iniSet(string $varName, string $newValue): void - { - $currentValue = ini_set($varName, $newValue); - - if ($currentValue !== false) { - $this->iniSettings[$varName] = $currentValue; - } else { - throw new Exception( - sprintf( - 'INI setting "%s" could not be set to "%s".', - $varName, - $newValue - ) - ); - } - } - - /** - * This method is a wrapper for the setlocale() function that automatically - * resets the locale to its original value after the test is run. - * - * @throws Exception - */ - protected function setLocale(mixed ...$arguments): void - { - if (count($arguments) < 2) { - throw new Exception; - } - - [$category, $locale] = $arguments; - - if (!in_array($category, self::LOCALE_CATEGORIES, true)) { - throw new Exception; - } - - if (!is_array($locale) && !is_string($locale)) { - throw new Exception; - } - - $this->locale[$category] = setlocale($category, 0); - - $result = setlocale(...$arguments); - - if ($result === false) { - throw new Exception( - 'The locale functionality is not implemented on your platform, ' . - 'the specified locale does not exist or the category name is ' . - 'invalid.' - ); - } - } - - /** - * Creates a test stub for the specified interface or class. - * - * @psalm-template RealInstanceType of object - * - * @psalm-param class-string $originalClassName - * - * @psalm-return Stub&RealInstanceType - * - * @throws \PHPUnit\Framework\MockObject\Exception - * @throws InvalidArgumentException - * @throws NoPreviousThrowableException - */ - protected function createStub(string $originalClassName): Stub - { - $stub = $this->createTestDouble($originalClassName, false); - - Event\Facade::emitter()->testCreatedStub($originalClassName); - - return $stub; - } - - /** - * @psalm-param list $interfaces - * - * @throws \PHPUnit\Framework\MockObject\Exception - */ - protected function createStubForIntersectionOfInterfaces(array $interfaces): Stub - { - $stub = $this->mockObjectGenerator()->getMockForInterfaces($interfaces); - - Event\Facade::emitter()->testCreatedStubForIntersectionOfInterfaces($interfaces); - - return $stub; - } - - /** - * Creates a mock object for the specified interface or class. - * - * @psalm-template RealInstanceType of object - * - * @psalm-param class-string $originalClassName - * - * @psalm-return MockObject&RealInstanceType - * - * @throws \PHPUnit\Framework\MockObject\Exception - * @throws InvalidArgumentException - * @throws NoPreviousThrowableException - */ - protected function createMock(string $originalClassName): MockObject - { - $mock = $this->createTestDouble($originalClassName); - - Event\Facade::emitter()->testCreatedMockObject($originalClassName); - - return $mock; - } - - /** - * @psalm-param list $interfaces - * - * @throws \PHPUnit\Framework\MockObject\Exception - */ - protected function createMockForIntersectionOfInterfaces(array $interfaces): MockObject - { - $mock = $this->mockObjectGenerator()->getMockForInterfaces($interfaces); - - Event\Facade::emitter()->testCreatedMockObjectForIntersectionOfInterfaces($interfaces); - - return $mock; - } - - /** - * Creates (and configures) a mock object for the specified interface or class. - * - * @psalm-template RealInstanceType of object - * - * @psalm-param class-string $originalClassName - * - * @psalm-return MockObject&RealInstanceType - * - * @throws \PHPUnit\Framework\MockObject\Exception - * @throws InvalidArgumentException - * @throws NoPreviousThrowableException - */ - protected function createConfiguredMock(string $originalClassName, array $configuration): MockObject - { - $o = $this->createMock($originalClassName); - - foreach ($configuration as $method => $return) { - $o->method($method)->willReturn($return); - } - - return $o; - } - - /** - * Creates a partial mock object for the specified interface or class. - * - * @psalm-param list $methods - * - * @psalm-template RealInstanceType of object - * - * @psalm-param class-string $originalClassName - * - * @psalm-return MockObject&RealInstanceType - * - * @throws \PHPUnit\Framework\MockObject\Exception - * @throws InvalidArgumentException - */ - protected function createPartialMock(string $originalClassName, array $methods): MockObject - { - $partialMock = $this->getMockBuilder($originalClassName) - ->disableOriginalConstructor() - ->disableOriginalClone() - ->disableArgumentCloning() - ->disallowMockingUnknownTypes() - ->onlyMethods($methods) - ->getMock(); - - Event\Facade::emitter()->testCreatedPartialMockObject( - $originalClassName, - ...$methods - ); - - return $partialMock; - } - - /** - * Creates a test proxy for the specified class. - * - * @psalm-template RealInstanceType of object - * - * @psalm-param class-string $originalClassName - * - * @psalm-return MockObject&RealInstanceType - * - * @throws \PHPUnit\Framework\MockObject\Exception - * @throws InvalidArgumentException - */ - protected function createTestProxy(string $originalClassName, array $constructorArguments = []): MockObject - { - $testProxy = $this->getMockBuilder($originalClassName) - ->setConstructorArgs($constructorArguments) - ->enableProxyingToOriginalMethods() - ->getMock(); - - Event\Facade::emitter()->testCreatedTestProxy( - $originalClassName, - $constructorArguments - ); - - return $testProxy; - } - - /** - * Creates a mock object for the specified abstract class with all abstract - * methods of the class mocked. Concrete methods are not mocked by default. - * To mock concrete methods, use the 7th parameter ($mockedMethods). - * - * @psalm-template RealInstanceType of object - * - * @psalm-param class-string $originalClassName - * - * @psalm-return MockObject&RealInstanceType - * - * @throws \PHPUnit\Framework\MockObject\Exception - * @throws InvalidArgumentException - */ - protected function getMockForAbstractClass(string $originalClassName, array $arguments = [], string $mockClassName = '', bool $callOriginalConstructor = true, bool $callOriginalClone = true, bool $callAutoload = true, array $mockedMethods = [], bool $cloneArguments = false): MockObject - { - $mockObject = $this->mockObjectGenerator()->getMockForAbstractClass( - $originalClassName, - $arguments, - $mockClassName, - $callOriginalConstructor, - $callOriginalClone, - $callAutoload, - $mockedMethods, - $cloneArguments - ); - - $this->registerMockObject($mockObject); - - Event\Facade::emitter()->testCreatedMockObjectForAbstractClass($originalClassName); - - return $mockObject; - } - - /** - * Creates a mock object based on the given WSDL file. - * - * @psalm-template RealInstanceType of object - * - * @psalm-param class-string|string $originalClassName - * - * @psalm-return MockObject&RealInstanceType - * - * @throws \PHPUnit\Framework\MockObject\Exception - */ - protected function getMockFromWsdl(string $wsdlFile, string $originalClassName = '', string $mockClassName = '', array $methods = [], bool $callOriginalConstructor = true, array $options = []): MockObject - { - if ($originalClassName === '') { - $fileName = pathinfo(basename(parse_url($wsdlFile, PHP_URL_PATH)), PATHINFO_FILENAME); - $originalClassName = preg_replace('/\W/', '', $fileName); - } - - if (!class_exists($originalClassName)) { - eval( - $this->mockObjectGenerator()->generateClassFromWsdl( - $wsdlFile, - $originalClassName, - $methods, - $options - ) - ); - } - - $mockObject = $this->mockObjectGenerator()->getMock( - $originalClassName, - $methods, - ['', $options], - $mockClassName, - $callOriginalConstructor, - false, - false - ); - - Event\Facade::emitter()->testCreatedMockObjectFromWsdl( - $wsdlFile, - $originalClassName, - $mockClassName, - $methods, - $callOriginalConstructor, - $options - ); - - $this->registerMockObject($mockObject); - - return $mockObject; - } - - /** - * Creates a mock object for the specified trait with all abstract methods - * of the trait mocked. Concrete methods to mock can be specified with the - * `$mockedMethods` parameter. - * - * @psalm-param trait-string $traitName - * - * @throws \PHPUnit\Framework\MockObject\Exception - * @throws InvalidArgumentException - */ - protected function getMockForTrait(string $traitName, array $arguments = [], string $mockClassName = '', bool $callOriginalConstructor = true, bool $callOriginalClone = true, bool $callAutoload = true, array $mockedMethods = [], bool $cloneArguments = false): MockObject - { - $mockObject = $this->mockObjectGenerator()->getMockForTrait( - $traitName, - $arguments, - $mockClassName, - $callOriginalConstructor, - $callOriginalClone, - $callAutoload, - $mockedMethods, - $cloneArguments - ); - - $this->registerMockObject($mockObject); - - Event\Facade::emitter()->testCreatedMockObjectForTrait($traitName); - - return $mockObject; - } - - /** - * Creates an object that uses the specified trait. - * - * @psalm-param trait-string $traitName - * - * @throws \PHPUnit\Framework\MockObject\Exception - */ - protected function getObjectForTrait(string $traitName, array $arguments = [], string $traitClassName = '', bool $callOriginalConstructor = true, bool $callOriginalClone = true, bool $callAutoload = true): object - { - return $this->mockObjectGenerator()->getObjectForTrait( - $traitName, - $traitClassName, - $callAutoload, - $callOriginalConstructor, - $arguments - ); - } - - /** - * This method is called when a test method did not execute successfully. - * - * @throws Throwable - */ - protected function onNotSuccessfulTest(Throwable $t): never - { - throw $t; - } - /** * @throws Throwable */ @@ -1423,7 +1572,7 @@ abstract class TestCase extends Assert implements Reorderable, SelfDescribing, T } $mockObject->__phpunit_verify( - $this->shouldInvocationMockerBeReset($mockObject) + $this->shouldInvocationMockerBeReset($mockObject), ); } } @@ -1439,7 +1588,7 @@ abstract class TestCase extends Assert implements Reorderable, SelfDescribing, T $missingRequirements = (new Requirements)->requirementsNotSatisfiedFor( static::class, - $this->name + $this->name, ); if (!empty($missingRequirements)) { @@ -1495,10 +1644,10 @@ abstract class TestCase extends Assert implements Reorderable, SelfDescribing, T if ($passedTests->isGreaterThan($dependencyTarget, $this->size())) { Event\Facade::emitter()->testConsideredRisky( $this->valueObjectForEvents(), - 'This test depends on a test that is larger than itself' + 'This test depends on a test that is larger than itself', ); - return false; + return true; } $returnValue = $passedTests->returnValue($dependencyTarget); @@ -1532,7 +1681,7 @@ abstract class TestCase extends Assert implements Reorderable, SelfDescribing, T if ($dependency !== null) { $message = sprintf( 'This test depends on "%s" which does not exist', - $dependency->targetIsClass() ? $dependency->getTargetClassName() : $dependency->getTarget() + $dependency->targetIsClass() ? $dependency->getTargetClassName() : $dependency->getTarget(), ); } @@ -1540,7 +1689,7 @@ abstract class TestCase extends Assert implements Reorderable, SelfDescribing, T Event\Facade::emitter()->testErrored( $this->valueObjectForEvents(), - Event\Code\ThrowableBuilder::from($exception) + Event\Code\ThrowableBuilder::from($exception), ); $this->status = TestStatus::error($message); @@ -1553,26 +1702,17 @@ abstract class TestCase extends Assert implements Reorderable, SelfDescribing, T { $message = sprintf( 'This test depends on "%s" to pass', - $dependency->getTarget() + $dependency->getTarget(), ); Event\Facade::emitter()->testSkipped( $this->valueObjectForEvents(), - $message + $message, ); $this->status = TestStatus::skipped($message); } - private function mockObjectGenerator(): MockGenerator - { - if ($this->mockObjectGenerator === null) { - $this->mockObjectGenerator = new MockGenerator; - } - - return $this->mockObjectGenerator; - } - private function startOutputBuffering(): void { ob_start(); @@ -1586,20 +1726,24 @@ abstract class TestCase extends Assert implements Reorderable, SelfDescribing, T */ private function stopOutputBuffering(): bool { - if (ob_get_level() !== $this->outputBufferingLevel) { + $bufferingLevel = ob_get_level(); + + if ($bufferingLevel !== $this->outputBufferingLevel) { + if ($bufferingLevel > $this->outputBufferingLevel) { + $message = 'Test code or tested code did not close its own output buffers'; + } else { + $message = 'Test code or tested code closed output buffers other than its own'; + } + while (ob_get_level() >= $this->outputBufferingLevel) { ob_end_clean(); } - $message = 'Test code or tested code did not (only) close its own output buffers'; - Event\Facade::emitter()->testConsideredRisky( $this->valueObjectForEvents(), - $message + $message, ); - $this->status = TestStatus::risky($message); - return false; } @@ -1635,7 +1779,7 @@ abstract class TestCase extends Assert implements Reorderable, SelfDescribing, T if (ConfigurationRegistry::get()->beStrictAboutChangesToGlobalState()) { $this->compareGlobalStateSnapshots( $this->snapshot, - $this->createGlobalStateSnapshot($this->backupGlobals === true) + $this->createGlobalStateSnapshot($this->backupGlobals === true), ); } @@ -1686,7 +1830,7 @@ abstract class TestCase extends Assert implements Reorderable, SelfDescribing, T false, false, false, - false + false, ); } @@ -1701,13 +1845,13 @@ abstract class TestCase extends Assert implements Reorderable, SelfDescribing, T $this->compareGlobalStateSnapshotPart( $before->globalVariables(), $after->globalVariables(), - "--- Global variables before the test\n+++ Global variables after the test\n" + "--- Global variables before the test\n+++ Global variables after the test\n", ); $this->compareGlobalStateSnapshotPart( $before->superGlobalVariables(), $after->superGlobalVariables(), - "--- Super-global variables before the test\n+++ Super-global variables after the test\n" + "--- Super-global variables before the test\n+++ Super-global variables after the test\n", ); } @@ -1715,7 +1859,7 @@ abstract class TestCase extends Assert implements Reorderable, SelfDescribing, T $this->compareGlobalStateSnapshotPart( $before->staticProperties(), $after->staticProperties(), - "--- Static properties before the test\n+++ Static properties after the test\n" + "--- Static properties before the test\n+++ Static properties after the test\n", ); } } @@ -1725,21 +1869,23 @@ abstract class TestCase extends Assert implements Reorderable, SelfDescribing, T */ private function compareGlobalStateSnapshotPart(array $before, array $after, string $header): void { - if ($before != $after) { - $differ = new Differ(new UnifiedDiffOutputBuilder($header)); - $exporter = new Exporter; - - Event\Facade::emitter()->testConsideredRisky( - $this->valueObjectForEvents(), - 'This test modified global state but was not expected to do so' . PHP_EOL . - trim( - $differ->diff( - $exporter->export($before), - $exporter->export($after) - ) - ) - ); + if ($before == $after) { + return; } + + $differ = new Differ(new UnifiedDiffOutputBuilder($header)); + $exporter = new Exporter; + + Event\Facade::emitter()->testConsideredRisky( + $this->valueObjectForEvents(), + 'This test modified global state but was not expected to do so' . PHP_EOL . + trim( + $differ->diff( + $exporter->export($before), + $exporter->export($after), + ), + ), + ); } private function shouldInvocationMockerBeReset(MockObject $mock): bool @@ -1757,6 +1903,9 @@ abstract class TestCase extends Assert implements Reorderable, SelfDescribing, T return !in_array($mock, $enumerator->enumerate($this->testResult), true); } + /** + * @deprecated + */ private function registerMockObjectsFromTestArguments(array $testArguments, Context $context = new Context): void { if ($this->registerMockObjectsFromTestArgumentsRecursively) { @@ -1766,17 +1915,18 @@ abstract class TestCase extends Assert implements Reorderable, SelfDescribing, T } } } else { - foreach ($testArguments as $testArgument) { + foreach ($testArguments as &$testArgument) { if ($testArgument instanceof MockObject) { $testArgument = Cloner::clone($testArgument); $this->registerMockObject($testArgument); } elseif (is_array($testArgument) && !$context->contains($testArgument)) { + $testArgumentCopy = $testArgument; $context->add($testArgument); $this->registerMockObjectsFromTestArguments( - $testArgument, - $context + $testArgumentCopy, + $context, ); } } @@ -1835,7 +1985,7 @@ abstract class TestCase extends Assert implements Reorderable, SelfDescribing, T throw new Exception( $e->getMessage(), $e->getCode(), - $e + $e, ); } // @codeCoverageIgnoreEnd @@ -1886,31 +2036,10 @@ abstract class TestCase extends Assert implements Reorderable, SelfDescribing, T } return TestUtil::isTestMethod( - $class->getMethod($methodName) + $class->getMethod($methodName), ); } - /** - * @psalm-template RealInstanceType of object - * - * @psalm-param class-string $originalClassName - * - * @psalm-return MockObject&RealInstanceType - * - * @throws \PHPUnit\Framework\MockObject\Exception - * @throws InvalidArgumentException - * @throws NoPreviousThrowableException - */ - private function createTestDouble(string $originalClassName, bool $register = true): MockObject - { - return $this->getMockBuilder($originalClassName) - ->disableOriginalConstructor() - ->disableOriginalClone() - ->disableArgumentCloning() - ->disallowMockingUnknownTypes() - ->getMock($register); - } - /** * @throws Exception * @throws ExpectationFailedException @@ -1923,7 +2052,7 @@ abstract class TestCase extends Assert implements Reorderable, SelfDescribing, T if ($this->outputExpectedRegex !== null) { $this->assertMatchesRegularExpression($this->outputExpectedRegex, $this->output); } elseif ($this->outputExpectedString !== null) { - $this->assertEquals($this->outputExpectedString, $this->output); + $this->assertSame($this->outputExpectedString, $this->output); } } catch (ExpectationFailedException $e) { $this->status = TestStatus::failure($e->getMessage()); @@ -1931,79 +2060,110 @@ abstract class TestCase extends Assert implements Reorderable, SelfDescribing, T Event\Facade::emitter()->testFailed( $this->valueObjectForEvents(), Event\Code\ThrowableBuilder::from($e), - Event\Code\ComparisonFailureBuilder::from($e) + Event\Code\ComparisonFailureBuilder::from($e), ); throw $e; } } + /** + * @throws Throwable + * + * @codeCoverageIgnore + */ private function invokeBeforeClassHookMethods(array $hookMethods, Event\Emitter $emitter): void { $this->invokeHookMethods( $hookMethods['beforeClass'], $emitter, - 'testBeforeFirstTestMethodCalled', - 'testBeforeFirstTestMethodFinished' + 'beforeFirstTestMethodCalled', + 'beforeFirstTestMethodErrored', + 'beforeFirstTestMethodFinished', ); } + /** + * @throws Throwable + */ private function invokeBeforeTestHookMethods(array $hookMethods, Event\Emitter $emitter): void { $this->invokeHookMethods( $hookMethods['before'], $emitter, - 'testBeforeTestMethodCalled', - 'testBeforeTestMethodFinished' + 'beforeTestMethodCalled', + 'beforeTestMethodErrored', + 'beforeTestMethodFinished', ); } + /** + * @throws Throwable + */ private function invokePreConditionHookMethods(array $hookMethods, Event\Emitter $emitter): void { $this->invokeHookMethods( $hookMethods['preCondition'], $emitter, - 'testPreConditionCalled', - 'testPreConditionFinished' + 'preConditionCalled', + 'preConditionErrored', + 'preConditionFinished', ); } + /** + * @throws Throwable + */ private function invokePostConditionHookMethods(array $hookMethods, Event\Emitter $emitter): void { $this->invokeHookMethods( $hookMethods['postCondition'], $emitter, - 'testPostConditionCalled', - 'testPostConditionFinished' + 'postConditionCalled', + 'postConditionErrored', + 'postConditionFinished', ); } + /** + * @throws Throwable + */ private function invokeAfterTestHookMethods(array $hookMethods, Event\Emitter $emitter): void { $this->invokeHookMethods( $hookMethods['after'], $emitter, - 'testAfterTestMethodCalled', - 'testAfterTestMethodFinished' + 'afterTestMethodCalled', + 'afterTestMethodErrored', + 'afterTestMethodFinished', ); } + /** + * @throws Throwable + * + * @codeCoverageIgnore + */ private function invokeAfterClassHookMethods(array $hookMethods, Event\Emitter $emitter): void { $this->invokeHookMethods( $hookMethods['afterClass'], $emitter, - 'testAfterLastTestMethodCalled', - 'testAfterLastTestMethodFinished' + 'afterLastTestMethodCalled', + 'afterLastTestMethodErrored', + 'afterLastTestMethodFinished', ); } /** * @psalm-param list $hookMethods - * @psalm-param 'testBeforeFirstTestMethodCalled'|'testBeforeTestMethodCalled'|'testPreConditionCalled'|'testPostConditionCalled'|'testAfterTestMethodCalled'|'testAfterLastTestMethodCalled' $calledMethod - * @psalm-param 'testBeforeFirstTestMethodFinished'|'testBeforeTestMethodFinished'|'testPreConditionFinished'|'testPostConditionFinished'|'testAfterTestMethodFinished'|'testAfterLastTestMethodFinished' $finishedMethod + * @psalm-param 'beforeFirstTestMethodCalled'|'beforeTestMethodCalled'|'preConditionCalled'|'postConditionCalled'|'afterTestMethodCalled'|'afterLastTestMethodCalled' $calledMethod + * @psalm-param 'beforeFirstTestMethodErrored'|'beforeTestMethodErrored'|'preConditionErrored'|'postConditionErrored'|'afterTestMethodErrored'|'afterLastTestMethodErrored' $erroredMethod + * @psalm-param 'beforeFirstTestMethodFinished'|'beforeTestMethodFinished'|'preConditionFinished'|'postConditionFinished'|'afterTestMethodFinished'|'afterLastTestMethodFinished' $finishedMethod + * + * @throws Throwable */ - private function invokeHookMethods(array $hookMethods, Event\Emitter $emitter, string $calledMethod, string $finishedMethod): void + private function invokeHookMethods(array $hookMethods, Event\Emitter $emitter, string $calledMethod, string $erroredMethod, string $finishedMethod): void { $methodsInvoked = []; @@ -2012,19 +2172,32 @@ abstract class TestCase extends Assert implements Reorderable, SelfDescribing, T continue; } - $this->{$methodName}(); - $methodInvoked = new Event\Code\ClassMethod( static::class, - $methodName + $methodName, ); + try { + $this->{$methodName}(); + } catch (Throwable $t) { + } + $emitter->{$calledMethod}( static::class, $methodInvoked ); $methodsInvoked[] = $methodInvoked; + + if (isset($t)) { + $emitter->{$erroredMethod}( + static::class, + $methodInvoked, + Event\Code\ThrowableBuilder::from($t), + ); + + break; + } } if (!empty($methodsInvoked)) { @@ -2033,6 +2206,10 @@ abstract class TestCase extends Assert implements Reorderable, SelfDescribing, T ...$methodsInvoked ); } + + if (isset($t)) { + throw $t; + } } private function methodDoesNotExistOrIsDeclaredInTestCase(string $methodName): bool @@ -2046,14 +2223,14 @@ abstract class TestCase extends Assert implements Reorderable, SelfDescribing, T /** * @throws ExpectationFailedException */ - private function verifyExceptionExpectations(Throwable|\Exception $exception): void + private function verifyExceptionExpectations(\Exception|Throwable $exception): void { if ($this->expectedException !== null) { $this->assertThat( $exception, new ExceptionConstraint( - $this->expectedException - ) + $this->expectedException, + ), ); } @@ -2061,8 +2238,8 @@ abstract class TestCase extends Assert implements Reorderable, SelfDescribing, T $this->assertThat( $exception->getMessage(), new ExceptionMessageIsOrContains( - $this->expectedExceptionMessage - ) + $this->expectedExceptionMessage, + ), ); } @@ -2070,8 +2247,8 @@ abstract class TestCase extends Assert implements Reorderable, SelfDescribing, T $this->assertThat( $exception->getMessage(), new ExceptionMessageMatchesRegularExpression( - $this->expectedExceptionMessageRegExp - ) + $this->expectedExceptionMessageRegExp, + ), ); } @@ -2079,8 +2256,8 @@ abstract class TestCase extends Assert implements Reorderable, SelfDescribing, T $this->assertThat( $exception->getCode(), new ExceptionCode( - $this->expectedExceptionCode - ) + $this->expectedExceptionCode, + ), ); } } @@ -2093,7 +2270,7 @@ abstract class TestCase extends Assert implements Reorderable, SelfDescribing, T if ($this->expectedException !== null) { $this->assertThat( null, - new ExceptionConstraint($this->expectedException) + new ExceptionConstraint($this->expectedException), ); } elseif ($this->expectedExceptionMessage !== null) { $this->numberOfAssertionsPerformed++; @@ -2101,8 +2278,8 @@ abstract class TestCase extends Assert implements Reorderable, SelfDescribing, T throw new AssertionFailedError( sprintf( 'Failed asserting that exception with message "%s" is thrown', - $this->expectedExceptionMessage - ) + $this->expectedExceptionMessage, + ), ); } elseif ($this->expectedExceptionMessageRegExp !== null) { $this->numberOfAssertionsPerformed++; @@ -2110,8 +2287,8 @@ abstract class TestCase extends Assert implements Reorderable, SelfDescribing, T throw new AssertionFailedError( sprintf( 'Failed asserting that exception with message matching "%s" is thrown', - $this->expectedExceptionMessageRegExp - ) + $this->expectedExceptionMessageRegExp, + ), ); } elseif ($this->expectedExceptionCode !== null) { $this->numberOfAssertionsPerformed++; @@ -2119,9 +2296,119 @@ abstract class TestCase extends Assert implements Reorderable, SelfDescribing, T throw new AssertionFailedError( sprintf( 'Failed asserting that exception with code "%s" is thrown', - $this->expectedExceptionCode - ) + $this->expectedExceptionCode, + ), ); } } + + private function isRegisteredFailure(Throwable $t): bool + { + foreach (array_keys($this->failureTypes) as $failureType) { + if ($t instanceof $failureType) { + return true; + } + } + + return false; + } + + /** + * @internal This method is not covered by the backward compatibility promise for PHPUnit + */ + private function hasExpectationOnOutput(): bool + { + return is_string($this->outputExpectedString) || is_string($this->outputExpectedRegex); + } + + private function requirementsNotSatisfied(): bool + { + return (new Requirements)->requirementsNotSatisfiedFor(static::class, $this->name) !== []; + } + + /** + * @see https://github.com/sebastianbergmann/phpunit/issues/6095 + */ + private function handleExceptionFromInvokedCountMockObjectRule(Throwable $t): void + { + if (!$t instanceof ExpectationFailedException) { + return; + } + + $trace = $t->getTrace(); + + if (isset($trace[0]['class']) && $trace[0]['class'] === InvokedCount::class) { + $this->numberOfAssertionsPerformed++; + } + } + + /** + * Creates a test stub for the specified interface or class. + * + * @psalm-template RealInstanceType of object + * + * @psalm-param class-string $originalClassName + * + * @throws InvalidArgumentException + * @throws MockObjectException + * @throws NoPreviousThrowableException + * + * @psalm-return Stub&RealInstanceType + */ + protected static function createStub(string $originalClassName): Stub + { + $stub = (new MockGenerator)->testDouble( + $originalClassName, + true, + callOriginalConstructor: false, + callOriginalClone: false, + cloneArguments: false, + allowMockingUnknownTypes: false, + ); + + Event\Facade::emitter()->testCreatedStub($originalClassName); + + assert($stub instanceof $originalClassName); + assert($stub instanceof Stub); + + return $stub; + } + + /** + * @psalm-param list $interfaces + * + * @throws MockObjectException + */ + protected static function createStubForIntersectionOfInterfaces(array $interfaces): Stub + { + $stub = (new MockGenerator)->testDoubleForInterfaceIntersection($interfaces, true); + + Event\Facade::emitter()->testCreatedStubForIntersectionOfInterfaces($interfaces); + + return $stub; + } + + /** + * Creates (and configures) a test stub for the specified interface or class. + * + * @psalm-template RealInstanceType of object + * + * @psalm-param class-string $originalClassName + * + * @throws InvalidArgumentException + * @throws MockObjectException + * @throws NoPreviousThrowableException + * + * @psalm-return Stub&RealInstanceType + */ + final protected static function createConfiguredStub(string $originalClassName, array $configuration): Stub + { + $o = self::createStub($originalClassName); + + foreach ($configuration as $method => $return) { + $o->method($method)->willReturn($return); + } + + return $o; + } } diff --git a/vendor/phpunit/phpunit/src/Framework/TestRunner.php b/vendor/phpunit/phpunit/src/Framework/TestRunner.php index 8eb9e580..9171b376 100644 --- a/vendor/phpunit/phpunit/src/Framework/TestRunner.php +++ b/vendor/phpunit/phpunit/src/Framework/TestRunner.php @@ -11,8 +11,8 @@ namespace PHPUnit\Framework; use const PHP_EOL; use function assert; -use function class_exists; use function defined; +use function error_clear_last; use function extension_loaded; use function get_include_path; use function hrtime; @@ -22,22 +22,22 @@ use function sys_get_temp_dir; use function tempnam; use function unlink; use function var_export; +use function xdebug_is_debugger_active; use AssertionError; use PHPUnit\Event; use PHPUnit\Event\NoPreviousThrowableException; use PHPUnit\Event\TestData\MoreThanOneDataSetFromDataProviderException; -use PHPUnit\Event\TestData\NoDataSetFromDataProviderException; use PHPUnit\Metadata\Api\CodeCoverage as CodeCoverageMetadataApi; use PHPUnit\Metadata\Parser\Registry as MetadataRegistry; use PHPUnit\Runner\CodeCoverage; +use PHPUnit\Runner\ErrorHandler; use PHPUnit\TextUI\Configuration\Configuration; use PHPUnit\TextUI\Configuration\Registry as ConfigurationRegistry; -use PHPUnit\Util\ErrorHandler; use PHPUnit\Util\GlobalState; use PHPUnit\Util\PHP\AbstractPhpProcess; use ReflectionClass; use SebastianBergmann\CodeCoverage\Exception as OriginalCodeCoverageException; -use SebastianBergmann\CodeCoverage\StaticAnalysisCacheNotConfiguredException; +use SebastianBergmann\CodeCoverage\InvalidArgumentException; use SebastianBergmann\CodeCoverage\UnintentionallyCoveredCodeException; use SebastianBergmann\Invoker\Invoker; use SebastianBergmann\Invoker\TimeoutException; @@ -45,6 +45,8 @@ use SebastianBergmann\Template\Template; use Throwable; /** + * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit + * * @internal This class is not covered by the backward compatibility promise for PHPUnit */ final class TestRunner @@ -59,10 +61,9 @@ final class TestRunner /** * @throws \PHPUnit\Runner\Exception - * @throws \SebastianBergmann\CodeCoverage\InvalidArgumentException * @throws CodeCoverageException + * @throws InvalidArgumentException * @throws MoreThanOneDataSetFromDataProviderException - * @throws NoDataSetFromDataProviderException * @throws UnintentionallyCoveredCodeException */ public function run(TestCase $test): void @@ -75,7 +76,7 @@ final class TestRunner $shouldCodeCoverageBeCollected = (new CodeCoverageMetadataApi)->shouldCodeCoverageBeCollectedFor( $test::class, - $test->name() + $test->name(), ); $error = false; @@ -84,7 +85,11 @@ final class TestRunner $risky = false; $skipped = false; - ErrorHandler::instance()->enable(); + error_clear_last(); + + if ($this->shouldErrorHandlerBeUsed($test)) { + ErrorHandler::instance()->enable(); + } $collectCodeCoverage = CodeCoverage::instance()->isActive() && $shouldCodeCoverageBeCollected; @@ -122,8 +127,8 @@ final class TestRunner '%s in %s:%s', $e->getMessage(), $frame['file'], - $frame['line'] - ) + $frame['line'], + ), ); } catch (Throwable $e) { $error = true; @@ -132,6 +137,7 @@ final class TestRunner $test->addToAssertionCount(Assert::getCount()); if ($this->configuration->reportUselessTests() && + !$test->doesNotPerformAssertions() && $test->numberOfAssertionsPerformed() === 0) { $risky = true; } @@ -141,7 +147,7 @@ final class TestRunner !$this->hasCoverageMetadata($test::class, $test->name())) { Event\Facade::emitter()->testConsideredRisky( $test->valueObjectForEvents(), - 'This test does not define a code coverage target but is expected to do so' + 'This test does not define a code coverage target but is expected to do so', ); $risky = true; @@ -156,18 +162,20 @@ final class TestRunner try { $linesToBeCovered = (new CodeCoverageMetadataApi)->linesToBeCovered( $test::class, - $test->name() + $test->name(), ); $linesToBeUsed = (new CodeCoverageMetadataApi)->linesToBeUsed( $test::class, - $test->name() + $test->name(), ); } catch (InvalidCoversTargetException $cce) { Event\Facade::emitter()->testTriggeredPhpunitWarning( $test->valueObjectForEvents(), - $cce->getMessage() + $cce->getMessage(), ); + + $append = false; } } @@ -175,14 +183,14 @@ final class TestRunner CodeCoverage::instance()->stop( $append, $linesToBeCovered, - $linesToBeUsed + $linesToBeUsed, ); } catch (UnintentionallyCoveredCodeException $cce) { Event\Facade::emitter()->testConsideredRisky( $test->valueObjectForEvents(), 'This test executed code that is not listed as code to be covered or used:' . PHP_EOL . - $cce->getMessage() + $cce->getMessage(), ); } catch (OriginalCodeCoverageException $cce) { $error = true; @@ -193,23 +201,15 @@ final class TestRunner ErrorHandler::instance()->disable(); - if (isset($e)) { - if ($test->wasPrepared()) { - Event\Facade::emitter()->testFinished( - $test->valueObjectForEvents(), - $test->numberOfAssertionsPerformed() - ); - } - - return; - } - - if ($this->configuration->reportUselessTests() && + if (!$error && + !$incomplete && + !$skipped && + $this->configuration->reportUselessTests() && !$test->doesNotPerformAssertions() && $test->numberOfAssertionsPerformed() === 0) { Event\Facade::emitter()->testConsideredRisky( $test->valueObjectForEvents(), - 'This test did not perform any assertions' + 'This test did not perform any assertions', ); } @@ -218,9 +218,10 @@ final class TestRunner Event\Facade::emitter()->testConsideredRisky( $test->valueObjectForEvents(), sprintf( - 'This test is not expected to perform assertions but performed %d assertions', - $test->numberOfAssertionsPerformed() - ) + 'This test is not expected to perform assertions but performed %d assertion%s', + $test->numberOfAssertionsPerformed(), + $test->numberOfAssertionsPerformed() > 1 ? 's' : '', + ), ); } @@ -232,16 +233,16 @@ final class TestRunner Event\Facade::emitter()->testConsideredRisky( $test->valueObjectForEvents(), sprintf( - 'This test printed output: %s', - $test->output() - ) + 'Test code or tested code printed unexpected output: %s', + $test->output(), + ), ); } if ($test->wasPrepared()) { Event\Facade::emitter()->testFinished( $test->valueObjectForEvents(), - $test->numberOfAssertionsPerformed() + $test->numberOfAssertionsPerformed(), ); } } @@ -254,7 +255,6 @@ final class TestRunner * @throws MoreThanOneDataSetFromDataProviderException * @throws NoPreviousThrowableException * @throws ProcessIsolationException - * @throws StaticAnalysisCacheNotConfiguredException */ public function runInSeparateProcess(TestCase $test, bool $runEntireClass, bool $preserveGlobalState): void { @@ -262,11 +262,11 @@ final class TestRunner if ($runEntireClass) { $template = new Template( - __DIR__ . '/../Util/PHP/Template/TestCaseClass.tpl' + __DIR__ . '/../Util/PHP/Template/TestCaseClass.tpl', ); } else { $template = new Template( - __DIR__ . '/../Util/PHP/Template/TestCaseMethod.tpl' + __DIR__ . '/../Util/PHP/Template/TestCaseMethod.tpl', ); } @@ -287,7 +287,9 @@ final class TestRunner $iniSettings = GlobalState::getIniSettingsAsString(); } - $coverage = CodeCoverage::instance()->isActive() ? 'true' : 'false'; + $exportObjects = Event\Facade::emitter()->exportsObjects() ? 'true' : 'false'; + $coverage = CodeCoverage::instance()->isActive() ? 'true' : 'false'; + $linesToBeIgnored = var_export(CodeCoverage::instance()->linesToBeIgnored(), true); if (defined('PHPUNIT_COMPOSER_INSTALL')) { $composerAutoload = var_export(PHPUNIT_COMPOSER_INSTALL, true); @@ -307,14 +309,13 @@ final class TestRunner $includePath = var_export(get_include_path(), true); // must do these fixes because TestCaseMethod.tpl has unserialize('{data}') in it, and we can't break BC // the lines above used to use addcslashes() rather than var_export(), which breaks null byte escape sequences - $data = "'." . $data . ".'"; - $dataName = "'.(" . $dataName . ").'"; - $dependencyInput = "'." . $dependencyInput . ".'"; - $includePath = "'." . $includePath . ".'"; - - $offset = hrtime(); - + $data = "'." . $data . ".'"; + $dataName = "'.(" . $dataName . ").'"; + $dependencyInput = "'." . $dependencyInput . ".'"; + $includePath = "'." . $includePath . ".'"; + $offset = hrtime(); $serializedConfiguration = $this->saveConfigurationForChildProcess(); + $processResultFile = tempnam(sys_get_temp_dir(), 'phpunit_'); $var = [ 'bootstrap' => $bootstrap, @@ -323,6 +324,7 @@ final class TestRunner 'filename' => $class->getFileName(), 'className' => $class->getName(), 'collectCodeCoverageInformation' => $coverage, + 'linesToBeIgnored' => $linesToBeIgnored, 'data' => $data, 'dataName' => $dataName, 'dependencyInput' => $dependencyInput, @@ -335,6 +337,8 @@ final class TestRunner 'offsetSeconds' => $offset[0], 'offsetNanoseconds' => $offset[1], 'serializedConfiguration' => $serializedConfiguration, + 'processResultFile' => $processResultFile, + 'exportObjects' => $exportObjects, ]; if (!$runEntireClass) { @@ -344,7 +348,7 @@ final class TestRunner $template->setVar($var); $php = AbstractPhpProcess::factory(); - $php->runTestJob($template->render(), $test); + $php->runTestJob($template->render(), $test, $processResultFile); @unlink($serializedConfiguration); } @@ -355,22 +359,22 @@ final class TestRunner */ private function hasCoverageMetadata(string $className, string $methodName): bool { - $metadata = MetadataRegistry::parser()->forClassAndMethod($className, $methodName); + foreach (MetadataRegistry::parser()->forClassAndMethod($className, $methodName) as $metadata) { + if ($metadata->isCovers()) { + return true; + } - if ($metadata->isCovers()->isNotEmpty()) { - return true; - } + if ($metadata->isCoversClass()) { + return true; + } - if ($metadata->isCoversClass()->isNotEmpty()) { - return true; - } + if ($metadata->isCoversFunction()) { + return true; + } - if ($metadata->isCoversFunction()->isNotEmpty()) { - return true; - } - - if ($metadata->isCoversNothing()->isNotEmpty()) { - return true; + if ($metadata->isCoversNothing()) { + return true; + } } return false; @@ -382,12 +386,6 @@ final class TestRunner return $this->timeLimitCanBeEnforced; } - if (!class_exists(Invoker::class)) { - $this->timeLimitCanBeEnforced = false; - - return $this->timeLimitCanBeEnforced; - } - $this->timeLimitCanBeEnforced = (new Invoker)->canInvokeWithTimeout(); return $this->timeLimitCanBeEnforced; @@ -416,12 +414,13 @@ final class TestRunner private function runTestWithTimeout(TestCase $test): bool { $_timeout = $this->configuration->defaultTimeLimit(); + $testSize = $test->size(); - if ($test->size()->isSmall()) { + if ($testSize->isSmall()) { $_timeout = $this->configuration->timeoutForSmallTests(); - } elseif ($test->size()->isMedium()) { + } elseif ($testSize->isMedium()) { $_timeout = $this->configuration->timeoutForMediumTests(); - } elseif ($test->size()->isLarge()) { + } elseif ($testSize->isLarge()) { $_timeout = $this->configuration->timeoutForLargeTests(); } @@ -433,8 +432,8 @@ final class TestRunner sprintf( 'This test was aborted after %d second%s', $_timeout, - $_timeout !== 1 ? 's' : '' - ) + $_timeout !== 1 ? 's' : '', + ), ); return true; @@ -448,9 +447,9 @@ final class TestRunner */ private function saveConfigurationForChildProcess(): string { - $path = tempnam(sys_get_temp_dir(), 'PHPUnit'); + $path = tempnam(sys_get_temp_dir(), 'phpunit_'); - if (!$path) { + if ($path === false) { throw new ProcessIsolationException; } @@ -460,4 +459,13 @@ final class TestRunner return $path; } + + private function shouldErrorHandlerBeUsed(TestCase $test): bool + { + if (MetadataRegistry::parser()->forMethod($test::class, $test->name())->isWithoutErrorHandler()->isNotEmpty()) { + return false; + } + + return true; + } } diff --git a/vendor/phpunit/phpunit/src/Framework/TestSize/Known.php b/vendor/phpunit/phpunit/src/Framework/TestSize/Known.php index d7dca96e..ea8cb293 100644 --- a/vendor/phpunit/phpunit/src/Framework/TestSize/Known.php +++ b/vendor/phpunit/phpunit/src/Framework/TestSize/Known.php @@ -10,6 +10,8 @@ namespace PHPUnit\Framework\TestSize; /** + * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit + * * @internal This class is not covered by the backward compatibility promise for PHPUnit * * @psalm-immutable diff --git a/vendor/phpunit/phpunit/src/Framework/TestSize/Large.php b/vendor/phpunit/phpunit/src/Framework/TestSize/Large.php index bdf00184..833dbc06 100644 --- a/vendor/phpunit/phpunit/src/Framework/TestSize/Large.php +++ b/vendor/phpunit/phpunit/src/Framework/TestSize/Large.php @@ -10,6 +10,8 @@ namespace PHPUnit\Framework\TestSize; /** + * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit + * * @internal This class is not covered by the backward compatibility promise for PHPUnit * * @psalm-immutable diff --git a/vendor/phpunit/phpunit/src/Framework/TestSize/Medium.php b/vendor/phpunit/phpunit/src/Framework/TestSize/Medium.php index b16edaa5..dd934bed 100644 --- a/vendor/phpunit/phpunit/src/Framework/TestSize/Medium.php +++ b/vendor/phpunit/phpunit/src/Framework/TestSize/Medium.php @@ -10,6 +10,8 @@ namespace PHPUnit\Framework\TestSize; /** + * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit + * * @internal This class is not covered by the backward compatibility promise for PHPUnit * * @psalm-immutable diff --git a/vendor/phpunit/phpunit/src/Framework/TestSize/Small.php b/vendor/phpunit/phpunit/src/Framework/TestSize/Small.php index 1387e930..eb7250db 100644 --- a/vendor/phpunit/phpunit/src/Framework/TestSize/Small.php +++ b/vendor/phpunit/phpunit/src/Framework/TestSize/Small.php @@ -10,6 +10,8 @@ namespace PHPUnit\Framework\TestSize; /** + * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit + * * @internal This class is not covered by the backward compatibility promise for PHPUnit * * @psalm-immutable diff --git a/vendor/phpunit/phpunit/src/Framework/TestSize/TestSize.php b/vendor/phpunit/phpunit/src/Framework/TestSize/TestSize.php index 7d876ea4..82b0bb23 100644 --- a/vendor/phpunit/phpunit/src/Framework/TestSize/TestSize.php +++ b/vendor/phpunit/phpunit/src/Framework/TestSize/TestSize.php @@ -10,6 +10,8 @@ namespace PHPUnit\Framework\TestSize; /** + * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit + * * @internal This class is not covered by the backward compatibility promise for PHPUnit * * @psalm-immutable diff --git a/vendor/phpunit/phpunit/src/Framework/TestSize/Unknown.php b/vendor/phpunit/phpunit/src/Framework/TestSize/Unknown.php index d0884e92..5089f3f2 100644 --- a/vendor/phpunit/phpunit/src/Framework/TestSize/Unknown.php +++ b/vendor/phpunit/phpunit/src/Framework/TestSize/Unknown.php @@ -10,6 +10,8 @@ namespace PHPUnit\Framework\TestSize; /** + * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit + * * @internal This class is not covered by the backward compatibility promise for PHPUnit * * @psalm-immutable diff --git a/vendor/phpunit/phpunit/src/Framework/TestStatus/Deprecation.php b/vendor/phpunit/phpunit/src/Framework/TestStatus/Deprecation.php index 2711760d..545f6aac 100644 --- a/vendor/phpunit/phpunit/src/Framework/TestStatus/Deprecation.php +++ b/vendor/phpunit/phpunit/src/Framework/TestStatus/Deprecation.php @@ -10,9 +10,11 @@ namespace PHPUnit\Framework\TestStatus; /** + * @psalm-immutable + * * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit * - * @psalm-immutable + * @internal This class is not covered by the backward compatibility promise for PHPUnit */ final class Deprecation extends Known { diff --git a/vendor/phpunit/phpunit/src/Framework/TestStatus/Error.php b/vendor/phpunit/phpunit/src/Framework/TestStatus/Error.php index 6ddb3b1b..8dedfdfc 100644 --- a/vendor/phpunit/phpunit/src/Framework/TestStatus/Error.php +++ b/vendor/phpunit/phpunit/src/Framework/TestStatus/Error.php @@ -10,9 +10,11 @@ namespace PHPUnit\Framework\TestStatus; /** + * @psalm-immutable + * * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit * - * @psalm-immutable + * @internal This class is not covered by the backward compatibility promise for PHPUnit */ final class Error extends Known { diff --git a/vendor/phpunit/phpunit/src/Framework/TestStatus/Failure.php b/vendor/phpunit/phpunit/src/Framework/TestStatus/Failure.php index 1bb1b037..2568445b 100644 --- a/vendor/phpunit/phpunit/src/Framework/TestStatus/Failure.php +++ b/vendor/phpunit/phpunit/src/Framework/TestStatus/Failure.php @@ -10,9 +10,11 @@ namespace PHPUnit\Framework\TestStatus; /** + * @psalm-immutable + * * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit * - * @psalm-immutable + * @internal This class is not covered by the backward compatibility promise for PHPUnit */ final class Failure extends Known { diff --git a/vendor/phpunit/phpunit/src/Framework/TestStatus/Incomplete.php b/vendor/phpunit/phpunit/src/Framework/TestStatus/Incomplete.php index eff26721..6b81dce9 100644 --- a/vendor/phpunit/phpunit/src/Framework/TestStatus/Incomplete.php +++ b/vendor/phpunit/phpunit/src/Framework/TestStatus/Incomplete.php @@ -10,9 +10,11 @@ namespace PHPUnit\Framework\TestStatus; /** + * @psalm-immutable + * * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit * - * @psalm-immutable + * @internal This class is not covered by the backward compatibility promise for PHPUnit */ final class Incomplete extends Known { diff --git a/vendor/phpunit/phpunit/src/Framework/TestStatus/Known.php b/vendor/phpunit/phpunit/src/Framework/TestStatus/Known.php index b5d92b39..30838d38 100644 --- a/vendor/phpunit/phpunit/src/Framework/TestStatus/Known.php +++ b/vendor/phpunit/phpunit/src/Framework/TestStatus/Known.php @@ -10,9 +10,11 @@ namespace PHPUnit\Framework\TestStatus; /** + * @psalm-immutable + * * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit * - * @psalm-immutable + * @internal This class is not covered by the backward compatibility promise for PHPUnit */ abstract class Known extends TestStatus { diff --git a/vendor/phpunit/phpunit/src/Framework/TestStatus/Notice.php b/vendor/phpunit/phpunit/src/Framework/TestStatus/Notice.php index 1eb10761..322db6f7 100644 --- a/vendor/phpunit/phpunit/src/Framework/TestStatus/Notice.php +++ b/vendor/phpunit/phpunit/src/Framework/TestStatus/Notice.php @@ -10,9 +10,11 @@ namespace PHPUnit\Framework\TestStatus; /** + * @psalm-immutable + * * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit * - * @psalm-immutable + * @internal This class is not covered by the backward compatibility promise for PHPUnit */ final class Notice extends Known { diff --git a/vendor/phpunit/phpunit/src/Framework/TestStatus/Risky.php b/vendor/phpunit/phpunit/src/Framework/TestStatus/Risky.php index bd0cb889..7e7db701 100644 --- a/vendor/phpunit/phpunit/src/Framework/TestStatus/Risky.php +++ b/vendor/phpunit/phpunit/src/Framework/TestStatus/Risky.php @@ -10,9 +10,11 @@ namespace PHPUnit\Framework\TestStatus; /** + * @psalm-immutable + * * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit * - * @psalm-immutable + * @internal This class is not covered by the backward compatibility promise for PHPUnit */ final class Risky extends Known { diff --git a/vendor/phpunit/phpunit/src/Framework/TestStatus/Skipped.php b/vendor/phpunit/phpunit/src/Framework/TestStatus/Skipped.php index 4c8aeaf9..345aae95 100644 --- a/vendor/phpunit/phpunit/src/Framework/TestStatus/Skipped.php +++ b/vendor/phpunit/phpunit/src/Framework/TestStatus/Skipped.php @@ -10,9 +10,11 @@ namespace PHPUnit\Framework\TestStatus; /** + * @psalm-immutable + * * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit * - * @psalm-immutable + * @internal This class is not covered by the backward compatibility promise for PHPUnit */ final class Skipped extends Known { diff --git a/vendor/phpunit/phpunit/src/Framework/TestStatus/Success.php b/vendor/phpunit/phpunit/src/Framework/TestStatus/Success.php index fb5c945e..973fbdf5 100644 --- a/vendor/phpunit/phpunit/src/Framework/TestStatus/Success.php +++ b/vendor/phpunit/phpunit/src/Framework/TestStatus/Success.php @@ -10,9 +10,11 @@ namespace PHPUnit\Framework\TestStatus; /** + * @psalm-immutable + * * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit * - * @psalm-immutable + * @internal This class is not covered by the backward compatibility promise for PHPUnit */ final class Success extends Known { diff --git a/vendor/phpunit/phpunit/src/Framework/TestStatus/TestStatus.php b/vendor/phpunit/phpunit/src/Framework/TestStatus/TestStatus.php index ab957de1..44484083 100644 --- a/vendor/phpunit/phpunit/src/Framework/TestStatus/TestStatus.php +++ b/vendor/phpunit/phpunit/src/Framework/TestStatus/TestStatus.php @@ -10,9 +10,11 @@ namespace PHPUnit\Framework\TestStatus; /** + * @psalm-immutable + * * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit * - * @psalm-immutable + * @internal This class is not covered by the backward compatibility promise for PHPUnit */ abstract class TestStatus { diff --git a/vendor/phpunit/phpunit/src/Framework/TestStatus/Unknown.php b/vendor/phpunit/phpunit/src/Framework/TestStatus/Unknown.php index 245ec67e..7a391638 100644 --- a/vendor/phpunit/phpunit/src/Framework/TestStatus/Unknown.php +++ b/vendor/phpunit/phpunit/src/Framework/TestStatus/Unknown.php @@ -10,9 +10,11 @@ namespace PHPUnit\Framework\TestStatus; /** + * @psalm-immutable + * * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit * - * @psalm-immutable + * @internal This class is not covered by the backward compatibility promise for PHPUnit */ final class Unknown extends TestStatus { diff --git a/vendor/phpunit/phpunit/src/Framework/TestStatus/Warning.php b/vendor/phpunit/phpunit/src/Framework/TestStatus/Warning.php index 7c31fa8f..ebb05b0f 100644 --- a/vendor/phpunit/phpunit/src/Framework/TestStatus/Warning.php +++ b/vendor/phpunit/phpunit/src/Framework/TestStatus/Warning.php @@ -10,9 +10,11 @@ namespace PHPUnit\Framework\TestStatus; /** + * @psalm-immutable + * * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit * - * @psalm-immutable + * @internal This class is not covered by the backward compatibility promise for PHPUnit */ final class Warning extends Known { diff --git a/vendor/phpunit/phpunit/src/Framework/TestSuite.php b/vendor/phpunit/phpunit/src/Framework/TestSuite.php index 3539eb6d..6c84242b 100644 --- a/vendor/phpunit/phpunit/src/Framework/TestSuite.php +++ b/vendor/phpunit/phpunit/src/Framework/TestSuite.php @@ -12,6 +12,8 @@ namespace PHPUnit\Framework; use const PHP_EOL; use function array_keys; use function array_map; +use function array_pop; +use function array_reverse; use function assert; use function call_user_func; use function class_exists; @@ -38,51 +40,57 @@ use PHPUnit\Runner\Exception as RunnerException; use PHPUnit\Runner\Filter\Factory; use PHPUnit\Runner\PhptTestCase; use PHPUnit\Runner\TestSuiteLoader; -use PHPUnit\TestRunner\TestResult\Facade; -use PHPUnit\TextUI\Configuration\Registry; +use PHPUnit\TestRunner\TestResult\Facade as TestResultFacade; use PHPUnit\Util\Filter; use PHPUnit\Util\Reflection; use PHPUnit\Util\Test as TestUtil; use ReflectionClass; use ReflectionMethod; +use SebastianBergmann\CodeCoverage\InvalidArgumentException; use SebastianBergmann\CodeCoverage\UnintentionallyCoveredCodeException; use Throwable; /** * @template-implements IteratorAggregate * + * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit + * * @internal This class is not covered by the backward compatibility promise for PHPUnit */ class TestSuite implements IteratorAggregate, Reorderable, SelfDescribing, Test { - protected string $name = ''; + /** + * @psalm-var non-empty-string + */ + private string $name; /** * @psalm-var array> */ - protected array $groups = []; - protected ?array $requiredTests = null; + private array $groups = []; + + /** + * @psalm-var ?list + */ + private ?array $requiredTests = null; /** * @psalm-var list */ - private array $tests = []; + private array $tests = []; + + /** + * @psalm-var ?list + */ private ?array $providedTests = null; private ?Factory $iteratorFilter = null; - private readonly bool $stopOnError; - private readonly bool $stopOnFailure; - private readonly bool $stopOnWarning; - private readonly bool $stopOnRisky; - private readonly bool $stopOnIncomplete; - private readonly bool $stopOnSkipped; - private readonly bool $stopOnDefect; + private bool $wasRun = false; - public static function empty(string $name = null): static + /** + * @psalm-param non-empty-string $name + */ + public static function empty(string $name): static { - if ($name === null) { - $name = ''; - } - return new static($name); } @@ -105,17 +113,17 @@ class TestSuite implements IteratorAggregate, Reorderable, SelfDescribing, Test $constructor = $class->getConstructor(); if ($constructor !== null && !$constructor->isPublic()) { - Event\Facade::emitter()->testRunnerTriggeredWarning( + Event\Facade::emitter()->testRunnerTriggeredPhpunitWarning( sprintf( 'Class "%s" has no public constructor.', - $class->getName() - ) + $class->getName(), + ), ); return $testSuite; } - foreach ((new Reflection)->publicMethodsInTestClass($class) as $method) { + foreach (Reflection::publicMethodsInTestClass($class) as $method) { if ($method->getDeclaringClass()->getName() === Assert::class) { continue; } @@ -131,31 +139,24 @@ class TestSuite implements IteratorAggregate, Reorderable, SelfDescribing, Test $testSuite->addTestMethod($class, $method); } - if (count($testSuite) === 0) { - Event\Facade::emitter()->testRunnerTriggeredWarning( + if ($testSuite->isEmpty()) { + Event\Facade::emitter()->testRunnerTriggeredPhpunitWarning( sprintf( 'No tests found in class "%s".', - $class->getName() - ) + $class->getName(), + ), ); } return $testSuite; } + /** + * @psalm-param non-empty-string $name + */ final private function __construct(string $name) { $this->name = $name; - - $configuration = Registry::get(); - - $this->stopOnError = $configuration->stopOnError(); - $this->stopOnFailure = $configuration->stopOnFailure(); - $this->stopOnWarning = $configuration->stopOnWarning(); - $this->stopOnRisky = $configuration->stopOnRisky(); - $this->stopOnIncomplete = $configuration->stopOnIncomplete(); - $this->stopOnSkipped = $configuration->stopOnSkipped(); - $this->stopOnDefect = $configuration->stopOnDefect(); } /** @@ -163,7 +164,7 @@ class TestSuite implements IteratorAggregate, Reorderable, SelfDescribing, Test */ public function toString(): string { - return $this->getName(); + return $this->name(); } /** @@ -173,30 +174,32 @@ class TestSuite implements IteratorAggregate, Reorderable, SelfDescribing, Test { $class = new ReflectionClass($test); - if (!$class->isAbstract()) { - $this->tests[] = $test; - $this->clearCaches(); + if ($class->isAbstract()) { + return; + } - if ($test instanceof self && empty($groups)) { - $groups = $test->getGroups(); - } + $this->tests[] = $test; + $this->clearCaches(); - if ($this->containsOnlyVirtualGroups($groups)) { - $groups[] = 'default'; - } + if ($test instanceof self && empty($groups)) { + $groups = $test->groups(); + } - foreach ($groups as $group) { - if (!isset($this->groups[$group])) { - $this->groups[$group] = [$test]; - } else { - $this->groups[$group][] = $test; - } - } + if ($this->containsOnlyVirtualGroups($groups)) { + $groups[] = 'default'; + } - if ($test instanceof TestCase) { - $test->setGroups($groups); + foreach ($groups as $group) { + if (!isset($this->groups[$group])) { + $this->groups[$group] = [$test]; + } else { + $this->groups[$group][] = $test; } } + + if ($test instanceof TestCase) { + $test->setGroups($groups); + } } /** @@ -210,8 +213,8 @@ class TestSuite implements IteratorAggregate, Reorderable, SelfDescribing, Test throw new Exception( sprintf( 'Class %s is abstract', - $testClass->getName() - ) + $testClass->getName(), + ), ); } @@ -220,8 +223,8 @@ class TestSuite implements IteratorAggregate, Reorderable, SelfDescribing, Test sprintf( 'Class %s is not a subclass of %s', $testClass->getName(), - TestCase::class - ) + TestCase::class, + ), ); } @@ -240,25 +243,17 @@ class TestSuite implements IteratorAggregate, Reorderable, SelfDescribing, Test */ public function addTestFile(string $filename): void { - if (is_file($filename) && str_ends_with($filename, '.phpt')) { - try { + try { + if (str_ends_with($filename, '.phpt') && is_file($filename)) { $this->addTest(new PhptTestCase($filename)); - } catch (RunnerException $e) { - Event\Facade::emitter()->testRunnerTriggeredWarning( - $e->getMessage() + } else { + $this->addTestSuite( + (new TestSuiteLoader)->load($filename), ); } - - return; - } - - try { - $this->addTestSuite( - (new TestSuiteLoader)->load($filename) - ); } catch (RunnerException $e) { - Event\Facade::emitter()->testRunnerTriggeredWarning( - $e->getMessage() + Event\Facade::emitter()->testRunnerTriggeredPhpunitWarning( + $e->getMessage(), ); } } @@ -291,13 +286,19 @@ class TestSuite implements IteratorAggregate, Reorderable, SelfDescribing, Test public function isEmpty(): bool { - return empty($this->tests); + foreach ($this as $test) { + if (count($test) !== 0) { + return false; + } + } + + return true; } /** - * Returns the name of the suite. + * @psalm-return non-empty-string */ - public function getName(): string + public function name(): string { return $this->name; } @@ -307,30 +308,38 @@ class TestSuite implements IteratorAggregate, Reorderable, SelfDescribing, Test * * @psalm-return list */ - public function getGroups(): array + public function groups(): array { return array_map( 'strval', - array_keys($this->groups) + array_keys($this->groups), ); } - public function getGroupDetails(): array + public function groupDetails(): array { return $this->groups; } /** - * @throws \SebastianBergmann\CodeCoverage\InvalidArgumentException * @throws CodeCoverageException * @throws Event\RuntimeException * @throws Exception + * @throws InvalidArgumentException * @throws NoPreviousThrowableException * @throws UnintentionallyCoveredCodeException */ public function run(): void { - if (count($this) === 0) { + if ($this->wasRun) { + // @codeCoverageIgnoreStart + throw new Exception('The tests aggregated by this TestSuite were already run'); + // @codeCoverageIgnoreEnd + } + + $this->wasRun = true; + + if ($this->isEmpty()) { return; } @@ -343,8 +352,22 @@ class TestSuite implements IteratorAggregate, Reorderable, SelfDescribing, Test return; } + /** @psalm-var list $tests */ + $tests = []; + foreach ($this as $test) { - if ($this->shouldStop()) { + $tests[] = $test; + } + + $tests = array_reverse($tests); + + $this->tests = []; + $this->groups = []; + + while (($test = array_pop($tests)) !== null) { + if (TestResultFacade::shouldStop()) { + $emitter->testRunnerExecutionAborted(); + break; } @@ -425,10 +448,9 @@ class TestSuite implements IteratorAggregate, Reorderable, SelfDescribing, Test foreach ($this->tests as $test) { if (!($test instanceof Reorderable)) { - // @codeCoverageIgnoreStart continue; - // @codeCoverageIgnoreEnd } + $this->providedTests = ExecutionOrderDependency::mergeUnique($this->providedTests, $test->provides()); } } @@ -446,13 +468,12 @@ class TestSuite implements IteratorAggregate, Reorderable, SelfDescribing, Test foreach ($this->tests as $test) { if (!($test instanceof Reorderable)) { - // @codeCoverageIgnoreStart continue; - // @codeCoverageIgnoreEnd } + $this->requiredTests = ExecutionOrderDependency::mergeUnique( ExecutionOrderDependency::filterInvalid($this->requiredTests), - $test->requires() + $test->requires(), ); } @@ -464,7 +485,7 @@ class TestSuite implements IteratorAggregate, Reorderable, SelfDescribing, Test public function sortId(): string { - return $this->getName() . '::class'; + return $this->name() . '::class'; } /** @@ -476,7 +497,7 @@ class TestSuite implements IteratorAggregate, Reorderable, SelfDescribing, Test } /** - * @throws \PHPUnit\Event\TestData\MoreThanOneDataSetFromDataProviderException + * @throws Event\TestData\MoreThanOneDataSetFromDataProviderException * @throws Exception */ protected function addTestMethod(ReflectionClass $class, ReflectionMethod $method): void @@ -497,17 +518,17 @@ class TestSuite implements IteratorAggregate, Reorderable, SelfDescribing, Test $method->getStartLine(), Event\Code\TestDoxBuilder::fromClassNameAndMethodName( $className, - $methodName + $methodName, ), MetadataCollection::fromArray([]), - Event\TestData\TestDataCollection::fromArray([]) + Event\TestData\TestDataCollection::fromArray([]), ), sprintf( "The data provider specified for %s::%s is invalid\n%s", $className, $methodName, - $this->throwableToString($e) - ) + $this->throwableToString($e), + ), ); return; @@ -515,13 +536,13 @@ class TestSuite implements IteratorAggregate, Reorderable, SelfDescribing, Test if ($test instanceof TestCase || $test instanceof DataProviderTestSuite) { $test->setDependencies( - Dependencies::dependencies($class->getName(), $methodName) + Dependencies::dependencies($class->getName(), $methodName), ); } $this->addTest( $test, - (new Groups)->groups($class->getName(), $methodName) + (new Groups)->groups($class->getName(), $methodName), ); } @@ -550,35 +571,6 @@ class TestSuite implements IteratorAggregate, Reorderable, SelfDescribing, Test $reflector->getMethod($methodName)->getDeclaringClass()->getName() === TestCase::class; } - private function shouldStop(): bool - { - if (($this->stopOnDefect || $this->stopOnError) && Facade::hasTestErroredEvents()) { - return true; - } - - if (($this->stopOnDefect || $this->stopOnFailure) && Facade::hasTestFailedEvents()) { - return true; - } - - if (($this->stopOnDefect || $this->stopOnWarning) && Facade::hasWarningEvents()) { - return true; - } - - if (($this->stopOnDefect || $this->stopOnRisky) && Facade::hasTestConsideredRiskyEvents()) { - return true; - } - - if ($this->stopOnSkipped && Facade::hasTestSkippedEvents()) { - return true; - } - - if ($this->stopOnIncomplete && Facade::hasTestMarkedIncompleteEvents()) { - return true; - } - - return false; - } - /** * @throws Exception */ @@ -594,7 +586,7 @@ class TestSuite implements IteratorAggregate, Reorderable, SelfDescribing, Test return sprintf( "%s\n%s", $message, - Filter::getFilteredStacktrace($t) + Filter::getFilteredStacktrace($t), ); } @@ -602,7 +594,7 @@ class TestSuite implements IteratorAggregate, Reorderable, SelfDescribing, Test "%s: %s\n%s", $t::class, $message, - Filter::getFilteredStacktrace($t) + Filter::getFilteredStacktrace($t), ); } @@ -616,68 +608,72 @@ class TestSuite implements IteratorAggregate, Reorderable, SelfDescribing, Test return true; } - $methodsCalledBeforeFirstTest = []; + $methods = (new HookMethods)->hookMethods($this->name)['beforeClass']; + $calledMethods = []; + $emitCalledEvent = true; + $result = true; - $beforeClassMethods = (new HookMethods)->hookMethods($this->name)['beforeClass']; + foreach ($methods as $method) { + if ($this->methodDoesNotExistOrIsDeclaredInTestCase($method)) { + continue; + } - try { - foreach ($beforeClassMethods as $beforeClassMethod) { - if ($this->methodDoesNotExistOrIsDeclaredInTestCase($beforeClassMethod)) { - continue; - } + $calledMethod = new Event\Code\ClassMethod( + $this->name, + $method, + ); + + try { + $missingRequirements = (new Requirements)->requirementsNotSatisfiedFor($this->name, $method); + + if ($missingRequirements !== []) { + $emitCalledEvent = false; - if ($missingRequirements = (new Requirements)->requirementsNotSatisfiedFor($this->name, $beforeClassMethod)) { $this->markTestSuiteSkipped(implode(PHP_EOL, $missingRequirements)); } - $methodCalledBeforeFirstTest = new Event\Code\ClassMethod( - $this->name, - $beforeClassMethod - ); - - $emitter->testBeforeFirstTestMethodCalled( - $this->name, - $methodCalledBeforeFirstTest - ); - - $methodsCalledBeforeFirstTest[] = $methodCalledBeforeFirstTest; - - call_user_func([$this->name, $beforeClassMethod]); - } - } catch (SkippedTestSuiteError|SkippedTest $e) { - $emitter->testSuiteSkipped( - $testSuiteValueObjectForEvents, - $e->getMessage() - ); - - return false; - } catch (Throwable $t) { - assert(isset($methodCalledBeforeFirstTest)); - - $emitter->testBeforeFirstTestMethodErrored( - $this->name, - $methodCalledBeforeFirstTest, - Event\Code\ThrowableBuilder::from($t) - ); - - if (!empty($methodsCalledBeforeFirstTest)) { - $emitter->testBeforeFirstTestMethodFinished( - $this->name, - ...$methodsCalledBeforeFirstTest - ); + call_user_func([$this->name, $method]); + } catch (Throwable $t) { } - return false; + /** @psalm-suppress RedundantCondition */ + if ($emitCalledEvent) { + $emitter->beforeFirstTestMethodCalled( + $this->name, + $calledMethod, + ); + + $calledMethods[] = $calledMethod; + } + + if (isset($t) && $t instanceof SkippedTest) { + $emitter->testSuiteSkipped( + $testSuiteValueObjectForEvents, + $t->getMessage(), + ); + + return false; + } + + if (isset($t)) { + $emitter->beforeFirstTestMethodErrored( + $this->name, + $calledMethod, + Event\Code\ThrowableBuilder::from($t), + ); + + $result = false; + } } - if (!empty($methodsCalledBeforeFirstTest)) { - $emitter->testBeforeFirstTestMethodFinished( + if (!empty($calledMethods)) { + $emitter->beforeFirstTestMethodFinished( $this->name, - ...$methodsCalledBeforeFirstTest + ...$calledMethods, ); } - return true; + return $result; } private function invokeMethodsAfterLastTest(Event\Emitter $emitter): void @@ -686,38 +682,44 @@ class TestSuite implements IteratorAggregate, Reorderable, SelfDescribing, Test return; } - $methodsCalledAfterLastTest = []; + $methods = (new HookMethods)->hookMethods($this->name)['afterClass']; + $calledMethods = []; - $afterClassMethods = (new HookMethods)->hookMethods($this->name)['afterClass']; - - foreach ($afterClassMethods as $afterClassMethod) { - if ($this->methodDoesNotExistOrIsDeclaredInTestCase($afterClassMethod)) { + foreach ($methods as $method) { + if ($this->methodDoesNotExistOrIsDeclaredInTestCase($method)) { continue; } + $calledMethod = new Event\Code\ClassMethod( + $this->name, + $method, + ); + try { - call_user_func([$this->name, $afterClassMethod]); + call_user_func([$this->name, $method]); + } catch (Throwable $t) { + } - $methodCalledAfterLastTest = new Event\Code\ClassMethod( + $emitter->afterLastTestMethodCalled( + $this->name, + $calledMethod, + ); + + $calledMethods[] = $calledMethod; + + if (isset($t)) { + $emitter->afterLastTestMethodErrored( $this->name, - $afterClassMethod + $calledMethod, + Event\Code\ThrowableBuilder::from($t), ); - - $emitter->testAfterLastTestMethodCalled( - $this->name, - $methodCalledAfterLastTest - ); - - $methodsCalledAfterLastTest[] = $methodCalledAfterLastTest; - } catch (Throwable) { - // @todo } } - if (!empty($methodsCalledAfterLastTest)) { - $emitter->testAfterLastTestMethodFinished( + if (!empty($calledMethods)) { + $emitter->afterLastTestMethodFinished( $this->name, - ...$methodsCalledAfterLastTest + ...$calledMethods, ); } } diff --git a/vendor/phpunit/phpunit/src/Framework/TestSuiteIterator.php b/vendor/phpunit/phpunit/src/Framework/TestSuiteIterator.php index 5b783ba3..8af01218 100644 --- a/vendor/phpunit/phpunit/src/Framework/TestSuiteIterator.php +++ b/vendor/phpunit/phpunit/src/Framework/TestSuiteIterator.php @@ -16,6 +16,8 @@ use RecursiveIterator; /** * @template-implements RecursiveIterator * + * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit + * * @internal This class is not covered by the backward compatibility promise for PHPUnit */ final class TestSuiteIterator implements RecursiveIterator @@ -64,7 +66,7 @@ final class TestSuiteIterator implements RecursiveIterator { if (!$this->hasChildren()) { throw new NoChildTestSuiteException( - 'The current item is not a TestSuite instance and therefore does not have any children.' + 'The current item is not a TestSuite instance and therefore does not have any children.', ); } diff --git a/vendor/phpunit/phpunit/src/Logging/EventLogger.php b/vendor/phpunit/phpunit/src/Logging/EventLogger.php index 786907d7..08350213 100644 --- a/vendor/phpunit/phpunit/src/Logging/EventLogger.php +++ b/vendor/phpunit/phpunit/src/Logging/EventLogger.php @@ -12,15 +12,18 @@ namespace PHPUnit\Logging; use const FILE_APPEND; use const LOCK_EX; use const PHP_EOL; -use function explode; +use const PHP_OS_FAMILY; use function file_put_contents; use function implode; +use function preg_split; use function str_repeat; use function strlen; use PHPUnit\Event\Event; use PHPUnit\Event\Tracer\Tracer; /** + * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit + * * @internal This class is not covered by the backward compatibility promise for PHPUnit */ final class EventLogger implements Tracer @@ -38,12 +41,19 @@ final class EventLogger implements Tracer { $telemetryInfo = $this->telemetryInfo($event); $indentation = PHP_EOL . str_repeat(' ', strlen($telemetryInfo)); - $lines = explode(PHP_EOL, $event->asString()); + $lines = preg_split('/\r\n|\r|\n/', $event->asString()); + + $flags = FILE_APPEND; + + if (!(PHP_OS_FAMILY === 'Windows' || PHP_OS_FAMILY === 'Darwin') || + $this->path !== 'php://stdout') { + $flags |= LOCK_EX; + } file_put_contents( $this->path, $telemetryInfo . implode($indentation, $lines) . PHP_EOL, - FILE_APPEND | LOCK_EX + $flags, ); } diff --git a/vendor/phpunit/phpunit/src/Logging/Exception.php b/vendor/phpunit/phpunit/src/Logging/Exception.php deleted file mode 100644 index f2e4f8bc..00000000 --- a/vendor/phpunit/phpunit/src/Logging/Exception.php +++ /dev/null @@ -1,19 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace PHPUnit\Logging; - -use RuntimeException; - -/** - * @internal This class is not covered by the backward compatibility promise for PHPUnit - */ -final class Exception extends RuntimeException implements \PHPUnit\Exception -{ -} diff --git a/vendor/phpunit/phpunit/src/Logging/JUnit/JunitXmlLogger.php b/vendor/phpunit/phpunit/src/Logging/JUnit/JunitXmlLogger.php index 00f10984..8bd9ffe3 100644 --- a/vendor/phpunit/phpunit/src/Logging/JUnit/JunitXmlLogger.php +++ b/vendor/phpunit/phpunit/src/Logging/JUnit/JunitXmlLogger.php @@ -9,6 +9,7 @@ */ namespace PHPUnit\Logging\JUnit; +use const PHP_EOL; use function assert; use function basename; use function is_int; @@ -28,15 +29,18 @@ use PHPUnit\Event\Test\Errored; use PHPUnit\Event\Test\Failed; use PHPUnit\Event\Test\Finished; use PHPUnit\Event\Test\MarkedIncomplete; +use PHPUnit\Event\Test\PreparationStarted; use PHPUnit\Event\Test\Prepared; +use PHPUnit\Event\Test\PrintedUnexpectedOutput; use PHPUnit\Event\Test\Skipped; -use PHPUnit\Event\TestData\NoDataSetFromDataProviderException; use PHPUnit\Event\TestSuite\Started; use PHPUnit\Event\UnknownSubscriberTypeException; use PHPUnit\TextUI\Output\Printer; use PHPUnit\Util\Xml; /** + * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit + * * @internal This class is not covered by the backward compatibility promise for PHPUnit */ final class JunitXmlLogger @@ -83,16 +87,18 @@ final class JunitXmlLogger private ?DOMElement $currentTestCase = null; private ?HRTime $time = null; private bool $prepared = false; + private bool $preparationFailed = false; + private ?string $unexpectedOutput = null; /** * @throws EventFacadeIsSealedException * @throws UnknownSubscriberTypeException */ - public function __construct(Printer $printer) + public function __construct(Printer $printer, Facade $facade) { $this->printer = $printer; - $this->registerSubscribers(); + $this->registerSubscribers($facade); $this->createDocument(); } @@ -132,41 +138,41 @@ final class JunitXmlLogger { $this->testSuites[$this->testSuiteLevel]->setAttribute( 'tests', - (string) $this->testSuiteTests[$this->testSuiteLevel] + (string) $this->testSuiteTests[$this->testSuiteLevel], ); $this->testSuites[$this->testSuiteLevel]->setAttribute( 'assertions', - (string) $this->testSuiteAssertions[$this->testSuiteLevel] + (string) $this->testSuiteAssertions[$this->testSuiteLevel], ); $this->testSuites[$this->testSuiteLevel]->setAttribute( 'errors', - (string) $this->testSuiteErrors[$this->testSuiteLevel] + (string) $this->testSuiteErrors[$this->testSuiteLevel], ); $this->testSuites[$this->testSuiteLevel]->setAttribute( 'failures', - (string) $this->testSuiteFailures[$this->testSuiteLevel] + (string) $this->testSuiteFailures[$this->testSuiteLevel], ); $this->testSuites[$this->testSuiteLevel]->setAttribute( 'skipped', - (string) $this->testSuiteSkipped[$this->testSuiteLevel] + (string) $this->testSuiteSkipped[$this->testSuiteLevel], ); $this->testSuites[$this->testSuiteLevel]->setAttribute( 'time', - sprintf('%F', $this->testSuiteTimes[$this->testSuiteLevel]) + sprintf('%F', $this->testSuiteTimes[$this->testSuiteLevel]), ); if ($this->testSuiteLevel > 1) { - $this->testSuiteTests[$this->testSuiteLevel - 1] += $this->testSuiteTests[$this->testSuiteLevel]; + $this->testSuiteTests[$this->testSuiteLevel - 1] += $this->testSuiteTests[$this->testSuiteLevel]; $this->testSuiteAssertions[$this->testSuiteLevel - 1] += $this->testSuiteAssertions[$this->testSuiteLevel]; - $this->testSuiteErrors[$this->testSuiteLevel - 1] += $this->testSuiteErrors[$this->testSuiteLevel]; - $this->testSuiteFailures[$this->testSuiteLevel - 1] += $this->testSuiteFailures[$this->testSuiteLevel]; - $this->testSuiteSkipped[$this->testSuiteLevel - 1] += $this->testSuiteSkipped[$this->testSuiteLevel]; - $this->testSuiteTimes[$this->testSuiteLevel - 1] += $this->testSuiteTimes[$this->testSuiteLevel]; + $this->testSuiteErrors[$this->testSuiteLevel - 1] += $this->testSuiteErrors[$this->testSuiteLevel]; + $this->testSuiteFailures[$this->testSuiteLevel - 1] += $this->testSuiteFailures[$this->testSuiteLevel]; + $this->testSuiteSkipped[$this->testSuiteLevel - 1] += $this->testSuiteSkipped[$this->testSuiteLevel]; + $this->testSuiteTimes[$this->testSuiteLevel - 1] += $this->testSuiteTimes[$this->testSuiteLevel]; } $this->testSuiteLevel--; @@ -174,25 +180,47 @@ final class JunitXmlLogger /** * @throws InvalidArgumentException - * @throws NoDataSetFromDataProviderException */ - public function testPrepared(Prepared $event): void + public function testPreparationStarted(PreparationStarted $event): void { $this->createTestCase($event); + } + + /** + * @throws InvalidArgumentException + */ + public function testPreparationFailed(): void + { + $this->preparationFailed = true; + } + + /** + * @throws InvalidArgumentException + */ + public function testPrepared(): void + { $this->prepared = true; } + public function testPrintedUnexpectedOutput(PrintedUnexpectedOutput $event): void + { + $this->unexpectedOutput = $event->output(); + } + /** * @throws InvalidArgumentException */ public function testFinished(Finished $event): void { + if (!$this->prepared || $this->preparationFailed) { + return; + } + $this->handleFinish($event->telemetryInfo(), $event->numberOfAssertionsPerformed()); } /** * @throws InvalidArgumentException - * @throws NoDataSetFromDataProviderException */ public function testMarkedIncomplete(MarkedIncomplete $event): void { @@ -201,7 +229,6 @@ final class JunitXmlLogger /** * @throws InvalidArgumentException - * @throws NoDataSetFromDataProviderException */ public function testSkipped(Skipped $event): void { @@ -210,7 +237,6 @@ final class JunitXmlLogger /** * @throws InvalidArgumentException - * @throws NoDataSetFromDataProviderException */ public function testErrored(Errored $event): void { @@ -221,7 +247,6 @@ final class JunitXmlLogger /** * @throws InvalidArgumentException - * @throws NoDataSetFromDataProviderException */ public function testFailed(Failed $event): void { @@ -244,36 +269,49 @@ final class JunitXmlLogger $this->currentTestCase->setAttribute( 'assertions', - (string) $numberOfAssertionsPerformed + (string) $numberOfAssertionsPerformed, ); $this->currentTestCase->setAttribute( 'time', - sprintf('%F', $time) + sprintf('%F', $time), ); + if ($this->unexpectedOutput !== null) { + $systemOut = $this->document->createElement( + 'system-out', + Xml::prepareString($this->unexpectedOutput), + ); + + $this->currentTestCase->appendChild($systemOut); + } + $this->testSuites[$this->testSuiteLevel]->appendChild( - $this->currentTestCase + $this->currentTestCase, ); $this->testSuiteTests[$this->testSuiteLevel]++; $this->testSuiteTimes[$this->testSuiteLevel] += $time; - $this->currentTestCase = null; - $this->time = null; - $this->prepared = false; + $this->currentTestCase = null; + $this->time = null; + $this->prepared = false; + $this->unexpectedOutput = null; } /** * @throws EventFacadeIsSealedException * @throws UnknownSubscriberTypeException */ - private function registerSubscribers(): void + private function registerSubscribers(Facade $facade): void { - Facade::registerSubscribers( + $facade->registerSubscribers( new TestSuiteStartedSubscriber($this), new TestSuiteFinishedSubscriber($this), + new TestPreparationStartedSubscriber($this), + new TestPreparationFailedSubscriber($this), new TestPreparedSubscriber($this), + new TestPrintedUnexpectedOutputSubscriber($this), new TestFinishedSubscriber($this), new TestErroredSubscriber($this), new TestFailedSubscriber($this), @@ -294,7 +332,6 @@ final class JunitXmlLogger /** * @throws InvalidArgumentException - * @throws NoDataSetFromDataProviderException */ private function handleFault(Errored|Failed $event, string $type): void { @@ -309,12 +346,12 @@ final class JunitXmlLogger $throwable = $event->throwable(); $buffer .= trim( $throwable->description() . PHP_EOL . - $throwable->stackTrace() + $throwable->stackTrace(), ); $fault = $this->document->createElement( $type, - Xml::prepareString($buffer) + Xml::prepareString($buffer), ); $fault->setAttribute('type', $throwable->className()); @@ -328,7 +365,6 @@ final class JunitXmlLogger /** * @throws InvalidArgumentException - * @throws NoDataSetFromDataProviderException */ private function handleIncompleteOrSkipped(MarkedIncomplete|Skipped $event): void { @@ -351,7 +387,6 @@ final class JunitXmlLogger /** * @throws InvalidArgumentException - * @throws NoDataSetFromDataProviderException */ private function testAsString(Test $test): string { @@ -371,7 +406,6 @@ final class JunitXmlLogger /** * @throws InvalidArgumentException - * @throws NoDataSetFromDataProviderException */ private function name(Test $test): string { @@ -391,24 +425,23 @@ final class JunitXmlLogger return sprintf( '%s with data set #%d', $test->methodName(), - $dataSetName + $dataSetName, ); } return sprintf( '%s with data set "%s"', $test->methodName(), - $dataSetName + $dataSetName, ); } /** * @throws InvalidArgumentException - * @throws NoDataSetFromDataProviderException * * @psalm-assert !null $this->currentTestCase */ - private function createTestCase(Prepared|MarkedIncomplete|Skipped|Errored|Failed $event): void + private function createTestCase(Errored|Failed|MarkedIncomplete|PreparationStarted|Prepared|Skipped $event): void { $testCase = $this->document->createElement('testcase'); diff --git a/vendor/phpunit/phpunit/src/Logging/JUnit/Subscriber/Subscriber.php b/vendor/phpunit/phpunit/src/Logging/JUnit/Subscriber/Subscriber.php index c3a7c624..7067461e 100644 --- a/vendor/phpunit/phpunit/src/Logging/JUnit/Subscriber/Subscriber.php +++ b/vendor/phpunit/phpunit/src/Logging/JUnit/Subscriber/Subscriber.php @@ -10,6 +10,8 @@ namespace PHPUnit\Logging\JUnit; /** + * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit + * * @internal This class is not covered by the backward compatibility promise for PHPUnit */ abstract class Subscriber diff --git a/vendor/phpunit/phpunit/src/Logging/JUnit/Subscriber/TestErroredSubscriber.php b/vendor/phpunit/phpunit/src/Logging/JUnit/Subscriber/TestErroredSubscriber.php index a7127525..1c5ca7be 100644 --- a/vendor/phpunit/phpunit/src/Logging/JUnit/Subscriber/TestErroredSubscriber.php +++ b/vendor/phpunit/phpunit/src/Logging/JUnit/Subscriber/TestErroredSubscriber.php @@ -12,16 +12,16 @@ namespace PHPUnit\Logging\JUnit; use PHPUnit\Event\InvalidArgumentException; use PHPUnit\Event\Test\Errored; use PHPUnit\Event\Test\ErroredSubscriber; -use PHPUnit\Event\TestData\NoDataSetFromDataProviderException; /** + * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit + * * @internal This class is not covered by the backward compatibility promise for PHPUnit */ final class TestErroredSubscriber extends Subscriber implements ErroredSubscriber { /** * @throws InvalidArgumentException - * @throws NoDataSetFromDataProviderException */ public function notify(Errored $event): void { diff --git a/vendor/phpunit/phpunit/src/Logging/JUnit/Subscriber/TestFailedSubscriber.php b/vendor/phpunit/phpunit/src/Logging/JUnit/Subscriber/TestFailedSubscriber.php index 6876fa65..286012ae 100644 --- a/vendor/phpunit/phpunit/src/Logging/JUnit/Subscriber/TestFailedSubscriber.php +++ b/vendor/phpunit/phpunit/src/Logging/JUnit/Subscriber/TestFailedSubscriber.php @@ -12,16 +12,16 @@ namespace PHPUnit\Logging\JUnit; use PHPUnit\Event\InvalidArgumentException; use PHPUnit\Event\Test\Failed; use PHPUnit\Event\Test\FailedSubscriber; -use PHPUnit\Event\TestData\NoDataSetFromDataProviderException; /** + * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit + * * @internal This class is not covered by the backward compatibility promise for PHPUnit */ final class TestFailedSubscriber extends Subscriber implements FailedSubscriber { /** * @throws InvalidArgumentException - * @throws NoDataSetFromDataProviderException */ public function notify(Failed $event): void { diff --git a/vendor/phpunit/phpunit/src/Logging/JUnit/Subscriber/TestFinishedSubscriber.php b/vendor/phpunit/phpunit/src/Logging/JUnit/Subscriber/TestFinishedSubscriber.php index 75390707..3f3ecac1 100644 --- a/vendor/phpunit/phpunit/src/Logging/JUnit/Subscriber/TestFinishedSubscriber.php +++ b/vendor/phpunit/phpunit/src/Logging/JUnit/Subscriber/TestFinishedSubscriber.php @@ -12,16 +12,16 @@ namespace PHPUnit\Logging\JUnit; use PHPUnit\Event\InvalidArgumentException; use PHPUnit\Event\Test\Finished; use PHPUnit\Event\Test\FinishedSubscriber; -use PHPUnit\Event\TestData\NoDataSetFromDataProviderException; /** + * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit + * * @internal This class is not covered by the backward compatibility promise for PHPUnit */ final class TestFinishedSubscriber extends Subscriber implements FinishedSubscriber { /** * @throws InvalidArgumentException - * @throws NoDataSetFromDataProviderException */ public function notify(Finished $event): void { diff --git a/vendor/phpunit/phpunit/src/Logging/JUnit/Subscriber/TestMarkedIncompleteSubscriber.php b/vendor/phpunit/phpunit/src/Logging/JUnit/Subscriber/TestMarkedIncompleteSubscriber.php index 9517b3e7..5354427e 100644 --- a/vendor/phpunit/phpunit/src/Logging/JUnit/Subscriber/TestMarkedIncompleteSubscriber.php +++ b/vendor/phpunit/phpunit/src/Logging/JUnit/Subscriber/TestMarkedIncompleteSubscriber.php @@ -12,16 +12,16 @@ namespace PHPUnit\Logging\JUnit; use PHPUnit\Event\InvalidArgumentException; use PHPUnit\Event\Test\MarkedIncomplete; use PHPUnit\Event\Test\MarkedIncompleteSubscriber; -use PHPUnit\Event\TestData\NoDataSetFromDataProviderException; /** + * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit + * * @internal This class is not covered by the backward compatibility promise for PHPUnit */ final class TestMarkedIncompleteSubscriber extends Subscriber implements MarkedIncompleteSubscriber { /** * @throws InvalidArgumentException - * @throws NoDataSetFromDataProviderException */ public function notify(MarkedIncomplete $event): void { diff --git a/vendor/phpunit/phpunit/src/Logging/JUnit/Subscriber/TestPreparedSubscriber.php b/vendor/phpunit/phpunit/src/Logging/JUnit/Subscriber/TestPreparedSubscriber.php index 98027dc9..d3de506b 100644 --- a/vendor/phpunit/phpunit/src/Logging/JUnit/Subscriber/TestPreparedSubscriber.php +++ b/vendor/phpunit/phpunit/src/Logging/JUnit/Subscriber/TestPreparedSubscriber.php @@ -12,19 +12,19 @@ namespace PHPUnit\Logging\JUnit; use PHPUnit\Event\InvalidArgumentException; use PHPUnit\Event\Test\Prepared; use PHPUnit\Event\Test\PreparedSubscriber; -use PHPUnit\Event\TestData\NoDataSetFromDataProviderException; /** + * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit + * * @internal This class is not covered by the backward compatibility promise for PHPUnit */ final class TestPreparedSubscriber extends Subscriber implements PreparedSubscriber { /** * @throws InvalidArgumentException - * @throws NoDataSetFromDataProviderException */ public function notify(Prepared $event): void { - $this->logger()->testPrepared($event); + $this->logger()->testPrepared(); } } diff --git a/vendor/phpunit/phpunit/src/Logging/JUnit/Subscriber/TestRunnerExecutionFinishedSubscriber.php b/vendor/phpunit/phpunit/src/Logging/JUnit/Subscriber/TestRunnerExecutionFinishedSubscriber.php index 148ff237..b544b04f 100644 --- a/vendor/phpunit/phpunit/src/Logging/JUnit/Subscriber/TestRunnerExecutionFinishedSubscriber.php +++ b/vendor/phpunit/phpunit/src/Logging/JUnit/Subscriber/TestRunnerExecutionFinishedSubscriber.php @@ -13,6 +13,8 @@ use PHPUnit\Event\TestRunner\ExecutionFinished; use PHPUnit\Event\TestRunner\ExecutionFinishedSubscriber; /** + * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit + * * @internal This class is not covered by the backward compatibility promise for PHPUnit */ final class TestRunnerExecutionFinishedSubscriber extends Subscriber implements ExecutionFinishedSubscriber diff --git a/vendor/phpunit/phpunit/src/Logging/JUnit/Subscriber/TestSkippedSubscriber.php b/vendor/phpunit/phpunit/src/Logging/JUnit/Subscriber/TestSkippedSubscriber.php index 90df5c04..383b89db 100644 --- a/vendor/phpunit/phpunit/src/Logging/JUnit/Subscriber/TestSkippedSubscriber.php +++ b/vendor/phpunit/phpunit/src/Logging/JUnit/Subscriber/TestSkippedSubscriber.php @@ -12,16 +12,16 @@ namespace PHPUnit\Logging\JUnit; use PHPUnit\Event\InvalidArgumentException; use PHPUnit\Event\Test\Skipped; use PHPUnit\Event\Test\SkippedSubscriber; -use PHPUnit\Event\TestData\NoDataSetFromDataProviderException; /** + * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit + * * @internal This class is not covered by the backward compatibility promise for PHPUnit */ final class TestSkippedSubscriber extends Subscriber implements SkippedSubscriber { /** * @throws InvalidArgumentException - * @throws NoDataSetFromDataProviderException */ public function notify(Skipped $event): void { diff --git a/vendor/phpunit/phpunit/src/Logging/JUnit/Subscriber/TestSuiteFinishedSubscriber.php b/vendor/phpunit/phpunit/src/Logging/JUnit/Subscriber/TestSuiteFinishedSubscriber.php index 26e1981f..122f4aa7 100644 --- a/vendor/phpunit/phpunit/src/Logging/JUnit/Subscriber/TestSuiteFinishedSubscriber.php +++ b/vendor/phpunit/phpunit/src/Logging/JUnit/Subscriber/TestSuiteFinishedSubscriber.php @@ -13,6 +13,8 @@ use PHPUnit\Event\TestSuite\Finished; use PHPUnit\Event\TestSuite\FinishedSubscriber; /** + * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit + * * @internal This class is not covered by the backward compatibility promise for PHPUnit */ final class TestSuiteFinishedSubscriber extends Subscriber implements FinishedSubscriber diff --git a/vendor/phpunit/phpunit/src/Logging/JUnit/Subscriber/TestSuiteStartedSubscriber.php b/vendor/phpunit/phpunit/src/Logging/JUnit/Subscriber/TestSuiteStartedSubscriber.php index dfec98b4..c213d774 100644 --- a/vendor/phpunit/phpunit/src/Logging/JUnit/Subscriber/TestSuiteStartedSubscriber.php +++ b/vendor/phpunit/phpunit/src/Logging/JUnit/Subscriber/TestSuiteStartedSubscriber.php @@ -13,6 +13,8 @@ use PHPUnit\Event\TestSuite\Started; use PHPUnit\Event\TestSuite\StartedSubscriber; /** + * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit + * * @internal This class is not covered by the backward compatibility promise for PHPUnit */ final class TestSuiteStartedSubscriber extends Subscriber implements StartedSubscriber diff --git a/vendor/phpunit/phpunit/src/Logging/TeamCity/Subscriber/Subscriber.php b/vendor/phpunit/phpunit/src/Logging/TeamCity/Subscriber/Subscriber.php index a2428962..ae72b8b4 100644 --- a/vendor/phpunit/phpunit/src/Logging/TeamCity/Subscriber/Subscriber.php +++ b/vendor/phpunit/phpunit/src/Logging/TeamCity/Subscriber/Subscriber.php @@ -10,6 +10,8 @@ namespace PHPUnit\Logging\TeamCity; /** + * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit + * * @internal This class is not covered by the backward compatibility promise for PHPUnit */ abstract class Subscriber diff --git a/vendor/phpunit/phpunit/src/Logging/TeamCity/Subscriber/TestConsideredRiskySubscriber.php b/vendor/phpunit/phpunit/src/Logging/TeamCity/Subscriber/TestConsideredRiskySubscriber.php index 431d1b28..ab266347 100644 --- a/vendor/phpunit/phpunit/src/Logging/TeamCity/Subscriber/TestConsideredRiskySubscriber.php +++ b/vendor/phpunit/phpunit/src/Logging/TeamCity/Subscriber/TestConsideredRiskySubscriber.php @@ -14,6 +14,8 @@ use PHPUnit\Event\Test\ConsideredRisky; use PHPUnit\Event\Test\ConsideredRiskySubscriber; /** + * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit + * * @internal This class is not covered by the backward compatibility promise for PHPUnit */ final class TestConsideredRiskySubscriber extends Subscriber implements ConsideredRiskySubscriber diff --git a/vendor/phpunit/phpunit/src/Logging/TeamCity/Subscriber/TestErroredSubscriber.php b/vendor/phpunit/phpunit/src/Logging/TeamCity/Subscriber/TestErroredSubscriber.php index 318534a4..2c4141b4 100644 --- a/vendor/phpunit/phpunit/src/Logging/TeamCity/Subscriber/TestErroredSubscriber.php +++ b/vendor/phpunit/phpunit/src/Logging/TeamCity/Subscriber/TestErroredSubscriber.php @@ -14,6 +14,8 @@ use PHPUnit\Event\Test\Errored; use PHPUnit\Event\Test\ErroredSubscriber; /** + * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit + * * @internal This class is not covered by the backward compatibility promise for PHPUnit */ final class TestErroredSubscriber extends Subscriber implements ErroredSubscriber diff --git a/vendor/phpunit/phpunit/src/Logging/TeamCity/Subscriber/TestFailedSubscriber.php b/vendor/phpunit/phpunit/src/Logging/TeamCity/Subscriber/TestFailedSubscriber.php index 1ada154a..248cc1b5 100644 --- a/vendor/phpunit/phpunit/src/Logging/TeamCity/Subscriber/TestFailedSubscriber.php +++ b/vendor/phpunit/phpunit/src/Logging/TeamCity/Subscriber/TestFailedSubscriber.php @@ -14,6 +14,8 @@ use PHPUnit\Event\Test\Failed; use PHPUnit\Event\Test\FailedSubscriber; /** + * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit + * * @internal This class is not covered by the backward compatibility promise for PHPUnit */ final class TestFailedSubscriber extends Subscriber implements FailedSubscriber diff --git a/vendor/phpunit/phpunit/src/Logging/TeamCity/Subscriber/TestFinishedSubscriber.php b/vendor/phpunit/phpunit/src/Logging/TeamCity/Subscriber/TestFinishedSubscriber.php index 22ba518f..82eaab66 100644 --- a/vendor/phpunit/phpunit/src/Logging/TeamCity/Subscriber/TestFinishedSubscriber.php +++ b/vendor/phpunit/phpunit/src/Logging/TeamCity/Subscriber/TestFinishedSubscriber.php @@ -14,6 +14,8 @@ use PHPUnit\Event\Test\Finished; use PHPUnit\Event\Test\FinishedSubscriber; /** + * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit + * * @internal This class is not covered by the backward compatibility promise for PHPUnit */ final class TestFinishedSubscriber extends Subscriber implements FinishedSubscriber diff --git a/vendor/phpunit/phpunit/src/Logging/TeamCity/Subscriber/TestMarkedIncompleteSubscriber.php b/vendor/phpunit/phpunit/src/Logging/TeamCity/Subscriber/TestMarkedIncompleteSubscriber.php index c3505f16..d0cb9214 100644 --- a/vendor/phpunit/phpunit/src/Logging/TeamCity/Subscriber/TestMarkedIncompleteSubscriber.php +++ b/vendor/phpunit/phpunit/src/Logging/TeamCity/Subscriber/TestMarkedIncompleteSubscriber.php @@ -14,6 +14,8 @@ use PHPUnit\Event\Test\MarkedIncomplete; use PHPUnit\Event\Test\MarkedIncompleteSubscriber; /** + * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit + * * @internal This class is not covered by the backward compatibility promise for PHPUnit */ final class TestMarkedIncompleteSubscriber extends Subscriber implements MarkedIncompleteSubscriber diff --git a/vendor/phpunit/phpunit/src/Logging/TeamCity/Subscriber/TestPreparedSubscriber.php b/vendor/phpunit/phpunit/src/Logging/TeamCity/Subscriber/TestPreparedSubscriber.php index c1bb537e..34e92007 100644 --- a/vendor/phpunit/phpunit/src/Logging/TeamCity/Subscriber/TestPreparedSubscriber.php +++ b/vendor/phpunit/phpunit/src/Logging/TeamCity/Subscriber/TestPreparedSubscriber.php @@ -13,6 +13,8 @@ use PHPUnit\Event\Test\Prepared; use PHPUnit\Event\Test\PreparedSubscriber; /** + * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit + * * @internal This class is not covered by the backward compatibility promise for PHPUnit */ final class TestPreparedSubscriber extends Subscriber implements PreparedSubscriber diff --git a/vendor/phpunit/phpunit/src/Logging/TeamCity/Subscriber/TestRunnerExecutionFinishedSubscriber.php b/vendor/phpunit/phpunit/src/Logging/TeamCity/Subscriber/TestRunnerExecutionFinishedSubscriber.php index ccec88d9..e87aa21d 100644 --- a/vendor/phpunit/phpunit/src/Logging/TeamCity/Subscriber/TestRunnerExecutionFinishedSubscriber.php +++ b/vendor/phpunit/phpunit/src/Logging/TeamCity/Subscriber/TestRunnerExecutionFinishedSubscriber.php @@ -13,6 +13,8 @@ use PHPUnit\Event\TestRunner\ExecutionFinished; use PHPUnit\Event\TestRunner\ExecutionFinishedSubscriber; /** + * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit + * * @internal This class is not covered by the backward compatibility promise for PHPUnit */ final class TestRunnerExecutionFinishedSubscriber extends Subscriber implements ExecutionFinishedSubscriber diff --git a/vendor/phpunit/phpunit/src/Logging/TeamCity/Subscriber/TestSkippedSubscriber.php b/vendor/phpunit/phpunit/src/Logging/TeamCity/Subscriber/TestSkippedSubscriber.php index e6ef6ae9..17951c36 100644 --- a/vendor/phpunit/phpunit/src/Logging/TeamCity/Subscriber/TestSkippedSubscriber.php +++ b/vendor/phpunit/phpunit/src/Logging/TeamCity/Subscriber/TestSkippedSubscriber.php @@ -14,6 +14,8 @@ use PHPUnit\Event\Test\Skipped; use PHPUnit\Event\Test\SkippedSubscriber; /** + * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit + * * @internal This class is not covered by the backward compatibility promise for PHPUnit */ final class TestSkippedSubscriber extends Subscriber implements SkippedSubscriber diff --git a/vendor/phpunit/phpunit/src/Logging/TeamCity/Subscriber/TestSuiteFinishedSubscriber.php b/vendor/phpunit/phpunit/src/Logging/TeamCity/Subscriber/TestSuiteFinishedSubscriber.php index d8e73e43..ff96fb22 100644 --- a/vendor/phpunit/phpunit/src/Logging/TeamCity/Subscriber/TestSuiteFinishedSubscriber.php +++ b/vendor/phpunit/phpunit/src/Logging/TeamCity/Subscriber/TestSuiteFinishedSubscriber.php @@ -13,6 +13,8 @@ use PHPUnit\Event\TestSuite\Finished; use PHPUnit\Event\TestSuite\FinishedSubscriber; /** + * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit + * * @internal This class is not covered by the backward compatibility promise for PHPUnit */ final class TestSuiteFinishedSubscriber extends Subscriber implements FinishedSubscriber diff --git a/vendor/phpunit/phpunit/src/Logging/TeamCity/Subscriber/TestSuiteStartedSubscriber.php b/vendor/phpunit/phpunit/src/Logging/TeamCity/Subscriber/TestSuiteStartedSubscriber.php index 2eb76478..6bebe6a7 100644 --- a/vendor/phpunit/phpunit/src/Logging/TeamCity/Subscriber/TestSuiteStartedSubscriber.php +++ b/vendor/phpunit/phpunit/src/Logging/TeamCity/Subscriber/TestSuiteStartedSubscriber.php @@ -13,6 +13,8 @@ use PHPUnit\Event\TestSuite\Started; use PHPUnit\Event\TestSuite\StartedSubscriber; /** + * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit + * * @internal This class is not covered by the backward compatibility promise for PHPUnit */ final class TestSuiteStartedSubscriber extends Subscriber implements StartedSubscriber diff --git a/vendor/phpunit/phpunit/src/Logging/TeamCity/TeamCityLogger.php b/vendor/phpunit/phpunit/src/Logging/TeamCity/TeamCityLogger.php index b37a99d8..47600a12 100644 --- a/vendor/phpunit/phpunit/src/Logging/TeamCity/TeamCityLogger.php +++ b/vendor/phpunit/phpunit/src/Logging/TeamCity/TeamCityLogger.php @@ -24,6 +24,7 @@ use PHPUnit\Event\EventFacadeIsSealedException; use PHPUnit\Event\Facade; use PHPUnit\Event\InvalidArgumentException; use PHPUnit\Event\Telemetry\HRTime; +use PHPUnit\Event\Test\BeforeFirstTestMethodErrored; use PHPUnit\Event\Test\ConsideredRisky; use PHPUnit\Event\Test\Errored; use PHPUnit\Event\Test\Failed; @@ -32,6 +33,7 @@ use PHPUnit\Event\Test\MarkedIncomplete; use PHPUnit\Event\Test\Prepared; use PHPUnit\Event\Test\Skipped; use PHPUnit\Event\TestSuite\Finished as TestSuiteFinished; +use PHPUnit\Event\TestSuite\Skipped as TestSuiteSkipped; use PHPUnit\Event\TestSuite\Started as TestSuiteStarted; use PHPUnit\Event\TestSuite\TestSuiteForTestClass; use PHPUnit\Event\TestSuite\TestSuiteForTestMethodWithDataProvider; @@ -40,6 +42,8 @@ use PHPUnit\Framework\Exception as FrameworkException; use PHPUnit\TextUI\Output\Printer; /** + * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit + * * @internal This class is not covered by the backward compatibility promise for PHPUnit */ final class TeamCityLogger @@ -53,11 +57,11 @@ final class TeamCityLogger * @throws EventFacadeIsSealedException * @throws UnknownSubscriberTypeException */ - public function __construct(Printer $printer) + public function __construct(Printer $printer, Facade $facade) { $this->printer = $printer; - $this->registerSubscribers(); + $this->registerSubscribers($facade); $this->setFlowId(); } @@ -70,14 +74,10 @@ final class TeamCityLogger $this->writeMessage( 'testCount', - ['count' => $testSuite->count()] + ['count' => $testSuite->count()], ); } - if ($testSuite->isWithName() && $testSuite->name() === '') { - return; - } - $parameters = ['name' => $testSuite->name()]; if ($testSuite->isForTestClass()) { @@ -86,7 +86,7 @@ final class TeamCityLogger $parameters['locationHint'] = sprintf( 'php_qn://%s::\\%s', $testSuite->file(), - $testSuite->name() + $testSuite->name(), ); } elseif ($testSuite->isForTestMethodWithDataProvider()) { assert($testSuite instanceof TestSuiteForTestMethodWithDataProvider); @@ -94,7 +94,7 @@ final class TeamCityLogger $parameters['locationHint'] = sprintf( 'php_qn://%s::\\%s', $testSuite->file(), - $testSuite->name() + $testSuite->name(), ); $parameters['name'] = $testSuite->methodName(); @@ -107,10 +107,6 @@ final class TeamCityLogger { $testSuite = $event->testSuite(); - if ($testSuite->isWithName() && $testSuite->name() === '') { - return; - } - $parameters = ['name' => $testSuite->name()]; if ($testSuite->isForTestMethodWithDataProvider()) { @@ -137,7 +133,7 @@ final class TeamCityLogger 'php_qn://%s::\\%s::%s', $test->file(), $test->className(), - $test->methodName() + $test->name(), ); } @@ -152,7 +148,9 @@ final class TeamCityLogger public function testMarkedIncomplete(MarkedIncomplete $event): void { if ($this->time === null) { + // @codeCoverageIgnoreStart $this->time = $event->telemetryInfo()->time(); + // @codeCoverageIgnoreEnd } $this->writeMessage( @@ -162,7 +160,7 @@ final class TeamCityLogger 'message' => $event->throwable()->message(), 'details' => $this->details($event->throwable()), 'duration' => $this->duration($event), - ] + ], ); } @@ -185,6 +183,46 @@ final class TeamCityLogger $this->writeMessage('testIgnored', $parameters); } + /** + * @throws InvalidArgumentException + */ + public function testSuiteSkipped(TestSuiteSkipped $event): void + { + if ($this->time === null) { + $this->time = $event->telemetryInfo()->time(); + } + + $parameters = [ + 'name' => $event->testSuite()->name(), + 'message' => $event->message(), + ]; + + $parameters['duration'] = $this->duration($event); + + $this->writeMessage('testIgnored', $parameters); + $this->writeMessage('testSuiteFinished', $parameters); + } + + /** + * @throws InvalidArgumentException + */ + public function beforeFirstTestMethodErrored(BeforeFirstTestMethodErrored $event): void + { + if ($this->time === null) { + $this->time = $event->telemetryInfo()->time(); + } + + $parameters = [ + 'name' => $event->testClassName(), + 'message' => $this->message($event->throwable()), + 'details' => $this->details($event->throwable()), + 'duration' => $this->duration($event), + ]; + + $this->writeMessage('testFailed', $parameters); + $this->writeMessage('testSuiteFinished', $parameters); + } + /** * @throws InvalidArgumentException */ @@ -201,7 +239,7 @@ final class TeamCityLogger 'message' => $this->message($event->throwable()), 'details' => $this->details($event->throwable()), 'duration' => $this->duration($event), - ] + ], ); } @@ -211,7 +249,9 @@ final class TeamCityLogger public function testFailed(Failed $event): void { if ($this->time === null) { + // @codeCoverageIgnoreStart $this->time = $event->telemetryInfo()->time(); + // @codeCoverageIgnoreEnd } $parameters = [ @@ -236,7 +276,9 @@ final class TeamCityLogger public function testConsideredRisky(ConsideredRisky $event): void { if ($this->time === null) { + // @codeCoverageIgnoreStart $this->time = $event->telemetryInfo()->time(); + // @codeCoverageIgnoreEnd } $this->writeMessage( @@ -246,7 +288,7 @@ final class TeamCityLogger 'message' => $event->message(), 'details' => '', 'duration' => $this->duration($event), - ] + ], ); } @@ -260,7 +302,7 @@ final class TeamCityLogger [ 'name' => $event->test()->name(), 'duration' => $this->duration($event), - ] + ], ); $this->time = null; @@ -275,9 +317,9 @@ final class TeamCityLogger * @throws EventFacadeIsSealedException * @throws UnknownSubscriberTypeException */ - private function registerSubscribers(): void + private function registerSubscribers(Facade $facade): void { - Facade::registerSubscribers( + $facade->registerSubscribers( new TestSuiteStartedSubscriber($this), new TestSuiteFinishedSubscriber($this), new TestPreparedSubscriber($this), @@ -286,8 +328,10 @@ final class TeamCityLogger new TestFailedSubscriber($this), new TestMarkedIncompleteSubscriber($this), new TestSkippedSubscriber($this), + new TestSuiteSkippedSubscriber($this), new TestConsideredRiskySubscriber($this), new TestRunnerExecutionFinishedSubscriber($this), + new TestSuiteBeforeFirstTestMethodErroredSubscriber($this), ); } @@ -302,9 +346,9 @@ final class TeamCityLogger { $this->printer->print( sprintf( - "\n##teamcity[%s", - $eventName - ) + '##teamcity[%s', + $eventName, + ), ); if ($this->flowId !== null) { @@ -316,8 +360,8 @@ final class TeamCityLogger sprintf( " %s='%s'", $key, - $this->escape((string) $value) - ) + $this->escape((string) $value), + ), ); } @@ -330,7 +374,9 @@ final class TeamCityLogger private function duration(Event $event): int { if ($this->time === null) { + // @codeCoverageIgnoreStart return 0; + // @codeCoverageIgnoreEnd } return (int) round($event->telemetryInfo()->time()->duration($this->time)->asFloat() * 1000); @@ -341,7 +387,7 @@ final class TeamCityLogger return str_replace( ['|', "'", "\n", "\r", ']', '['], ['||', "|'", '|n', '|r', '|]', '|['], - $string + $string, ); } @@ -370,7 +416,7 @@ final class TeamCityLogger $buffer .= sprintf( "\nCaused by\n%s\n%s", $throwable->description(), - $throwable->stackTrace() + $throwable->stackTrace(), ); } diff --git a/vendor/phpunit/phpunit/src/Logging/TestDox/HtmlRenderer.php b/vendor/phpunit/phpunit/src/Logging/TestDox/HtmlRenderer.php index f067ee8f..35bc243e 100644 --- a/vendor/phpunit/phpunit/src/Logging/TestDox/HtmlRenderer.php +++ b/vendor/phpunit/phpunit/src/Logging/TestDox/HtmlRenderer.php @@ -12,6 +12,8 @@ namespace PHPUnit\Logging\TestDox; use function sprintf; /** + * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit + * * @internal This class is not covered by the backward compatibility promise for PHPUnit */ final class HtmlRenderer @@ -111,14 +113,14 @@ EOT; foreach ($tests as $prettifiedClassName => $_tests) { $buffer .= sprintf( self::CLASS_HEADER, - $prettifiedClassName + $prettifiedClassName, ); foreach ($this->reduce($_tests) as $prettifiedMethodName => $outcome) { $buffer .= sprintf( "
  • %s
  • \n", $outcome, - $prettifiedMethodName + $prettifiedMethodName, ); } diff --git a/vendor/phpunit/phpunit/src/Logging/TestDox/NamePrettifier.php b/vendor/phpunit/phpunit/src/Logging/TestDox/NamePrettifier.php index 5e4bcdb9..7b229fc1 100644 --- a/vendor/phpunit/phpunit/src/Logging/TestDox/NamePrettifier.php +++ b/vendor/phpunit/phpunit/src/Logging/TestDox/NamePrettifier.php @@ -19,18 +19,15 @@ use function class_exists; use function explode; use function gettype; use function implode; -use function in_array; use function is_bool; use function is_float; use function is_int; -use function is_numeric; use function is_object; use function is_scalar; use function method_exists; -use function ord; use function preg_quote; use function preg_replace; -use function range; +use function rtrim; use function sprintf; use function str_contains; use function str_ends_with; @@ -45,17 +42,20 @@ use PHPUnit\Framework\TestCase; use PHPUnit\Metadata\Parser\Registry as MetadataRegistry; use PHPUnit\Metadata\TestDox; use PHPUnit\Util\Color; +use ReflectionEnum; use ReflectionMethod; use ReflectionObject; use SebastianBergmann\Exporter\Exporter; /** + * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit + * * @internal This class is not covered by the backward compatibility promise for PHPUnit */ final class NamePrettifier { /** - * @psalm-var list + * @psalm-var array */ private static array $strings = []; @@ -109,20 +109,19 @@ final class NamePrettifier return $result; } + // NOTE: this method is on a hot path and very performance sensitive. change with care. public function prettifyTestMethodName(string $name): string { - $buffer = ''; - if ($name === '') { - return $buffer; + return ''; } - $string = (string) preg_replace('#\d+$#', '', $name, -1, $count); + $string = rtrim($name, '0123456789'); - if (in_array($string, self::$strings, true)) { + if (array_key_exists($string, self::$strings)) { $name = $string; - } elseif ($count === 0) { - self::$strings[] = $string; + } elseif ($string === $name) { + self::$strings[$string] = 1; } if (str_starts_with($name, 'test_')) { @@ -132,22 +131,28 @@ final class NamePrettifier } if ($name === '') { - return $buffer; + return ''; } $name[0] = strtoupper($name[0]); - if (str_contains($name, '_')) { - return trim(str_replace('_', ' ', $name)); + $noUnderscore = str_replace('_', ' ', $name); + + if ($noUnderscore !== $name) { + return trim($noUnderscore); } $wasNumeric = false; - foreach (range(0, strlen($name) - 1) as $i) { - if ($i > 0 && ord($name[$i]) >= 65 && ord($name[$i]) <= 90) { + $buffer = ''; + + $len = strlen($name); + + for ($i = 0; $i < $len; $i++) { + if ($i > 0 && $name[$i] >= 'A' && $name[$i] <= 'Z') { $buffer .= ' ' . strtolower($name[$i]); } else { - $isNumeric = is_numeric($name[$i]); + $isNumeric = $name[$i] >= '0' && $name[$i] <= '9'; if (!$wasNumeric && $isNumeric) { $buffer .= ' '; @@ -184,12 +189,12 @@ final class NamePrettifier $variables = array_map( static fn (string $variable): string => sprintf( '/%s(?=\b)/', - preg_quote($variable, '/') + preg_quote($variable, '/'), ), - array_keys($providedData) + array_keys($providedData), ); - $result = trim(preg_replace($variables, $providedData, $annotation)); + $result = preg_replace($variables, $providedData, $annotation); $annotationWithPlaceholders = true; } @@ -238,19 +243,15 @@ final class NamePrettifier $value = $providedDataValues[$i++] ?? null; if (is_object($value)) { - $reflector = new ReflectionObject($value); - - if ($reflector->isEnum()) { - $value = $value->value; - } elseif ($reflector->hasMethod('__toString')) { - $value = (string) $value; - } else { - $value = $value::class; - } + $value = $this->objectToString($value); } if (!is_scalar($value)) { $value = gettype($value); + + if ($value === 'NULL') { + $value = 'null'; + } } if (is_bool($value) || is_int($value) || is_float($value)) { @@ -265,13 +266,40 @@ final class NamePrettifier } } - $providedData['$' . $parameter->getName()] = $value; + $providedData['$' . $parameter->getName()] = str_replace('$', '\\$', $value); } if ($colorize) { - $providedData = array_map(static fn ($value) => Color::colorize('fg-cyan', Color::visualizeWhitespace((string) $value, true)), $providedData); + $providedData = array_map( + static fn ($value) => Color::colorize('fg-cyan', Color::visualizeWhitespace((string) $value, true)), + $providedData, + ); } return $providedData; } + + /** + * @return non-empty-string + */ + private function objectToString(object $value): string + { + $reflector = new ReflectionObject($value); + + if ($reflector->isEnum()) { + $enumReflector = new ReflectionEnum($value); + + if ($enumReflector->isBacked()) { + return (string) $value->value; + } + + return $value->name; + } + + if ($reflector->hasMethod('__toString')) { + return $value->__toString(); + } + + return $value::class; + } } diff --git a/vendor/phpunit/phpunit/src/Logging/TestDox/PlainTextRenderer.php b/vendor/phpunit/phpunit/src/Logging/TestDox/PlainTextRenderer.php index cea4e2a8..8d11c1c2 100644 --- a/vendor/phpunit/phpunit/src/Logging/TestDox/PlainTextRenderer.php +++ b/vendor/phpunit/phpunit/src/Logging/TestDox/PlainTextRenderer.php @@ -12,6 +12,8 @@ namespace PHPUnit\Logging\TestDox; use function sprintf; /** + * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit + * * @internal This class is not covered by the backward compatibility promise for PHPUnit */ final class PlainTextRenderer @@ -30,7 +32,7 @@ final class PlainTextRenderer $buffer .= sprintf( ' [%s] %s' . "\n", $outcome, - $prettifiedMethodName + $prettifiedMethodName, ); } @@ -50,13 +52,22 @@ final class PlainTextRenderer foreach ($tests as $test) { $prettifiedMethodName = $test->test()->testDox()->prettifiedMethodName(); + $success = true; + + if ($test->status()->isError() || + $test->status()->isFailure() || + $test->status()->isIncomplete() || + $test->status()->isSkipped()) { + $success = false; + } + if (!isset($result[$prettifiedMethodName])) { - $result[$prettifiedMethodName] = $test->status()->isSuccess() ? 'x' : ' '; + $result[$prettifiedMethodName] = $success ? 'x' : ' '; continue; } - if ($test->status()->isSuccess()) { + if ($success) { continue; } diff --git a/vendor/phpunit/phpunit/src/Logging/TestDox/TestMethod/Subscriber/Subscriber.php b/vendor/phpunit/phpunit/src/Logging/TestDox/TestMethod/Subscriber/Subscriber.php deleted file mode 100644 index d2779f19..00000000 --- a/vendor/phpunit/phpunit/src/Logging/TestDox/TestMethod/Subscriber/Subscriber.php +++ /dev/null @@ -1,28 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace PHPUnit\Logging\TestDox; - -/** - * @internal This class is not covered by the backward compatibility promise for PHPUnit - */ -abstract class Subscriber -{ - private readonly TestResultCollector $collector; - - public function __construct(TestResultCollector $collector) - { - $this->collector = $collector; - } - - protected function collector(): TestResultCollector - { - return $this->collector; - } -} diff --git a/vendor/phpunit/phpunit/src/Logging/TestDox/TestMethod/Subscriber/TestConsideredRiskySubscriber.php b/vendor/phpunit/phpunit/src/Logging/TestDox/TestMethod/Subscriber/TestConsideredRiskySubscriber.php deleted file mode 100644 index 5bfcceda..00000000 --- a/vendor/phpunit/phpunit/src/Logging/TestDox/TestMethod/Subscriber/TestConsideredRiskySubscriber.php +++ /dev/null @@ -1,24 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace PHPUnit\Logging\TestDox; - -use PHPUnit\Event\Test\ConsideredRisky; -use PHPUnit\Event\Test\ConsideredRiskySubscriber; - -/** - * @internal This class is not covered by the backward compatibility promise for PHPUnit - */ -final class TestConsideredRiskySubscriber extends Subscriber implements ConsideredRiskySubscriber -{ - public function notify(ConsideredRisky $event): void - { - $this->collector()->testConsideredRisky($event); - } -} diff --git a/vendor/phpunit/phpunit/src/Logging/TestDox/TestMethod/Subscriber/TestCreatedMockObjectForAbstractClassSubscriber.php b/vendor/phpunit/phpunit/src/Logging/TestDox/TestMethod/Subscriber/TestCreatedMockObjectForAbstractClassSubscriber.php deleted file mode 100644 index 0445a43c..00000000 --- a/vendor/phpunit/phpunit/src/Logging/TestDox/TestMethod/Subscriber/TestCreatedMockObjectForAbstractClassSubscriber.php +++ /dev/null @@ -1,24 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace PHPUnit\Logging\TestDox; - -use PHPUnit\Event\Test\MockObjectForAbstractClassCreated; -use PHPUnit\Event\Test\MockObjectForAbstractClassCreatedSubscriber; - -/** - * @internal This class is not covered by the backward compatibility promise for PHPUnit - */ -final class TestCreatedMockObjectForAbstractClassSubscriber extends Subscriber implements MockObjectForAbstractClassCreatedSubscriber -{ - public function notify(MockObjectForAbstractClassCreated $event): void - { - $this->collector()->testCreatedTestDouble($event); - } -} diff --git a/vendor/phpunit/phpunit/src/Logging/TestDox/TestMethod/Subscriber/TestCreatedMockObjectForTraitSubscriber.php b/vendor/phpunit/phpunit/src/Logging/TestDox/TestMethod/Subscriber/TestCreatedMockObjectForTraitSubscriber.php deleted file mode 100644 index 86bb377c..00000000 --- a/vendor/phpunit/phpunit/src/Logging/TestDox/TestMethod/Subscriber/TestCreatedMockObjectForTraitSubscriber.php +++ /dev/null @@ -1,24 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace PHPUnit\Logging\TestDox; - -use PHPUnit\Event\Test\MockObjectForTraitCreated; -use PHPUnit\Event\Test\MockObjectForTraitCreatedSubscriber; - -/** - * @internal This class is not covered by the backward compatibility promise for PHPUnit - */ -final class TestCreatedMockObjectForTraitSubscriber extends Subscriber implements MockObjectForTraitCreatedSubscriber -{ - public function notify(MockObjectForTraitCreated $event): void - { - $this->collector()->testCreatedTestDouble($event); - } -} diff --git a/vendor/phpunit/phpunit/src/Logging/TestDox/TestMethod/Subscriber/TestCreatedMockObjectFromWsdlSubscriber.php b/vendor/phpunit/phpunit/src/Logging/TestDox/TestMethod/Subscriber/TestCreatedMockObjectFromWsdlSubscriber.php deleted file mode 100644 index e0994bf2..00000000 --- a/vendor/phpunit/phpunit/src/Logging/TestDox/TestMethod/Subscriber/TestCreatedMockObjectFromWsdlSubscriber.php +++ /dev/null @@ -1,24 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace PHPUnit\Logging\TestDox; - -use PHPUnit\Event\Test\MockObjectFromWsdlCreated; -use PHPUnit\Event\Test\MockObjectFromWsdlCreatedSubscriber; - -/** - * @internal This class is not covered by the backward compatibility promise for PHPUnit - */ -final class TestCreatedMockObjectFromWsdlSubscriber extends Subscriber implements MockObjectFromWsdlCreatedSubscriber -{ - public function notify(MockObjectFromWsdlCreated $event): void - { - $this->collector()->testCreatedTestDouble($event); - } -} diff --git a/vendor/phpunit/phpunit/src/Logging/TestDox/TestMethod/Subscriber/TestCreatedMockObjectSubscriber.php b/vendor/phpunit/phpunit/src/Logging/TestDox/TestMethod/Subscriber/TestCreatedMockObjectSubscriber.php deleted file mode 100644 index f95327b6..00000000 --- a/vendor/phpunit/phpunit/src/Logging/TestDox/TestMethod/Subscriber/TestCreatedMockObjectSubscriber.php +++ /dev/null @@ -1,24 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace PHPUnit\Logging\TestDox; - -use PHPUnit\Event\Test\MockObjectCreated; -use PHPUnit\Event\Test\MockObjectCreatedSubscriber; - -/** - * @internal This class is not covered by the backward compatibility promise for PHPUnit - */ -final class TestCreatedMockObjectSubscriber extends Subscriber implements MockObjectCreatedSubscriber -{ - public function notify(MockObjectCreated $event): void - { - $this->collector()->testCreatedTestDouble($event); - } -} diff --git a/vendor/phpunit/phpunit/src/Logging/TestDox/TestMethod/Subscriber/TestCreatedPartialMockObjectSubscriber.php b/vendor/phpunit/phpunit/src/Logging/TestDox/TestMethod/Subscriber/TestCreatedPartialMockObjectSubscriber.php deleted file mode 100644 index eb14c24b..00000000 --- a/vendor/phpunit/phpunit/src/Logging/TestDox/TestMethod/Subscriber/TestCreatedPartialMockObjectSubscriber.php +++ /dev/null @@ -1,24 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace PHPUnit\Logging\TestDox; - -use PHPUnit\Event\Test\PartialMockObjectCreated; -use PHPUnit\Event\Test\PartialMockObjectCreatedSubscriber; - -/** - * @internal This class is not covered by the backward compatibility promise for PHPUnit - */ -final class TestCreatedPartialMockObjectSubscriber extends Subscriber implements PartialMockObjectCreatedSubscriber -{ - public function notify(PartialMockObjectCreated $event): void - { - $this->collector()->testCreatedTestDouble($event); - } -} diff --git a/vendor/phpunit/phpunit/src/Logging/TestDox/TestMethod/Subscriber/TestCreatedTestProxySubscriber.php b/vendor/phpunit/phpunit/src/Logging/TestDox/TestMethod/Subscriber/TestCreatedTestProxySubscriber.php deleted file mode 100644 index acf05fd7..00000000 --- a/vendor/phpunit/phpunit/src/Logging/TestDox/TestMethod/Subscriber/TestCreatedTestProxySubscriber.php +++ /dev/null @@ -1,24 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace PHPUnit\Logging\TestDox; - -use PHPUnit\Event\Test\TestProxyCreated; -use PHPUnit\Event\Test\TestProxyCreatedSubscriber; - -/** - * @internal This class is not covered by the backward compatibility promise for PHPUnit - */ -final class TestCreatedTestProxySubscriber extends Subscriber implements TestProxyCreatedSubscriber -{ - public function notify(TestProxyCreated $event): void - { - $this->collector()->testCreatedTestDouble($event); - } -} diff --git a/vendor/phpunit/phpunit/src/Logging/TestDox/TestMethod/Subscriber/TestCreatedTestStubSubscriber.php b/vendor/phpunit/phpunit/src/Logging/TestDox/TestMethod/Subscriber/TestCreatedTestStubSubscriber.php deleted file mode 100644 index ab5a48a5..00000000 --- a/vendor/phpunit/phpunit/src/Logging/TestDox/TestMethod/Subscriber/TestCreatedTestStubSubscriber.php +++ /dev/null @@ -1,24 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace PHPUnit\Logging\TestDox; - -use PHPUnit\Event\Test\TestStubCreated; -use PHPUnit\Event\Test\TestStubCreatedSubscriber; - -/** - * @internal This class is not covered by the backward compatibility promise for PHPUnit - */ -final class TestCreatedTestStubSubscriber extends Subscriber implements TestStubCreatedSubscriber -{ - public function notify(TestStubCreated $event): void - { - $this->collector()->testCreatedTestDouble($event); - } -} diff --git a/vendor/phpunit/phpunit/src/Logging/TestDox/TestMethod/Subscriber/TestErroredSubscriber.php b/vendor/phpunit/phpunit/src/Logging/TestDox/TestMethod/Subscriber/TestErroredSubscriber.php deleted file mode 100644 index 3a24981d..00000000 --- a/vendor/phpunit/phpunit/src/Logging/TestDox/TestMethod/Subscriber/TestErroredSubscriber.php +++ /dev/null @@ -1,24 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace PHPUnit\Logging\TestDox; - -use PHPUnit\Event\Test\Errored; -use PHPUnit\Event\Test\ErroredSubscriber; - -/** - * @internal This class is not covered by the backward compatibility promise for PHPUnit - */ -final class TestErroredSubscriber extends Subscriber implements ErroredSubscriber -{ - public function notify(Errored $event): void - { - $this->collector()->testErrored($event); - } -} diff --git a/vendor/phpunit/phpunit/src/Logging/TestDox/TestMethod/Subscriber/TestFailedSubscriber.php b/vendor/phpunit/phpunit/src/Logging/TestDox/TestMethod/Subscriber/TestFailedSubscriber.php deleted file mode 100644 index a5647f95..00000000 --- a/vendor/phpunit/phpunit/src/Logging/TestDox/TestMethod/Subscriber/TestFailedSubscriber.php +++ /dev/null @@ -1,24 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace PHPUnit\Logging\TestDox; - -use PHPUnit\Event\Test\Failed; -use PHPUnit\Event\Test\FailedSubscriber; - -/** - * @internal This class is not covered by the backward compatibility promise for PHPUnit - */ -final class TestFailedSubscriber extends Subscriber implements FailedSubscriber -{ - public function notify(Failed $event): void - { - $this->collector()->testFailed($event); - } -} diff --git a/vendor/phpunit/phpunit/src/Logging/TestDox/TestMethod/Subscriber/TestFinishedSubscriber.php b/vendor/phpunit/phpunit/src/Logging/TestDox/TestMethod/Subscriber/TestFinishedSubscriber.php deleted file mode 100644 index c7dbdc15..00000000 --- a/vendor/phpunit/phpunit/src/Logging/TestDox/TestMethod/Subscriber/TestFinishedSubscriber.php +++ /dev/null @@ -1,28 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace PHPUnit\Logging\TestDox; - -use PHPUnit\Event\InvalidArgumentException; -use PHPUnit\Event\Test\Finished; -use PHPUnit\Event\Test\FinishedSubscriber; - -/** - * @internal This class is not covered by the backward compatibility promise for PHPUnit - */ -final class TestFinishedSubscriber extends Subscriber implements FinishedSubscriber -{ - /** - * @throws InvalidArgumentException - */ - public function notify(Finished $event): void - { - $this->collector()->testFinished($event); - } -} diff --git a/vendor/phpunit/phpunit/src/Logging/TestDox/TestMethod/Subscriber/TestMarkedIncompleteSubscriber.php b/vendor/phpunit/phpunit/src/Logging/TestDox/TestMethod/Subscriber/TestMarkedIncompleteSubscriber.php deleted file mode 100644 index 1846712e..00000000 --- a/vendor/phpunit/phpunit/src/Logging/TestDox/TestMethod/Subscriber/TestMarkedIncompleteSubscriber.php +++ /dev/null @@ -1,24 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace PHPUnit\Logging\TestDox; - -use PHPUnit\Event\Test\MarkedIncomplete; -use PHPUnit\Event\Test\MarkedIncompleteSubscriber; - -/** - * @internal This class is not covered by the backward compatibility promise for PHPUnit - */ -final class TestMarkedIncompleteSubscriber extends Subscriber implements MarkedIncompleteSubscriber -{ - public function notify(MarkedIncomplete $event): void - { - $this->collector()->testMarkedIncomplete($event); - } -} diff --git a/vendor/phpunit/phpunit/src/Logging/TestDox/TestMethod/Subscriber/TestPassedSubscriber.php b/vendor/phpunit/phpunit/src/Logging/TestDox/TestMethod/Subscriber/TestPassedSubscriber.php deleted file mode 100644 index df39fca5..00000000 --- a/vendor/phpunit/phpunit/src/Logging/TestDox/TestMethod/Subscriber/TestPassedSubscriber.php +++ /dev/null @@ -1,24 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace PHPUnit\Logging\TestDox; - -use PHPUnit\Event\Test\Passed; -use PHPUnit\Event\Test\PassedSubscriber; - -/** - * @internal This class is not covered by the backward compatibility promise for PHPUnit - */ -final class TestPassedSubscriber extends Subscriber implements PassedSubscriber -{ - public function notify(Passed $event): void - { - $this->collector()->testPassed($event); - } -} diff --git a/vendor/phpunit/phpunit/src/Logging/TestDox/TestMethod/Subscriber/TestPreparedSubscriber.php b/vendor/phpunit/phpunit/src/Logging/TestDox/TestMethod/Subscriber/TestPreparedSubscriber.php deleted file mode 100644 index c21e8c17..00000000 --- a/vendor/phpunit/phpunit/src/Logging/TestDox/TestMethod/Subscriber/TestPreparedSubscriber.php +++ /dev/null @@ -1,24 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace PHPUnit\Logging\TestDox; - -use PHPUnit\Event\Test\Prepared; -use PHPUnit\Event\Test\PreparedSubscriber; - -/** - * @internal This class is not covered by the backward compatibility promise for PHPUnit - */ -final class TestPreparedSubscriber extends Subscriber implements PreparedSubscriber -{ - public function notify(Prepared $event): void - { - $this->collector()->testPrepared($event); - } -} diff --git a/vendor/phpunit/phpunit/src/Logging/TestDox/TestMethod/Subscriber/TestSkippedSubscriber.php b/vendor/phpunit/phpunit/src/Logging/TestDox/TestMethod/Subscriber/TestSkippedSubscriber.php deleted file mode 100644 index 5f291ab3..00000000 --- a/vendor/phpunit/phpunit/src/Logging/TestDox/TestMethod/Subscriber/TestSkippedSubscriber.php +++ /dev/null @@ -1,24 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace PHPUnit\Logging\TestDox; - -use PHPUnit\Event\Test\Skipped; -use PHPUnit\Event\Test\SkippedSubscriber; - -/** - * @internal This class is not covered by the backward compatibility promise for PHPUnit - */ -final class TestSkippedSubscriber extends Subscriber implements SkippedSubscriber -{ - public function notify(Skipped $event): void - { - $this->collector()->testSkipped($event); - } -} diff --git a/vendor/phpunit/phpunit/src/Logging/TestDox/TestMethod/TestResult.php b/vendor/phpunit/phpunit/src/Logging/TestDox/TestMethod/TestResult.php deleted file mode 100644 index d2108344..00000000 --- a/vendor/phpunit/phpunit/src/Logging/TestDox/TestMethod/TestResult.php +++ /dev/null @@ -1,81 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace PHPUnit\Logging\TestDox; - -use PHPUnit\Event\Code\TestMethod; -use PHPUnit\Event\Code\Throwable; -use PHPUnit\Event\Telemetry\Duration; -use PHPUnit\Framework\TestStatus\TestStatus; - -/** - * @psalm-immutable - * - * @internal This class is not covered by the backward compatibility promise for PHPUnit - */ -final class TestResult -{ - private readonly TestMethod $test; - private readonly Duration $duration; - private readonly TestStatus $status; - private readonly ?Throwable $throwable; - - /** - * @psalm-var list - */ - private readonly array $testDoubles; - - /** - * @psalm-param list $testDoubles - */ - public function __construct(TestMethod $test, Duration $duration, TestStatus $status, ?Throwable $throwable, array $testDoubles) - { - $this->test = $test; - $this->duration = $duration; - $this->status = $status; - $this->throwable = $throwable; - $this->testDoubles = $testDoubles; - } - - public function test(): TestMethod - { - return $this->test; - } - - public function duration(): Duration - { - return $this->duration; - } - - public function status(): TestStatus - { - return $this->status; - } - - /** - * @psalm-assert-if-true !null $this->throwable - */ - public function hasThrowable(): bool - { - return $this->throwable !== null; - } - - public function throwable(): ?Throwable - { - return $this->throwable; - } - - /** - * @psalm-return list - */ - public function testDoubles(): array - { - return $this->testDoubles; - } -} diff --git a/vendor/phpunit/phpunit/src/Logging/TestDox/TestMethod/TestResultCollection.php b/vendor/phpunit/phpunit/src/Logging/TestDox/TestMethod/TestResultCollection.php deleted file mode 100644 index 98c6f7d5..00000000 --- a/vendor/phpunit/phpunit/src/Logging/TestDox/TestMethod/TestResultCollection.php +++ /dev/null @@ -1,53 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace PHPUnit\Logging\TestDox; - -use IteratorAggregate; - -/** - * @template-implements IteratorAggregate - * - * @psalm-immutable - * - * @internal This class is not covered by the backward compatibility promise for PHPUnit - */ -final class TestResultCollection implements IteratorAggregate -{ - /** - * @psalm-var list - */ - private readonly array $testResults; - - /** - * @psalm-param list $testResults - */ - public static function fromArray(array $testResults): self - { - return new self(...$testResults); - } - - private function __construct(TestResult ...$testResults) - { - $this->testResults = $testResults; - } - - /** - * @psalm-return list - */ - public function asArray(): array - { - return $this->testResults; - } - - public function getIterator(): TestResultCollectionIterator - { - return new TestResultCollectionIterator($this); - } -} diff --git a/vendor/phpunit/phpunit/src/Logging/TestDox/TestMethod/TestResultCollectionIterator.php b/vendor/phpunit/phpunit/src/Logging/TestDox/TestMethod/TestResultCollectionIterator.php deleted file mode 100644 index 7f07cb5d..00000000 --- a/vendor/phpunit/phpunit/src/Logging/TestDox/TestMethod/TestResultCollectionIterator.php +++ /dev/null @@ -1,57 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace PHPUnit\Logging\TestDox; - -use function count; -use Iterator; - -/** - * @template-implements Iterator - * - * @internal This class is not covered by the backward compatibility promise for PHPUnit - */ -final class TestResultCollectionIterator implements Iterator -{ - /** - * @psalm-var list - */ - private readonly array $testResults; - private int $position = 0; - - public function __construct(TestResultCollection $testResults) - { - $this->testResults = $testResults->asArray(); - } - - public function rewind(): void - { - $this->position = 0; - } - - public function valid(): bool - { - return $this->position < count($this->testResults); - } - - public function key(): int - { - return $this->position; - } - - public function current(): TestResult - { - return $this->testResults[$this->position]; - } - - public function next(): void - { - $this->position++; - } -} diff --git a/vendor/phpunit/phpunit/src/Logging/TestDox/TestMethod/TestResultCollector.php b/vendor/phpunit/phpunit/src/Logging/TestDox/TestMethod/TestResultCollector.php deleted file mode 100644 index 5b035cec..00000000 --- a/vendor/phpunit/phpunit/src/Logging/TestDox/TestMethod/TestResultCollector.php +++ /dev/null @@ -1,209 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace PHPUnit\Logging\TestDox; - -use function assert; -use PHPUnit\Event\Code\TestMethod; -use PHPUnit\Event\Code\Throwable; -use PHPUnit\Event\EventFacadeIsSealedException; -use PHPUnit\Event\Facade; -use PHPUnit\Event\InvalidArgumentException; -use PHPUnit\Event\Telemetry\HRTime; -use PHPUnit\Event\Test\ConsideredRisky; -use PHPUnit\Event\Test\Errored; -use PHPUnit\Event\Test\Failed; -use PHPUnit\Event\Test\Finished; -use PHPUnit\Event\Test\MarkedIncomplete; -use PHPUnit\Event\Test\MockObjectCreated; -use PHPUnit\Event\Test\MockObjectForAbstractClassCreated; -use PHPUnit\Event\Test\MockObjectForTraitCreated; -use PHPUnit\Event\Test\MockObjectFromWsdlCreated; -use PHPUnit\Event\Test\PartialMockObjectCreated; -use PHPUnit\Event\Test\Passed; -use PHPUnit\Event\Test\Prepared; -use PHPUnit\Event\Test\Skipped; -use PHPUnit\Event\Test\TestProxyCreated; -use PHPUnit\Event\Test\TestStubCreated; -use PHPUnit\Event\UnknownSubscriberTypeException; -use PHPUnit\Framework\TestStatus\TestStatus; -use PHPUnit\Logging\TestDox\TestResult as TestDoxTestMethod; -use SoapClient; - -/** - * @internal This class is not covered by the backward compatibility promise for PHPUnit - */ -final class TestResultCollector -{ - /** - * @psalm-var array> - */ - private array $tests = []; - private ?HRTime $time = null; - private ?TestStatus $status = null; - private ?Throwable $throwable = null; - - /** - * @psalm-var list - */ - private array $testDoubles = []; - - /** - * @throws EventFacadeIsSealedException - * @throws UnknownSubscriberTypeException - */ - public function __construct() - { - $this->registerSubscribers(); - } - - /** - * @psalm-return array - */ - public function testMethodsGroupedByClass(): array - { - $result = []; - - foreach ($this->tests as $prettifiedClassName => $tests) { - $result[$prettifiedClassName] = TestResultCollection::fromArray($tests); - } - - return $result; - } - - public function testPrepared(Prepared $event): void - { - if (!$event->test()->isTestMethod()) { - return; - } - - $this->time = $event->telemetryInfo()->time(); - $this->status = TestStatus::unknown(); - $this->throwable = null; - $this->testDoubles = []; - } - - public function testErrored(Errored $event): void - { - if (!$event->test()->isTestMethod()) { - return; - } - - $this->status = TestStatus::error($event->throwable()->message()); - $this->throwable = $event->throwable(); - } - - public function testFailed(Failed $event): void - { - if (!$event->test()->isTestMethod()) { - return; - } - - $this->status = TestStatus::failure($event->throwable()->message()); - $this->throwable = $event->throwable(); - } - - public function testPassed(Passed $event): void - { - if (!$event->test()->isTestMethod()) { - return; - } - - $this->status = TestStatus::success(); - } - - public function testSkipped(Skipped $event): void - { - $this->status = TestStatus::skipped($event->message()); - } - - public function testMarkedIncomplete(MarkedIncomplete $event): void - { - $this->status = TestStatus::incomplete($event->throwable()->message()); - $this->throwable = $event->throwable(); - } - - public function testConsideredRisky(ConsideredRisky $event): void - { - $this->status = TestStatus::risky($event->message()); - } - - public function testCreatedTestDouble(MockObjectCreated|MockObjectForAbstractClassCreated|MockObjectForTraitCreated|MockObjectFromWsdlCreated|PartialMockObjectCreated|TestProxyCreated|TestStubCreated $event): void - { - if ($event instanceof MockObjectForTraitCreated) { - $this->testDoubles[] = $event->traitName(); - - return; - } - - if ($event instanceof MockObjectFromWsdlCreated) { - $this->testDoubles[] = SoapClient::class; - - return; - } - - $this->testDoubles[] = $event->className(); - } - - /** - * @throws InvalidArgumentException - */ - public function testFinished(Finished $event): void - { - if (!$event->test()->isTestMethod()) { - return; - } - - $test = $event->test(); - - assert($test instanceof TestMethod); - - if (!isset($this->tests[$test->testDox()->prettifiedClassName()])) { - $this->tests[$test->testDox()->prettifiedClassName()] = []; - } - - $this->tests[$test->testDox()->prettifiedClassName()][] = new TestDoxTestMethod( - $test, - $event->telemetryInfo()->time()->duration($this->time), - $this->status, - $this->throwable, - $this->testDoubles - ); - - $this->time = null; - $this->status = null; - $this->throwable = null; - $this->testDoubles = []; - } - - /** - * @throws EventFacadeIsSealedException - * @throws UnknownSubscriberTypeException - */ - private function registerSubscribers(): void - { - Facade::registerSubscribers( - new TestConsideredRiskySubscriber($this), - new TestCreatedMockObjectForAbstractClassSubscriber($this), - new TestCreatedMockObjectForTraitSubscriber($this), - new TestCreatedMockObjectFromWsdlSubscriber($this), - new TestCreatedMockObjectSubscriber($this), - new TestCreatedPartialMockObjectSubscriber($this), - new TestCreatedTestProxySubscriber($this), - new TestCreatedTestStubSubscriber($this), - new TestErroredSubscriber($this), - new TestFailedSubscriber($this), - new TestFinishedSubscriber($this), - new TestMarkedIncompleteSubscriber($this), - new TestPassedSubscriber($this), - new TestPreparedSubscriber($this), - new TestSkippedSubscriber($this), - ); - } -} diff --git a/vendor/phpunit/phpunit/src/Metadata/After.php b/vendor/phpunit/phpunit/src/Metadata/After.php index f9e497e3..87900590 100644 --- a/vendor/phpunit/phpunit/src/Metadata/After.php +++ b/vendor/phpunit/phpunit/src/Metadata/After.php @@ -16,6 +16,9 @@ namespace PHPUnit\Metadata; */ final class After extends Metadata { + /** + * @psalm-assert-if-true After $this + */ public function isAfter(): bool { return true; diff --git a/vendor/phpunit/phpunit/src/Metadata/AfterClass.php b/vendor/phpunit/phpunit/src/Metadata/AfterClass.php index 505a7a89..16bb5cc0 100644 --- a/vendor/phpunit/phpunit/src/Metadata/AfterClass.php +++ b/vendor/phpunit/phpunit/src/Metadata/AfterClass.php @@ -16,6 +16,9 @@ namespace PHPUnit\Metadata; */ final class AfterClass extends Metadata { + /** + * @psalm-assert-if-true AfterClass $this + */ public function isAfterClass(): bool { return true; diff --git a/vendor/phpunit/phpunit/src/Metadata/Api/CodeCoverage.php b/vendor/phpunit/phpunit/src/Metadata/Api/CodeCoverage.php index 123d1093..d09abbfc 100644 --- a/vendor/phpunit/phpunit/src/Metadata/Api/CodeCoverage.php +++ b/vendor/phpunit/phpunit/src/Metadata/Api/CodeCoverage.php @@ -9,6 +9,8 @@ */ namespace PHPUnit\Metadata\Api; +use function array_unique; +use function array_values; use function assert; use function count; use function interface_exists; @@ -16,20 +18,28 @@ use function sprintf; use function str_starts_with; use PHPUnit\Framework\CodeCoverageException; use PHPUnit\Framework\InvalidCoversTargetException; +use PHPUnit\Framework\TestSuite; use PHPUnit\Metadata\Covers; use PHPUnit\Metadata\CoversClass; use PHPUnit\Metadata\CoversDefaultClass; use PHPUnit\Metadata\CoversFunction; +use PHPUnit\Metadata\IgnoreClassForCodeCoverage; +use PHPUnit\Metadata\IgnoreFunctionForCodeCoverage; +use PHPUnit\Metadata\IgnoreMethodForCodeCoverage; use PHPUnit\Metadata\Parser\Registry; use PHPUnit\Metadata\Uses; use PHPUnit\Metadata\UsesClass; use PHPUnit\Metadata\UsesDefaultClass; use PHPUnit\Metadata\UsesFunction; +use RecursiveIteratorIterator; use SebastianBergmann\CodeUnit\CodeUnitCollection; +use SebastianBergmann\CodeUnit\Exception as CodeUnitException; use SebastianBergmann\CodeUnit\InvalidCodeUnitException; use SebastianBergmann\CodeUnit\Mapper; /** + * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit + * * @internal This class is not covered by the backward compatibility promise for PHPUnit */ final class CodeCoverage @@ -38,9 +48,9 @@ final class CodeCoverage * @psalm-param class-string $className * @psalm-param non-empty-string $methodName * - * @psalm-return array>|false - * * @throws CodeCoverageException + * + * @psalm-return array>|false */ public function linesToBeCovered(string $className, string $methodName): array|false { @@ -56,8 +66,8 @@ final class CodeCoverage throw new CodeCoverageException( sprintf( 'More than one @coversDefaultClass annotation for class or interface "%s"', - $className - ) + $className, + ), ); } @@ -72,30 +82,14 @@ final class CodeCoverage $mapper = new Mapper; foreach (Registry::parser()->forClassAndMethod($className, $methodName) as $metadata) { + if (!$metadata->isCoversClass() && !$metadata->isCoversFunction() && !$metadata->isCovers()) { + continue; + } + + assert($metadata instanceof CoversClass || $metadata instanceof CoversFunction || $metadata instanceof Covers); + if ($metadata->isCoversClass() || $metadata->isCoversFunction()) { - assert($metadata instanceof CoversClass || $metadata instanceof CoversFunction); - - try { - $codeUnits = $codeUnits->mergeWith( - $mapper->stringToCodeUnits($metadata->asStringForCodeUnitMapper()) - ); - } catch (InvalidCodeUnitException $e) { - if ($metadata->isCoversClass()) { - $type = 'Class'; - } else { - $type = 'Function'; - } - - throw new InvalidCoversTargetException( - sprintf( - '%s "%s" is not a valid target for code coverage', - $type, - $metadata->asStringForCodeUnitMapper() - ), - $e->getCode(), - $e - ); - } + $codeUnits = $codeUnits->mergeWith($this->mapToCodeUnits($metadata)); } elseif ($metadata->isCovers()) { assert($metadata instanceof Covers); @@ -105,8 +99,8 @@ final class CodeCoverage throw new InvalidCoversTargetException( sprintf( 'Trying to @cover interface "%s".', - $target - ) + $target, + ), ); } @@ -120,10 +114,10 @@ final class CodeCoverage throw new InvalidCoversTargetException( sprintf( '"@covers %s" is invalid', - $target + $target, ), $e->getCode(), - $e + $e, ); } } @@ -136,9 +130,9 @@ final class CodeCoverage * @psalm-param class-string $className * @psalm-param non-empty-string $methodName * - * @psalm-return array> - * * @throws CodeCoverageException + * + * @psalm-return array> */ public function linesToBeUsed(string $className, string $methodName): array { @@ -150,8 +144,8 @@ final class CodeCoverage throw new CodeCoverageException( sprintf( 'More than one @usesDefaultClass annotation for class or interface "%s"', - $className - ) + $className, + ), ); } @@ -166,30 +160,14 @@ final class CodeCoverage $mapper = new Mapper; foreach (Registry::parser()->forClassAndMethod($className, $methodName) as $metadata) { + if (!$metadata->isUsesClass() && !$metadata->isUsesFunction() && !$metadata->isUses()) { + continue; + } + + assert($metadata instanceof UsesClass || $metadata instanceof UsesFunction || $metadata instanceof Uses); + if ($metadata->isUsesClass() || $metadata->isUsesFunction()) { - assert($metadata instanceof UsesClass || $metadata instanceof UsesFunction); - - try { - $codeUnits = $codeUnits->mergeWith( - $mapper->stringToCodeUnits($metadata->asStringForCodeUnitMapper()) - ); - } catch (InvalidCodeUnitException $e) { - if ($metadata->isUsesClass()) { - $type = 'Class'; - } else { - $type = 'Function'; - } - - throw new InvalidCoversTargetException( - sprintf( - '%s "%s" is not a valid target for code coverage', - $type, - $metadata->asStringForCodeUnitMapper() - ), - $e->getCode(), - $e - ); - } + $codeUnits = $codeUnits->mergeWith($this->mapToCodeUnits($metadata)); } elseif ($metadata->isUses()) { assert($metadata instanceof Uses); @@ -205,10 +183,10 @@ final class CodeCoverage throw new InvalidCoversTargetException( sprintf( '"@uses %s" is invalid', - $target + $target, ), $e->getCode(), - $e + $e, ); } } @@ -217,6 +195,23 @@ final class CodeCoverage return $mapper->codeUnitsToSourceLines($codeUnits); } + /** + * @psalm-return array> + */ + public function linesToBeIgnored(TestSuite $testSuite): array + { + $codeUnits = CodeUnitCollection::fromList(); + $mapper = new Mapper; + + foreach ($this->testCaseClassesIn($testSuite) as $testCaseClassName) { + $codeUnits = $codeUnits->mergeWith( + $this->codeUnitsIgnoredBy($testCaseClassName), + ); + } + + return $mapper->codeUnitsToSourceLines($codeUnits); + } + /** * @psalm-param class-string $className * @psalm-param non-empty-string $methodName @@ -242,4 +237,81 @@ final class CodeCoverage return true; } + + /** + * @psalm-return list + */ + private function testCaseClassesIn(TestSuite $testSuite): array + { + $classNames = []; + + foreach (new RecursiveIteratorIterator($testSuite) as $test) { + $classNames[] = $test::class; + } + + return array_values(array_unique($classNames)); + } + + /** + * @psalm-param class-string $className + */ + private function codeUnitsIgnoredBy(string $className): CodeUnitCollection + { + $codeUnits = CodeUnitCollection::fromList(); + $mapper = new Mapper; + + foreach (Registry::parser()->forClass($className) as $metadata) { + if ($metadata instanceof IgnoreClassForCodeCoverage) { + $codeUnits = $codeUnits->mergeWith( + $mapper->stringToCodeUnits($metadata->className()), + ); + } + + if ($metadata instanceof IgnoreMethodForCodeCoverage) { + $codeUnits = $codeUnits->mergeWith( + $mapper->stringToCodeUnits($metadata->className() . '::' . $metadata->methodName()), + ); + } + + if ($metadata instanceof IgnoreFunctionForCodeCoverage) { + $codeUnits = $codeUnits->mergeWith( + $mapper->stringToCodeUnits('::' . $metadata->functionName()), + ); + } + } + + return $codeUnits; + } + + /** + * @throws InvalidCoversTargetException + */ + private function mapToCodeUnits(CoversClass|CoversFunction|UsesClass|UsesFunction $metadata): CodeUnitCollection + { + $mapper = new Mapper; + + try { + return $mapper->stringToCodeUnits($metadata->asStringForCodeUnitMapper()); + } catch (CodeUnitException $e) { + if ($metadata->isCoversClass() || $metadata->isUsesClass()) { + if (interface_exists($metadata->className())) { + $type = 'Interface'; + } else { + $type = 'Class'; + } + } else { + $type = 'Function'; + } + + throw new InvalidCoversTargetException( + sprintf( + '%s "%s" is not a valid target for code coverage', + $type, + $metadata->asStringForCodeUnitMapper(), + ), + $e->getCode(), + $e, + ); + } + } } diff --git a/vendor/phpunit/phpunit/src/Metadata/Api/DataProvider.php b/vendor/phpunit/phpunit/src/Metadata/Api/DataProvider.php index 4acc56a7..6dab3144 100644 --- a/vendor/phpunit/phpunit/src/Metadata/Api/DataProvider.php +++ b/vendor/phpunit/phpunit/src/Metadata/Api/DataProvider.php @@ -9,12 +9,15 @@ */ namespace PHPUnit\Metadata\Api; +use const JSON_ERROR_NONE; +use const PREG_OFFSET_CAPTURE; use function array_key_exists; -use function array_merge; use function assert; use function explode; +use function get_debug_type; use function is_array; use function is_int; +use function is_string; use function json_decode; use function json_last_error; use function json_last_error_msg; @@ -36,12 +39,14 @@ use PHPUnit\Metadata\MetadataCollection; use PHPUnit\Metadata\Parser\Registry as MetadataRegistry; use PHPUnit\Metadata\TestWith; use PHPUnit\Util\Reflection; +use PHPUnit\Util\Test; use ReflectionClass; use ReflectionMethod; use Throwable; -use Traversable; /** + * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit + * * @internal This class is not covered by the backward compatibility promise for PHPUnit */ final class DataProvider @@ -69,7 +74,7 @@ final class DataProvider if ($data === []) { throw new InvalidDataProviderException( - 'Empty data set provided by data provider' + 'Empty data set provided by data provider', ); } @@ -78,8 +83,8 @@ final class DataProvider throw new InvalidDataProviderException( sprintf( 'Data set %s is invalid', - is_int($key) ? '#' . $key : '"' . $key . '"' - ) + is_int($key) ? '#' . $key : '"' . $key . '"', + ), ); } } @@ -95,14 +100,38 @@ final class DataProvider */ private function dataProvidedByMethods(string $className, string $methodName, MetadataCollection $dataProvider): array { - $result = []; + $testMethod = new Event\Code\ClassMethod($className, $methodName); + $methodsCalled = []; + $result = []; foreach ($dataProvider as $_dataProvider) { assert($_dataProvider instanceof DataProviderMetadata); + $dataProviderMethod = new Event\Code\ClassMethod($_dataProvider->className(), $_dataProvider->methodName()); + + Event\Facade::emitter()->dataProviderMethodCalled( + $testMethod, + $dataProviderMethod, + ); + + $methodsCalled[] = $dataProviderMethod; + try { $class = new ReflectionClass($_dataProvider->className()); $method = $class->getMethod($_dataProvider->methodName()); + + if (Test::isTestMethod($method)) { + Event\Facade::emitter()->testRunnerTriggeredPhpunitWarning( + sprintf( + 'Method %s::%s() used by test method %s::%s() is also a test method', + $_dataProvider->className(), + $_dataProvider->methodName(), + $className, + $methodName, + ), + ); + } + $object = null; if (!$method->isPublic()) { @@ -114,8 +143,8 @@ final class DataProvider sprintf( 'Data Provider method %s::%s() is not public', $_dataProvider->className(), - $_dataProvider->methodName() - ) + $_dataProvider->methodName(), + ), ); } @@ -128,8 +157,8 @@ final class DataProvider sprintf( 'Data Provider method %s::%s() is not static', $_dataProvider->className(), - $_dataProvider->methodName() - ) + $_dataProvider->methodName(), + ), ); $object = $class->newInstanceWithoutConstructor(); @@ -146,45 +175,60 @@ final class DataProvider sprintf( 'Data Provider method %s::%s() expects an argument', $_dataProvider->className(), - $_dataProvider->methodName() - ) + $_dataProvider->methodName(), + ), ); $data = $method->invoke($object, $_dataProvider->methodName()); } } catch (Throwable $e) { + Event\Facade::emitter()->dataProviderMethodFinished( + $testMethod, + ...$methodsCalled, + ); + throw new InvalidDataProviderException( $e->getMessage(), $e->getCode(), - $e + $e, ); } - if ($data instanceof Traversable) { - $origData = $data; - $data = []; + foreach ($data as $key => $value) { + if (is_int($key)) { + $result[] = $value; + } elseif (is_string($key)) { + if (array_key_exists($key, $result)) { + Event\Facade::emitter()->dataProviderMethodFinished( + $testMethod, + ...$methodsCalled, + ); - foreach ($origData as $key => $value) { - if (is_int($key)) { - $data[] = $value; - } elseif (array_key_exists($key, $data)) { throw new InvalidDataProviderException( sprintf( 'The key "%s" has already been defined by a previous data provider', $key, - ) + ), ); - } else { - $data[$key] = $value; } + + $result[$key] = $value; + } else { + throw new InvalidDataProviderException( + sprintf( + 'The key must be an integer or a string, %s given', + get_debug_type($key), + ), + ); } } - - if (is_array($data)) { - $result = array_merge($result, $data); - } } + Event\Facade::emitter()->dataProviderMethodFinished( + $testMethod, + ...$methodsCalled, + ); + return $result; } @@ -210,12 +254,12 @@ final class DataProvider { $docComment = (new ReflectionMethod($className, $methodName))->getDocComment(); - if (!$docComment) { + if ($docComment === false) { return null; } $docComment = str_replace("\r\n", "\n", $docComment); - $docComment = preg_replace('/' . '\n' . '\s*' . '\*' . '\s?' . '/', "\n", $docComment); + $docComment = preg_replace('/\n\s*\*\s?/', "\n", $docComment); $docComment = substr($docComment, 0, -1); $docComment = rtrim($docComment, "\n"); @@ -223,14 +267,14 @@ final class DataProvider return null; } - $offset = strlen($matches[0][0]) + $matches[0][1]; + $offset = strlen($matches[0][0]) + (int) $matches[0][1]; $annotationContent = substr($docComment, $offset); $data = []; foreach (explode("\n", $annotationContent) as $candidateRow) { $candidateRow = trim($candidateRow); - if ($candidateRow[0] !== '[') { + if ($candidateRow === '' || $candidateRow[0] !== '[') { break; } @@ -238,7 +282,7 @@ final class DataProvider if (json_last_error() !== JSON_ERROR_NONE) { throw new InvalidDataProviderException( - 'The data set for the @testWith annotation cannot be parsed: ' . json_last_error_msg() + 'The data set for the @testWith annotation cannot be parsed: ' . json_last_error_msg(), ); } @@ -247,7 +291,7 @@ final class DataProvider if (!$data) { throw new InvalidDataProviderException( - 'The data set for the @testWith annotation cannot be parsed.' + 'The data set for the @testWith annotation cannot be parsed.', ); } @@ -271,13 +315,13 @@ final class DataProvider $location['line'], Event\Code\TestDoxBuilder::fromClassNameAndMethodName( $className, - $methodName + $methodName, ), - MetadataRegistry::parser()->for( + MetadataRegistry::parser()->forClassAndMethod( $className, - $methodName + $methodName, ), - TestDataCollection::fromArray([]) + TestDataCollection::fromArray([]), ); } } diff --git a/vendor/phpunit/phpunit/src/Metadata/Api/Dependencies.php b/vendor/phpunit/phpunit/src/Metadata/Api/Dependencies.php index cda6e099..1b20df98 100644 --- a/vendor/phpunit/phpunit/src/Metadata/Api/Dependencies.php +++ b/vendor/phpunit/phpunit/src/Metadata/Api/Dependencies.php @@ -16,6 +16,8 @@ use PHPUnit\Metadata\DependsOnMethod; use PHPUnit\Metadata\Parser\Registry; /** + * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit + * * @internal This class is not covered by the backward compatibility promise for PHPUnit */ final class Dependencies diff --git a/vendor/phpunit/phpunit/src/Metadata/Api/Groups.php b/vendor/phpunit/phpunit/src/Metadata/Api/Groups.php index 73341851..dca8ef64 100644 --- a/vendor/phpunit/phpunit/src/Metadata/Api/Groups.php +++ b/vendor/phpunit/phpunit/src/Metadata/Api/Groups.php @@ -10,6 +10,7 @@ namespace PHPUnit\Metadata\Api; use function array_flip; +use function array_key_exists; use function array_unique; use function assert; use function strtolower; @@ -25,18 +26,31 @@ use PHPUnit\Metadata\UsesClass; use PHPUnit\Metadata\UsesFunction; /** + * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit + * * @internal This class is not covered by the backward compatibility promise for PHPUnit */ final class Groups { + /** + * @var array> + */ + private static array $groupCache = []; + /** * @psalm-param class-string $className * @psalm-param non-empty-string $methodName * - * @psalm-return list + * @psalm-return array */ public function groups(string $className, string $methodName, bool $includeVirtual = true): array { + $key = $className . '::' . $methodName . '::' . $includeVirtual; + + if (array_key_exists($key, self::$groupCache)) { + return self::$groupCache[$key]; + } + $groups = []; foreach (Registry::parser()->forClassAndMethod($className, $methodName)->isGroup() as $group) { @@ -50,7 +64,7 @@ final class Groups } if (!$includeVirtual) { - return array_unique($groups); + return self::$groupCache[$key] = array_unique($groups); } foreach (Registry::parser()->forClassAndMethod($className, $methodName) as $metadata) { @@ -85,7 +99,7 @@ final class Groups } } - return array_unique($groups); + return self::$groupCache[$key] = array_unique($groups); } /** diff --git a/vendor/phpunit/phpunit/src/Metadata/Api/HookMethods.php b/vendor/phpunit/phpunit/src/Metadata/Api/HookMethods.php index 19daf646..89b8c2c7 100644 --- a/vendor/phpunit/phpunit/src/Metadata/Api/HookMethods.php +++ b/vendor/phpunit/phpunit/src/Metadata/Api/HookMethods.php @@ -17,6 +17,8 @@ use PHPUnit\Util\Reflection; use ReflectionClass; /** + * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit + * * @internal This class is not covered by the backward compatibility promise for PHPUnit */ final class HookMethods @@ -43,7 +45,7 @@ final class HookMethods self::$hookMethods[$className] = self::emptyHookMethodsArray(); - foreach ((new Reflection)->methodsInTestClass(new ReflectionClass($className)) as $method) { + foreach (Reflection::methodsInTestClass(new ReflectionClass($className)) as $method) { $methodName = $method->getName(); assert(!empty($methodName)); @@ -54,7 +56,7 @@ final class HookMethods if ($metadata->isBeforeClass()->isNotEmpty()) { array_unshift( self::$hookMethods[$className]['beforeClass'], - $methodName + $methodName, ); } @@ -66,14 +68,14 @@ final class HookMethods if ($metadata->isBefore()->isNotEmpty()) { array_unshift( self::$hookMethods[$className]['before'], - $methodName + $methodName, ); } if ($metadata->isPreCondition()->isNotEmpty()) { array_unshift( self::$hookMethods[$className]['preCondition'], - $methodName + $methodName, ); } diff --git a/vendor/phpunit/phpunit/src/Metadata/Api/Requirements.php b/vendor/phpunit/phpunit/src/Metadata/Api/Requirements.php index 21486a92..922421f4 100644 --- a/vendor/phpunit/phpunit/src/Metadata/Api/Requirements.php +++ b/vendor/phpunit/phpunit/src/Metadata/Api/Requirements.php @@ -33,6 +33,8 @@ use PHPUnit\Metadata\RequiresSetting; use PHPUnit\Runner\Version; /** + * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit + * * @internal This class is not covered by the backward compatibility promise for PHPUnit */ final class Requirements @@ -54,7 +56,7 @@ final class Requirements if (!$metadata->versionRequirement()->isSatisfiedBy(PHP_VERSION)) { $notSatisfied[] = sprintf( 'PHP %s is required.', - $metadata->versionRequirement()->asString() + $metadata->versionRequirement()->asString(), ); } } @@ -68,7 +70,7 @@ final class Requirements $notSatisfied[] = sprintf( 'PHP extension %s%s is required.', $metadata->extension(), - $metadata->hasVersionRequirement() ? (' ' . $metadata->versionRequirement()->asString()) : '' + $metadata->hasVersionRequirement() ? (' ' . $metadata->versionRequirement()->asString()) : '', ); } } @@ -79,7 +81,7 @@ final class Requirements if (!$metadata->versionRequirement()->isSatisfiedBy(Version::id())) { $notSatisfied[] = sprintf( 'PHPUnit %s is required.', - $metadata->versionRequirement()->asString() + $metadata->versionRequirement()->asString(), ); } } @@ -90,7 +92,7 @@ final class Requirements if ($metadata->operatingSystemFamily() !== PHP_OS_FAMILY) { $notSatisfied[] = sprintf( 'Operating system %s is required.', - $metadata->operatingSystemFamily() + $metadata->operatingSystemFamily(), ); } } @@ -100,13 +102,13 @@ final class Requirements $pattern = sprintf( '/%s/i', - addcslashes($metadata->operatingSystem(), '/') + addcslashes($metadata->operatingSystem(), '/'), ); if (!preg_match($pattern, PHP_OS)) { $notSatisfied[] = sprintf( 'Operating system %s is required.', - $metadata->operatingSystem() + $metadata->operatingSystem(), ); } } @@ -117,7 +119,7 @@ final class Requirements if (!function_exists($metadata->functionName())) { $notSatisfied[] = sprintf( 'Function %s() is required.', - $metadata->functionName() + $metadata->functionName(), ); } } @@ -129,7 +131,7 @@ final class Requirements $notSatisfied[] = sprintf( 'Method %s::%s() is required.', $metadata->className(), - $metadata->methodName() + $metadata->methodName(), ); } } @@ -141,7 +143,7 @@ final class Requirements $notSatisfied[] = sprintf( 'Setting "%s" is required to be "%s".', $metadata->setting(), - $metadata->value() + $metadata->value(), ); } } diff --git a/vendor/phpunit/phpunit/src/Metadata/BackupGlobals.php b/vendor/phpunit/phpunit/src/Metadata/BackupGlobals.php index 3d41b2b3..b6c485c8 100644 --- a/vendor/phpunit/phpunit/src/Metadata/BackupGlobals.php +++ b/vendor/phpunit/phpunit/src/Metadata/BackupGlobals.php @@ -18,6 +18,9 @@ final class BackupGlobals extends Metadata { private readonly bool $enabled; + /** + * @psalm-param 0|1 $level + */ protected function __construct(int $level, bool $enabled) { parent::__construct($level); @@ -25,6 +28,9 @@ final class BackupGlobals extends Metadata $this->enabled = $enabled; } + /** + * @psalm-assert-if-true BackupGlobals $this + */ public function isBackupGlobals(): bool { return true; diff --git a/vendor/phpunit/phpunit/src/Metadata/BackupStaticProperties.php b/vendor/phpunit/phpunit/src/Metadata/BackupStaticProperties.php index a75da06b..30cb9c4d 100644 --- a/vendor/phpunit/phpunit/src/Metadata/BackupStaticProperties.php +++ b/vendor/phpunit/phpunit/src/Metadata/BackupStaticProperties.php @@ -18,6 +18,9 @@ final class BackupStaticProperties extends Metadata { private readonly bool $enabled; + /** + * @psalm-param 0|1 $level + */ protected function __construct(int $level, bool $enabled) { parent::__construct($level); @@ -25,6 +28,9 @@ final class BackupStaticProperties extends Metadata $this->enabled = $enabled; } + /** + * @psalm-assert-if-true BackupStaticProperties $this + */ public function isBackupStaticProperties(): bool { return true; diff --git a/vendor/phpunit/phpunit/src/Metadata/Before.php b/vendor/phpunit/phpunit/src/Metadata/Before.php index 41c42bf0..08a72b47 100644 --- a/vendor/phpunit/phpunit/src/Metadata/Before.php +++ b/vendor/phpunit/phpunit/src/Metadata/Before.php @@ -16,6 +16,9 @@ namespace PHPUnit\Metadata; */ final class Before extends Metadata { + /** + * @psalm-assert-if-true Before $this + */ public function isBefore(): bool { return true; diff --git a/vendor/phpunit/phpunit/src/Metadata/BeforeClass.php b/vendor/phpunit/phpunit/src/Metadata/BeforeClass.php index b1c045fb..9ae35e51 100644 --- a/vendor/phpunit/phpunit/src/Metadata/BeforeClass.php +++ b/vendor/phpunit/phpunit/src/Metadata/BeforeClass.php @@ -16,6 +16,9 @@ namespace PHPUnit\Metadata; */ final class BeforeClass extends Metadata { + /** + * @psalm-assert-if-true BeforeClass $this + */ public function isBeforeClass(): bool { return true; diff --git a/vendor/phpunit/phpunit/src/Metadata/Covers.php b/vendor/phpunit/phpunit/src/Metadata/Covers.php index 7eacf4a8..b4c72345 100644 --- a/vendor/phpunit/phpunit/src/Metadata/Covers.php +++ b/vendor/phpunit/phpunit/src/Metadata/Covers.php @@ -16,8 +16,15 @@ namespace PHPUnit\Metadata; */ final class Covers extends Metadata { + /** + * @psalm-var non-empty-string + */ private readonly string $target; + /** + * @psalm-param 0|1 $level + * @psalm-param non-empty-string $target + */ protected function __construct(int $level, string $target) { parent::__construct($level); @@ -25,11 +32,17 @@ final class Covers extends Metadata $this->target = $target; } + /** + * @psalm-assert-if-true Covers $this + */ public function isCovers(): bool { return true; } + /** + * @psalm-return non-empty-string + */ public function target(): string { return $this->target; diff --git a/vendor/phpunit/phpunit/src/Metadata/CoversClass.php b/vendor/phpunit/phpunit/src/Metadata/CoversClass.php index c669c5c4..22889adf 100644 --- a/vendor/phpunit/phpunit/src/Metadata/CoversClass.php +++ b/vendor/phpunit/phpunit/src/Metadata/CoversClass.php @@ -22,6 +22,7 @@ final class CoversClass extends Metadata private readonly string $className; /** + * @psalm-param 0|1 $level * @psalm-param class-string $className */ protected function __construct(int $level, string $className) @@ -31,6 +32,9 @@ final class CoversClass extends Metadata $this->className = $className; } + /** + * @psalm-assert-if-true CoversClass $this + */ public function isCoversClass(): bool { return true; diff --git a/vendor/phpunit/phpunit/src/Metadata/CoversDefaultClass.php b/vendor/phpunit/phpunit/src/Metadata/CoversDefaultClass.php index 4592744d..3f7b57c4 100644 --- a/vendor/phpunit/phpunit/src/Metadata/CoversDefaultClass.php +++ b/vendor/phpunit/phpunit/src/Metadata/CoversDefaultClass.php @@ -22,6 +22,7 @@ final class CoversDefaultClass extends Metadata private readonly string $className; /** + * @psalm-param 0|1 $level * @psalm-param class-string $className */ protected function __construct(int $level, string $className) @@ -31,6 +32,9 @@ final class CoversDefaultClass extends Metadata $this->className = $className; } + /** + * @psalm-assert-if-true CoversDefaultClass $this + */ public function isCoversDefaultClass(): bool { return true; diff --git a/vendor/phpunit/phpunit/src/Metadata/CoversFunction.php b/vendor/phpunit/phpunit/src/Metadata/CoversFunction.php index a57945fc..ee9f858e 100644 --- a/vendor/phpunit/phpunit/src/Metadata/CoversFunction.php +++ b/vendor/phpunit/phpunit/src/Metadata/CoversFunction.php @@ -16,8 +16,15 @@ namespace PHPUnit\Metadata; */ final class CoversFunction extends Metadata { + /** + * @psalm-var non-empty-string + */ private readonly string $functionName; + /** + * @psalm-param 0|1 $level + * @psalm-param non-empty-string $functionName + */ protected function __construct(int $level, string $functionName) { parent::__construct($level); @@ -25,11 +32,17 @@ final class CoversFunction extends Metadata $this->functionName = $functionName; } + /** + * @psalm-assert-if-true CoversFunction $this + */ public function isCoversFunction(): bool { return true; } + /** + * @psalm-return non-empty-string + */ public function functionName(): string { return $this->functionName; diff --git a/vendor/phpunit/phpunit/src/Metadata/CoversNothing.php b/vendor/phpunit/phpunit/src/Metadata/CoversNothing.php index 863fe4d1..4703964e 100644 --- a/vendor/phpunit/phpunit/src/Metadata/CoversNothing.php +++ b/vendor/phpunit/phpunit/src/Metadata/CoversNothing.php @@ -16,6 +16,9 @@ namespace PHPUnit\Metadata; */ final class CoversNothing extends Metadata { + /** + * @psalm-assert-if-true CoversNothing $this + */ public function isCoversNothing(): bool { return true; diff --git a/vendor/phpunit/phpunit/src/Metadata/DataProvider.php b/vendor/phpunit/phpunit/src/Metadata/DataProvider.php index cef1d007..d1a0bfd5 100644 --- a/vendor/phpunit/phpunit/src/Metadata/DataProvider.php +++ b/vendor/phpunit/phpunit/src/Metadata/DataProvider.php @@ -20,10 +20,16 @@ final class DataProvider extends Metadata * @psalm-var class-string */ private readonly string $className; + + /** + * @psalm-var non-empty-string + */ private readonly string $methodName; /** + * @psalm-param 0|1 $level * @psalm-param class-string $className + * @psalm-param non-empty-string $methodName */ protected function __construct(int $level, string $className, string $methodName) { @@ -33,6 +39,9 @@ final class DataProvider extends Metadata $this->methodName = $methodName; } + /** + * @psalm-assert-if-true DataProvider $this + */ public function isDataProvider(): bool { return true; @@ -46,6 +55,9 @@ final class DataProvider extends Metadata return $this->className; } + /** + * @psalm-return non-empty-string + */ public function methodName(): string { return $this->methodName; diff --git a/vendor/phpunit/phpunit/src/Metadata/DependsOnClass.php b/vendor/phpunit/phpunit/src/Metadata/DependsOnClass.php index 7fa190b5..c146afd9 100644 --- a/vendor/phpunit/phpunit/src/Metadata/DependsOnClass.php +++ b/vendor/phpunit/phpunit/src/Metadata/DependsOnClass.php @@ -24,6 +24,7 @@ final class DependsOnClass extends Metadata private readonly bool $shallowClone; /** + * @psalm-param 0|1 $level * @psalm-param class-string $className */ protected function __construct(int $level, string $className, bool $deepClone, bool $shallowClone) @@ -35,6 +36,9 @@ final class DependsOnClass extends Metadata $this->shallowClone = $shallowClone; } + /** + * @psalm-assert-if-true DependsOnClass $this + */ public function isDependsOnClass(): bool { return true; diff --git a/vendor/phpunit/phpunit/src/Metadata/DependsOnMethod.php b/vendor/phpunit/phpunit/src/Metadata/DependsOnMethod.php index 4f76846e..1db27c7b 100644 --- a/vendor/phpunit/phpunit/src/Metadata/DependsOnMethod.php +++ b/vendor/phpunit/phpunit/src/Metadata/DependsOnMethod.php @@ -20,12 +20,18 @@ final class DependsOnMethod extends Metadata * @psalm-var class-string */ private readonly string $className; + + /** + * @psalm-var non-empty-string + */ private readonly string $methodName; private readonly bool $deepClone; private readonly bool $shallowClone; /** + * @psalm-param 0|1 $level * @psalm-param class-string $className + * @psalm-param non-empty-string $methodName */ protected function __construct(int $level, string $className, string $methodName, bool $deepClone, bool $shallowClone) { @@ -37,6 +43,9 @@ final class DependsOnMethod extends Metadata $this->shallowClone = $shallowClone; } + /** + * @psalm-assert-if-true DependsOnMethod $this + */ public function isDependsOnMethod(): bool { return true; @@ -50,6 +59,9 @@ final class DependsOnMethod extends Metadata return $this->className; } + /** + * @psalm-return non-empty-string + */ public function methodName(): string { return $this->methodName; diff --git a/vendor/phpunit/phpunit/src/Metadata/DoesNotPerformAssertions.php b/vendor/phpunit/phpunit/src/Metadata/DoesNotPerformAssertions.php index 9ae0bfd6..0e1ac0e7 100644 --- a/vendor/phpunit/phpunit/src/Metadata/DoesNotPerformAssertions.php +++ b/vendor/phpunit/phpunit/src/Metadata/DoesNotPerformAssertions.php @@ -16,6 +16,9 @@ namespace PHPUnit\Metadata; */ final class DoesNotPerformAssertions extends Metadata { + /** + * @psalm-assert-if-true DoesNotPerformAssertions $this + */ public function isDoesNotPerformAssertions(): bool { return true; diff --git a/vendor/phpunit/phpunit/src/Metadata/Exception/AnnotationsAreNotSupportedForInternalClassesException.php b/vendor/phpunit/phpunit/src/Metadata/Exception/AnnotationsAreNotSupportedForInternalClassesException.php index 17712b11..ddff62e0 100644 --- a/vendor/phpunit/phpunit/src/Metadata/Exception/AnnotationsAreNotSupportedForInternalClassesException.php +++ b/vendor/phpunit/phpunit/src/Metadata/Exception/AnnotationsAreNotSupportedForInternalClassesException.php @@ -10,12 +10,15 @@ namespace PHPUnit\Metadata; use function sprintf; +use PHPUnit\Exception; use RuntimeException; /** + * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit + * * @internal This class is not covered by the backward compatibility promise for PHPUnit */ -final class AnnotationsAreNotSupportedForInternalClassesException extends RuntimeException implements \PHPUnit\Exception +final class AnnotationsAreNotSupportedForInternalClassesException extends RuntimeException implements Exception { /** * @psalm-param class-string $className @@ -25,8 +28,8 @@ final class AnnotationsAreNotSupportedForInternalClassesException extends Runtim parent::__construct( sprintf( 'Annotations can only be parsed for user-defined classes, trying to parse annotations for class "%s"', - $className - ) + $className, + ), ); } } diff --git a/vendor/phpunit/phpunit/src/Metadata/Exception/ReflectionException.php b/vendor/phpunit/phpunit/src/Metadata/Exception/ReflectionException.php index 4311e83b..04e0d229 100644 --- a/vendor/phpunit/phpunit/src/Metadata/Exception/ReflectionException.php +++ b/vendor/phpunit/phpunit/src/Metadata/Exception/ReflectionException.php @@ -9,11 +9,14 @@ */ namespace PHPUnit\Metadata; +use PHPUnit\Exception; use RuntimeException; /** + * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit + * * @internal This class is not covered by the backward compatibility promise for PHPUnit */ -final class ReflectionException extends RuntimeException implements \PHPUnit\Exception +final class ReflectionException extends RuntimeException implements Exception { } diff --git a/vendor/phpunit/phpunit/src/Metadata/ExcludeGlobalVariableFromBackup.php b/vendor/phpunit/phpunit/src/Metadata/ExcludeGlobalVariableFromBackup.php index 71115868..a096d676 100644 --- a/vendor/phpunit/phpunit/src/Metadata/ExcludeGlobalVariableFromBackup.php +++ b/vendor/phpunit/phpunit/src/Metadata/ExcludeGlobalVariableFromBackup.php @@ -16,8 +16,15 @@ namespace PHPUnit\Metadata; */ final class ExcludeGlobalVariableFromBackup extends Metadata { + /** + * @psalm-var non-empty-string + */ private readonly string $globalVariableName; + /** + * @psalm-param 0|1 $level + * @psalm-param non-empty-string $globalVariableName + */ protected function __construct(int $level, string $globalVariableName) { parent::__construct($level); @@ -25,11 +32,17 @@ final class ExcludeGlobalVariableFromBackup extends Metadata $this->globalVariableName = $globalVariableName; } + /** + * @psalm-assert-if-true ExcludeGlobalVariableFromBackup $this + */ public function isExcludeGlobalVariableFromBackup(): bool { return true; } + /** + * @psalm-return non-empty-string + */ public function globalVariableName(): string { return $this->globalVariableName; diff --git a/vendor/phpunit/phpunit/src/Metadata/ExcludeStaticPropertyFromBackup.php b/vendor/phpunit/phpunit/src/Metadata/ExcludeStaticPropertyFromBackup.php index 50ac2fbd..53a3c523 100644 --- a/vendor/phpunit/phpunit/src/Metadata/ExcludeStaticPropertyFromBackup.php +++ b/vendor/phpunit/phpunit/src/Metadata/ExcludeStaticPropertyFromBackup.php @@ -20,10 +20,16 @@ final class ExcludeStaticPropertyFromBackup extends Metadata * @psalm-var class-string */ private readonly string $className; + + /** + * @psalm-var non-empty-string + */ private readonly string $propertyName; /** + * @psalm-param 0|1 $level * @psalm-param class-string $className + * @psalm-param non-empty-string $propertyName */ protected function __construct(int $level, string $className, string $propertyName) { @@ -33,6 +39,9 @@ final class ExcludeStaticPropertyFromBackup extends Metadata $this->propertyName = $propertyName; } + /** + * @psalm-assert-if-true ExcludeStaticPropertyFromBackup $this + */ public function isExcludeStaticPropertyFromBackup(): bool { return true; @@ -46,6 +55,9 @@ final class ExcludeStaticPropertyFromBackup extends Metadata return $this->className; } + /** + * @psalm-return non-empty-string + */ public function propertyName(): string { return $this->propertyName; diff --git a/vendor/phpunit/phpunit/src/Metadata/Group.php b/vendor/phpunit/phpunit/src/Metadata/Group.php index 1be2aa5b..e609d2ed 100644 --- a/vendor/phpunit/phpunit/src/Metadata/Group.php +++ b/vendor/phpunit/phpunit/src/Metadata/Group.php @@ -16,8 +16,15 @@ namespace PHPUnit\Metadata; */ final class Group extends Metadata { + /** + * @psalm-var non-empty-string + */ private readonly string $groupName; + /** + * @psalm-param 0|1 $level + * @psalm-param non-empty-string $groupName + */ protected function __construct(int $level, string $groupName) { parent::__construct($level); @@ -25,11 +32,17 @@ final class Group extends Metadata $this->groupName = $groupName; } + /** + * @psalm-assert-if-true Group $this + */ public function isGroup(): bool { return true; } + /** + * @psalm-return non-empty-string + */ public function groupName(): string { return $this->groupName; diff --git a/vendor/phpunit/phpunit/src/Metadata/Metadata.php b/vendor/phpunit/phpunit/src/Metadata/Metadata.php index 6ec74688..a98985f2 100644 --- a/vendor/phpunit/phpunit/src/Metadata/Metadata.php +++ b/vendor/phpunit/phpunit/src/Metadata/Metadata.php @@ -18,9 +18,12 @@ use PHPUnit\Metadata\Version\Requirement; */ abstract class Metadata { - private const CLASS_LEVEL = 0; - + private const CLASS_LEVEL = 0; private const METHOD_LEVEL = 1; + + /** + * @psalm-var 0|1 + */ private readonly int $level; public static function after(): After @@ -71,16 +74,25 @@ abstract class Metadata return new CoversClass(self::CLASS_LEVEL, $className); } + /** + * @psalm-param non-empty-string $functionName + */ public static function coversFunction(string $functionName): CoversFunction { return new CoversFunction(self::CLASS_LEVEL, $functionName); } + /** + * @psalm-param non-empty-string $target + */ public static function coversOnClass(string $target): Covers { return new Covers(self::CLASS_LEVEL, $target); } + /** + * @psalm-param non-empty-string $target + */ public static function coversOnMethod(string $target): Covers { return new Covers(self::METHOD_LEVEL, $target); @@ -106,17 +118,25 @@ abstract class Metadata /** * @psalm-param class-string $className + * @psalm-param non-empty-string $methodName */ public static function dataProvider(string $className, string $methodName): DataProvider { return new DataProvider(self::METHOD_LEVEL, $className, $methodName); } + /** + * @psalm-param class-string $className + */ public static function dependsOnClass(string $className, bool $deepClone, bool $shallowClone): DependsOnClass { return new DependsOnClass(self::METHOD_LEVEL, $className, $deepClone, $shallowClone); } + /** + * @psalm-param class-string $className + * @psalm-param non-empty-string $methodName + */ public static function dependsOnMethod(string $className, string $methodName, bool $deepClone, bool $shallowClone): DependsOnMethod { return new DependsOnMethod(self::METHOD_LEVEL, $className, $methodName, $deepClone, $shallowClone); @@ -132,11 +152,17 @@ abstract class Metadata return new DoesNotPerformAssertions(self::METHOD_LEVEL); } + /** + * @psalm-param non-empty-string $globalVariableName + */ public static function excludeGlobalVariableFromBackupOnClass(string $globalVariableName): ExcludeGlobalVariableFromBackup { return new ExcludeGlobalVariableFromBackup(self::CLASS_LEVEL, $globalVariableName); } + /** + * @psalm-param non-empty-string $globalVariableName + */ public static function excludeGlobalVariableFromBackupOnMethod(string $globalVariableName): ExcludeGlobalVariableFromBackup { return new ExcludeGlobalVariableFromBackup(self::METHOD_LEVEL, $globalVariableName); @@ -144,6 +170,7 @@ abstract class Metadata /** * @psalm-param class-string $className + * @psalm-param non-empty-string $propertyName */ public static function excludeStaticPropertyFromBackupOnClass(string $className, string $propertyName): ExcludeStaticPropertyFromBackup { @@ -152,22 +179,64 @@ abstract class Metadata /** * @psalm-param class-string $className + * @psalm-param non-empty-string $propertyName */ public static function excludeStaticPropertyFromBackupOnMethod(string $className, string $propertyName): ExcludeStaticPropertyFromBackup { return new ExcludeStaticPropertyFromBackup(self::METHOD_LEVEL, $className, $propertyName); } + /** + * @psalm-param non-empty-string $groupName + */ public static function groupOnClass(string $groupName): Group { return new Group(self::CLASS_LEVEL, $groupName); } + /** + * @psalm-param non-empty-string $groupName + */ public static function groupOnMethod(string $groupName): Group { return new Group(self::METHOD_LEVEL, $groupName); } + public static function ignoreDeprecationsOnClass(): IgnoreDeprecations + { + return new IgnoreDeprecations(self::CLASS_LEVEL); + } + + public static function ignoreDeprecationsOnMethod(): IgnoreDeprecations + { + return new IgnoreDeprecations(self::METHOD_LEVEL); + } + + /** + * @psalm-param class-string $className + */ + public static function ignoreClassForCodeCoverage(string $className): IgnoreClassForCodeCoverage + { + return new IgnoreClassForCodeCoverage(self::CLASS_LEVEL, $className); + } + + /** + * @psalm-param class-string $className + * @psalm-param non-empty-string $methodName + */ + public static function ignoreMethodForCodeCoverage(string $className, string $methodName): IgnoreMethodForCodeCoverage + { + return new IgnoreMethodForCodeCoverage(self::CLASS_LEVEL, $className, $methodName); + } + + /** + * @psalm-param non-empty-string $functionName + */ + public static function ignoreFunctionForCodeCoverage(string $functionName): IgnoreFunctionForCodeCoverage + { + return new IgnoreFunctionForCodeCoverage(self::CLASS_LEVEL, $functionName); + } + public static function postCondition(): PostCondition { return new PostCondition(self::METHOD_LEVEL); @@ -188,11 +257,17 @@ abstract class Metadata return new PreserveGlobalState(self::METHOD_LEVEL, $enabled); } + /** + * @psalm-param non-empty-string $functionName + */ public static function requiresFunctionOnClass(string $functionName): RequiresFunction { return new RequiresFunction(self::CLASS_LEVEL, $functionName); } + /** + * @psalm-param non-empty-string $functionName + */ public static function requiresFunctionOnMethod(string $functionName): RequiresFunction { return new RequiresFunction(self::METHOD_LEVEL, $functionName); @@ -200,6 +275,7 @@ abstract class Metadata /** * @psalm-param class-string $className + * @psalm-param non-empty-string $methodName */ public static function requiresMethodOnClass(string $className, string $methodName): RequiresMethod { @@ -208,27 +284,40 @@ abstract class Metadata /** * @psalm-param class-string $className + * @psalm-param non-empty-string $methodName */ public static function requiresMethodOnMethod(string $className, string $methodName): RequiresMethod { return new RequiresMethod(self::METHOD_LEVEL, $className, $methodName); } + /** + * @psalm-param non-empty-string $operatingSystem + */ public static function requiresOperatingSystemOnClass(string $operatingSystem): RequiresOperatingSystem { return new RequiresOperatingSystem(self::CLASS_LEVEL, $operatingSystem); } + /** + * @psalm-param non-empty-string $operatingSystem + */ public static function requiresOperatingSystemOnMethod(string $operatingSystem): RequiresOperatingSystem { return new RequiresOperatingSystem(self::METHOD_LEVEL, $operatingSystem); } + /** + * @psalm-param non-empty-string $operatingSystemFamily + */ public static function requiresOperatingSystemFamilyOnClass(string $operatingSystemFamily): RequiresOperatingSystemFamily { return new RequiresOperatingSystemFamily(self::CLASS_LEVEL, $operatingSystemFamily); } + /** + * @psalm-param non-empty-string $operatingSystemFamily + */ public static function requiresOperatingSystemFamilyOnMethod(string $operatingSystemFamily): RequiresOperatingSystemFamily { return new RequiresOperatingSystemFamily(self::METHOD_LEVEL, $operatingSystemFamily); @@ -244,11 +333,17 @@ abstract class Metadata return new RequiresPhp(self::METHOD_LEVEL, $versionRequirement); } + /** + * @psalm-param non-empty-string $extension + */ public static function requiresPhpExtensionOnClass(string $extension, ?Requirement $versionRequirement): RequiresPhpExtension { return new RequiresPhpExtension(self::CLASS_LEVEL, $extension, $versionRequirement); } + /** + * @psalm-param non-empty-string $extension + */ public static function requiresPhpExtensionOnMethod(string $extension, ?Requirement $versionRequirement): RequiresPhpExtension { return new RequiresPhpExtension(self::METHOD_LEVEL, $extension, $versionRequirement); @@ -264,11 +359,19 @@ abstract class Metadata return new RequiresPhpunit(self::METHOD_LEVEL, $versionRequirement); } + /** + * @psalm-param non-empty-string $setting + * @psalm-param non-empty-string $value + */ public static function requiresSettingOnClass(string $setting, string $value): RequiresSetting { return new RequiresSetting(self::CLASS_LEVEL, $setting, $value); } + /** + * @psalm-param non-empty-string $setting + * @psalm-param non-empty-string $value + */ public static function requiresSettingOnMethod(string $setting, string $value): RequiresSetting { return new RequiresSetting(self::METHOD_LEVEL, $setting, $value); @@ -294,17 +397,23 @@ abstract class Metadata return new Test(self::METHOD_LEVEL); } + /** + * @psalm-param non-empty-string $text + */ public static function testDoxOnClass(string $text): TestDox { return new TestDox(self::CLASS_LEVEL, $text); } + /** + * @psalm-param non-empty-string $text + */ public static function testDoxOnMethod(string $text): TestDox { return new TestDox(self::METHOD_LEVEL, $text); } - public static function testWith(array $data): TestWith + public static function testWith(mixed $data): TestWith { return new TestWith(self::METHOD_LEVEL, $data); } @@ -317,16 +426,25 @@ abstract class Metadata return new UsesClass(self::CLASS_LEVEL, $className); } + /** + * @psalm-param non-empty-string $functionName + */ public static function usesFunction(string $functionName): UsesFunction { return new UsesFunction(self::CLASS_LEVEL, $functionName); } + /** + * @psalm-param non-empty-string $target + */ public static function usesOnClass(string $target): Uses { return new Uses(self::CLASS_LEVEL, $target); } + /** + * @psalm-param non-empty-string $target + */ public static function usesOnMethod(string $target): Uses { return new Uses(self::METHOD_LEVEL, $target); @@ -340,6 +458,14 @@ abstract class Metadata return new UsesDefaultClass(self::CLASS_LEVEL, $className); } + public static function withoutErrorHandler(): WithoutErrorHandler + { + return new WithoutErrorHandler(self::METHOD_LEVEL); + } + + /** + * @psalm-param 0|1 $level + */ protected function __construct(int $level) { $this->level = $level; @@ -475,11 +601,17 @@ abstract class Metadata return false; } + /** + * @psalm-assert-if-true ExcludeGlobalVariableFromBackup $this + */ public function isExcludeGlobalVariableFromBackup(): bool { return false; } + /** + * @psalm-assert-if-true ExcludeStaticPropertyFromBackup $this + */ public function isExcludeStaticPropertyFromBackup(): bool { return false; @@ -493,6 +625,38 @@ abstract class Metadata return false; } + /** + * @psalm-assert-if-true IgnoreDeprecations $this + */ + public function isIgnoreDeprecations(): bool + { + return false; + } + + /** + * @psalm-assert-if-true IgnoreClassForCodeCoverage $this + */ + public function isIgnoreClassForCodeCoverage(): bool + { + return false; + } + + /** + * @psalm-assert-if-true IgnoreMethodForCodeCoverage $this + */ + public function isIgnoreMethodForCodeCoverage(): bool + { + return false; + } + + /** + * @psalm-assert-if-true IgnoreFunctionForCodeCoverage $this + */ + public function isIgnoreFunctionForCodeCoverage(): bool + { + return false; + } + /** * @psalm-assert-if-true RunClassInSeparateProcess $this */ @@ -660,4 +824,12 @@ abstract class Metadata { return false; } + + /** + * @psalm-assert-if-true WithoutErrorHandler $this + */ + public function isWithoutErrorHandler(): bool + { + return false; + } } diff --git a/vendor/phpunit/phpunit/src/Metadata/MetadataCollection.php b/vendor/phpunit/phpunit/src/Metadata/MetadataCollection.php index 247a040c..d0b96568 100644 --- a/vendor/phpunit/phpunit/src/Metadata/MetadataCollection.php +++ b/vendor/phpunit/phpunit/src/Metadata/MetadataCollection.php @@ -75,8 +75,8 @@ final class MetadataCollection implements Countable, IteratorAggregate return new self( ...array_merge( $this->asArray(), - $other->asArray() - ) + $other->asArray(), + ), ); } @@ -85,8 +85,8 @@ final class MetadataCollection implements Countable, IteratorAggregate return new self( ...array_filter( $this->metadata, - static fn (Metadata $metadata): bool => $metadata->isClassLevel() - ) + static fn (Metadata $metadata): bool => $metadata->isClassLevel(), + ), ); } @@ -95,8 +95,8 @@ final class MetadataCollection implements Countable, IteratorAggregate return new self( ...array_filter( $this->metadata, - static fn (Metadata $metadata): bool => $metadata->isMethodLevel() - ) + static fn (Metadata $metadata): bool => $metadata->isMethodLevel(), + ), ); } @@ -105,8 +105,8 @@ final class MetadataCollection implements Countable, IteratorAggregate return new self( ...array_filter( $this->metadata, - static fn (Metadata $metadata): bool => $metadata->isAfter() - ) + static fn (Metadata $metadata): bool => $metadata->isAfter(), + ), ); } @@ -115,8 +115,8 @@ final class MetadataCollection implements Countable, IteratorAggregate return new self( ...array_filter( $this->metadata, - static fn (Metadata $metadata): bool => $metadata->isAfterClass() - ) + static fn (Metadata $metadata): bool => $metadata->isAfterClass(), + ), ); } @@ -125,8 +125,8 @@ final class MetadataCollection implements Countable, IteratorAggregate return new self( ...array_filter( $this->metadata, - static fn (Metadata $metadata): bool => $metadata->isBackupGlobals() - ) + static fn (Metadata $metadata): bool => $metadata->isBackupGlobals(), + ), ); } @@ -135,8 +135,8 @@ final class MetadataCollection implements Countable, IteratorAggregate return new self( ...array_filter( $this->metadata, - static fn (Metadata $metadata): bool => $metadata->isBackupStaticProperties() - ) + static fn (Metadata $metadata): bool => $metadata->isBackupStaticProperties(), + ), ); } @@ -145,8 +145,8 @@ final class MetadataCollection implements Countable, IteratorAggregate return new self( ...array_filter( $this->metadata, - static fn (Metadata $metadata): bool => $metadata->isBeforeClass() - ) + static fn (Metadata $metadata): bool => $metadata->isBeforeClass(), + ), ); } @@ -155,8 +155,8 @@ final class MetadataCollection implements Countable, IteratorAggregate return new self( ...array_filter( $this->metadata, - static fn (Metadata $metadata): bool => $metadata->isBefore() - ) + static fn (Metadata $metadata): bool => $metadata->isBefore(), + ), ); } @@ -165,8 +165,8 @@ final class MetadataCollection implements Countable, IteratorAggregate return new self( ...array_filter( $this->metadata, - static fn (Metadata $metadata): bool => $metadata->isCovers() - ) + static fn (Metadata $metadata): bool => $metadata->isCovers(), + ), ); } @@ -175,8 +175,8 @@ final class MetadataCollection implements Countable, IteratorAggregate return new self( ...array_filter( $this->metadata, - static fn (Metadata $metadata): bool => $metadata->isCoversClass() - ) + static fn (Metadata $metadata): bool => $metadata->isCoversClass(), + ), ); } @@ -185,8 +185,8 @@ final class MetadataCollection implements Countable, IteratorAggregate return new self( ...array_filter( $this->metadata, - static fn (Metadata $metadata): bool => $metadata->isCoversDefaultClass() - ) + static fn (Metadata $metadata): bool => $metadata->isCoversDefaultClass(), + ), ); } @@ -195,8 +195,8 @@ final class MetadataCollection implements Countable, IteratorAggregate return new self( ...array_filter( $this->metadata, - static fn (Metadata $metadata): bool => $metadata->isCoversFunction() - ) + static fn (Metadata $metadata): bool => $metadata->isCoversFunction(), + ), ); } @@ -205,8 +205,8 @@ final class MetadataCollection implements Countable, IteratorAggregate return new self( ...array_filter( $this->metadata, - static fn (Metadata $metadata): bool => $metadata->isExcludeGlobalVariableFromBackup() - ) + static fn (Metadata $metadata): bool => $metadata->isExcludeGlobalVariableFromBackup(), + ), ); } @@ -215,8 +215,8 @@ final class MetadataCollection implements Countable, IteratorAggregate return new self( ...array_filter( $this->metadata, - static fn (Metadata $metadata): bool => $metadata->isExcludeStaticPropertyFromBackup() - ) + static fn (Metadata $metadata): bool => $metadata->isExcludeStaticPropertyFromBackup(), + ), ); } @@ -225,8 +225,8 @@ final class MetadataCollection implements Countable, IteratorAggregate return new self( ...array_filter( $this->metadata, - static fn (Metadata $metadata): bool => $metadata->isCoversNothing() - ) + static fn (Metadata $metadata): bool => $metadata->isCoversNothing(), + ), ); } @@ -235,8 +235,8 @@ final class MetadataCollection implements Countable, IteratorAggregate return new self( ...array_filter( $this->metadata, - static fn (Metadata $metadata): bool => $metadata->isDataProvider() - ) + static fn (Metadata $metadata): bool => $metadata->isDataProvider(), + ), ); } @@ -245,8 +245,8 @@ final class MetadataCollection implements Countable, IteratorAggregate return new self( ...array_filter( $this->metadata, - static fn (Metadata $metadata): bool => $metadata->isDependsOnClass() || $metadata->isDependsOnMethod() - ) + static fn (Metadata $metadata): bool => $metadata->isDependsOnClass() || $metadata->isDependsOnMethod(), + ), ); } @@ -255,8 +255,8 @@ final class MetadataCollection implements Countable, IteratorAggregate return new self( ...array_filter( $this->metadata, - static fn (Metadata $metadata): bool => $metadata->isDependsOnClass() - ) + static fn (Metadata $metadata): bool => $metadata->isDependsOnClass(), + ), ); } @@ -265,8 +265,8 @@ final class MetadataCollection implements Countable, IteratorAggregate return new self( ...array_filter( $this->metadata, - static fn (Metadata $metadata): bool => $metadata->isDependsOnMethod() - ) + static fn (Metadata $metadata): bool => $metadata->isDependsOnMethod(), + ), ); } @@ -275,8 +275,8 @@ final class MetadataCollection implements Countable, IteratorAggregate return new self( ...array_filter( $this->metadata, - static fn (Metadata $metadata): bool => $metadata->isDoesNotPerformAssertions() - ) + static fn (Metadata $metadata): bool => $metadata->isDoesNotPerformAssertions(), + ), ); } @@ -285,8 +285,57 @@ final class MetadataCollection implements Countable, IteratorAggregate return new self( ...array_filter( $this->metadata, - static fn (Metadata $metadata): bool => $metadata->isGroup() - ) + static fn (Metadata $metadata): bool => $metadata->isGroup(), + ), + ); + } + + public function isIgnoreDeprecations(): self + { + return new self( + ...array_filter( + $this->metadata, + static fn (Metadata $metadata): bool => $metadata->isIgnoreDeprecations(), + ), + ); + } + + /** + * @deprecated https://github.com/sebastianbergmann/phpunit/issues/5513 + */ + public function isIgnoreClassForCodeCoverage(): self + { + return new self( + ...array_filter( + $this->metadata, + static fn (Metadata $metadata): bool => $metadata->isIgnoreClassForCodeCoverage(), + ), + ); + } + + /** + * @deprecated https://github.com/sebastianbergmann/phpunit/issues/5513 + */ + public function isIgnoreMethodForCodeCoverage(): self + { + return new self( + ...array_filter( + $this->metadata, + static fn (Metadata $metadata): bool => $metadata->isIgnoreMethodForCodeCoverage(), + ), + ); + } + + /** + * @deprecated https://github.com/sebastianbergmann/phpunit/issues/5513 + */ + public function isIgnoreFunctionForCodeCoverage(): self + { + return new self( + ...array_filter( + $this->metadata, + static fn (Metadata $metadata): bool => $metadata->isIgnoreFunctionForCodeCoverage(), + ), ); } @@ -295,8 +344,8 @@ final class MetadataCollection implements Countable, IteratorAggregate return new self( ...array_filter( $this->metadata, - static fn (Metadata $metadata): bool => $metadata->isRunClassInSeparateProcess() - ) + static fn (Metadata $metadata): bool => $metadata->isRunClassInSeparateProcess(), + ), ); } @@ -305,8 +354,8 @@ final class MetadataCollection implements Countable, IteratorAggregate return new self( ...array_filter( $this->metadata, - static fn (Metadata $metadata): bool => $metadata->isRunInSeparateProcess() - ) + static fn (Metadata $metadata): bool => $metadata->isRunInSeparateProcess(), + ), ); } @@ -315,8 +364,8 @@ final class MetadataCollection implements Countable, IteratorAggregate return new self( ...array_filter( $this->metadata, - static fn (Metadata $metadata): bool => $metadata->isRunTestsInSeparateProcesses() - ) + static fn (Metadata $metadata): bool => $metadata->isRunTestsInSeparateProcesses(), + ), ); } @@ -325,8 +374,8 @@ final class MetadataCollection implements Countable, IteratorAggregate return new self( ...array_filter( $this->metadata, - static fn (Metadata $metadata): bool => $metadata->isTest() - ) + static fn (Metadata $metadata): bool => $metadata->isTest(), + ), ); } @@ -335,8 +384,8 @@ final class MetadataCollection implements Countable, IteratorAggregate return new self( ...array_filter( $this->metadata, - static fn (Metadata $metadata): bool => $metadata->isPreCondition() - ) + static fn (Metadata $metadata): bool => $metadata->isPreCondition(), + ), ); } @@ -345,8 +394,8 @@ final class MetadataCollection implements Countable, IteratorAggregate return new self( ...array_filter( $this->metadata, - static fn (Metadata $metadata): bool => $metadata->isPostCondition() - ) + static fn (Metadata $metadata): bool => $metadata->isPostCondition(), + ), ); } @@ -355,8 +404,8 @@ final class MetadataCollection implements Countable, IteratorAggregate return new self( ...array_filter( $this->metadata, - static fn (Metadata $metadata): bool => $metadata->isPreserveGlobalState() - ) + static fn (Metadata $metadata): bool => $metadata->isPreserveGlobalState(), + ), ); } @@ -365,8 +414,8 @@ final class MetadataCollection implements Countable, IteratorAggregate return new self( ...array_filter( $this->metadata, - static fn (Metadata $metadata): bool => $metadata->isRequiresMethod() - ) + static fn (Metadata $metadata): bool => $metadata->isRequiresMethod(), + ), ); } @@ -375,8 +424,8 @@ final class MetadataCollection implements Countable, IteratorAggregate return new self( ...array_filter( $this->metadata, - static fn (Metadata $metadata): bool => $metadata->isRequiresFunction() - ) + static fn (Metadata $metadata): bool => $metadata->isRequiresFunction(), + ), ); } @@ -385,8 +434,8 @@ final class MetadataCollection implements Countable, IteratorAggregate return new self( ...array_filter( $this->metadata, - static fn (Metadata $metadata): bool => $metadata->isRequiresOperatingSystem() - ) + static fn (Metadata $metadata): bool => $metadata->isRequiresOperatingSystem(), + ), ); } @@ -395,8 +444,8 @@ final class MetadataCollection implements Countable, IteratorAggregate return new self( ...array_filter( $this->metadata, - static fn (Metadata $metadata): bool => $metadata->isRequiresOperatingSystemFamily() - ) + static fn (Metadata $metadata): bool => $metadata->isRequiresOperatingSystemFamily(), + ), ); } @@ -405,8 +454,8 @@ final class MetadataCollection implements Countable, IteratorAggregate return new self( ...array_filter( $this->metadata, - static fn (Metadata $metadata): bool => $metadata->isRequiresPhp() - ) + static fn (Metadata $metadata): bool => $metadata->isRequiresPhp(), + ), ); } @@ -415,8 +464,8 @@ final class MetadataCollection implements Countable, IteratorAggregate return new self( ...array_filter( $this->metadata, - static fn (Metadata $metadata): bool => $metadata->isRequiresPhpExtension() - ) + static fn (Metadata $metadata): bool => $metadata->isRequiresPhpExtension(), + ), ); } @@ -425,8 +474,8 @@ final class MetadataCollection implements Countable, IteratorAggregate return new self( ...array_filter( $this->metadata, - static fn (Metadata $metadata): bool => $metadata->isRequiresPhpunit() - ) + static fn (Metadata $metadata): bool => $metadata->isRequiresPhpunit(), + ), ); } @@ -435,8 +484,8 @@ final class MetadataCollection implements Countable, IteratorAggregate return new self( ...array_filter( $this->metadata, - static fn (Metadata $metadata): bool => $metadata->isRequiresSetting() - ) + static fn (Metadata $metadata): bool => $metadata->isRequiresSetting(), + ), ); } @@ -445,8 +494,8 @@ final class MetadataCollection implements Countable, IteratorAggregate return new self( ...array_filter( $this->metadata, - static fn (Metadata $metadata): bool => $metadata->isTestDox() - ) + static fn (Metadata $metadata): bool => $metadata->isTestDox(), + ), ); } @@ -455,8 +504,8 @@ final class MetadataCollection implements Countable, IteratorAggregate return new self( ...array_filter( $this->metadata, - static fn (Metadata $metadata): bool => $metadata->isTestWith() - ) + static fn (Metadata $metadata): bool => $metadata->isTestWith(), + ), ); } @@ -465,8 +514,8 @@ final class MetadataCollection implements Countable, IteratorAggregate return new self( ...array_filter( $this->metadata, - static fn (Metadata $metadata): bool => $metadata->isUses() - ) + static fn (Metadata $metadata): bool => $metadata->isUses(), + ), ); } @@ -475,8 +524,8 @@ final class MetadataCollection implements Countable, IteratorAggregate return new self( ...array_filter( $this->metadata, - static fn (Metadata $metadata): bool => $metadata->isUsesClass() - ) + static fn (Metadata $metadata): bool => $metadata->isUsesClass(), + ), ); } @@ -485,8 +534,8 @@ final class MetadataCollection implements Countable, IteratorAggregate return new self( ...array_filter( $this->metadata, - static fn (Metadata $metadata): bool => $metadata->isUsesDefaultClass() - ) + static fn (Metadata $metadata): bool => $metadata->isUsesDefaultClass(), + ), ); } @@ -495,8 +544,18 @@ final class MetadataCollection implements Countable, IteratorAggregate return new self( ...array_filter( $this->metadata, - static fn (Metadata $metadata): bool => $metadata->isUsesFunction() - ) + static fn (Metadata $metadata): bool => $metadata->isUsesFunction(), + ), + ); + } + + public function isWithoutErrorHandler(): self + { + return new self( + ...array_filter( + $this->metadata, + static fn (Metadata $metadata): bool => $metadata->isWithoutErrorHandler(), + ), ); } } diff --git a/vendor/phpunit/phpunit/src/Metadata/Parser/Annotation/DocBlock.php b/vendor/phpunit/phpunit/src/Metadata/Parser/Annotation/DocBlock.php index 79351672..d88032b6 100644 --- a/vendor/phpunit/phpunit/src/Metadata/Parser/Annotation/DocBlock.php +++ b/vendor/phpunit/phpunit/src/Metadata/Parser/Annotation/DocBlock.php @@ -34,19 +34,17 @@ use ReflectionMethod; * allowing us to ask meaningful questions about a specific * reflection symbol. * + * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit + * * @internal This class is not covered by the backward compatibility promise for PHPUnit */ final class DocBlock { - private const REGEX_REQUIRES_VERSION = '/@requires\s+(?PPHP(?:Unit)?)\s+(?P[<>=!]{0,2})\s*(?P[\d\.-]+(dev|(RC|alpha|beta)[\d\.])?)[ \t]*\r?$/m'; - + private const REGEX_REQUIRES_VERSION = '/@requires\s+(?PPHP(?:Unit)?)\s+(?P[<>=!]{0,2})\s*(?P[\d\.-]+(dev|(RC|alpha|beta)[\d\.])?)[ \t]*\r?$/m'; private const REGEX_REQUIRES_VERSION_CONSTRAINT = '/@requires\s+(?PPHP(?:Unit)?)\s+(?P[\d\t \-.|~^]+)[ \t]*\r?$/m'; - - private const REGEX_REQUIRES_OS = '/@requires\s+(?POS(?:FAMILY)?)\s+(?P.+?)[ \t]*\r?$/m'; - - private const REGEX_REQUIRES_SETTING = '/@requires\s+(?Psetting)\s+(?P([^ ]+?))\s*(?P[\w\.-]+[\w\.]?)?[ \t]*\r?$/m'; - - private const REGEX_REQUIRES = '/@requires\s+(?Pfunction|extension)\s+(?P([^\s<>=!]+))\s*(?P[<>=!]{0,2})\s*(?P[\d\.-]+[\d\.]?)?[ \t]*\r?$/m'; + private const REGEX_REQUIRES_OS = '/@requires\s+(?POS(?:FAMILY)?)\s+(?P.+?)[ \t]*\r?$/m'; + private const REGEX_REQUIRES_SETTING = '/@requires\s+(?Psetting)\s+(?P([^ ]+?))\s*(?P[\w\.-]+[\w\.]?)?[ \t]*\r?$/m'; + private const REGEX_REQUIRES = '/@requires\s+(?Pfunction|extension)\s+(?P([^\s<>=!]+))\s*(?P[<>=!]{0,2})\s*(?P[\d\.-]+[\d\.]?)?[ \t]*\r?$/m'; private readonly string $docComment; /** @@ -55,14 +53,14 @@ final class DocBlock private readonly array $symbolAnnotations; /** - * @psalm-var null|(array{ + * @psalm-var null|(array< + * string, + * array|array{constraint: string}|array{version: string, operator: string}|string + * >&array{ * __OFFSET: array&array{__FILE: string}, * setting?: array, * extension_versions?: array - * }&array< - * string, - * string|array{version: string, operator: string}|array{constraint: string}|array - * >) + * }) */ private ?array $parsedRequirements = null; private readonly int $startLine; @@ -116,6 +114,8 @@ final class DocBlock } /** + * @throws InvalidVersionRequirementException + * * @psalm-return array{ * __OFFSET: array&array{__FILE: string}, * setting?: array, @@ -177,7 +177,7 @@ final class DocBlock throw new InvalidVersionRequirementException( $e->getMessage(), $e->getCode(), - $e + $e, ); } } @@ -215,8 +215,8 @@ final class DocBlock [ 'setting' => $recordedSettings, 'extension_versions' => $extensionVersions, - ] - ) + ], + ), ); } @@ -254,14 +254,14 @@ final class DocBlock $annotations, ...array_map( static fn (ReflectionClass $trait): array => self::parseDocBlock((string) $trait->getDocComment()), - array_values($reflector->getTraits()) - ) + array_values($reflector->getTraits()), + ), ); } return array_merge( $annotations, - self::parseDocBlock((string) $reflector->getDocComment()) + self::parseDocBlock((string) $reflector->getDocComment()), ); } } diff --git a/vendor/phpunit/phpunit/src/Metadata/Parser/Annotation/Registry.php b/vendor/phpunit/phpunit/src/Metadata/Parser/Annotation/Registry.php index 80bfde7c..51397a70 100644 --- a/vendor/phpunit/phpunit/src/Metadata/Parser/Annotation/Registry.php +++ b/vendor/phpunit/phpunit/src/Metadata/Parser/Annotation/Registry.php @@ -19,6 +19,8 @@ use ReflectionMethod; * Reflection information, and therefore DocBlock information, is static within * a single PHP process. It is therefore okay to use a Singleton registry here. * + * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit + * * @internal This class is not covered by the backward compatibility promise for PHPUnit */ final class Registry @@ -40,10 +42,6 @@ final class Registry return self::$instance ?? self::$instance = new self; } - private function __construct() - { - } - /** * @psalm-param class-string $class * @@ -63,7 +61,7 @@ final class Registry throw new ReflectionException( $e->getMessage(), $e->getCode(), - $e + $e, ); } // @codeCoverageIgnoreEnd @@ -90,7 +88,7 @@ final class Registry throw new ReflectionException( $e->getMessage(), $e->getCode(), - $e + $e, ); } // @codeCoverageIgnoreEnd diff --git a/vendor/phpunit/phpunit/src/Metadata/Parser/AnnotationParser.php b/vendor/phpunit/phpunit/src/Metadata/Parser/AnnotationParser.php index fdc082e0..cdb42dc8 100644 --- a/vendor/phpunit/phpunit/src/Metadata/Parser/AnnotationParser.php +++ b/vendor/phpunit/phpunit/src/Metadata/Parser/AnnotationParser.php @@ -10,17 +10,23 @@ namespace PHPUnit\Metadata\Parser; use function array_merge; +use function assert; +use function class_exists; use function count; use function explode; use function method_exists; use function preg_replace; +use function rtrim; +use function sprintf; use function str_contains; use function str_starts_with; use function strlen; use function substr; use function trim; +use PHPUnit\Event\Facade as EventFacade; use PHPUnit\Metadata\Annotation\Parser\Registry as AnnotationRegistry; use PHPUnit\Metadata\AnnotationsAreNotSupportedForInternalClassesException; +use PHPUnit\Metadata\InvalidVersionRequirementException; use PHPUnit\Metadata\Metadata; use PHPUnit\Metadata\MetadataCollection; use PHPUnit\Metadata\ReflectionException; @@ -30,6 +36,8 @@ use PHPUnit\Util\InvalidVersionOperatorException; use PHPUnit\Util\VersionComparisonOperator; /** + * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit + * * @internal This class is not covered by the backward compatibility promise for PHPUnit */ final class AnnotationParser implements Parser @@ -43,6 +51,8 @@ final class AnnotationParser implements Parser */ public function forClass(string $className): MetadataCollection { + assert(class_exists($className)); + $result = []; foreach (AnnotationRegistry::getInstance()->forClassName($className)->symbolAnnotations() as $annotation => $values) { @@ -145,13 +155,23 @@ final class AnnotationParser implements Parser } } - $result = array_merge( - $result, - $this->parseRequirements( - AnnotationRegistry::getInstance()->forClassName($className)->requirements(), - 'class' - ) - ); + try { + $result = array_merge( + $result, + $this->parseRequirements( + AnnotationRegistry::getInstance()->forClassName($className)->requirements(), + 'class', + ), + ); + } catch (InvalidVersionRequirementException $e) { + EventFacade::emitter()->testRunnerTriggeredPhpunitWarning( + sprintf( + 'Class %s is annotated using an invalid version requirement: %s', + $className, + $e->getMessage(), + ), + ); + } return MetadataCollection::fromArray($result); } @@ -166,6 +186,9 @@ final class AnnotationParser implements Parser */ public function forMethod(string $className, string $methodName): MetadataCollection { + assert(class_exists($className)); + assert(method_exists($className, $methodName)); + $result = []; foreach (AnnotationRegistry::getInstance()->forMethod($className, $methodName)->symbolAnnotations() as $annotation => $values) { @@ -217,6 +240,8 @@ final class AnnotationParser implements Parser case 'dataProvider': foreach ($values as $value) { + $value = rtrim($value, " ()\n\r\t\v\x00"); + if (str_contains($value, '::')) { $result[] = Metadata::dataProvider(...explode('::', $value)); @@ -246,15 +271,18 @@ final class AnnotationParser implements Parser } if (str_contains($value, '::')) { - [$className, $methodName] = explode('::', $value); + [$_className, $_methodName] = explode('::', $value); - if ($methodName === 'class') { - $result[] = Metadata::dependsOnClass($className, $deepClone, $shallowClone); + assert($_className !== ''); + assert($_methodName !== ''); + + if ($_methodName === 'class') { + $result[] = Metadata::dependsOnClass($_className, $deepClone, $shallowClone); continue; } - $result[] = Metadata::dependsOnMethod($className, $methodName, $deepClone, $shallowClone); + $result[] = Metadata::dependsOnMethod($_className, $_methodName, $deepClone, $shallowClone); continue; } @@ -286,7 +314,7 @@ final class AnnotationParser implements Parser $result[] = Metadata::excludeStaticPropertyFromBackupOnMethod( trim($tmp[0]), - trim($tmp[1]) + trim($tmp[1]), ); } @@ -357,13 +385,24 @@ final class AnnotationParser implements Parser } if (method_exists($className, $methodName)) { - $result = array_merge( - $result, - $this->parseRequirements( - AnnotationRegistry::getInstance()->forMethod($className, $methodName)->requirements(), - 'method' - ) - ); + try { + $result = array_merge( + $result, + $this->parseRequirements( + AnnotationRegistry::getInstance()->forMethod($className, $methodName)->requirements(), + 'method', + ), + ); + } catch (InvalidVersionRequirementException $e) { + EventFacade::emitter()->testRunnerTriggeredPhpunitWarning( + sprintf( + 'Method %s::%s is annotated using an invalid version requirement: %s', + $className, + $methodName, + $e->getMessage(), + ), + ); + } } return MetadataCollection::fromArray($result); @@ -380,7 +419,7 @@ final class AnnotationParser implements Parser public function forClassAndMethod(string $className, string $methodName): MetadataCollection { return $this->forClass($className)->mergeWith( - $this->forMethod($className, $methodName) + $this->forMethod($className, $methodName), ); } @@ -401,9 +440,9 @@ final class AnnotationParser implements Parser } /** - * @psalm-return list - * * @throws InvalidVersionOperatorException + * + * @psalm-return list */ private function parseRequirements(array $requirements, string $level): array { @@ -412,7 +451,7 @@ final class AnnotationParser implements Parser if (!empty($requirements['PHP'])) { $versionRequirement = new ComparisonRequirement( $requirements['PHP']['version'], - new VersionComparisonOperator(empty($requirements['PHP']['operator']) ? '>=' : $requirements['PHP']['operator']) + new VersionComparisonOperator(empty($requirements['PHP']['operator']) ? '>=' : $requirements['PHP']['operator']), ); if ($level === 'class') { @@ -448,7 +487,7 @@ final class AnnotationParser implements Parser foreach ($requirements['extension_versions'] as $extension => $version) { $versionRequirement = new ComparisonRequirement( $version['version'], - new VersionComparisonOperator(empty($version['operator']) ? '>=' : $version['operator']) + new VersionComparisonOperator(empty($version['operator']) ? '>=' : $version['operator']), ); if ($level === 'class') { @@ -462,7 +501,7 @@ final class AnnotationParser implements Parser if (!empty($requirements['PHPUnit'])) { $versionRequirement = new ComparisonRequirement( $requirements['PHPUnit']['version'], - new VersionComparisonOperator(empty($requirements['PHPUnit']['operator']) ? '>=' : $requirements['PHPUnit']['operator']) + new VersionComparisonOperator(empty($requirements['PHPUnit']['operator']) ? '>=' : $requirements['PHPUnit']['operator']), ); if ($level === 'class') { diff --git a/vendor/phpunit/phpunit/src/Metadata/Parser/AttributeParser.php b/vendor/phpunit/phpunit/src/Metadata/Parser/AttributeParser.php index a1024680..e6f0b709 100644 --- a/vendor/phpunit/phpunit/src/Metadata/Parser/AttributeParser.php +++ b/vendor/phpunit/phpunit/src/Metadata/Parser/AttributeParser.php @@ -11,8 +11,11 @@ namespace PHPUnit\Metadata\Parser; use const JSON_THROW_ON_ERROR; use function assert; +use function class_exists; use function json_decode; +use function method_exists; use function str_starts_with; +use Error; use PHPUnit\Framework\Attributes\After; use PHPUnit\Framework\Attributes\AfterClass; use PHPUnit\Framework\Attributes\BackupGlobals; @@ -37,6 +40,10 @@ use PHPUnit\Framework\Attributes\DoesNotPerformAssertions; use PHPUnit\Framework\Attributes\ExcludeGlobalVariableFromBackup; use PHPUnit\Framework\Attributes\ExcludeStaticPropertyFromBackup; use PHPUnit\Framework\Attributes\Group; +use PHPUnit\Framework\Attributes\IgnoreClassForCodeCoverage; +use PHPUnit\Framework\Attributes\IgnoreDeprecations; +use PHPUnit\Framework\Attributes\IgnoreFunctionForCodeCoverage; +use PHPUnit\Framework\Attributes\IgnoreMethodForCodeCoverage; use PHPUnit\Framework\Attributes\Large; use PHPUnit\Framework\Attributes\Medium; use PHPUnit\Framework\Attributes\PostCondition; @@ -61,13 +68,17 @@ use PHPUnit\Framework\Attributes\TestWithJson; use PHPUnit\Framework\Attributes\Ticket; use PHPUnit\Framework\Attributes\UsesClass; use PHPUnit\Framework\Attributes\UsesFunction; +use PHPUnit\Framework\Attributes\WithoutErrorHandler; +use PHPUnit\Metadata\InvalidAttributeException; use PHPUnit\Metadata\Metadata; use PHPUnit\Metadata\MetadataCollection; -use PHPUnit\Metadata\Version\ConstraintRequirement; +use PHPUnit\Metadata\Version\Requirement; use ReflectionClass; use ReflectionMethod; /** + * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit + * * @internal This class is not covered by the backward compatibility promise for PHPUnit */ final class AttributeParser implements Parser @@ -77,14 +88,31 @@ final class AttributeParser implements Parser */ public function forClass(string $className): MetadataCollection { - $result = []; + assert(class_exists($className)); - foreach ((new ReflectionClass($className))->getAttributes() as $attribute) { + $reflector = new ReflectionClass($className); + $result = []; + + foreach ($reflector->getAttributes() as $attribute) { if (!str_starts_with($attribute->getName(), 'PHPUnit\\Framework\\Attributes\\')) { continue; } - $attributeInstance = $attribute->newInstance(); + if (!class_exists($attribute->getName())) { + continue; + } + + try { + $attributeInstance = $attribute->newInstance(); + } catch (Error $e) { + throw new InvalidAttributeException( + $attribute->getName(), + 'class ' . $className, + $reflector->getFileName(), + $reflector->getStartLine(), + $e->getMessage(), + ); + } switch ($attribute->getName()) { case BackupGlobals::class: @@ -137,7 +165,7 @@ final class AttributeParser implements Parser $result[] = Metadata::excludeStaticPropertyFromBackupOnClass( $attributeInstance->className(), - $attributeInstance->propertyName() + $attributeInstance->propertyName(), ); break; @@ -159,6 +187,34 @@ final class AttributeParser implements Parser break; + case IgnoreClassForCodeCoverage::class: + assert($attributeInstance instanceof IgnoreClassForCodeCoverage); + + $result[] = Metadata::ignoreClassForCodeCoverage($attributeInstance->className()); + + break; + + case IgnoreDeprecations::class: + assert($attributeInstance instanceof IgnoreDeprecations); + + $result[] = Metadata::ignoreDeprecationsOnClass(); + + break; + + case IgnoreMethodForCodeCoverage::class: + assert($attributeInstance instanceof IgnoreMethodForCodeCoverage); + + $result[] = Metadata::ignoreMethodForCodeCoverage($attributeInstance->className(), $attributeInstance->methodName()); + + break; + + case IgnoreFunctionForCodeCoverage::class: + assert($attributeInstance instanceof IgnoreFunctionForCodeCoverage); + + $result[] = Metadata::ignoreFunctionForCodeCoverage($attributeInstance->functionName()); + + break; + case PreserveGlobalState::class: assert($attributeInstance instanceof PreserveGlobalState); @@ -171,7 +227,7 @@ final class AttributeParser implements Parser $result[] = Metadata::requiresMethodOnClass( $attributeInstance->className(), - $attributeInstance->methodName() + $attributeInstance->methodName(), ); break; @@ -201,9 +257,9 @@ final class AttributeParser implements Parser assert($attributeInstance instanceof RequiresPhp); $result[] = Metadata::requiresPhpOnClass( - ConstraintRequirement::from( - $attributeInstance->versionRequirement() - ) + Requirement::from( + $attributeInstance->versionRequirement(), + ), ); break; @@ -215,12 +271,12 @@ final class AttributeParser implements Parser $versionRequirement = $attributeInstance->versionRequirement(); if ($versionRequirement !== null) { - $versionConstraint = ConstraintRequirement::from($versionRequirement); + $versionConstraint = Requirement::from($versionRequirement); } $result[] = Metadata::requiresPhpExtensionOnClass( $attributeInstance->extension(), - $versionConstraint + $versionConstraint, ); break; @@ -229,9 +285,9 @@ final class AttributeParser implements Parser assert($attributeInstance instanceof RequiresPhpunit); $result[] = Metadata::requiresPhpunitOnClass( - ConstraintRequirement::from( - $attributeInstance->versionRequirement() - ) + Requirement::from( + $attributeInstance->versionRequirement(), + ), ); break; @@ -241,7 +297,7 @@ final class AttributeParser implements Parser $result[] = Metadata::requiresSettingOnClass( $attributeInstance->setting(), - $attributeInstance->value() + $attributeInstance->value(), ); break; @@ -300,14 +356,32 @@ final class AttributeParser implements Parser */ public function forMethod(string $className, string $methodName): MetadataCollection { - $result = []; + assert(class_exists($className)); + assert(method_exists($className, $methodName)); - foreach ((new ReflectionMethod($className, $methodName))->getAttributes() as $attribute) { + $reflector = new ReflectionMethod($className, $methodName); + $result = []; + + foreach ($reflector->getAttributes() as $attribute) { if (!str_starts_with($attribute->getName(), 'PHPUnit\\Framework\\Attributes\\')) { continue; } - $attributeInstance = $attribute->newInstance(); + if (!class_exists($attribute->getName())) { + continue; + } + + try { + $attributeInstance = $attribute->newInstance(); + } catch (Error $e) { + throw new InvalidAttributeException( + $attribute->getName(), + 'method ' . $className . '::' . $methodName . '()', + $reflector->getFileName(), + $reflector->getStartLine(), + $e->getMessage(), + ); + } switch ($attribute->getName()) { case After::class: @@ -445,7 +519,7 @@ final class AttributeParser implements Parser $result[] = Metadata::excludeStaticPropertyFromBackupOnMethod( $attributeInstance->className(), - $attributeInstance->propertyName() + $attributeInstance->propertyName(), ); break; @@ -457,6 +531,13 @@ final class AttributeParser implements Parser break; + case IgnoreDeprecations::class: + assert($attributeInstance instanceof IgnoreDeprecations); + + $result[] = Metadata::ignoreDeprecationsOnMethod(); + + break; + case PostCondition::class: $result[] = Metadata::postCondition(); @@ -479,7 +560,7 @@ final class AttributeParser implements Parser $result[] = Metadata::requiresMethodOnMethod( $attributeInstance->className(), - $attributeInstance->methodName() + $attributeInstance->methodName(), ); break; @@ -509,9 +590,9 @@ final class AttributeParser implements Parser assert($attributeInstance instanceof RequiresPhp); $result[] = Metadata::requiresPhpOnMethod( - ConstraintRequirement::from( - $attributeInstance->versionRequirement() - ) + Requirement::from( + $attributeInstance->versionRequirement(), + ), ); break; @@ -523,12 +604,12 @@ final class AttributeParser implements Parser $versionRequirement = $attributeInstance->versionRequirement(); if ($versionRequirement !== null) { - $versionConstraint = ConstraintRequirement::from($versionRequirement); + $versionConstraint = Requirement::from($versionRequirement); } $result[] = Metadata::requiresPhpExtensionOnMethod( $attributeInstance->extension(), - $versionConstraint + $versionConstraint, ); break; @@ -537,9 +618,9 @@ final class AttributeParser implements Parser assert($attributeInstance instanceof RequiresPhpunit); $result[] = Metadata::requiresPhpunitOnMethod( - ConstraintRequirement::from( - $attributeInstance->versionRequirement() - ) + Requirement::from( + $attributeInstance->versionRequirement(), + ), ); break; @@ -549,7 +630,7 @@ final class AttributeParser implements Parser $result[] = Metadata::requiresSettingOnMethod( $attributeInstance->setting(), - $attributeInstance->value() + $attributeInstance->value(), ); break; @@ -590,6 +671,13 @@ final class AttributeParser implements Parser $result[] = Metadata::groupOnMethod($attributeInstance->text()); + break; + + case WithoutErrorHandler::class: + assert($attributeInstance instanceof WithoutErrorHandler); + + $result[] = Metadata::withoutErrorHandler(); + break; } } @@ -604,7 +692,7 @@ final class AttributeParser implements Parser public function forClassAndMethod(string $className, string $methodName): MetadataCollection { return $this->forClass($className)->mergeWith( - $this->forMethod($className, $methodName) + $this->forMethod($className, $methodName), ); } } diff --git a/vendor/phpunit/phpunit/src/Metadata/Parser/CachingParser.php b/vendor/phpunit/phpunit/src/Metadata/Parser/CachingParser.php index 0aecab56..a383006f 100644 --- a/vendor/phpunit/phpunit/src/Metadata/Parser/CachingParser.php +++ b/vendor/phpunit/phpunit/src/Metadata/Parser/CachingParser.php @@ -9,11 +9,14 @@ */ namespace PHPUnit\Metadata\Parser; +use function assert; use function class_exists; use function method_exists; use PHPUnit\Metadata\MetadataCollection; /** + * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit + * * @internal This class is not covered by the backward compatibility promise for PHPUnit */ final class CachingParser implements Parser @@ -33,6 +36,8 @@ final class CachingParser implements Parser */ public function forClass(string $className): MetadataCollection { + assert(class_exists($className)); + if (isset($this->classCache[$className])) { return $this->classCache[$className]; } @@ -48,6 +53,9 @@ final class CachingParser implements Parser */ public function forMethod(string $className, string $methodName): MetadataCollection { + assert(class_exists($className)); + assert(method_exists($className, $methodName)); + $key = $className . '::' . $methodName; if (isset($this->methodCache[$key])) { @@ -72,26 +80,9 @@ final class CachingParser implements Parser } $this->classAndMethodCache[$key] = $this->forClass($className)->mergeWith( - $this->forMethod($className, $methodName) + $this->forMethod($className, $methodName), ); return $this->classAndMethodCache[$key]; } - - /** - * @psalm-param class-string $className - * @psalm-param non-empty-string $methodName - */ - public function for(string $className, string $methodName): MetadataCollection - { - if (!class_exists($className)) { - return MetadataCollection::fromArray([]); - } - - if (method_exists($className, $methodName)) { - return $this->forClassAndMethod($className, $methodName); - } - - return $this->forClass($className); - } } diff --git a/vendor/phpunit/phpunit/src/Metadata/Parser/Parser.php b/vendor/phpunit/phpunit/src/Metadata/Parser/Parser.php index ea61d18f..b5efd354 100644 --- a/vendor/phpunit/phpunit/src/Metadata/Parser/Parser.php +++ b/vendor/phpunit/phpunit/src/Metadata/Parser/Parser.php @@ -12,7 +12,9 @@ namespace PHPUnit\Metadata\Parser; use PHPUnit\Metadata\MetadataCollection; /** - * @internal This class is not covered by the backward compatibility promise for PHPUnit + * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit + * + * @internal This interface is not covered by the backward compatibility promise for PHPUnit */ interface Parser { diff --git a/vendor/phpunit/phpunit/src/Metadata/Parser/ParserChain.php b/vendor/phpunit/phpunit/src/Metadata/Parser/ParserChain.php index 81d8fd9f..89d69dce 100644 --- a/vendor/phpunit/phpunit/src/Metadata/Parser/ParserChain.php +++ b/vendor/phpunit/phpunit/src/Metadata/Parser/ParserChain.php @@ -9,9 +9,14 @@ */ namespace PHPUnit\Metadata\Parser; +use function assert; +use function class_exists; +use function method_exists; use PHPUnit\Metadata\MetadataCollection; /** + * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit + * * @internal This class is not covered by the backward compatibility promise for PHPUnit */ final class ParserChain implements Parser @@ -30,6 +35,8 @@ final class ParserChain implements Parser */ public function forClass(string $className): MetadataCollection { + assert(class_exists($className)); + $metadata = $this->attributeReader->forClass($className); if (!$metadata->isEmpty()) { @@ -45,6 +52,9 @@ final class ParserChain implements Parser */ public function forMethod(string $className, string $methodName): MetadataCollection { + assert(class_exists($className)); + assert(method_exists($className, $methodName)); + $metadata = $this->attributeReader->forMethod($className, $methodName); if (!$metadata->isEmpty()) { @@ -61,7 +71,7 @@ final class ParserChain implements Parser public function forClassAndMethod(string $className, string $methodName): MetadataCollection { return $this->forClass($className)->mergeWith( - $this->forMethod($className, $methodName) + $this->forMethod($className, $methodName), ); } } diff --git a/vendor/phpunit/phpunit/src/Metadata/Parser/Registry.php b/vendor/phpunit/phpunit/src/Metadata/Parser/Registry.php index f0d6f329..a68ab014 100644 --- a/vendor/phpunit/phpunit/src/Metadata/Parser/Registry.php +++ b/vendor/phpunit/phpunit/src/Metadata/Parser/Registry.php @@ -13,28 +13,26 @@ namespace PHPUnit\Metadata\Parser; * Attribute and annotation information is static within a single PHP process. * It is therefore okay to use a Singleton registry here. * + * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit + * * @internal This class is not covered by the backward compatibility promise for PHPUnit */ final class Registry { - private static ?CachingParser $instance = null; + private static ?Parser $instance = null; - public static function parser(): CachingParser + public static function parser(): Parser { return self::$instance ?? self::$instance = self::build(); } - private function __construct() - { - } - - private static function build(): CachingParser + private static function build(): Parser { return new CachingParser( new ParserChain( new AttributeParser, - new AnnotationParser - ) + new AnnotationParser, + ), ); } } diff --git a/vendor/phpunit/phpunit/src/Metadata/PostCondition.php b/vendor/phpunit/phpunit/src/Metadata/PostCondition.php index e14bc05d..1e30f550 100644 --- a/vendor/phpunit/phpunit/src/Metadata/PostCondition.php +++ b/vendor/phpunit/phpunit/src/Metadata/PostCondition.php @@ -16,6 +16,9 @@ namespace PHPUnit\Metadata; */ final class PostCondition extends Metadata { + /** + * @psalm-assert-if-true PostCondition $this + */ public function isPostCondition(): bool { return true; diff --git a/vendor/phpunit/phpunit/src/Metadata/PreCondition.php b/vendor/phpunit/phpunit/src/Metadata/PreCondition.php index c6f3deea..4691f113 100644 --- a/vendor/phpunit/phpunit/src/Metadata/PreCondition.php +++ b/vendor/phpunit/phpunit/src/Metadata/PreCondition.php @@ -16,6 +16,9 @@ namespace PHPUnit\Metadata; */ final class PreCondition extends Metadata { + /** + * @psalm-assert-if-true PreCondition $this + */ public function isPreCondition(): bool { return true; diff --git a/vendor/phpunit/phpunit/src/Metadata/PreserveGlobalState.php b/vendor/phpunit/phpunit/src/Metadata/PreserveGlobalState.php index 83cea03a..521af6d6 100644 --- a/vendor/phpunit/phpunit/src/Metadata/PreserveGlobalState.php +++ b/vendor/phpunit/phpunit/src/Metadata/PreserveGlobalState.php @@ -18,6 +18,9 @@ final class PreserveGlobalState extends Metadata { private readonly bool $enabled; + /** + * @psalm-param 0|1 $level + */ protected function __construct(int $level, bool $enabled) { parent::__construct($level); @@ -25,6 +28,9 @@ final class PreserveGlobalState extends Metadata $this->enabled = $enabled; } + /** + * @psalm-assert-if-true PreserveGlobalState $this + */ public function isPreserveGlobalState(): bool { return true; diff --git a/vendor/phpunit/phpunit/src/Metadata/RequiresFunction.php b/vendor/phpunit/phpunit/src/Metadata/RequiresFunction.php index 97d3fe28..638d35c0 100644 --- a/vendor/phpunit/phpunit/src/Metadata/RequiresFunction.php +++ b/vendor/phpunit/phpunit/src/Metadata/RequiresFunction.php @@ -16,8 +16,15 @@ namespace PHPUnit\Metadata; */ final class RequiresFunction extends Metadata { + /** + * @psalm-var non-empty-string + */ private readonly string $functionName; + /** + * @psalm-param 0|1 $level + * @psalm-param non-empty-string $functionName + */ protected function __construct(int $level, string $functionName) { parent::__construct($level); @@ -25,11 +32,17 @@ final class RequiresFunction extends Metadata $this->functionName = $functionName; } + /** + * @psalm-assert-if-true RequiresFunction $this + */ public function isRequiresFunction(): bool { return true; } + /** + * @psalm-return non-empty-string + */ public function functionName(): string { return $this->functionName; diff --git a/vendor/phpunit/phpunit/src/Metadata/RequiresMethod.php b/vendor/phpunit/phpunit/src/Metadata/RequiresMethod.php index 62a62252..45d611ff 100644 --- a/vendor/phpunit/phpunit/src/Metadata/RequiresMethod.php +++ b/vendor/phpunit/phpunit/src/Metadata/RequiresMethod.php @@ -20,10 +20,16 @@ final class RequiresMethod extends Metadata * @psalm-var class-string */ private readonly string $className; + + /** + * @psalm-var non-empty-string + */ private readonly string $methodName; /** + * @psalm-param 0|1 $level * @psalm-param class-string $className + * @psalm-param non-empty-string $methodName */ protected function __construct(int $level, string $className, string $methodName) { @@ -33,7 +39,10 @@ final class RequiresMethod extends Metadata $this->methodName = $methodName; } - public function isrequiresMethod(): bool + /** + * @psalm-assert-if-true RequiresMethod $this + */ + public function isRequiresMethod(): bool { return true; } @@ -46,6 +55,9 @@ final class RequiresMethod extends Metadata return $this->className; } + /** + * @psalm-return non-empty-string + */ public function methodName(): string { return $this->methodName; diff --git a/vendor/phpunit/phpunit/src/Metadata/RequiresOperatingSystem.php b/vendor/phpunit/phpunit/src/Metadata/RequiresOperatingSystem.php index 94ebe1fc..d3598637 100644 --- a/vendor/phpunit/phpunit/src/Metadata/RequiresOperatingSystem.php +++ b/vendor/phpunit/phpunit/src/Metadata/RequiresOperatingSystem.php @@ -16,20 +16,33 @@ namespace PHPUnit\Metadata; */ final class RequiresOperatingSystem extends Metadata { + /** + * @psalm-var non-empty-string + */ private readonly string $operatingSystem; - public function __construct(int $level, string $operatingSystem) + /** + * @psalm-param 0|1 $level + * @psalm-param non-empty-string $operatingSystem + */ + protected function __construct(int $level, string $operatingSystem) { parent::__construct($level); $this->operatingSystem = $operatingSystem; } + /** + * @psalm-assert-if-true RequiresOperatingSystem $this + */ public function isRequiresOperatingSystem(): bool { return true; } + /** + * @psalm-return non-empty-string + */ public function operatingSystem(): string { return $this->operatingSystem; diff --git a/vendor/phpunit/phpunit/src/Metadata/RequiresOperatingSystemFamily.php b/vendor/phpunit/phpunit/src/Metadata/RequiresOperatingSystemFamily.php index 7179512b..84182748 100644 --- a/vendor/phpunit/phpunit/src/Metadata/RequiresOperatingSystemFamily.php +++ b/vendor/phpunit/phpunit/src/Metadata/RequiresOperatingSystemFamily.php @@ -16,8 +16,15 @@ namespace PHPUnit\Metadata; */ final class RequiresOperatingSystemFamily extends Metadata { + /** + * @psalm-var non-empty-string + */ private readonly string $operatingSystemFamily; + /** + * @psalm-param 0|1 $level + * @psalm-param non-empty-string $operatingSystemFamily + */ protected function __construct(int $level, string $operatingSystemFamily) { parent::__construct($level); @@ -25,11 +32,17 @@ final class RequiresOperatingSystemFamily extends Metadata $this->operatingSystemFamily = $operatingSystemFamily; } + /** + * @psalm-assert-if-true RequiresOperatingSystemFamily $this + */ public function isRequiresOperatingSystemFamily(): bool { return true; } + /** + * @psalm-return non-empty-string + */ public function operatingSystemFamily(): string { return $this->operatingSystemFamily; diff --git a/vendor/phpunit/phpunit/src/Metadata/RequiresPhp.php b/vendor/phpunit/phpunit/src/Metadata/RequiresPhp.php index 038deb7f..e73bfb40 100644 --- a/vendor/phpunit/phpunit/src/Metadata/RequiresPhp.php +++ b/vendor/phpunit/phpunit/src/Metadata/RequiresPhp.php @@ -20,6 +20,9 @@ final class RequiresPhp extends Metadata { private readonly Requirement $versionRequirement; + /** + * @psalm-param 0|1 $level + */ protected function __construct(int $level, Requirement $versionRequirement) { parent::__construct($level); @@ -27,6 +30,9 @@ final class RequiresPhp extends Metadata $this->versionRequirement = $versionRequirement; } + /** + * @psalm-assert-if-true RequiresPhp $this + */ public function isRequiresPhp(): bool { return true; diff --git a/vendor/phpunit/phpunit/src/Metadata/RequiresPhpExtension.php b/vendor/phpunit/phpunit/src/Metadata/RequiresPhpExtension.php index 6447a145..053b8966 100644 --- a/vendor/phpunit/phpunit/src/Metadata/RequiresPhpExtension.php +++ b/vendor/phpunit/phpunit/src/Metadata/RequiresPhpExtension.php @@ -18,9 +18,16 @@ use PHPUnit\Metadata\Version\Requirement; */ final class RequiresPhpExtension extends Metadata { + /** + * @psalm-var non-empty-string + */ private readonly string $extension; private readonly ?Requirement $versionRequirement; + /** + * @psalm-param 0|1 $level + * @psalm-param non-empty-string $extension + */ protected function __construct(int $level, string $extension, ?Requirement $versionRequirement) { parent::__construct($level); @@ -29,11 +36,17 @@ final class RequiresPhpExtension extends Metadata $this->versionRequirement = $versionRequirement; } + /** + * @psalm-assert-if-true RequiresPhpExtension $this + */ public function isRequiresPhpExtension(): bool { return true; } + /** + * @psalm-return non-empty-string + */ public function extension(): string { return $this->extension; diff --git a/vendor/phpunit/phpunit/src/Metadata/RequiresPhpunit.php b/vendor/phpunit/phpunit/src/Metadata/RequiresPhpunit.php index 1c2611f9..250190e5 100644 --- a/vendor/phpunit/phpunit/src/Metadata/RequiresPhpunit.php +++ b/vendor/phpunit/phpunit/src/Metadata/RequiresPhpunit.php @@ -20,6 +20,9 @@ final class RequiresPhpunit extends Metadata { private readonly Requirement $versionRequirement; + /** + * @psalm-param 0|1 $level + */ protected function __construct(int $level, Requirement $versionRequirement) { parent::__construct($level); @@ -27,6 +30,9 @@ final class RequiresPhpunit extends Metadata $this->versionRequirement = $versionRequirement; } + /** + * @psalm-assert-if-true RequiresPhpunit $this + */ public function isRequiresPhpunit(): bool { return true; diff --git a/vendor/phpunit/phpunit/src/Metadata/RequiresSetting.php b/vendor/phpunit/phpunit/src/Metadata/RequiresSetting.php index 4c0e6a20..03f710d7 100644 --- a/vendor/phpunit/phpunit/src/Metadata/RequiresSetting.php +++ b/vendor/phpunit/phpunit/src/Metadata/RequiresSetting.php @@ -16,9 +16,21 @@ namespace PHPUnit\Metadata; */ final class RequiresSetting extends Metadata { + /** + * @psalm-var non-empty-string + */ private readonly string $setting; + + /** + * @psalm-var non-empty-string + */ private readonly string $value; + /** + * @psalm-param 0|1 $level + * @psalm-param non-empty-string $setting + * @psalm-param non-empty-string $value + */ protected function __construct(int $level, string $setting, string $value) { parent::__construct($level); @@ -27,16 +39,25 @@ final class RequiresSetting extends Metadata $this->value = $value; } + /** + * @psalm-assert-if-true RequiresSetting $this + */ public function isRequiresSetting(): bool { return true; } + /** + * @psalm-return non-empty-string + */ public function setting(): string { return $this->setting; } + /** + * @psalm-return non-empty-string + */ public function value(): string { return $this->value; diff --git a/vendor/phpunit/phpunit/src/Metadata/RunClassInSeparateProcess.php b/vendor/phpunit/phpunit/src/Metadata/RunClassInSeparateProcess.php index 10acd71a..eb0b7742 100644 --- a/vendor/phpunit/phpunit/src/Metadata/RunClassInSeparateProcess.php +++ b/vendor/phpunit/phpunit/src/Metadata/RunClassInSeparateProcess.php @@ -16,6 +16,9 @@ namespace PHPUnit\Metadata; */ final class RunClassInSeparateProcess extends Metadata { + /** + * @psalm-assert-if-true RunClassInSeparateProcess $this + */ public function isRunClassInSeparateProcess(): bool { return true; diff --git a/vendor/phpunit/phpunit/src/Metadata/RunInSeparateProcess.php b/vendor/phpunit/phpunit/src/Metadata/RunInSeparateProcess.php index 18c63348..62d552ae 100644 --- a/vendor/phpunit/phpunit/src/Metadata/RunInSeparateProcess.php +++ b/vendor/phpunit/phpunit/src/Metadata/RunInSeparateProcess.php @@ -16,6 +16,9 @@ namespace PHPUnit\Metadata; */ final class RunInSeparateProcess extends Metadata { + /** + * @psalm-assert-if-true RunInSeparateProcess $this + */ public function isRunInSeparateProcess(): bool { return true; diff --git a/vendor/phpunit/phpunit/src/Metadata/RunTestsInSeparateProcesses.php b/vendor/phpunit/phpunit/src/Metadata/RunTestsInSeparateProcesses.php index f43d9dd8..ea0807a5 100644 --- a/vendor/phpunit/phpunit/src/Metadata/RunTestsInSeparateProcesses.php +++ b/vendor/phpunit/phpunit/src/Metadata/RunTestsInSeparateProcesses.php @@ -16,6 +16,9 @@ namespace PHPUnit\Metadata; */ final class RunTestsInSeparateProcesses extends Metadata { + /** + * @psalm-assert-if-true RunTestsInSeparateProcesses $this + */ public function isRunTestsInSeparateProcesses(): bool { return true; diff --git a/vendor/phpunit/phpunit/src/Metadata/Test.php b/vendor/phpunit/phpunit/src/Metadata/Test.php index 60e2acee..6d2aeecd 100644 --- a/vendor/phpunit/phpunit/src/Metadata/Test.php +++ b/vendor/phpunit/phpunit/src/Metadata/Test.php @@ -16,6 +16,9 @@ namespace PHPUnit\Metadata; */ final class Test extends Metadata { + /** + * @psalm-assert-if-true Test $this + */ public function isTest(): bool { return true; diff --git a/vendor/phpunit/phpunit/src/Metadata/TestDox.php b/vendor/phpunit/phpunit/src/Metadata/TestDox.php index 50c5ecc7..d78d86cf 100644 --- a/vendor/phpunit/phpunit/src/Metadata/TestDox.php +++ b/vendor/phpunit/phpunit/src/Metadata/TestDox.php @@ -16,8 +16,15 @@ namespace PHPUnit\Metadata; */ final class TestDox extends Metadata { + /** + * @psalm-var non-empty-string + */ private readonly string $text; + /** + * @psalm-param 0|1 $level + * @psalm-param non-empty-string $text + */ protected function __construct(int $level, string $text) { parent::__construct($level); @@ -25,11 +32,17 @@ final class TestDox extends Metadata $this->text = $text; } + /** + * @psalm-assert-if-true TestDox $this + */ public function isTestDox(): bool { return true; } + /** + * @psalm-return non-empty-string + */ public function text(): string { return $this->text; diff --git a/vendor/phpunit/phpunit/src/Metadata/TestWith.php b/vendor/phpunit/phpunit/src/Metadata/TestWith.php index 2d7a5e75..e1ffec7c 100644 --- a/vendor/phpunit/phpunit/src/Metadata/TestWith.php +++ b/vendor/phpunit/phpunit/src/Metadata/TestWith.php @@ -16,21 +16,27 @@ namespace PHPUnit\Metadata; */ final class TestWith extends Metadata { - private readonly array $data; + private readonly mixed $data; - protected function __construct(int $level, array $data) + /** + * @psalm-param 0|1 $level + */ + protected function __construct(int $level, mixed $data) { parent::__construct($level); $this->data = $data; } + /** + * @psalm-assert-if-true TestWith $this + */ public function isTestWith(): bool { return true; } - public function data(): array + public function data(): mixed { return $this->data; } diff --git a/vendor/phpunit/phpunit/src/Metadata/Uses.php b/vendor/phpunit/phpunit/src/Metadata/Uses.php index 96c29642..d3fa216b 100644 --- a/vendor/phpunit/phpunit/src/Metadata/Uses.php +++ b/vendor/phpunit/phpunit/src/Metadata/Uses.php @@ -16,8 +16,15 @@ namespace PHPUnit\Metadata; */ final class Uses extends Metadata { + /** + * @psalm-var non-empty-string + */ private readonly string $target; + /** + * @psalm-param 0|1 $level + * @psalm-param non-empty-string $target + */ protected function __construct(int $level, string $target) { parent::__construct($level); @@ -25,11 +32,17 @@ final class Uses extends Metadata $this->target = $target; } + /** + * @psalm-assert-if-true Uses $this + */ public function isUses(): bool { return true; } + /** + * @psalm-return non-empty-string + */ public function target(): string { return $this->target; diff --git a/vendor/phpunit/phpunit/src/Metadata/UsesClass.php b/vendor/phpunit/phpunit/src/Metadata/UsesClass.php index 5bf09fce..01e7741e 100644 --- a/vendor/phpunit/phpunit/src/Metadata/UsesClass.php +++ b/vendor/phpunit/phpunit/src/Metadata/UsesClass.php @@ -22,6 +22,7 @@ final class UsesClass extends Metadata private readonly string $className; /** + * @psalm-param 0|1 $level * @psalm-param class-string $className */ protected function __construct(int $level, string $className) @@ -31,6 +32,9 @@ final class UsesClass extends Metadata $this->className = $className; } + /** + * @psalm-assert-if-true UsesClass $this + */ public function isUsesClass(): bool { return true; diff --git a/vendor/phpunit/phpunit/src/Metadata/UsesDefaultClass.php b/vendor/phpunit/phpunit/src/Metadata/UsesDefaultClass.php index a6bf8674..48a82471 100644 --- a/vendor/phpunit/phpunit/src/Metadata/UsesDefaultClass.php +++ b/vendor/phpunit/phpunit/src/Metadata/UsesDefaultClass.php @@ -22,6 +22,7 @@ final class UsesDefaultClass extends Metadata private readonly string $className; /** + * @psalm-param 0|1 $level * @psalm-param class-string $className */ protected function __construct(int $level, string $className) @@ -31,6 +32,9 @@ final class UsesDefaultClass extends Metadata $this->className = $className; } + /** + * @psalm-assert-if-true UsesDefaultClass $this + */ public function isUsesDefaultClass(): bool { return true; diff --git a/vendor/phpunit/phpunit/src/Metadata/UsesFunction.php b/vendor/phpunit/phpunit/src/Metadata/UsesFunction.php index a55aaddf..357dc1ae 100644 --- a/vendor/phpunit/phpunit/src/Metadata/UsesFunction.php +++ b/vendor/phpunit/phpunit/src/Metadata/UsesFunction.php @@ -16,20 +16,33 @@ namespace PHPUnit\Metadata; */ final class UsesFunction extends Metadata { + /** + * @psalm-var non-empty-string + */ private readonly string $functionName; - public function __construct(int $level, string $functionName) + /** + * @psalm-param 0|1 $level + * @psalm-param non-empty-string $functionName + */ + protected function __construct(int $level, string $functionName) { parent::__construct($level); $this->functionName = $functionName; } + /** + * @psalm-assert-if-true UsesFunction $this + */ public function isUsesFunction(): bool { return true; } + /** + * @psalm-return non-empty-string + */ public function functionName(): string { return $this->functionName; diff --git a/vendor/phpunit/phpunit/src/Metadata/Version/ConstraintRequirement.php b/vendor/phpunit/phpunit/src/Metadata/Version/ConstraintRequirement.php index f803722b..32857899 100644 --- a/vendor/phpunit/phpunit/src/Metadata/Version/ConstraintRequirement.php +++ b/vendor/phpunit/phpunit/src/Metadata/Version/ConstraintRequirement.php @@ -33,7 +33,7 @@ final class ConstraintRequirement extends Requirement public function isSatisfiedBy(string $version): bool { return $this->constraint->complies( - new Version($this->sanitize($version)) + new Version($this->sanitize($version)), ); } @@ -50,7 +50,7 @@ final class ConstraintRequirement extends Requirement return preg_replace( '/^(\d+\.\d+(?:.\d+)?).*$/', '$1', - $version + $version, ); } } diff --git a/vendor/phpunit/phpunit/src/Metadata/Version/Requirement.php b/vendor/phpunit/phpunit/src/Metadata/Version/Requirement.php index 483f6d22..a61e5003 100644 --- a/vendor/phpunit/phpunit/src/Metadata/Version/Requirement.php +++ b/vendor/phpunit/phpunit/src/Metadata/Version/Requirement.php @@ -34,16 +34,16 @@ abstract class Requirement try { return new ConstraintRequirement( (new VersionConstraintParser)->parse( - $versionRequirement - ) + $versionRequirement, + ), ); } catch (UnsupportedVersionConstraintException) { if (preg_match(self::VERSION_COMPARISON, $versionRequirement, $matches)) { return new ComparisonRequirement( $matches['version'], new VersionComparisonOperator( - !empty($matches['operator']) ? $matches['operator'] : '>=' - ) + !empty($matches['operator']) ? $matches['operator'] : '>=', + ), ); } } diff --git a/vendor/phpunit/phpunit/src/Runner/CodeCoverage.php b/vendor/phpunit/phpunit/src/Runner/CodeCoverage.php index ca8da889..7ba5887d 100644 --- a/vendor/phpunit/phpunit/src/Runner/CodeCoverage.php +++ b/vendor/phpunit/phpunit/src/Runner/CodeCoverage.php @@ -13,7 +13,6 @@ use function file_put_contents; use function sprintf; use PHPUnit\Event\Facade as EventFacade; use PHPUnit\Event\TestData\MoreThanOneDataSetFromDataProviderException; -use PHPUnit\Event\TestData\NoDataSetFromDataProviderException; use PHPUnit\Framework\TestCase; use PHPUnit\TextUI\Configuration\CodeCoverageFilterRegistry; use PHPUnit\TextUI\Configuration\Configuration; @@ -39,7 +38,11 @@ use SebastianBergmann\Timer\NoActiveTimerException; use SebastianBergmann\Timer\Timer; /** + * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit + * * @internal This class is not covered by the backward compatibility promise for PHPUnit + * + * @codeCoverageIgnore */ final class CodeCoverage { @@ -50,6 +53,11 @@ final class CodeCoverage private ?TestCase $test = null; private ?Timer $timer = null; + /** + * @psalm-var array> + */ + private array $linesToBeIgnored = []; + public static function instance(): self { if (self::$instance === null) { @@ -59,11 +67,11 @@ final class CodeCoverage return self::$instance; } - public function init(Configuration $configuration, CodeCoverageFilterRegistry $codeCoverageFilterRegistry): void + public function init(Configuration $configuration, CodeCoverageFilterRegistry $codeCoverageFilterRegistry, bool $extensionRequiresCodeCoverageCollection): void { $codeCoverageFilterRegistry->init($configuration); - if (!$configuration->hasCoverageReport()) { + if (!$configuration->hasCoverageReport() && !$extensionRequiresCodeCoverageCollection) { return; } @@ -103,12 +111,12 @@ final class CodeCoverage if ($codeCoverageFilterRegistry->get()->isEmpty()) { if (!$codeCoverageFilterRegistry->configured()) { - EventFacade::emitter()->testRunnerTriggeredWarning( - 'No filter is configured, code coverage will not be processed' + EventFacade::emitter()->testRunnerTriggeredPhpunitWarning( + 'No filter is configured, code coverage will not be processed', ); } else { - EventFacade::emitter()->testRunnerTriggeredWarning( - 'Incorrect filter configuration, code coverage will not be processed' + EventFacade::emitter()->testRunnerTriggeredPhpunitWarning( + 'Configured filter does not match any files, code coverage will not be processed', ); } @@ -136,7 +144,6 @@ final class CodeCoverage /** * @throws MoreThanOneDataSetFromDataProviderException - * @throws NoDataSetFromDataProviderException */ public function start(TestCase $test): void { @@ -158,13 +165,13 @@ final class CodeCoverage $this->codeCoverage->start( $test->valueObjectForEvents()->id(), - $size + $size, ); $this->collecting = true; } - public function stop(bool $append = true, array|false $linesToBeCovered = [], array $linesToBeUsed = []): void + public function stop(bool $append, array|false $linesToBeCovered = [], array $linesToBeUsed = []): void { if (!$this->collecting) { return; @@ -181,7 +188,7 @@ final class CodeCoverage } /* @noinspection UnusedFunctionResultInspection */ - $this->codeCoverage->stop($append, $status, $linesToBeCovered, $linesToBeUsed); + $this->codeCoverage->stop($append, $status, $linesToBeCovered, $linesToBeUsed, $this->linesToBeIgnored); $this->test = null; $this->collecting = false; @@ -200,6 +207,21 @@ final class CodeCoverage return; } + if ($configuration->hasCoveragePhp()) { + $this->codeCoverageGenerationStart($printer, 'PHP'); + + try { + $writer = new PhpReport; + $writer->process($this->codeCoverage(), $configuration->coveragePhp()); + + $this->codeCoverageGenerationSucceeded($printer); + + unset($writer); + } catch (CodeCoverageException $e) { + $this->codeCoverageGenerationFailed($printer, $e); + } + } + if ($configuration->hasCoverageClover()) { $this->codeCoverageGenerationStart($printer, 'Clover XML'); @@ -258,7 +280,7 @@ final class CodeCoverage $writer = new HtmlReport( sprintf( ' and PHPUnit %s', - Version::id() + Version::id(), ), Colors::from( $configuration->coverageHtmlColorSuccessLow(), @@ -269,9 +291,9 @@ final class CodeCoverage ), Thresholds::from( $configuration->coverageHtmlLowUpperBound(), - $configuration->coverageHtmlHighLowerBound() + $configuration->coverageHtmlHighLowerBound(), ), - $customCssFile + $customCssFile, ); $writer->process($this->codeCoverage(), $configuration->coverageHtml()); @@ -284,32 +306,19 @@ final class CodeCoverage } } - if ($configuration->hasCoveragePhp()) { - $this->codeCoverageGenerationStart($printer, 'PHP'); - - try { - $writer = new PhpReport; - $writer->process($this->codeCoverage(), $configuration->coveragePhp()); - - $this->codeCoverageGenerationSucceeded($printer); - - unset($writer); - } catch (CodeCoverageException $e) { - $this->codeCoverageGenerationFailed($printer, $e); - } - } - if ($configuration->hasCoverageText()) { $processor = new TextReport( Thresholds::default(), $configuration->coverageTextShowUncoveredFiles(), - $configuration->coverageTextShowOnlySummary() + $configuration->coverageTextShowOnlySummary(), ); $textReport = $processor->process($this->codeCoverage(), $configuration->colors()); if ($configuration->coverageText() === 'php://stdout') { - $printer->print($textReport); + if (!$configuration->noOutput() && !$configuration->debug()) { + $printer->print($textReport); + } } else { file_put_contents($configuration->coverageText(), $textReport); } @@ -331,6 +340,22 @@ final class CodeCoverage } } + /** + * @psalm-param array> $linesToBeIgnored + */ + public function ignoreLines(array $linesToBeIgnored): void + { + $this->linesToBeIgnored = $linesToBeIgnored; + } + + /** + * @psalm-return array> + */ + public function linesToBeIgnored(): array + { + return $this->linesToBeIgnored; + } + private function activate(Filter $filter, bool $pathCoverage): void { try { @@ -342,11 +367,11 @@ final class CodeCoverage $this->codeCoverage = new \SebastianBergmann\CodeCoverage\CodeCoverage( $this->driver, - $filter + $filter, ); } catch (CodeCoverageException $e) { - EventFacade::emitter()->testRunnerTriggeredWarning( - $e->getMessage() + EventFacade::emitter()->testRunnerTriggeredPhpunitWarning( + $e->getMessage(), ); } } @@ -356,8 +381,8 @@ final class CodeCoverage $printer->print( sprintf( "\nGenerating code coverage report in %s format ... ", - $format - ) + $format, + ), ); $this->timer()->start(); @@ -371,8 +396,8 @@ final class CodeCoverage $printer->print( sprintf( "done [%s]\n", - $this->timer()->stop()->asString() - ) + $this->timer()->stop()->asString(), + ), ); } @@ -385,8 +410,8 @@ final class CodeCoverage sprintf( "failed [%s]\n%s\n", $this->timer()->stop()->asString(), - $e->getMessage() - ) + $e->getMessage(), + ), ); } diff --git a/vendor/phpunit/phpunit/src/Runner/Exception/ClassCannotBeFoundException.php b/vendor/phpunit/phpunit/src/Runner/Exception/ClassCannotBeFoundException.php index adce339a..701cbb5b 100644 --- a/vendor/phpunit/phpunit/src/Runner/Exception/ClassCannotBeFoundException.php +++ b/vendor/phpunit/phpunit/src/Runner/Exception/ClassCannotBeFoundException.php @@ -13,6 +13,8 @@ use function sprintf; use RuntimeException; /** + * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit + * * @internal This class is not covered by the backward compatibility promise for PHPUnit */ final class ClassCannotBeFoundException extends RuntimeException implements Exception @@ -23,8 +25,8 @@ final class ClassCannotBeFoundException extends RuntimeException implements Exce sprintf( 'Class %s cannot be found in %s', $className, - $file - ) + $file, + ), ); } } diff --git a/vendor/phpunit/phpunit/src/Runner/Exception/ClassCannotBeInstantiatedException.php b/vendor/phpunit/phpunit/src/Runner/Exception/ClassCannotBeInstantiatedException.php deleted file mode 100644 index 59eace7b..00000000 --- a/vendor/phpunit/phpunit/src/Runner/Exception/ClassCannotBeInstantiatedException.php +++ /dev/null @@ -1,33 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace PHPUnit\Runner; - -use function sprintf; -use ReflectionException; -use RuntimeException; - -/** - * @internal This class is not covered by the backward compatibility promise for PHPUnit - */ -final class ClassCannotBeInstantiatedException extends RuntimeException implements Exception -{ - public function __construct(string $className, ReflectionException $previous) - { - parent::__construct( - sprintf( - 'Class "%s" cannot be instantiated: %s', - $className, - $previous->getMessage() - ), - $previous->getCode(), - $previous - ); - } -} diff --git a/vendor/phpunit/phpunit/src/Runner/Exception/ClassDoesNotExistException.php b/vendor/phpunit/phpunit/src/Runner/Exception/ClassDoesNotExistException.php deleted file mode 100644 index e1fd5ffa..00000000 --- a/vendor/phpunit/phpunit/src/Runner/Exception/ClassDoesNotExistException.php +++ /dev/null @@ -1,29 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace PHPUnit\Runner; - -use function sprintf; -use RuntimeException; - -/** - * @internal This class is not covered by the backward compatibility promise for PHPUnit - */ -final class ClassDoesNotExistException extends RuntimeException implements Exception -{ - public function __construct(string $className) - { - parent::__construct( - sprintf( - 'Class "%s" does not exist', - $className - ) - ); - } -} diff --git a/vendor/phpunit/phpunit/src/Runner/Exception/ClassDoesNotImplementExtensionInterfaceException.php b/vendor/phpunit/phpunit/src/Runner/Exception/ClassDoesNotImplementExtensionInterfaceException.php deleted file mode 100644 index 95638a95..00000000 --- a/vendor/phpunit/phpunit/src/Runner/Exception/ClassDoesNotImplementExtensionInterfaceException.php +++ /dev/null @@ -1,31 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace PHPUnit\Runner; - -use function sprintf; -use PHPUnit\Runner\Extension\Extension; -use RuntimeException; - -/** - * @internal This class is not covered by the backward compatibility promise for PHPUnit - */ -final class ClassDoesNotImplementExtensionInterfaceException extends RuntimeException implements Exception -{ - public function __construct(string $className) - { - parent::__construct( - sprintf( - 'Class "%s" does not implement interface %s', - $className, - Extension::class - ) - ); - } -} diff --git a/vendor/phpunit/phpunit/src/Runner/Exception/ClassIsAbstractException.php b/vendor/phpunit/phpunit/src/Runner/Exception/ClassIsAbstractException.php index 690a57b4..bf947589 100644 --- a/vendor/phpunit/phpunit/src/Runner/Exception/ClassIsAbstractException.php +++ b/vendor/phpunit/phpunit/src/Runner/Exception/ClassIsAbstractException.php @@ -13,6 +13,8 @@ use function sprintf; use RuntimeException; /** + * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit + * * @internal This class is not covered by the backward compatibility promise for PHPUnit */ final class ClassIsAbstractException extends RuntimeException implements Exception @@ -23,8 +25,8 @@ final class ClassIsAbstractException extends RuntimeException implements Excepti sprintf( 'Class %s declared in %s is abstract', $className, - $file - ) + $file, + ), ); } } diff --git a/vendor/phpunit/phpunit/src/Runner/Exception/DirectoryCannotBeCreatedException.php b/vendor/phpunit/phpunit/src/Runner/Exception/DirectoryCannotBeCreatedException.php deleted file mode 100644 index 5eaddabe..00000000 --- a/vendor/phpunit/phpunit/src/Runner/Exception/DirectoryCannotBeCreatedException.php +++ /dev/null @@ -1,29 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace PHPUnit\Runner; - -use function sprintf; -use RuntimeException; - -/** - * @internal This class is not covered by the backward compatibility promise for PHPUnit - */ -final class DirectoryCannotBeCreatedException extends RuntimeException implements Exception -{ - public function __construct(string $directory) - { - parent::__construct( - sprintf( - 'Cannot create directory "%s"', - $directory - ) - ); - } -} diff --git a/vendor/phpunit/phpunit/src/Runner/Exception/Exception.php b/vendor/phpunit/phpunit/src/Runner/Exception/Exception.php index 205f76ee..d2577c2d 100644 --- a/vendor/phpunit/phpunit/src/Runner/Exception/Exception.php +++ b/vendor/phpunit/phpunit/src/Runner/Exception/Exception.php @@ -10,7 +10,9 @@ namespace PHPUnit\Runner; /** - * @internal This class is not covered by the backward compatibility promise for PHPUnit + * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit + * + * @internal This interface is not covered by the backward compatibility promise for PHPUnit */ interface Exception extends \PHPUnit\Exception { diff --git a/vendor/phpunit/phpunit/src/Runner/Exception/FileDoesNotExistException.php b/vendor/phpunit/phpunit/src/Runner/Exception/FileDoesNotExistException.php index 60fcc4b9..5b84c785 100644 --- a/vendor/phpunit/phpunit/src/Runner/Exception/FileDoesNotExistException.php +++ b/vendor/phpunit/phpunit/src/Runner/Exception/FileDoesNotExistException.php @@ -13,6 +13,8 @@ use function sprintf; use RuntimeException; /** + * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit + * * @internal This class is not covered by the backward compatibility promise for PHPUnit */ final class FileDoesNotExistException extends RuntimeException implements Exception @@ -22,8 +24,8 @@ final class FileDoesNotExistException extends RuntimeException implements Except parent::__construct( sprintf( 'File "%s" does not exist', - $file - ) + $file, + ), ); } } diff --git a/vendor/phpunit/phpunit/src/Runner/Exception/InvalidOrderException.php b/vendor/phpunit/phpunit/src/Runner/Exception/InvalidOrderException.php index d02d179e..016ec85e 100644 --- a/vendor/phpunit/phpunit/src/Runner/Exception/InvalidOrderException.php +++ b/vendor/phpunit/phpunit/src/Runner/Exception/InvalidOrderException.php @@ -12,6 +12,8 @@ namespace PHPUnit\Runner; use RuntimeException; /** + * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit + * * @internal This class is not covered by the backward compatibility promise for PHPUnit */ final class InvalidOrderException extends RuntimeException implements Exception diff --git a/vendor/phpunit/phpunit/src/Runner/Exception/InvalidPhptFileException.php b/vendor/phpunit/phpunit/src/Runner/Exception/InvalidPhptFileException.php index de8c4ecb..d1f593b8 100644 --- a/vendor/phpunit/phpunit/src/Runner/Exception/InvalidPhptFileException.php +++ b/vendor/phpunit/phpunit/src/Runner/Exception/InvalidPhptFileException.php @@ -12,6 +12,8 @@ namespace PHPUnit\Runner; use RuntimeException; /** + * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit + * * @internal This class is not covered by the backward compatibility promise for PHPUnit */ final class InvalidPhptFileException extends RuntimeException implements Exception diff --git a/vendor/phpunit/phpunit/src/Runner/Exception/NoIgnoredEventException.php b/vendor/phpunit/phpunit/src/Runner/Exception/NoIgnoredEventException.php deleted file mode 100644 index 487308f7..00000000 --- a/vendor/phpunit/phpunit/src/Runner/Exception/NoIgnoredEventException.php +++ /dev/null @@ -1,19 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace PHPUnit\Runner; - -use RuntimeException; - -/** - * @internal This class is not covered by the backward compatibility promise for PHPUnit - */ -final class NoIgnoredEventException extends RuntimeException implements Exception -{ -} diff --git a/vendor/phpunit/phpunit/src/Runner/Exception/ParameterDoesNotExistException.php b/vendor/phpunit/phpunit/src/Runner/Exception/ParameterDoesNotExistException.php index de95f87e..5d7a0967 100644 --- a/vendor/phpunit/phpunit/src/Runner/Exception/ParameterDoesNotExistException.php +++ b/vendor/phpunit/phpunit/src/Runner/Exception/ParameterDoesNotExistException.php @@ -13,6 +13,8 @@ use function sprintf; use RuntimeException; /** + * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit + * * @internal This class is not covered by the backward compatibility promise for PHPUnit */ final class ParameterDoesNotExistException extends RuntimeException implements Exception @@ -23,7 +25,7 @@ final class ParameterDoesNotExistException extends RuntimeException implements E sprintf( 'Parameter "%s" does not exist', $name, - ) + ), ); } } diff --git a/vendor/phpunit/phpunit/src/Runner/Exception/PhptExternalFileCannotBeLoadedException.php b/vendor/phpunit/phpunit/src/Runner/Exception/PhptExternalFileCannotBeLoadedException.php index 74a6528d..33977155 100644 --- a/vendor/phpunit/phpunit/src/Runner/Exception/PhptExternalFileCannotBeLoadedException.php +++ b/vendor/phpunit/phpunit/src/Runner/Exception/PhptExternalFileCannotBeLoadedException.php @@ -13,6 +13,8 @@ use function sprintf; use RuntimeException; /** + * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit + * * @internal This class is not covered by the backward compatibility promise for PHPUnit */ final class PhptExternalFileCannotBeLoadedException extends RuntimeException implements Exception @@ -23,8 +25,8 @@ final class PhptExternalFileCannotBeLoadedException extends RuntimeException imp sprintf( 'Could not load --%s-- %s for PHPT file', $section . '_EXTERNAL', - $file - ) + $file, + ), ); } } diff --git a/vendor/phpunit/phpunit/src/Runner/Exception/ReflectionException.php b/vendor/phpunit/phpunit/src/Runner/Exception/ReflectionException.php deleted file mode 100644 index 39723048..00000000 --- a/vendor/phpunit/phpunit/src/Runner/Exception/ReflectionException.php +++ /dev/null @@ -1,19 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace PHPUnit\Runner; - -use RuntimeException; - -/** - * @internal This class is not covered by the backward compatibility promise for PHPUnit - */ -final class ReflectionException extends RuntimeException implements Exception -{ -} diff --git a/vendor/phpunit/phpunit/src/Runner/Exception/UnsupportedPhptSectionException.php b/vendor/phpunit/phpunit/src/Runner/Exception/UnsupportedPhptSectionException.php index 3e7c239c..ca8647e6 100644 --- a/vendor/phpunit/phpunit/src/Runner/Exception/UnsupportedPhptSectionException.php +++ b/vendor/phpunit/phpunit/src/Runner/Exception/UnsupportedPhptSectionException.php @@ -13,6 +13,8 @@ use function sprintf; use RuntimeException; /** + * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit + * * @internal This class is not covered by the backward compatibility promise for PHPUnit */ final class UnsupportedPhptSectionException extends RuntimeException implements Exception @@ -22,8 +24,8 @@ final class UnsupportedPhptSectionException extends RuntimeException implements parent::__construct( sprintf( 'PHPUnit does not support PHPT %s sections', - $section - ) + $section, + ), ); } } diff --git a/vendor/phpunit/phpunit/src/Runner/Extension/ExtensionBootstrapper.php b/vendor/phpunit/phpunit/src/Runner/Extension/ExtensionBootstrapper.php index ac468c2d..eb90a454 100644 --- a/vendor/phpunit/phpunit/src/Runner/Extension/ExtensionBootstrapper.php +++ b/vendor/phpunit/phpunit/src/Runner/Extension/ExtensionBootstrapper.php @@ -9,20 +9,20 @@ */ namespace PHPUnit\Runner\Extension; +use const PHP_EOL; use function assert; use function class_exists; use function class_implements; use function in_array; -use PHPUnit\Event; -use PHPUnit\Runner\ClassCannotBeInstantiatedException; -use PHPUnit\Runner\ClassDoesNotExistException; -use PHPUnit\Runner\ClassDoesNotImplementExtensionInterfaceException; -use PHPUnit\Runner\Exception; +use function sprintf; +use PHPUnit\Event\Facade as EventFacade; use PHPUnit\TextUI\Configuration\Configuration; use ReflectionClass; -use ReflectionException; +use Throwable; /** + * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit + * * @internal This class is not covered by the backward compatibility promise for PHPUnit */ final class ExtensionBootstrapper @@ -39,34 +39,57 @@ final class ExtensionBootstrapper /** * @psalm-param class-string $className * @psalm-param array $parameters - * - * @throws Exception */ public function bootstrap(string $className, array $parameters): void { if (!class_exists($className)) { - throw new ClassDoesNotExistException($className); + EventFacade::emitter()->testRunnerTriggeredPhpunitWarning( + sprintf( + 'Cannot bootstrap extension because class %s does not exist', + $className, + ), + ); + + return; } if (!in_array(Extension::class, class_implements($className), true)) { - throw new ClassDoesNotImplementExtensionInterfaceException($className); + EventFacade::emitter()->testRunnerTriggeredPhpunitWarning( + sprintf( + 'Cannot bootstrap extension because class %s does not implement interface %s', + $className, + Extension::class, + ), + ); + + return; } try { $instance = (new ReflectionClass($className))->newInstance(); - } catch (ReflectionException $e) { - throw new ClassCannotBeInstantiatedException($className, $e); + + assert($instance instanceof Extension); + + $instance->bootstrap( + $this->configuration, + $this->facade, + ParameterCollection::fromArray($parameters), + ); + } catch (Throwable $t) { + EventFacade::emitter()->testRunnerTriggeredPhpunitWarning( + sprintf( + 'Bootstrapping of extension %s failed: %s%s%s', + $className, + $t->getMessage(), + PHP_EOL, + $t->getTraceAsString(), + ), + ); + + return; } - assert($instance instanceof Extension); - - $instance->bootstrap( - $this->configuration, - $this->facade, - ParameterCollection::fromArray($parameters), - ); - - Event\Facade::emitter()->testRunnerBootstrappedExtension( + EventFacade::emitter()->testRunnerBootstrappedExtension( $className, $parameters, ); diff --git a/vendor/phpunit/phpunit/src/Runner/Extension/Facade.php b/vendor/phpunit/phpunit/src/Runner/Extension/Facade.php index 166ba5f2..b168eb62 100644 --- a/vendor/phpunit/phpunit/src/Runner/Extension/Facade.php +++ b/vendor/phpunit/phpunit/src/Runner/Extension/Facade.php @@ -20,13 +20,19 @@ use PHPUnit\Event\UnknownSubscriberTypeException; */ final class Facade { + private bool $replacesOutput = false; + private bool $replacesProgressOutput = false; + private bool $replacesResultOutput = false; + private bool $requiresCodeCoverageCollection = false; + private bool $requiresExportOfObjects = false; + /** * @throws EventFacadeIsSealedException * @throws UnknownSubscriberTypeException */ public function registerSubscribers(Subscriber ...$subscribers): void { - EventFacade::registerSubscribers(...$subscribers); + EventFacade::instance()->registerSubscribers(...$subscribers); } /** @@ -35,7 +41,7 @@ final class Facade */ public function registerSubscriber(Subscriber $subscriber): void { - EventFacade::registerSubscriber($subscriber); + EventFacade::instance()->registerSubscriber($subscriber); } /** @@ -43,6 +49,62 @@ final class Facade */ public function registerTracer(Tracer $tracer): void { - EventFacade::registerTracer($tracer); + EventFacade::instance()->registerTracer($tracer); + } + + public function replaceOutput(): void + { + $this->replacesOutput = true; + } + + public function replacesOutput(): bool + { + return $this->replacesOutput; + } + + public function replaceProgressOutput(): void + { + $this->replacesProgressOutput = true; + } + + public function replacesProgressOutput(): bool + { + return $this->replacesOutput || $this->replacesProgressOutput; + } + + public function replaceResultOutput(): void + { + $this->replacesResultOutput = true; + } + + public function replacesResultOutput(): bool + { + return $this->replacesOutput || $this->replacesResultOutput; + } + + public function requireCodeCoverageCollection(): void + { + $this->requiresCodeCoverageCollection = true; + } + + public function requiresCodeCoverageCollection(): bool + { + return $this->requiresCodeCoverageCollection; + } + + /** + * @deprecated + */ + public function requireExportOfObjects(): void + { + $this->requiresExportOfObjects = true; + } + + /** + * @deprecated + */ + public function requiresExportOfObjects(): bool + { + return $this->requiresExportOfObjects; } } diff --git a/vendor/phpunit/phpunit/src/Runner/Extension/PharLoader.php b/vendor/phpunit/phpunit/src/Runner/Extension/PharLoader.php index e007e637..70750cf4 100644 --- a/vendor/phpunit/phpunit/src/Runner/Extension/PharLoader.php +++ b/vendor/phpunit/phpunit/src/Runner/Extension/PharLoader.php @@ -9,8 +9,13 @@ */ namespace PHPUnit\Runner\Extension; +use function count; +use function explode; use function extension_loaded; +use function implode; use function is_file; +use function sprintf; +use function str_contains; use PharIo\Manifest\ApplicationName; use PharIo\Manifest\Exception as ManifestException; use PharIo\Manifest\ManifestLoader; @@ -18,80 +23,128 @@ use PharIo\Version\Version as PharIoVersion; use PHPUnit\Event; use PHPUnit\Runner\Version; use SebastianBergmann\FileIterator\Facade as FileIteratorFacade; +use Throwable; /** + * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit + * * @internal This class is not covered by the backward compatibility promise for PHPUnit */ final class PharLoader { /** - * @psalm-return array{loadedExtensions: list, notLoadedExtensions: list} + * @psalm-param non-empty-string $directory + * + * @psalm-return list */ public function loadPharExtensionsInDirectory(string $directory): array { $pharExtensionLoaded = extension_loaded('phar'); - - if (!$pharExtensionLoaded) { - Event\Facade::emitter()->testRunnerTriggeredWarning( - 'Loading PHPUnit extension(s) from PHP archive(s) failed, PHAR extension not loaded' - ); - } - $loadedExtensions = []; - $notLoadedExtensions = []; foreach ((new FileIteratorFacade)->getFilesAsArray($directory, '.phar') as $file) { if (!$pharExtensionLoaded) { - $notLoadedExtensions[] = $file . ' cannot be loaded'; + Event\Facade::emitter()->testRunnerTriggeredPhpunitWarning( + sprintf( + 'Cannot load extension from %s because the PHAR extension is not available', + $file, + ), + ); continue; } if (!is_file('phar://' . $file . '/manifest.xml')) { - $notLoadedExtensions[] = $file . ' is not an extension for PHPUnit'; + Event\Facade::emitter()->testRunnerTriggeredPhpunitWarning( + sprintf( + '%s is not an extension for PHPUnit', + $file, + ), + ); continue; } try { $applicationName = new ApplicationName('phpunit/phpunit'); - $version = new PharIoVersion(Version::series()); + $version = new PharIoVersion($this->phpunitVersion()); $manifest = ManifestLoader::fromFile('phar://' . $file . '/manifest.xml'); if (!$manifest->isExtensionFor($applicationName)) { - $notLoadedExtensions[] = $file . ' is not an extension for PHPUnit'; + Event\Facade::emitter()->testRunnerTriggeredPhpunitWarning( + sprintf( + '%s is not an extension for PHPUnit', + $file, + ), + ); continue; } if (!$manifest->isExtensionFor($applicationName, $version)) { - $notLoadedExtensions[] = $file . ' is not compatible with this version of PHPUnit'; + Event\Facade::emitter()->testRunnerTriggeredPhpunitWarning( + sprintf( + '%s is not compatible with PHPUnit %s', + $file, + Version::series(), + ), + ); continue; } } catch (ManifestException $e) { - $notLoadedExtensions[] = $file . ': ' . $e->getMessage(); + Event\Facade::emitter()->testRunnerTriggeredPhpunitWarning( + sprintf( + 'Cannot load extension from %s: %s', + $file, + $e->getMessage(), + ), + ); continue; } - /** - * @psalm-suppress UnresolvableInclude - */ - require $file; + try { + /** @psalm-suppress UnresolvableInclude */ + @require $file; + } catch (Throwable $t) { + Event\Facade::emitter()->testRunnerTriggeredPhpunitWarning( + sprintf( + 'Cannot load extension from %s: %s', + $file, + $t->getMessage(), + ), + ); + + continue; + } $loadedExtensions[] = $manifest->getName()->asString() . ' ' . $manifest->getVersion()->getVersionString(); Event\Facade::emitter()->testRunnerLoadedExtensionFromPhar( $file, $manifest->getName()->asString(), - $manifest->getVersion()->getVersionString() + $manifest->getVersion()->getVersionString(), ); } - return [ - 'loadedExtensions' => $loadedExtensions, - 'notLoadedExtensions' => $notLoadedExtensions, - ]; + return $loadedExtensions; + } + + private function phpunitVersion(): string + { + $version = Version::id(); + + if (!str_contains($version, '-')) { + return $version; + } + + $parts = explode('.', explode('-', $version)[0]); + + if (count($parts) === 2) { + $parts[] = 0; + } + + return implode('.', $parts); } } diff --git a/vendor/phpunit/phpunit/src/Runner/Filter/ExcludeGroupFilterIterator.php b/vendor/phpunit/phpunit/src/Runner/Filter/ExcludeGroupFilterIterator.php index b4f3a45c..63a26b44 100644 --- a/vendor/phpunit/phpunit/src/Runner/Filter/ExcludeGroupFilterIterator.php +++ b/vendor/phpunit/phpunit/src/Runner/Filter/ExcludeGroupFilterIterator.php @@ -12,6 +12,8 @@ namespace PHPUnit\Runner\Filter; use function in_array; /** + * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit + * * @internal This class is not covered by the backward compatibility promise for PHPUnit */ final class ExcludeGroupFilterIterator extends GroupFilterIterator diff --git a/vendor/phpunit/phpunit/src/Runner/Filter/Factory.php b/vendor/phpunit/phpunit/src/Runner/Filter/Factory.php index f03c9bbf..4afa5d99 100644 --- a/vendor/phpunit/phpunit/src/Runner/Filter/Factory.php +++ b/vendor/phpunit/phpunit/src/Runner/Filter/Factory.php @@ -16,6 +16,8 @@ use PHPUnit\Framework\TestSuite; use ReflectionClass; /** + * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit + * * @internal This class is not covered by the backward compatibility promise for PHPUnit */ final class Factory @@ -25,6 +27,19 @@ final class Factory */ private array $filters = []; + /** + * @psalm-param list $testIds + */ + public function addTestIdFilter(array $testIds): void + { + $this->filters[] = [ + new ReflectionClass(TestIdFilterIterator::class), $testIds, + ]; + } + + /** + * @psalm-param list $groups + */ public function addExcludeGroupFilter(array $groups): void { $this->filters[] = [ @@ -32,6 +47,9 @@ final class Factory ]; } + /** + * @psalm-param list $groups + */ public function addIncludeGroupFilter(array $groups): void { $this->filters[] = [ @@ -39,6 +57,9 @@ final class Factory ]; } + /** + * @psalm-param non-empty-string $name + */ public function addNameFilter(string $name): void { $this->filters[] = [ diff --git a/vendor/phpunit/phpunit/src/Runner/Filter/GroupFilterIterator.php b/vendor/phpunit/phpunit/src/Runner/Filter/GroupFilterIterator.php index 2519edfd..f2114de9 100644 --- a/vendor/phpunit/phpunit/src/Runner/Filter/GroupFilterIterator.php +++ b/vendor/phpunit/phpunit/src/Runner/Filter/GroupFilterIterator.php @@ -13,11 +13,14 @@ use function array_map; use function array_push; use function in_array; use function spl_object_id; +use PHPUnit\Framework\Test; use PHPUnit\Framework\TestSuite; use RecursiveFilterIterator; use RecursiveIterator; /** + * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit + * * @internal This class is not covered by the backward compatibility promise for PHPUnit */ abstract class GroupFilterIterator extends RecursiveFilterIterator @@ -27,15 +30,19 @@ abstract class GroupFilterIterator extends RecursiveFilterIterator */ protected array $groupTests = []; + /** + * @psalm-param RecursiveIterator $iterator + * @psalm-param list $groups + */ public function __construct(RecursiveIterator $iterator, array $groups, TestSuite $suite) { parent::__construct($iterator); - foreach ($suite->getGroupDetails() as $group => $tests) { + foreach ($suite->groupDetails() as $group => $tests) { if (in_array((string) $group, $groups, true)) { $testHashes = array_map( 'spl_object_id', - $tests + $tests, ); array_push($this->groupTests, ...$testHashes); diff --git a/vendor/phpunit/phpunit/src/Runner/Filter/IncludeGroupFilterIterator.php b/vendor/phpunit/phpunit/src/Runner/Filter/IncludeGroupFilterIterator.php index 8a89e8e5..34b0652a 100644 --- a/vendor/phpunit/phpunit/src/Runner/Filter/IncludeGroupFilterIterator.php +++ b/vendor/phpunit/phpunit/src/Runner/Filter/IncludeGroupFilterIterator.php @@ -12,6 +12,8 @@ namespace PHPUnit\Runner\Filter; use function in_array; /** + * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit + * * @internal This class is not covered by the backward compatibility promise for PHPUnit */ final class IncludeGroupFilterIterator extends GroupFilterIterator diff --git a/vendor/phpunit/phpunit/src/Runner/Filter/NameFilterIterator.php b/vendor/phpunit/phpunit/src/Runner/Filter/NameFilterIterator.php index 8e934df1..5b0c63bb 100644 --- a/vendor/phpunit/phpunit/src/Runner/Filter/NameFilterIterator.php +++ b/vendor/phpunit/phpunit/src/Runner/Filter/NameFilterIterator.php @@ -14,6 +14,7 @@ use function implode; use function preg_match; use function sprintf; use function str_replace; +use function substr; use Exception; use PHPUnit\Framework\SelfDescribing; use PHPUnit\Framework\Test; @@ -23,6 +24,8 @@ use RecursiveFilterIterator; use RecursiveIterator; /** + * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit + * * @internal This class is not covered by the backward compatibility promise for PHPUnit */ final class NameFilterIterator extends RecursiveFilterIterator @@ -32,6 +35,9 @@ final class NameFilterIterator extends RecursiveFilterIterator private ?int $filterMax = null; /** + * @psalm-param RecursiveIterator $iterator + * @psalm-param non-empty-string $filter + * * @throws Exception */ public function __construct(RecursiveIterator $iterator, string $filter) @@ -72,7 +78,7 @@ final class NameFilterIterator extends RecursiveFilterIterator */ private function setFilter(string $filter): void { - if (@preg_match($filter, '') === false) { + if (preg_match('/[a-zA-Z0-9]/', substr($filter, 0, 1)) === 1 || @preg_match($filter, '') === false) { // Handles: // * testAssertEqualsSucceeds#4 // * testAssertEqualsSucceeds#4-8 @@ -80,7 +86,7 @@ final class NameFilterIterator extends RecursiveFilterIterator if (isset($matches[3]) && $matches[2] < $matches[3]) { $filter = sprintf( '%s.*with data set #(\d+)$', - $matches[1] + $matches[1], ); $this->filterMin = (int) $matches[2]; @@ -89,7 +95,7 @@ final class NameFilterIterator extends RecursiveFilterIterator $filter = sprintf( '%s.*with data set #%s$', $matches[1], - $matches[2] + $matches[2], ); } } // Handles: @@ -99,7 +105,7 @@ final class NameFilterIterator extends RecursiveFilterIterator $filter = sprintf( '%s.*with data set "%s"$', $matches[1], - $matches[2] + $matches[2], ); } @@ -110,8 +116,8 @@ final class NameFilterIterator extends RecursiveFilterIterator str_replace( '/', '\\/', - $filter - ) + $filter, + ), ); } diff --git a/vendor/phpunit/phpunit/src/Runner/PhptTestCase.php b/vendor/phpunit/phpunit/src/Runner/PhptTestCase.php index 34eaa30c..dd98c45d 100644 --- a/vendor/phpunit/phpunit/src/Runner/PhptTestCase.php +++ b/vendor/phpunit/phpunit/src/Runner/PhptTestCase.php @@ -19,6 +19,7 @@ use function dirname; use function explode; use function extension_loaded; use function file; +use function file_exists; use function file_get_contents; use function file_put_contents; use function is_array; @@ -31,6 +32,7 @@ use function preg_replace; use function preg_split; use function realpath; use function rtrim; +use function sprintf; use function str_contains; use function str_replace; use function str_starts_with; @@ -57,7 +59,7 @@ use PHPUnit\TextUI\Configuration\Registry as ConfigurationRegistry; use PHPUnit\Util\PHP\AbstractPhpProcess; use SebastianBergmann\CodeCoverage\Data\RawCodeCoverageData; use SebastianBergmann\CodeCoverage\InvalidArgumentException; -use SebastianBergmann\CodeCoverage\StaticAnalysisCacheNotConfiguredException; +use SebastianBergmann\CodeCoverage\ReflectionException; use SebastianBergmann\CodeCoverage\Test\TestSize\TestSize; use SebastianBergmann\CodeCoverage\Test\TestStatus\TestStatus; use SebastianBergmann\CodeCoverage\TestIdMissingException; @@ -66,10 +68,15 @@ use SebastianBergmann\Template\Template; use Throwable; /** + * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit + * * @internal This class is not covered by the backward compatibility promise for PHPUnit */ final class PhptTestCase implements Reorderable, SelfDescribing, Test { + /** + * @psalm-var non-empty-string + */ private readonly string $filename; private readonly AbstractPhpProcess $phpUtil; private string $output = ''; @@ -77,16 +84,17 @@ final class PhptTestCase implements Reorderable, SelfDescribing, Test /** * Constructs a test case with the given filename. * + * @psalm-param non-empty-string $filename + * * @throws Exception */ - public function __construct(string $filename, AbstractPhpProcess $phpUtil = null) + public function __construct(string $filename, ?AbstractPhpProcess $phpUtil = null) { - if (!is_file($filename)) { - throw new FileDoesNotExistException($filename); - } - $this->filename = $filename; - $this->phpUtil = $phpUtil ?: AbstractPhpProcess::factory(); + + $this->ensureCoverageFileDoesNotExist(); + + $this->phpUtil = $phpUtil ?: AbstractPhpProcess::factory(); } /** @@ -101,12 +109,11 @@ final class PhptTestCase implements Reorderable, SelfDescribing, Test * Runs a test and collects its result in a TestResult instance. * * @throws \PHPUnit\Framework\Exception - * @throws \SebastianBergmann\CodeCoverage\ReflectionException * @throws \SebastianBergmann\Template\InvalidArgumentException * @throws Exception * @throws InvalidArgumentException * @throws NoPreviousThrowableException - * @throws StaticAnalysisCacheNotConfiguredException + * @throws ReflectionException * @throws TestIdMissingException * @throws UnintentionallyCoveredCodeException * @@ -117,7 +124,7 @@ final class PhptTestCase implements Reorderable, SelfDescribing, Test $emitter = EventFacade::emitter(); $emitter->testPreparationStarted( - $this->valueObjectForEvents() + $this->valueObjectForEvents(), ); try { @@ -147,10 +154,6 @@ final class PhptTestCase implements Reorderable, SelfDescribing, Test $this->phpUtil->setUseStderrRedirection(true); - if (ConfigurationRegistry::get()->enforceTimeLimit()) { - $this->phpUtil->setTimeout(ConfigurationRegistry::get()->timeoutForLargeTests()); - } - if ($this->shouldTestBeSkipped($sections, $settings)) { return; } @@ -171,20 +174,23 @@ final class PhptTestCase implements Reorderable, SelfDescribing, Test $codeCoverageCacheDirectory = null; if (CodeCoverage::instance()->codeCoverage()->cachesStaticAnalysis()) { + /** @psalm-suppress MissingThrowsDocblock */ $codeCoverageCacheDirectory = CodeCoverage::instance()->codeCoverage()->cacheDirectory(); } $this->renderForCoverage( $code, CodeCoverage::instance()->codeCoverage()->collectsBranchAndPathCoverage(), - $codeCoverageCacheDirectory + $codeCoverageCacheDirectory, ); } $jobResult = $this->phpUtil->runJob($code, $this->stringifyIni($settings)); $this->output = $jobResult['stdout'] ?? ''; - if (CodeCoverage::instance()->isActive() && ($coverage = $this->cleanupForCoverage())) { + if (CodeCoverage::instance()->isActive()) { + $coverage = $this->cleanupForCoverage(); + CodeCoverage::instance()->codeCoverage()->start($this->filename, TestSize::large()); CodeCoverage::instance()->codeCoverage()->append( @@ -192,11 +198,11 @@ final class PhptTestCase implements Reorderable, SelfDescribing, Test $this->filename, true, TestStatus::unknown(), - [], - [] ); } + $passed = true; + try { $this->assertPhptExpectation($sections, $this->output); } catch (AssertionFailedError $e) { @@ -218,10 +224,10 @@ final class PhptTestCase implements Reorderable, SelfDescribing, Test $failure = new PhptAssertionFailedError( $e->getMessage(), 0, - $trace[0]['file'], - $trace[0]['line'], + (string) $trace[0]['file'], + (int) $trace[0]['line'], $trace, - $comparisonFailure ? $diff : '' + $comparisonFailure ? $diff : '', ); } @@ -230,8 +236,16 @@ final class PhptTestCase implements Reorderable, SelfDescribing, Test } else { $emitter->testFailed($this->valueObjectForEvents(), ThrowableBuilder::from($failure), null); } + + $passed = false; } catch (Throwable $t) { $emitter->testErrored($this->valueObjectForEvents(), ThrowableBuilder::from($t)); + + $passed = false; + } + + if ($passed) { + $emitter->testPassed($this->valueObjectForEvents()); } $this->runClean($sections, CodeCoverage::instance()->isActive()); @@ -345,7 +359,7 @@ final class PhptTestCase implements Reorderable, SelfDescribing, Test foreach (explode("\n", trim($content)) as $e) { $e = explode('=', trim($e), 2); - if (!empty($e[0]) && isset($e[1])) { + if ($e[0] !== '' && isset($e[1])) { $env[$e[0]] = $e[1]; } } @@ -399,7 +413,7 @@ final class PhptTestCase implements Reorderable, SelfDescribing, Test EventFacade::emitter()->testSkipped( $this->valueObjectForEvents(), - $message + $message, ); EventFacade::emitter()->testFinished($this->valueObjectForEvents(), 0); @@ -508,7 +522,7 @@ final class PhptTestCase implements Reorderable, SelfDescribing, Test !is_readable($testDirectory . $externalFilename)) { throw new PhptExternalFileCannotBeLoadedException( $section, - $testDirectory . $externalFilename + $testDirectory . $externalFilename, ); } @@ -566,7 +580,7 @@ final class PhptTestCase implements Reorderable, SelfDescribing, Test "'" . dirname($this->filename) . "'", "'" . $this->filename . "'", ], - $code + $code, ); } @@ -589,7 +603,7 @@ final class PhptTestCase implements Reorderable, SelfDescribing, Test $files = $this->getCoverageFiles(); $template = new Template( - __DIR__ . '/../Util/PHP/Template/PhptTestCase.tpl' + __DIR__ . '/../Util/PHP/Template/PhptTestCase.tpl', ); $composerAutoload = '\'\''; @@ -625,7 +639,7 @@ final class PhptTestCase implements Reorderable, SelfDescribing, Test 'coverageFile' => $files['coverage'], 'driverMethod' => $pathCoverage ? 'forLineAndPathCoverage' : 'forLineCoverage', 'codeCoverageCacheDirectory' => $codeCoverageCacheDirectory, - ] + ], ); file_put_contents($files['job'], $job); @@ -638,15 +652,24 @@ final class PhptTestCase implements Reorderable, SelfDescribing, Test $coverage = RawCodeCoverageData::fromXdebugWithoutPathCoverage([]); $files = $this->getCoverageFiles(); + $buffer = false; + if (is_file($files['coverage'])) { $buffer = @file_get_contents($files['coverage']); + } - if ($buffer !== false) { - $coverage = @unserialize($buffer); + if ($buffer !== false) { + $coverage = @unserialize( + $buffer, + [ + 'allowed_classes' => [ + RawCodeCoverageData::class, + ], + ], + ); - if ($coverage === false) { - $coverage = RawCodeCoverageData::fromXdebugWithoutPathCoverage([]); - } + if ($coverage === false) { + $coverage = RawCodeCoverageData::fromXdebugWithoutPathCoverage([]); } } @@ -808,7 +831,6 @@ final class PhptTestCase implements Reorderable, SelfDescribing, Test 'open_basedir=', 'output_buffering=Off', 'output_handler=', - 'report_memleaks=0', 'report_zend_debug=0', ]; @@ -830,4 +852,22 @@ final class PhptTestCase implements Reorderable, SelfDescribing, Test return $settings; } + + /** + * @throws CodeCoverageFileExistsException + */ + private function ensureCoverageFileDoesNotExist(): void + { + $files = $this->getCoverageFiles(); + + if (file_exists($files['coverage'])) { + throw new CodeCoverageFileExistsException( + sprintf( + 'File %s exists, PHPT test %s will not be executed', + $files['coverage'], + $this->filename, + ), + ); + } + } } diff --git a/vendor/phpunit/phpunit/src/Runner/ResultCache/DefaultResultCache.php b/vendor/phpunit/phpunit/src/Runner/ResultCache/DefaultResultCache.php index b77f44ac..32340ef0 100644 --- a/vendor/phpunit/phpunit/src/Runner/ResultCache/DefaultResultCache.php +++ b/vendor/phpunit/phpunit/src/Runner/ResultCache/DefaultResultCache.php @@ -10,6 +10,7 @@ namespace PHPUnit\Runner\ResultCache; use const DIRECTORY_SEPARATOR; +use const LOCK_EX; use function array_keys; use function assert; use function dirname; @@ -21,11 +22,13 @@ use function is_file; use function json_decode; use function json_encode; use PHPUnit\Framework\TestStatus\TestStatus; -use PHPUnit\Runner\DirectoryCannotBeCreatedException; +use PHPUnit\Runner\DirectoryDoesNotExistException; use PHPUnit\Runner\Exception; use PHPUnit\Util\Filesystem; /** + * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit + * * @internal This class is not covered by the backward compatibility promise for PHPUnit */ final class DefaultResultCache implements ResultCache @@ -33,7 +36,7 @@ final class DefaultResultCache implements ResultCache /** * @var int */ - private const VERSION = 1; + private const VERSION = 2; /** * @var string @@ -84,15 +87,32 @@ final class DefaultResultCache implements ResultCache return $this->times[$id] ?? 0.0; } + public function mergeWith(self $other): void + { + foreach ($other->defects as $id => $defect) { + $this->defects[$id] = $defect; + } + + foreach ($other->times as $id => $time) { + $this->times[$id] = $time; + } + } + public function load(): void { if (!is_file($this->cacheFilename)) { return; } + $contents = file_get_contents($this->cacheFilename); + + if ($contents === false) { + return; + } + $data = json_decode( - file_get_contents($this->cacheFilename), - true + $contents, + true, ); if ($data === null) { @@ -124,7 +144,7 @@ final class DefaultResultCache implements ResultCache public function persist(): void { if (!Filesystem::createDirectory(dirname($this->cacheFilename))) { - throw new DirectoryCannotBeCreatedException($this->cacheFilename); + throw new DirectoryDoesNotExistException(dirname($this->cacheFilename)); } $data = [ @@ -140,7 +160,7 @@ final class DefaultResultCache implements ResultCache file_put_contents( $this->cacheFilename, json_encode($data), - LOCK_EX + LOCK_EX, ); } } diff --git a/vendor/phpunit/phpunit/src/Runner/ResultCache/NullResultCache.php b/vendor/phpunit/phpunit/src/Runner/ResultCache/NullResultCache.php index 1e93eeb9..f0cc4c30 100644 --- a/vendor/phpunit/phpunit/src/Runner/ResultCache/NullResultCache.php +++ b/vendor/phpunit/phpunit/src/Runner/ResultCache/NullResultCache.php @@ -12,6 +12,8 @@ namespace PHPUnit\Runner\ResultCache; use PHPUnit\Framework\TestStatus\TestStatus; /** + * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit + * * @internal This class is not covered by the backward compatibility promise for PHPUnit */ final class NullResultCache implements ResultCache diff --git a/vendor/phpunit/phpunit/src/Runner/ResultCache/ResultCache.php b/vendor/phpunit/phpunit/src/Runner/ResultCache/ResultCache.php index 95546048..5b9a0cc7 100644 --- a/vendor/phpunit/phpunit/src/Runner/ResultCache/ResultCache.php +++ b/vendor/phpunit/phpunit/src/Runner/ResultCache/ResultCache.php @@ -12,7 +12,9 @@ namespace PHPUnit\Runner\ResultCache; use PHPUnit\Framework\TestStatus\TestStatus; /** - * @internal This class is not covered by the backward compatibility promise for PHPUnit + * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit + * + * @internal This interface is not covered by the backward compatibility promise for PHPUnit */ interface ResultCache { diff --git a/vendor/phpunit/phpunit/src/Runner/ResultCache/ResultCacheHandler.php b/vendor/phpunit/phpunit/src/Runner/ResultCache/ResultCacheHandler.php index 58a4bafc..927725a8 100644 --- a/vendor/phpunit/phpunit/src/Runner/ResultCache/ResultCacheHandler.php +++ b/vendor/phpunit/phpunit/src/Runner/ResultCache/ResultCacheHandler.php @@ -26,6 +26,8 @@ use PHPUnit\Framework\InvalidArgumentException; use PHPUnit\Framework\TestStatus\TestStatus; /** + * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit + * * @internal This class is not covered by the backward compatibility promise for PHPUnit */ final class ResultCacheHandler @@ -38,11 +40,11 @@ final class ResultCacheHandler * @throws EventFacadeIsSealedException * @throws UnknownSubscriberTypeException */ - public function __construct(ResultCache $cache) + public function __construct(ResultCache $cache, Facade $facade) { $this->cache = $cache; - $this->registerSubscribers(); + $this->registerSubscribers($facade); } public function testSuiteStarted(): void @@ -68,7 +70,7 @@ final class ResultCacheHandler { $this->cache->setStatus( $event->test()->id(), - TestStatus::incomplete($event->throwable()->message()) + TestStatus::incomplete($event->throwable()->message()), ); } @@ -76,7 +78,7 @@ final class ResultCacheHandler { $this->cache->setStatus( $event->test()->id(), - TestStatus::risky($event->message()) + TestStatus::risky($event->message()), ); } @@ -84,7 +86,7 @@ final class ResultCacheHandler { $this->cache->setStatus( $event->test()->id(), - TestStatus::error($event->throwable()->message()) + TestStatus::error($event->throwable()->message()), ); } @@ -92,7 +94,7 @@ final class ResultCacheHandler { $this->cache->setStatus( $event->test()->id(), - TestStatus::failure($event->throwable()->message()) + TestStatus::failure($event->throwable()->message()), ); } @@ -104,7 +106,7 @@ final class ResultCacheHandler { $this->cache->setStatus( $event->test()->id(), - TestStatus::skipped($event->message()) + TestStatus::skipped($event->message()), ); $this->cache->setTime($event->test()->id(), $this->duration($event)); @@ -138,9 +140,9 @@ final class ResultCacheHandler * @throws EventFacadeIsSealedException * @throws UnknownSubscriberTypeException */ - private function registerSubscribers(): void + private function registerSubscribers(Facade $facade): void { - Facade::registerSubscribers( + $facade->registerSubscribers( new TestSuiteStartedSubscriber($this), new TestSuiteFinishedSubscriber($this), new TestPreparedSubscriber($this), diff --git a/vendor/phpunit/phpunit/src/Runner/ResultCache/Subscriber/Subscriber.php b/vendor/phpunit/phpunit/src/Runner/ResultCache/Subscriber/Subscriber.php index 77abb6f1..254b36a4 100644 --- a/vendor/phpunit/phpunit/src/Runner/ResultCache/Subscriber/Subscriber.php +++ b/vendor/phpunit/phpunit/src/Runner/ResultCache/Subscriber/Subscriber.php @@ -10,6 +10,8 @@ namespace PHPUnit\Runner\ResultCache; /** + * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit + * * @internal This class is not covered by the backward compatibility promise for PHPUnit */ abstract class Subscriber diff --git a/vendor/phpunit/phpunit/src/Runner/ResultCache/Subscriber/TestConsideredRiskySubscriber.php b/vendor/phpunit/phpunit/src/Runner/ResultCache/Subscriber/TestConsideredRiskySubscriber.php index 6ca0701a..5675f46d 100644 --- a/vendor/phpunit/phpunit/src/Runner/ResultCache/Subscriber/TestConsideredRiskySubscriber.php +++ b/vendor/phpunit/phpunit/src/Runner/ResultCache/Subscriber/TestConsideredRiskySubscriber.php @@ -13,6 +13,8 @@ use PHPUnit\Event\Test\ConsideredRisky; use PHPUnit\Event\Test\ConsideredRiskySubscriber; /** + * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit + * * @internal This class is not covered by the backward compatibility promise for PHPUnit */ final class TestConsideredRiskySubscriber extends Subscriber implements ConsideredRiskySubscriber diff --git a/vendor/phpunit/phpunit/src/Runner/ResultCache/Subscriber/TestErroredSubscriber.php b/vendor/phpunit/phpunit/src/Runner/ResultCache/Subscriber/TestErroredSubscriber.php index 954551bd..6acc7fbf 100644 --- a/vendor/phpunit/phpunit/src/Runner/ResultCache/Subscriber/TestErroredSubscriber.php +++ b/vendor/phpunit/phpunit/src/Runner/ResultCache/Subscriber/TestErroredSubscriber.php @@ -13,6 +13,8 @@ use PHPUnit\Event\Test\Errored; use PHPUnit\Event\Test\ErroredSubscriber; /** + * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit + * * @internal This class is not covered by the backward compatibility promise for PHPUnit */ final class TestErroredSubscriber extends Subscriber implements ErroredSubscriber diff --git a/vendor/phpunit/phpunit/src/Runner/ResultCache/Subscriber/TestFailedSubscriber.php b/vendor/phpunit/phpunit/src/Runner/ResultCache/Subscriber/TestFailedSubscriber.php index effdb0c2..d9528986 100644 --- a/vendor/phpunit/phpunit/src/Runner/ResultCache/Subscriber/TestFailedSubscriber.php +++ b/vendor/phpunit/phpunit/src/Runner/ResultCache/Subscriber/TestFailedSubscriber.php @@ -13,6 +13,8 @@ use PHPUnit\Event\Test\Failed; use PHPUnit\Event\Test\FailedSubscriber; /** + * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit + * * @internal This class is not covered by the backward compatibility promise for PHPUnit */ final class TestFailedSubscriber extends Subscriber implements FailedSubscriber diff --git a/vendor/phpunit/phpunit/src/Runner/ResultCache/Subscriber/TestFinishedSubscriber.php b/vendor/phpunit/phpunit/src/Runner/ResultCache/Subscriber/TestFinishedSubscriber.php index ff39f716..d0457379 100644 --- a/vendor/phpunit/phpunit/src/Runner/ResultCache/Subscriber/TestFinishedSubscriber.php +++ b/vendor/phpunit/phpunit/src/Runner/ResultCache/Subscriber/TestFinishedSubscriber.php @@ -14,6 +14,8 @@ use PHPUnit\Event\Test\Finished; use PHPUnit\Event\Test\FinishedSubscriber; /** + * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit + * * @internal This class is not covered by the backward compatibility promise for PHPUnit */ final class TestFinishedSubscriber extends Subscriber implements FinishedSubscriber diff --git a/vendor/phpunit/phpunit/src/Runner/ResultCache/Subscriber/TestMarkedIncompleteSubscriber.php b/vendor/phpunit/phpunit/src/Runner/ResultCache/Subscriber/TestMarkedIncompleteSubscriber.php index 69364ac2..e9838359 100644 --- a/vendor/phpunit/phpunit/src/Runner/ResultCache/Subscriber/TestMarkedIncompleteSubscriber.php +++ b/vendor/phpunit/phpunit/src/Runner/ResultCache/Subscriber/TestMarkedIncompleteSubscriber.php @@ -13,6 +13,8 @@ use PHPUnit\Event\Test\MarkedIncomplete; use PHPUnit\Event\Test\MarkedIncompleteSubscriber; /** + * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit + * * @internal This class is not covered by the backward compatibility promise for PHPUnit */ final class TestMarkedIncompleteSubscriber extends Subscriber implements MarkedIncompleteSubscriber diff --git a/vendor/phpunit/phpunit/src/Runner/ResultCache/Subscriber/TestPreparedSubscriber.php b/vendor/phpunit/phpunit/src/Runner/ResultCache/Subscriber/TestPreparedSubscriber.php index eee675b1..6e7cd77a 100644 --- a/vendor/phpunit/phpunit/src/Runner/ResultCache/Subscriber/TestPreparedSubscriber.php +++ b/vendor/phpunit/phpunit/src/Runner/ResultCache/Subscriber/TestPreparedSubscriber.php @@ -13,6 +13,8 @@ use PHPUnit\Event\Test\Prepared; use PHPUnit\Event\Test\PreparedSubscriber; /** + * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit + * * @internal This class is not covered by the backward compatibility promise for PHPUnit */ final class TestPreparedSubscriber extends Subscriber implements PreparedSubscriber diff --git a/vendor/phpunit/phpunit/src/Runner/ResultCache/Subscriber/TestSkippedSubscriber.php b/vendor/phpunit/phpunit/src/Runner/ResultCache/Subscriber/TestSkippedSubscriber.php index 21c748b0..b9ad4e34 100644 --- a/vendor/phpunit/phpunit/src/Runner/ResultCache/Subscriber/TestSkippedSubscriber.php +++ b/vendor/phpunit/phpunit/src/Runner/ResultCache/Subscriber/TestSkippedSubscriber.php @@ -14,6 +14,8 @@ use PHPUnit\Event\Test\Skipped; use PHPUnit\Event\Test\SkippedSubscriber; /** + * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit + * * @internal This class is not covered by the backward compatibility promise for PHPUnit */ final class TestSkippedSubscriber extends Subscriber implements SkippedSubscriber diff --git a/vendor/phpunit/phpunit/src/Runner/ResultCache/Subscriber/TestSuiteFinishedSubscriber.php b/vendor/phpunit/phpunit/src/Runner/ResultCache/Subscriber/TestSuiteFinishedSubscriber.php index c252823b..1c6fef3a 100644 --- a/vendor/phpunit/phpunit/src/Runner/ResultCache/Subscriber/TestSuiteFinishedSubscriber.php +++ b/vendor/phpunit/phpunit/src/Runner/ResultCache/Subscriber/TestSuiteFinishedSubscriber.php @@ -13,6 +13,8 @@ use PHPUnit\Event\TestSuite\Finished; use PHPUnit\Event\TestSuite\FinishedSubscriber; /** + * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit + * * @internal This class is not covered by the backward compatibility promise for PHPUnit */ final class TestSuiteFinishedSubscriber extends Subscriber implements FinishedSubscriber diff --git a/vendor/phpunit/phpunit/src/Runner/ResultCache/Subscriber/TestSuiteStartedSubscriber.php b/vendor/phpunit/phpunit/src/Runner/ResultCache/Subscriber/TestSuiteStartedSubscriber.php index 1c78b0ec..e56874fa 100644 --- a/vendor/phpunit/phpunit/src/Runner/ResultCache/Subscriber/TestSuiteStartedSubscriber.php +++ b/vendor/phpunit/phpunit/src/Runner/ResultCache/Subscriber/TestSuiteStartedSubscriber.php @@ -13,6 +13,8 @@ use PHPUnit\Event\TestSuite\Started; use PHPUnit\Event\TestSuite\StartedSubscriber; /** + * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit + * * @internal This class is not covered by the backward compatibility promise for PHPUnit */ final class TestSuiteStartedSubscriber extends Subscriber implements StartedSubscriber diff --git a/vendor/phpunit/phpunit/src/Runner/TestResult/Collector.php b/vendor/phpunit/phpunit/src/Runner/TestResult/Collector.php index f39528ad..d50536c9 100644 --- a/vendor/phpunit/phpunit/src/Runner/TestResult/Collector.php +++ b/vendor/phpunit/phpunit/src/Runner/TestResult/Collector.php @@ -9,11 +9,14 @@ */ namespace PHPUnit\TestRunner\TestResult; +use function array_values; use function assert; +use function implode; use function str_contains; use PHPUnit\Event\Code\TestMethod; use PHPUnit\Event\EventFacadeIsSealedException; use PHPUnit\Event\Facade; +use PHPUnit\Event\Test\AfterLastTestMethodErrored; use PHPUnit\Event\Test\BeforeFirstTestMethodErrored; use PHPUnit\Event\Test\ConsideredRisky; use PHPUnit\Event\Test\DeprecationTriggered; @@ -31,7 +34,6 @@ use PHPUnit\Event\Test\PhpunitWarningTriggered; use PHPUnit\Event\Test\PhpWarningTriggered; use PHPUnit\Event\Test\Skipped as TestSkipped; use PHPUnit\Event\Test\WarningTriggered; -use PHPUnit\Event\TestData\NoDataSetFromDataProviderException; use PHPUnit\Event\TestRunner\DeprecationTriggered as TestRunnerDeprecationTriggered; use PHPUnit\Event\TestRunner\ExecutionStarted; use PHPUnit\Event\TestRunner\WarningTriggered as TestRunnerWarningTriggered; @@ -41,12 +43,18 @@ use PHPUnit\Event\TestSuite\Started as TestSuiteStarted; use PHPUnit\Event\TestSuite\TestSuiteForTestClass; use PHPUnit\Event\TestSuite\TestSuiteForTestMethodWithDataProvider; use PHPUnit\Event\UnknownSubscriberTypeException; +use PHPUnit\TestRunner\TestResult\Issues\Issue; +use PHPUnit\TextUI\Configuration\Source; +use PHPUnit\TextUI\Configuration\SourceFilter; /** + * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit + * * @internal This class is not covered by the backward compatibility promise for PHPUnit */ final class Collector { + private readonly Source $source; private int $numberOfTests = 0; private int $numberOfTestsRun = 0; private int $numberOfAssertions = 0; @@ -54,7 +62,12 @@ final class Collector private bool $currentTestSuiteForTestClassFailed = false; /** - * @psalm-var list + * @psalm-var non-negative-int + */ + private int $numberOfIssuesIgnoredByBaseline = 0; + + /** + * @psalm-var list */ private array $testErroredEvents = []; @@ -83,46 +96,11 @@ final class Collector */ private array $testConsideredRiskyEvents = []; - /** - * @psalm-var array> - */ - private array $testTriggeredDeprecationEvents = []; - - /** - * @psalm-var array> - */ - private array $testTriggeredPhpDeprecationEvents = []; - /** * @psalm-var array> */ private array $testTriggeredPhpunitDeprecationEvents = []; - /** - * @psalm-var array> - */ - private array $testTriggeredErrorEvents = []; - - /** - * @psalm-var array> - */ - private array $testTriggeredNoticeEvents = []; - - /** - * @psalm-var array> - */ - private array $testTriggeredPhpNoticeEvents = []; - - /** - * @psalm-var array> - */ - private array $testTriggeredWarningEvents = []; - - /** - * @psalm-var array> - */ - private array $testTriggeredPhpWarningEvents = []; - /** * @psalm-var array> */ @@ -143,13 +121,48 @@ final class Collector */ private array $testRunnerTriggeredDeprecationEvents = []; + /** + * @psalm-var array + */ + private array $errors = []; + + /** + * @psalm-var array + */ + private array $deprecations = []; + + /** + * @psalm-var array + */ + private array $notices = []; + + /** + * @psalm-var array + */ + private array $warnings = []; + + /** + * @psalm-var array + */ + private array $phpDeprecations = []; + + /** + * @psalm-var array + */ + private array $phpNotices = []; + + /** + * @psalm-var array + */ + private array $phpWarnings = []; + /** * @throws EventFacadeIsSealedException * @throws UnknownSubscriberTypeException */ - public function __construct() + public function __construct(Facade $facade, Source $source) { - Facade::registerSubscribers( + $facade->registerSubscribers( new ExecutionStartedSubscriber($this), new TestSuiteSkippedSubscriber($this), new TestSuiteStartedSubscriber($this), @@ -157,6 +170,7 @@ final class Collector new TestPreparedSubscriber($this), new TestFinishedSubscriber($this), new BeforeTestClassMethodErroredSubscriber($this), + new AfterTestClassMethodErroredSubscriber($this), new TestErroredSubscriber($this), new TestFailedSubscriber($this), new TestMarkedIncompleteSubscriber($this), @@ -175,6 +189,8 @@ final class Collector new TestRunnerTriggeredDeprecationSubscriber($this), new TestRunnerTriggeredWarningSubscriber($this), ); + + $this->source = $source; } public function result(): TestResult @@ -189,59 +205,22 @@ final class Collector $this->testSuiteSkippedEvents, $this->testSkippedEvents, $this->testMarkedIncompleteEvents, - $this->testTriggeredDeprecationEvents, - $this->testTriggeredPhpDeprecationEvents, $this->testTriggeredPhpunitDeprecationEvents, - $this->testTriggeredErrorEvents, - $this->testTriggeredNoticeEvents, - $this->testTriggeredPhpNoticeEvents, - $this->testTriggeredWarningEvents, - $this->testTriggeredPhpWarningEvents, $this->testTriggeredPhpunitErrorEvents, $this->testTriggeredPhpunitWarningEvents, $this->testRunnerTriggeredDeprecationEvents, $this->testRunnerTriggeredWarningEvents, + array_values($this->errors), + array_values($this->deprecations), + array_values($this->notices), + array_values($this->warnings), + array_values($this->phpDeprecations), + array_values($this->phpNotices), + array_values($this->phpWarnings), + $this->numberOfIssuesIgnoredByBaseline, ); } - public function hasTestErroredEvents(): bool - { - return !empty($this->testErroredEvents); - } - - public function hasTestFailedEvents(): bool - { - return !empty($this->testFailedEvents); - } - - public function hasTestConsideredRiskyEvents(): bool - { - return !empty($this->testConsideredRiskyEvents); - } - - public function hasTestSkippedEvents(): bool - { - return !empty($this->testSkippedEvents); - } - - public function hasTestMarkedIncompleteEvents(): bool - { - return !empty($this->testMarkedIncompleteEvents); - } - - public function hasTestRunnerTriggeredWarningEvents(): bool - { - return !empty($this->testRunnerTriggeredWarningEvents); - } - - /** - * @psalm-return list - */ - public function testRunnerTriggeredWarningEvents(): array - { - return $this->testRunnerTriggeredWarningEvents; - } - public function executionStarted(ExecutionStarted $event): void { $this->numberOfTests = $event->testSuite()->count(); @@ -269,9 +248,6 @@ final class Collector $this->currentTestSuiteForTestClassFailed = false; } - /** - * @throws NoDataSetFromDataProviderException - */ public function testSuiteFinished(TestSuiteFinished $event): void { if ($this->currentTestSuiteForTestClassFailed) { @@ -322,6 +298,11 @@ final class Collector $this->numberOfTestsRun++; } + public function afterTestClassMethodErrored(AfterLastTestMethodErrored $event): void + { + $this->testErroredEvents[] = $event; + } + public function testErrored(Errored $event): void { $this->testErroredEvents[] = $event; @@ -372,20 +353,74 @@ final class Collector public function testTriggeredDeprecation(DeprecationTriggered $event): void { - if (!isset($this->testTriggeredDeprecationEvents[$event->test()->id()])) { - $this->testTriggeredDeprecationEvents[$event->test()->id()] = []; + if ($event->ignoredByTest()) { + return; } - $this->testTriggeredDeprecationEvents[$event->test()->id()][] = $event; + if ($event->ignoredByBaseline()) { + $this->numberOfIssuesIgnoredByBaseline++; + + return; + } + + if (!$this->source->ignoreSuppressionOfDeprecations() && $event->wasSuppressed()) { + return; + } + + if ($this->source->restrictDeprecations() && !SourceFilter::instance()->includes($event->file())) { + return; + } + + $id = $this->issueId($event); + + if (!isset($this->deprecations[$id])) { + $this->deprecations[$id] = Issue::from( + $event->file(), + $event->line(), + $event->message(), + $event->test(), + ); + + return; + } + + $this->deprecations[$id]->triggeredBy($event->test()); } public function testTriggeredPhpDeprecation(PhpDeprecationTriggered $event): void { - if (!isset($this->testTriggeredPhpDeprecationEvents[$event->test()->id()])) { - $this->testTriggeredPhpDeprecationEvents[$event->test()->id()] = []; + if ($event->ignoredByTest()) { + return; } - $this->testTriggeredPhpDeprecationEvents[$event->test()->id()][] = $event; + if ($event->ignoredByBaseline()) { + $this->numberOfIssuesIgnoredByBaseline++; + + return; + } + + if (!$this->source->ignoreSuppressionOfPhpDeprecations() && $event->wasSuppressed()) { + return; + } + + if ($this->source->restrictDeprecations() && !SourceFilter::instance()->includes($event->file())) { + return; + } + + $id = $this->issueId($event); + + if (!isset($this->phpDeprecations[$id])) { + $this->phpDeprecations[$id] = Issue::from( + $event->file(), + $event->line(), + $event->message(), + $event->test(), + ); + + return; + } + + $this->phpDeprecations[$id]->triggeredBy($event->test()); } public function testTriggeredPhpunitDeprecation(PhpunitDeprecationTriggered $event): void @@ -399,47 +434,152 @@ final class Collector public function testTriggeredError(ErrorTriggered $event): void { - if (!isset($this->testTriggeredErrorEvents[$event->test()->id()])) { - $this->testTriggeredErrorEvents[$event->test()->id()] = []; + if (!$this->source->ignoreSuppressionOfErrors() && $event->wasSuppressed()) { + return; } - $this->testTriggeredErrorEvents[$event->test()->id()][] = $event; + $id = $this->issueId($event); + + if (!isset($this->errors[$id])) { + $this->errors[$id] = Issue::from( + $event->file(), + $event->line(), + $event->message(), + $event->test(), + ); + + return; + } + + $this->errors[$id]->triggeredBy($event->test()); } public function testTriggeredNotice(NoticeTriggered $event): void { - if (!isset($this->testTriggeredNoticeEvents[$event->test()->id()])) { - $this->testTriggeredNoticeEvents[$event->test()->id()] = []; + if ($event->ignoredByBaseline()) { + $this->numberOfIssuesIgnoredByBaseline++; + + return; } - $this->testTriggeredNoticeEvents[$event->test()->id()][] = $event; + if (!$this->source->ignoreSuppressionOfNotices() && $event->wasSuppressed()) { + return; + } + + if ($this->source->restrictNotices() && !SourceFilter::instance()->includes($event->file())) { + return; + } + + $id = $this->issueId($event); + + if (!isset($this->notices[$id])) { + $this->notices[$id] = Issue::from( + $event->file(), + $event->line(), + $event->message(), + $event->test(), + ); + + return; + } + + $this->notices[$id]->triggeredBy($event->test()); } public function testTriggeredPhpNotice(PhpNoticeTriggered $event): void { - if (!isset($this->testTriggeredPhpNoticeEvents[$event->test()->id()])) { - $this->testTriggeredPhpNoticeEvents[$event->test()->id()] = []; + if ($event->ignoredByBaseline()) { + $this->numberOfIssuesIgnoredByBaseline++; + + return; } - $this->testTriggeredPhpNoticeEvents[$event->test()->id()][] = $event; + if (!$this->source->ignoreSuppressionOfPhpNotices() && $event->wasSuppressed()) { + return; + } + + if ($this->source->restrictNotices() && !SourceFilter::instance()->includes($event->file())) { + return; + } + + $id = $this->issueId($event); + + if (!isset($this->phpNotices[$id])) { + $this->phpNotices[$id] = Issue::from( + $event->file(), + $event->line(), + $event->message(), + $event->test(), + ); + + return; + } + + $this->phpNotices[$id]->triggeredBy($event->test()); } public function testTriggeredWarning(WarningTriggered $event): void { - if (!isset($this->testTriggeredWarningEvents[$event->test()->id()])) { - $this->testTriggeredWarningEvents[$event->test()->id()] = []; + if ($event->ignoredByBaseline()) { + $this->numberOfIssuesIgnoredByBaseline++; + + return; } - $this->testTriggeredWarningEvents[$event->test()->id()][] = $event; + if (!$this->source->ignoreSuppressionOfWarnings() && $event->wasSuppressed()) { + return; + } + + if ($this->source->restrictWarnings() && !SourceFilter::instance()->includes($event->file())) { + return; + } + + $id = $this->issueId($event); + + if (!isset($this->warnings[$id])) { + $this->warnings[$id] = Issue::from( + $event->file(), + $event->line(), + $event->message(), + $event->test(), + ); + + return; + } + + $this->warnings[$id]->triggeredBy($event->test()); } public function testTriggeredPhpWarning(PhpWarningTriggered $event): void { - if (!isset($this->testTriggeredPhpWarningEvents[$event->test()->id()])) { - $this->testTriggeredPhpWarningEvents[$event->test()->id()] = []; + if ($event->ignoredByBaseline()) { + $this->numberOfIssuesIgnoredByBaseline++; + + return; } - $this->testTriggeredPhpWarningEvents[$event->test()->id()][] = $event; + if (!$this->source->ignoreSuppressionOfPhpWarnings() && $event->wasSuppressed()) { + return; + } + + if ($this->source->restrictWarnings() && !SourceFilter::instance()->includes($event->file())) { + return; + } + + $id = $this->issueId($event); + + if (!isset($this->phpWarnings[$id])) { + $this->phpWarnings[$id] = Issue::from( + $event->file(), + $event->line(), + $event->message(), + $event->test(), + ); + + return; + } + + $this->phpWarnings[$id]->triggeredBy($event->test()); } public function testTriggeredPhpunitError(PhpunitErrorTriggered $event): void @@ -470,11 +610,58 @@ final class Collector $this->testRunnerTriggeredWarningEvents[] = $event; } - public function hasWarningEvents(): bool + public function hasErroredTests(): bool { - return !empty($this->testTriggeredWarningEvents) || - !empty($this->testTriggeredPhpWarningEvents) || + return !empty($this->testErroredEvents); + } + + public function hasFailedTests(): bool + { + return !empty($this->testFailedEvents); + } + + public function hasRiskyTests(): bool + { + return !empty($this->testConsideredRiskyEvents); + } + + public function hasSkippedTests(): bool + { + return !empty($this->testSkippedEvents); + } + + public function hasIncompleteTests(): bool + { + return !empty($this->testMarkedIncompleteEvents); + } + + public function hasDeprecations(): bool + { + return !empty($this->deprecations) || + !empty($this->phpDeprecations) || + !empty($this->testTriggeredPhpunitDeprecationEvents) || + !empty($this->testRunnerTriggeredDeprecationEvents); + } + + public function hasNotices(): bool + { + return !empty($this->notices) || + !empty($this->phpNotices); + } + + public function hasWarnings(): bool + { + return !empty($this->warnings) || + !empty($this->phpWarnings) || !empty($this->testTriggeredPhpunitWarningEvents) || !empty($this->testRunnerTriggeredWarningEvents); } + + /** + * @psalm-return non-empty-string + */ + private function issueId(DeprecationTriggered|ErrorTriggered|NoticeTriggered|PhpDeprecationTriggered|PhpNoticeTriggered|PhpWarningTriggered|WarningTriggered $event): string + { + return implode(':', [$event->file(), $event->line(), $event->message()]); + } } diff --git a/vendor/phpunit/phpunit/src/Runner/TestResult/Facade.php b/vendor/phpunit/phpunit/src/Runner/TestResult/Facade.php index e4d964a5..75b7471e 100644 --- a/vendor/phpunit/phpunit/src/Runner/TestResult/Facade.php +++ b/vendor/phpunit/phpunit/src/Runner/TestResult/Facade.php @@ -10,9 +10,13 @@ namespace PHPUnit\TestRunner\TestResult; use PHPUnit\Event\EventFacadeIsSealedException; +use PHPUnit\Event\Facade as EventFacade; use PHPUnit\Event\UnknownSubscriberTypeException; +use PHPUnit\TextUI\Configuration\Registry as ConfigurationRegistry; /** + * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit + * * @internal This class is not covered by the backward compatibility promise for PHPUnit */ final class Facade @@ -41,54 +45,44 @@ final class Facade * @throws EventFacadeIsSealedException * @throws UnknownSubscriberTypeException */ - public static function hasTestErroredEvents(): bool + public static function shouldStop(): bool { - return self::collector()->hasTestErroredEvents(); - } + $configuration = ConfigurationRegistry::get(); + $collector = self::collector(); - /** - * @throws EventFacadeIsSealedException - * @throws UnknownSubscriberTypeException - */ - public static function hasTestFailedEvents(): bool - { - return self::collector()->hasTestFailedEvents(); - } + if (($configuration->stopOnDefect() || $configuration->stopOnError()) && $collector->hasErroredTests()) { + return true; + } - /** - * @throws EventFacadeIsSealedException - * @throws UnknownSubscriberTypeException - */ - public static function hasWarningEvents(): bool - { - return self::collector()->hasWarningEvents(); - } + if (($configuration->stopOnDefect() || $configuration->stopOnFailure()) && $collector->hasFailedTests()) { + return true; + } - /** - * @throws EventFacadeIsSealedException - * @throws UnknownSubscriberTypeException - */ - public static function hasTestConsideredRiskyEvents(): bool - { - return self::collector()->hasTestConsideredRiskyEvents(); - } + if (($configuration->stopOnDefect() || $configuration->stopOnWarning()) && $collector->hasWarnings()) { + return true; + } - /** - * @throws EventFacadeIsSealedException - * @throws UnknownSubscriberTypeException - */ - public static function hasTestSkippedEvents(): bool - { - return self::collector()->hasTestSkippedEvents(); - } + if (($configuration->stopOnDefect() || $configuration->stopOnRisky()) && $collector->hasRiskyTests()) { + return true; + } - /** - * @throws EventFacadeIsSealedException - * @throws UnknownSubscriberTypeException - */ - public static function hasTestMarkedIncompleteEvents(): bool - { - return self::collector()->hasTestMarkedIncompleteEvents(); + if ($configuration->stopOnDeprecation() && $collector->hasDeprecations()) { + return true; + } + + if ($configuration->stopOnNotice() && $collector->hasNotices()) { + return true; + } + + if ($configuration->stopOnIncomplete() && $collector->hasIncompleteTests()) { + return true; + } + + if ($configuration->stopOnSkipped() && $collector->hasSkippedTests()) { + return true; + } + + return false; } /** @@ -98,7 +92,12 @@ final class Facade private static function collector(): Collector { if (self::$collector === null) { - self::$collector = new Collector; + $configuration = ConfigurationRegistry::get(); + + self::$collector = new Collector( + EventFacade::instance(), + $configuration->source(), + ); } return self::$collector; diff --git a/vendor/phpunit/phpunit/src/Runner/TestResult/PassedTests.php b/vendor/phpunit/phpunit/src/Runner/TestResult/PassedTests.php index 54957177..b448bc86 100644 --- a/vendor/phpunit/phpunit/src/Runner/TestResult/PassedTests.php +++ b/vendor/phpunit/phpunit/src/Runner/TestResult/PassedTests.php @@ -13,12 +13,13 @@ use function array_merge; use function assert; use function in_array; use PHPUnit\Event\Code\TestMethod; -use PHPUnit\Event\TestData\NoDataSetFromDataProviderException; use PHPUnit\Framework\TestSize\Known; use PHPUnit\Framework\TestSize\TestSize; use PHPUnit\Metadata\Api\Groups; /** + * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit + * * @internal This class is not covered by the backward compatibility promise for PHPUnit */ final class PassedTests @@ -54,14 +55,11 @@ final class PassedTests $this->passedTestClasses[] = $className; } - /** - * @throws NoDataSetFromDataProviderException - */ public function testMethodPassed(TestMethod $test, mixed $returnValue): void { $size = (new Groups)->size( $test->className(), - $test->methodName() + $test->methodName(), ); $this->passedTestMethods[$test->className() . '::' . $test->methodName()] = [ @@ -74,12 +72,12 @@ final class PassedTests { $this->passedTestClasses = array_merge( $this->passedTestClasses, - $other->passedTestClasses + $other->passedTestClasses, ); $this->passedTestMethods = array_merge( $this->passedTestMethods, - $other->passedTestMethods + $other->passedTestMethods, ); } diff --git a/vendor/phpunit/phpunit/src/Runner/TestResult/Subscriber/BeforeTestClassMethodErroredSubscriber.php b/vendor/phpunit/phpunit/src/Runner/TestResult/Subscriber/BeforeTestClassMethodErroredSubscriber.php index cfa5e9d5..c9facc24 100644 --- a/vendor/phpunit/phpunit/src/Runner/TestResult/Subscriber/BeforeTestClassMethodErroredSubscriber.php +++ b/vendor/phpunit/phpunit/src/Runner/TestResult/Subscriber/BeforeTestClassMethodErroredSubscriber.php @@ -13,6 +13,8 @@ use PHPUnit\Event\Test\BeforeFirstTestMethodErrored; use PHPUnit\Event\Test\BeforeFirstTestMethodErroredSubscriber; /** + * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit + * * @internal This class is not covered by the backward compatibility promise for PHPUnit */ final class BeforeTestClassMethodErroredSubscriber extends Subscriber implements BeforeFirstTestMethodErroredSubscriber diff --git a/vendor/phpunit/phpunit/src/Runner/TestResult/Subscriber/ExecutionStartedSubscriber.php b/vendor/phpunit/phpunit/src/Runner/TestResult/Subscriber/ExecutionStartedSubscriber.php index 2d1c1a5f..56f16d76 100644 --- a/vendor/phpunit/phpunit/src/Runner/TestResult/Subscriber/ExecutionStartedSubscriber.php +++ b/vendor/phpunit/phpunit/src/Runner/TestResult/Subscriber/ExecutionStartedSubscriber.php @@ -13,6 +13,8 @@ use PHPUnit\Event\TestRunner\ExecutionStarted; use PHPUnit\Event\TestRunner\ExecutionStartedSubscriber as TestRunnerExecutionStartedSubscriber; /** + * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit + * * @internal This class is not covered by the backward compatibility promise for PHPUnit */ final class ExecutionStartedSubscriber extends Subscriber implements TestRunnerExecutionStartedSubscriber diff --git a/vendor/phpunit/phpunit/src/Runner/TestResult/Subscriber/Subscriber.php b/vendor/phpunit/phpunit/src/Runner/TestResult/Subscriber/Subscriber.php index 7bb28d20..f9abbb77 100644 --- a/vendor/phpunit/phpunit/src/Runner/TestResult/Subscriber/Subscriber.php +++ b/vendor/phpunit/phpunit/src/Runner/TestResult/Subscriber/Subscriber.php @@ -10,6 +10,8 @@ namespace PHPUnit\TestRunner\TestResult; /** + * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit + * * @internal This class is not covered by the backward compatibility promise for PHPUnit */ abstract class Subscriber diff --git a/vendor/phpunit/phpunit/src/Runner/TestResult/Subscriber/TestConsideredRiskySubscriber.php b/vendor/phpunit/phpunit/src/Runner/TestResult/Subscriber/TestConsideredRiskySubscriber.php index 777ca47a..b3656e43 100644 --- a/vendor/phpunit/phpunit/src/Runner/TestResult/Subscriber/TestConsideredRiskySubscriber.php +++ b/vendor/phpunit/phpunit/src/Runner/TestResult/Subscriber/TestConsideredRiskySubscriber.php @@ -13,6 +13,8 @@ use PHPUnit\Event\Test\ConsideredRisky; use PHPUnit\Event\Test\ConsideredRiskySubscriber; /** + * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit + * * @internal This class is not covered by the backward compatibility promise for PHPUnit */ final class TestConsideredRiskySubscriber extends Subscriber implements ConsideredRiskySubscriber diff --git a/vendor/phpunit/phpunit/src/Runner/TestResult/Subscriber/TestErroredSubscriber.php b/vendor/phpunit/phpunit/src/Runner/TestResult/Subscriber/TestErroredSubscriber.php index 132482b7..272c9924 100644 --- a/vendor/phpunit/phpunit/src/Runner/TestResult/Subscriber/TestErroredSubscriber.php +++ b/vendor/phpunit/phpunit/src/Runner/TestResult/Subscriber/TestErroredSubscriber.php @@ -13,6 +13,8 @@ use PHPUnit\Event\Test\Errored; use PHPUnit\Event\Test\ErroredSubscriber; /** + * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit + * * @internal This class is not covered by the backward compatibility promise for PHPUnit */ final class TestErroredSubscriber extends Subscriber implements ErroredSubscriber diff --git a/vendor/phpunit/phpunit/src/Runner/TestResult/Subscriber/TestFailedSubscriber.php b/vendor/phpunit/phpunit/src/Runner/TestResult/Subscriber/TestFailedSubscriber.php index 7382b0bb..c0b059df 100644 --- a/vendor/phpunit/phpunit/src/Runner/TestResult/Subscriber/TestFailedSubscriber.php +++ b/vendor/phpunit/phpunit/src/Runner/TestResult/Subscriber/TestFailedSubscriber.php @@ -13,6 +13,8 @@ use PHPUnit\Event\Test\Failed; use PHPUnit\Event\Test\FailedSubscriber; /** + * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit + * * @internal This class is not covered by the backward compatibility promise for PHPUnit */ final class TestFailedSubscriber extends Subscriber implements FailedSubscriber diff --git a/vendor/phpunit/phpunit/src/Runner/TestResult/Subscriber/TestFinishedSubscriber.php b/vendor/phpunit/phpunit/src/Runner/TestResult/Subscriber/TestFinishedSubscriber.php index 44aea9f9..6ce115b4 100644 --- a/vendor/phpunit/phpunit/src/Runner/TestResult/Subscriber/TestFinishedSubscriber.php +++ b/vendor/phpunit/phpunit/src/Runner/TestResult/Subscriber/TestFinishedSubscriber.php @@ -13,6 +13,8 @@ use PHPUnit\Event\Test\Finished; use PHPUnit\Event\Test\FinishedSubscriber; /** + * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit + * * @internal This class is not covered by the backward compatibility promise for PHPUnit */ final class TestFinishedSubscriber extends Subscriber implements FinishedSubscriber diff --git a/vendor/phpunit/phpunit/src/Runner/TestResult/Subscriber/TestMarkedIncompleteSubscriber.php b/vendor/phpunit/phpunit/src/Runner/TestResult/Subscriber/TestMarkedIncompleteSubscriber.php index 9c486c53..b57a0984 100644 --- a/vendor/phpunit/phpunit/src/Runner/TestResult/Subscriber/TestMarkedIncompleteSubscriber.php +++ b/vendor/phpunit/phpunit/src/Runner/TestResult/Subscriber/TestMarkedIncompleteSubscriber.php @@ -13,6 +13,8 @@ use PHPUnit\Event\Test\MarkedIncomplete; use PHPUnit\Event\Test\MarkedIncompleteSubscriber; /** + * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit + * * @internal This class is not covered by the backward compatibility promise for PHPUnit */ final class TestMarkedIncompleteSubscriber extends Subscriber implements MarkedIncompleteSubscriber diff --git a/vendor/phpunit/phpunit/src/Runner/TestResult/Subscriber/TestPreparedSubscriber.php b/vendor/phpunit/phpunit/src/Runner/TestResult/Subscriber/TestPreparedSubscriber.php index cc91590d..b68c0d5e 100644 --- a/vendor/phpunit/phpunit/src/Runner/TestResult/Subscriber/TestPreparedSubscriber.php +++ b/vendor/phpunit/phpunit/src/Runner/TestResult/Subscriber/TestPreparedSubscriber.php @@ -13,6 +13,8 @@ use PHPUnit\Event\Test\Prepared; use PHPUnit\Event\Test\PreparedSubscriber; /** + * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit + * * @internal This class is not covered by the backward compatibility promise for PHPUnit */ final class TestPreparedSubscriber extends Subscriber implements PreparedSubscriber diff --git a/vendor/phpunit/phpunit/src/Runner/TestResult/Subscriber/TestRunnerTriggeredDeprecationSubscriber.php b/vendor/phpunit/phpunit/src/Runner/TestResult/Subscriber/TestRunnerTriggeredDeprecationSubscriber.php index 4dce071c..0550adae 100644 --- a/vendor/phpunit/phpunit/src/Runner/TestResult/Subscriber/TestRunnerTriggeredDeprecationSubscriber.php +++ b/vendor/phpunit/phpunit/src/Runner/TestResult/Subscriber/TestRunnerTriggeredDeprecationSubscriber.php @@ -13,6 +13,8 @@ use PHPUnit\Event\TestRunner\DeprecationTriggered; use PHPUnit\Event\TestRunner\DeprecationTriggeredSubscriber; /** + * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit + * * @internal This class is not covered by the backward compatibility promise for PHPUnit */ final class TestRunnerTriggeredDeprecationSubscriber extends Subscriber implements DeprecationTriggeredSubscriber diff --git a/vendor/phpunit/phpunit/src/Runner/TestResult/Subscriber/TestRunnerTriggeredWarningSubscriber.php b/vendor/phpunit/phpunit/src/Runner/TestResult/Subscriber/TestRunnerTriggeredWarningSubscriber.php index ddc2564d..b66e7494 100644 --- a/vendor/phpunit/phpunit/src/Runner/TestResult/Subscriber/TestRunnerTriggeredWarningSubscriber.php +++ b/vendor/phpunit/phpunit/src/Runner/TestResult/Subscriber/TestRunnerTriggeredWarningSubscriber.php @@ -13,6 +13,8 @@ use PHPUnit\Event\TestRunner\WarningTriggered; use PHPUnit\Event\TestRunner\WarningTriggeredSubscriber; /** + * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit + * * @internal This class is not covered by the backward compatibility promise for PHPUnit */ final class TestRunnerTriggeredWarningSubscriber extends Subscriber implements WarningTriggeredSubscriber diff --git a/vendor/phpunit/phpunit/src/Runner/TestResult/Subscriber/TestSkippedSubscriber.php b/vendor/phpunit/phpunit/src/Runner/TestResult/Subscriber/TestSkippedSubscriber.php index 651e12f5..4cc44545 100644 --- a/vendor/phpunit/phpunit/src/Runner/TestResult/Subscriber/TestSkippedSubscriber.php +++ b/vendor/phpunit/phpunit/src/Runner/TestResult/Subscriber/TestSkippedSubscriber.php @@ -13,6 +13,8 @@ use PHPUnit\Event\Test\Skipped; use PHPUnit\Event\Test\SkippedSubscriber; /** + * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit + * * @internal This class is not covered by the backward compatibility promise for PHPUnit */ final class TestSkippedSubscriber extends Subscriber implements SkippedSubscriber diff --git a/vendor/phpunit/phpunit/src/Runner/TestResult/Subscriber/TestSuiteFinishedSubscriber.php b/vendor/phpunit/phpunit/src/Runner/TestResult/Subscriber/TestSuiteFinishedSubscriber.php index 5ad8c1a7..125cd519 100644 --- a/vendor/phpunit/phpunit/src/Runner/TestResult/Subscriber/TestSuiteFinishedSubscriber.php +++ b/vendor/phpunit/phpunit/src/Runner/TestResult/Subscriber/TestSuiteFinishedSubscriber.php @@ -9,18 +9,16 @@ */ namespace PHPUnit\TestRunner\TestResult; -use PHPUnit\Event\TestData\NoDataSetFromDataProviderException; use PHPUnit\Event\TestSuite\Finished; use PHPUnit\Event\TestSuite\FinishedSubscriber; /** + * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit + * * @internal This class is not covered by the backward compatibility promise for PHPUnit */ final class TestSuiteFinishedSubscriber extends Subscriber implements FinishedSubscriber { - /** - * @throws NoDataSetFromDataProviderException - */ public function notify(Finished $event): void { $this->collector()->testSuiteFinished($event); diff --git a/vendor/phpunit/phpunit/src/Runner/TestResult/Subscriber/TestSuiteSkippedSubscriber.php b/vendor/phpunit/phpunit/src/Runner/TestResult/Subscriber/TestSuiteSkippedSubscriber.php index a16ae17e..bf26b15c 100644 --- a/vendor/phpunit/phpunit/src/Runner/TestResult/Subscriber/TestSuiteSkippedSubscriber.php +++ b/vendor/phpunit/phpunit/src/Runner/TestResult/Subscriber/TestSuiteSkippedSubscriber.php @@ -13,6 +13,8 @@ use PHPUnit\Event\TestSuite\Skipped; use PHPUnit\Event\TestSuite\SkippedSubscriber; /** + * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit + * * @internal This class is not covered by the backward compatibility promise for PHPUnit */ final class TestSuiteSkippedSubscriber extends Subscriber implements SkippedSubscriber diff --git a/vendor/phpunit/phpunit/src/Runner/TestResult/Subscriber/TestSuiteStartedSubscriber.php b/vendor/phpunit/phpunit/src/Runner/TestResult/Subscriber/TestSuiteStartedSubscriber.php index d50b1232..ef8c8d09 100644 --- a/vendor/phpunit/phpunit/src/Runner/TestResult/Subscriber/TestSuiteStartedSubscriber.php +++ b/vendor/phpunit/phpunit/src/Runner/TestResult/Subscriber/TestSuiteStartedSubscriber.php @@ -13,6 +13,8 @@ use PHPUnit\Event\TestSuite\Started; use PHPUnit\Event\TestSuite\StartedSubscriber; /** + * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit + * * @internal This class is not covered by the backward compatibility promise for PHPUnit */ final class TestSuiteStartedSubscriber extends Subscriber implements StartedSubscriber diff --git a/vendor/phpunit/phpunit/src/Runner/TestResult/Subscriber/TestTriggeredDeprecationSubscriber.php b/vendor/phpunit/phpunit/src/Runner/TestResult/Subscriber/TestTriggeredDeprecationSubscriber.php index 7692bae3..6185723e 100644 --- a/vendor/phpunit/phpunit/src/Runner/TestResult/Subscriber/TestTriggeredDeprecationSubscriber.php +++ b/vendor/phpunit/phpunit/src/Runner/TestResult/Subscriber/TestTriggeredDeprecationSubscriber.php @@ -13,6 +13,8 @@ use PHPUnit\Event\Test\DeprecationTriggered; use PHPUnit\Event\Test\DeprecationTriggeredSubscriber; /** + * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit + * * @internal This class is not covered by the backward compatibility promise for PHPUnit */ final class TestTriggeredDeprecationSubscriber extends Subscriber implements DeprecationTriggeredSubscriber diff --git a/vendor/phpunit/phpunit/src/Runner/TestResult/Subscriber/TestTriggeredErrorSubscriber.php b/vendor/phpunit/phpunit/src/Runner/TestResult/Subscriber/TestTriggeredErrorSubscriber.php index fc48c2d4..c5daf0d7 100644 --- a/vendor/phpunit/phpunit/src/Runner/TestResult/Subscriber/TestTriggeredErrorSubscriber.php +++ b/vendor/phpunit/phpunit/src/Runner/TestResult/Subscriber/TestTriggeredErrorSubscriber.php @@ -13,6 +13,8 @@ use PHPUnit\Event\Test\ErrorTriggered; use PHPUnit\Event\Test\ErrorTriggeredSubscriber; /** + * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit + * * @internal This class is not covered by the backward compatibility promise for PHPUnit */ final class TestTriggeredErrorSubscriber extends Subscriber implements ErrorTriggeredSubscriber diff --git a/vendor/phpunit/phpunit/src/Runner/TestResult/Subscriber/TestTriggeredNoticeSubscriber.php b/vendor/phpunit/phpunit/src/Runner/TestResult/Subscriber/TestTriggeredNoticeSubscriber.php index dbedc8bd..e0c4b55a 100644 --- a/vendor/phpunit/phpunit/src/Runner/TestResult/Subscriber/TestTriggeredNoticeSubscriber.php +++ b/vendor/phpunit/phpunit/src/Runner/TestResult/Subscriber/TestTriggeredNoticeSubscriber.php @@ -13,6 +13,8 @@ use PHPUnit\Event\Test\NoticeTriggered; use PHPUnit\Event\Test\NoticeTriggeredSubscriber; /** + * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit + * * @internal This class is not covered by the backward compatibility promise for PHPUnit */ final class TestTriggeredNoticeSubscriber extends Subscriber implements NoticeTriggeredSubscriber diff --git a/vendor/phpunit/phpunit/src/Runner/TestResult/Subscriber/TestTriggeredPhpDeprecationSubscriber.php b/vendor/phpunit/phpunit/src/Runner/TestResult/Subscriber/TestTriggeredPhpDeprecationSubscriber.php index a1bbc804..b0ddcba0 100644 --- a/vendor/phpunit/phpunit/src/Runner/TestResult/Subscriber/TestTriggeredPhpDeprecationSubscriber.php +++ b/vendor/phpunit/phpunit/src/Runner/TestResult/Subscriber/TestTriggeredPhpDeprecationSubscriber.php @@ -13,6 +13,8 @@ use PHPUnit\Event\Test\PhpDeprecationTriggered; use PHPUnit\Event\Test\PhpDeprecationTriggeredSubscriber; /** + * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit + * * @internal This class is not covered by the backward compatibility promise for PHPUnit */ final class TestTriggeredPhpDeprecationSubscriber extends Subscriber implements PhpDeprecationTriggeredSubscriber diff --git a/vendor/phpunit/phpunit/src/Runner/TestResult/Subscriber/TestTriggeredPhpNoticeSubscriber.php b/vendor/phpunit/phpunit/src/Runner/TestResult/Subscriber/TestTriggeredPhpNoticeSubscriber.php index 16f442c8..3f6e54c3 100644 --- a/vendor/phpunit/phpunit/src/Runner/TestResult/Subscriber/TestTriggeredPhpNoticeSubscriber.php +++ b/vendor/phpunit/phpunit/src/Runner/TestResult/Subscriber/TestTriggeredPhpNoticeSubscriber.php @@ -13,6 +13,8 @@ use PHPUnit\Event\Test\PhpNoticeTriggered; use PHPUnit\Event\Test\PhpNoticeTriggeredSubscriber; /** + * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit + * * @internal This class is not covered by the backward compatibility promise for PHPUnit */ final class TestTriggeredPhpNoticeSubscriber extends Subscriber implements PhpNoticeTriggeredSubscriber diff --git a/vendor/phpunit/phpunit/src/Runner/TestResult/Subscriber/TestTriggeredPhpWarningSubscriber.php b/vendor/phpunit/phpunit/src/Runner/TestResult/Subscriber/TestTriggeredPhpWarningSubscriber.php index 9ff15316..c8af2899 100644 --- a/vendor/phpunit/phpunit/src/Runner/TestResult/Subscriber/TestTriggeredPhpWarningSubscriber.php +++ b/vendor/phpunit/phpunit/src/Runner/TestResult/Subscriber/TestTriggeredPhpWarningSubscriber.php @@ -13,6 +13,8 @@ use PHPUnit\Event\Test\PhpWarningTriggered; use PHPUnit\Event\Test\PhpWarningTriggeredSubscriber; /** + * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit + * * @internal This class is not covered by the backward compatibility promise for PHPUnit */ final class TestTriggeredPhpWarningSubscriber extends Subscriber implements PhpWarningTriggeredSubscriber diff --git a/vendor/phpunit/phpunit/src/Runner/TestResult/Subscriber/TestTriggeredPhpunitDeprecationSubscriber.php b/vendor/phpunit/phpunit/src/Runner/TestResult/Subscriber/TestTriggeredPhpunitDeprecationSubscriber.php index bb3ce03c..704895be 100644 --- a/vendor/phpunit/phpunit/src/Runner/TestResult/Subscriber/TestTriggeredPhpunitDeprecationSubscriber.php +++ b/vendor/phpunit/phpunit/src/Runner/TestResult/Subscriber/TestTriggeredPhpunitDeprecationSubscriber.php @@ -13,6 +13,8 @@ use PHPUnit\Event\Test\PhpunitDeprecationTriggered; use PHPUnit\Event\Test\PhpunitDeprecationTriggeredSubscriber; /** + * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit + * * @internal This class is not covered by the backward compatibility promise for PHPUnit */ final class TestTriggeredPhpunitDeprecationSubscriber extends Subscriber implements PhpunitDeprecationTriggeredSubscriber diff --git a/vendor/phpunit/phpunit/src/Runner/TestResult/Subscriber/TestTriggeredPhpunitErrorSubscriber.php b/vendor/phpunit/phpunit/src/Runner/TestResult/Subscriber/TestTriggeredPhpunitErrorSubscriber.php index e61bf0b4..0fcb0176 100644 --- a/vendor/phpunit/phpunit/src/Runner/TestResult/Subscriber/TestTriggeredPhpunitErrorSubscriber.php +++ b/vendor/phpunit/phpunit/src/Runner/TestResult/Subscriber/TestTriggeredPhpunitErrorSubscriber.php @@ -13,6 +13,8 @@ use PHPUnit\Event\Test\PhpunitErrorTriggered; use PHPUnit\Event\Test\PhpunitErrorTriggeredSubscriber; /** + * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit + * * @internal This class is not covered by the backward compatibility promise for PHPUnit */ final class TestTriggeredPhpunitErrorSubscriber extends Subscriber implements PhpunitErrorTriggeredSubscriber diff --git a/vendor/phpunit/phpunit/src/Runner/TestResult/Subscriber/TestTriggeredPhpunitWarningSubscriber.php b/vendor/phpunit/phpunit/src/Runner/TestResult/Subscriber/TestTriggeredPhpunitWarningSubscriber.php index 89f24886..6c6c49ad 100644 --- a/vendor/phpunit/phpunit/src/Runner/TestResult/Subscriber/TestTriggeredPhpunitWarningSubscriber.php +++ b/vendor/phpunit/phpunit/src/Runner/TestResult/Subscriber/TestTriggeredPhpunitWarningSubscriber.php @@ -13,6 +13,8 @@ use PHPUnit\Event\Test\PhpunitWarningTriggered; use PHPUnit\Event\Test\PhpunitWarningTriggeredSubscriber; /** + * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit + * * @internal This class is not covered by the backward compatibility promise for PHPUnit */ final class TestTriggeredPhpunitWarningSubscriber extends Subscriber implements PhpunitWarningTriggeredSubscriber diff --git a/vendor/phpunit/phpunit/src/Runner/TestResult/Subscriber/TestTriggeredWarningSubscriber.php b/vendor/phpunit/phpunit/src/Runner/TestResult/Subscriber/TestTriggeredWarningSubscriber.php index ac34bb27..a68d1e23 100644 --- a/vendor/phpunit/phpunit/src/Runner/TestResult/Subscriber/TestTriggeredWarningSubscriber.php +++ b/vendor/phpunit/phpunit/src/Runner/TestResult/Subscriber/TestTriggeredWarningSubscriber.php @@ -13,6 +13,8 @@ use PHPUnit\Event\Test\WarningTriggered; use PHPUnit\Event\Test\WarningTriggeredSubscriber; /** + * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit + * * @internal This class is not covered by the backward compatibility promise for PHPUnit */ final class TestTriggeredWarningSubscriber extends Subscriber implements WarningTriggeredSubscriber diff --git a/vendor/phpunit/phpunit/src/Runner/TestResult/TestResult.php b/vendor/phpunit/phpunit/src/Runner/TestResult/TestResult.php index af1fa614..52bf78e1 100644 --- a/vendor/phpunit/phpunit/src/Runner/TestResult/TestResult.php +++ b/vendor/phpunit/phpunit/src/Runner/TestResult/TestResult.php @@ -10,27 +10,24 @@ namespace PHPUnit\TestRunner\TestResult; use function count; +use PHPUnit\Event\Test\AfterLastTestMethodErrored; use PHPUnit\Event\Test\BeforeFirstTestMethodErrored; use PHPUnit\Event\Test\ConsideredRisky; -use PHPUnit\Event\Test\DeprecationTriggered; use PHPUnit\Event\Test\Errored; -use PHPUnit\Event\Test\ErrorTriggered; use PHPUnit\Event\Test\Failed; use PHPUnit\Event\Test\MarkedIncomplete; -use PHPUnit\Event\Test\NoticeTriggered; -use PHPUnit\Event\Test\PhpDeprecationTriggered; -use PHPUnit\Event\Test\PhpNoticeTriggered; use PHPUnit\Event\Test\PhpunitDeprecationTriggered; use PHPUnit\Event\Test\PhpunitErrorTriggered; use PHPUnit\Event\Test\PhpunitWarningTriggered; -use PHPUnit\Event\Test\PhpWarningTriggered; use PHPUnit\Event\Test\Skipped as TestSkipped; -use PHPUnit\Event\Test\WarningTriggered; use PHPUnit\Event\TestRunner\DeprecationTriggered as TestRunnerDeprecationTriggered; use PHPUnit\Event\TestRunner\WarningTriggered as TestRunnerWarningTriggered; use PHPUnit\Event\TestSuite\Skipped as TestSuiteSkipped; +use PHPUnit\TestRunner\TestResult\Issues\Issue; /** + * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit + * * @internal This class is not covered by the backward compatibility promise for PHPUnit */ final class TestResult @@ -40,7 +37,7 @@ final class TestResult private readonly int $numberOfAssertions; /** - * @psalm-var list + * @psalm-var list */ private readonly array $testErroredEvents; @@ -69,46 +66,11 @@ final class TestResult */ private readonly array $testConsideredRiskyEvents; - /** - * @psalm-var array> - */ - private readonly array $testTriggeredDeprecationEvents; - - /** - * @psalm-var array> - */ - private readonly array $testTriggeredPhpDeprecationEvents; - /** * @psalm-var array> */ private readonly array $testTriggeredPhpunitDeprecationEvents; - /** - * @psalm-var array> - */ - private readonly array $testTriggeredErrorEvents; - - /** - * @psalm-var array> - */ - private readonly array $testTriggeredNoticeEvents; - - /** - * @psalm-var array> - */ - private readonly array $testTriggeredPhpNoticeEvents; - - /** - * @psalm-var array> - */ - private readonly array $testTriggeredWarningEvents; - - /** - * @psalm-var array> - */ - private readonly array $testTriggeredPhpWarningEvents; - /** * @psalm-var array> */ @@ -130,26 +92,67 @@ final class TestResult private readonly array $testRunnerTriggeredWarningEvents; /** - * @psalm-param list $testErroredEvents + * @psalm-var list + */ + private readonly array $errors; + + /** + * @psalm-var list + */ + private readonly array $deprecations; + + /** + * @psalm-var list + */ + private readonly array $notices; + + /** + * @psalm-var list + */ + private readonly array $warnings; + + /** + * @psalm-var list + */ + private readonly array $phpDeprecations; + + /** + * @psalm-var list + */ + private readonly array $phpNotices; + + /** + * @psalm-var list + */ + private readonly array $phpWarnings; + + /** + * @psalm-var non-negative-int + */ + private readonly int $numberOfIssuesIgnoredByBaseline; + + /** + * @psalm-param list $testErroredEvents * @psalm-param list $testFailedEvents * @psalm-param array> $testConsideredRiskyEvents * @psalm-param list $testSuiteSkippedEvents * @psalm-param list $testSkippedEvents * @psalm-param list $testMarkedIncompleteEvents - * @psalm-param array> $testTriggeredDeprecationEvents - * @psalm-param array> $testTriggeredPhpDeprecationEvents * @psalm-param array> $testTriggeredPhpunitDeprecationEvents - * @psalm-param array> $testTriggeredErrorEvents - * @psalm-param array> $testTriggeredNoticeEvents - * @psalm-param array> $testTriggeredPhpNoticeEvents - * @psalm-param array> $testTriggeredWarningEvents - * @psalm-param array> $testTriggeredPhpWarningEvents * @psalm-param array> $testTriggeredPhpunitErrorEvents * @psalm-param array> $testTriggeredPhpunitWarningEvents * @psalm-param list $testRunnerTriggeredDeprecationEvents * @psalm-param list $testRunnerTriggeredWarningEvents + * @psalm-param list $errors + * @psalm-param list $deprecations + * @psalm-param list $notices + * @psalm-param list $warnings + * @psalm-param list $phpDeprecations + * @psalm-param list $phpNotices + * @psalm-param list $phpWarnings + * @psalm-param non-negative-int $numberOfIssuesIgnoredByBaseline */ - public function __construct(int $numberOfTests, int $numberOfTestsRun, int $numberOfAssertions, array $testErroredEvents, array $testFailedEvents, array $testConsideredRiskyEvents, array $testSuiteSkippedEvents, array $testSkippedEvents, array $testMarkedIncompleteEvents, array $testTriggeredDeprecationEvents, array $testTriggeredPhpDeprecationEvents, array $testTriggeredPhpunitDeprecationEvents, array $testTriggeredErrorEvents, array $testTriggeredNoticeEvents, array $testTriggeredPhpNoticeEvents, array $testTriggeredWarningEvents, array $testTriggeredPhpWarningEvents, array $testTriggeredPhpunitErrorEvents, array $testTriggeredPhpunitWarningEvents, array $testRunnerTriggeredDeprecationEvents, array $testRunnerTriggeredWarningEvents) + public function __construct(int $numberOfTests, int $numberOfTestsRun, int $numberOfAssertions, array $testErroredEvents, array $testFailedEvents, array $testConsideredRiskyEvents, array $testSuiteSkippedEvents, array $testSkippedEvents, array $testMarkedIncompleteEvents, array $testTriggeredPhpunitDeprecationEvents, array $testTriggeredPhpunitErrorEvents, array $testTriggeredPhpunitWarningEvents, array $testRunnerTriggeredDeprecationEvents, array $testRunnerTriggeredWarningEvents, array $errors, array $deprecations, array $notices, array $warnings, array $phpDeprecations, array $phpNotices, array $phpWarnings, int $numberOfIssuesIgnoredByBaseline) { $this->numberOfTests = $numberOfTests; $this->numberOfTestsRun = $numberOfTestsRun; @@ -160,23 +163,19 @@ final class TestResult $this->testSuiteSkippedEvents = $testSuiteSkippedEvents; $this->testSkippedEvents = $testSkippedEvents; $this->testMarkedIncompleteEvents = $testMarkedIncompleteEvents; - $this->testTriggeredDeprecationEvents = $testTriggeredDeprecationEvents; - $this->testTriggeredPhpDeprecationEvents = $testTriggeredPhpDeprecationEvents; $this->testTriggeredPhpunitDeprecationEvents = $testTriggeredPhpunitDeprecationEvents; - $this->testTriggeredErrorEvents = $testTriggeredErrorEvents; - $this->testTriggeredNoticeEvents = $testTriggeredNoticeEvents; - $this->testTriggeredPhpNoticeEvents = $testTriggeredPhpNoticeEvents; - $this->testTriggeredWarningEvents = $testTriggeredWarningEvents; - $this->testTriggeredPhpWarningEvents = $testTriggeredPhpWarningEvents; $this->testTriggeredPhpunitErrorEvents = $testTriggeredPhpunitErrorEvents; $this->testTriggeredPhpunitWarningEvents = $testTriggeredPhpunitWarningEvents; $this->testRunnerTriggeredDeprecationEvents = $testRunnerTriggeredDeprecationEvents; $this->testRunnerTriggeredWarningEvents = $testRunnerTriggeredWarningEvents; - } - - public function numberOfTests(): int - { - return $this->numberOfTests; + $this->errors = $errors; + $this->deprecations = $deprecations; + $this->notices = $notices; + $this->warnings = $warnings; + $this->phpDeprecations = $phpDeprecations; + $this->phpNotices = $phpNotices; + $this->phpWarnings = $phpWarnings; + $this->numberOfIssuesIgnoredByBaseline = $numberOfIssuesIgnoredByBaseline; } public function numberOfTestsRun(): int @@ -190,7 +189,7 @@ final class TestResult } /** - * @psalm-return list + * @psalm-return list */ public function testErroredEvents(): array { @@ -297,42 +296,6 @@ final class TestResult return $this->numberOfTestMarkedIncompleteEvents() > 0; } - /** - * @psalm-return array> - */ - public function testTriggeredDeprecationEvents(): array - { - return $this->testTriggeredDeprecationEvents; - } - - public function numberOfTestsWithTestTriggeredDeprecationEvents(): int - { - return count($this->testTriggeredDeprecationEvents); - } - - public function hasTestTriggeredDeprecationEvents(): bool - { - return $this->numberOfTestsWithTestTriggeredDeprecationEvents() > 0; - } - - /** - * @psalm-return array> - */ - public function testTriggeredPhpDeprecationEvents(): array - { - return $this->testTriggeredPhpDeprecationEvents; - } - - public function numberOfTestsWithTestTriggeredPhpDeprecationEvents(): int - { - return count($this->testTriggeredPhpDeprecationEvents); - } - - public function hasTestTriggeredPhpDeprecationEvents(): bool - { - return $this->numberOfTestsWithTestTriggeredPhpDeprecationEvents() > 0; - } - /** * @psalm-return array> */ @@ -351,96 +314,6 @@ final class TestResult return $this->numberOfTestsWithTestTriggeredPhpunitDeprecationEvents() > 0; } - /** - * @psalm-return array> - */ - public function testTriggeredErrorEvents(): array - { - return $this->testTriggeredErrorEvents; - } - - public function numberOfTestsWithTestTriggeredErrorEvents(): int - { - return count($this->testTriggeredErrorEvents); - } - - public function hasTestTriggeredErrorEvents(): bool - { - return $this->numberOfTestsWithTestTriggeredErrorEvents() > 0; - } - - /** - * @psalm-return array> - */ - public function testTriggeredNoticeEvents(): array - { - return $this->testTriggeredNoticeEvents; - } - - public function numberOfTestsWithTestTriggeredNoticeEvents(): int - { - return count($this->testTriggeredNoticeEvents); - } - - public function hasTestTriggeredNoticeEvents(): bool - { - return $this->numberOfTestsWithTestTriggeredNoticeEvents() > 0; - } - - /** - * @psalm-return array> - */ - public function testTriggeredPhpNoticeEvents(): array - { - return $this->testTriggeredPhpNoticeEvents; - } - - public function numberOfTestsWithTestTriggeredPhpNoticeEvents(): int - { - return count($this->testTriggeredPhpNoticeEvents); - } - - public function hasTestTriggeredPhpNoticeEvents(): bool - { - return $this->numberOfTestsWithTestTriggeredPhpNoticeEvents() > 0; - } - - /** - * @psalm-return array> - */ - public function testTriggeredWarningEvents(): array - { - return $this->testTriggeredWarningEvents; - } - - public function numberOfTestsWithTestTriggeredWarningEvents(): int - { - return count($this->testTriggeredWarningEvents); - } - - public function hasTestTriggeredWarningEvents(): bool - { - return $this->numberOfTestsWithTestTriggeredWarningEvents() > 0; - } - - /** - * @psalm-return array> - */ - public function testTriggeredPhpWarningEvents(): array - { - return $this->testTriggeredPhpWarningEvents; - } - - public function numberOfTestsWithTestTriggeredPhpWarningEvents(): int - { - return count($this->testTriggeredPhpWarningEvents); - } - - public function hasTestTriggeredPhpWarningEvents(): bool - { - return $this->numberOfTestsWithTestTriggeredPhpWarningEvents() > 0; - } - /** * @psalm-return array> */ @@ -513,54 +386,11 @@ final class TestResult return $this->numberOfTestRunnerTriggeredWarningEvents() > 0; } - public function hasDeprecationEvents(): bool - { - return $this->numberOfDeprecationEvents() > 0; - } - - public function numberOfDeprecationEvents(): int - { - return $this->numberOfTestsWithTestTriggeredDeprecationEvents() + - $this->numberOfTestsWithTestTriggeredPhpDeprecationEvents() + - $this->numberOfTestRunnerTriggeredDeprecationEvents() + - $this->numberOfTestsWithTestTriggeredPhpunitDeprecationEvents(); - } - - public function hasNoticeEvents(): bool - { - return $this->numberOfNoticeEvents() > 0; - } - - public function numberOfNoticeEvents(): int - { - return $this->numberOfTestsWithTestTriggeredNoticeEvents() + - $this->numberOfTestsWithTestTriggeredPhpNoticeEvents(); - } - - public function hasWarningEvents(): bool - { - return $this->numberOfWarningEvents() > 0; - } - - public function numberOfWarningEvents(): int - { - return $this->numberOfTestsWithTestTriggeredWarningEvents() + - $this->numberOfTestsWithTestTriggeredPhpWarningEvents() + - $this->numberOfTestsWithTestTriggeredPhpunitWarningEvents() + - $this->numberOfTestRunnerTriggeredWarningEvents(); - } - public function wasSuccessful(): bool - { - return $this->wasSuccessfulIgnoringPhpunitWarnings() && - !$this->hasTestRunnerTriggeredWarningEvents() && - !$this->hasTestTriggeredPhpunitWarningEvents(); - } - - public function wasSuccessfulIgnoringPhpunitWarnings(): bool { return !$this->hasTestErroredEvents() && - !$this->hasTestFailedEvents(); + !$this->hasTestFailedEvents() && + !$this->hasTestTriggeredPhpunitErrorEvents(); } public function wasSuccessfulAndNoTestHasIssues(): bool @@ -568,13 +398,189 @@ final class TestResult return $this->wasSuccessful() && !$this->hasTestsWithIssues(); } + public function hasIssues(): bool + { + return $this->hasTestsWithIssues() || + $this->hasTestRunnerTriggeredWarningEvents(); + } + public function hasTestsWithIssues(): bool { - return $this->hasTestConsideredRiskyEvents() || - $this->hasTestMarkedIncompleteEvents() || - $this->hasDeprecationEvents() || - $this->hasTestTriggeredErrorEvents() || - $this->hasNoticeEvents() || - $this->hasWarningEvents(); + return $this->hasRiskyTests() || + $this->hasIncompleteTests() || + $this->hasDeprecations() || + !empty($this->errors) || + $this->hasNotices() || + $this->hasWarnings() || + $this->hasPhpunitWarnings(); + } + + /** + * @psalm-return list + */ + public function errors(): array + { + return $this->errors; + } + + /** + * @psalm-return list + */ + public function deprecations(): array + { + return $this->deprecations; + } + + /** + * @psalm-return list + */ + public function notices(): array + { + return $this->notices; + } + + /** + * @psalm-return list + */ + public function warnings(): array + { + return $this->warnings; + } + + /** + * @psalm-return list + */ + public function phpDeprecations(): array + { + return $this->phpDeprecations; + } + + /** + * @psalm-return list + */ + public function phpNotices(): array + { + return $this->phpNotices; + } + + /** + * @psalm-return list + */ + public function phpWarnings(): array + { + return $this->phpWarnings; + } + + public function hasTests(): bool + { + return $this->numberOfTests > 0; + } + + public function hasErrors(): bool + { + return $this->numberOfErrors() > 0; + } + + public function numberOfErrors(): int + { + return $this->numberOfTestErroredEvents() + + count($this->errors) + + $this->numberOfTestsWithTestTriggeredPhpunitErrorEvents(); + } + + public function hasDeprecations(): bool + { + return $this->numberOfDeprecations() > 0; + } + + public function hasPhpOrUserDeprecations(): bool + { + return $this->numberOfPhpOrUserDeprecations() > 0; + } + + public function numberOfPhpOrUserDeprecations(): int + { + return count($this->deprecations) + + count($this->phpDeprecations); + } + + public function hasPhpunitDeprecations(): bool + { + return $this->numberOfPhpunitDeprecations() > 0; + } + + public function numberOfPhpunitDeprecations(): int + { + return count($this->testTriggeredPhpunitDeprecationEvents) + + count($this->testRunnerTriggeredDeprecationEvents); + } + + public function hasPhpunitWarnings(): bool + { + return $this->numberOfPhpunitWarnings() > 0; + } + + public function numberOfPhpunitWarnings(): int + { + return count($this->testTriggeredPhpunitWarningEvents) + + count($this->testRunnerTriggeredWarningEvents); + } + + public function numberOfDeprecations(): int + { + return count($this->deprecations) + + count($this->phpDeprecations) + + count($this->testTriggeredPhpunitDeprecationEvents) + + count($this->testRunnerTriggeredDeprecationEvents); + } + + public function hasNotices(): bool + { + return $this->numberOfNotices() > 0; + } + + public function numberOfNotices(): int + { + return count($this->notices) + + count($this->phpNotices); + } + + public function hasWarnings(): bool + { + return $this->numberOfWarnings() > 0; + } + + public function numberOfWarnings(): int + { + return count($this->warnings) + + count($this->phpWarnings); + } + + public function hasIncompleteTests(): bool + { + return !empty($this->testMarkedIncompleteEvents); + } + + public function hasRiskyTests(): bool + { + return !empty($this->testConsideredRiskyEvents); + } + + public function hasSkippedTests(): bool + { + return !empty($this->testSkippedEvents); + } + + public function hasIssuesIgnoredByBaseline(): bool + { + return $this->numberOfIssuesIgnoredByBaseline > 0; + } + + /** + * @psalm-return non-negative-int + */ + public function numberOfIssuesIgnoredByBaseline(): int + { + return $this->numberOfIssuesIgnoredByBaseline; } } diff --git a/vendor/phpunit/phpunit/src/Runner/TestSuiteLoader.php b/vendor/phpunit/phpunit/src/Runner/TestSuiteLoader.php index 4121c1aa..e3b984cf 100644 --- a/vendor/phpunit/phpunit/src/Runner/TestSuiteLoader.php +++ b/vendor/phpunit/phpunit/src/Runner/TestSuiteLoader.php @@ -10,92 +10,78 @@ namespace PHPUnit\Runner; use function array_diff; -use function array_merge; use function array_values; use function basename; -use function class_exists; use function get_declared_classes; -use function stripos; -use function strlen; +use function realpath; +use function str_ends_with; use function strpos; +use function strtolower; use function substr; use PHPUnit\Framework\TestCase; use ReflectionClass; /** + * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit + * * @internal This class is not covered by the backward compatibility promise for PHPUnit */ final class TestSuiteLoader { - /** - * @psalm-var list - */ - private static array $loadedClasses = []; - /** * @psalm-var list */ private static array $declaredClasses = []; - public function __construct() - { - if (empty(self::$declaredClasses)) { - self::$declaredClasses = get_declared_classes(); - } - } + /** + * @psalm-var array> + */ + private static array $fileToClassesMap = []; /** * @throws Exception */ public function load(string $suiteClassFile): ReflectionClass { + $suiteClassFile = realpath($suiteClassFile); $suiteClassName = $this->classNameFromFileName($suiteClassFile); + $loadedClasses = $this->loadSuiteClassFile($suiteClassFile); - if (!class_exists($suiteClassName, false)) { - include_once $suiteClassFile; + foreach ($loadedClasses as $className) { + /** @noinspection PhpUnhandledExceptionInspection */ + $class = new ReflectionClass($className); - $loadedClasses = array_values( - array_diff( - get_declared_classes(), - array_merge( - self::$declaredClasses, - self::$loadedClasses - ) - ) - ); - - self::$loadedClasses = array_merge($loadedClasses, self::$loadedClasses); - - if (empty(self::$loadedClasses)) { - throw new ClassCannotBeFoundException($suiteClassName, $suiteClassFile); - } - } - - if (!class_exists($suiteClassName, false)) { - $offset = 0 - strlen($suiteClassName); - - foreach (self::$loadedClasses as $loadedClass) { - if (stripos(substr($loadedClass, $offset - 1), '\\' . $suiteClassName) === 0 || - stripos(substr($loadedClass, $offset - 1), '_' . $suiteClassName) === 0) { - $suiteClassName = $loadedClass; - - break; - } - } - } - - if (!class_exists($suiteClassName, false)) { - throw new ClassCannotBeFoundException($suiteClassName, $suiteClassFile); - } - - $class = new ReflectionClass($suiteClassName); - - if ($class->isSubclassOf(TestCase::class)) { - if ($class->isAbstract()) { - throw new ClassIsAbstractException($suiteClassName, $suiteClassFile); + if ($class->isAnonymous()) { + continue; } - return $class; + if ($class->getFileName() !== $suiteClassFile) { + continue; + } + + if (!$class->isSubclassOf(TestCase::class)) { + continue; + } + + if (!str_ends_with(strtolower($class->getShortName()), strtolower($suiteClassName))) { + continue; + } + + if (!$class->isAbstract()) { + return $class; + } + + $e = new ClassIsAbstractException($class->getName(), $suiteClassFile); + } + + if (isset($e)) { + throw $e; + } + + foreach ($loadedClasses as $className) { + if (str_ends_with(strtolower($className), strtolower($suiteClassName))) { + throw new ClassDoesNotExtendTestCaseException($className, $suiteClassFile); + } } throw new ClassCannotBeFoundException($suiteClassName, $suiteClassFile); @@ -112,4 +98,46 @@ final class TestSuiteLoader return $className; } + + /** + * @psalm-return list + */ + private function loadSuiteClassFile(string $suiteClassFile): array + { + if (isset(self::$fileToClassesMap[$suiteClassFile])) { + return self::$fileToClassesMap[$suiteClassFile]; + } + + if (empty(self::$declaredClasses)) { + self::$declaredClasses = get_declared_classes(); + } + + require_once $suiteClassFile; + + $loadedClasses = array_values( + array_diff( + get_declared_classes(), + self::$declaredClasses, + ), + ); + + foreach ($loadedClasses as $loadedClass) { + /** @noinspection PhpUnhandledExceptionInspection */ + $class = new ReflectionClass($loadedClass); + + if (!isset(self::$fileToClassesMap[$class->getFileName()])) { + self::$fileToClassesMap[$class->getFileName()] = []; + } + + self::$fileToClassesMap[$class->getFileName()][] = $class->getName(); + } + + self::$declaredClasses = get_declared_classes(); + + if (empty($loadedClasses)) { + return self::$declaredClasses; + } + + return $loadedClasses; + } } diff --git a/vendor/phpunit/phpunit/src/Runner/TestSuiteSorter.php b/vendor/phpunit/phpunit/src/Runner/TestSuiteSorter.php index 8df7ff27..b332c431 100644 --- a/vendor/phpunit/phpunit/src/Runner/TestSuiteSorter.php +++ b/vendor/phpunit/phpunit/src/Runner/TestSuiteSorter.php @@ -13,6 +13,7 @@ use function array_diff; use function array_merge; use function array_reverse; use function array_splice; +use function assert; use function count; use function in_array; use function max; @@ -27,6 +28,8 @@ use PHPUnit\Runner\ResultCache\NullResultCache; use PHPUnit\Runner\ResultCache\ResultCache; /** + * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit + * * @internal This class is not covered by the backward compatibility promise for PHPUnit */ final class TestSuiteSorter @@ -74,16 +77,6 @@ final class TestSuiteSorter private array $defectSortOrder = []; private readonly ResultCache $cache; - /** - * @psalm-var array A list of normalized names of tests before reordering - */ - private array $originalExecutionOrder = []; - - /** - * @psalm-var array A list of normalized names of tests affected by reordering - */ - private array $executionOrder = []; - public function __construct(?ResultCache $cache = null) { $this->cache = $cache ?? new NullResultCache; @@ -92,7 +85,7 @@ final class TestSuiteSorter /** * @throws Exception */ - public function reorderTestsInSuite(Test $suite, int $order, bool $resolveDependencies, int $orderDefects, bool $isRootTestSuite = true): void + public function reorderTestsInSuite(Test $suite, int $order, bool $resolveDependencies, int $orderDefects): void { $allowedOrders = [ self::ORDER_DEFAULT, @@ -103,7 +96,9 @@ final class TestSuiteSorter ]; if (!in_array($order, $allowedOrders, true)) { + // @codeCoverageIgnoreStart throw new InvalidOrderException; + // @codeCoverageIgnoreEnd } $allowedOrderDefects = [ @@ -112,16 +107,14 @@ final class TestSuiteSorter ]; if (!in_array($orderDefects, $allowedOrderDefects, true)) { + // @codeCoverageIgnoreStart throw new InvalidOrderException; - } - - if ($isRootTestSuite) { - $this->originalExecutionOrder = $this->calculateTestExecutionOrder($suite); + // @codeCoverageIgnoreEnd } if ($suite instanceof TestSuite) { foreach ($suite as $_suite) { - $this->reorderTestsInSuite($_suite, $order, $resolveDependencies, $orderDefects, false); + $this->reorderTestsInSuite($_suite, $order, $resolveDependencies, $orderDefects); } if ($orderDefects === self::ORDER_DEFECTS_FIRST) { @@ -130,20 +123,6 @@ final class TestSuiteSorter $this->sort($suite, $order, $resolveDependencies, $orderDefects); } - - if ($isRootTestSuite) { - $this->executionOrder = $this->calculateTestExecutionOrder($suite); - } - } - - public function getOriginalExecutionOrder(): array - { - return $this->originalExecutionOrder; - } - - public function getExecutionOrder(): array - { - return $this->executionOrder; } private function sort(TestSuite $suite, int $order, bool $resolveDependencies, int $orderDefects): void @@ -156,13 +135,13 @@ final class TestSuiteSorter $suite->setTests($this->reverse($suite->tests())); } elseif ($order === self::ORDER_RANDOMIZED) { $suite->setTests($this->randomize($suite->tests())); - } elseif ($order === self::ORDER_DURATION && $this->cache !== null) { + } elseif ($order === self::ORDER_DURATION) { $suite->setTests($this->sortByDuration($suite->tests())); } elseif ($order === self::ORDER_SIZE) { $suite->setTests($this->sortBySize($suite->tests())); } - if ($orderDefects === self::ORDER_DEFECTS_FIRST && $this->cache !== null) { + if ($orderDefects === self::ORDER_DEFECTS_FIRST) { $suite->setTests($this->sortDefectsFirst($suite->tests())); } @@ -178,9 +157,7 @@ final class TestSuiteSorter $max = 0; foreach ($suite->tests() as $test) { - if (!$test instanceof Reorderable) { - continue; - } + assert($test instanceof Reorderable); if (!isset($this->defectSortOrder[$test->sortId()])) { $this->defectSortOrder[$test->sortId()] = $this->cache->status($test->sortId())->asInt(); @@ -207,7 +184,7 @@ final class TestSuiteSorter { usort( $tests, - fn ($left, $right) => $this->cmpDefectPriorityAndTime($left, $right) + fn ($left, $right) => $this->cmpDefectPriorityAndTime($left, $right), ); return $tests; @@ -217,7 +194,7 @@ final class TestSuiteSorter { usort( $tests, - fn ($left, $right) => $this->cmpDuration($left, $right) + fn ($left, $right) => $this->cmpDuration($left, $right), ); return $tests; @@ -227,7 +204,7 @@ final class TestSuiteSorter { usort( $tests, - fn ($left, $right) => $this->cmpSize($left, $right) + fn ($left, $right) => $this->cmpSize($left, $right), ); return $tests; @@ -242,9 +219,8 @@ final class TestSuiteSorter */ private function cmpDefectPriorityAndTime(Test $a, Test $b): int { - if (!($a instanceof Reorderable && $b instanceof Reorderable)) { - return 0; - } + assert($a instanceof Reorderable); + assert($b instanceof Reorderable); $priorityA = $this->defectSortOrder[$a->sortId()] ?? 0; $priorityB = $this->defectSortOrder[$b->sortId()] ?? 0; @@ -267,9 +243,8 @@ final class TestSuiteSorter */ private function cmpDuration(Test $a, Test $b): int { - if (!($a instanceof Reorderable && $b instanceof Reorderable)) { - return 0; - } + assert($a instanceof Reorderable); + assert($b instanceof Reorderable); return $this->cache->time($a->sortId()) <=> $this->cache->time($b->sortId()); } @@ -322,21 +297,4 @@ final class TestSuiteSorter return array_merge($newTestOrder, $tests); } - - private function calculateTestExecutionOrder(Test $suite): array - { - $tests = []; - - if ($suite instanceof TestSuite) { - foreach ($suite->tests() as $test) { - if (!$test instanceof TestSuite && $test instanceof Reorderable) { - $tests[] = $test->sortId(); - } else { - $tests = array_merge($tests, $this->calculateTestExecutionOrder($test)); - } - } - } - - return $tests; - } } diff --git a/vendor/phpunit/phpunit/src/Runner/Version.php b/vendor/phpunit/phpunit/src/Runner/Version.php index 1e73e336..caaba8a5 100644 --- a/vendor/phpunit/phpunit/src/Runner/Version.php +++ b/vendor/phpunit/phpunit/src/Runner/Version.php @@ -34,7 +34,7 @@ final class Version } if (self::$version === '') { - self::$version = (new VersionId('10.0.16', dirname(__DIR__, 2)))->asString(); + self::$version = (new VersionId('10.5.64', dirname(__DIR__, 2)))->asString(); } return self::$version; @@ -51,6 +51,11 @@ final class Version return implode('.', array_slice(explode('.', $version), 0, 2)); } + public static function majorVersionNumber(): int + { + return (int) explode('.', self::series())[0]; + } + public static function getVersionString(): string { return 'PHPUnit ' . self::id() . ' by Sebastian Bergmann and contributors.'; diff --git a/vendor/phpunit/phpunit/src/TextUI/Application.php b/vendor/phpunit/phpunit/src/TextUI/Application.php index 9f7da699..5c9d2d20 100644 --- a/vendor/phpunit/phpunit/src/TextUI/Application.php +++ b/vendor/phpunit/phpunit/src/TextUI/Application.php @@ -10,6 +10,7 @@ namespace PHPUnit\TextUI; use const PHP_EOL; +use const PHP_VERSION; use function is_file; use function is_readable; use function printf; @@ -17,7 +18,9 @@ use function realpath; use function sprintf; use function trim; use function unlink; +use PHPUnit\Event\EventFacadeIsSealedException; use PHPUnit\Event\Facade as EventFacade; +use PHPUnit\Event\UnknownSubscriberTypeException; use PHPUnit\Framework\TestSuite; use PHPUnit\Logging\EventLogger; use PHPUnit\Logging\JUnit\JunitXmlLogger; @@ -25,10 +28,18 @@ use PHPUnit\Logging\TeamCity\TeamCityLogger; use PHPUnit\Logging\TestDox\HtmlRenderer as TestDoxHtmlRenderer; use PHPUnit\Logging\TestDox\PlainTextRenderer as TestDoxTextRenderer; use PHPUnit\Logging\TestDox\TestResultCollector as TestDoxResultCollector; +use PHPUnit\Metadata\Api\CodeCoverage as CodeCoverageMetadataApi; +use PHPUnit\Runner\Baseline\CannotLoadBaselineException; +use PHPUnit\Runner\Baseline\Generator as BaselineGenerator; +use PHPUnit\Runner\Baseline\Reader; +use PHPUnit\Runner\Baseline\Writer; use PHPUnit\Runner\CodeCoverage; +use PHPUnit\Runner\DirectoryDoesNotExistException; +use PHPUnit\Runner\ErrorHandler; use PHPUnit\Runner\Extension\ExtensionBootstrapper; use PHPUnit\Runner\Extension\Facade as ExtensionFacade; use PHPUnit\Runner\Extension\PharLoader; +use PHPUnit\Runner\GarbageCollection\GarbageCollectionHandler; use PHPUnit\Runner\ResultCache\DefaultResultCache; use PHPUnit\Runner\ResultCache\NullResultCache; use PHPUnit\Runner\ResultCache\ResultCache; @@ -41,6 +52,7 @@ use PHPUnit\TextUI\CliArguments\Configuration as CliConfiguration; use PHPUnit\TextUI\CliArguments\Exception as ArgumentsException; use PHPUnit\TextUI\CliArguments\XmlConfigurationFileFinder; use PHPUnit\TextUI\Command\AtLeastVersionCommand; +use PHPUnit\TextUI\Command\CheckPhpConfigurationCommand; use PHPUnit\TextUI\Command\GenerateConfigurationCommand; use PHPUnit\TextUI\Command\ListGroupsCommand; use PHPUnit\TextUI\Command\ListTestsAsTextCommand; @@ -63,10 +75,13 @@ use PHPUnit\TextUI\Output\Printer; use PHPUnit\TextUI\XmlConfiguration\Configuration as XmlConfiguration; use PHPUnit\TextUI\XmlConfiguration\DefaultConfiguration; use PHPUnit\TextUI\XmlConfiguration\Loader; +use PHPUnit\Util\Http\PhpDownloader; use SebastianBergmann\Timer\Timer; use Throwable; /** + * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit + * * @internal This class is not covered by the backward compatibility promise for PHPUnit */ final class Application @@ -85,7 +100,7 @@ final class Application $configuration = Registry::init( $cliConfiguration, - $xmlConfiguration + $xmlConfiguration, ); (new PhpHandler)->handle($configuration->php()); @@ -101,27 +116,66 @@ final class Application $this->executeCommandsThatRequireCliConfigurationAndTestSuite($cliConfiguration, $testSuite); $this->executeHelpCommandWhenThereIsNothingElseToDo($configuration, $testSuite); - $pharExtensions = null; + $pharExtensions = null; + $extensionRequiresCodeCoverageCollection = false; + $extensionReplacesOutput = false; + $extensionReplacesProgressOutput = false; + $extensionReplacesResultOutput = false; + $extensionRequiresExportOfObjects = false; if (!$configuration->noExtensions()) { if ($configuration->hasPharExtensionDirectory()) { $pharExtensions = (new PharLoader)->loadPharExtensionsInDirectory( - $configuration->pharExtensionDirectory() + $configuration->pharExtensionDirectory(), ); } - $this->bootstrapExtensions($configuration); + $bootstrappedExtensions = $this->bootstrapExtensions($configuration); + $extensionRequiresCodeCoverageCollection = $bootstrappedExtensions['requiresCodeCoverageCollection']; + $extensionReplacesOutput = $bootstrappedExtensions['replacesOutput']; + $extensionReplacesProgressOutput = $bootstrappedExtensions['replacesProgressOutput']; + $extensionReplacesResultOutput = $bootstrappedExtensions['replacesResultOutput']; + $extensionRequiresExportOfObjects = $bootstrappedExtensions['requiresExportOfObjects']; } - CodeCoverage::instance()->init($configuration, CodeCoverageFilterRegistry::instance()); + if ($extensionRequiresExportOfObjects) { + EventFacade::emitter()->exportObjects(); + } - $printer = OutputFacade::init($configuration); + CodeCoverage::instance()->init( + $configuration, + CodeCoverageFilterRegistry::instance(), + $extensionRequiresCodeCoverageCollection, + ); - $this->writeRuntimeInformation($printer, $configuration); - $this->writePharExtensionInformation($printer, $pharExtensions); - $this->writeRandomSeedInformation($printer, $configuration); + if (CodeCoverage::instance()->isActive()) { + CodeCoverage::instance()->ignoreLines( + (new CodeCoverageMetadataApi)->linesToBeIgnored($testSuite), + ); + } - $printer->print(PHP_EOL); + $printer = OutputFacade::init( + $configuration, + $extensionReplacesProgressOutput, + $extensionReplacesResultOutput, + ); + + if (!$configuration->debug() && !$extensionReplacesOutput) { + $this->writeRuntimeInformation($printer, $configuration); + $this->writePharExtensionInformation($printer, $pharExtensions); + $this->writeRandomSeedInformation($printer, $configuration); + + $printer->print(PHP_EOL); + } + + if ($configuration->debug()) { + EventFacade::instance()->registerTracer( + new EventLogger( + 'php://stdout', + false, + ), + ); + } $this->registerLogfileWriters($configuration); @@ -131,7 +185,16 @@ final class Application $resultCache = $this->initializeTestResultCache($configuration); - EventFacade::seal(); + if ($configuration->controlGarbageCollector()) { + new GarbageCollectionHandler( + EventFacade::instance(), + $configuration->numberOfTestsBeforeGarbageCollection(), + ); + } + + $baselineGenerator = $this->configureBaseline($configuration); + + EventFacade::instance()->seal(); $timer = new Timer; $timer->start(); @@ -141,7 +204,7 @@ final class Application $runner->run( $configuration, $resultCache, - $testSuite + $testSuite, ); $duration = $timer->stop(); @@ -154,94 +217,109 @@ final class Application if ($testDoxResult !== null && $configuration->hasLogfileTestdoxHtml()) { - OutputFacade::printerFor($configuration->logfileTestdoxHtml())->print( - (new TestDoxHtmlRenderer)->render($testDoxResult) - ); + try { + OutputFacade::printerFor($configuration->logfileTestdoxHtml())->print( + (new TestDoxHtmlRenderer)->render($testDoxResult), + ); + } catch (DirectoryDoesNotExistException|InvalidSocketException $e) { + EventFacade::emitter()->testRunnerTriggeredPhpunitWarning( + sprintf( + 'Cannot log test results in TestDox HTML format to "%s": %s', + $configuration->logfileTestdoxHtml(), + $e->getMessage(), + ), + ); + } } if ($testDoxResult !== null && $configuration->hasLogfileTestdoxText()) { - OutputFacade::printerFor($configuration->logfileTestdoxText())->print( - (new TestDoxTextRenderer)->render($testDoxResult) - ); + try { + OutputFacade::printerFor($configuration->logfileTestdoxText())->print( + (new TestDoxTextRenderer)->render($testDoxResult), + ); + } catch (DirectoryDoesNotExistException|InvalidSocketException $e) { + EventFacade::emitter()->testRunnerTriggeredPhpunitWarning( + sprintf( + 'Cannot log test results in TestDox plain text format to "%s": %s', + $configuration->logfileTestdoxText(), + $e->getMessage(), + ), + ); + } } $result = TestResultFacade::result(); - OutputFacade::printResult($result, $testDoxResult, $duration); + if (!$extensionReplacesResultOutput && !$configuration->debug()) { + OutputFacade::printResult($result, $testDoxResult, $duration); + } + CodeCoverage::instance()->generateReports($printer, $configuration); + if (isset($baselineGenerator)) { + (new Writer)->write( + $configuration->generateBaseline(), + $baselineGenerator->baseline(), + ); + + $printer->print( + sprintf( + PHP_EOL . 'Baseline written to %s.' . PHP_EOL, + realpath($configuration->generateBaseline()), + ), + ); + } + $shellExitCode = (new ShellExitCodeCalculator)->calculate( - $configuration->failOnEmptyTestSuite(), - $configuration->failOnRisky(), - $configuration->failOnWarning(), - $configuration->failOnIncomplete(), - $configuration->failOnSkipped(), - $result + $configuration, + $result, ); EventFacade::emitter()->applicationFinished($shellExitCode); return $shellExitCode; + // @codeCoverageIgnoreStart } catch (Throwable $t) { $this->exitWithCrashMessage($t); } + // @codeCoverageIgnoreEnd } - private function exitWithCrashMessage(Throwable $t): never + private function execute(Command\Command $command, bool $requiresResultCollectedFromEvents = false): never { - $message = $t->getMessage(); + if ($requiresResultCollectedFromEvents) { + try { + TestResultFacade::init(); + EventFacade::instance()->seal(); - if (empty(trim($message))) { - $message = '(no message)'; + $resultCollectedFromEvents = TestResultFacade::result(); + } catch (EventFacadeIsSealedException|UnknownSubscriberTypeException) { + } } - printf( - '%s%sAn error occurred inside PHPUnit.%s%sMessage: %s', - PHP_EOL, - PHP_EOL, - PHP_EOL, - PHP_EOL, - $message - ); - - $first = true; - - do { - printf( - '%s%s: %s:%d%s%s%s%s', - PHP_EOL, - $first ? 'Location' : 'Caused by', - $t->getFile(), - $t->getLine(), - PHP_EOL, - PHP_EOL, - $t->getTraceAsString(), - PHP_EOL - ); - - $first = false; - } while ($t = $t->getPrevious()); - - exit(Result::CRASH); - } - - private function exitWithErrorMessage(string $message): never - { - print Version::getVersionString() . PHP_EOL . PHP_EOL . $message . PHP_EOL; - - exit(Result::EXCEPTION); - } - - private function execute(Command\Command $command): never - { print Version::getVersionString() . PHP_EOL . PHP_EOL; $result = $command->execute(); print $result->output(); - exit($result->shellExitCode()); + $shellExitCode = $result->shellExitCode(); + + if (isset($resultCollectedFromEvents) && + $resultCollectedFromEvents->hasTestTriggeredPhpunitErrorEvents()) { + $shellExitCode = Result::EXCEPTION; + + print PHP_EOL . PHP_EOL . 'There were errors:' . PHP_EOL; + + foreach ($resultCollectedFromEvents->testTriggeredPhpunitErrorEvents() as $events) { + foreach ($events as $event) { + print PHP_EOL . trim($event->message()) . PHP_EOL; + } + } + } + + exit($shellExitCode); } private function loadBootstrapScript(string $filename): void @@ -250,24 +328,37 @@ final class Application $this->exitWithErrorMessage( sprintf( 'Cannot open bootstrap script "%s"', - $filename - ) + $filename, + ), ); } try { include_once $filename; } catch (Throwable $t) { - $this->exitWithErrorMessage( - sprintf( - 'Error in bootstrap script: %s:%s%s%s%s', + $message = sprintf( + 'Error in bootstrap script: %s:%s%s%s%s', + $t::class, + PHP_EOL, + $t->getMessage(), + PHP_EOL, + $t->getTraceAsString(), + ); + + while ($t = $t->getPrevious()) { + $message .= sprintf( + '%s%sPrevious error: %s:%s%s%s%s', + PHP_EOL, + PHP_EOL, $t::class, PHP_EOL, $t->getMessage(), PHP_EOL, - $t->getTraceAsString() - ) - ); + $t->getTraceAsString(), + ); + } + + $this->exitWithErrorMessage($message); } EventFacade::emitter()->testRunnerBootstrapFinished($filename); @@ -284,9 +375,9 @@ final class Application return $cliConfiguration; } - private function loadXmlConfiguration(string|false $configurationFile): XmlConfiguration + private function loadXmlConfiguration(false|string $configurationFile): XmlConfiguration { - if (!$configurationFile) { + if ($configurationFile === false) { return DefaultConfiguration::create(); } @@ -306,38 +397,42 @@ final class Application } } - private function bootstrapExtensions(Configuration $configuration): void + /** + * @psalm-return array{requiresCodeCoverageCollection: bool, replacesOutput: bool, replacesProgressOutput: bool, replacesResultOutput: bool, requiresExportOfObjects: bool} + */ + private function bootstrapExtensions(Configuration $configuration): array { + $facade = new ExtensionFacade; + $extensionBootstrapper = new ExtensionBootstrapper( $configuration, - new ExtensionFacade + $facade, ); foreach ($configuration->extensionBootstrappers() as $bootstrapper) { - try { - $extensionBootstrapper->bootstrap( - $bootstrapper['className'], - $bootstrapper['parameters'] - ); - } catch (\PHPUnit\Runner\Exception $e) { - $this->exitWithErrorMessage( - sprintf( - 'Error while bootstrapping extension: %s', - $e->getMessage() - ) - ); - } + $extensionBootstrapper->bootstrap( + $bootstrapper['className'], + $bootstrapper['parameters'], + ); } + + return [ + 'requiresCodeCoverageCollection' => $facade->requiresCodeCoverageCollection(), + 'replacesOutput' => $facade->replacesOutput(), + 'replacesProgressOutput' => $facade->replacesProgressOutput(), + 'replacesResultOutput' => $facade->replacesResultOutput(), + 'requiresExportOfObjects' => $facade->requiresExportOfObjects(), + ]; } - private function executeCommandsThatOnlyRequireCliConfiguration(CliConfiguration $cliConfiguration, string|false $configurationFile): void + private function executeCommandsThatOnlyRequireCliConfiguration(CliConfiguration $cliConfiguration, false|string $configurationFile): void { if ($cliConfiguration->generateConfiguration()) { $this->execute(new GenerateConfigurationCommand); } if ($cliConfiguration->migrateConfiguration()) { - if (!$configurationFile) { + if ($configurationFile === false) { $this->exitWithErrorMessage('No configuration file found to migrate'); } @@ -352,8 +447,12 @@ final class Application $this->execute(new ShowVersionCommand); } + if ($cliConfiguration->checkPhpConfiguration()) { + $this->execute(new CheckPhpConfigurationCommand); + } + if ($cliConfiguration->checkVersion()) { - $this->execute(new VersionCheckCommand); + $this->execute(new VersionCheckCommand(new PhpDownloader, Version::majorVersionNumber(), Version::id())); } if ($cliConfiguration->help()) { @@ -364,19 +463,20 @@ final class Application private function executeCommandsThatRequireCliConfigurationAndTestSuite(CliConfiguration $cliConfiguration, TestSuite $testSuite): void { if ($cliConfiguration->listGroups()) { - $this->execute(new ListGroupsCommand($testSuite)); + $this->execute(new ListGroupsCommand($testSuite), true); } if ($cliConfiguration->listTests()) { - $this->execute(new ListTestsAsTextCommand($testSuite)); + $this->execute(new ListTestsAsTextCommand($testSuite), true); } if ($cliConfiguration->hasListTestsXml()) { $this->execute( new ListTestsAsXmlCommand( $cliConfiguration->listTestsXml(), - $testSuite - ) + $testSuite, + ), + true, ); } } @@ -394,7 +494,7 @@ final class Application private function executeHelpCommandWhenThereIsNothingElseToDo(Configuration $configuration, TestSuite $testSuite): void { - if ($testSuite->isEmpty() && !$configuration->hasCliArgument() && $configuration->testSuite()->isEmpty()) { + if ($testSuite->isEmpty() && !$configuration->hasCliArguments() && $configuration->testSuite()->isEmpty()) { $this->execute(new ShowHelpCommand(Result::FAILURE)); } } @@ -415,13 +515,13 @@ final class Application $this->writeMessage( $printer, 'Configuration', - $configuration->configurationFile() + $configuration->configurationFile(), ); } } /** - * @psalm-param ?array{loadedExtensions: list, notLoadedExtensions: list} $pharExtensions + * @psalm-param ?list $pharExtensions */ private function writePharExtensionInformation(Printer $printer, ?array $pharExtensions): void { @@ -429,19 +529,11 @@ final class Application return; } - foreach ($pharExtensions['loadedExtensions'] as $extension) { + foreach ($pharExtensions as $extension) { $this->writeMessage( $printer, 'Extension', - $extension - ); - } - - foreach ($pharExtensions['notLoadedExtensions'] as $extension) { - $this->writeMessage( - $printer, - 'Extension', - $extension + $extension, ); } } @@ -452,8 +544,8 @@ final class Application sprintf( "%-15s%s\n", $type . ':', - $message - ) + $message, + ), ); } @@ -463,11 +555,15 @@ final class Application $this->writeMessage( $printer, 'Random Seed', - (string) $configuration->randomOrderSeed() + (string) $configuration->randomOrderSeed(), ); } } + /** + * @throws EventFacadeIsSealedException + * @throws UnknownSubscriberTypeException + */ private function registerLogfileWriters(Configuration $configuration): void { if ($configuration->hasLogEventsText()) { @@ -475,11 +571,11 @@ final class Application unlink($configuration->logEventsText()); } - EventFacade::registerTracer( + EventFacade::instance()->registerTracer( new EventLogger( $configuration->logEventsText(), - false - ) + false, + ), ); } @@ -488,50 +584,169 @@ final class Application unlink($configuration->logEventsVerboseText()); } - EventFacade::registerTracer( + EventFacade::instance()->registerTracer( new EventLogger( $configuration->logEventsVerboseText(), - true - ) + true, + ), ); + + EventFacade::emitter()->exportObjects(); } if ($configuration->hasLogfileJunit()) { - new JunitXmlLogger( - OutputFacade::printerFor($configuration->logfileJunit()), - ); + try { + new JunitXmlLogger( + OutputFacade::printerFor($configuration->logfileJunit()), + EventFacade::instance(), + ); + } catch (DirectoryDoesNotExistException|InvalidSocketException $e) { + EventFacade::emitter()->testRunnerTriggeredPhpunitWarning( + sprintf( + 'Cannot log test results in JUnit XML format to "%s": %s', + $configuration->logfileJunit(), + $e->getMessage(), + ), + ); + } } if ($configuration->hasLogfileTeamcity()) { - new TeamCityLogger( - DefaultPrinter::from( - $configuration->logfileTeamcity() - ) - ); + try { + new TeamCityLogger( + DefaultPrinter::from( + $configuration->logfileTeamcity(), + ), + EventFacade::instance(), + ); + } catch (DirectoryDoesNotExistException|InvalidSocketException $e) { + EventFacade::emitter()->testRunnerTriggeredPhpunitWarning( + sprintf( + 'Cannot log test results in TeamCity format to "%s": %s', + $configuration->logfileTeamcity(), + $e->getMessage(), + ), + ); + } } } + /** + * @throws EventFacadeIsSealedException + * @throws UnknownSubscriberTypeException + */ private function testDoxResultCollector(Configuration $configuration): ?TestDoxResultCollector { if ($configuration->hasLogfileTestdoxHtml() || $configuration->hasLogfileTestdoxText() || $configuration->outputIsTestDox()) { - return new TestDoxResultCollector; + return new TestDoxResultCollector( + EventFacade::instance(), + $configuration->source(), + ); } return null; } + /** + * @throws EventFacadeIsSealedException + * @throws UnknownSubscriberTypeException + */ private function initializeTestResultCache(Configuration $configuration): ResultCache { if ($configuration->cacheResult()) { $cache = new DefaultResultCache($configuration->testResultCacheFile()); - new ResultCacheHandler($cache); + new ResultCacheHandler($cache, EventFacade::instance()); return $cache; } return new NullResultCache; } + + /** + * @throws EventFacadeIsSealedException + * @throws UnknownSubscriberTypeException + */ + private function configureBaseline(Configuration $configuration): ?BaselineGenerator + { + if ($configuration->hasGenerateBaseline()) { + return new BaselineGenerator( + EventFacade::instance(), + $configuration->source(), + ); + } + + if ($configuration->source()->useBaseline()) { + /** @psalm-suppress MissingThrowsDocblock */ + $baselineFile = $configuration->source()->baseline(); + $baseline = null; + + try { + $baseline = (new Reader)->read($baselineFile); + } catch (CannotLoadBaselineException $e) { + EventFacade::emitter()->testRunnerTriggeredPhpunitWarning($e->getMessage()); + } + + if ($baseline !== null) { + ErrorHandler::instance()->use($baseline); + } + } + + return null; + } + + /** + * @codeCoverageIgnore + */ + private function exitWithCrashMessage(Throwable $t): never + { + $message = $t->getMessage(); + + if (empty(trim($message))) { + $message = '(no message)'; + } + + printf( + '%s%sAn error occurred inside PHPUnit.%s%sMessage: %s', + PHP_EOL, + PHP_EOL, + PHP_EOL, + PHP_EOL, + $message, + ); + + $first = true; + + if ($t->getPrevious()) { + $t = $t->getPrevious(); + } + + do { + printf( + '%s%s: %s:%d%s%s%s%s', + PHP_EOL, + $first ? 'Location' : 'Caused by', + $t->getFile(), + $t->getLine(), + PHP_EOL, + PHP_EOL, + $t->getTraceAsString(), + PHP_EOL, + ); + + $first = false; + } while ($t = $t->getPrevious()); + + exit(Result::CRASH); + } + + private function exitWithErrorMessage(string $message): never + { + print Version::getVersionString() . PHP_EOL . PHP_EOL . $message . PHP_EOL; + + exit(Result::EXCEPTION); + } } diff --git a/vendor/phpunit/phpunit/src/TextUI/Command/Command.php b/vendor/phpunit/phpunit/src/TextUI/Command/Command.php index d340c830..faa9ebc0 100644 --- a/vendor/phpunit/phpunit/src/TextUI/Command/Command.php +++ b/vendor/phpunit/phpunit/src/TextUI/Command/Command.php @@ -10,7 +10,9 @@ namespace PHPUnit\TextUI\Command; /** - * @internal This class is not covered by the backward compatibility promise for PHPUnit + * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit + * + * @internal This interface is not covered by the backward compatibility promise for PHPUnit */ interface Command { diff --git a/vendor/phpunit/phpunit/src/TextUI/Command/Commands/AtLeastVersionCommand.php b/vendor/phpunit/phpunit/src/TextUI/Command/Commands/AtLeastVersionCommand.php index 2fe62c51..06d78358 100644 --- a/vendor/phpunit/phpunit/src/TextUI/Command/Commands/AtLeastVersionCommand.php +++ b/vendor/phpunit/phpunit/src/TextUI/Command/Commands/AtLeastVersionCommand.php @@ -13,6 +13,8 @@ use function version_compare; use PHPUnit\Runner\Version; /** + * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit + * * @internal This class is not covered by the backward compatibility promise for PHPUnit */ final class AtLeastVersionCommand implements Command diff --git a/vendor/phpunit/phpunit/src/TextUI/Command/Commands/GenerateConfigurationCommand.php b/vendor/phpunit/phpunit/src/TextUI/Command/Commands/GenerateConfigurationCommand.php index f37815be..b71d8b04 100644 --- a/vendor/phpunit/phpunit/src/TextUI/Command/Commands/GenerateConfigurationCommand.php +++ b/vendor/phpunit/phpunit/src/TextUI/Command/Commands/GenerateConfigurationCommand.php @@ -9,14 +9,19 @@ */ namespace PHPUnit\TextUI\Command; +use const PHP_EOL; +use const STDIN; use function fgets; use function file_put_contents; use function getcwd; +use function sprintf; use function trim; use PHPUnit\Runner\Version; use PHPUnit\TextUI\XmlConfiguration\Generator; /** + * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit + * * @internal This class is not covered by the backward compatibility promise for PHPUnit */ final class GenerateConfigurationCommand implements Command @@ -58,22 +63,37 @@ final class GenerateConfigurationCommand implements Command $generator = new Generator; - file_put_contents( + $result = @file_put_contents( 'phpunit.xml', $generator->generateDefaultConfiguration( Version::series(), $bootstrapScript, $testsDirectory, $src, - $cacheDirectory - ) + $cacheDirectory, + ), ); - /* @noinspection MissingDirectorySeparatorInspection */ - print PHP_EOL . 'Generated phpunit.xml in ' . getcwd() . '.' . PHP_EOL; - print 'Make sure to exclude the ' . $cacheDirectory . ' directory from version control.' . PHP_EOL; + if ($result !== false) { + return Result::from( + sprintf( + PHP_EOL . 'Generated phpunit.xml in %s.' . PHP_EOL . + 'Make sure to exclude the %s directory from version control.' . PHP_EOL, + getcwd(), + $cacheDirectory, + ), + ); + } - return Result::from(); + // @codeCoverageIgnoreStart + return Result::from( + sprintf( + PHP_EOL . 'Could not write phpunit.xml in %s.' . PHP_EOL, + getcwd(), + ), + Result::EXCEPTION, + ); + // @codeCoverageIgnoreEnd } private function read(): string diff --git a/vendor/phpunit/phpunit/src/TextUI/Command/Commands/ListGroupsCommand.php b/vendor/phpunit/phpunit/src/TextUI/Command/Commands/ListGroupsCommand.php index e69e52f8..f5f0fac0 100644 --- a/vendor/phpunit/phpunit/src/TextUI/Command/Commands/ListGroupsCommand.php +++ b/vendor/phpunit/phpunit/src/TextUI/Command/Commands/ListGroupsCommand.php @@ -9,6 +9,7 @@ */ namespace PHPUnit\TextUI\Command; +use const PHP_EOL; use function sort; use function sprintf; use function str_starts_with; @@ -16,6 +17,8 @@ use PHPUnit\Framework\TestSuite; use PHPUnit\TextUI\Configuration\Registry; /** + * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit + * * @internal This class is not covered by the backward compatibility promise for PHPUnit */ final class ListGroupsCommand implements Command @@ -32,7 +35,7 @@ final class ListGroupsCommand implements Command $buffer = $this->warnAboutConflictingOptions(); $buffer .= 'Available test group(s):' . PHP_EOL; - $groups = $this->suite->getGroups(); + $groups = $this->suite->groups(); sort($groups); foreach ($groups as $group) { @@ -42,7 +45,7 @@ final class ListGroupsCommand implements Command $buffer .= sprintf( ' - %s' . PHP_EOL, - $group + $group, ); } diff --git a/vendor/phpunit/phpunit/src/TextUI/Command/Commands/ListTestSuitesCommand.php b/vendor/phpunit/phpunit/src/TextUI/Command/Commands/ListTestSuitesCommand.php index bb53afdd..44aead51 100644 --- a/vendor/phpunit/phpunit/src/TextUI/Command/Commands/ListTestSuitesCommand.php +++ b/vendor/phpunit/phpunit/src/TextUI/Command/Commands/ListTestSuitesCommand.php @@ -9,11 +9,14 @@ */ namespace PHPUnit\TextUI\Command; +use const PHP_EOL; use function sprintf; use PHPUnit\TextUI\Configuration\Registry; use PHPUnit\TextUI\Configuration\TestSuiteCollection; /** + * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit + * * @internal This class is not covered by the backward compatibility promise for PHPUnit */ final class ListTestSuitesCommand implements Command @@ -33,7 +36,7 @@ final class ListTestSuitesCommand implements Command foreach ($this->suites as $suite) { $buffer .= sprintf( ' - %s' . PHP_EOL, - $suite->name() + $suite->name(), ); } @@ -59,7 +62,7 @@ final class ListTestSuitesCommand implements Command } if ($configuration->includeTestSuite() !== '') { - $buffer .= 'The --testsuite and --list-suites options cannot be combined, --exclude-group is ignored' . PHP_EOL; + $buffer .= 'The --testsuite and --list-suites options cannot be combined, --testsuite is ignored' . PHP_EOL; } if (!empty($buffer)) { diff --git a/vendor/phpunit/phpunit/src/TextUI/Command/Commands/ListTestsAsTextCommand.php b/vendor/phpunit/phpunit/src/TextUI/Command/Commands/ListTestsAsTextCommand.php index 3af328f1..0d377011 100644 --- a/vendor/phpunit/phpunit/src/TextUI/Command/Commands/ListTestsAsTextCommand.php +++ b/vendor/phpunit/phpunit/src/TextUI/Command/Commands/ListTestsAsTextCommand.php @@ -9,6 +9,7 @@ */ namespace PHPUnit\TextUI\Command; +use const PHP_EOL; use function sprintf; use function str_replace; use PHPUnit\Framework\TestCase; @@ -18,6 +19,8 @@ use PHPUnit\TextUI\Configuration\Registry; use RecursiveIteratorIterator; /** + * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit + * * @internal This class is not covered by the backward compatibility promise for PHPUnit */ final class ListTestsAsTextCommand implements Command @@ -40,7 +43,7 @@ final class ListTestsAsTextCommand implements Command $name = sprintf( '%s::%s', $test::class, - str_replace(' with data set ', '', $test->nameWithDataSet()) + str_replace(' with data set ', '', $test->nameWithDataSet()), ); } elseif ($test instanceof PhptTestCase) { $name = $test->getName(); @@ -50,7 +53,7 @@ final class ListTestsAsTextCommand implements Command $buffer .= sprintf( ' - %s' . PHP_EOL, - $name + $name, ); } diff --git a/vendor/phpunit/phpunit/src/TextUI/Command/Commands/ListTestsAsXmlCommand.php b/vendor/phpunit/phpunit/src/TextUI/Command/Commands/ListTestsAsXmlCommand.php index 7cd5fb5f..5a1085f1 100644 --- a/vendor/phpunit/phpunit/src/TextUI/Command/Commands/ListTestsAsXmlCommand.php +++ b/vendor/phpunit/phpunit/src/TextUI/Command/Commands/ListTestsAsXmlCommand.php @@ -9,6 +9,7 @@ */ namespace PHPUnit\TextUI\Command; +use const PHP_EOL; use function file_put_contents; use function implode; use function sprintf; @@ -21,6 +22,8 @@ use RecursiveIteratorIterator; use XMLWriter; /** + * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit + * * @internal This class is not covered by the backward compatibility promise for PHPUnit */ final class ListTestsAsXmlCommand implements Command @@ -60,22 +63,30 @@ final class ListTestsAsXmlCommand implements Command } $writer->startElement('testCaseMethod'); + $writer->writeAttribute('id', $test->valueObjectForEvents()->id()); $writer->writeAttribute('name', $test->name()); $writer->writeAttribute('groups', implode(',', $test->groups())); + /** + * @deprecated https://github.com/sebastianbergmann/phpunit/issues/5481 + */ if (!empty($test->dataSetAsString())) { $writer->writeAttribute( 'dataSet', str_replace( ' with data set ', '', - $test->dataSetAsString() - ) + $test->dataSetAsString(), + ), ); } $writer->endElement(); - } elseif ($test instanceof PhptTestCase) { + + continue; + } + + if ($test instanceof PhptTestCase) { if ($currentTestCase !== null) { $writer->endElement(); @@ -98,7 +109,7 @@ final class ListTestsAsXmlCommand implements Command $buffer .= sprintf( 'Wrote list of tests that would have been run to %s' . PHP_EOL, - $this->filename + $this->filename, ); return Result::from($buffer); diff --git a/vendor/phpunit/phpunit/src/TextUI/Command/Commands/MigrateConfigurationCommand.php b/vendor/phpunit/phpunit/src/TextUI/Command/Commands/MigrateConfigurationCommand.php index 7de97696..cde391ab 100644 --- a/vendor/phpunit/phpunit/src/TextUI/Command/Commands/MigrateConfigurationCommand.php +++ b/vendor/phpunit/phpunit/src/TextUI/Command/Commands/MigrateConfigurationCommand.php @@ -9,12 +9,16 @@ */ namespace PHPUnit\TextUI\Command; +use const PHP_EOL; use function copy; use function file_put_contents; +use function sprintf; use PHPUnit\TextUI\XmlConfiguration\Migrator; use Throwable; /** + * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit + * * @internal This class is not covered by the backward compatibility promise for PHPUnit */ final class MigrateConfigurationCommand implements Command @@ -28,24 +32,33 @@ final class MigrateConfigurationCommand implements Command public function execute(): Result { - copy($this->filename, $this->filename . '.bak'); - - $buffer = 'Created backup: ' . $this->filename . '.bak' . PHP_EOL; - $shellExitCode = Result::SUCCESS; - try { - file_put_contents( - $this->filename, - (new Migrator)->migrate($this->filename) + $migrated = (new Migrator)->migrate($this->filename); + + copy($this->filename, $this->filename . '.bak'); + + file_put_contents($this->filename, $migrated); + + return Result::from( + sprintf( + 'Created backup: %s.bak%sMigrated configuration: %s%s', + $this->filename, + PHP_EOL, + $this->filename, + PHP_EOL, + ), ); - - $buffer .= 'Migrated configuration: ' . $this->filename . PHP_EOL; } catch (Throwable $t) { - $buffer .= 'Migration failed: ' . $t->getMessage() . PHP_EOL; - - $shellExitCode = Result::FAILURE; + return Result::from( + sprintf( + 'Migration of %s failed:%s%s%s', + $this->filename, + PHP_EOL, + $t->getMessage(), + PHP_EOL, + ), + Result::FAILURE, + ); } - - return Result::from($buffer, $shellExitCode); } } diff --git a/vendor/phpunit/phpunit/src/TextUI/Command/Commands/ShowHelpCommand.php b/vendor/phpunit/phpunit/src/TextUI/Command/Commands/ShowHelpCommand.php index 2b23fc24..654cbb88 100644 --- a/vendor/phpunit/phpunit/src/TextUI/Command/Commands/ShowHelpCommand.php +++ b/vendor/phpunit/phpunit/src/TextUI/Command/Commands/ShowHelpCommand.php @@ -12,6 +12,8 @@ namespace PHPUnit\TextUI\Command; use PHPUnit\TextUI\Help; /** + * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit + * * @internal This class is not covered by the backward compatibility promise for PHPUnit */ final class ShowHelpCommand implements Command @@ -27,7 +29,7 @@ final class ShowHelpCommand implements Command { return Result::from( (new Help)->generate(), - $this->shellExitCode + $this->shellExitCode, ); } } diff --git a/vendor/phpunit/phpunit/src/TextUI/Command/Commands/ShowVersionCommand.php b/vendor/phpunit/phpunit/src/TextUI/Command/Commands/ShowVersionCommand.php index b5ddfc29..b1e66510 100644 --- a/vendor/phpunit/phpunit/src/TextUI/Command/Commands/ShowVersionCommand.php +++ b/vendor/phpunit/phpunit/src/TextUI/Command/Commands/ShowVersionCommand.php @@ -10,6 +10,8 @@ namespace PHPUnit\TextUI\Command; /** + * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit + * * @internal This class is not covered by the backward compatibility promise for PHPUnit */ final class ShowVersionCommand implements Command diff --git a/vendor/phpunit/phpunit/src/TextUI/Command/Commands/VersionCheckCommand.php b/vendor/phpunit/phpunit/src/TextUI/Command/Commands/VersionCheckCommand.php index 35866e17..95dabba8 100644 --- a/vendor/phpunit/phpunit/src/TextUI/Command/Commands/VersionCheckCommand.php +++ b/vendor/phpunit/phpunit/src/TextUI/Command/Commands/VersionCheckCommand.php @@ -9,33 +9,66 @@ */ namespace PHPUnit\TextUI\Command; -use function file_get_contents; +use const PHP_EOL; +use function assert; use function sprintf; use function version_compare; -use PHPUnit\Runner\Version; +use PHPUnit\Util\Http\Downloader; /** + * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit + * * @internal This class is not covered by the backward compatibility promise for PHPUnit */ final class VersionCheckCommand implements Command { + private readonly Downloader $downloader; + private readonly int $majorVersionNumber; + private readonly string $versionId; + + public function __construct(Downloader $downloader, int $majorVersionNumber, string $versionId) + { + $this->downloader = $downloader; + $this->majorVersionNumber = $majorVersionNumber; + $this->versionId = $versionId; + } + public function execute(): Result { - $latestVersion = file_get_contents('https://phar.phpunit.de/latest-version-of/phpunit'); - $isOutdated = version_compare($latestVersion, Version::id(), '>'); + $latestVersion = $this->downloader->download('https://phar.phpunit.de/latest-version-of/phpunit'); - if ($isOutdated) { + assert($latestVersion !== false); + + $latestCompatibleVersion = $this->downloader->download('https://phar.phpunit.de/latest-version-of/phpunit-' . $this->majorVersionNumber); + + assert($latestCompatibleVersion !== false); + + $notLatest = version_compare($latestVersion, $this->versionId, '>'); + $notLatestCompatible = version_compare($latestCompatibleVersion, $this->versionId, '>'); + + if (!$notLatest && !$notLatestCompatible) { return Result::from( - sprintf( - 'You are not using the latest version of PHPUnit.' . PHP_EOL . - 'The latest version is PHPUnit %s.' . PHP_EOL, - $latestVersion - ) + 'You are using the latest version of PHPUnit.' . PHP_EOL, ); } - return Result::from( - 'You are using the latest version of PHPUnit.' . PHP_EOL - ); + $buffer = 'You are not using the latest version of PHPUnit.' . PHP_EOL; + + if ($notLatestCompatible) { + $buffer .= sprintf( + 'The latest version compatible with PHPUnit %s is PHPUnit %s.' . PHP_EOL, + $this->versionId, + $latestCompatibleVersion, + ); + } + + if ($notLatest) { + $buffer .= sprintf( + 'The latest version is PHPUnit %s.' . PHP_EOL, + $latestVersion, + ); + } + + return Result::from($buffer); } } diff --git a/vendor/phpunit/phpunit/src/TextUI/Command/Commands/WarmCodeCoverageCacheCommand.php b/vendor/phpunit/phpunit/src/TextUI/Command/Commands/WarmCodeCoverageCacheCommand.php index 4749bfeb..fa8256e7 100644 --- a/vendor/phpunit/phpunit/src/TextUI/Command/Commands/WarmCodeCoverageCacheCommand.php +++ b/vendor/phpunit/phpunit/src/TextUI/Command/Commands/WarmCodeCoverageCacheCommand.php @@ -9,6 +9,7 @@ */ namespace PHPUnit\TextUI\Command; +use const PHP_EOL; use function printf; use PHPUnit\TextUI\Configuration\CodeCoverageFilterRegistry; use PHPUnit\TextUI\Configuration\Configuration; @@ -18,7 +19,11 @@ use SebastianBergmann\Timer\NoActiveTimerException; use SebastianBergmann\Timer\Timer; /** + * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit + * * @internal This class is not covered by the backward compatibility promise for PHPUnit + * + * @codeCoverageIgnore */ final class WarmCodeCoverageCacheCommand implements Command { @@ -40,16 +45,16 @@ final class WarmCodeCoverageCacheCommand implements Command if (!$this->configuration->hasCoverageCacheDirectory()) { return Result::from( 'Cache for static analysis has not been configured' . PHP_EOL, - Result::FAILURE + Result::FAILURE, ); } - $this->codeCoverageFilterRegistry->init($this->configuration); + $this->codeCoverageFilterRegistry->init($this->configuration, true); if (!$this->codeCoverageFilterRegistry->configured()) { return Result::from( 'Filter for code coverage has not been configured' . PHP_EOL, - Result::FAILURE + Result::FAILURE, ); } @@ -62,13 +67,13 @@ final class WarmCodeCoverageCacheCommand implements Command $this->configuration->coverageCacheDirectory(), !$this->configuration->disableCodeCoverageIgnore(), $this->configuration->ignoreDeprecatedCodeUnitsFromCodeCoverage(), - $this->codeCoverageFilterRegistry->get() + $this->codeCoverageFilterRegistry->get(), ); printf( '[%s]%s', $timer->stop()->asString(), - \PHP_EOL + PHP_EOL, ); return Result::from(); diff --git a/vendor/phpunit/phpunit/src/TextUI/Command/Result.php b/vendor/phpunit/phpunit/src/TextUI/Command/Result.php index fe817751..b0544e7a 100644 --- a/vendor/phpunit/phpunit/src/TextUI/Command/Result.php +++ b/vendor/phpunit/phpunit/src/TextUI/Command/Result.php @@ -12,17 +12,16 @@ namespace PHPUnit\TextUI\Command; /** * @psalm-immutable * + * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit + * * @internal This class is not covered by the backward compatibility promise for PHPUnit */ final class Result { - public const SUCCESS = 0; - - public const FAILURE = 1; - + public const SUCCESS = 0; + public const FAILURE = 1; public const EXCEPTION = 2; - - public const CRASH = 255; + public const CRASH = 255; private readonly string $output; private readonly int $shellExitCode; diff --git a/vendor/phpunit/phpunit/src/TextUI/Configuration/Builder.php b/vendor/phpunit/phpunit/src/TextUI/Configuration/Builder.php index 55f38c5b..6ada9b4a 100644 --- a/vendor/phpunit/phpunit/src/TextUI/Configuration/Builder.php +++ b/vendor/phpunit/phpunit/src/TextUI/Configuration/Builder.php @@ -18,6 +18,8 @@ use PHPUnit\TextUI\XmlConfiguration\Loader; /** * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit + * + * @codeCoverageIgnore */ final class Builder { @@ -31,19 +33,19 @@ final class Builder $configurationFile = (new XmlConfigurationFileFinder)->find($cliConfiguration); $xmlConfiguration = DefaultConfiguration::create(); - if ($configurationFile) { + if ($configurationFile !== false) { $xmlConfiguration = (new Loader)->load($configurationFile); } return Registry::init( $cliConfiguration, - $xmlConfiguration + $xmlConfiguration, ); } catch (CliConfigurationException|XmlConfigurationException $e) { throw new ConfigurationCannotBeBuiltException( $e->getMessage(), $e->getCode(), - $e + $e, ); } } diff --git a/vendor/phpunit/phpunit/src/TextUI/Configuration/Cli/Builder.php b/vendor/phpunit/phpunit/src/TextUI/Configuration/Cli/Builder.php index a6d852ff..17559f70 100644 --- a/vendor/phpunit/phpunit/src/TextUI/Configuration/Cli/Builder.php +++ b/vendor/phpunit/phpunit/src/TextUI/Configuration/Cli/Builder.php @@ -9,15 +9,23 @@ */ namespace PHPUnit\TextUI\CliArguments; +use const DIRECTORY_SEPARATOR; use function array_map; +use function basename; use function explode; +use function getcwd; +use function is_file; use function is_numeric; use function sprintf; +use PHPUnit\Event\Facade as EventFacade; use PHPUnit\Runner\TestSuiteSorter; +use PHPUnit\Util\Filesystem; use SebastianBergmann\CliParser\Exception as CliParserException; use SebastianBergmann\CliParser\Parser as CliParser; /** + * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit + * * @internal This class is not covered by the backward compatibility promise for PHPUnit */ final class Builder @@ -30,6 +38,7 @@ final class Builder 'cache-directory=', 'cache-result-file=', 'check-version', + 'check-php-configuration', 'colors==', 'columns=', 'configuration=', @@ -42,12 +51,16 @@ final class Builder 'coverage-html=', 'coverage-php=', 'coverage-text==', + 'only-summary-for-coverage-text', + 'show-uncovered-for-coverage-text', 'coverage-xml=', 'path-coverage', 'disallow-test-output', + 'display-all-issues', 'display-incomplete', 'display-skipped', 'display-deprecations', + 'display-phpunit-deprecations', 'display-errors', 'display-notices', 'display-warnings', @@ -55,6 +68,9 @@ final class Builder 'enforce-time-limit', 'exclude-group=', 'filter=', + 'generate-baseline=', + 'use-baseline=', + 'ignore-baseline', 'generate-configuration', 'globals-backup', 'group=', @@ -80,6 +96,7 @@ final class Builder 'no-results', 'order-by=', 'process-isolation', + 'do-not-report-useless-tests', 'dont-report-useless-tests', 'random-order', 'random-order-seed=', @@ -87,18 +104,34 @@ final class Builder 'reverse-list', 'static-backup', 'stderr', - 'stop-on-defect', - 'stop-on-error', - 'stop-on-failure', - 'stop-on-warning', - 'stop-on-incomplete', - 'stop-on-risky', - 'stop-on-skipped', + 'fail-on-all-issues', + 'fail-on-deprecation', + 'fail-on-phpunit-deprecation', + 'fail-on-phpunit-warning', 'fail-on-empty-test-suite', 'fail-on-incomplete', + 'fail-on-notice', 'fail-on-risky', 'fail-on-skipped', 'fail-on-warning', + 'do-not-fail-on-deprecation', + 'do-not-fail-on-phpunit-deprecation', + 'do-not-fail-on-phpunit-warning', + 'do-not-fail-on-empty-test-suite', + 'do-not-fail-on-incomplete', + 'do-not-fail-on-notice', + 'do-not-fail-on-risky', + 'do-not-fail-on-skipped', + 'do-not-fail-on-warning', + 'stop-on-defect', + 'stop-on-deprecation', + 'stop-on-error', + 'stop-on-failure', + 'stop-on-incomplete', + 'stop-on-notice', + 'stop-on-risky', + 'stop-on-skipped', + 'stop-on-warning', 'strict-coverage', 'disable-coverage-ignore', 'strict-global-state', @@ -112,9 +145,14 @@ final class Builder 'log-events-text=', 'log-events-verbose-text=', 'version', + 'debug', ]; + private const SHORT_OPTIONS = 'd:c:h'; - private const SHORT_OPTIONS = 'd:c:hv'; + /** + * @psalm-var array + */ + private array $processed = []; /** * @throws Exception @@ -125,17 +163,16 @@ final class Builder $options = (new CliParser)->parse( $parameters, self::SHORT_OPTIONS, - self::LONG_OPTIONS + self::LONG_OPTIONS, ); } catch (CliParserException $e) { throw new Exception( $e->getMessage(), $e->getCode(), - $e + $e, ); } - $argument = null; $atLeastVersion = null; $backupGlobals = null; $backupStaticProperties = null; @@ -144,6 +181,7 @@ final class Builder $cacheDirectory = null; $cacheResult = null; $cacheResultFile = null; + $checkPhpConfiguration = false; $checkVersion = false; $colors = null; $columns = null; @@ -164,9 +202,11 @@ final class Builder $defaultTimeLimit = null; $disableCodeCoverageIgnore = null; $disallowTestOutput = null; + $displayAllIssues = null; $displayIncomplete = null; $displaySkipped = null; $displayDeprecations = null; + $displayPhpunitDeprecations = null; $displayErrors = null; $displayNotices = null; $displayWarnings = null; @@ -174,12 +214,38 @@ final class Builder $excludeGroups = null; $executionOrder = null; $executionOrderDefects = null; + $failOnAllIssues = null; + $failOnDeprecation = null; + $failOnPhpunitDeprecation = null; + $failOnPhpunitWarning = null; $failOnEmptyTestSuite = null; $failOnIncomplete = null; + $failOnNotice = null; $failOnRisky = null; $failOnSkipped = null; $failOnWarning = null; + $doNotFailOnDeprecation = null; + $doNotFailOnPhpunitDeprecation = null; + $doNotFailOnPhpunitWarning = null; + $doNotFailOnEmptyTestSuite = null; + $doNotFailOnIncomplete = null; + $doNotFailOnNotice = null; + $doNotFailOnRisky = null; + $doNotFailOnSkipped = null; + $doNotFailOnWarning = null; + $stopOnDefect = null; + $stopOnDeprecation = null; + $stopOnError = null; + $stopOnFailure = null; + $stopOnIncomplete = null; + $stopOnNotice = null; + $stopOnRisky = null; + $stopOnSkipped = null; + $stopOnWarning = null; $filter = null; + $generateBaseline = null; + $useBaseline = null; + $ignoreBaseline = false; $generateConfiguration = false; $migrateConfiguration = false; $groups = null; @@ -206,13 +272,6 @@ final class Builder $reverseList = null; $stderr = null; $strictCoverage = null; - $stopOnDefect = null; - $stopOnError = null; - $stopOnFailure = null; - $stopOnIncomplete = null; - $stopOnRisky = null; - $stopOnSkipped = null; - $stopOnWarning = null; $teamcityLogfile = null; $testdoxHtmlFile = null; $testdoxTextFile = null; @@ -225,12 +284,11 @@ final class Builder $logEventsVerboseText = null; $printerTeamCity = null; $printerTestDox = null; - - if (isset($options[1][0])) { - $argument = $options[1][0]; - } + $debug = false; foreach ($options[0] as $option) { + $optionAllowedMultipleTimes = false; + switch ($option[0]) { case '--colors': $colors = $option[1] ?: \PHPUnit\TextUI\Configuration\Configuration::COLOR_AUTO; @@ -317,9 +375,17 @@ final class Builder $option[1] = 'php://stdout'; } - $coverageText = $option[1]; - $coverageTextShowUncoveredFiles = false; - $coverageTextShowOnlySummary = false; + $coverageText = $option[1]; + + break; + + case '--only-summary-for-coverage-text': + $coverageTextShowOnlySummary = true; + + break; + + case '--show-uncovered-for-coverage-text': + $coverageTextShowUncoveredFiles = true; break; @@ -344,6 +410,8 @@ final class Builder } } + $optionAllowedMultipleTimes = true; + break; case 'h': @@ -367,6 +435,29 @@ final class Builder break; + case '--generate-baseline': + $generateBaseline = $option[1]; + + if (basename($generateBaseline) === $generateBaseline) { + $generateBaseline = getcwd() . DIRECTORY_SEPARATOR . $generateBaseline; + } + + break; + + case '--use-baseline': + $useBaseline = $option[1]; + + if (basename($useBaseline) === $useBaseline && !is_file($useBaseline)) { + $useBaseline = getcwd() . DIRECTORY_SEPARATOR . $useBaseline; + } + + break; + + case '--ignore-baseline': + $ignoreBaseline = true; + + break; + case '--generate-configuration': $generateConfiguration = true; @@ -486,8 +577,8 @@ final class Builder throw new Exception( sprintf( 'unrecognized --order-by option: %s', - $order - ) + $order, + ), ); } } @@ -504,11 +595,219 @@ final class Builder break; + case '--fail-on-all-issues': + $failOnAllIssues = true; + + break; + + case '--fail-on-deprecation': + $this->warnWhenOptionsConflict( + $doNotFailOnDeprecation, + '--fail-on-deprecation', + '--do-not-fail-on-deprecation', + ); + + $failOnDeprecation = true; + + break; + + case '--fail-on-phpunit-deprecation': + $this->warnWhenOptionsConflict( + $doNotFailOnPhpunitDeprecation, + '--fail-on-phpunit-deprecation', + '--do-not-fail-on-phpunit-deprecation', + ); + + $failOnPhpunitDeprecation = true; + + break; + + case '--fail-on-phpunit-warning': + $this->warnWhenOptionsConflict( + $doNotFailOnPhpunitWarning, + '--fail-on-phpunit-warning', + '--do-not-fail-on-phpunit-warning', + ); + + $failOnPhpunitWarning = true; + + break; + + case '--fail-on-empty-test-suite': + $this->warnWhenOptionsConflict( + $doNotFailOnEmptyTestSuite, + '--fail-on-empty-test-suite', + '--do-not-fail-on-empty-test-suite', + ); + + $failOnEmptyTestSuite = true; + + break; + + case '--fail-on-incomplete': + $this->warnWhenOptionsConflict( + $doNotFailOnIncomplete, + '--fail-on-incomplete', + '--do-not-fail-on-incomplete', + ); + + $failOnIncomplete = true; + + break; + + case '--fail-on-notice': + $this->warnWhenOptionsConflict( + $doNotFailOnNotice, + '--fail-on-notice', + '--do-not-fail-on-notice', + ); + + $failOnNotice = true; + + break; + + case '--fail-on-risky': + $this->warnWhenOptionsConflict( + $doNotFailOnRisky, + '--fail-on-risky', + '--do-not-fail-on-risky', + ); + + $failOnRisky = true; + + break; + + case '--fail-on-skipped': + $this->warnWhenOptionsConflict( + $doNotFailOnSkipped, + '--fail-on-skipped', + '--do-not-fail-on-skipped', + ); + + $failOnSkipped = true; + + break; + + case '--fail-on-warning': + $this->warnWhenOptionsConflict( + $doNotFailOnWarning, + '--fail-on-warning', + '--do-not-fail-on-warning', + ); + + $failOnWarning = true; + + break; + + case '--do-not-fail-on-deprecation': + $this->warnWhenOptionsConflict( + $failOnDeprecation, + '--do-not-fail-on-deprecation', + '--fail-on-deprecation', + ); + + $doNotFailOnDeprecation = true; + + break; + + case '--do-not-fail-on-phpunit-deprecation': + $this->warnWhenOptionsConflict( + $failOnPhpunitDeprecation, + '--do-not-fail-on-phpunit-deprecation', + '--fail-on-phpunit-deprecation', + ); + + $doNotFailOnPhpunitDeprecation = true; + + break; + + case '--do-not-fail-on-phpunit-warning': + $this->warnWhenOptionsConflict( + $failOnPhpunitWarning, + '--do-not-fail-on-phpunit-warning', + '--fail-on-phpunit-warning', + ); + + $doNotFailOnPhpunitWarning = true; + + break; + + case '--do-not-fail-on-empty-test-suite': + $this->warnWhenOptionsConflict( + $failOnEmptyTestSuite, + '--do-not-fail-on-empty-test-suite', + '--fail-on-empty-test-suite', + ); + + $doNotFailOnEmptyTestSuite = true; + + break; + + case '--do-not-fail-on-incomplete': + $this->warnWhenOptionsConflict( + $failOnIncomplete, + '--do-not-fail-on-incomplete', + '--fail-on-incomplete', + ); + + $doNotFailOnIncomplete = true; + + break; + + case '--do-not-fail-on-notice': + $this->warnWhenOptionsConflict( + $failOnNotice, + '--do-not-fail-on-notice', + '--fail-on-notice', + ); + + $doNotFailOnNotice = true; + + break; + + case '--do-not-fail-on-risky': + $this->warnWhenOptionsConflict( + $failOnRisky, + '--do-not-fail-on-risky', + '--fail-on-risky', + ); + + $doNotFailOnRisky = true; + + break; + + case '--do-not-fail-on-skipped': + $this->warnWhenOptionsConflict( + $failOnSkipped, + '--do-not-fail-on-skipped', + '--fail-on-skipped', + ); + + $doNotFailOnSkipped = true; + + break; + + case '--do-not-fail-on-warning': + $this->warnWhenOptionsConflict( + $failOnWarning, + '--do-not-fail-on-warning', + '--fail-on-warning', + ); + + $doNotFailOnWarning = true; + + break; + case '--stop-on-defect': $stopOnDefect = true; break; + case '--stop-on-deprecation': + $stopOnDeprecation = true; + + break; + case '--stop-on-error': $stopOnError = true; @@ -519,13 +818,13 @@ final class Builder break; - case '--stop-on-warning': - $stopOnWarning = true; + case '--stop-on-incomplete': + $stopOnIncomplete = true; break; - case '--stop-on-incomplete': - $stopOnIncomplete = true; + case '--stop-on-notice': + $stopOnNotice = true; break; @@ -539,28 +838,8 @@ final class Builder break; - case '--fail-on-empty-test-suite': - $failOnEmptyTestSuite = true; - - break; - - case '--fail-on-incomplete': - $failOnIncomplete = true; - - break; - - case '--fail-on-risky': - $failOnRisky = true; - - break; - - case '--fail-on-skipped': - $failOnSkipped = true; - - break; - - case '--fail-on-warning': - $failOnWarning = true; + case '--stop-on-warning': + $stopOnWarning = true; break; @@ -639,6 +918,7 @@ final class Builder break; + case '--do-not-report-useless-tests': case '--dont-report-useless-tests': $reportUselessTests = false; @@ -664,6 +944,11 @@ final class Builder break; + case '--display-all-issues': + $displayAllIssues = true; + + break; + case '--display-incomplete': $displayIncomplete = true; @@ -679,6 +964,11 @@ final class Builder break; + case '--display-phpunit-deprecations': + $displayPhpunitDeprecations = true; + + break; + case '--display-errors': $displayErrors = true; @@ -709,6 +999,11 @@ final class Builder break; + case '--check-php-configuration': + $checkPhpConfiguration = true; + + break; + case '--check-version': $checkVersion = true; @@ -721,6 +1016,8 @@ final class Builder $coverageFilter[] = $option[1]; + $optionAllowedMultipleTimes = true; + break; case '--random-order': @@ -749,14 +1046,41 @@ final class Builder break; case '--log-events-text': - $logEventsText = $option[1]; + $logEventsText = Filesystem::resolveStreamOrFile($option[1]); + + if ($logEventsText === false) { + throw new Exception( + sprintf( + 'The path "%s" specified for the --log-events-text option could not be resolved', + $option[1], + ), + ); + } break; case '--log-events-verbose-text': - $logEventsVerboseText = $option[1]; + $logEventsVerboseText = Filesystem::resolveStreamOrFile($option[1]); + + if ($logEventsVerboseText === false) { + throw new Exception( + sprintf( + 'The path "%s" specified for the --log-events-verbose-text option could not be resolved', + $option[1], + ), + ); + } break; + + case '--debug': + $debug = true; + + break; + } + + if (!$optionAllowedMultipleTimes) { + $this->markProcessed($option[0]); } } @@ -769,7 +1093,7 @@ final class Builder } return new Configuration( - $argument, + $options[1], $atLeastVersion, $backupGlobals, $backupStaticProperties, @@ -778,6 +1102,7 @@ final class Builder $cacheDirectory, $cacheResult, $cacheResultFile, + $checkPhpConfiguration, $checkVersion, $colors, $columns, @@ -801,12 +1126,38 @@ final class Builder $excludeGroups, $executionOrder, $executionOrderDefects, + $failOnAllIssues, + $failOnDeprecation, + $failOnPhpunitDeprecation, + $failOnPhpunitWarning, $failOnEmptyTestSuite, $failOnIncomplete, + $failOnNotice, $failOnRisky, $failOnSkipped, $failOnWarning, + $doNotFailOnDeprecation, + $doNotFailOnPhpunitDeprecation, + $doNotFailOnPhpunitWarning, + $doNotFailOnEmptyTestSuite, + $doNotFailOnIncomplete, + $doNotFailOnNotice, + $doNotFailOnRisky, + $doNotFailOnSkipped, + $doNotFailOnWarning, + $stopOnDefect, + $stopOnDeprecation, + $stopOnError, + $stopOnFailure, + $stopOnIncomplete, + $stopOnNotice, + $stopOnRisky, + $stopOnSkipped, + $stopOnWarning, $filter, + $generateBaseline, + $useBaseline, + $ignoreBaseline, $generateConfiguration, $migrateConfiguration, $groups, @@ -833,13 +1184,6 @@ final class Builder $reverseList, $stderr, $strictCoverage, - $stopOnDefect, - $stopOnError, - $stopOnFailure, - $stopOnIncomplete, - $stopOnRisky, - $stopOnSkipped, - $stopOnWarning, $teamcityLogfile, $testdoxHtmlFile, $testdoxTextFile, @@ -847,9 +1191,11 @@ final class Builder $testSuite, $excludeTestSuite, $useDefaultConfiguration, + $displayAllIssues, $displayIncomplete, $displaySkipped, $displayDeprecations, + $displayPhpunitDeprecations, $displayErrors, $displayNotices, $displayWarnings, @@ -858,7 +1204,49 @@ final class Builder $logEventsText, $logEventsVerboseText, $printerTeamCity, - $printerTestDox + $printerTestDox, + $debug, + ); + } + + /** + * @psalm-param non-empty-string $option + */ + private function markProcessed(string $option): void + { + if (!isset($this->processed[$option])) { + $this->processed[$option] = 1; + + return; + } + + $this->processed[$option]++; + + if ($this->processed[$option] === 2) { + EventFacade::emitter()->testRunnerTriggeredPhpunitWarning( + sprintf( + 'Option %s cannot be used more than once', + $option, + ), + ); + } + } + + /** + * @psalm-param non-empty-string $option + */ + private function warnWhenOptionsConflict(?bool $current, string $option, string $opposite): void + { + if ($current === null) { + return; + } + + EventFacade::emitter()->testRunnerTriggeredPhpunitWarning( + sprintf( + 'Options %s and %s cannot be used together', + $option, + $opposite, + ), ); } } diff --git a/vendor/phpunit/phpunit/src/TextUI/Configuration/Cli/Configuration.php b/vendor/phpunit/phpunit/src/TextUI/Configuration/Cli/Configuration.php index 4b68fd51..f243003a 100644 --- a/vendor/phpunit/phpunit/src/TextUI/Configuration/Cli/Configuration.php +++ b/vendor/phpunit/phpunit/src/TextUI/Configuration/Cli/Configuration.php @@ -10,13 +10,18 @@ namespace PHPUnit\TextUI\CliArguments; /** + * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit + * * @internal This class is not covered by the backward compatibility promise for PHPUnit * * @psalm-immutable */ final class Configuration { - private readonly ?string $argument; + /** + * @psalm-var list + */ + private readonly array $arguments; private readonly ?string $atLeastVersion; private readonly ?bool $backupGlobals; private readonly ?bool $backupStaticProperties; @@ -25,6 +30,7 @@ final class Configuration private readonly ?string $cacheDirectory; private readonly ?bool $cacheResult; private readonly ?string $cacheResultFile; + private readonly bool $checkPhpConfiguration; private readonly bool $checkVersion; private readonly ?string $colors; private readonly null|int|string $columns; @@ -49,12 +55,38 @@ final class Configuration private readonly ?array $excludeGroups; private readonly ?int $executionOrder; private readonly ?int $executionOrderDefects; + private readonly ?bool $failOnAllIssues; + private readonly ?bool $failOnDeprecation; + private readonly ?bool $failOnPhpunitDeprecation; + private readonly ?bool $failOnPhpunitWarning; private readonly ?bool $failOnEmptyTestSuite; private readonly ?bool $failOnIncomplete; + private readonly ?bool $failOnNotice; private readonly ?bool $failOnRisky; private readonly ?bool $failOnSkipped; private readonly ?bool $failOnWarning; + private readonly ?bool $doNotFailOnDeprecation; + private readonly ?bool $doNotFailOnPhpunitDeprecation; + private readonly ?bool $doNotFailOnPhpunitWarning; + private readonly ?bool $doNotFailOnEmptyTestSuite; + private readonly ?bool $doNotFailOnIncomplete; + private readonly ?bool $doNotFailOnNotice; + private readonly ?bool $doNotFailOnRisky; + private readonly ?bool $doNotFailOnSkipped; + private readonly ?bool $doNotFailOnWarning; + private readonly ?bool $stopOnDefect; + private readonly ?bool $stopOnDeprecation; + private readonly ?bool $stopOnError; + private readonly ?bool $stopOnFailure; + private readonly ?bool $stopOnIncomplete; + private readonly ?bool $stopOnNotice; + private readonly ?bool $stopOnRisky; + private readonly ?bool $stopOnSkipped; + private readonly ?bool $stopOnWarning; private readonly ?string $filter; + private readonly ?string $generateBaseline; + private readonly ?string $useBaseline; + private readonly bool $ignoreBaseline; private readonly bool $generateConfiguration; private readonly bool $migrateConfiguration; private readonly ?array $groups; @@ -81,13 +113,6 @@ final class Configuration private readonly ?bool $reverseList; private readonly ?bool $stderr; private readonly ?bool $strictCoverage; - private readonly ?bool $stopOnDefect; - private readonly ?bool $stopOnError; - private readonly ?bool $stopOnFailure; - private readonly ?bool $stopOnIncomplete; - private readonly ?bool $stopOnRisky; - private readonly ?bool $stopOnSkipped; - private readonly ?bool $stopOnWarning; private readonly ?string $teamcityLogfile; private readonly ?bool $teamCityPrinter; private readonly ?string $testdoxHtmlFile; @@ -95,28 +120,32 @@ final class Configuration private readonly ?bool $testdoxPrinter; /** - * @psalm-var ?non-empty-list + * @psalm-var ?non-empty-list */ private readonly ?array $testSuffixes; private readonly ?string $testSuite; private readonly ?string $excludeTestSuite; private readonly bool $useDefaultConfiguration; + private readonly ?bool $displayDetailsOnAllIssues; private readonly ?bool $displayDetailsOnIncompleteTests; private readonly ?bool $displayDetailsOnSkippedTests; private readonly ?bool $displayDetailsOnTestsThatTriggerDeprecations; + private readonly ?bool $displayDetailsOnPhpunitDeprecations; private readonly ?bool $displayDetailsOnTestsThatTriggerErrors; private readonly ?bool $displayDetailsOnTestsThatTriggerNotices; private readonly ?bool $displayDetailsOnTestsThatTriggerWarnings; private readonly bool $version; private readonly ?string $logEventsText; private readonly ?string $logEventsVerboseText; + private readonly bool $debug; /** - * @psalm-param ?non-empty-list $testSuffixes + * @psalm-param list $arguments + * @psalm-param ?non-empty-list $testSuffixes */ - public function __construct(?string $argument, ?string $atLeastVersion, ?bool $backupGlobals, ?bool $backupStaticProperties, ?bool $beStrictAboutChangesToGlobalState, ?string $bootstrap, ?string $cacheDirectory, ?bool $cacheResult, ?string $cacheResultFile, bool $checkVersion, ?string $colors, null|int|string $columns, ?string $configurationFile, ?string $coverageClover, ?string $coverageCobertura, ?string $coverageCrap4J, ?string $coverageHtml, ?string $coveragePhp, ?string $coverageText, ?bool $coverageTextShowUncoveredFiles, ?bool $coverageTextShowOnlySummary, ?string $coverageXml, ?bool $pathCoverage, ?string $coverageCacheDirectory, bool $warmCoverageCache, ?int $defaultTimeLimit, ?bool $disableCodeCoverageIgnore, ?bool $disallowTestOutput, ?bool $enforceTimeLimit, ?array $excludeGroups, ?int $executionOrder, ?int $executionOrderDefects, ?bool $failOnEmptyTestSuite, ?bool $failOnIncomplete, ?bool $failOnRisky, ?bool $failOnSkipped, ?bool $failOnWarning, ?string $filter, bool $generateConfiguration, bool $migrateConfiguration, ?array $groups, ?array $testsCovering, ?array $testsUsing, bool $help, ?string $includePath, ?array $iniSettings, ?string $junitLogfile, bool $listGroups, bool $listSuites, bool $listTests, ?string $listTestsXml, ?bool $noCoverage, ?bool $noExtensions, ?bool $noOutput, ?bool $noProgress, ?bool $noResults, ?bool $noLogging, ?bool $processIsolation, ?int $randomOrderSeed, ?bool $reportUselessTests, ?bool $resolveDependencies, ?bool $reverseList, ?bool $stderr, ?bool $strictCoverage, ?bool $stopOnDefect, ?bool $stopOnError, ?bool $stopOnFailure, ?bool $stopOnIncomplete, ?bool $stopOnRisky, ?bool $stopOnSkipped, ?bool $stopOnWarning, ?string $teamcityLogfile, ?string $testdoxHtmlFile, ?string $testdoxTextFile, ?array $testSuffixes, ?string $testSuite, ?string $excludeTestSuite, bool $useDefaultConfiguration, ?bool $displayDetailsOnIncompleteTests, ?bool $displayDetailsOnSkippedTests, ?bool $displayDetailsOnTestsThatTriggerDeprecations, ?bool $displayDetailsOnTestsThatTriggerErrors, ?bool $displayDetailsOnTestsThatTriggerNotices, ?bool $displayDetailsOnTestsThatTriggerWarnings, bool $version, ?array $coverageFilter, ?string $logEventsText, ?string $logEventsVerboseText, ?bool $printerTeamCity, ?bool $printerTestDox) + public function __construct(array $arguments, ?string $atLeastVersion, ?bool $backupGlobals, ?bool $backupStaticProperties, ?bool $beStrictAboutChangesToGlobalState, ?string $bootstrap, ?string $cacheDirectory, ?bool $cacheResult, ?string $cacheResultFile, bool $checkPhpConfiguration, bool $checkVersion, ?string $colors, null|int|string $columns, ?string $configurationFile, ?string $coverageClover, ?string $coverageCobertura, ?string $coverageCrap4J, ?string $coverageHtml, ?string $coveragePhp, ?string $coverageText, ?bool $coverageTextShowUncoveredFiles, ?bool $coverageTextShowOnlySummary, ?string $coverageXml, ?bool $pathCoverage, ?string $coverageCacheDirectory, bool $warmCoverageCache, ?int $defaultTimeLimit, ?bool $disableCodeCoverageIgnore, ?bool $disallowTestOutput, ?bool $enforceTimeLimit, ?array $excludeGroups, ?int $executionOrder, ?int $executionOrderDefects, ?bool $failOnAllIssues, ?bool $failOnDeprecation, ?bool $failOnPhpunitDeprecation, ?bool $failOnPhpunitWarning, ?bool $failOnEmptyTestSuite, ?bool $failOnIncomplete, ?bool $failOnNotice, ?bool $failOnRisky, ?bool $failOnSkipped, ?bool $failOnWarning, ?bool $doNotFailOnDeprecation, ?bool $doNotFailOnPhpunitDeprecation, ?bool $doNotFailOnPhpunitWarning, ?bool $doNotFailOnEmptyTestSuite, ?bool $doNotFailOnIncomplete, ?bool $doNotFailOnNotice, ?bool $doNotFailOnRisky, ?bool $doNotFailOnSkipped, ?bool $doNotFailOnWarning, ?bool $stopOnDefect, ?bool $stopOnDeprecation, ?bool $stopOnError, ?bool $stopOnFailure, ?bool $stopOnIncomplete, ?bool $stopOnNotice, ?bool $stopOnRisky, ?bool $stopOnSkipped, ?bool $stopOnWarning, ?string $filter, ?string $generateBaseline, ?string $useBaseline, bool $ignoreBaseline, bool $generateConfiguration, bool $migrateConfiguration, ?array $groups, ?array $testsCovering, ?array $testsUsing, bool $help, ?string $includePath, ?array $iniSettings, ?string $junitLogfile, bool $listGroups, bool $listSuites, bool $listTests, ?string $listTestsXml, ?bool $noCoverage, ?bool $noExtensions, ?bool $noOutput, ?bool $noProgress, ?bool $noResults, ?bool $noLogging, ?bool $processIsolation, ?int $randomOrderSeed, ?bool $reportUselessTests, ?bool $resolveDependencies, ?bool $reverseList, ?bool $stderr, ?bool $strictCoverage, ?string $teamcityLogfile, ?string $testdoxHtmlFile, ?string $testdoxTextFile, ?array $testSuffixes, ?string $testSuite, ?string $excludeTestSuite, bool $useDefaultConfiguration, ?bool $displayDetailsOnAllIssues, ?bool $displayDetailsOnIncompleteTests, ?bool $displayDetailsOnSkippedTests, ?bool $displayDetailsOnTestsThatTriggerDeprecations, ?bool $displayDetailsOnPhpunitDeprecations, ?bool $displayDetailsOnTestsThatTriggerErrors, ?bool $displayDetailsOnTestsThatTriggerNotices, ?bool $displayDetailsOnTestsThatTriggerWarnings, bool $version, ?array $coverageFilter, ?string $logEventsText, ?string $logEventsVerboseText, ?bool $printerTeamCity, ?bool $printerTestDox, bool $debug) { - $this->argument = $argument; + $this->arguments = $arguments; $this->atLeastVersion = $atLeastVersion; $this->backupGlobals = $backupGlobals; $this->backupStaticProperties = $backupStaticProperties; @@ -125,6 +154,7 @@ final class Configuration $this->cacheDirectory = $cacheDirectory; $this->cacheResult = $cacheResult; $this->cacheResultFile = $cacheResultFile; + $this->checkPhpConfiguration = $checkPhpConfiguration; $this->checkVersion = $checkVersion; $this->colors = $colors; $this->columns = $columns; @@ -149,12 +179,38 @@ final class Configuration $this->excludeGroups = $excludeGroups; $this->executionOrder = $executionOrder; $this->executionOrderDefects = $executionOrderDefects; + $this->failOnAllIssues = $failOnAllIssues; + $this->failOnDeprecation = $failOnDeprecation; + $this->failOnPhpunitDeprecation = $failOnPhpunitDeprecation; + $this->failOnPhpunitWarning = $failOnPhpunitWarning; $this->failOnEmptyTestSuite = $failOnEmptyTestSuite; $this->failOnIncomplete = $failOnIncomplete; + $this->failOnNotice = $failOnNotice; $this->failOnRisky = $failOnRisky; $this->failOnSkipped = $failOnSkipped; $this->failOnWarning = $failOnWarning; + $this->doNotFailOnDeprecation = $doNotFailOnDeprecation; + $this->doNotFailOnPhpunitDeprecation = $doNotFailOnPhpunitDeprecation; + $this->doNotFailOnPhpunitWarning = $doNotFailOnPhpunitWarning; + $this->doNotFailOnEmptyTestSuite = $doNotFailOnEmptyTestSuite; + $this->doNotFailOnIncomplete = $doNotFailOnIncomplete; + $this->doNotFailOnNotice = $doNotFailOnNotice; + $this->doNotFailOnRisky = $doNotFailOnRisky; + $this->doNotFailOnSkipped = $doNotFailOnSkipped; + $this->doNotFailOnWarning = $doNotFailOnWarning; + $this->stopOnDefect = $stopOnDefect; + $this->stopOnDeprecation = $stopOnDeprecation; + $this->stopOnError = $stopOnError; + $this->stopOnFailure = $stopOnFailure; + $this->stopOnIncomplete = $stopOnIncomplete; + $this->stopOnNotice = $stopOnNotice; + $this->stopOnRisky = $stopOnRisky; + $this->stopOnSkipped = $stopOnSkipped; + $this->stopOnWarning = $stopOnWarning; $this->filter = $filter; + $this->generateBaseline = $generateBaseline; + $this->useBaseline = $useBaseline; + $this->ignoreBaseline = $ignoreBaseline; $this->generateConfiguration = $generateConfiguration; $this->migrateConfiguration = $migrateConfiguration; $this->groups = $groups; @@ -181,13 +237,6 @@ final class Configuration $this->reverseList = $reverseList; $this->stderr = $stderr; $this->strictCoverage = $strictCoverage; - $this->stopOnDefect = $stopOnDefect; - $this->stopOnError = $stopOnError; - $this->stopOnFailure = $stopOnFailure; - $this->stopOnIncomplete = $stopOnIncomplete; - $this->stopOnRisky = $stopOnRisky; - $this->stopOnSkipped = $stopOnSkipped; - $this->stopOnWarning = $stopOnWarning; $this->teamcityLogfile = $teamcityLogfile; $this->testdoxHtmlFile = $testdoxHtmlFile; $this->testdoxTextFile = $testdoxTextFile; @@ -195,9 +244,11 @@ final class Configuration $this->testSuite = $testSuite; $this->excludeTestSuite = $excludeTestSuite; $this->useDefaultConfiguration = $useDefaultConfiguration; + $this->displayDetailsOnAllIssues = $displayDetailsOnAllIssues; $this->displayDetailsOnIncompleteTests = $displayDetailsOnIncompleteTests; $this->displayDetailsOnSkippedTests = $displayDetailsOnSkippedTests; $this->displayDetailsOnTestsThatTriggerDeprecations = $displayDetailsOnTestsThatTriggerDeprecations; + $this->displayDetailsOnPhpunitDeprecations = $displayDetailsOnPhpunitDeprecations; $this->displayDetailsOnTestsThatTriggerErrors = $displayDetailsOnTestsThatTriggerErrors; $this->displayDetailsOnTestsThatTriggerNotices = $displayDetailsOnTestsThatTriggerNotices; $this->displayDetailsOnTestsThatTriggerWarnings = $displayDetailsOnTestsThatTriggerWarnings; @@ -206,26 +257,15 @@ final class Configuration $this->logEventsVerboseText = $logEventsVerboseText; $this->teamCityPrinter = $printerTeamCity; $this->testdoxPrinter = $printerTestDox; + $this->debug = $debug; } /** - * @psalm-assert-if-true !null $this->argument + * @psalm-return list */ - public function hasArgument(): bool + public function arguments(): array { - return $this->argument !== null; - } - - /** - * @throws Exception - */ - public function argument(): string - { - if (!$this->hasArgument()) { - throw new Exception; - } - - return $this->argument; + return $this->arguments; } /** @@ -370,6 +410,8 @@ final class Configuration /** * @psalm-assert-if-true !null $this->cacheResultFile + * + * @deprecated */ public function hasCacheResultFile(): bool { @@ -378,6 +420,8 @@ final class Configuration /** * @throws Exception + * + * @deprecated */ public function cacheResultFile(): string { @@ -388,6 +432,11 @@ final class Configuration return $this->cacheResultFile; } + public function checkPhpConfiguration(): bool + { + return $this->checkPhpConfiguration; + } + public function checkVersion(): bool { return $this->checkVersion; @@ -675,6 +724,8 @@ final class Configuration /** * @psalm-assert-if-true !null $this->coverageCacheDirectory + * + * @deprecated */ public function hasCoverageCacheDirectory(): bool { @@ -683,6 +734,8 @@ final class Configuration /** * @throws Exception + * + * @deprecated */ public function coverageCacheDirectory(): string { @@ -838,6 +891,86 @@ final class Configuration return $this->executionOrderDefects; } + /** + * @psalm-assert-if-true !null $this->failOnAllIssues + */ + public function hasFailOnAllIssues(): bool + { + return $this->failOnAllIssues !== null; + } + + /** + * @throws Exception + */ + public function failOnAllIssues(): bool + { + if (!$this->hasFailOnAllIssues()) { + throw new Exception; + } + + return $this->failOnAllIssues; + } + + /** + * @psalm-assert-if-true !null $this->failOnDeprecation + */ + public function hasFailOnDeprecation(): bool + { + return $this->failOnDeprecation !== null; + } + + /** + * @throws Exception + */ + public function failOnDeprecation(): bool + { + if (!$this->hasFailOnDeprecation()) { + throw new Exception; + } + + return $this->failOnDeprecation; + } + + /** + * @psalm-assert-if-true !null $this->failOnPhpunitDeprecation + */ + public function hasFailOnPhpunitDeprecation(): bool + { + return $this->failOnPhpunitDeprecation !== null; + } + + /** + * @throws Exception + */ + public function failOnPhpunitDeprecation(): bool + { + if (!$this->hasFailOnPhpunitDeprecation()) { + throw new Exception; + } + + return $this->failOnPhpunitDeprecation; + } + + /** + * @psalm-assert-if-true !null $this->failOnPhpunitWarning + */ + public function hasFailOnPhpunitWarning(): bool + { + return $this->failOnPhpunitWarning !== null; + } + + /** + * @throws Exception + */ + public function failOnPhpunitWarning(): bool + { + if (!$this->hasFailOnPhpunitWarning()) { + throw new Exception; + } + + return $this->failOnPhpunitWarning; + } + /** * @psalm-assert-if-true !null $this->failOnEmptyTestSuite */ @@ -878,6 +1011,26 @@ final class Configuration return $this->failOnIncomplete; } + /** + * @psalm-assert-if-true !null $this->failOnNotice + */ + public function hasFailOnNotice(): bool + { + return $this->failOnNotice !== null; + } + + /** + * @throws Exception + */ + public function failOnNotice(): bool + { + if (!$this->hasFailOnNotice()) { + throw new Exception; + } + + return $this->failOnNotice; + } + /** * @psalm-assert-if-true !null $this->failOnRisky */ @@ -938,6 +1091,366 @@ final class Configuration return $this->failOnWarning; } + /** + * @psalm-assert-if-true !null $this->doNotFailOnDeprecation + */ + public function hasDoNotFailOnDeprecation(): bool + { + return $this->doNotFailOnDeprecation !== null; + } + + /** + * @throws Exception + */ + public function doNotFailOnDeprecation(): bool + { + if (!$this->hasDoNotFailOnDeprecation()) { + throw new Exception; + } + + return $this->doNotFailOnDeprecation; + } + + /** + * @psalm-assert-if-true !null $this->doNotFailOnPhpunitDeprecation + */ + public function hasDoNotFailOnPhpunitDeprecation(): bool + { + return $this->doNotFailOnPhpunitDeprecation !== null; + } + + /** + * @throws Exception + */ + public function doNotFailOnPhpunitDeprecation(): bool + { + if (!$this->hasDoNotFailOnPhpunitDeprecation()) { + throw new Exception; + } + + return $this->doNotFailOnPhpunitDeprecation; + } + + /** + * @psalm-assert-if-true !null $this->doNotFailOnPhpunitWarning + */ + public function hasDoNotFailOnPhpunitWarning(): bool + { + return $this->doNotFailOnPhpunitWarning !== null; + } + + /** + * @throws Exception + */ + public function doNotFailOnPhpunitWarning(): bool + { + if (!$this->hasDoNotFailOnPhpunitWarning()) { + throw new Exception; + } + + return $this->doNotFailOnPhpunitWarning; + } + + /** + * @psalm-assert-if-true !null $this->doNotFailOnEmptyTestSuite + */ + public function hasDoNotFailOnEmptyTestSuite(): bool + { + return $this->doNotFailOnEmptyTestSuite !== null; + } + + /** + * @throws Exception + */ + public function doNotFailOnEmptyTestSuite(): bool + { + if (!$this->hasDoNotFailOnEmptyTestSuite()) { + throw new Exception; + } + + return $this->doNotFailOnEmptyTestSuite; + } + + /** + * @psalm-assert-if-true !null $this->doNotFailOnIncomplete + */ + public function hasDoNotFailOnIncomplete(): bool + { + return $this->doNotFailOnIncomplete !== null; + } + + /** + * @throws Exception + */ + public function doNotFailOnIncomplete(): bool + { + if (!$this->hasDoNotFailOnIncomplete()) { + throw new Exception; + } + + return $this->doNotFailOnIncomplete; + } + + /** + * @psalm-assert-if-true !null $this->doNotFailOnNotice + */ + public function hasDoNotFailOnNotice(): bool + { + return $this->doNotFailOnNotice !== null; + } + + /** + * @throws Exception + */ + public function doNotFailOnNotice(): bool + { + if (!$this->hasDoNotFailOnNotice()) { + throw new Exception; + } + + return $this->doNotFailOnNotice; + } + + /** + * @psalm-assert-if-true !null $this->doNotFailOnRisky + */ + public function hasDoNotFailOnRisky(): bool + { + return $this->doNotFailOnRisky !== null; + } + + /** + * @throws Exception + */ + public function doNotFailOnRisky(): bool + { + if (!$this->hasDoNotFailOnRisky()) { + throw new Exception; + } + + return $this->doNotFailOnRisky; + } + + /** + * @psalm-assert-if-true !null $this->doNotFailOnSkipped + */ + public function hasDoNotFailOnSkipped(): bool + { + return $this->doNotFailOnSkipped !== null; + } + + /** + * @throws Exception + */ + public function doNotFailOnSkipped(): bool + { + if (!$this->hasDoNotFailOnSkipped()) { + throw new Exception; + } + + return $this->doNotFailOnSkipped; + } + + /** + * @psalm-assert-if-true !null $this->doNotFailOnWarning + */ + public function hasDoNotFailOnWarning(): bool + { + return $this->doNotFailOnWarning !== null; + } + + /** + * @throws Exception + */ + public function doNotFailOnWarning(): bool + { + if (!$this->hasDoNotFailOnWarning()) { + throw new Exception; + } + + return $this->doNotFailOnWarning; + } + + /** + * @psalm-assert-if-true !null $this->stopOnDefect + */ + public function hasStopOnDefect(): bool + { + return $this->stopOnDefect !== null; + } + + /** + * @throws Exception + */ + public function stopOnDefect(): bool + { + if (!$this->hasStopOnDefect()) { + throw new Exception; + } + + return $this->stopOnDefect; + } + + /** + * @psalm-assert-if-true !null $this->stopOnDeprecation + */ + public function hasStopOnDeprecation(): bool + { + return $this->stopOnDeprecation !== null; + } + + /** + * @throws Exception + */ + public function stopOnDeprecation(): bool + { + if (!$this->hasStopOnDeprecation()) { + throw new Exception; + } + + return $this->stopOnDeprecation; + } + + /** + * @psalm-assert-if-true !null $this->stopOnError + */ + public function hasStopOnError(): bool + { + return $this->stopOnError !== null; + } + + /** + * @throws Exception + */ + public function stopOnError(): bool + { + if (!$this->hasStopOnError()) { + throw new Exception; + } + + return $this->stopOnError; + } + + /** + * @psalm-assert-if-true !null $this->stopOnFailure + */ + public function hasStopOnFailure(): bool + { + return $this->stopOnFailure !== null; + } + + /** + * @throws Exception + */ + public function stopOnFailure(): bool + { + if (!$this->hasStopOnFailure()) { + throw new Exception; + } + + return $this->stopOnFailure; + } + + /** + * @psalm-assert-if-true !null $this->stopOnIncomplete + */ + public function hasStopOnIncomplete(): bool + { + return $this->stopOnIncomplete !== null; + } + + /** + * @throws Exception + */ + public function stopOnIncomplete(): bool + { + if (!$this->hasStopOnIncomplete()) { + throw new Exception; + } + + return $this->stopOnIncomplete; + } + + /** + * @psalm-assert-if-true !null $this->stopOnNotice + */ + public function hasStopOnNotice(): bool + { + return $this->stopOnNotice !== null; + } + + /** + * @throws Exception + */ + public function stopOnNotice(): bool + { + if (!$this->hasStopOnNotice()) { + throw new Exception; + } + + return $this->stopOnNotice; + } + + /** + * @psalm-assert-if-true !null $this->stopOnRisky + */ + public function hasStopOnRisky(): bool + { + return $this->stopOnRisky !== null; + } + + /** + * @throws Exception + */ + public function stopOnRisky(): bool + { + if (!$this->hasStopOnRisky()) { + throw new Exception; + } + + return $this->stopOnRisky; + } + + /** + * @psalm-assert-if-true !null $this->stopOnSkipped + */ + public function hasStopOnSkipped(): bool + { + return $this->stopOnSkipped !== null; + } + + /** + * @throws Exception + */ + public function stopOnSkipped(): bool + { + if (!$this->hasStopOnSkipped()) { + throw new Exception; + } + + return $this->stopOnSkipped; + } + + /** + * @psalm-assert-if-true !null $this->stopOnWarning + */ + public function hasStopOnWarning(): bool + { + return $this->stopOnWarning !== null; + } + + /** + * @throws Exception + */ + public function stopOnWarning(): bool + { + if (!$this->hasStopOnWarning()) { + throw new Exception; + } + + return $this->stopOnWarning; + } + /** * @psalm-assert-if-true !null $this->filter */ @@ -958,6 +1471,51 @@ final class Configuration return $this->filter; } + /** + * @psalm-assert-if-true !null $this->generateBaseline + */ + public function hasGenerateBaseline(): bool + { + return $this->generateBaseline !== null; + } + + /** + * @throws Exception + */ + public function generateBaseline(): string + { + if (!$this->hasGenerateBaseline()) { + throw new Exception; + } + + return $this->generateBaseline; + } + + /** + * @psalm-assert-if-true !null $this->useBaseline + */ + public function hasUseBaseline(): bool + { + return $this->useBaseline !== null; + } + + /** + * @throws Exception + */ + public function useBaseline(): string + { + if (!$this->hasUseBaseline()) { + throw new Exception; + } + + return $this->useBaseline; + } + + public function ignoreBaseline(): bool + { + return $this->ignoreBaseline; + } + public function generateConfiguration(): bool { return $this->generateConfiguration; @@ -1388,146 +1946,6 @@ final class Configuration return $this->strictCoverage; } - /** - * @psalm-assert-if-true !null $this->stopOnDefect - */ - public function hasStopOnDefect(): bool - { - return $this->stopOnDefect !== null; - } - - /** - * @throws Exception - */ - public function stopOnDefect(): bool - { - if (!$this->hasStopOnDefect()) { - throw new Exception; - } - - return $this->stopOnDefect; - } - - /** - * @psalm-assert-if-true !null $this->stopOnError - */ - public function hasStopOnError(): bool - { - return $this->stopOnError !== null; - } - - /** - * @throws Exception - */ - public function stopOnError(): bool - { - if (!$this->hasStopOnError()) { - throw new Exception; - } - - return $this->stopOnError; - } - - /** - * @psalm-assert-if-true !null $this->stopOnFailure - */ - public function hasStopOnFailure(): bool - { - return $this->stopOnFailure !== null; - } - - /** - * @throws Exception - */ - public function stopOnFailure(): bool - { - if (!$this->hasStopOnFailure()) { - throw new Exception; - } - - return $this->stopOnFailure; - } - - /** - * @psalm-assert-if-true !null $this->stopOnIncomplete - */ - public function hasStopOnIncomplete(): bool - { - return $this->stopOnIncomplete !== null; - } - - /** - * @throws Exception - */ - public function stopOnIncomplete(): bool - { - if (!$this->hasStopOnIncomplete()) { - throw new Exception; - } - - return $this->stopOnIncomplete; - } - - /** - * @psalm-assert-if-true !null $this->stopOnRisky - */ - public function hasStopOnRisky(): bool - { - return $this->stopOnRisky !== null; - } - - /** - * @throws Exception - */ - public function stopOnRisky(): bool - { - if (!$this->hasStopOnRisky()) { - throw new Exception; - } - - return $this->stopOnRisky; - } - - /** - * @psalm-assert-if-true !null $this->stopOnSkipped - */ - public function hasStopOnSkipped(): bool - { - return $this->stopOnSkipped !== null; - } - - /** - * @throws Exception - */ - public function stopOnSkipped(): bool - { - if (!$this->hasStopOnSkipped()) { - throw new Exception; - } - - return $this->stopOnSkipped; - } - - /** - * @psalm-assert-if-true !null $this->stopOnWarning - */ - public function hasStopOnWarning(): bool - { - return $this->stopOnWarning !== null; - } - - /** - * @throws Exception - */ - public function stopOnWarning(): bool - { - if (!$this->hasStopOnWarning()) { - throw new Exception; - } - - return $this->stopOnWarning; - } - /** * @psalm-assert-if-true !null $this->teamcityLogfile */ @@ -1637,9 +2055,9 @@ final class Configuration } /** - * @psalm-return non-empty-list - * * @throws Exception + * + * @psalm-return non-empty-list */ public function testSuffixes(): array { @@ -1695,6 +2113,26 @@ final class Configuration return $this->useDefaultConfiguration; } + /** + * @psalm-assert-if-true !null $this->displayDetailsOnAllIssues + */ + public function hasDisplayDetailsOnAllIssues(): bool + { + return $this->displayDetailsOnAllIssues !== null; + } + + /** + * @throws Exception + */ + public function displayDetailsOnAllIssues(): bool + { + if (!$this->hasDisplayDetailsOnAllIssues()) { + throw new Exception; + } + + return $this->displayDetailsOnAllIssues; + } + /** * @psalm-assert-if-true !null $this->displayDetailsOnIncompleteTests */ @@ -1755,6 +2193,26 @@ final class Configuration return $this->displayDetailsOnTestsThatTriggerDeprecations; } + /** + * @psalm-assert-if-true !null $this->displayDetailsOnPhpunitDeprecations + */ + public function hasDisplayDetailsOnPhpunitDeprecations(): bool + { + return $this->displayDetailsOnPhpunitDeprecations !== null; + } + + /** + * @throws Exception + */ + public function displayDetailsOnPhpunitDeprecations(): bool + { + if (!$this->hasDisplayDetailsOnPhpunitDeprecations()) { + throw new Exception; + } + + return $this->displayDetailsOnPhpunitDeprecations; + } + /** * @psalm-assert-if-true !null $this->displayDetailsOnTestsThatTriggerErrors */ @@ -1859,4 +2317,9 @@ final class Configuration return $this->logEventsVerboseText; } + + public function debug(): bool + { + return $this->debug; + } } diff --git a/vendor/phpunit/phpunit/src/TextUI/Configuration/Cli/Exception.php b/vendor/phpunit/phpunit/src/TextUI/Configuration/Cli/Exception.php index dd5536ea..0d9a5a00 100644 --- a/vendor/phpunit/phpunit/src/TextUI/Configuration/Cli/Exception.php +++ b/vendor/phpunit/phpunit/src/TextUI/Configuration/Cli/Exception.php @@ -12,6 +12,8 @@ namespace PHPUnit\TextUI\CliArguments; use RuntimeException; /** + * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit + * * @internal This class is not covered by the backward compatibility promise for PHPUnit */ final class Exception extends RuntimeException implements \PHPUnit\Exception diff --git a/vendor/phpunit/phpunit/src/TextUI/Configuration/Cli/XmlConfigurationFileFinder.php b/vendor/phpunit/phpunit/src/TextUI/Configuration/Cli/XmlConfigurationFileFinder.php index 01959282..03ac43a0 100644 --- a/vendor/phpunit/phpunit/src/TextUI/Configuration/Cli/XmlConfigurationFileFinder.php +++ b/vendor/phpunit/phpunit/src/TextUI/Configuration/Cli/XmlConfigurationFileFinder.php @@ -15,11 +15,13 @@ use function is_file; use function realpath; /** + * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit + * * @internal This class is not covered by the backward compatibility promise for PHPUnit */ final class XmlConfigurationFileFinder { - public function find(Configuration $configuration): string|false + public function find(Configuration $configuration): false|string { $useDefaultConfiguration = $configuration->useDefaultConfiguration(); @@ -27,7 +29,7 @@ final class XmlConfigurationFileFinder if (is_dir($configuration->configurationFile())) { $candidate = $this->configurationFileInDirectory($configuration->configurationFile()); - if ($candidate) { + if ($candidate !== false) { return $candidate; } @@ -40,7 +42,7 @@ final class XmlConfigurationFileFinder if ($useDefaultConfiguration) { $candidate = $this->configurationFileInDirectory(getcwd()); - if ($candidate) { + if ($candidate !== false) { return $candidate; } } @@ -48,7 +50,7 @@ final class XmlConfigurationFileFinder return false; } - private function configurationFileInDirectory(string $directory): string|false + private function configurationFileInDirectory(string $directory): false|string { $candidates = [ $directory . '/phpunit.xml', diff --git a/vendor/phpunit/phpunit/src/TextUI/Configuration/CodeCoverageFilterRegistry.php b/vendor/phpunit/phpunit/src/TextUI/Configuration/CodeCoverageFilterRegistry.php index 2e4e4b68..7051d284 100644 --- a/vendor/phpunit/phpunit/src/TextUI/Configuration/CodeCoverageFilterRegistry.php +++ b/vendor/phpunit/phpunit/src/TextUI/Configuration/CodeCoverageFilterRegistry.php @@ -9,6 +9,7 @@ */ namespace PHPUnit\TextUI\Configuration; +use function array_keys; use function assert; use SebastianBergmann\CodeCoverage\Filter; @@ -16,6 +17,8 @@ use SebastianBergmann\CodeCoverage\Filter; * CLI options and XML configuration are static within a single PHPUnit process. * It is therefore okay to use a Singleton registry here. * + * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit + * * @internal This class is not covered by the backward compatibility promise for PHPUnit */ final class CodeCoverageFilterRegistry @@ -33,6 +36,9 @@ final class CodeCoverageFilterRegistry return self::$instance; } + /** + * @codeCoverageIgnore + */ public function get(): Filter { assert($this->filter !== null); @@ -40,47 +46,31 @@ final class CodeCoverageFilterRegistry return $this->filter; } - public function init(Configuration $configuration): void + /** + * @codeCoverageIgnore + */ + public function init(Configuration $configuration, bool $force = false): void { - if (!$configuration->hasCoverageReport()) { + if (!$configuration->hasCoverageReport() && !$force) { return; } - if ($this->configured) { + if ($this->configured && !$force) { return; } $this->filter = new Filter; - if ($configuration->hasNonEmptyListOfFilesToBeIncludedInCodeCoverageReport()) { - foreach ($configuration->coverageIncludeDirectories() as $directory) { - $this->filter->includeDirectory( - $directory->path(), - $directory->suffix(), - $directory->prefix() - ); - } - - foreach ($configuration->coverageIncludeFiles() as $file) { - $this->filter->includeFile($file->path()); - } - - foreach ($configuration->coverageExcludeDirectories() as $directory) { - $this->filter->excludeDirectory( - $directory->path(), - $directory->suffix(), - $directory->prefix() - ); - } - - foreach ($configuration->coverageExcludeFiles() as $file) { - $this->filter->excludeFile($file->path()); - } + if ($configuration->source()->notEmpty()) { + $this->filter->includeFiles(array_keys((new SourceMapper)->map($configuration->source()))); $this->configured = true; } } + /** + * @codeCoverageIgnore + */ public function configured(): bool { return $this->configured; diff --git a/vendor/phpunit/phpunit/src/TextUI/Configuration/Configuration.php b/vendor/phpunit/phpunit/src/TextUI/Configuration/Configuration.php index d7a8d057..d209425d 100644 --- a/vendor/phpunit/phpunit/src/TextUI/Configuration/Configuration.php +++ b/vendor/phpunit/phpunit/src/TextUI/Configuration/Configuration.php @@ -16,23 +16,21 @@ namespace PHPUnit\TextUI\Configuration; */ final class Configuration { - public const COLOR_NEVER = 'never'; - - public const COLOR_AUTO = 'auto'; - - public const COLOR_ALWAYS = 'always'; - + public const COLOR_NEVER = 'never'; + public const COLOR_AUTO = 'auto'; + public const COLOR_ALWAYS = 'always'; public const COLOR_DEFAULT = self::COLOR_NEVER; - private readonly ?string $cliArgument; + + /** + * @psalm-var list + */ + private readonly array $cliArguments; private readonly ?string $configurationFile; private readonly ?string $bootstrap; private readonly bool $cacheResult; private readonly ?string $cacheDirectory; private readonly ?string $coverageCacheDirectory; - private readonly FilterDirectoryCollection $coverageIncludeDirectories; - private readonly FileCollection $coverageIncludeFiles; - private readonly FilterDirectoryCollection $coverageExcludeDirectories; - private readonly FileCollection $coverageExcludeFiles; + private readonly Source $source; private readonly bool $pathCoverage; private readonly ?string $coverageClover; private readonly ?string $coverageCobertura; @@ -55,14 +53,41 @@ final class Configuration private readonly string $testResultCacheFile; private readonly bool $ignoreDeprecatedCodeUnitsFromCodeCoverage; private readonly bool $disableCodeCoverageIgnore; + private readonly bool $failOnAllIssues; + private readonly bool $failOnDeprecation; + private readonly bool $failOnPhpunitDeprecation; + private readonly bool $failOnPhpunitWarning; private readonly bool $failOnEmptyTestSuite; private readonly bool $failOnIncomplete; + private readonly bool $failOnNotice; private readonly bool $failOnRisky; private readonly bool $failOnSkipped; private readonly bool $failOnWarning; + private readonly bool $doNotFailOnDeprecation; + private readonly bool $doNotFailOnPhpunitDeprecation; + private readonly bool $doNotFailOnPhpunitWarning; + private readonly bool $doNotFailOnEmptyTestSuite; + private readonly bool $doNotFailOnIncomplete; + private readonly bool $doNotFailOnNotice; + private readonly bool $doNotFailOnRisky; + private readonly bool $doNotFailOnSkipped; + private readonly bool $doNotFailOnWarning; + private readonly bool $stopOnDefect; + private readonly bool $stopOnDeprecation; + private readonly bool $stopOnError; + private readonly bool $stopOnFailure; + private readonly bool $stopOnIncomplete; + private readonly bool $stopOnNotice; + private readonly bool $stopOnRisky; + private readonly bool $stopOnSkipped; + private readonly bool $stopOnWarning; private readonly bool $outputToStandardErrorStream; private readonly int $columns; private readonly bool $noExtensions; + + /** + * @psalm-var ?non-empty-string + */ private readonly ?string $pharExtensionDirectory; /** @@ -74,13 +99,6 @@ final class Configuration private readonly bool $beStrictAboutChangesToGlobalState; private readonly bool $colors; private readonly bool $processIsolation; - private readonly bool $stopOnDefect; - private readonly bool $stopOnError; - private readonly bool $stopOnFailure; - private readonly bool $stopOnWarning; - private readonly bool $stopOnIncomplete; - private readonly bool $stopOnRisky; - private readonly bool $stopOnSkipped; private readonly bool $enforceTimeLimit; private readonly int $defaultTimeLimit; private readonly int $timeoutForSmallTests; @@ -89,9 +107,11 @@ final class Configuration private readonly bool $reportUselessTests; private readonly bool $strictCoverage; private readonly bool $disallowTestOutput; + private readonly bool $displayDetailsOnAllIssues; private readonly bool $displayDetailsOnIncompleteTests; private readonly bool $displayDetailsOnSkippedTests; private readonly bool $displayDetailsOnTestsThatTriggerDeprecations; + private readonly bool $displayDetailsOnPhpunitDeprecations; private readonly bool $displayDetailsOnTestsThatTriggerErrors; private readonly bool $displayDetailsOnTestsThatTriggerNotices; private readonly bool $displayDetailsOnTestsThatTriggerWarnings; @@ -125,27 +145,30 @@ final class Configuration private readonly ?string $defaultTestSuite; /** - * @psalm-var non-empty-list + * @psalm-var non-empty-list */ private readonly array $testSuffixes; private readonly Php $php; + private readonly bool $controlGarbageCollector; + private readonly int $numberOfTestsBeforeGarbageCollection; + private readonly ?string $generateBaseline; + private readonly bool $debug; /** - * @psalm-param non-empty-list $testSuffixes + * @psalm-param list $cliArguments + * @psalm-param ?non-empty-string $pharExtensionDirectory + * @psalm-param non-empty-list $testSuffixes * @psalm-param list}> $extensionBootstrappers */ - public function __construct(?string $cliArgument, ?string $configurationFile, ?string $bootstrap, bool $cacheResult, ?string $cacheDirectory, ?string $coverageCacheDirectory, FilterDirectoryCollection $coverageIncludeDirectories, FileCollection $coverageIncludeFiles, FilterDirectoryCollection $coverageExcludeDirectories, FileCollection $coverageExcludeFiles, string $testResultCacheFile, ?string $coverageClover, ?string $coverageCobertura, ?string $coverageCrap4j, int $coverageCrap4jThreshold, ?string $coverageHtml, int $coverageHtmlLowUpperBound, int $coverageHtmlHighLowerBound, string $coverageHtmlColorSuccessLow, string $coverageHtmlColorSuccessMedium, string $coverageHtmlColorSuccessHigh, string $coverageHtmlColorWarning, string $coverageHtmlColorDanger, ?string $coverageHtmlCustomCssFile, ?string $coveragePhp, ?string $coverageText, bool $coverageTextShowUncoveredFiles, bool $coverageTextShowOnlySummary, ?string $coverageXml, bool $pathCoverage, bool $ignoreDeprecatedCodeUnitsFromCodeCoverage, bool $disableCodeCoverageIgnore, bool $failOnEmptyTestSuite, bool $failOnIncomplete, bool $failOnRisky, bool $failOnSkipped, bool $failOnWarning, bool $outputToStandardErrorStream, int|string $columns, bool $noExtensions, ?string $pharExtensionDirectory, array $extensionBootstrappers, bool $backupGlobals, bool $backupStaticProperties, bool $beStrictAboutChangesToGlobalState, bool $colors, bool $processIsolation, bool $stopOnDefect, bool $stopOnError, bool $stopOnFailure, bool $stopOnWarning, bool $stopOnIncomplete, bool $stopOnRisky, bool $stopOnSkipped, bool $enforceTimeLimit, int $defaultTimeLimit, int $timeoutForSmallTests, int $timeoutForMediumTests, int $timeoutForLargeTests, bool $reportUselessTests, bool $strictCoverage, bool $disallowTestOutput, bool $displayDetailsOnIncompleteTests, bool $displayDetailsOnSkippedTests, bool $displayDetailsOnTestsThatTriggerDeprecations, bool $displayDetailsOnTestsThatTriggerErrors, bool $displayDetailsOnTestsThatTriggerNotices, bool $displayDetailsOnTestsThatTriggerWarnings, bool $reverseDefectList, bool $requireCoverageMetadata, bool $registerMockObjectsFromTestArgumentsRecursively, bool $noProgress, bool $noResults, bool $noOutput, int $executionOrder, int $executionOrderDefects, bool $resolveDependencies, ?string $logfileTeamcity, ?string $logfileJunit, ?string $logfileTestdoxHtml, ?string $logfileTestdoxText, ?string $logEventsText, ?string $logEventsVerboseText, bool $teamCityOutput, bool $testDoxOutput, ?array $testsCovering, ?array $testsUsing, ?string $filter, ?array $groups, ?array $excludeGroups, int $randomOrderSeed, bool $includeUncoveredFiles, TestSuiteCollection $testSuite, string $includeTestSuite, string $excludeTestSuite, ?string $defaultTestSuite, array $testSuffixes, Php $php) + public function __construct(array $cliArguments, ?string $configurationFile, ?string $bootstrap, bool $cacheResult, ?string $cacheDirectory, ?string $coverageCacheDirectory, Source $source, string $testResultCacheFile, ?string $coverageClover, ?string $coverageCobertura, ?string $coverageCrap4j, int $coverageCrap4jThreshold, ?string $coverageHtml, int $coverageHtmlLowUpperBound, int $coverageHtmlHighLowerBound, string $coverageHtmlColorSuccessLow, string $coverageHtmlColorSuccessMedium, string $coverageHtmlColorSuccessHigh, string $coverageHtmlColorWarning, string $coverageHtmlColorDanger, ?string $coverageHtmlCustomCssFile, ?string $coveragePhp, ?string $coverageText, bool $coverageTextShowUncoveredFiles, bool $coverageTextShowOnlySummary, ?string $coverageXml, bool $pathCoverage, bool $ignoreDeprecatedCodeUnitsFromCodeCoverage, bool $disableCodeCoverageIgnore, bool $failOnAllIssues, bool $failOnDeprecation, bool $failOnPhpunitDeprecation, bool $failOnPhpunitWarning, bool $failOnEmptyTestSuite, bool $failOnIncomplete, bool $failOnNotice, bool $failOnRisky, bool $failOnSkipped, bool $failOnWarning, bool $doNotFailOnDeprecation, bool $doNotFailOnPhpunitDeprecation, bool $doNotFailOnPhpunitWarning, bool $doNotFailOnEmptyTestSuite, bool $doNotFailOnIncomplete, bool $doNotFailOnNotice, bool $doNotFailOnRisky, bool $doNotFailOnSkipped, bool $doNotFailOnWarning, bool $stopOnDefect, bool $stopOnDeprecation, bool $stopOnError, bool $stopOnFailure, bool $stopOnIncomplete, bool $stopOnNotice, bool $stopOnRisky, bool $stopOnSkipped, bool $stopOnWarning, bool $outputToStandardErrorStream, int|string $columns, bool $noExtensions, ?string $pharExtensionDirectory, array $extensionBootstrappers, bool $backupGlobals, bool $backupStaticProperties, bool $beStrictAboutChangesToGlobalState, bool $colors, bool $processIsolation, bool $enforceTimeLimit, int $defaultTimeLimit, int $timeoutForSmallTests, int $timeoutForMediumTests, int $timeoutForLargeTests, bool $reportUselessTests, bool $strictCoverage, bool $disallowTestOutput, bool $displayDetailsOnAllIssues, bool $displayDetailsOnIncompleteTests, bool $displayDetailsOnSkippedTests, bool $displayDetailsOnTestsThatTriggerDeprecations, bool $displayDetailsOnPhpunitDeprecations, bool $displayDetailsOnTestsThatTriggerErrors, bool $displayDetailsOnTestsThatTriggerNotices, bool $displayDetailsOnTestsThatTriggerWarnings, bool $reverseDefectList, bool $requireCoverageMetadata, bool $registerMockObjectsFromTestArgumentsRecursively, bool $noProgress, bool $noResults, bool $noOutput, int $executionOrder, int $executionOrderDefects, bool $resolveDependencies, ?string $logfileTeamcity, ?string $logfileJunit, ?string $logfileTestdoxHtml, ?string $logfileTestdoxText, ?string $logEventsText, ?string $logEventsVerboseText, bool $teamCityOutput, bool $testDoxOutput, ?array $testsCovering, ?array $testsUsing, ?string $filter, ?array $groups, ?array $excludeGroups, int $randomOrderSeed, bool $includeUncoveredFiles, TestSuiteCollection $testSuite, string $includeTestSuite, string $excludeTestSuite, ?string $defaultTestSuite, array $testSuffixes, Php $php, bool $controlGarbageCollector, int $numberOfTestsBeforeGarbageCollection, ?string $generateBaseline, bool $debug) { - $this->cliArgument = $cliArgument; + $this->cliArguments = $cliArguments; $this->configurationFile = $configurationFile; $this->bootstrap = $bootstrap; $this->cacheResult = $cacheResult; $this->cacheDirectory = $cacheDirectory; $this->coverageCacheDirectory = $coverageCacheDirectory; - $this->coverageIncludeDirectories = $coverageIncludeDirectories; - $this->coverageIncludeFiles = $coverageIncludeFiles; - $this->coverageExcludeDirectories = $coverageExcludeDirectories; - $this->coverageExcludeFiles = $coverageExcludeFiles; + $this->source = $source; $this->testResultCacheFile = $testResultCacheFile; $this->coverageClover = $coverageClover; $this->coverageCobertura = $coverageCobertura; @@ -168,11 +191,34 @@ final class Configuration $this->pathCoverage = $pathCoverage; $this->ignoreDeprecatedCodeUnitsFromCodeCoverage = $ignoreDeprecatedCodeUnitsFromCodeCoverage; $this->disableCodeCoverageIgnore = $disableCodeCoverageIgnore; + $this->failOnAllIssues = $failOnAllIssues; + $this->failOnDeprecation = $failOnDeprecation; + $this->failOnPhpunitDeprecation = $failOnPhpunitDeprecation; + $this->failOnPhpunitWarning = $failOnPhpunitWarning; $this->failOnEmptyTestSuite = $failOnEmptyTestSuite; $this->failOnIncomplete = $failOnIncomplete; + $this->failOnNotice = $failOnNotice; $this->failOnRisky = $failOnRisky; $this->failOnSkipped = $failOnSkipped; $this->failOnWarning = $failOnWarning; + $this->doNotFailOnDeprecation = $doNotFailOnDeprecation; + $this->doNotFailOnPhpunitDeprecation = $doNotFailOnPhpunitDeprecation; + $this->doNotFailOnPhpunitWarning = $doNotFailOnPhpunitWarning; + $this->doNotFailOnEmptyTestSuite = $doNotFailOnEmptyTestSuite; + $this->doNotFailOnIncomplete = $doNotFailOnIncomplete; + $this->doNotFailOnNotice = $doNotFailOnNotice; + $this->doNotFailOnRisky = $doNotFailOnRisky; + $this->doNotFailOnSkipped = $doNotFailOnSkipped; + $this->doNotFailOnWarning = $doNotFailOnWarning; + $this->stopOnDefect = $stopOnDefect; + $this->stopOnDeprecation = $stopOnDeprecation; + $this->stopOnError = $stopOnError; + $this->stopOnFailure = $stopOnFailure; + $this->stopOnIncomplete = $stopOnIncomplete; + $this->stopOnNotice = $stopOnNotice; + $this->stopOnRisky = $stopOnRisky; + $this->stopOnSkipped = $stopOnSkipped; + $this->stopOnWarning = $stopOnWarning; $this->outputToStandardErrorStream = $outputToStandardErrorStream; $this->columns = $columns; $this->noExtensions = $noExtensions; @@ -183,13 +229,6 @@ final class Configuration $this->beStrictAboutChangesToGlobalState = $beStrictAboutChangesToGlobalState; $this->colors = $colors; $this->processIsolation = $processIsolation; - $this->stopOnDefect = $stopOnDefect; - $this->stopOnError = $stopOnError; - $this->stopOnFailure = $stopOnFailure; - $this->stopOnWarning = $stopOnWarning; - $this->stopOnIncomplete = $stopOnIncomplete; - $this->stopOnRisky = $stopOnRisky; - $this->stopOnSkipped = $stopOnSkipped; $this->enforceTimeLimit = $enforceTimeLimit; $this->defaultTimeLimit = $defaultTimeLimit; $this->timeoutForSmallTests = $timeoutForSmallTests; @@ -198,9 +237,11 @@ final class Configuration $this->reportUselessTests = $reportUselessTests; $this->strictCoverage = $strictCoverage; $this->disallowTestOutput = $disallowTestOutput; + $this->displayDetailsOnAllIssues = $displayDetailsOnAllIssues; $this->displayDetailsOnIncompleteTests = $displayDetailsOnIncompleteTests; $this->displayDetailsOnSkippedTests = $displayDetailsOnSkippedTests; $this->displayDetailsOnTestsThatTriggerDeprecations = $displayDetailsOnTestsThatTriggerDeprecations; + $this->displayDetailsOnPhpunitDeprecations = $displayDetailsOnPhpunitDeprecations; $this->displayDetailsOnTestsThatTriggerErrors = $displayDetailsOnTestsThatTriggerErrors; $this->displayDetailsOnTestsThatTriggerNotices = $displayDetailsOnTestsThatTriggerNotices; $this->displayDetailsOnTestsThatTriggerWarnings = $displayDetailsOnTestsThatTriggerWarnings; @@ -234,26 +275,52 @@ final class Configuration $this->defaultTestSuite = $defaultTestSuite; $this->testSuffixes = $testSuffixes; $this->php = $php; + $this->controlGarbageCollector = $controlGarbageCollector; + $this->numberOfTestsBeforeGarbageCollection = $numberOfTestsBeforeGarbageCollection; + $this->generateBaseline = $generateBaseline; + $this->debug = $debug; } /** - * @psalm-assert-if-true !null $this->cliArgument + * @psalm-assert-if-true !empty $this->cliArguments + */ + public function hasCliArguments(): bool + { + return !empty($this->cliArguments); + } + + /** + * @psalm-return list + */ + public function cliArguments(): array + { + return $this->cliArguments; + } + + /** + * @psalm-assert-if-true !empty $this->cliArguments + * + * @deprecated Use hasCliArguments() instead */ public function hasCliArgument(): bool { - return $this->cliArgument !== null; + return !empty($this->cliArguments); } /** * @throws NoCliArgumentException + * + * @return non-empty-string + * + * @deprecated Use cliArguments()[0] instead */ public function cliArgument(): string { - if (!$this->hasCliArgument()) { + if (!$this->hasCliArguments()) { throw new NoCliArgumentException; } - return $this->cliArgument; + return $this->cliArguments[0]; } /** @@ -341,29 +408,73 @@ final class Configuration return $this->coverageCacheDirectory; } + public function source(): Source + { + return $this->source; + } + + /** + * @deprecated Use source()->restrictDeprecations() instead + */ + public function restrictDeprecations(): bool + { + return $this->source()->restrictDeprecations(); + } + + /** + * @deprecated Use source()->restrictNotices() instead + */ + public function restrictNotices(): bool + { + return $this->source()->restrictNotices(); + } + + /** + * @deprecated Use source()->restrictWarnings() instead + */ + public function restrictWarnings(): bool + { + return $this->source()->restrictWarnings(); + } + + /** + * @deprecated Use source()->notEmpty() instead + */ public function hasNonEmptyListOfFilesToBeIncludedInCodeCoverageReport(): bool { - return $this->coverageIncludeDirectories->notEmpty() || $this->coverageIncludeFiles->notEmpty(); + return $this->source->notEmpty(); } + /** + * @deprecated Use source()->includeDirectories() instead + */ public function coverageIncludeDirectories(): FilterDirectoryCollection { - return $this->coverageIncludeDirectories; + return $this->source()->includeDirectories(); } + /** + * @deprecated Use source()->includeFiles() instead + */ public function coverageIncludeFiles(): FileCollection { - return $this->coverageIncludeFiles; + return $this->source()->includeFiles(); } + /** + * @deprecated Use source()->excludeDirectories() instead + */ public function coverageExcludeDirectories(): FilterDirectoryCollection { - return $this->coverageExcludeDirectories; + return $this->source()->excludeDirectories(); } + /** + * @deprecated Use source()->excludeFiles() instead + */ public function coverageExcludeFiles(): FileCollection { - return $this->coverageExcludeFiles; + return $this->source()->excludeFiles(); } public function testResultCacheFile(): string @@ -607,6 +718,26 @@ final class Configuration return $this->coverageXml; } + public function failOnAllIssues(): bool + { + return $this->failOnAllIssues; + } + + public function failOnDeprecation(): bool + { + return $this->failOnDeprecation; + } + + public function failOnPhpunitDeprecation(): bool + { + return $this->failOnPhpunitDeprecation; + } + + public function failOnPhpunitWarning(): bool + { + return $this->failOnPhpunitWarning; + } + public function failOnEmptyTestSuite(): bool { return $this->failOnEmptyTestSuite; @@ -617,6 +748,11 @@ final class Configuration return $this->failOnIncomplete; } + public function failOnNotice(): bool + { + return $this->failOnNotice; + } + public function failOnRisky(): bool { return $this->failOnRisky; @@ -632,6 +768,96 @@ final class Configuration return $this->failOnWarning; } + public function doNotFailOnDeprecation(): bool + { + return $this->doNotFailOnDeprecation; + } + + public function doNotFailOnPhpunitDeprecation(): bool + { + return $this->doNotFailOnPhpunitDeprecation; + } + + public function doNotFailOnPhpunitWarning(): bool + { + return $this->doNotFailOnPhpunitWarning; + } + + public function doNotFailOnEmptyTestSuite(): bool + { + return $this->doNotFailOnEmptyTestSuite; + } + + public function doNotFailOnIncomplete(): bool + { + return $this->doNotFailOnIncomplete; + } + + public function doNotFailOnNotice(): bool + { + return $this->doNotFailOnNotice; + } + + public function doNotFailOnRisky(): bool + { + return $this->doNotFailOnRisky; + } + + public function doNotFailOnSkipped(): bool + { + return $this->doNotFailOnSkipped; + } + + public function doNotFailOnWarning(): bool + { + return $this->doNotFailOnWarning; + } + + public function stopOnDefect(): bool + { + return $this->stopOnDefect; + } + + public function stopOnDeprecation(): bool + { + return $this->stopOnDeprecation; + } + + public function stopOnError(): bool + { + return $this->stopOnError; + } + + public function stopOnFailure(): bool + { + return $this->stopOnFailure; + } + + public function stopOnIncomplete(): bool + { + return $this->stopOnIncomplete; + } + + public function stopOnNotice(): bool + { + return $this->stopOnNotice; + } + + public function stopOnRisky(): bool + { + return $this->stopOnRisky; + } + + public function stopOnSkipped(): bool + { + return $this->stopOnSkipped; + } + + public function stopOnWarning(): bool + { + return $this->stopOnWarning; + } + public function outputToStandardErrorStream(): bool { return $this->outputToStandardErrorStream; @@ -665,6 +891,8 @@ final class Configuration /** * @throws NoPharExtensionDirectoryException + * + * @psalm-return non-empty-string */ public function pharExtensionDirectory(): string { @@ -708,41 +936,6 @@ final class Configuration return $this->processIsolation; } - public function stopOnDefect(): bool - { - return $this->stopOnDefect; - } - - public function stopOnError(): bool - { - return $this->stopOnError; - } - - public function stopOnFailure(): bool - { - return $this->stopOnFailure; - } - - public function stopOnWarning(): bool - { - return $this->stopOnWarning; - } - - public function stopOnIncomplete(): bool - { - return $this->stopOnIncomplete; - } - - public function stopOnRisky(): bool - { - return $this->stopOnRisky; - } - - public function stopOnSkipped(): bool - { - return $this->stopOnSkipped; - } - public function enforceTimeLimit(): bool { return $this->enforceTimeLimit; @@ -783,6 +976,11 @@ final class Configuration return $this->disallowTestOutput; } + public function displayDetailsOnAllIssues(): bool + { + return $this->displayDetailsOnAllIssues; + } + public function displayDetailsOnIncompleteTests(): bool { return $this->displayDetailsOnIncompleteTests; @@ -798,6 +996,11 @@ final class Configuration return $this->displayDetailsOnTestsThatTriggerDeprecations; } + public function displayDetailsOnPhpunitDeprecations(): bool + { + return $this->displayDetailsOnPhpunitDeprecations; + } + public function displayDetailsOnTestsThatTriggerErrors(): bool { return $this->displayDetailsOnTestsThatTriggerErrors; @@ -823,6 +1026,9 @@ final class Configuration return $this->requireCoverageMetadata; } + /** + * @deprecated + */ public function registerMockObjectsFromTestArgumentsRecursively(): bool { return $this->registerMockObjectsFromTestArgumentsRecursively; @@ -997,9 +1203,9 @@ final class Configuration } /** - * @psalm-return list - * * @throws FilterNotConfiguredException + * + * @psalm-return list */ public function testsCovering(): array { @@ -1019,9 +1225,9 @@ final class Configuration } /** - * @psalm-return list - * * @throws FilterNotConfiguredException + * + * @psalm-return list */ public function testsUsing(): array { @@ -1138,7 +1344,7 @@ final class Configuration } /** - * @psalm-return non-empty-list + * @psalm-return non-empty-list */ public function testSuffixes(): array { @@ -1149,4 +1355,39 @@ final class Configuration { return $this->php; } + + public function controlGarbageCollector(): bool + { + return $this->controlGarbageCollector; + } + + public function numberOfTestsBeforeGarbageCollection(): int + { + return $this->numberOfTestsBeforeGarbageCollection; + } + + /** + * @psalm-assert-if-true !null $this->generateBaseline + */ + public function hasGenerateBaseline(): bool + { + return $this->generateBaseline !== null; + } + + /** + * @throws NoBaselineException + */ + public function generateBaseline(): string + { + if (!$this->hasGenerateBaseline()) { + throw new NoBaselineException; + } + + return $this->generateBaseline; + } + + public function debug(): bool + { + return $this->debug; + } } diff --git a/vendor/phpunit/phpunit/src/TextUI/Configuration/Exception/CodeCoverageReportNotConfiguredException.php b/vendor/phpunit/phpunit/src/TextUI/Configuration/Exception/CodeCoverageReportNotConfiguredException.php index 05243c9a..83faa0a2 100644 --- a/vendor/phpunit/phpunit/src/TextUI/Configuration/Exception/CodeCoverageReportNotConfiguredException.php +++ b/vendor/phpunit/phpunit/src/TextUI/Configuration/Exception/CodeCoverageReportNotConfiguredException.php @@ -12,6 +12,8 @@ namespace PHPUnit\TextUI\Configuration; use RuntimeException; /** + * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit + * * @internal This class is not covered by the backward compatibility promise for PHPUnit */ final class CodeCoverageReportNotConfiguredException extends RuntimeException implements Exception diff --git a/vendor/phpunit/phpunit/src/TextUI/Configuration/Exception/ConfigurationCannotBeBuiltException.php b/vendor/phpunit/phpunit/src/TextUI/Configuration/Exception/ConfigurationCannotBeBuiltException.php index 8aef8643..e95e0942 100644 --- a/vendor/phpunit/phpunit/src/TextUI/Configuration/Exception/ConfigurationCannotBeBuiltException.php +++ b/vendor/phpunit/phpunit/src/TextUI/Configuration/Exception/ConfigurationCannotBeBuiltException.php @@ -12,6 +12,8 @@ namespace PHPUnit\TextUI\Configuration; use RuntimeException; /** + * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit + * * @internal This class is not covered by the backward compatibility promise for PHPUnit */ final class ConfigurationCannotBeBuiltException extends RuntimeException implements Exception diff --git a/vendor/phpunit/phpunit/src/TextUI/Configuration/Exception/Exception.php b/vendor/phpunit/phpunit/src/TextUI/Configuration/Exception/Exception.php index 8678983b..dc49125a 100644 --- a/vendor/phpunit/phpunit/src/TextUI/Configuration/Exception/Exception.php +++ b/vendor/phpunit/phpunit/src/TextUI/Configuration/Exception/Exception.php @@ -10,6 +10,8 @@ namespace PHPUnit\TextUI\Configuration; /** + * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit + * * @internal This interface is not covered by the backward compatibility promise for PHPUnit */ interface Exception extends \PHPUnit\TextUI\Exception diff --git a/vendor/phpunit/phpunit/src/TextUI/Configuration/Exception/FilterNotConfiguredException.php b/vendor/phpunit/phpunit/src/TextUI/Configuration/Exception/FilterNotConfiguredException.php index 9cb4a79a..5ae4331f 100644 --- a/vendor/phpunit/phpunit/src/TextUI/Configuration/Exception/FilterNotConfiguredException.php +++ b/vendor/phpunit/phpunit/src/TextUI/Configuration/Exception/FilterNotConfiguredException.php @@ -12,6 +12,8 @@ namespace PHPUnit\TextUI\Configuration; use RuntimeException; /** + * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit + * * @internal This class is not covered by the backward compatibility promise for PHPUnit */ final class FilterNotConfiguredException extends RuntimeException implements Exception diff --git a/vendor/phpunit/phpunit/src/TextUI/Configuration/Exception/IncludePathNotConfiguredException.php b/vendor/phpunit/phpunit/src/TextUI/Configuration/Exception/IncludePathNotConfiguredException.php deleted file mode 100644 index e4623b24..00000000 --- a/vendor/phpunit/phpunit/src/TextUI/Configuration/Exception/IncludePathNotConfiguredException.php +++ /dev/null @@ -1,19 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace PHPUnit\TextUI\Configuration; - -use RuntimeException; - -/** - * @internal This class is not covered by the backward compatibility promise for PHPUnit - */ -final class IncludePathNotConfiguredException extends RuntimeException implements Exception -{ -} diff --git a/vendor/phpunit/phpunit/src/TextUI/Configuration/Exception/LoggingNotConfiguredException.php b/vendor/phpunit/phpunit/src/TextUI/Configuration/Exception/LoggingNotConfiguredException.php index c10febbb..63cf9b07 100644 --- a/vendor/phpunit/phpunit/src/TextUI/Configuration/Exception/LoggingNotConfiguredException.php +++ b/vendor/phpunit/phpunit/src/TextUI/Configuration/Exception/LoggingNotConfiguredException.php @@ -12,6 +12,8 @@ namespace PHPUnit\TextUI\Configuration; use RuntimeException; /** + * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit + * * @internal This class is not covered by the backward compatibility promise for PHPUnit */ final class LoggingNotConfiguredException extends RuntimeException implements Exception diff --git a/vendor/phpunit/phpunit/src/TextUI/Configuration/Exception/NoBootstrapException.php b/vendor/phpunit/phpunit/src/TextUI/Configuration/Exception/NoBootstrapException.php index 1abc7e88..ff1bddf0 100644 --- a/vendor/phpunit/phpunit/src/TextUI/Configuration/Exception/NoBootstrapException.php +++ b/vendor/phpunit/phpunit/src/TextUI/Configuration/Exception/NoBootstrapException.php @@ -12,6 +12,8 @@ namespace PHPUnit\TextUI\Configuration; use RuntimeException; /** + * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit + * * @internal This class is not covered by the backward compatibility promise for PHPUnit */ final class NoBootstrapException extends RuntimeException implements Exception diff --git a/vendor/phpunit/phpunit/src/TextUI/Configuration/Exception/NoCacheDirectoryException.php b/vendor/phpunit/phpunit/src/TextUI/Configuration/Exception/NoCacheDirectoryException.php index 36d2499e..215fe21f 100644 --- a/vendor/phpunit/phpunit/src/TextUI/Configuration/Exception/NoCacheDirectoryException.php +++ b/vendor/phpunit/phpunit/src/TextUI/Configuration/Exception/NoCacheDirectoryException.php @@ -12,6 +12,8 @@ namespace PHPUnit\TextUI\Configuration; use RuntimeException; /** + * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit + * * @internal This class is not covered by the backward compatibility promise for PHPUnit */ final class NoCacheDirectoryException extends RuntimeException implements Exception diff --git a/vendor/phpunit/phpunit/src/TextUI/Configuration/Exception/NoCliArgumentException.php b/vendor/phpunit/phpunit/src/TextUI/Configuration/Exception/NoCliArgumentException.php index 18c5e16f..42ed0d49 100644 --- a/vendor/phpunit/phpunit/src/TextUI/Configuration/Exception/NoCliArgumentException.php +++ b/vendor/phpunit/phpunit/src/TextUI/Configuration/Exception/NoCliArgumentException.php @@ -12,6 +12,8 @@ namespace PHPUnit\TextUI\Configuration; use RuntimeException; /** + * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit + * * @internal This class is not covered by the backward compatibility promise for PHPUnit */ final class NoCliArgumentException extends RuntimeException implements Exception diff --git a/vendor/phpunit/phpunit/src/TextUI/Configuration/Exception/NoConfigurationFileException.php b/vendor/phpunit/phpunit/src/TextUI/Configuration/Exception/NoConfigurationFileException.php index 1d488d3b..f8ceb80b 100644 --- a/vendor/phpunit/phpunit/src/TextUI/Configuration/Exception/NoConfigurationFileException.php +++ b/vendor/phpunit/phpunit/src/TextUI/Configuration/Exception/NoConfigurationFileException.php @@ -12,6 +12,8 @@ namespace PHPUnit\TextUI\Configuration; use RuntimeException; /** + * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit + * * @internal This class is not covered by the backward compatibility promise for PHPUnit */ final class NoConfigurationFileException extends RuntimeException implements Exception diff --git a/vendor/phpunit/phpunit/src/TextUI/Configuration/Exception/NoCoverageCacheDirectoryException.php b/vendor/phpunit/phpunit/src/TextUI/Configuration/Exception/NoCoverageCacheDirectoryException.php index 54eaabbe..113950b5 100644 --- a/vendor/phpunit/phpunit/src/TextUI/Configuration/Exception/NoCoverageCacheDirectoryException.php +++ b/vendor/phpunit/phpunit/src/TextUI/Configuration/Exception/NoCoverageCacheDirectoryException.php @@ -12,6 +12,8 @@ namespace PHPUnit\TextUI\Configuration; use RuntimeException; /** + * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit + * * @internal This class is not covered by the backward compatibility promise for PHPUnit */ final class NoCoverageCacheDirectoryException extends RuntimeException implements Exception diff --git a/vendor/phpunit/phpunit/src/TextUI/Configuration/Exception/NoCustomCssFileException.php b/vendor/phpunit/phpunit/src/TextUI/Configuration/Exception/NoCustomCssFileException.php index 672b1fc1..e524c8db 100644 --- a/vendor/phpunit/phpunit/src/TextUI/Configuration/Exception/NoCustomCssFileException.php +++ b/vendor/phpunit/phpunit/src/TextUI/Configuration/Exception/NoCustomCssFileException.php @@ -12,6 +12,8 @@ namespace PHPUnit\TextUI\Configuration; use RuntimeException; /** + * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit + * * @internal This class is not covered by the backward compatibility promise for PHPUnit */ final class NoCustomCssFileException extends RuntimeException implements Exception diff --git a/vendor/phpunit/phpunit/src/TextUI/Configuration/Exception/NoDefaultTestSuiteException.php b/vendor/phpunit/phpunit/src/TextUI/Configuration/Exception/NoDefaultTestSuiteException.php index 28663ff5..96e7a7ad 100644 --- a/vendor/phpunit/phpunit/src/TextUI/Configuration/Exception/NoDefaultTestSuiteException.php +++ b/vendor/phpunit/phpunit/src/TextUI/Configuration/Exception/NoDefaultTestSuiteException.php @@ -12,6 +12,8 @@ namespace PHPUnit\TextUI\Configuration; use RuntimeException; /** + * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit + * * @internal This class is not covered by the backward compatibility promise for PHPUnit */ final class NoDefaultTestSuiteException extends RuntimeException implements Exception diff --git a/vendor/phpunit/phpunit/src/TextUI/Configuration/Exception/NoPharExtensionDirectoryException.php b/vendor/phpunit/phpunit/src/TextUI/Configuration/Exception/NoPharExtensionDirectoryException.php index 269be3bd..ce573ca7 100644 --- a/vendor/phpunit/phpunit/src/TextUI/Configuration/Exception/NoPharExtensionDirectoryException.php +++ b/vendor/phpunit/phpunit/src/TextUI/Configuration/Exception/NoPharExtensionDirectoryException.php @@ -12,6 +12,8 @@ namespace PHPUnit\TextUI\Configuration; use RuntimeException; /** + * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit + * * @internal This class is not covered by the backward compatibility promise for PHPUnit */ final class NoPharExtensionDirectoryException extends RuntimeException implements Exception diff --git a/vendor/phpunit/phpunit/src/TextUI/Configuration/Merger.php b/vendor/phpunit/phpunit/src/TextUI/Configuration/Merger.php index 04f246ea..3768ff3b 100644 --- a/vendor/phpunit/phpunit/src/TextUI/Configuration/Merger.php +++ b/vendor/phpunit/phpunit/src/TextUI/Configuration/Merger.php @@ -10,6 +10,7 @@ namespace PHPUnit\TextUI\Configuration; use const DIRECTORY_SEPARATOR; +use const PATH_SEPARATOR; use function array_diff; use function assert; use function dirname; @@ -20,33 +21,30 @@ use function time; use PHPUnit\Event\Facade as EventFacade; use PHPUnit\Runner\TestSuiteSorter; use PHPUnit\TextUI\CliArguments\Configuration as CliConfiguration; +use PHPUnit\TextUI\CliArguments\Exception; use PHPUnit\TextUI\XmlConfiguration\Configuration as XmlConfiguration; use PHPUnit\TextUI\XmlConfiguration\LoadedFromFileConfiguration; +use PHPUnit\TextUI\XmlConfiguration\SchemaDetector; use PHPUnit\Util\Filesystem; -use PHPUnit\Util\Xml\SchemaDetector; use SebastianBergmann\CodeCoverage\Report\Html\Colors; use SebastianBergmann\CodeCoverage\Report\Thresholds; use SebastianBergmann\Environment\Console; use SebastianBergmann\Invoker\Invoker; /** + * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit + * * @internal This class is not covered by the backward compatibility promise for PHPUnit */ final class Merger { /** - * @throws \PHPUnit\TextUI\CliArguments\Exception * @throws \PHPUnit\TextUI\XmlConfiguration\Exception + * @throws Exception * @throws NoCustomCssFileException */ public function merge(CliConfiguration $cliConfiguration, XmlConfiguration $xmlConfiguration): Configuration { - $cliArgument = null; - - if ($cliConfiguration->hasArgument()) { - $cliArgument = $cliConfiguration->argument(); - } - $configurationFile = null; if ($xmlConfiguration->wasLoadedFromFile()) { @@ -115,6 +113,30 @@ final class Merger $disableCodeCoverageIgnore = $xmlConfiguration->codeCoverage()->disableCodeCoverageIgnore(); } + if ($cliConfiguration->hasFailOnAllIssues()) { + $failOnAllIssues = $cliConfiguration->failOnAllIssues(); + } else { + $failOnAllIssues = $xmlConfiguration->phpunit()->failOnAllIssues(); + } + + if ($cliConfiguration->hasFailOnDeprecation()) { + $failOnDeprecation = $cliConfiguration->failOnDeprecation(); + } else { + $failOnDeprecation = $xmlConfiguration->phpunit()->failOnDeprecation(); + } + + if ($cliConfiguration->hasFailOnPhpunitDeprecation()) { + $failOnPhpunitDeprecation = $cliConfiguration->failOnPhpunitDeprecation(); + } else { + $failOnPhpunitDeprecation = $xmlConfiguration->phpunit()->failOnPhpunitDeprecation(); + } + + if ($cliConfiguration->hasFailOnPhpunitWarning()) { + $failOnPhpunitWarning = $cliConfiguration->failOnPhpunitWarning(); + } else { + $failOnPhpunitWarning = $xmlConfiguration->phpunit()->failOnPhpunitWarning(); + } + if ($cliConfiguration->hasFailOnEmptyTestSuite()) { $failOnEmptyTestSuite = $cliConfiguration->failOnEmptyTestSuite(); } else { @@ -127,6 +149,12 @@ final class Merger $failOnIncomplete = $xmlConfiguration->phpunit()->failOnIncomplete(); } + if ($cliConfiguration->hasFailOnNotice()) { + $failOnNotice = $cliConfiguration->failOnNotice(); + } else { + $failOnNotice = $xmlConfiguration->phpunit()->failOnNotice(); + } + if ($cliConfiguration->hasFailOnRisky()) { $failOnRisky = $cliConfiguration->failOnRisky(); } else { @@ -145,14 +173,120 @@ final class Merger $failOnWarning = $xmlConfiguration->phpunit()->failOnWarning(); } + $doNotFailOnDeprecation = false; + + if ($cliConfiguration->hasDoNotFailOnDeprecation()) { + $doNotFailOnDeprecation = $cliConfiguration->doNotFailOnDeprecation(); + } + + $doNotFailOnPhpunitDeprecation = false; + + if ($cliConfiguration->hasDoNotFailOnPhpunitDeprecation()) { + $doNotFailOnPhpunitDeprecation = $cliConfiguration->doNotFailOnPhpunitDeprecation(); + } + + $doNotFailOnPhpunitWarning = false; + + if ($cliConfiguration->hasDoNotFailOnPhpunitWarning()) { + $doNotFailOnPhpunitWarning = $cliConfiguration->doNotFailOnPhpunitWarning(); + } + + $doNotFailOnEmptyTestSuite = false; + + if ($cliConfiguration->hasDoNotFailOnEmptyTestSuite()) { + $doNotFailOnEmptyTestSuite = $cliConfiguration->doNotFailOnEmptyTestSuite(); + } + + $doNotFailOnIncomplete = false; + + if ($cliConfiguration->hasDoNotFailOnIncomplete()) { + $doNotFailOnIncomplete = $cliConfiguration->doNotFailOnIncomplete(); + } + + $doNotFailOnNotice = false; + + if ($cliConfiguration->hasDoNotFailOnNotice()) { + $doNotFailOnNotice = $cliConfiguration->doNotFailOnNotice(); + } + + $doNotFailOnRisky = false; + + if ($cliConfiguration->hasDoNotFailOnRisky()) { + $doNotFailOnRisky = $cliConfiguration->doNotFailOnRisky(); + } + + $doNotFailOnSkipped = false; + + if ($cliConfiguration->hasDoNotFailOnSkipped()) { + $doNotFailOnSkipped = $cliConfiguration->doNotFailOnSkipped(); + } + + $doNotFailOnWarning = false; + + if ($cliConfiguration->hasDoNotFailOnWarning()) { + $doNotFailOnWarning = $cliConfiguration->doNotFailOnWarning(); + } + + if ($cliConfiguration->hasStopOnDefect()) { + $stopOnDefect = $cliConfiguration->stopOnDefect(); + } else { + $stopOnDefect = $xmlConfiguration->phpunit()->stopOnDefect(); + } + + if ($cliConfiguration->hasStopOnDeprecation()) { + $stopOnDeprecation = $cliConfiguration->stopOnDeprecation(); + } else { + $stopOnDeprecation = $xmlConfiguration->phpunit()->stopOnDeprecation(); + } + + if ($cliConfiguration->hasStopOnError()) { + $stopOnError = $cliConfiguration->stopOnError(); + } else { + $stopOnError = $xmlConfiguration->phpunit()->stopOnError(); + } + + if ($cliConfiguration->hasStopOnFailure()) { + $stopOnFailure = $cliConfiguration->stopOnFailure(); + } else { + $stopOnFailure = $xmlConfiguration->phpunit()->stopOnFailure(); + } + + if ($cliConfiguration->hasStopOnIncomplete()) { + $stopOnIncomplete = $cliConfiguration->stopOnIncomplete(); + } else { + $stopOnIncomplete = $xmlConfiguration->phpunit()->stopOnIncomplete(); + } + + if ($cliConfiguration->hasStopOnNotice()) { + $stopOnNotice = $cliConfiguration->stopOnNotice(); + } else { + $stopOnNotice = $xmlConfiguration->phpunit()->stopOnNotice(); + } + + if ($cliConfiguration->hasStopOnRisky()) { + $stopOnRisky = $cliConfiguration->stopOnRisky(); + } else { + $stopOnRisky = $xmlConfiguration->phpunit()->stopOnRisky(); + } + + if ($cliConfiguration->hasStopOnSkipped()) { + $stopOnSkipped = $cliConfiguration->stopOnSkipped(); + } else { + $stopOnSkipped = $xmlConfiguration->phpunit()->stopOnSkipped(); + } + + if ($cliConfiguration->hasStopOnWarning()) { + $stopOnWarning = $cliConfiguration->stopOnWarning(); + } else { + $stopOnWarning = $xmlConfiguration->phpunit()->stopOnWarning(); + } + if ($cliConfiguration->hasStderr() && $cliConfiguration->stderr()) { $outputToStandardErrorStream = true; } else { $outputToStandardErrorStream = $xmlConfiguration->phpunit()->stderr(); } - $maxNumberOfColumns = (new Console)->getNumberOfColumns(); - if ($cliConfiguration->hasColumns()) { $columns = $cliConfiguration->columns(); } else { @@ -160,21 +294,17 @@ final class Merger } if ($columns === 'max') { - $columns = $maxNumberOfColumns; + $columns = (new Console)->getNumberOfColumns(); } if ($columns < 16) { $columns = 16; - EventFacade::emitter()->testRunnerTriggeredWarning( - 'Less than 16 columns requested, number of columns set to 16' + EventFacade::emitter()->testRunnerTriggeredPhpunitWarning( + 'Less than 16 columns requested, number of columns set to 16', ); } - if ($columns > $maxNumberOfColumns) { - $columns = $maxNumberOfColumns; - } - assert(is_int($columns)); $noExtensions = false; @@ -290,6 +420,14 @@ final class Merger $coverageTextShowOnlySummary = $xmlConfiguration->codeCoverage()->text()->showOnlySummary(); } + if ($cliConfiguration->hasCoverageTextShowUncoveredFiles()) { + $coverageTextShowUncoveredFiles = $cliConfiguration->coverageTextShowUncoveredFiles(); + } + + if ($cliConfiguration->hasCoverageTextShowOnlySummary()) { + $coverageTextShowOnlySummary = $cliConfiguration->coverageTextShowOnlySummary(); + } + if ($cliConfiguration->hasCoverageText()) { $coverageText = $cliConfiguration->coverageText(); } elseif ($coverageFromXmlConfiguration && $xmlConfiguration->codeCoverage()->hasText()) { @@ -326,48 +464,6 @@ final class Merger $processIsolation = $xmlConfiguration->phpunit()->processIsolation(); } - if ($cliConfiguration->hasStopOnDefect()) { - $stopOnDefect = $cliConfiguration->stopOnDefect(); - } else { - $stopOnDefect = $xmlConfiguration->phpunit()->stopOnDefect(); - } - - if ($cliConfiguration->hasStopOnError()) { - $stopOnError = $cliConfiguration->stopOnError(); - } else { - $stopOnError = $xmlConfiguration->phpunit()->stopOnError(); - } - - if ($cliConfiguration->hasStopOnFailure()) { - $stopOnFailure = $cliConfiguration->stopOnFailure(); - } else { - $stopOnFailure = $xmlConfiguration->phpunit()->stopOnFailure(); - } - - if ($cliConfiguration->hasStopOnWarning()) { - $stopOnWarning = $cliConfiguration->stopOnWarning(); - } else { - $stopOnWarning = $xmlConfiguration->phpunit()->stopOnWarning(); - } - - if ($cliConfiguration->hasStopOnIncomplete()) { - $stopOnIncomplete = $cliConfiguration->stopOnIncomplete(); - } else { - $stopOnIncomplete = $xmlConfiguration->phpunit()->stopOnIncomplete(); - } - - if ($cliConfiguration->hasStopOnRisky()) { - $stopOnRisky = $cliConfiguration->stopOnRisky(); - } else { - $stopOnRisky = $xmlConfiguration->phpunit()->stopOnRisky(); - } - - if ($cliConfiguration->hasStopOnSkipped()) { - $stopOnSkipped = $cliConfiguration->stopOnSkipped(); - } else { - $stopOnSkipped = $xmlConfiguration->phpunit()->stopOnSkipped(); - } - if ($cliConfiguration->hasEnforceTimeLimit()) { $enforceTimeLimit = $cliConfiguration->enforceTimeLimit(); } else { @@ -375,8 +471,8 @@ final class Merger } if ($enforceTimeLimit && !(new Invoker)->canInvokeWithTimeout()) { - EventFacade::emitter()->testRunnerTriggeredWarning( - 'The pcntl extension is required for enforcing time limits' + EventFacade::emitter()->testRunnerTriggeredPhpunitWarning( + 'The pcntl extension is required for enforcing time limits', ); } @@ -408,6 +504,12 @@ final class Merger $disallowTestOutput = $xmlConfiguration->phpunit()->beStrictAboutOutputDuringTests(); } + if ($cliConfiguration->hasDisplayDetailsOnAllIssues()) { + $displayDetailsOnAllIssues = $cliConfiguration->displayDetailsOnAllIssues(); + } else { + $displayDetailsOnAllIssues = $xmlConfiguration->phpunit()->displayDetailsOnAllIssues(); + } + if ($cliConfiguration->hasDisplayDetailsOnIncompleteTests()) { $displayDetailsOnIncompleteTests = $cliConfiguration->displayDetailsOnIncompleteTests(); } else { @@ -426,6 +528,12 @@ final class Merger $displayDetailsOnTestsThatTriggerDeprecations = $xmlConfiguration->phpunit()->displayDetailsOnTestsThatTriggerDeprecations(); } + if ($cliConfiguration->hasDisplayDetailsOnPhpunitDeprecations()) { + $displayDetailsOnPhpunitDeprecations = $cliConfiguration->displayDetailsOnPhpunitDeprecations(); + } else { + $displayDetailsOnPhpunitDeprecations = $xmlConfiguration->phpunit()->displayDetailsOnPhpunitDeprecations(); + } + if ($cliConfiguration->hasDisplayDetailsOnTestsThatTriggerErrors()) { $displayDetailsOnTestsThatTriggerErrors = $cliConfiguration->displayDetailsOnTestsThatTriggerErrors(); } else { @@ -604,13 +712,13 @@ final class Merger if ($xmlConfiguration->wasLoadedFromFile() && $xmlConfiguration->hasValidationErrors()) { if ((new SchemaDetector)->detect($xmlConfiguration->filename())->detected()) { - EventFacade::emitter()->testRunnerTriggeredWarning( - 'Your XML configuration validates against a deprecated schema. Migrate your XML configuration using "--migrate-configuration"!' + EventFacade::emitter()->testRunnerTriggeredPhpunitDeprecation( + 'Your XML configuration validates against a deprecated schema. Migrate your XML configuration using "--migrate-configuration"!', ); } else { - EventFacade::emitter()->testRunnerTriggeredWarning( + EventFacade::emitter()->testRunnerTriggeredPhpunitWarning( "Test results may not be as expected because the XML configuration file did not pass validation:\n" . - $xmlConfiguration->validationErrors() + $xmlConfiguration->validationErrors(), ); } } @@ -661,29 +769,73 @@ final class Merger $testSuffixes = $cliConfiguration->testSuffixes(); } - $coverageIncludeDirectories = []; + $sourceIncludeDirectories = []; if ($cliConfiguration->hasCoverageFilter()) { foreach ($cliConfiguration->coverageFilter() as $directory) { - $coverageIncludeDirectories[] = new FilterDirectory($directory, '', '.php'); + $sourceIncludeDirectories[] = new FilterDirectory($directory, '', '.php'); } } - foreach ($xmlConfiguration->codeCoverage()->directories() as $directory) { - $coverageIncludeDirectories[] = $directory; + if ($xmlConfiguration->codeCoverage()->hasNonEmptyListOfFilesToBeIncludedInCodeCoverageReport()) { + foreach ($xmlConfiguration->codeCoverage()->directories() as $directory) { + $sourceIncludeDirectories[] = $directory; + } + + $sourceIncludeFiles = $xmlConfiguration->codeCoverage()->files(); + $sourceExcludeDirectories = $xmlConfiguration->codeCoverage()->excludeDirectories(); + $sourceExcludeFiles = $xmlConfiguration->codeCoverage()->excludeFiles(); + } else { + foreach ($xmlConfiguration->source()->includeDirectories() as $directory) { + $sourceIncludeDirectories[] = $directory; + } + + $sourceIncludeFiles = $xmlConfiguration->source()->includeFiles(); + $sourceExcludeDirectories = $xmlConfiguration->source()->excludeDirectories(); + $sourceExcludeFiles = $xmlConfiguration->source()->excludeFiles(); } + $useBaseline = null; + $generateBaseline = null; + + if (!$cliConfiguration->hasGenerateBaseline()) { + if ($cliConfiguration->hasUseBaseline()) { + $useBaseline = $cliConfiguration->useBaseline(); + } elseif ($xmlConfiguration->source()->hasBaseline()) { + $useBaseline = $xmlConfiguration->source()->baseline(); + } + } else { + $generateBaseline = $cliConfiguration->generateBaseline(); + } + + assert($useBaseline !== ''); + assert($generateBaseline !== ''); + return new Configuration( - $cliArgument, + $cliConfiguration->arguments(), $configurationFile, $bootstrap, $cacheResult, $cacheDirectory, $coverageCacheDirectory, - FilterDirectoryCollection::fromArray($coverageIncludeDirectories), - $xmlConfiguration->codeCoverage()->files(), - $xmlConfiguration->codeCoverage()->excludeDirectories(), - $xmlConfiguration->codeCoverage()->excludeFiles(), + new Source( + $useBaseline, + $cliConfiguration->ignoreBaseline(), + FilterDirectoryCollection::fromArray($sourceIncludeDirectories), + $sourceIncludeFiles, + $sourceExcludeDirectories, + $sourceExcludeFiles, + $xmlConfiguration->source()->restrictDeprecations(), + $xmlConfiguration->source()->restrictNotices(), + $xmlConfiguration->source()->restrictWarnings(), + $xmlConfiguration->source()->ignoreSuppressionOfDeprecations(), + $xmlConfiguration->source()->ignoreSuppressionOfPhpDeprecations(), + $xmlConfiguration->source()->ignoreSuppressionOfErrors(), + $xmlConfiguration->source()->ignoreSuppressionOfNotices(), + $xmlConfiguration->source()->ignoreSuppressionOfPhpNotices(), + $xmlConfiguration->source()->ignoreSuppressionOfWarnings(), + $xmlConfiguration->source()->ignoreSuppressionOfPhpWarnings(), + ), $testResultCacheFile, $coverageClover, $coverageCobertura, @@ -706,11 +858,34 @@ final class Merger $pathCoverage, $xmlConfiguration->codeCoverage()->ignoreDeprecatedCodeUnits(), $disableCodeCoverageIgnore, + $failOnAllIssues, + $failOnDeprecation, + $failOnPhpunitDeprecation, + $failOnPhpunitWarning, $failOnEmptyTestSuite, $failOnIncomplete, + $failOnNotice, $failOnRisky, $failOnSkipped, $failOnWarning, + $doNotFailOnDeprecation, + $doNotFailOnPhpunitDeprecation, + $doNotFailOnPhpunitWarning, + $doNotFailOnEmptyTestSuite, + $doNotFailOnIncomplete, + $doNotFailOnNotice, + $doNotFailOnRisky, + $doNotFailOnSkipped, + $doNotFailOnWarning, + $stopOnDefect, + $stopOnDeprecation, + $stopOnError, + $stopOnFailure, + $stopOnIncomplete, + $stopOnNotice, + $stopOnRisky, + $stopOnSkipped, + $stopOnWarning, $outputToStandardErrorStream, $columns, $noExtensions, @@ -721,13 +896,6 @@ final class Merger $beStrictAboutChangesToGlobalState, $colors, $processIsolation, - $stopOnDefect, - $stopOnError, - $stopOnFailure, - $stopOnWarning, - $stopOnIncomplete, - $stopOnRisky, - $stopOnSkipped, $enforceTimeLimit, $defaultTimeLimit, $timeoutForSmallTests, @@ -736,9 +904,11 @@ final class Merger $reportUselessTests, $strictCoverage, $disallowTestOutput, + $displayDetailsOnAllIssues, $displayDetailsOnIncompleteTests, $displayDetailsOnSkippedTests, $displayDetailsOnTestsThatTriggerDeprecations, + $displayDetailsOnPhpunitDeprecations, $displayDetailsOnTestsThatTriggerErrors, $displayDetailsOnTestsThatTriggerNotices, $displayDetailsOnTestsThatTriggerWarnings, @@ -784,6 +954,10 @@ final class Merger $xmlConfiguration->php()->filesVariables(), $xmlConfiguration->php()->requestVariables(), ), + $xmlConfiguration->phpunit()->controlGarbageCollector(), + $xmlConfiguration->phpunit()->numberOfTestsBeforeGarbageCollection(), + $generateBaseline, + $cliConfiguration->debug(), ); } } diff --git a/vendor/phpunit/phpunit/src/TextUI/Configuration/PhpHandler.php b/vendor/phpunit/phpunit/src/TextUI/Configuration/PhpHandler.php index ae5076a0..8bd727f2 100644 --- a/vendor/phpunit/phpunit/src/TextUI/Configuration/PhpHandler.php +++ b/vendor/phpunit/phpunit/src/TextUI/Configuration/PhpHandler.php @@ -20,6 +20,8 @@ use function ini_set; use function putenv; /** + * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit + * * @internal This class is not covered by the backward compatibility promise for PHPUnit */ final class PhpHandler @@ -52,7 +54,7 @@ final class PhpHandler 'include_path', implode(PATH_SEPARATOR, $includePathsAsStrings) . PATH_SEPARATOR . - ini_get('include_path') + ini_get('include_path'), ); } } diff --git a/vendor/phpunit/phpunit/src/TextUI/Configuration/Registry.php b/vendor/phpunit/phpunit/src/TextUI/Configuration/Registry.php index b74efc89..bde319a7 100644 --- a/vendor/phpunit/phpunit/src/TextUI/Configuration/Registry.php +++ b/vendor/phpunit/phpunit/src/TextUI/Configuration/Registry.php @@ -16,6 +16,7 @@ use function serialize; use function unserialize; use PHPUnit\Event\Facade as EventFacade; use PHPUnit\TextUI\CliArguments\Configuration as CliConfiguration; +use PHPUnit\TextUI\CliArguments\Exception; use PHPUnit\TextUI\XmlConfiguration\Configuration as XmlConfiguration; use PHPUnit\Util\VersionComparisonOperator; @@ -23,6 +24,8 @@ use PHPUnit\Util\VersionComparisonOperator; * CLI options and XML configuration are static within a single PHPUnit process. * It is therefore okay to use a Singleton registry here. * + * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit + * * @internal This class is not covered by the backward compatibility promise for PHPUnit */ final class Registry @@ -33,20 +36,24 @@ final class Registry { $result = file_put_contents( $path, - serialize(self::get()) + serialize(self::get()), ); if ($result) { return true; } + // @codeCoverageIgnoreStart return false; + // @codeCoverageIgnoreEnd } /** * This method is used by the "run test(s) in separate process" templates. * * @noinspection PhpUnused + * + * @codeCoverageIgnore */ public static function loadFrom(string $path): void { @@ -75,8 +82,9 @@ final class Registry TestSuiteCollection::class, TestSuite::class, VersionComparisonOperator::class, + Source::class, ], - ] + ], ); } @@ -88,8 +96,8 @@ final class Registry } /** - * @throws \PHPUnit\TextUI\CliArguments\Exception * @throws \PHPUnit\TextUI\XmlConfiguration\Exception + * @throws Exception * @throws NoCustomCssFileException */ public static function init(CliConfiguration $cliConfiguration, XmlConfiguration $xmlConfiguration): Configuration diff --git a/vendor/phpunit/phpunit/src/TextUI/Configuration/TestSuiteBuilder.php b/vendor/phpunit/phpunit/src/TextUI/Configuration/TestSuiteBuilder.php index 9e84131e..0b948059 100644 --- a/vendor/phpunit/phpunit/src/TextUI/Configuration/TestSuiteBuilder.php +++ b/vendor/phpunit/phpunit/src/TextUI/Configuration/TestSuiteBuilder.php @@ -9,6 +9,9 @@ */ namespace PHPUnit\TextUI\Configuration; +use const PHP_EOL; +use function assert; +use function count; use function is_dir; use function is_file; use function realpath; @@ -24,6 +27,8 @@ use PHPUnit\TextUI\XmlConfiguration\TestSuiteMapper; use SebastianBergmann\FileIterator\Facade as FileIteratorFacade; /** + * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit + * * @internal This class is not covered by the backward compatibility promise for PHPUnit */ final class TestSuiteBuilder @@ -36,24 +41,42 @@ final class TestSuiteBuilder */ public function build(Configuration $configuration): TestSuite { - if ($configuration->hasCliArgument()) { - $argument = realpath($configuration->cliArgument()); + if ($configuration->hasCliArguments()) { + $arguments = []; - if (!$argument) { - throw new TestFileNotFoundException($configuration->cliArgument()); + foreach ($configuration->cliArguments() as $cliArgument) { + $argument = realpath($cliArgument); + + if (!$argument) { + throw new TestFileNotFoundException($cliArgument); + } + + $arguments[] = $argument; } - $testSuite = $this->testSuiteFromPath( - $argument, - $configuration->testSuffixes() - ); + if (count($arguments) === 1) { + $testSuite = $this->testSuiteFromPath( + $arguments[0], + $configuration->testSuffixes(), + ); + } else { + $testSuite = $this->testSuiteFromPathList( + $arguments, + $configuration->testSuffixes(), + ); + } } if (!isset($testSuite)) { + $xmlConfigurationFile = $configuration->hasConfigurationFile() ? $configuration->configurationFile() : 'Root Test Suite'; + + assert(!empty($xmlConfigurationFile)); + $testSuite = (new TestSuiteMapper)->map( + $xmlConfigurationFile, $configuration->testSuite(), $configuration->includeTestSuite(), - $configuration->excludeTestSuite() + $configuration->excludeTestSuite(), ); } @@ -63,24 +86,26 @@ final class TestSuiteBuilder } /** - * @psalm-param list $suffixes + * @psalm-param non-empty-string $path + * @psalm-param list $suffixes + * @psalm-param ?TestSuite $suite * * @throws \PHPUnit\Framework\Exception */ - private function testSuiteFromPath(string $path, array $suffixes): TestSuite + private function testSuiteFromPath(string $path, array $suffixes, ?TestSuite $suite = null): TestSuite { - if (is_dir($path)) { - $files = (new FileIteratorFacade)->getFilesAsArray($path, $suffixes); - - $suite = TestSuite::empty($path); - $suite->addTestFiles($files); + if (str_ends_with($path, '.phpt') && is_file($path)) { + $suite = $suite ?: TestSuite::empty($path); + $suite->addTestFile($path); return $suite; } - if (is_file($path) && str_ends_with($path, '.phpt')) { - $suite = TestSuite::empty(); - $suite->addTestFile($path); + if (is_dir($path)) { + $files = (new FileIteratorFacade)->getFilesAsArray($path, $suffixes); + + $suite = $suite ?: TestSuite::empty('CLI Arguments'); + $suite->addTestFiles($files); return $suite; } @@ -93,6 +118,29 @@ final class TestSuiteBuilder exit(1); } - return TestSuite::fromClassReflector($testClass); + if (!$suite) { + return TestSuite::fromClassReflector($testClass); + } + + $suite->addTestSuite($testClass); + + return $suite; + } + + /** + * @psalm-param list $paths + * @psalm-param list $suffixes + * + * @throws \PHPUnit\Framework\Exception + */ + private function testSuiteFromPathList(array $paths, array $suffixes): TestSuite + { + $suite = TestSuite::empty('CLI Arguments'); + + foreach ($paths as $path) { + $this->testSuiteFromPath($path, $suffixes, $suite); + } + + return $suite; } } diff --git a/vendor/phpunit/phpunit/src/TextUI/Configuration/Value/Constant.php b/vendor/phpunit/phpunit/src/TextUI/Configuration/Value/Constant.php index 0ec9487e..44a4a83a 100644 --- a/vendor/phpunit/phpunit/src/TextUI/Configuration/Value/Constant.php +++ b/vendor/phpunit/phpunit/src/TextUI/Configuration/Value/Constant.php @@ -30,7 +30,7 @@ final class Constant return $this->name; } - public function value(): mixed + public function value(): bool|string { return $this->value; } diff --git a/vendor/phpunit/phpunit/src/TextUI/Configuration/Value/File.php b/vendor/phpunit/phpunit/src/TextUI/Configuration/Value/File.php index e0b0dad8..035b9a35 100644 --- a/vendor/phpunit/phpunit/src/TextUI/Configuration/Value/File.php +++ b/vendor/phpunit/phpunit/src/TextUI/Configuration/Value/File.php @@ -16,13 +16,22 @@ namespace PHPUnit\TextUI\Configuration; */ final class File { + /** + * @psalm-var non-empty-string + */ private readonly string $path; + /** + * @psalm-param non-empty-string $path + */ public function __construct(string $path) { $this->path = $path; } + /** + * @psalm-return non-empty-string + */ public function path(): string { return $this->path; diff --git a/vendor/phpunit/phpunit/src/TextUI/Configuration/Value/FilterDirectory.php b/vendor/phpunit/phpunit/src/TextUI/Configuration/Value/FilterDirectory.php index 1bc0e045..d66f9511 100644 --- a/vendor/phpunit/phpunit/src/TextUI/Configuration/Value/FilterDirectory.php +++ b/vendor/phpunit/phpunit/src/TextUI/Configuration/Value/FilterDirectory.php @@ -16,10 +16,16 @@ namespace PHPUnit\TextUI\Configuration; */ final class FilterDirectory { + /** + * @psalm-var non-empty-string + */ private readonly string $path; private readonly string $prefix; private readonly string $suffix; + /** + * @psalm-param non-empty-string $path + */ public function __construct(string $path, string $prefix, string $suffix) { $this->path = $path; @@ -27,6 +33,9 @@ final class FilterDirectory $this->suffix = $suffix; } + /** + * @psalm-return non-empty-string + */ public function path(): string { return $this->path; diff --git a/vendor/phpunit/phpunit/src/TextUI/Configuration/Value/TestDirectory.php b/vendor/phpunit/phpunit/src/TextUI/Configuration/Value/TestDirectory.php index 8615014f..d19e8859 100644 --- a/vendor/phpunit/phpunit/src/TextUI/Configuration/Value/TestDirectory.php +++ b/vendor/phpunit/phpunit/src/TextUI/Configuration/Value/TestDirectory.php @@ -18,12 +18,18 @@ use PHPUnit\Util\VersionComparisonOperator; */ final class TestDirectory { + /** + * @psalm-var non-empty-string + */ private readonly string $path; private readonly string $prefix; private readonly string $suffix; private readonly string $phpVersion; private readonly VersionComparisonOperator $phpVersionOperator; + /** + * @psalm-param non-empty-string $path + */ public function __construct(string $path, string $prefix, string $suffix, string $phpVersion, VersionComparisonOperator $phpVersionOperator) { $this->path = $path; @@ -33,6 +39,9 @@ final class TestDirectory $this->phpVersionOperator = $phpVersionOperator; } + /** + * @psalm-return non-empty-string + */ public function path(): string { return $this->path; diff --git a/vendor/phpunit/phpunit/src/TextUI/Configuration/Value/TestSuite.php b/vendor/phpunit/phpunit/src/TextUI/Configuration/Value/TestSuite.php index 196bdf96..7105242b 100644 --- a/vendor/phpunit/phpunit/src/TextUI/Configuration/Value/TestSuite.php +++ b/vendor/phpunit/phpunit/src/TextUI/Configuration/Value/TestSuite.php @@ -16,11 +16,17 @@ namespace PHPUnit\TextUI\Configuration; */ final class TestSuite { + /** + * @psalm-var non-empty-string + */ private readonly string $name; private readonly TestDirectoryCollection $directories; private readonly TestFileCollection $files; private readonly FileCollection $exclude; + /** + * @psalm-param non-empty-string $name + */ public function __construct(string $name, TestDirectoryCollection $directories, TestFileCollection $files, FileCollection $exclude) { $this->name = $name; @@ -29,6 +35,9 @@ final class TestSuite $this->exclude = $exclude; } + /** + * @psalm-return non-empty-string + */ public function name(): string { return $this->name; diff --git a/vendor/phpunit/phpunit/src/TextUI/Configuration/Xml/CodeCoverage/CodeCoverage.php b/vendor/phpunit/phpunit/src/TextUI/Configuration/Xml/CodeCoverage/CodeCoverage.php index 3e4687c7..4450970f 100644 --- a/vendor/phpunit/phpunit/src/TextUI/Configuration/Xml/CodeCoverage/CodeCoverage.php +++ b/vendor/phpunit/phpunit/src/TextUI/Configuration/Xml/CodeCoverage/CodeCoverage.php @@ -23,6 +23,8 @@ use PHPUnit\TextUI\XmlConfiguration\CodeCoverage\Report\Xml; use PHPUnit\TextUI\XmlConfiguration\Exception; /** + * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit + * * @internal This class is not covered by the backward compatibility promise for PHPUnit * * @psalm-immutable @@ -85,7 +87,7 @@ final class CodeCoverage { if (!$this->hasCacheDirectory()) { throw new Exception( - 'No cache directory has been configured' + 'No cache directory has been configured', ); } @@ -152,7 +154,7 @@ final class CodeCoverage { if (!$this->hasClover()) { throw new Exception( - 'Code Coverage report "Clover XML" has not been configured' + 'Code Coverage report "Clover XML" has not been configured', ); } @@ -174,7 +176,7 @@ final class CodeCoverage { if (!$this->hasCobertura()) { throw new Exception( - 'Code Coverage report "Cobertura XML" has not been configured' + 'Code Coverage report "Cobertura XML" has not been configured', ); } @@ -196,7 +198,7 @@ final class CodeCoverage { if (!$this->hasCrap4j()) { throw new Exception( - 'Code Coverage report "Crap4J" has not been configured' + 'Code Coverage report "Crap4J" has not been configured', ); } @@ -218,7 +220,7 @@ final class CodeCoverage { if (!$this->hasHtml()) { throw new Exception( - 'Code Coverage report "HTML" has not been configured' + 'Code Coverage report "HTML" has not been configured', ); } @@ -240,7 +242,7 @@ final class CodeCoverage { if (!$this->hasPhp()) { throw new Exception( - 'Code Coverage report "PHP" has not been configured' + 'Code Coverage report "PHP" has not been configured', ); } @@ -262,7 +264,7 @@ final class CodeCoverage { if (!$this->hasText()) { throw new Exception( - 'Code Coverage report "Text" has not been configured' + 'Code Coverage report "Text" has not been configured', ); } @@ -284,7 +286,7 @@ final class CodeCoverage { if (!$this->hasXml()) { throw new Exception( - 'Code Coverage report "XML" has not been configured' + 'Code Coverage report "XML" has not been configured', ); } diff --git a/vendor/phpunit/phpunit/src/TextUI/Configuration/Xml/CodeCoverage/Report/Clover.php b/vendor/phpunit/phpunit/src/TextUI/Configuration/Xml/CodeCoverage/Report/Clover.php index 0d59cef5..a815dc46 100644 --- a/vendor/phpunit/phpunit/src/TextUI/Configuration/Xml/CodeCoverage/Report/Clover.php +++ b/vendor/phpunit/phpunit/src/TextUI/Configuration/Xml/CodeCoverage/Report/Clover.php @@ -12,6 +12,8 @@ namespace PHPUnit\TextUI\XmlConfiguration\CodeCoverage\Report; use PHPUnit\TextUI\Configuration\File; /** + * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit + * * @internal This class is not covered by the backward compatibility promise for PHPUnit * * @psalm-immutable diff --git a/vendor/phpunit/phpunit/src/TextUI/Configuration/Xml/CodeCoverage/Report/Cobertura.php b/vendor/phpunit/phpunit/src/TextUI/Configuration/Xml/CodeCoverage/Report/Cobertura.php index 5c15cf27..c8b560d7 100644 --- a/vendor/phpunit/phpunit/src/TextUI/Configuration/Xml/CodeCoverage/Report/Cobertura.php +++ b/vendor/phpunit/phpunit/src/TextUI/Configuration/Xml/CodeCoverage/Report/Cobertura.php @@ -12,6 +12,8 @@ namespace PHPUnit\TextUI\XmlConfiguration\CodeCoverage\Report; use PHPUnit\TextUI\Configuration\File; /** + * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit + * * @internal This class is not covered by the backward compatibility promise for PHPUnit * * @psalm-immutable diff --git a/vendor/phpunit/phpunit/src/TextUI/Configuration/Xml/CodeCoverage/Report/Crap4j.php b/vendor/phpunit/phpunit/src/TextUI/Configuration/Xml/CodeCoverage/Report/Crap4j.php index 3e292df3..eff20d6b 100644 --- a/vendor/phpunit/phpunit/src/TextUI/Configuration/Xml/CodeCoverage/Report/Crap4j.php +++ b/vendor/phpunit/phpunit/src/TextUI/Configuration/Xml/CodeCoverage/Report/Crap4j.php @@ -12,6 +12,8 @@ namespace PHPUnit\TextUI\XmlConfiguration\CodeCoverage\Report; use PHPUnit\TextUI\Configuration\File; /** + * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit + * * @internal This class is not covered by the backward compatibility promise for PHPUnit * * @psalm-immutable diff --git a/vendor/phpunit/phpunit/src/TextUI/Configuration/Xml/CodeCoverage/Report/Html.php b/vendor/phpunit/phpunit/src/TextUI/Configuration/Xml/CodeCoverage/Report/Html.php index 8a5841d2..db6fa53d 100644 --- a/vendor/phpunit/phpunit/src/TextUI/Configuration/Xml/CodeCoverage/Report/Html.php +++ b/vendor/phpunit/phpunit/src/TextUI/Configuration/Xml/CodeCoverage/Report/Html.php @@ -13,6 +13,8 @@ use PHPUnit\TextUI\Configuration\Directory; use PHPUnit\TextUI\Configuration\NoCustomCssFileException; /** + * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit + * * @internal This class is not covered by the backward compatibility promise for PHPUnit * * @psalm-immutable diff --git a/vendor/phpunit/phpunit/src/TextUI/Configuration/Xml/CodeCoverage/Report/Php.php b/vendor/phpunit/phpunit/src/TextUI/Configuration/Xml/CodeCoverage/Report/Php.php index 121287a1..39a3762d 100644 --- a/vendor/phpunit/phpunit/src/TextUI/Configuration/Xml/CodeCoverage/Report/Php.php +++ b/vendor/phpunit/phpunit/src/TextUI/Configuration/Xml/CodeCoverage/Report/Php.php @@ -12,6 +12,8 @@ namespace PHPUnit\TextUI\XmlConfiguration\CodeCoverage\Report; use PHPUnit\TextUI\Configuration\File; /** + * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit + * * @internal This class is not covered by the backward compatibility promise for PHPUnit * * @psalm-immutable diff --git a/vendor/phpunit/phpunit/src/TextUI/Configuration/Xml/CodeCoverage/Report/Text.php b/vendor/phpunit/phpunit/src/TextUI/Configuration/Xml/CodeCoverage/Report/Text.php index 749c32cf..6ff3c8ce 100644 --- a/vendor/phpunit/phpunit/src/TextUI/Configuration/Xml/CodeCoverage/Report/Text.php +++ b/vendor/phpunit/phpunit/src/TextUI/Configuration/Xml/CodeCoverage/Report/Text.php @@ -12,6 +12,8 @@ namespace PHPUnit\TextUI\XmlConfiguration\CodeCoverage\Report; use PHPUnit\TextUI\Configuration\File; /** + * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit + * * @internal This class is not covered by the backward compatibility promise for PHPUnit * * @psalm-immutable diff --git a/vendor/phpunit/phpunit/src/TextUI/Configuration/Xml/CodeCoverage/Report/Xml.php b/vendor/phpunit/phpunit/src/TextUI/Configuration/Xml/CodeCoverage/Report/Xml.php index 2f891e97..09dddc0c 100644 --- a/vendor/phpunit/phpunit/src/TextUI/Configuration/Xml/CodeCoverage/Report/Xml.php +++ b/vendor/phpunit/phpunit/src/TextUI/Configuration/Xml/CodeCoverage/Report/Xml.php @@ -12,6 +12,8 @@ namespace PHPUnit\TextUI\XmlConfiguration\CodeCoverage\Report; use PHPUnit\TextUI\Configuration\Directory; /** + * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit + * * @internal This class is not covered by the backward compatibility promise for PHPUnit * * @psalm-immutable diff --git a/vendor/phpunit/phpunit/src/TextUI/Configuration/Xml/Configuration.php b/vendor/phpunit/phpunit/src/TextUI/Configuration/Xml/Configuration.php index 12b29f62..d9a74fa8 100644 --- a/vendor/phpunit/phpunit/src/TextUI/Configuration/Xml/Configuration.php +++ b/vendor/phpunit/phpunit/src/TextUI/Configuration/Xml/Configuration.php @@ -11,11 +11,14 @@ namespace PHPUnit\TextUI\XmlConfiguration; use PHPUnit\TextUI\Configuration\ExtensionBootstrapCollection; use PHPUnit\TextUI\Configuration\Php; +use PHPUnit\TextUI\Configuration\Source; use PHPUnit\TextUI\Configuration\TestSuiteCollection; use PHPUnit\TextUI\XmlConfiguration\CodeCoverage\CodeCoverage; use PHPUnit\TextUI\XmlConfiguration\Logging\Logging; /** + * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit + * * @internal This class is not covered by the backward compatibility promise for PHPUnit * * @psalm-immutable @@ -23,6 +26,7 @@ use PHPUnit\TextUI\XmlConfiguration\Logging\Logging; abstract class Configuration { private readonly ExtensionBootstrapCollection $extensions; + private readonly Source $source; private readonly CodeCoverage $codeCoverage; private readonly Groups $groups; private readonly Logging $logging; @@ -30,9 +34,10 @@ abstract class Configuration private readonly PHPUnit $phpunit; private readonly TestSuiteCollection $testSuite; - public function __construct(ExtensionBootstrapCollection $extensions, CodeCoverage $codeCoverage, Groups $groups, Logging $logging, Php $php, PHPUnit $phpunit, TestSuiteCollection $testSuite) + public function __construct(ExtensionBootstrapCollection $extensions, Source $source, CodeCoverage $codeCoverage, Groups $groups, Logging $logging, Php $php, PHPUnit $phpunit, TestSuiteCollection $testSuite) { $this->extensions = $extensions; + $this->source = $source; $this->codeCoverage = $codeCoverage; $this->groups = $groups; $this->logging = $logging; @@ -46,6 +51,11 @@ abstract class Configuration return $this->extensions; } + public function source(): Source + { + return $this->source; + } + public function codeCoverage(): CodeCoverage { return $this->codeCoverage; diff --git a/vendor/phpunit/phpunit/src/TextUI/Configuration/Xml/DefaultConfiguration.php b/vendor/phpunit/phpunit/src/TextUI/Configuration/Xml/DefaultConfiguration.php index 3e783260..aa9b8fc9 100644 --- a/vendor/phpunit/phpunit/src/TextUI/Configuration/Xml/DefaultConfiguration.php +++ b/vendor/phpunit/phpunit/src/TextUI/Configuration/Xml/DefaultConfiguration.php @@ -18,12 +18,15 @@ use PHPUnit\TextUI\Configuration\FilterDirectoryCollection as CodeCoverageFilter use PHPUnit\TextUI\Configuration\GroupCollection; use PHPUnit\TextUI\Configuration\IniSettingCollection; use PHPUnit\TextUI\Configuration\Php; +use PHPUnit\TextUI\Configuration\Source; use PHPUnit\TextUI\Configuration\TestSuiteCollection; use PHPUnit\TextUI\Configuration\VariableCollection; use PHPUnit\TextUI\XmlConfiguration\CodeCoverage\CodeCoverage; use PHPUnit\TextUI\XmlConfiguration\Logging\Logging; /** + * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit + * * @internal This class is not covered by the backward compatibility promise for PHPUnit * * @psalm-immutable @@ -34,6 +37,24 @@ final class DefaultConfiguration extends Configuration { return new self( ExtensionBootstrapCollection::fromArray([]), + new Source( + null, + false, + CodeCoverageFilterDirectoryCollection::fromArray([]), + FileCollection::fromArray([]), + CodeCoverageFilterDirectoryCollection::fromArray([]), + FileCollection::fromArray([]), + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + ), new CodeCoverage( null, CodeCoverageFilterDirectoryCollection::fromArray([]), @@ -50,17 +71,17 @@ final class DefaultConfiguration extends Configuration null, null, null, - null + null, ), new Groups( GroupCollection::fromArray([]), - GroupCollection::fromArray([]) + GroupCollection::fromArray([]), ), new Logging( null, null, null, - null + null, ), new Php( DirectoryCollection::fromArray([]), @@ -73,7 +94,7 @@ final class DefaultConfiguration extends Configuration VariableCollection::fromArray([]), VariableCollection::fromArray([]), VariableCollection::fromArray([]), - VariableCollection::fromArray([]) + VariableCollection::fromArray([]), ), new PHPUnit( null, @@ -90,11 +111,20 @@ final class DefaultConfiguration extends Configuration false, false, false, + false, + false, null, false, false, false, false, + true, + false, + false, + false, + false, + false, + false, false, false, false, @@ -121,9 +151,11 @@ final class DefaultConfiguration extends Configuration false, false, false, - false + false, + false, + 100, ), - TestSuiteCollection::fromArray([]) + TestSuiteCollection::fromArray([]), ); } diff --git a/vendor/phpunit/phpunit/src/TextUI/Configuration/Xml/Exception.php b/vendor/phpunit/phpunit/src/TextUI/Configuration/Xml/Exception.php index 162b37e8..60c3c9ac 100644 --- a/vendor/phpunit/phpunit/src/TextUI/Configuration/Xml/Exception.php +++ b/vendor/phpunit/phpunit/src/TextUI/Configuration/Xml/Exception.php @@ -12,6 +12,8 @@ namespace PHPUnit\TextUI\XmlConfiguration; use RuntimeException; /** + * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit + * * @internal This class is not covered by the backward compatibility promise for PHPUnit */ final class Exception extends RuntimeException implements \PHPUnit\Exception diff --git a/vendor/phpunit/phpunit/src/TextUI/Configuration/Xml/Generator.php b/vendor/phpunit/phpunit/src/TextUI/Configuration/Xml/Generator.php index 2b961a98..865fb5d4 100644 --- a/vendor/phpunit/phpunit/src/TextUI/Configuration/Xml/Generator.php +++ b/vendor/phpunit/phpunit/src/TextUI/Configuration/Xml/Generator.php @@ -12,6 +12,8 @@ namespace PHPUnit\TextUI\XmlConfiguration; use function str_replace; /** + * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit + * * @internal This class is not covered by the backward compatibility promise for PHPUnit */ final class Generator @@ -29,6 +31,8 @@ final class Generator requireCoverageMetadata="true" beStrictAboutCoverageMetadata="true" beStrictAboutOutputDuringTests="true" + displayDetailsOnPhpunitDeprecations="true" + failOnPhpunitDeprecation="true" failOnRisky="true" failOnWarning="true"> @@ -37,11 +41,11 @@ final class Generator - + - {src_directory} + {src_directory} - +
    EOT; @@ -63,7 +67,7 @@ EOT; $srcDirectory, $cacheDirectory, ], - self::TEMPLATE + self::TEMPLATE, ); } } diff --git a/vendor/phpunit/phpunit/src/TextUI/Configuration/Xml/Groups.php b/vendor/phpunit/phpunit/src/TextUI/Configuration/Xml/Groups.php index e8f61b5e..d89908ca 100644 --- a/vendor/phpunit/phpunit/src/TextUI/Configuration/Xml/Groups.php +++ b/vendor/phpunit/phpunit/src/TextUI/Configuration/Xml/Groups.php @@ -12,6 +12,8 @@ namespace PHPUnit\TextUI\XmlConfiguration; use PHPUnit\TextUI\Configuration\GroupCollection; /** + * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit + * * @internal This class is not covered by the backward compatibility promise for PHPUnit * * @psalm-immutable diff --git a/vendor/phpunit/phpunit/src/TextUI/Configuration/Xml/LoadedFromFileConfiguration.php b/vendor/phpunit/phpunit/src/TextUI/Configuration/Xml/LoadedFromFileConfiguration.php index bacf0ba4..31106ed9 100644 --- a/vendor/phpunit/phpunit/src/TextUI/Configuration/Xml/LoadedFromFileConfiguration.php +++ b/vendor/phpunit/phpunit/src/TextUI/Configuration/Xml/LoadedFromFileConfiguration.php @@ -11,12 +11,14 @@ namespace PHPUnit\TextUI\XmlConfiguration; use PHPUnit\TextUI\Configuration\ExtensionBootstrapCollection; use PHPUnit\TextUI\Configuration\Php; +use PHPUnit\TextUI\Configuration\Source; use PHPUnit\TextUI\Configuration\TestSuiteCollection; use PHPUnit\TextUI\XmlConfiguration\CodeCoverage\CodeCoverage; use PHPUnit\TextUI\XmlConfiguration\Logging\Logging; -use PHPUnit\Util\Xml\ValidationResult; /** + * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit + * * @internal This class is not covered by the backward compatibility promise for PHPUnit * * @psalm-immutable @@ -26,19 +28,20 @@ final class LoadedFromFileConfiguration extends Configuration private readonly string $filename; private readonly ValidationResult $validationResult; - public function __construct(string $filename, ValidationResult $validationResult, ExtensionBootstrapCollection $extensions, CodeCoverage $codeCoverage, Groups $groups, Logging $logging, Php $php, PHPUnit $phpunit, TestSuiteCollection $testSuite) + public function __construct(string $filename, ValidationResult $validationResult, ExtensionBootstrapCollection $extensions, Source $source, CodeCoverage $codeCoverage, Groups $groups, Logging $logging, Php $php, PHPUnit $phpunit, TestSuiteCollection $testSuite) { $this->filename = $filename; $this->validationResult = $validationResult; parent::__construct( $extensions, + $source, $codeCoverage, $groups, $logging, $php, $phpunit, - $testSuite + $testSuite, ); } diff --git a/vendor/phpunit/phpunit/src/TextUI/Configuration/Xml/Loader.php b/vendor/phpunit/phpunit/src/TextUI/Configuration/Xml/Loader.php index f28e3178..bc7b420c 100644 --- a/vendor/phpunit/phpunit/src/TextUI/Configuration/Xml/Loader.php +++ b/vendor/phpunit/phpunit/src/TextUI/Configuration/Xml/Loader.php @@ -15,21 +15,22 @@ use function assert; use function defined; use function dirname; use function explode; -use function is_file; use function is_numeric; use function preg_match; +use function realpath; use function str_contains; use function str_starts_with; -use function stream_resolve_include_path; use function strlen; use function strtolower; use function substr; use function trim; use DOMDocument; use DOMElement; +use DOMNode; use DOMXPath; use PHPUnit\Runner\TestSuiteSorter; use PHPUnit\Runner\Version; +use PHPUnit\TextUI\Configuration\Configuration; use PHPUnit\TextUI\Configuration\Constant; use PHPUnit\TextUI\Configuration\ConstantCollection; use PHPUnit\TextUI\Configuration\Directory; @@ -45,6 +46,7 @@ use PHPUnit\TextUI\Configuration\GroupCollection; use PHPUnit\TextUI\Configuration\IniSetting; use PHPUnit\TextUI\Configuration\IniSettingCollection; use PHPUnit\TextUI\Configuration\Php; +use PHPUnit\TextUI\Configuration\Source; use PHPUnit\TextUI\Configuration\TestDirectory; use PHPUnit\TextUI\Configuration\TestDirectoryCollection; use PHPUnit\TextUI\Configuration\TestFile; @@ -68,13 +70,13 @@ use PHPUnit\TextUI\XmlConfiguration\Logging\TestDox\Html as TestDoxHtml; use PHPUnit\TextUI\XmlConfiguration\Logging\TestDox\Text as TestDoxText; use PHPUnit\Util\VersionComparisonOperator; use PHPUnit\Util\Xml\Loader as XmlLoader; -use PHPUnit\Util\Xml\SchemaFinder; -use PHPUnit\Util\Xml\Validator; use PHPUnit\Util\Xml\XmlException; use SebastianBergmann\CodeCoverage\Report\Html\Colors; use SebastianBergmann\CodeCoverage\Report\Thresholds; /** + * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit + * * @internal This class is not covered by the backward compatibility promise for PHPUnit */ final class Loader @@ -85,12 +87,12 @@ final class Loader public function load(string $filename): LoadedFromFileConfiguration { try { - $document = (new XmlLoader)->loadFile($filename, false, true, true); + $document = (new XmlLoader)->loadFile($filename); } catch (XmlException $e) { throw new Exception( $e->getMessage(), $e->getCode(), - $e + $e, ); } @@ -98,24 +100,27 @@ final class Loader try { $xsdFilename = (new SchemaFinder)->find(Version::series()); - } catch (XmlException $e) { + } catch (CannotFindSchemaException $e) { throw new Exception( $e->getMessage(), $e->getCode(), - $e + $e, ); } + $configurationFileRealpath = realpath($filename); + return new LoadedFromFileConfiguration( - $filename, + $configurationFileRealpath, (new Validator)->validate($document, $xsdFilename), $this->extensions($xpath), - $this->codeCoverage($filename, $xpath), + $this->source($configurationFileRealpath, $xpath), + $this->codeCoverage($configurationFileRealpath, $xpath), $this->groups($xpath), - $this->logging($filename, $xpath), - $this->php($filename, $xpath), - $this->phpunit($filename, $document), - $this->testSuite($filename, $xpath) + $this->logging($configurationFileRealpath, $xpath), + $this->php($configurationFileRealpath, $xpath), + $this->phpunit($configurationFileRealpath, $document), + $this->testSuite($configurationFileRealpath, $xpath), ); } @@ -129,9 +134,9 @@ final class Loader new File( $this->toAbsolutePath( $filename, - (string) $this->getStringAttribute($element, 'outputFile') - ) - ) + (string) $this->getStringAttribute($element, 'outputFile'), + ), + ), ); } @@ -143,9 +148,9 @@ final class Loader new File( $this->toAbsolutePath( $filename, - (string) $this->getStringAttribute($element, 'outputFile') - ) - ) + (string) $this->getStringAttribute($element, 'outputFile'), + ), + ), ); } @@ -157,9 +162,9 @@ final class Loader new File( $this->toAbsolutePath( $filename, - (string) $this->getStringAttribute($element, 'outputFile') - ) - ) + (string) $this->getStringAttribute($element, 'outputFile'), + ), + ), ); } @@ -171,9 +176,9 @@ final class Loader new File( $this->toAbsolutePath( $filename, - (string) $this->getStringAttribute($element, 'outputFile') - ) - ) + (string) $this->getStringAttribute($element, 'outputFile'), + ), + ), ); } @@ -181,7 +186,7 @@ final class Loader $junit, $teamCity, $testDoxHtml, - $testDoxText + $testDoxText, ); } @@ -202,14 +207,17 @@ final class Loader $extensionBootstrappers[] = new ExtensionBootstrap( $bootstrap->getAttribute('class'), - $parameters + $parameters, ); } return ExtensionBootstrapCollection::fromArray($extensionBootstrappers); } - private function toAbsolutePath(string $filename, string $path, bool $useIncludePath = false): string + /** + * @psalm-return non-empty-string + */ + private function toAbsolutePath(string $filename, string $path): string { $path = trim($path); @@ -226,6 +234,7 @@ final class Loader // - C:/windows // - c:/windows if (defined('PHP_WINDOWS_VERSION_BUILD') && + !empty($path) && ($path[0] === '\\' || (strlen($path) >= 3 && preg_match('#^[A-Z]:[/\\\]#i', substr($path, 0, 3))))) { return $path; } @@ -234,17 +243,62 @@ final class Loader return $path; } - $file = dirname($filename) . DIRECTORY_SEPARATOR . $path; + return dirname($filename) . DIRECTORY_SEPARATOR . $path; + } - if ($useIncludePath && !is_file($file)) { - $includePathFile = stream_resolve_include_path($path); + private function source(string $filename, DOMXPath $xpath): Source + { + $baseline = null; + $restrictDeprecations = false; + $restrictNotices = false; + $restrictWarnings = false; + $ignoreSuppressionOfDeprecations = false; + $ignoreSuppressionOfPhpDeprecations = false; + $ignoreSuppressionOfErrors = false; + $ignoreSuppressionOfNotices = false; + $ignoreSuppressionOfPhpNotices = false; + $ignoreSuppressionOfWarnings = false; + $ignoreSuppressionOfPhpWarnings = false; - if ($includePathFile) { - $file = $includePathFile; + $element = $this->element($xpath, 'source'); + + if ($element) { + $baseline = $this->getStringAttribute($element, 'baseline'); + + if ($baseline !== null) { + $baseline = $this->toAbsolutePath($filename, $baseline); } + + $restrictDeprecations = $this->getBooleanAttribute($element, 'restrictDeprecations', false); + $restrictNotices = $this->getBooleanAttribute($element, 'restrictNotices', false); + $restrictWarnings = $this->getBooleanAttribute($element, 'restrictWarnings', false); + $ignoreSuppressionOfDeprecations = $this->getBooleanAttribute($element, 'ignoreSuppressionOfDeprecations', false); + $ignoreSuppressionOfPhpDeprecations = $this->getBooleanAttribute($element, 'ignoreSuppressionOfPhpDeprecations', false); + $ignoreSuppressionOfErrors = $this->getBooleanAttribute($element, 'ignoreSuppressionOfErrors', false); + $ignoreSuppressionOfNotices = $this->getBooleanAttribute($element, 'ignoreSuppressionOfNotices', false); + $ignoreSuppressionOfPhpNotices = $this->getBooleanAttribute($element, 'ignoreSuppressionOfPhpNotices', false); + $ignoreSuppressionOfWarnings = $this->getBooleanAttribute($element, 'ignoreSuppressionOfWarnings', false); + $ignoreSuppressionOfPhpWarnings = $this->getBooleanAttribute($element, 'ignoreSuppressionOfPhpWarnings', false); } - return $file; + return new Source( + $baseline, + false, + $this->readFilterDirectories($filename, $xpath, 'source/include/directory'), + $this->readFilterFiles($filename, $xpath, 'source/include/file'), + $this->readFilterDirectories($filename, $xpath, 'source/exclude/directory'), + $this->readFilterFiles($filename, $xpath, 'source/exclude/file'), + $restrictDeprecations, + $restrictNotices, + $restrictWarnings, + $ignoreSuppressionOfDeprecations, + $ignoreSuppressionOfPhpDeprecations, + $ignoreSuppressionOfErrors, + $ignoreSuppressionOfNotices, + $ignoreSuppressionOfPhpNotices, + $ignoreSuppressionOfWarnings, + $ignoreSuppressionOfPhpWarnings, + ); } private function codeCoverage(string $filename, DOMXPath $xpath): CodeCoverage @@ -262,32 +316,32 @@ final class Loader if ($cacheDirectory !== null) { $cacheDirectory = new Directory( - $this->toAbsolutePath($filename, $cacheDirectory) + $this->toAbsolutePath($filename, $cacheDirectory), ); } $pathCoverage = $this->getBooleanAttribute( $element, 'pathCoverage', - false + false, ); $includeUncoveredFiles = $this->getBooleanAttribute( $element, 'includeUncoveredFiles', - true + true, ); $ignoreDeprecatedCodeUnits = $this->getBooleanAttribute( $element, 'ignoreDeprecatedCodeUnits', - false + false, ); $disableCodeCoverageIgnore = $this->getBooleanAttribute( $element, 'disableCodeCoverageIgnore', - false + false, ); } @@ -299,9 +353,9 @@ final class Loader new File( $this->toAbsolutePath( $filename, - (string) $this->getStringAttribute($element, 'outputFile') - ) - ) + (string) $this->getStringAttribute($element, 'outputFile'), + ), + ), ); } @@ -313,9 +367,9 @@ final class Loader new File( $this->toAbsolutePath( $filename, - (string) $this->getStringAttribute($element, 'outputFile') - ) - ) + (string) $this->getStringAttribute($element, 'outputFile'), + ), + ), ); } @@ -327,10 +381,10 @@ final class Loader new File( $this->toAbsolutePath( $filename, - (string) $this->getStringAttribute($element, 'outputFile') - ) + (string) $this->getStringAttribute($element, 'outputFile'), + ), ), - $this->getIntegerAttribute($element, 'threshold', 30) + $this->getIntegerAttribute($element, 'threshold', 30), ); } @@ -345,8 +399,8 @@ final class Loader new Directory( $this->toAbsolutePath( $filename, - (string) $this->getStringAttribute($element, 'outputDirectory') - ) + (string) $this->getStringAttribute($element, 'outputDirectory'), + ), ), $this->getIntegerAttribute($element, 'lowUpperBound', $defaultThresholds->lowUpperBound()), $this->getIntegerAttribute($element, 'highLowerBound', $defaultThresholds->highLowerBound()), @@ -355,7 +409,7 @@ final class Loader $this->getStringAttributeWithDefault($element, 'colorSuccessHigh', $defaultColors->successHigh()), $this->getStringAttributeWithDefault($element, 'colorWarning', $defaultColors->warning()), $this->getStringAttributeWithDefault($element, 'colorDanger', $defaultColors->danger()), - $this->getStringAttribute($element, 'customCssFile') + $this->getStringAttribute($element, 'customCssFile'), ); } @@ -367,9 +421,9 @@ final class Loader new File( $this->toAbsolutePath( $filename, - (string) $this->getStringAttribute($element, 'outputFile') - ) - ) + (string) $this->getStringAttribute($element, 'outputFile'), + ), + ), ); } @@ -381,11 +435,11 @@ final class Loader new File( $this->toAbsolutePath( $filename, - (string) $this->getStringAttribute($element, 'outputFile') - ) + (string) $this->getStringAttribute($element, 'outputFile'), + ), ), $this->getBooleanAttribute($element, 'showUncoveredFiles', false), - $this->getBooleanAttribute($element, 'showOnlySummary', false) + $this->getBooleanAttribute($element, 'showOnlySummary', false), ); } @@ -397,9 +451,9 @@ final class Loader new Directory( $this->toAbsolutePath( $filename, - (string) $this->getStringAttribute($element, 'outputDirectory') - ) - ) + (string) $this->getStringAttribute($element, 'outputDirectory'), + ), + ), ); } @@ -419,11 +473,11 @@ final class Loader $html, $php, $text, - $xml + $xml, ); } - private function getBoolean(string $value, bool|string $default): bool|string + private function getBoolean(string $value, bool $default): bool { if (strtolower($value) === 'false') { return false; @@ -436,6 +490,19 @@ final class Loader return $default; } + private function getValue(string $value): bool|string + { + if (strtolower($value) === 'false') { + return false; + } + + if (strtolower($value) === 'true') { + return true; + } + + return $value; + } + private function readFilterDirectories(string $filename, DOMXPath $xpath, string $query): FilterDirectoryCollection { $directories = []; @@ -464,6 +531,8 @@ final class Loader $files = []; foreach ($xpath->query($query) as $file) { + assert($file instanceof DOMNode); + $filePath = $file->textContent; if ($filePath) { @@ -479,17 +548,21 @@ final class Loader $include = []; $exclude = []; - foreach ($xpath->query('groups' . '/include/group') as $group) { + foreach ($xpath->query('groups/include/group') as $group) { + assert($group instanceof DOMNode); + $include[] = new Group($group->textContent); } - foreach ($xpath->query('groups' . '/exclude/group') as $group) { + foreach ($xpath->query('groups/exclude/group') as $group) { + assert($group instanceof DOMNode); + $exclude[] = new Group($group->textContent); } return new Groups( GroupCollection::fromArray($include), - GroupCollection::fromArray($exclude) + GroupCollection::fromArray($exclude), ); } @@ -499,9 +572,9 @@ final class Loader return $default; } - return (bool) $this->getBoolean( + return $this->getBoolean( $element->getAttribute($attribute), - false + false, ); } @@ -513,7 +586,7 @@ final class Loader return $this->getInteger( $element->getAttribute($attribute), - $default + $default, ); } @@ -549,6 +622,8 @@ final class Loader $includePaths = []; foreach ($xpath->query('php/includePath') as $includePath) { + assert($includePath instanceof DOMNode); + $path = $includePath->textContent; if ($path) { @@ -563,7 +638,7 @@ final class Loader $iniSettings[] = new IniSetting( $ini->getAttribute('name'), - $ini->getAttribute('value') + $ini->getAttribute('value'), ); } @@ -576,7 +651,7 @@ final class Loader $constants[] = new Constant( $const->getAttribute('name'), - $this->getBoolean($value, $value) + $this->getValue($value), ); } @@ -601,7 +676,7 @@ final class Loader $verbatim = false; if ($var->hasAttribute('force')) { - $force = (bool) $this->getBoolean($var->getAttribute('force'), false); + $force = $this->getBoolean($var->getAttribute('force'), false); } if ($var->hasAttribute('verbatim')) { @@ -609,7 +684,7 @@ final class Loader } if (!$verbatim) { - $value = $this->getBoolean($value, $value); + $value = $this->getValue($value); } $variables[$array][] = new Variable($name, $value, $force); @@ -740,9 +815,11 @@ final class Loader $this->getColumns($document), $this->getColors($document), $this->getBooleanAttribute($document->documentElement, 'stderr', false), + $this->getBooleanAttribute($document->documentElement, 'displayDetailsOnAllIssues', false), $this->getBooleanAttribute($document->documentElement, 'displayDetailsOnIncompleteTests', false), $this->getBooleanAttribute($document->documentElement, 'displayDetailsOnSkippedTests', false), $this->getBooleanAttribute($document->documentElement, 'displayDetailsOnTestsThatTriggerDeprecations', false), + $this->getBooleanAttribute($document->documentElement, 'displayDetailsOnPhpunitDeprecations', false), $this->getBooleanAttribute($document->documentElement, 'displayDetailsOnTestsThatTriggerErrors', false), $this->getBooleanAttribute($document->documentElement, 'displayDetailsOnTestsThatTriggerNotices', false), $this->getBooleanAttribute($document->documentElement, 'displayDetailsOnTestsThatTriggerWarnings', false), @@ -750,18 +827,25 @@ final class Loader $requireCoverageMetadata, $bootstrap, $this->getBooleanAttribute($document->documentElement, 'processIsolation', false), + $this->getBooleanAttribute($document->documentElement, 'failOnAllIssues', false), + $this->getBooleanAttribute($document->documentElement, 'failOnDeprecation', false), + $this->getBooleanAttribute($document->documentElement, 'failOnPhpunitDeprecation', false), + $this->getBooleanAttribute($document->documentElement, 'failOnPhpunitWarning', true), $this->getBooleanAttribute($document->documentElement, 'failOnEmptyTestSuite', false), $this->getBooleanAttribute($document->documentElement, 'failOnIncomplete', false), + $this->getBooleanAttribute($document->documentElement, 'failOnNotice', false), $this->getBooleanAttribute($document->documentElement, 'failOnRisky', false), $this->getBooleanAttribute($document->documentElement, 'failOnSkipped', false), $this->getBooleanAttribute($document->documentElement, 'failOnWarning', false), $this->getBooleanAttribute($document->documentElement, 'stopOnDefect', false), + $this->getBooleanAttribute($document->documentElement, 'stopOnDeprecation', false), $this->getBooleanAttribute($document->documentElement, 'stopOnError', false), $this->getBooleanAttribute($document->documentElement, 'stopOnFailure', false), - $this->getBooleanAttribute($document->documentElement, 'stopOnWarning', false), $this->getBooleanAttribute($document->documentElement, 'stopOnIncomplete', false), + $this->getBooleanAttribute($document->documentElement, 'stopOnNotice', false), $this->getBooleanAttribute($document->documentElement, 'stopOnRisky', false), $this->getBooleanAttribute($document->documentElement, 'stopOnSkipped', false), + $this->getBooleanAttribute($document->documentElement, 'stopOnWarning', false), $extensionsDirectory, $this->getBooleanAttribute($document->documentElement, 'beStrictAboutChangesToGlobalState', false), $this->getBooleanAttribute($document->documentElement, 'beStrictAboutOutputDuringTests', false), @@ -779,21 +863,23 @@ final class Loader $this->getBooleanAttribute($document->documentElement, 'backupGlobals', false), $backupStaticProperties, $this->getBooleanAttribute($document->documentElement, 'registerMockObjectsFromTestArgumentsRecursively', false), - $this->getBooleanAttribute($document->documentElement, 'testdox', false) + $this->getBooleanAttribute($document->documentElement, 'testdox', false), + $this->getBooleanAttribute($document->documentElement, 'controlGarbageCollector', false), + $this->getIntegerAttribute($document->documentElement, 'numberOfTestsBeforeGarbageCollection', 100), ); } private function getColors(DOMDocument $document): string { - $colors = \PHPUnit\TextUI\Configuration\Configuration::COLOR_DEFAULT; + $colors = Configuration::COLOR_DEFAULT; if ($document->documentElement->hasAttribute('colors')) { /* only allow boolean for compatibility with previous versions 'always' only allowed from command line */ if ($this->getBoolean($document->documentElement->getAttribute('colors'), false)) { - $colors = \PHPUnit\TextUI\Configuration\Configuration::COLOR_AUTO; + $colors = Configuration::COLOR_AUTO; } else { - $colors = \PHPUnit\TextUI\Configuration\Configuration::COLOR_NEVER; + $colors = Configuration::COLOR_NEVER; } } @@ -870,7 +956,7 @@ final class Loader $prefix, $suffix, $phpVersion, - $phpVersionOperator + $phpVersionOperator, ); } @@ -900,15 +986,19 @@ final class Loader $files[] = new TestFile( $this->toAbsolutePath($filename, $file), $phpVersion, - $phpVersionOperator + $phpVersionOperator, ); } + $name = $element->getAttribute('name'); + + assert(!empty($name)); + $testSuites[] = new TestSuiteConfiguration( - $element->getAttribute('name'), + $name, TestDirectoryCollection::fromArray($directories), TestFileCollection::fromArray($files), - FileCollection::fromArray($exclude) + FileCollection::fromArray($exclude), ); } diff --git a/vendor/phpunit/phpunit/src/TextUI/Configuration/Xml/Logging/Junit.php b/vendor/phpunit/phpunit/src/TextUI/Configuration/Xml/Logging/Junit.php index 020144b8..406aaf2b 100644 --- a/vendor/phpunit/phpunit/src/TextUI/Configuration/Xml/Logging/Junit.php +++ b/vendor/phpunit/phpunit/src/TextUI/Configuration/Xml/Logging/Junit.php @@ -12,6 +12,8 @@ namespace PHPUnit\TextUI\XmlConfiguration\Logging; use PHPUnit\TextUI\Configuration\File; /** + * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit + * * @internal This class is not covered by the backward compatibility promise for PHPUnit * * @psalm-immutable diff --git a/vendor/phpunit/phpunit/src/TextUI/Configuration/Xml/Logging/Logging.php b/vendor/phpunit/phpunit/src/TextUI/Configuration/Xml/Logging/Logging.php index 587f727f..8fc34394 100644 --- a/vendor/phpunit/phpunit/src/TextUI/Configuration/Xml/Logging/Logging.php +++ b/vendor/phpunit/phpunit/src/TextUI/Configuration/Xml/Logging/Logging.php @@ -14,6 +14,8 @@ use PHPUnit\TextUI\XmlConfiguration\Logging\TestDox\Html as TestDoxHtml; use PHPUnit\TextUI\XmlConfiguration\Logging\TestDox\Text as TestDoxText; /** + * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit + * * @internal This class is not covered by the backward compatibility promise for PHPUnit * * @psalm-immutable diff --git a/vendor/phpunit/phpunit/src/TextUI/Configuration/Xml/Logging/TeamCity.php b/vendor/phpunit/phpunit/src/TextUI/Configuration/Xml/Logging/TeamCity.php index 263fcf0d..2025c1f4 100644 --- a/vendor/phpunit/phpunit/src/TextUI/Configuration/Xml/Logging/TeamCity.php +++ b/vendor/phpunit/phpunit/src/TextUI/Configuration/Xml/Logging/TeamCity.php @@ -12,6 +12,8 @@ namespace PHPUnit\TextUI\XmlConfiguration\Logging; use PHPUnit\TextUI\Configuration\File; /** + * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit + * * @internal This class is not covered by the backward compatibility promise for PHPUnit * * @psalm-immutable diff --git a/vendor/phpunit/phpunit/src/TextUI/Configuration/Xml/Logging/TestDox/Html.php b/vendor/phpunit/phpunit/src/TextUI/Configuration/Xml/Logging/TestDox/Html.php index 8cfb00e2..e52587bb 100644 --- a/vendor/phpunit/phpunit/src/TextUI/Configuration/Xml/Logging/TestDox/Html.php +++ b/vendor/phpunit/phpunit/src/TextUI/Configuration/Xml/Logging/TestDox/Html.php @@ -12,6 +12,8 @@ namespace PHPUnit\TextUI\XmlConfiguration\Logging\TestDox; use PHPUnit\TextUI\Configuration\File; /** + * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit + * * @internal This class is not covered by the backward compatibility promise for PHPUnit * * @psalm-immutable diff --git a/vendor/phpunit/phpunit/src/TextUI/Configuration/Xml/Logging/TestDox/Text.php b/vendor/phpunit/phpunit/src/TextUI/Configuration/Xml/Logging/TestDox/Text.php index b91c793d..db47a3ef 100644 --- a/vendor/phpunit/phpunit/src/TextUI/Configuration/Xml/Logging/TestDox/Text.php +++ b/vendor/phpunit/phpunit/src/TextUI/Configuration/Xml/Logging/TestDox/Text.php @@ -12,6 +12,8 @@ namespace PHPUnit\TextUI\XmlConfiguration\Logging\TestDox; use PHPUnit\TextUI\Configuration\File; /** + * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit + * * @internal This class is not covered by the backward compatibility promise for PHPUnit * * @psalm-immutable diff --git a/vendor/phpunit/phpunit/src/TextUI/Configuration/Xml/Migration/MigrationBuilder.php b/vendor/phpunit/phpunit/src/TextUI/Configuration/Xml/Migration/MigrationBuilder.php index 4e4f5073..e4364b7d 100644 --- a/vendor/phpunit/phpunit/src/TextUI/Configuration/Xml/Migration/MigrationBuilder.php +++ b/vendor/phpunit/phpunit/src/TextUI/Configuration/Xml/Migration/MigrationBuilder.php @@ -9,11 +9,11 @@ */ namespace PHPUnit\TextUI\XmlConfiguration; -use function array_key_exists; -use function sprintf; use function version_compare; /** + * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit + * * @internal This class is not covered by the backward compatibility promise for PHPUnit */ final class MigrationBuilder @@ -28,7 +28,7 @@ final class MigrationBuilder IntroduceCoverageElement::class, MoveAttributesFromRootToCoverage::class, MoveAttributesFromFilterWhitelistToCoverage::class, - MoveWhitelistDirectoriesToCoverage::class, + MoveWhitelistIncludesToCoverage::class, MoveWhitelistExcludesToCoverage::class, RemoveEmptyFilter::class, CoverageCloverToReport::class, @@ -40,7 +40,7 @@ final class MigrationBuilder ConvertLogTypes::class, ], - '9.5' => [ + '9.6' => [ RemoveListeners::class, RemoveTestSuiteLoaderAttributes::class, RemoveCacheResultFileAttribute::class, @@ -59,22 +59,18 @@ final class MigrationBuilder RemoveLoggingElements::class, RemoveTestDoxGroupsElement::class, ], + + '10.0' => [ + MoveCoverageDirectoriesToSource::class, + ], + + '10.4' => [ + RemoveBeStrictAboutTodoAnnotatedTestsAttribute::class, + ], ]; - /** - * @throws MigrationBuilderException - */ public function build(string $fromVersion): array { - if (!array_key_exists($fromVersion, self::AVAILABLE_MIGRATIONS)) { - throw new MigrationBuilderException( - sprintf( - 'Migration from schema version %s is not supported', - $fromVersion - ) - ); - } - $stack = [new UpdateSchemaLocation]; foreach (self::AVAILABLE_MIGRATIONS as $version => $migrations) { diff --git a/vendor/phpunit/phpunit/src/TextUI/Configuration/Xml/Migration/MigrationBuilderException.php b/vendor/phpunit/phpunit/src/TextUI/Configuration/Xml/Migration/MigrationBuilderException.php deleted file mode 100644 index 3d3c767a..00000000 --- a/vendor/phpunit/phpunit/src/TextUI/Configuration/Xml/Migration/MigrationBuilderException.php +++ /dev/null @@ -1,19 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace PHPUnit\TextUI\XmlConfiguration; - -use RuntimeException; - -/** - * @internal This class is not covered by the backward compatibility promise for PHPUnit - */ -final class MigrationBuilderException extends RuntimeException implements \PHPUnit\Exception -{ -} diff --git a/vendor/phpunit/phpunit/src/TextUI/Configuration/Xml/Migration/MigrationException.php b/vendor/phpunit/phpunit/src/TextUI/Configuration/Xml/Migration/MigrationException.php index f92b2db3..bb35aca6 100644 --- a/vendor/phpunit/phpunit/src/TextUI/Configuration/Xml/Migration/MigrationException.php +++ b/vendor/phpunit/phpunit/src/TextUI/Configuration/Xml/Migration/MigrationException.php @@ -9,11 +9,14 @@ */ namespace PHPUnit\TextUI\XmlConfiguration; +use PHPUnit\Exception; use RuntimeException; /** + * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit + * * @internal This class is not covered by the backward compatibility promise for PHPUnit */ -final class MigrationException extends RuntimeException implements \PHPUnit\Exception +final class MigrationException extends RuntimeException implements Exception { } diff --git a/vendor/phpunit/phpunit/src/TextUI/Configuration/Xml/Migration/Migrations/ConvertLogTypes.php b/vendor/phpunit/phpunit/src/TextUI/Configuration/Xml/Migration/Migrations/ConvertLogTypes.php index 697bbe08..43a9bf15 100644 --- a/vendor/phpunit/phpunit/src/TextUI/Configuration/Xml/Migration/Migrations/ConvertLogTypes.php +++ b/vendor/phpunit/phpunit/src/TextUI/Configuration/Xml/Migration/Migrations/ConvertLogTypes.php @@ -13,6 +13,8 @@ use DOMDocument; use DOMElement; /** + * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit + * * @internal This class is not covered by the backward compatibility promise for PHPUnit */ final class ConvertLogTypes implements Migration diff --git a/vendor/phpunit/phpunit/src/TextUI/Configuration/Xml/Migration/Migrations/CoverageCloverToReport.php b/vendor/phpunit/phpunit/src/TextUI/Configuration/Xml/Migration/Migrations/CoverageCloverToReport.php index ccefbfbc..7d3ee496 100644 --- a/vendor/phpunit/phpunit/src/TextUI/Configuration/Xml/Migration/Migrations/CoverageCloverToReport.php +++ b/vendor/phpunit/phpunit/src/TextUI/Configuration/Xml/Migration/Migrations/CoverageCloverToReport.php @@ -12,6 +12,8 @@ namespace PHPUnit\TextUI\XmlConfiguration; use DOMElement; /** + * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit + * * @internal This class is not covered by the backward compatibility promise for PHPUnit */ final class CoverageCloverToReport extends LogToReportMigration diff --git a/vendor/phpunit/phpunit/src/TextUI/Configuration/Xml/Migration/Migrations/CoverageCrap4jToReport.php b/vendor/phpunit/phpunit/src/TextUI/Configuration/Xml/Migration/Migrations/CoverageCrap4jToReport.php index afbaaec1..2b494780 100644 --- a/vendor/phpunit/phpunit/src/TextUI/Configuration/Xml/Migration/Migrations/CoverageCrap4jToReport.php +++ b/vendor/phpunit/phpunit/src/TextUI/Configuration/Xml/Migration/Migrations/CoverageCrap4jToReport.php @@ -12,6 +12,8 @@ namespace PHPUnit\TextUI\XmlConfiguration; use DOMElement; /** + * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit + * * @internal This class is not covered by the backward compatibility promise for PHPUnit */ final class CoverageCrap4jToReport extends LogToReportMigration diff --git a/vendor/phpunit/phpunit/src/TextUI/Configuration/Xml/Migration/Migrations/CoverageHtmlToReport.php b/vendor/phpunit/phpunit/src/TextUI/Configuration/Xml/Migration/Migrations/CoverageHtmlToReport.php index 7e12095b..64af982d 100644 --- a/vendor/phpunit/phpunit/src/TextUI/Configuration/Xml/Migration/Migrations/CoverageHtmlToReport.php +++ b/vendor/phpunit/phpunit/src/TextUI/Configuration/Xml/Migration/Migrations/CoverageHtmlToReport.php @@ -12,6 +12,8 @@ namespace PHPUnit\TextUI\XmlConfiguration; use DOMElement; /** + * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit + * * @internal This class is not covered by the backward compatibility promise for PHPUnit */ final class CoverageHtmlToReport extends LogToReportMigration diff --git a/vendor/phpunit/phpunit/src/TextUI/Configuration/Xml/Migration/Migrations/CoveragePhpToReport.php b/vendor/phpunit/phpunit/src/TextUI/Configuration/Xml/Migration/Migrations/CoveragePhpToReport.php index bfa10030..93868c47 100644 --- a/vendor/phpunit/phpunit/src/TextUI/Configuration/Xml/Migration/Migrations/CoveragePhpToReport.php +++ b/vendor/phpunit/phpunit/src/TextUI/Configuration/Xml/Migration/Migrations/CoveragePhpToReport.php @@ -12,6 +12,8 @@ namespace PHPUnit\TextUI\XmlConfiguration; use DOMElement; /** + * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit + * * @internal This class is not covered by the backward compatibility promise for PHPUnit */ final class CoveragePhpToReport extends LogToReportMigration diff --git a/vendor/phpunit/phpunit/src/TextUI/Configuration/Xml/Migration/Migrations/CoverageTextToReport.php b/vendor/phpunit/phpunit/src/TextUI/Configuration/Xml/Migration/Migrations/CoverageTextToReport.php index 063d8df0..f50be1d7 100644 --- a/vendor/phpunit/phpunit/src/TextUI/Configuration/Xml/Migration/Migrations/CoverageTextToReport.php +++ b/vendor/phpunit/phpunit/src/TextUI/Configuration/Xml/Migration/Migrations/CoverageTextToReport.php @@ -12,6 +12,8 @@ namespace PHPUnit\TextUI\XmlConfiguration; use DOMElement; /** + * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit + * * @internal This class is not covered by the backward compatibility promise for PHPUnit */ final class CoverageTextToReport extends LogToReportMigration diff --git a/vendor/phpunit/phpunit/src/TextUI/Configuration/Xml/Migration/Migrations/CoverageXmlToReport.php b/vendor/phpunit/phpunit/src/TextUI/Configuration/Xml/Migration/Migrations/CoverageXmlToReport.php index 480d7777..2ea7cdc8 100644 --- a/vendor/phpunit/phpunit/src/TextUI/Configuration/Xml/Migration/Migrations/CoverageXmlToReport.php +++ b/vendor/phpunit/phpunit/src/TextUI/Configuration/Xml/Migration/Migrations/CoverageXmlToReport.php @@ -12,6 +12,8 @@ namespace PHPUnit\TextUI\XmlConfiguration; use DOMElement; /** + * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit + * * @internal This class is not covered by the backward compatibility promise for PHPUnit */ final class CoverageXmlToReport extends LogToReportMigration diff --git a/vendor/phpunit/phpunit/src/TextUI/Configuration/Xml/Migration/Migrations/IntroduceCacheDirectoryAttribute.php b/vendor/phpunit/phpunit/src/TextUI/Configuration/Xml/Migration/Migrations/IntroduceCacheDirectoryAttribute.php index 4ac7331c..fe0e0a2b 100644 --- a/vendor/phpunit/phpunit/src/TextUI/Configuration/Xml/Migration/Migrations/IntroduceCacheDirectoryAttribute.php +++ b/vendor/phpunit/phpunit/src/TextUI/Configuration/Xml/Migration/Migrations/IntroduceCacheDirectoryAttribute.php @@ -14,6 +14,8 @@ use DOMDocument; use DOMElement; /** + * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit + * * @internal This class is not covered by the backward compatibility promise for PHPUnit */ final class IntroduceCacheDirectoryAttribute implements Migration diff --git a/vendor/phpunit/phpunit/src/TextUI/Configuration/Xml/Migration/Migrations/IntroduceCoverageElement.php b/vendor/phpunit/phpunit/src/TextUI/Configuration/Xml/Migration/Migrations/IntroduceCoverageElement.php index 867a8441..54b5485d 100644 --- a/vendor/phpunit/phpunit/src/TextUI/Configuration/Xml/Migration/Migrations/IntroduceCoverageElement.php +++ b/vendor/phpunit/phpunit/src/TextUI/Configuration/Xml/Migration/Migrations/IntroduceCoverageElement.php @@ -12,6 +12,8 @@ namespace PHPUnit\TextUI\XmlConfiguration; use DOMDocument; /** + * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit + * * @internal This class is not covered by the backward compatibility promise for PHPUnit */ final class IntroduceCoverageElement implements Migration @@ -22,7 +24,7 @@ final class IntroduceCoverageElement implements Migration $document->documentElement->insertBefore( $coverage, - $document->documentElement->firstChild + $document->documentElement->firstChild, ); } } diff --git a/vendor/phpunit/phpunit/src/TextUI/Configuration/Xml/Migration/Migrations/LogToReportMigration.php b/vendor/phpunit/phpunit/src/TextUI/Configuration/Xml/Migration/Migrations/LogToReportMigration.php index e987308b..321260b5 100644 --- a/vendor/phpunit/phpunit/src/TextUI/Configuration/Xml/Migration/Migrations/LogToReportMigration.php +++ b/vendor/phpunit/phpunit/src/TextUI/Configuration/Xml/Migration/Migrations/LogToReportMigration.php @@ -15,6 +15,8 @@ use DOMElement; use DOMXPath; /** + * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit + * * @internal This class is not covered by the backward compatibility promise for PHPUnit */ abstract class LogToReportMigration implements Migration @@ -67,7 +69,7 @@ abstract class LogToReportMigration implements Migration private function findLogNode(DOMDocument $document): ?DOMElement { $logNode = (new DOMXPath($document))->query( - sprintf('//logging/log[@type="%s"]', $this->forType()) + sprintf('//logging/log[@type="%s"]', $this->forType()), )->item(0); if (!$logNode instanceof DOMElement) { diff --git a/vendor/phpunit/phpunit/src/TextUI/Configuration/Xml/Migration/Migrations/Migration.php b/vendor/phpunit/phpunit/src/TextUI/Configuration/Xml/Migration/Migrations/Migration.php index fa4092a9..6fd05241 100644 --- a/vendor/phpunit/phpunit/src/TextUI/Configuration/Xml/Migration/Migrations/Migration.php +++ b/vendor/phpunit/phpunit/src/TextUI/Configuration/Xml/Migration/Migrations/Migration.php @@ -12,7 +12,9 @@ namespace PHPUnit\TextUI\XmlConfiguration; use DOMDocument; /** - * @internal This class is not covered by the backward compatibility promise for PHPUnit + * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit + * + * @internal This interface is not covered by the backward compatibility promise for PHPUnit */ interface Migration { diff --git a/vendor/phpunit/phpunit/src/TextUI/Configuration/Xml/Migration/Migrations/MoveAttributesFromFilterWhitelistToCoverage.php b/vendor/phpunit/phpunit/src/TextUI/Configuration/Xml/Migration/Migrations/MoveAttributesFromFilterWhitelistToCoverage.php index a7aab5e5..b6ed401a 100644 --- a/vendor/phpunit/phpunit/src/TextUI/Configuration/Xml/Migration/Migrations/MoveAttributesFromFilterWhitelistToCoverage.php +++ b/vendor/phpunit/phpunit/src/TextUI/Configuration/Xml/Migration/Migrations/MoveAttributesFromFilterWhitelistToCoverage.php @@ -13,6 +13,8 @@ use DOMDocument; use DOMElement; /** + * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit + * * @internal This class is not covered by the backward compatibility promise for PHPUnit */ final class MoveAttributesFromFilterWhitelistToCoverage implements Migration diff --git a/vendor/phpunit/phpunit/src/TextUI/Configuration/Xml/Migration/Migrations/MoveAttributesFromRootToCoverage.php b/vendor/phpunit/phpunit/src/TextUI/Configuration/Xml/Migration/Migrations/MoveAttributesFromRootToCoverage.php index 1e0fb4c9..40b95fec 100644 --- a/vendor/phpunit/phpunit/src/TextUI/Configuration/Xml/Migration/Migrations/MoveAttributesFromRootToCoverage.php +++ b/vendor/phpunit/phpunit/src/TextUI/Configuration/Xml/Migration/Migrations/MoveAttributesFromRootToCoverage.php @@ -14,6 +14,8 @@ use DOMDocument; use DOMElement; /** + * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit + * * @internal This class is not covered by the backward compatibility promise for PHPUnit */ final class MoveAttributesFromRootToCoverage implements Migration diff --git a/vendor/phpunit/phpunit/src/TextUI/Configuration/Xml/Migration/Migrations/MoveWhitelistDirectoriesToCoverage.php b/vendor/phpunit/phpunit/src/TextUI/Configuration/Xml/Migration/Migrations/MoveWhitelistDirectoriesToCoverage.php deleted file mode 100644 index 14e6cec8..00000000 --- a/vendor/phpunit/phpunit/src/TextUI/Configuration/Xml/Migration/Migrations/MoveWhitelistDirectoriesToCoverage.php +++ /dev/null @@ -1,49 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace PHPUnit\TextUI\XmlConfiguration; - -use DOMDocument; -use DOMElement; -use PHPUnit\Util\Xml\SnapshotNodeList; - -/** - * @internal This class is not covered by the backward compatibility promise for PHPUnit - */ -final class MoveWhitelistDirectoriesToCoverage implements Migration -{ - /** - * @throws MigrationException - */ - public function migrate(DOMDocument $document): void - { - $whitelist = $document->getElementsByTagName('whitelist')->item(0); - - if ($whitelist === null) { - return; - } - - $coverage = $document->getElementsByTagName('coverage')->item(0); - - if (!$coverage instanceof DOMElement) { - throw new MigrationException('Unexpected state - No coverage element'); - } - - $include = $document->createElement('include'); - $coverage->appendChild($include); - - foreach (SnapshotNodeList::fromNodeList($whitelist->childNodes) as $child) { - if (!$child instanceof DOMElement || $child->nodeName !== 'directory') { - continue; - } - - $include->appendChild($child); - } - } -} diff --git a/vendor/phpunit/phpunit/src/TextUI/Configuration/Xml/Migration/Migrations/MoveWhitelistExcludesToCoverage.php b/vendor/phpunit/phpunit/src/TextUI/Configuration/Xml/Migration/Migrations/MoveWhitelistExcludesToCoverage.php index c55315fa..311fb567 100644 --- a/vendor/phpunit/phpunit/src/TextUI/Configuration/Xml/Migration/Migrations/MoveWhitelistExcludesToCoverage.php +++ b/vendor/phpunit/phpunit/src/TextUI/Configuration/Xml/Migration/Migrations/MoveWhitelistExcludesToCoverage.php @@ -13,9 +13,10 @@ use function assert; use function in_array; use DOMDocument; use DOMElement; -use PHPUnit\Util\Xml\SnapshotNodeList; /** + * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit + * * @internal This class is not covered by the backward compatibility promise for PHPUnit */ final class MoveWhitelistExcludesToCoverage implements Migration @@ -47,7 +48,7 @@ final class MoveWhitelistExcludesToCoverage implements Migration if ($targetExclude === null) { $targetExclude = $coverage->appendChild( - $document->createElement('exclude') + $document->createElement('exclude'), ); } diff --git a/vendor/phpunit/phpunit/src/TextUI/Configuration/Xml/Migration/Migrations/RemoveBeStrictAboutResourceUsageDuringSmallTestsAttribute.php b/vendor/phpunit/phpunit/src/TextUI/Configuration/Xml/Migration/Migrations/RemoveBeStrictAboutResourceUsageDuringSmallTestsAttribute.php index c88ff348..ee49fcfc 100644 --- a/vendor/phpunit/phpunit/src/TextUI/Configuration/Xml/Migration/Migrations/RemoveBeStrictAboutResourceUsageDuringSmallTestsAttribute.php +++ b/vendor/phpunit/phpunit/src/TextUI/Configuration/Xml/Migration/Migrations/RemoveBeStrictAboutResourceUsageDuringSmallTestsAttribute.php @@ -14,6 +14,8 @@ use DOMDocument; use DOMElement; /** + * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit + * * @internal This class is not covered by the backward compatibility promise for PHPUnit */ final class RemoveBeStrictAboutResourceUsageDuringSmallTestsAttribute implements Migration diff --git a/vendor/phpunit/phpunit/src/TextUI/Configuration/Xml/Migration/Migrations/RemoveBeStrictAboutTodoAnnotatedTestsAttribute.php b/vendor/phpunit/phpunit/src/TextUI/Configuration/Xml/Migration/Migrations/RemoveBeStrictAboutTodoAnnotatedTestsAttribute.php index 84b92ef8..d7ab28f6 100644 --- a/vendor/phpunit/phpunit/src/TextUI/Configuration/Xml/Migration/Migrations/RemoveBeStrictAboutTodoAnnotatedTestsAttribute.php +++ b/vendor/phpunit/phpunit/src/TextUI/Configuration/Xml/Migration/Migrations/RemoveBeStrictAboutTodoAnnotatedTestsAttribute.php @@ -14,6 +14,8 @@ use DOMDocument; use DOMElement; /** + * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit + * * @internal This class is not covered by the backward compatibility promise for PHPUnit */ final class RemoveBeStrictAboutTodoAnnotatedTestsAttribute implements Migration diff --git a/vendor/phpunit/phpunit/src/TextUI/Configuration/Xml/Migration/Migrations/RemoveCacheResultFileAttribute.php b/vendor/phpunit/phpunit/src/TextUI/Configuration/Xml/Migration/Migrations/RemoveCacheResultFileAttribute.php index 6a9aae9e..e283b64d 100644 --- a/vendor/phpunit/phpunit/src/TextUI/Configuration/Xml/Migration/Migrations/RemoveCacheResultFileAttribute.php +++ b/vendor/phpunit/phpunit/src/TextUI/Configuration/Xml/Migration/Migrations/RemoveCacheResultFileAttribute.php @@ -14,6 +14,8 @@ use DOMDocument; use DOMElement; /** + * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit + * * @internal This class is not covered by the backward compatibility promise for PHPUnit */ final class RemoveCacheResultFileAttribute implements Migration diff --git a/vendor/phpunit/phpunit/src/TextUI/Configuration/Xml/Migration/Migrations/RemoveCacheTokensAttribute.php b/vendor/phpunit/phpunit/src/TextUI/Configuration/Xml/Migration/Migrations/RemoveCacheTokensAttribute.php index faf16f2e..5ab7e041 100644 --- a/vendor/phpunit/phpunit/src/TextUI/Configuration/Xml/Migration/Migrations/RemoveCacheTokensAttribute.php +++ b/vendor/phpunit/phpunit/src/TextUI/Configuration/Xml/Migration/Migrations/RemoveCacheTokensAttribute.php @@ -14,6 +14,8 @@ use DOMDocument; use DOMElement; /** + * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit + * * @internal This class is not covered by the backward compatibility promise for PHPUnit */ final class RemoveCacheTokensAttribute implements Migration diff --git a/vendor/phpunit/phpunit/src/TextUI/Configuration/Xml/Migration/Migrations/RemoveConversionToExceptionsAttributes.php b/vendor/phpunit/phpunit/src/TextUI/Configuration/Xml/Migration/Migrations/RemoveConversionToExceptionsAttributes.php index 267ff0e8..339b3e20 100644 --- a/vendor/phpunit/phpunit/src/TextUI/Configuration/Xml/Migration/Migrations/RemoveConversionToExceptionsAttributes.php +++ b/vendor/phpunit/phpunit/src/TextUI/Configuration/Xml/Migration/Migrations/RemoveConversionToExceptionsAttributes.php @@ -14,6 +14,8 @@ use DOMDocument; use DOMElement; /** + * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit + * * @internal This class is not covered by the backward compatibility promise for PHPUnit */ final class RemoveConversionToExceptionsAttributes implements Migration diff --git a/vendor/phpunit/phpunit/src/TextUI/Configuration/Xml/Migration/Migrations/RemoveCoverageElementCacheDirectoryAttribute.php b/vendor/phpunit/phpunit/src/TextUI/Configuration/Xml/Migration/Migrations/RemoveCoverageElementCacheDirectoryAttribute.php index f34518e3..4a71bbb8 100644 --- a/vendor/phpunit/phpunit/src/TextUI/Configuration/Xml/Migration/Migrations/RemoveCoverageElementCacheDirectoryAttribute.php +++ b/vendor/phpunit/phpunit/src/TextUI/Configuration/Xml/Migration/Migrations/RemoveCoverageElementCacheDirectoryAttribute.php @@ -13,6 +13,8 @@ use DOMDocument; use DOMElement; /** + * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit + * * @internal This class is not covered by the backward compatibility promise for PHPUnit */ final class RemoveCoverageElementCacheDirectoryAttribute implements Migration diff --git a/vendor/phpunit/phpunit/src/TextUI/Configuration/Xml/Migration/Migrations/RemoveCoverageElementProcessUncoveredFilesAttribute.php b/vendor/phpunit/phpunit/src/TextUI/Configuration/Xml/Migration/Migrations/RemoveCoverageElementProcessUncoveredFilesAttribute.php index 7a55eacf..720b65c5 100644 --- a/vendor/phpunit/phpunit/src/TextUI/Configuration/Xml/Migration/Migrations/RemoveCoverageElementProcessUncoveredFilesAttribute.php +++ b/vendor/phpunit/phpunit/src/TextUI/Configuration/Xml/Migration/Migrations/RemoveCoverageElementProcessUncoveredFilesAttribute.php @@ -13,6 +13,8 @@ use DOMDocument; use DOMElement; /** + * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit + * * @internal This class is not covered by the backward compatibility promise for PHPUnit */ final class RemoveCoverageElementProcessUncoveredFilesAttribute implements Migration diff --git a/vendor/phpunit/phpunit/src/TextUI/Configuration/Xml/Migration/Migrations/RemoveEmptyFilter.php b/vendor/phpunit/phpunit/src/TextUI/Configuration/Xml/Migration/Migrations/RemoveEmptyFilter.php index 8f1a6d54..2d8fea52 100644 --- a/vendor/phpunit/phpunit/src/TextUI/Configuration/Xml/Migration/Migrations/RemoveEmptyFilter.php +++ b/vendor/phpunit/phpunit/src/TextUI/Configuration/Xml/Migration/Migrations/RemoveEmptyFilter.php @@ -14,6 +14,8 @@ use DOMDocument; use DOMElement; /** + * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit + * * @internal This class is not covered by the backward compatibility promise for PHPUnit */ final class RemoveEmptyFilter implements Migration diff --git a/vendor/phpunit/phpunit/src/TextUI/Configuration/Xml/Migration/Migrations/RemoveListeners.php b/vendor/phpunit/phpunit/src/TextUI/Configuration/Xml/Migration/Migrations/RemoveListeners.php index 3095c03b..b493d1c7 100644 --- a/vendor/phpunit/phpunit/src/TextUI/Configuration/Xml/Migration/Migrations/RemoveListeners.php +++ b/vendor/phpunit/phpunit/src/TextUI/Configuration/Xml/Migration/Migrations/RemoveListeners.php @@ -13,6 +13,8 @@ use DOMDocument; use DOMElement; /** + * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit + * * @internal This class is not covered by the backward compatibility promise for PHPUnit */ final class RemoveListeners implements Migration diff --git a/vendor/phpunit/phpunit/src/TextUI/Configuration/Xml/Migration/Migrations/RemoveLogTypes.php b/vendor/phpunit/phpunit/src/TextUI/Configuration/Xml/Migration/Migrations/RemoveLogTypes.php index 962ff13c..9591f8c9 100644 --- a/vendor/phpunit/phpunit/src/TextUI/Configuration/Xml/Migration/Migrations/RemoveLogTypes.php +++ b/vendor/phpunit/phpunit/src/TextUI/Configuration/Xml/Migration/Migrations/RemoveLogTypes.php @@ -12,9 +12,10 @@ namespace PHPUnit\TextUI\XmlConfiguration; use function assert; use DOMDocument; use DOMElement; -use PHPUnit\Util\Xml\SnapshotNodeList; /** + * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit + * * @internal This class is not covered by the backward compatibility promise for PHPUnit */ final class RemoveLogTypes implements Migration diff --git a/vendor/phpunit/phpunit/src/TextUI/Configuration/Xml/Migration/Migrations/RemoveLoggingElements.php b/vendor/phpunit/phpunit/src/TextUI/Configuration/Xml/Migration/Migrations/RemoveLoggingElements.php index cf59ce71..de09f8c4 100644 --- a/vendor/phpunit/phpunit/src/TextUI/Configuration/Xml/Migration/Migrations/RemoveLoggingElements.php +++ b/vendor/phpunit/phpunit/src/TextUI/Configuration/Xml/Migration/Migrations/RemoveLoggingElements.php @@ -14,6 +14,8 @@ use DOMElement; use DOMXPath; /** + * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit + * * @internal This class is not covered by the backward compatibility promise for PHPUnit */ final class RemoveLoggingElements implements Migration diff --git a/vendor/phpunit/phpunit/src/TextUI/Configuration/Xml/Migration/Migrations/RemoveNoInteractionAttribute.php b/vendor/phpunit/phpunit/src/TextUI/Configuration/Xml/Migration/Migrations/RemoveNoInteractionAttribute.php index 5efaefad..c3dd3f10 100644 --- a/vendor/phpunit/phpunit/src/TextUI/Configuration/Xml/Migration/Migrations/RemoveNoInteractionAttribute.php +++ b/vendor/phpunit/phpunit/src/TextUI/Configuration/Xml/Migration/Migrations/RemoveNoInteractionAttribute.php @@ -14,6 +14,8 @@ use DOMDocument; use DOMElement; /** + * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit + * * @internal This class is not covered by the backward compatibility promise for PHPUnit */ final class RemoveNoInteractionAttribute implements Migration diff --git a/vendor/phpunit/phpunit/src/TextUI/Configuration/Xml/Migration/Migrations/RemovePrinterAttributes.php b/vendor/phpunit/phpunit/src/TextUI/Configuration/Xml/Migration/Migrations/RemovePrinterAttributes.php index 5281cc3a..2d1d03fa 100644 --- a/vendor/phpunit/phpunit/src/TextUI/Configuration/Xml/Migration/Migrations/RemovePrinterAttributes.php +++ b/vendor/phpunit/phpunit/src/TextUI/Configuration/Xml/Migration/Migrations/RemovePrinterAttributes.php @@ -14,6 +14,8 @@ use DOMDocument; use DOMElement; /** + * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit + * * @internal This class is not covered by the backward compatibility promise for PHPUnit */ final class RemovePrinterAttributes implements Migration diff --git a/vendor/phpunit/phpunit/src/TextUI/Configuration/Xml/Migration/Migrations/RemoveTestDoxGroupsElement.php b/vendor/phpunit/phpunit/src/TextUI/Configuration/Xml/Migration/Migrations/RemoveTestDoxGroupsElement.php index 50906f15..eb2f1359 100644 --- a/vendor/phpunit/phpunit/src/TextUI/Configuration/Xml/Migration/Migrations/RemoveTestDoxGroupsElement.php +++ b/vendor/phpunit/phpunit/src/TextUI/Configuration/Xml/Migration/Migrations/RemoveTestDoxGroupsElement.php @@ -13,6 +13,8 @@ use DOMDocument; use DOMElement; /** + * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit + * * @internal This class is not covered by the backward compatibility promise for PHPUnit */ final class RemoveTestDoxGroupsElement implements Migration diff --git a/vendor/phpunit/phpunit/src/TextUI/Configuration/Xml/Migration/Migrations/RemoveTestSuiteLoaderAttributes.php b/vendor/phpunit/phpunit/src/TextUI/Configuration/Xml/Migration/Migrations/RemoveTestSuiteLoaderAttributes.php index 4b15dc73..823c9647 100644 --- a/vendor/phpunit/phpunit/src/TextUI/Configuration/Xml/Migration/Migrations/RemoveTestSuiteLoaderAttributes.php +++ b/vendor/phpunit/phpunit/src/TextUI/Configuration/Xml/Migration/Migrations/RemoveTestSuiteLoaderAttributes.php @@ -14,6 +14,8 @@ use DOMDocument; use DOMElement; /** + * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit + * * @internal This class is not covered by the backward compatibility promise for PHPUnit */ final class RemoveTestSuiteLoaderAttributes implements Migration diff --git a/vendor/phpunit/phpunit/src/TextUI/Configuration/Xml/Migration/Migrations/RemoveVerboseAttribute.php b/vendor/phpunit/phpunit/src/TextUI/Configuration/Xml/Migration/Migrations/RemoveVerboseAttribute.php index 6091cd5a..0233d8b4 100644 --- a/vendor/phpunit/phpunit/src/TextUI/Configuration/Xml/Migration/Migrations/RemoveVerboseAttribute.php +++ b/vendor/phpunit/phpunit/src/TextUI/Configuration/Xml/Migration/Migrations/RemoveVerboseAttribute.php @@ -14,6 +14,8 @@ use DOMDocument; use DOMElement; /** + * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit + * * @internal This class is not covered by the backward compatibility promise for PHPUnit */ final class RemoveVerboseAttribute implements Migration diff --git a/vendor/phpunit/phpunit/src/TextUI/Configuration/Xml/Migration/Migrations/RenameBackupStaticAttributesAttribute.php b/vendor/phpunit/phpunit/src/TextUI/Configuration/Xml/Migration/Migrations/RenameBackupStaticAttributesAttribute.php index 3fe871d9..b04bbdb2 100644 --- a/vendor/phpunit/phpunit/src/TextUI/Configuration/Xml/Migration/Migrations/RenameBackupStaticAttributesAttribute.php +++ b/vendor/phpunit/phpunit/src/TextUI/Configuration/Xml/Migration/Migrations/RenameBackupStaticAttributesAttribute.php @@ -14,6 +14,8 @@ use DOMDocument; use DOMElement; /** + * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit + * * @internal This class is not covered by the backward compatibility promise for PHPUnit */ final class RenameBackupStaticAttributesAttribute implements Migration diff --git a/vendor/phpunit/phpunit/src/TextUI/Configuration/Xml/Migration/Migrations/RenameBeStrictAboutCoversAnnotationAttribute.php b/vendor/phpunit/phpunit/src/TextUI/Configuration/Xml/Migration/Migrations/RenameBeStrictAboutCoversAnnotationAttribute.php index eba48730..3950e2a3 100644 --- a/vendor/phpunit/phpunit/src/TextUI/Configuration/Xml/Migration/Migrations/RenameBeStrictAboutCoversAnnotationAttribute.php +++ b/vendor/phpunit/phpunit/src/TextUI/Configuration/Xml/Migration/Migrations/RenameBeStrictAboutCoversAnnotationAttribute.php @@ -14,6 +14,8 @@ use DOMDocument; use DOMElement; /** + * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit + * * @internal This class is not covered by the backward compatibility promise for PHPUnit */ final class RenameBeStrictAboutCoversAnnotationAttribute implements Migration diff --git a/vendor/phpunit/phpunit/src/TextUI/Configuration/Xml/Migration/Migrations/RenameForceCoversAnnotationAttribute.php b/vendor/phpunit/phpunit/src/TextUI/Configuration/Xml/Migration/Migrations/RenameForceCoversAnnotationAttribute.php index b1b41f5d..c384be21 100644 --- a/vendor/phpunit/phpunit/src/TextUI/Configuration/Xml/Migration/Migrations/RenameForceCoversAnnotationAttribute.php +++ b/vendor/phpunit/phpunit/src/TextUI/Configuration/Xml/Migration/Migrations/RenameForceCoversAnnotationAttribute.php @@ -14,6 +14,8 @@ use DOMDocument; use DOMElement; /** + * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit + * * @internal This class is not covered by the backward compatibility promise for PHPUnit */ final class RenameForceCoversAnnotationAttribute implements Migration diff --git a/vendor/phpunit/phpunit/src/TextUI/Configuration/Xml/Migration/Migrations/UpdateSchemaLocation.php b/vendor/phpunit/phpunit/src/TextUI/Configuration/Xml/Migration/Migrations/UpdateSchemaLocation.php index e1bb154a..6f39eb4c 100644 --- a/vendor/phpunit/phpunit/src/TextUI/Configuration/Xml/Migration/Migrations/UpdateSchemaLocation.php +++ b/vendor/phpunit/phpunit/src/TextUI/Configuration/Xml/Migration/Migrations/UpdateSchemaLocation.php @@ -15,6 +15,8 @@ use DOMElement; use PHPUnit\Runner\Version; /** + * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit + * * @internal This class is not covered by the backward compatibility promise for PHPUnit */ final class UpdateSchemaLocation implements Migration @@ -28,7 +30,7 @@ final class UpdateSchemaLocation implements Migration $root->setAttributeNS( 'http://www.w3.org/2001/XMLSchema-instance', 'xsi:noNamespaceSchemaLocation', - 'https://schema.phpunit.de/' . Version::series() . '/phpunit.xsd' + 'https://schema.phpunit.de/' . Version::series() . '/phpunit.xsd', ); } } diff --git a/vendor/phpunit/phpunit/src/TextUI/Configuration/Xml/Migration/Migrator.php b/vendor/phpunit/phpunit/src/TextUI/Configuration/Xml/Migration/Migrator.php index d0f1a7ce..278789ff 100644 --- a/vendor/phpunit/phpunit/src/TextUI/Configuration/Xml/Migration/Migrator.php +++ b/vendor/phpunit/phpunit/src/TextUI/Configuration/Xml/Migration/Migrator.php @@ -9,19 +9,19 @@ */ namespace PHPUnit\TextUI\XmlConfiguration; -use function sprintf; +use PHPUnit\Runner\Version; use PHPUnit\Util\Xml\Loader as XmlLoader; -use PHPUnit\Util\Xml\SchemaDetector; use PHPUnit\Util\Xml\XmlException; /** + * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit + * * @internal This class is not covered by the backward compatibility promise for PHPUnit */ final class Migrator { /** * @throws Exception - * @throws MigrationBuilderException * @throws MigrationException * @throws XmlException */ @@ -30,20 +30,14 @@ final class Migrator $origin = (new SchemaDetector)->detect($filename); if (!$origin->detected()) { - throw new Exception( - sprintf( - '"%s" is not a valid PHPUnit XML configuration file that can be migrated', - $filename, - ) - ); + throw new Exception('The file does not validate against any known schema'); } - $configurationDocument = (new XmlLoader)->loadFile( - $filename, - false, - true, - true - ); + if ($origin->version() === Version::series()) { + throw new Exception('The file does not need to be migrated'); + } + + $configurationDocument = (new XmlLoader)->loadFile($filename); foreach ((new MigrationBuilder)->build($origin->version()) as $migration) { $migration->migrate($configurationDocument); diff --git a/vendor/phpunit/phpunit/src/TextUI/Configuration/Xml/PHPUnit.php b/vendor/phpunit/phpunit/src/TextUI/Configuration/Xml/PHPUnit.php index f83800a3..55a006fd 100644 --- a/vendor/phpunit/phpunit/src/TextUI/Configuration/Xml/PHPUnit.php +++ b/vendor/phpunit/phpunit/src/TextUI/Configuration/Xml/PHPUnit.php @@ -10,6 +10,8 @@ namespace PHPUnit\TextUI\XmlConfiguration; /** + * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit + * * @internal This class is not covered by the backward compatibility promise for PHPUnit * * @psalm-immutable @@ -22,9 +24,11 @@ final class PHPUnit private readonly int|string $columns; private readonly string $colors; private readonly bool $stderr; + private readonly bool $displayDetailsOnAllIssues; private readonly bool $displayDetailsOnIncompleteTests; private readonly bool $displayDetailsOnSkippedTests; private readonly bool $displayDetailsOnTestsThatTriggerDeprecations; + private readonly bool $displayDetailsOnPhpunitDeprecations; private readonly bool $displayDetailsOnTestsThatTriggerErrors; private readonly bool $displayDetailsOnTestsThatTriggerNotices; private readonly bool $displayDetailsOnTestsThatTriggerWarnings; @@ -32,18 +36,29 @@ final class PHPUnit private readonly bool $requireCoverageMetadata; private readonly ?string $bootstrap; private readonly bool $processIsolation; + private readonly bool $failOnAllIssues; + private readonly bool $failOnDeprecation; + private readonly bool $failOnPhpunitDeprecation; + private readonly bool $failOnPhpunitWarning; private readonly bool $failOnEmptyTestSuite; private readonly bool $failOnIncomplete; + private readonly bool $failOnNotice; private readonly bool $failOnRisky; private readonly bool $failOnSkipped; private readonly bool $failOnWarning; private readonly bool $stopOnDefect; + private readonly bool $stopOnDeprecation; private readonly bool $stopOnError; private readonly bool $stopOnFailure; - private readonly bool $stopOnWarning; private readonly bool $stopOnIncomplete; + private readonly bool $stopOnNotice; private readonly bool $stopOnRisky; private readonly bool $stopOnSkipped; + private readonly bool $stopOnWarning; + + /** + * @psalm-var ?non-empty-string + */ private readonly ?string $extensionsDirectory; private readonly bool $beStrictAboutChangesToGlobalState; private readonly bool $beStrictAboutOutputDuringTests; @@ -62,8 +77,13 @@ final class PHPUnit private readonly bool $backupStaticProperties; private readonly bool $registerMockObjectsFromTestArgumentsRecursively; private readonly bool $testdoxPrinter; + private readonly bool $controlGarbageCollector; + private readonly int $numberOfTestsBeforeGarbageCollection; - public function __construct(?string $cacheDirectory, bool $cacheResult, ?string $cacheResultFile, int|string $columns, string $colors, bool $stderr, bool $displayDetailsOnIncompleteTests, bool $displayDetailsOnSkippedTests, bool $displayDetailsOnTestsThatTriggerDeprecations, bool $displayDetailsOnTestsThatTriggerErrors, bool $displayDetailsOnTestsThatTriggerNotices, bool $displayDetailsOnTestsThatTriggerWarnings, bool $reverseDefectList, bool $requireCoverageMetadata, ?string $bootstrap, bool $processIsolation, bool $failOnEmptyTestSuite, bool $failOnIncomplete, bool $failOnRisky, bool $failOnSkipped, bool $failOnWarning, bool $stopOnDefect, bool $stopOnError, bool $stopOnFailure, bool $stopOnWarning, bool $stopOnIncomplete, bool $stopOnRisky, bool $stopOnSkipped, ?string $extensionsDirectory, bool $beStrictAboutChangesToGlobalState, bool $beStrictAboutOutputDuringTests, bool $beStrictAboutTestsThatDoNotTestAnything, bool $beStrictAboutCoverageMetadata, bool $enforceTimeLimit, int $defaultTimeLimit, int $timeoutForSmallTests, int $timeoutForMediumTests, int $timeoutForLargeTests, ?string $defaultTestSuite, int $executionOrder, bool $resolveDependencies, bool $defectsFirst, bool $backupGlobals, bool $backupStaticProperties, bool $registerMockObjectsFromTestArgumentsRecursively, bool $testdoxPrinter) + /** + * @psalm-param ?non-empty-string $extensionsDirectory + */ + public function __construct(?string $cacheDirectory, bool $cacheResult, ?string $cacheResultFile, int|string $columns, string $colors, bool $stderr, bool $displayDetailsOnAllIssues, bool $displayDetailsOnIncompleteTests, bool $displayDetailsOnSkippedTests, bool $displayDetailsOnTestsThatTriggerDeprecations, bool $displayDetailsOnPhpunitDeprecations, bool $displayDetailsOnTestsThatTriggerErrors, bool $displayDetailsOnTestsThatTriggerNotices, bool $displayDetailsOnTestsThatTriggerWarnings, bool $reverseDefectList, bool $requireCoverageMetadata, ?string $bootstrap, bool $processIsolation, bool $failOnAllIssues, bool $failOnDeprecation, bool $failOnPhpunitDeprecation, bool $failOnPhpunitWarning, bool $failOnEmptyTestSuite, bool $failOnIncomplete, bool $failOnNotice, bool $failOnRisky, bool $failOnSkipped, bool $failOnWarning, bool $stopOnDefect, bool $stopOnDeprecation, bool $stopOnError, bool $stopOnFailure, bool $stopOnIncomplete, bool $stopOnNotice, bool $stopOnRisky, bool $stopOnSkipped, bool $stopOnWarning, ?string $extensionsDirectory, bool $beStrictAboutChangesToGlobalState, bool $beStrictAboutOutputDuringTests, bool $beStrictAboutTestsThatDoNotTestAnything, bool $beStrictAboutCoverageMetadata, bool $enforceTimeLimit, int $defaultTimeLimit, int $timeoutForSmallTests, int $timeoutForMediumTests, int $timeoutForLargeTests, ?string $defaultTestSuite, int $executionOrder, bool $resolveDependencies, bool $defectsFirst, bool $backupGlobals, bool $backupStaticProperties, bool $registerMockObjectsFromTestArgumentsRecursively, bool $testdoxPrinter, bool $controlGarbageCollector, int $numberOfTestsBeforeGarbageCollection) { $this->cacheDirectory = $cacheDirectory; $this->cacheResult = $cacheResult; @@ -71,9 +91,11 @@ final class PHPUnit $this->columns = $columns; $this->colors = $colors; $this->stderr = $stderr; + $this->displayDetailsOnAllIssues = $displayDetailsOnAllIssues; $this->displayDetailsOnIncompleteTests = $displayDetailsOnIncompleteTests; $this->displayDetailsOnSkippedTests = $displayDetailsOnSkippedTests; $this->displayDetailsOnTestsThatTriggerDeprecations = $displayDetailsOnTestsThatTriggerDeprecations; + $this->displayDetailsOnPhpunitDeprecations = $displayDetailsOnPhpunitDeprecations; $this->displayDetailsOnTestsThatTriggerErrors = $displayDetailsOnTestsThatTriggerErrors; $this->displayDetailsOnTestsThatTriggerNotices = $displayDetailsOnTestsThatTriggerNotices; $this->displayDetailsOnTestsThatTriggerWarnings = $displayDetailsOnTestsThatTriggerWarnings; @@ -81,18 +103,25 @@ final class PHPUnit $this->requireCoverageMetadata = $requireCoverageMetadata; $this->bootstrap = $bootstrap; $this->processIsolation = $processIsolation; + $this->failOnAllIssues = $failOnAllIssues; + $this->failOnDeprecation = $failOnDeprecation; + $this->failOnPhpunitDeprecation = $failOnPhpunitDeprecation; + $this->failOnPhpunitWarning = $failOnPhpunitWarning; $this->failOnEmptyTestSuite = $failOnEmptyTestSuite; $this->failOnIncomplete = $failOnIncomplete; + $this->failOnNotice = $failOnNotice; $this->failOnRisky = $failOnRisky; $this->failOnSkipped = $failOnSkipped; $this->failOnWarning = $failOnWarning; $this->stopOnDefect = $stopOnDefect; + $this->stopOnDeprecation = $stopOnDeprecation; $this->stopOnError = $stopOnError; $this->stopOnFailure = $stopOnFailure; - $this->stopOnWarning = $stopOnWarning; $this->stopOnIncomplete = $stopOnIncomplete; + $this->stopOnNotice = $stopOnNotice; $this->stopOnRisky = $stopOnRisky; $this->stopOnSkipped = $stopOnSkipped; + $this->stopOnWarning = $stopOnWarning; $this->extensionsDirectory = $extensionsDirectory; $this->beStrictAboutChangesToGlobalState = $beStrictAboutChangesToGlobalState; $this->beStrictAboutOutputDuringTests = $beStrictAboutOutputDuringTests; @@ -111,6 +140,8 @@ final class PHPUnit $this->backupStaticProperties = $backupStaticProperties; $this->registerMockObjectsFromTestArgumentsRecursively = $registerMockObjectsFromTestArgumentsRecursively; $this->testdoxPrinter = $testdoxPrinter; + $this->controlGarbageCollector = $controlGarbageCollector; + $this->numberOfTestsBeforeGarbageCollection = $numberOfTestsBeforeGarbageCollection; } /** @@ -177,6 +208,11 @@ final class PHPUnit return $this->stderr; } + public function displayDetailsOnAllIssues(): bool + { + return $this->displayDetailsOnAllIssues; + } + public function displayDetailsOnIncompleteTests(): bool { return $this->displayDetailsOnIncompleteTests; @@ -192,6 +228,11 @@ final class PHPUnit return $this->displayDetailsOnTestsThatTriggerDeprecations; } + public function displayDetailsOnPhpunitDeprecations(): bool + { + return $this->displayDetailsOnPhpunitDeprecations; + } + public function displayDetailsOnTestsThatTriggerErrors(): bool { return $this->displayDetailsOnTestsThatTriggerErrors; @@ -242,6 +283,26 @@ final class PHPUnit return $this->processIsolation; } + public function failOnAllIssues(): bool + { + return $this->failOnAllIssues; + } + + public function failOnDeprecation(): bool + { + return $this->failOnDeprecation; + } + + public function failOnPhpunitDeprecation(): bool + { + return $this->failOnPhpunitDeprecation; + } + + public function failOnPhpunitWarning(): bool + { + return $this->failOnPhpunitWarning; + } + public function failOnEmptyTestSuite(): bool { return $this->failOnEmptyTestSuite; @@ -252,6 +313,11 @@ final class PHPUnit return $this->failOnIncomplete; } + public function failOnNotice(): bool + { + return $this->failOnNotice; + } + public function failOnRisky(): bool { return $this->failOnRisky; @@ -272,6 +338,11 @@ final class PHPUnit return $this->stopOnDefect; } + public function stopOnDeprecation(): bool + { + return $this->stopOnDeprecation; + } + public function stopOnError(): bool { return $this->stopOnError; @@ -282,16 +353,16 @@ final class PHPUnit return $this->stopOnFailure; } - public function stopOnWarning(): bool - { - return $this->stopOnWarning; - } - public function stopOnIncomplete(): bool { return $this->stopOnIncomplete; } + public function stopOnNotice(): bool + { + return $this->stopOnNotice; + } + public function stopOnRisky(): bool { return $this->stopOnRisky; @@ -302,6 +373,11 @@ final class PHPUnit return $this->stopOnSkipped; } + public function stopOnWarning(): bool + { + return $this->stopOnWarning; + } + /** * @psalm-assert-if-true !null $this->extensionsDirectory */ @@ -312,6 +388,8 @@ final class PHPUnit /** * @throws Exception + * + * @psalm-return non-empty-string */ public function extensionsDirectory(): string { @@ -412,6 +490,9 @@ final class PHPUnit return $this->backupStaticProperties; } + /** + * @deprecated + */ public function registerMockObjectsFromTestArgumentsRecursively(): bool { return $this->registerMockObjectsFromTestArgumentsRecursively; @@ -421,4 +502,14 @@ final class PHPUnit { return $this->testdoxPrinter; } + + public function controlGarbageCollector(): bool + { + return $this->controlGarbageCollector; + } + + public function numberOfTestsBeforeGarbageCollection(): int + { + return $this->numberOfTestsBeforeGarbageCollection; + } } diff --git a/vendor/phpunit/phpunit/src/TextUI/Configuration/Xml/TestSuiteMapper.php b/vendor/phpunit/phpunit/src/TextUI/Configuration/Xml/TestSuiteMapper.php index 1d3f3097..7721ca4e 100644 --- a/vendor/phpunit/phpunit/src/TextUI/Configuration/Xml/TestSuiteMapper.php +++ b/vendor/phpunit/phpunit/src/TextUI/Configuration/Xml/TestSuiteMapper.php @@ -10,6 +10,8 @@ namespace PHPUnit\TextUI\XmlConfiguration; use const PHP_VERSION; +use function array_merge; +use function array_unique; use function explode; use function in_array; use function is_dir; @@ -25,21 +27,25 @@ use PHPUnit\TextUI\TestFileNotFoundException; use SebastianBergmann\FileIterator\Facade; /** + * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit + * * @internal This class is not covered by the backward compatibility promise for PHPUnit */ final class TestSuiteMapper { /** + * @psalm-param non-empty-string $xmlConfigurationFile, + * * @throws RuntimeException * @throws TestDirectoryNotFoundException * @throws TestFileNotFoundException */ - public function map(TestSuiteCollection $configuration, string $filter, string $excludedTestSuites): TestSuiteObject + public function map(string $xmlConfigurationFile, TestSuiteCollection $configuration, string $filter, string $excludedTestSuites): TestSuiteObject { try { $filterAsArray = $filter ? explode(',', $filter) : []; $excludedFilterAsArray = $excludedTestSuites ? explode(',', $excludedTestSuites) : []; - $result = TestSuiteObject::empty(); + $result = TestSuiteObject::empty($xmlConfigurationFile); foreach ($configuration as $testSuiteConfiguration) { if (!empty($filterAsArray) && !in_array($testSuiteConfiguration->name(), $filterAsArray, true)) { @@ -50,34 +56,32 @@ final class TestSuiteMapper continue; } - $testSuite = TestSuiteObject::empty($testSuiteConfiguration->name()); - $testSuiteEmpty = true; - $exclude = []; foreach ($testSuiteConfiguration->exclude()->asArray() as $file) { $exclude[] = $file->path(); } + $files = []; + foreach ($testSuiteConfiguration->directories() as $directory) { + if (!str_contains($directory->path(), '*') && !is_dir($directory->path())) { + throw new TestDirectoryNotFoundException($directory->path()); + } + if (!version_compare(PHP_VERSION, $directory->phpVersion(), $directory->phpVersionOperator()->asString())) { continue; } - $files = (new Facade)->getFilesAsArray( - $directory->path(), - $directory->suffix(), - $directory->prefix(), - $exclude + $files = array_merge( + $files, + (new Facade)->getFilesAsArray( + $directory->path(), + $directory->suffix(), + $directory->prefix(), + $exclude, + ), ); - - if (!empty($files)) { - $testSuite->addTestFiles($files); - - $testSuiteEmpty = false; - } elseif (!str_contains($directory->path(), '*') && !is_dir($directory->path())) { - throw new TestDirectoryNotFoundException($directory->path()); - } } foreach ($testSuiteConfiguration->files() as $file) { @@ -89,12 +93,14 @@ final class TestSuiteMapper continue; } - $testSuite->addTestFile($file->path()); - - $testSuiteEmpty = false; + $files[] = $file->path(); } - if (!$testSuiteEmpty) { + if (!empty($files)) { + $testSuite = TestSuiteObject::empty($testSuiteConfiguration->name()); + + $testSuite->addTestFiles(array_unique($files)); + $result->addTest($testSuite); } } @@ -104,7 +110,7 @@ final class TestSuiteMapper throw new RuntimeException( $e->getMessage(), $e->getCode(), - $e + $e, ); } } diff --git a/vendor/phpunit/phpunit/src/TextUI/Exception/Exception.php b/vendor/phpunit/phpunit/src/TextUI/Exception/Exception.php index ee2ae4ff..6b370ca0 100644 --- a/vendor/phpunit/phpunit/src/TextUI/Exception/Exception.php +++ b/vendor/phpunit/phpunit/src/TextUI/Exception/Exception.php @@ -12,6 +12,8 @@ namespace PHPUnit\TextUI; use Throwable; /** + * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit + * * @internal This interface is not covered by the backward compatibility promise for PHPUnit */ interface Exception extends Throwable diff --git a/vendor/phpunit/phpunit/src/TextUI/Exception/ExtensionsNotConfiguredException.php b/vendor/phpunit/phpunit/src/TextUI/Exception/ExtensionsNotConfiguredException.php deleted file mode 100644 index c192e753..00000000 --- a/vendor/phpunit/phpunit/src/TextUI/Exception/ExtensionsNotConfiguredException.php +++ /dev/null @@ -1,19 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace PHPUnit\TextUI; - -use RuntimeException; - -/** - * @internal This class is not covered by the backward compatibility promise for PHPUnit - */ -final class ExtensionsNotConfiguredException extends RuntimeException implements Exception -{ -} diff --git a/vendor/phpunit/phpunit/src/TextUI/Exception/ReflectionException.php b/vendor/phpunit/phpunit/src/TextUI/Exception/ReflectionException.php deleted file mode 100644 index 5e041444..00000000 --- a/vendor/phpunit/phpunit/src/TextUI/Exception/ReflectionException.php +++ /dev/null @@ -1,19 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace PHPUnit\TextUI; - -use RuntimeException; - -/** - * @internal This class is not covered by the backward compatibility promise for PHPUnit - */ -final class ReflectionException extends RuntimeException implements Exception -{ -} diff --git a/vendor/phpunit/phpunit/src/TextUI/Exception/RuntimeException.php b/vendor/phpunit/phpunit/src/TextUI/Exception/RuntimeException.php index 61902319..875a0487 100644 --- a/vendor/phpunit/phpunit/src/TextUI/Exception/RuntimeException.php +++ b/vendor/phpunit/phpunit/src/TextUI/Exception/RuntimeException.php @@ -10,6 +10,8 @@ namespace PHPUnit\TextUI; /** + * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit + * * @internal This class is not covered by the backward compatibility promise for PHPUnit */ final class RuntimeException extends \RuntimeException implements Exception diff --git a/vendor/phpunit/phpunit/src/TextUI/Exception/TestDirectoryNotFoundException.php b/vendor/phpunit/phpunit/src/TextUI/Exception/TestDirectoryNotFoundException.php index 35b788ce..9b35390c 100644 --- a/vendor/phpunit/phpunit/src/TextUI/Exception/TestDirectoryNotFoundException.php +++ b/vendor/phpunit/phpunit/src/TextUI/Exception/TestDirectoryNotFoundException.php @@ -13,6 +13,8 @@ use function sprintf; use RuntimeException; /** + * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit + * * @internal This class is not covered by the backward compatibility promise for PHPUnit */ final class TestDirectoryNotFoundException extends RuntimeException implements Exception @@ -22,8 +24,8 @@ final class TestDirectoryNotFoundException extends RuntimeException implements E parent::__construct( sprintf( 'Test directory "%s" not found', - $path - ) + $path, + ), ); } } diff --git a/vendor/phpunit/phpunit/src/TextUI/Exception/TestFileNotFoundException.php b/vendor/phpunit/phpunit/src/TextUI/Exception/TestFileNotFoundException.php index 35cb4b1e..46c9df80 100644 --- a/vendor/phpunit/phpunit/src/TextUI/Exception/TestFileNotFoundException.php +++ b/vendor/phpunit/phpunit/src/TextUI/Exception/TestFileNotFoundException.php @@ -13,6 +13,8 @@ use function sprintf; use RuntimeException; /** + * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit + * * @internal This class is not covered by the backward compatibility promise for PHPUnit */ final class TestFileNotFoundException extends RuntimeException implements Exception @@ -22,8 +24,8 @@ final class TestFileNotFoundException extends RuntimeException implements Except parent::__construct( sprintf( 'Test file "%s" not found', - $path - ) + $path, + ), ); } } diff --git a/vendor/phpunit/phpunit/src/TextUI/Help.php b/vendor/phpunit/phpunit/src/TextUI/Help.php index 1106904b..ef8fbed3 100644 --- a/vendor/phpunit/phpunit/src/TextUI/Help.php +++ b/vendor/phpunit/phpunit/src/TextUI/Help.php @@ -11,6 +11,7 @@ namespace PHPUnit\TextUI; use const PHP_EOL; use function count; +use function defined; use function explode; use function max; use function preg_replace_callback; @@ -22,140 +23,13 @@ use PHPUnit\Util\Color; use SebastianBergmann\Environment\Console; /** + * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit + * * @internal This class is not covered by the backward compatibility promise for PHPUnit */ final class Help { - private const LEFT_MARGIN = ' '; - - private const HELP_TEXT = [ - 'Usage' => [ - ['text' => 'phpunit [options] UnitTest.php'], - ['text' => 'phpunit [options] '], - ], - - 'Configuration' => [ - ['arg' => '--bootstrap ', 'desc' => 'A PHP script that is included before the tests run'], - ['arg' => '-c|--configuration ', 'desc' => 'Read configuration from XML file'], - ['arg' => '--no-configuration', 'desc' => 'Ignore default configuration file (phpunit.xml)'], - ['arg' => '--no-extensions', 'desc' => 'Do not load PHPUnit extensions'], - ['arg' => '--include-path ', 'desc' => 'Prepend PHP\'s include_path with given path(s)'], - ['arg' => '-d ', 'desc' => 'Sets a php.ini value'], - ['arg' => '--cache-directory ', 'desc' => 'Specify cache directory'], - ['arg' => '--generate-configuration', 'desc' => 'Generate configuration file with suggested settings'], - ['arg' => '--migrate-configuration', 'desc' => 'Migrate configuration file to current format'], - ], - - 'Selection' => [ - ['arg' => '--list-suites', 'desc' => 'List available test suites'], - ['arg' => '--testsuite ', 'desc' => 'Only run tests from the specified test suite(s)'], - ['arg' => '--exclude-testsuite ', 'desc' => 'Exclude tests from the specified test suite(s)'], - ['arg' => '--list-groups', 'desc' => 'List available test groups'], - ['arg' => '--group ', 'desc' => 'Only run tests from the specified group(s)'], - ['arg' => '--exclude-group ', 'desc' => 'Exclude tests from the specified group(s)'], - ['arg' => '--covers ', 'desc' => 'Only run tests that intend to cover '], - ['arg' => '--uses ', 'desc' => 'Only run tests that intend to use '], - ['arg' => '--list-tests', 'desc' => 'List available tests'], - ['arg' => '--list-tests-xml ', 'desc' => 'List available tests in XML format'], - ['arg' => '--filter ', 'desc' => 'Filter which tests to run'], - ['arg' => '--test-suffix ', 'desc' => 'Only search for test in files with specified suffix(es). Default: Test.php,.phpt'], - ], - - 'Execution' => [ - ['arg' => '--process-isolation', 'desc' => 'Run each test in a separate PHP process'], - ['arg' => '--globals-backup', 'desc' => 'Backup and restore $GLOBALS for each test'], - ['arg' => '--static-backup', 'desc' => 'Backup and restore static properties for each test'], - ['spacer' => ''], - - ['arg' => '--strict-coverage', 'desc' => 'Be strict about code coverage metadata'], - ['arg' => '--strict-global-state', 'desc' => 'Be strict about changes to global state'], - ['arg' => '--disallow-test-output', 'desc' => 'Be strict about output during tests'], - ['arg' => '--enforce-time-limit', 'desc' => 'Enforce time limit based on test size'], - ['arg' => '--default-time-limit ', 'desc' => 'Timeout in seconds for tests that have no declared size'], - ['arg' => '--dont-report-useless-tests', 'desc' => 'Do not report tests that do not test anything'], - ['spacer' => ''], - - ['arg' => '--stop-on-defect', 'desc' => 'Stop execution upon first not-passed test'], - ['arg' => '--stop-on-error', 'desc' => 'Stop execution upon first error'], - ['arg' => '--stop-on-failure', 'desc' => 'Stop execution upon first error or failure'], - ['arg' => '--stop-on-warning', 'desc' => 'Stop execution upon first warning'], - ['arg' => '--stop-on-risky', 'desc' => 'Stop execution upon first risky test'], - ['arg' => '--stop-on-skipped', 'desc' => 'Stop execution upon first skipped test'], - ['arg' => '--stop-on-incomplete', 'desc' => 'Stop execution upon first incomplete test'], - ['spacer' => ''], - - ['arg' => '--fail-on-incomplete', 'desc' => 'Treat incomplete tests as failures'], - ['arg' => '--fail-on-risky', 'desc' => 'Treat risky tests as failures'], - ['arg' => '--fail-on-skipped', 'desc' => 'Treat skipped tests as failures'], - ['arg' => '--fail-on-warning', 'desc' => 'Treat tests with warnings as failures'], - ['spacer' => ''], - - ['arg' => '--cache-result', 'desc' => 'Write test results to cache file'], - ['arg' => '--do-not-cache-result', 'desc' => 'Do not write test results to cache file'], - ['spacer' => ''], - - ['arg' => '--order-by ', 'desc' => 'Run tests in order: default|defects|depends|duration|no-depends|random|reverse|size'], - ['arg' => '--random-order-seed ', 'desc' => 'Use the specified random seed when running tests in random order'], - ], - - 'Reporting' => [ - ['arg' => '--colors ', 'desc' => 'Use colors in output ("never", "auto" or "always")'], - ['arg' => '--columns ', 'desc' => 'Number of columns to use for progress output'], - ['arg' => '--columns max', 'desc' => 'Use maximum number of columns for progress output'], - ['arg' => '--stderr', 'desc' => 'Write to STDERR instead of STDOUT'], - ['spacer' => ''], - - ['arg' => '--no-progress', 'desc' => 'Disable output of test execution progress'], - ['arg' => '--no-results', 'desc' => 'Disable output of test results'], - ['arg' => '--no-output', 'desc' => 'Disable all output'], - ['spacer' => ''], - - ['arg' => '--display-incomplete', 'desc' => 'Display details for incomplete tests'], - ['arg' => '--display-skipped', 'desc' => 'Display details for skipped tests'], - ['arg' => '--display-deprecations', 'desc' => 'Display details for deprecations triggered by tests'], - ['arg' => '--display-errors', 'desc' => 'Display details for errors triggered by tests'], - ['arg' => '--display-notices', 'desc' => 'Display details for notices triggered by tests'], - ['arg' => '--display-warnings', 'desc' => 'Display details for warnings triggered by tests'], - ['arg' => '--reverse-list', 'desc' => 'Print defects in reverse order'], - ['spacer' => ''], - - ['arg' => '--teamcity', 'desc' => 'Replace default progress and result output with TeamCity format'], - ['arg' => '--testdox', 'desc' => 'Replace default result output with TestDox format'], - ], - - 'Logging' => [ - ['arg' => '--log-junit ', 'desc' => 'Write test results in JUnit XML format to file'], - ['arg' => '--log-teamcity ', 'desc' => 'Write test results in TeamCity format to file'], - ['arg' => '--testdox-html ', 'desc' => 'Write test results in TestDox format (HTML) to file'], - ['arg' => '--testdox-text ', 'desc' => 'Write test results in TestDox format (plain text) to file'], - ['arg' => '--log-events-text ', 'desc' => 'Stream events as plain text to file'], - ['arg' => '--log-events-verbose-text ', 'desc' => 'Stream events as plain text (with telemetry information) to file'], - ['arg' => '--no-logging', 'desc' => 'Ignore logging configured in the XML configuration file'], - ], - - 'Code Coverage' => [ - ['arg' => '--coverage-clover ', 'desc' => 'Write code coverage report in Clover XML format to file'], - ['arg' => '--coverage-cobertura ', 'desc' => 'Write code coverage report in Cobertura XML format to file'], - ['arg' => '--coverage-crap4j ', 'desc' => 'Write code coverage report in Crap4J XML format to file'], - ['arg' => '--coverage-html ', 'desc' => 'Write code coverage report in HTML format to directory'], - ['arg' => '--coverage-php ', 'desc' => 'Write serialized code coverage data to file'], - ['arg' => '--coverage-text=', 'desc' => 'Write code coverage report in text format to file [default: standard output]'], - ['arg' => '--coverage-xml ', 'desc' => 'Write code coverage report in XML format to directory'], - ['arg' => '--warm-coverage-cache', 'desc' => 'Warm static analysis cache'], - ['arg' => '--coverage-filter ', 'desc' => 'Include in code coverage reporting'], - ['arg' => '--path-coverage', 'desc' => 'Report path coverage in addition to line coverage'], - ['arg' => '--disable-coverage-ignore', 'desc' => 'Disable metadata for ignoring code coverage'], - ['arg' => '--no-coverage', 'desc' => 'Ignore code coverage reporting configured in the XML configuration file'], - ], - - 'Miscellaneous' => [ - ['arg' => '-h|--help', 'desc' => 'Prints this usage information'], - ['arg' => '--version', 'desc' => 'Prints the version and exits'], - ['arg' => '--atleast-version ', 'desc' => 'Checks that version is greater than and exits'], - ['arg' => '--check-version', 'desc' => 'Check whether PHPUnit is the latest version and exits'], - ], - - ]; + private const LEFT_MARGIN = ' '; private int $lengthOfLongestOptionName = 0; private readonly int $columnsAvailableForDescription; private ?bool $hasColor; @@ -172,10 +46,10 @@ final class Help $this->hasColor = $withColor; } - foreach (self::HELP_TEXT as $options) { + foreach ($this->elements() as $options) { foreach ($options as $option) { if (isset($option['arg'])) { - $this->lengthOfLongestOptionName = max($this->lengthOfLongestOptionName, isset($option['arg']) ? strlen($option['arg']) : 0); + $this->lengthOfLongestOptionName = max($this->lengthOfLongestOptionName, strlen($option['arg'])); } } } @@ -196,7 +70,7 @@ final class Help { $buffer = ''; - foreach (self::HELP_TEXT as $section => $options) { + foreach ($this->elements() as $section => $options) { $buffer .= "{$section}:" . PHP_EOL; if ($section !== 'Usage') { @@ -229,7 +103,7 @@ final class Help { $buffer = ''; - foreach (self::HELP_TEXT as $section => $options) { + foreach ($this->elements() as $section => $options) { $buffer .= Color::colorize('fg-yellow', "{$section}:") . PHP_EOL; if ($section !== 'Usage') { @@ -250,7 +124,7 @@ final class Help $arg = preg_replace_callback( '/(<[^>]+>)/', static fn ($matches) => Color::colorize('fg-cyan', $matches[0]), - $arg + $arg, ); $desc = explode(PHP_EOL, wordwrap($option['desc'], $this->columnsAvailableForDescription, PHP_EOL)); @@ -268,4 +142,177 @@ final class Help return $buffer; } + + /** + * @psalm-return array> + */ + private function elements(): array + { + $elements = [ + 'Usage' => [ + ['text' => 'phpunit [options] ...'], + ], + + 'Configuration' => [ + ['arg' => '--bootstrap ', 'desc' => 'A PHP script that is included before the tests run'], + ['arg' => '-c|--configuration ', 'desc' => 'Read configuration from XML file'], + ['arg' => '--no-configuration', 'desc' => 'Ignore default configuration file (phpunit.xml)'], + ['arg' => '--no-extensions', 'desc' => 'Do not load PHPUnit extensions'], + ['arg' => '--include-path ', 'desc' => 'Prepend PHP\'s include_path with given path(s)'], + ['arg' => '-d ', 'desc' => 'Sets a php.ini value'], + ['arg' => '--cache-directory ', 'desc' => 'Specify cache directory'], + ['arg' => '--generate-configuration', 'desc' => 'Generate configuration file with suggested settings'], + ['arg' => '--migrate-configuration', 'desc' => 'Migrate configuration file to current format'], + ['arg' => '--generate-baseline ', 'desc' => 'Generate baseline for issues'], + ['arg' => '--use-baseline ', 'desc' => 'Use baseline to ignore issues'], + ['arg' => '--ignore-baseline', 'desc' => 'Do not use baseline to ignore issues'], + ], + + 'Selection' => [ + ['arg' => '--list-suites', 'desc' => 'List available test suites'], + ['arg' => '--testsuite ', 'desc' => 'Only run tests from the specified test suite(s)'], + ['arg' => '--exclude-testsuite ', 'desc' => 'Exclude tests from the specified test suite(s)'], + ['arg' => '--list-groups', 'desc' => 'List available test groups'], + ['arg' => '--group ', 'desc' => 'Only run tests from the specified group(s)'], + ['arg' => '--exclude-group ', 'desc' => 'Exclude tests from the specified group(s)'], + ['arg' => '--covers ', 'desc' => 'Only run tests that intend to cover '], + ['arg' => '--uses ', 'desc' => 'Only run tests that intend to use '], + ['arg' => '--list-tests', 'desc' => 'List available tests'], + ['arg' => '--list-tests-xml ', 'desc' => 'List available tests in XML format'], + ['arg' => '--filter ', 'desc' => 'Filter which tests to run'], + ['arg' => '--test-suffix ', 'desc' => 'Only search for test in files with specified suffix(es). Default: Test.php,.phpt'], + ], + + 'Execution' => [ + ['arg' => '--process-isolation', 'desc' => 'Run each test in a separate PHP process'], + ['arg' => '--globals-backup', 'desc' => 'Backup and restore $GLOBALS for each test'], + ['arg' => '--static-backup', 'desc' => 'Backup and restore static properties for each test'], + ['spacer' => ''], + + ['arg' => '--strict-coverage', 'desc' => 'Be strict about code coverage metadata'], + ['arg' => '--strict-global-state', 'desc' => 'Be strict about changes to global state'], + ['arg' => '--disallow-test-output', 'desc' => 'Be strict about output during tests'], + ['arg' => '--enforce-time-limit', 'desc' => 'Enforce time limit based on test size'], + ['arg' => '--default-time-limit ', 'desc' => 'Timeout in seconds for tests that have no declared size'], + ['arg' => '--do-not-report-useless-tests', 'desc' => 'Do not report tests that do not test anything'], + ['spacer' => ''], + + ['arg' => '--stop-on-defect', 'desc' => 'Stop after first error, failure, warning, or risky test'], + ['arg' => '--stop-on-error', 'desc' => 'Stop after first error'], + ['arg' => '--stop-on-failure', 'desc' => 'Stop after first failure'], + ['arg' => '--stop-on-warning', 'desc' => 'Stop after first warning'], + ['arg' => '--stop-on-risky', 'desc' => 'Stop after first risky test'], + ['arg' => '--stop-on-deprecation', 'desc' => 'Stop after first test that triggered a deprecation'], + ['arg' => '--stop-on-notice', 'desc' => 'Stop after first test that triggered a notice'], + ['arg' => '--stop-on-skipped', 'desc' => 'Stop after first skipped test'], + ['arg' => '--stop-on-incomplete', 'desc' => 'Stop after first incomplete test'], + ['spacer' => ''], + + ['arg' => '--fail-on-empty-test-suite', 'desc' => 'Signal failure using shell exit code when no tests were run'], + ['arg' => '--fail-on-warning', 'desc' => 'Signal failure using shell exit code when a warning was triggered'], + ['arg' => '--fail-on-risky', 'desc' => 'Signal failure using shell exit code when a test was considered risky'], + ['arg' => '--fail-on-deprecation', 'desc' => 'Signal failure using shell exit code when a deprecation was triggered'], + ['arg' => '--fail-on-phpunit-deprecation', 'desc' => 'Signal failure using shell exit code when a PHPUnit deprecation was triggered'], + ['arg' => '--fail-on-phpunit-warning', 'desc' => 'Signal failure using shell exit code when a PHPUnit warning was triggered'], + ['arg' => '--fail-on-notice', 'desc' => 'Signal failure using shell exit code when a notice was triggered'], + ['arg' => '--fail-on-skipped', 'desc' => 'Signal failure using shell exit code when a test was skipped'], + ['arg' => '--fail-on-incomplete', 'desc' => 'Signal failure using shell exit code when a test was marked incomplete'], + ['arg' => '--fail-on-all-issues', 'desc' => 'Signal failure using shell exit code when an issue is triggered'], + ['spacer' => ''], + + ['arg' => '--do-not-fail-on-empty-test-suite', 'desc' => 'Do not signal failure using shell exit code when no tests were run'], + ['arg' => '--do-not-fail-on-warning', 'desc' => 'Do not signal failure using shell exit code when a warning was triggered'], + ['arg' => '--do-not-fail-on-risky', 'desc' => 'Do not signal failure using shell exit code when a test was considered risky'], + ['arg' => '--do-not-fail-on-deprecation', 'desc' => 'Do not signal failure using shell exit code when a deprecation was triggered'], + ['arg' => '--do-not-fail-on-phpunit-deprecation', 'desc' => 'Do not signal failure using shell exit code when a PHPUnit deprecation was triggered'], + ['arg' => '--do-not-fail-on-phpunit-warning', 'desc' => 'Do not signal failure using shell exit code when a PHPUnit warning was triggered'], + ['arg' => '--do-not-fail-on-notice', 'desc' => 'Do not signal failure using shell exit code when a notice was triggered'], + ['arg' => '--do-not-fail-on-skipped', 'desc' => 'Do not signal failure using shell exit code when a test was skipped'], + ['arg' => '--do-not-fail-on-incomplete', 'desc' => 'Do not signal failure using shell exit code when a test was marked incomplete'], + ['spacer' => ''], + + ['arg' => '--cache-result', 'desc' => 'Write test results to cache file'], + ['arg' => '--do-not-cache-result', 'desc' => 'Do not write test results to cache file'], + ['spacer' => ''], + + ['arg' => '--order-by ', 'desc' => 'Run tests in order: default|defects|depends|duration|no-depends|random|reverse|size'], + ['arg' => '--random-order-seed ', 'desc' => 'Use the specified random seed when running tests in random order'], + ], + + 'Reporting' => [ + ['arg' => '--colors ', 'desc' => 'Use colors in output ("never", "auto" or "always")'], + ['arg' => '--columns ', 'desc' => 'Number of columns to use for progress output'], + ['arg' => '--columns max', 'desc' => 'Use maximum number of columns for progress output'], + ['arg' => '--stderr', 'desc' => 'Write to STDERR instead of STDOUT'], + ['spacer' => ''], + + ['arg' => '--no-progress', 'desc' => 'Disable output of test execution progress'], + ['arg' => '--no-results', 'desc' => 'Disable output of test results'], + ['arg' => '--no-output', 'desc' => 'Disable all output'], + ['spacer' => ''], + + ['arg' => '--display-incomplete', 'desc' => 'Display details for incomplete tests'], + ['arg' => '--display-skipped', 'desc' => 'Display details for skipped tests'], + ['arg' => '--display-deprecations', 'desc' => 'Display details for deprecations triggered by tests'], + ['arg' => '--display-phpunit-deprecations', 'desc' => 'Display details for PHPUnit deprecations'], + ['arg' => '--display-errors', 'desc' => 'Display details for errors triggered by tests'], + ['arg' => '--display-notices', 'desc' => 'Display details for notices triggered by tests'], + ['arg' => '--display-warnings', 'desc' => 'Display details for warnings triggered by tests'], + ['arg' => '--display-all-issues', 'desc' => 'Display details for all issues that are triggered'], + ['arg' => '--reverse-list', 'desc' => 'Print defects in reverse order'], + ['spacer' => ''], + + ['arg' => '--teamcity', 'desc' => 'Replace default progress and result output with TeamCity format'], + ['arg' => '--testdox', 'desc' => 'Replace default result output with TestDox format'], + ['spacer' => ''], + + ['arg' => '--debug', 'desc' => 'Replace default progress and result output with debugging information'], + ], + + 'Logging' => [ + ['arg' => '--log-junit ', 'desc' => 'Write test results in JUnit XML format to file'], + ['arg' => '--log-teamcity ', 'desc' => 'Write test results in TeamCity format to file'], + ['arg' => '--testdox-html ', 'desc' => 'Write test results in TestDox format (HTML) to file'], + ['arg' => '--testdox-text ', 'desc' => 'Write test results in TestDox format (plain text) to file'], + ['arg' => '--log-events-text ', 'desc' => 'Stream events as plain text to file'], + ['arg' => '--log-events-verbose-text ', 'desc' => 'Stream events as plain text with extended information to file'], + ['arg' => '--no-logging', 'desc' => 'Ignore logging configured in the XML configuration file'], + ], + + 'Code Coverage' => [ + ['arg' => '--coverage-clover ', 'desc' => 'Write code coverage report in Clover XML format to file'], + ['arg' => '--coverage-cobertura ', 'desc' => 'Write code coverage report in Cobertura XML format to file'], + ['arg' => '--coverage-crap4j ', 'desc' => 'Write code coverage report in Crap4J XML format to file'], + ['arg' => '--coverage-html ', 'desc' => 'Write code coverage report in HTML format to directory'], + ['arg' => '--coverage-php ', 'desc' => 'Write serialized code coverage data to file'], + ['arg' => '--coverage-text=', 'desc' => 'Write code coverage report in text format to file [default: standard output]'], + ['arg' => '--only-summary-for-coverage-text', 'desc' => 'Option for code coverage report in text format: only show summary'], + ['arg' => '--show-uncovered-for-coverage-text', 'desc' => 'Option for code coverage report in text format: show uncovered files'], + ['arg' => '--coverage-xml ', 'desc' => 'Write code coverage report in XML format to directory'], + ['arg' => '--warm-coverage-cache', 'desc' => 'Warm static analysis cache'], + ['arg' => '--coverage-filter ', 'desc' => 'Include in code coverage reporting'], + ['arg' => '--path-coverage', 'desc' => 'Report path coverage in addition to line coverage'], + ['arg' => '--disable-coverage-ignore', 'desc' => 'Disable metadata for ignoring code coverage'], + ['arg' => '--no-coverage', 'desc' => 'Ignore code coverage reporting configured in the XML configuration file'], + ], + ]; + + if (defined('__PHPUNIT_PHAR__')) { + $elements['PHAR'] = [ + ['arg' => '--manifest', 'desc' => 'Print Software Bill of Materials (SBOM) in plain-text format'], + ['arg' => '--sbom', 'desc' => 'Print Software Bill of Materials (SBOM) in CycloneDX XML format'], + ['arg' => '--composer-lock', 'desc' => 'Print composer.lock file used to build the PHAR'], + ]; + } + + $elements['Miscellaneous'] = [ + ['arg' => '-h|--help', 'desc' => 'Prints this usage information'], + ['arg' => '--version', 'desc' => 'Prints the version and exits'], + ['arg' => '--atleast-version ', 'desc' => 'Checks that version is greater than and exits'], + ['arg' => '--check-version', 'desc' => 'Checks whether PHPUnit is the latest version and exits'], + ['arg' => '--check-php-configuration', 'desc' => 'Checks whether PHP configuration follows best practices'], + ]; + + return $elements; + } } diff --git a/vendor/phpunit/phpunit/src/TextUI/Output/Default/ProgressPrinter/ProgressPrinter.php b/vendor/phpunit/phpunit/src/TextUI/Output/Default/ProgressPrinter/ProgressPrinter.php index 71f4ed5c..0247f021 100644 --- a/vendor/phpunit/phpunit/src/TextUI/Output/Default/ProgressPrinter/ProgressPrinter.php +++ b/vendor/phpunit/phpunit/src/TextUI/Output/Default/ProgressPrinter/ProgressPrinter.php @@ -16,15 +16,25 @@ use function str_repeat; use function strlen; use PHPUnit\Event\EventFacadeIsSealedException; use PHPUnit\Event\Facade; +use PHPUnit\Event\Test\DeprecationTriggered; use PHPUnit\Event\Test\Errored; -use PHPUnit\Event\Test\PrintedUnexpectedOutput; +use PHPUnit\Event\Test\ErrorTriggered; +use PHPUnit\Event\Test\NoticeTriggered; +use PHPUnit\Event\Test\PhpDeprecationTriggered; +use PHPUnit\Event\Test\PhpNoticeTriggered; +use PHPUnit\Event\Test\PhpWarningTriggered; +use PHPUnit\Event\Test\WarningTriggered; use PHPUnit\Event\TestRunner\ExecutionStarted; use PHPUnit\Event\UnknownSubscriberTypeException; use PHPUnit\Framework\TestStatus\TestStatus; +use PHPUnit\TextUI\Configuration\Source; +use PHPUnit\TextUI\Configuration\SourceFilter; use PHPUnit\TextUI\Output\Printer; use PHPUnit\Util\Color; /** + * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit + * * @internal This class is not covered by the backward compatibility promise for PHPUnit */ final class ProgressPrinter @@ -32,6 +42,7 @@ final class ProgressPrinter private readonly Printer $printer; private readonly bool $colors; private readonly int $numberOfColumns; + private readonly Source $source; private int $column = 0; private int $numberOfTests = 0; private int $numberOfTestsWidth = 0; @@ -44,13 +55,14 @@ final class ProgressPrinter * @throws EventFacadeIsSealedException * @throws UnknownSubscriberTypeException */ - public function __construct(Printer $printer, bool $colors, int $numberOfColumns) + public function __construct(Printer $printer, Facade $facade, bool $colors, int $numberOfColumns, Source $source) { $this->printer = $printer; $this->colors = $colors; $this->numberOfColumns = $numberOfColumns; + $this->source = $source; - $this->registerSubscribers(); + $this->registerSubscribers($facade); } public function testRunnerExecutionStarted(ExecutionStarted $event): void @@ -87,12 +99,79 @@ final class ProgressPrinter $this->updateTestStatus(TestStatus::incomplete()); } - public function testTriggeredNotice(): void + public function testTriggeredNotice(NoticeTriggered $event): void { + if ($event->ignoredByBaseline()) { + return; + } + + if ($this->source->restrictNotices() && + !SourceFilter::instance()->includes($event->file())) { + return; + } + + if (!$this->source->ignoreSuppressionOfNotices() && $event->wasSuppressed()) { + return; + } + $this->updateTestStatus(TestStatus::notice()); } - public function testTriggeredDeprecation(): void + public function testTriggeredPhpNotice(PhpNoticeTriggered $event): void + { + if ($event->ignoredByBaseline()) { + return; + } + + if ($this->source->restrictNotices() && + !SourceFilter::instance()->includes($event->file())) { + return; + } + + if (!$this->source->ignoreSuppressionOfPhpNotices() && $event->wasSuppressed()) { + return; + } + + $this->updateTestStatus(TestStatus::notice()); + } + + public function testTriggeredDeprecation(DeprecationTriggered $event): void + { + if ($event->ignoredByBaseline() || $event->ignoredByTest()) { + return; + } + + if ($this->source->restrictDeprecations() && + !SourceFilter::instance()->includes($event->file())) { + return; + } + + if (!$this->source->ignoreSuppressionOfDeprecations() && $event->wasSuppressed()) { + return; + } + + $this->updateTestStatus(TestStatus::deprecation()); + } + + public function testTriggeredPhpDeprecation(PhpDeprecationTriggered $event): void + { + if ($event->ignoredByBaseline() || $event->ignoredByTest()) { + return; + } + + if ($this->source->restrictDeprecations() && + !SourceFilter::instance()->includes($event->file())) { + return; + } + + if (!$this->source->ignoreSuppressionOfPhpDeprecations() && $event->wasSuppressed()) { + return; + } + + $this->updateTestStatus(TestStatus::deprecation()); + } + + public function testTriggeredPhpunitDeprecation(): void { $this->updateTestStatus(TestStatus::deprecation()); } @@ -102,11 +181,56 @@ final class ProgressPrinter $this->updateTestStatus(TestStatus::risky()); } - public function testTriggeredWarning(): void + public function testTriggeredWarning(WarningTriggered $event): void + { + if ($event->ignoredByBaseline()) { + return; + } + + if ($this->source->restrictWarnings() && + !SourceFilter::instance()->includes($event->file())) { + return; + } + + if (!$this->source->ignoreSuppressionOfWarnings() && $event->wasSuppressed()) { + return; + } + + $this->updateTestStatus(TestStatus::warning()); + } + + public function testTriggeredPhpWarning(PhpWarningTriggered $event): void + { + if ($event->ignoredByBaseline()) { + return; + } + + if ($this->source->restrictWarnings() && + !SourceFilter::instance()->includes($event->file())) { + return; + } + + if (!$this->source->ignoreSuppressionOfPhpWarnings() && $event->wasSuppressed()) { + return; + } + + $this->updateTestStatus(TestStatus::warning()); + } + + public function testTriggeredPhpunitWarning(): void { $this->updateTestStatus(TestStatus::warning()); } + public function testTriggeredError(ErrorTriggered $event): void + { + if (!$this->source->ignoreSuppressionOfErrors() && $event->wasSuppressed()) { + return; + } + + $this->updateTestStatus(TestStatus::error()); + } + public function testFailed(): void { $this->updateTestStatus(TestStatus::failure()); @@ -130,11 +254,6 @@ final class ProgressPrinter } } - public function testPrintedOutput(PrintedUnexpectedOutput $event): void - { - $this->printer->print($event->output()); - } - public function testFinished(): void { if ($this->status === null) { @@ -165,9 +284,9 @@ final class ProgressPrinter * @throws EventFacadeIsSealedException * @throws UnknownSubscriberTypeException */ - private function registerSubscribers(): void + private function registerSubscribers(Facade $facade): void { - Facade::registerSubscribers( + $facade->registerSubscribers( new BeforeTestClassMethodErroredSubscriber($this), new TestConsideredRiskySubscriber($this), new TestErroredSubscriber($this), @@ -185,7 +304,6 @@ final class ProgressPrinter new TestTriggeredPhpunitWarningSubscriber($this), new TestTriggeredPhpWarningSubscriber($this), new TestTriggeredWarningSubscriber($this), - new TestPrintedUnexpectedOutputSubscriber($this), ); } @@ -271,8 +389,8 @@ final class ProgressPrinter $this->numberOfTestsWidth . 'd (%3s%%)', $this->numberOfTestsRun, $this->numberOfTests, - floor(($this->numberOfTestsRun / $this->numberOfTests) * 100) - ) + floor(($this->numberOfTestsRun / $this->numberOfTests) * 100), + ), ); if ($this->column === $this->maxColumn) { diff --git a/vendor/phpunit/phpunit/src/TextUI/Output/Default/ProgressPrinter/Subscriber/BeforeTestClassMethodErroredSubscriber.php b/vendor/phpunit/phpunit/src/TextUI/Output/Default/ProgressPrinter/Subscriber/BeforeTestClassMethodErroredSubscriber.php index 742aa95c..85e63159 100644 --- a/vendor/phpunit/phpunit/src/TextUI/Output/Default/ProgressPrinter/Subscriber/BeforeTestClassMethodErroredSubscriber.php +++ b/vendor/phpunit/phpunit/src/TextUI/Output/Default/ProgressPrinter/Subscriber/BeforeTestClassMethodErroredSubscriber.php @@ -13,6 +13,8 @@ use PHPUnit\Event\Test\BeforeFirstTestMethodErrored; use PHPUnit\Event\Test\BeforeFirstTestMethodErroredSubscriber; /** + * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit + * * @internal This class is not covered by the backward compatibility promise for PHPUnit */ final class BeforeTestClassMethodErroredSubscriber extends Subscriber implements BeforeFirstTestMethodErroredSubscriber diff --git a/vendor/phpunit/phpunit/src/TextUI/Output/Default/ProgressPrinter/Subscriber/Subscriber.php b/vendor/phpunit/phpunit/src/TextUI/Output/Default/ProgressPrinter/Subscriber/Subscriber.php index 46aa73d2..f238ed22 100644 --- a/vendor/phpunit/phpunit/src/TextUI/Output/Default/ProgressPrinter/Subscriber/Subscriber.php +++ b/vendor/phpunit/phpunit/src/TextUI/Output/Default/ProgressPrinter/Subscriber/Subscriber.php @@ -10,6 +10,8 @@ namespace PHPUnit\TextUI\Output\Default\ProgressPrinter; /** + * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit + * * @internal This class is not covered by the backward compatibility promise for PHPUnit */ abstract class Subscriber diff --git a/vendor/phpunit/phpunit/src/TextUI/Output/Default/ProgressPrinter/Subscriber/TestConsideredRiskySubscriber.php b/vendor/phpunit/phpunit/src/TextUI/Output/Default/ProgressPrinter/Subscriber/TestConsideredRiskySubscriber.php index a18303bc..f72056de 100644 --- a/vendor/phpunit/phpunit/src/TextUI/Output/Default/ProgressPrinter/Subscriber/TestConsideredRiskySubscriber.php +++ b/vendor/phpunit/phpunit/src/TextUI/Output/Default/ProgressPrinter/Subscriber/TestConsideredRiskySubscriber.php @@ -13,6 +13,8 @@ use PHPUnit\Event\Test\ConsideredRisky; use PHPUnit\Event\Test\ConsideredRiskySubscriber; /** + * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit + * * @internal This class is not covered by the backward compatibility promise for PHPUnit */ final class TestConsideredRiskySubscriber extends Subscriber implements ConsideredRiskySubscriber diff --git a/vendor/phpunit/phpunit/src/TextUI/Output/Default/ProgressPrinter/Subscriber/TestErroredSubscriber.php b/vendor/phpunit/phpunit/src/TextUI/Output/Default/ProgressPrinter/Subscriber/TestErroredSubscriber.php index d9fbacd7..2c07b789 100644 --- a/vendor/phpunit/phpunit/src/TextUI/Output/Default/ProgressPrinter/Subscriber/TestErroredSubscriber.php +++ b/vendor/phpunit/phpunit/src/TextUI/Output/Default/ProgressPrinter/Subscriber/TestErroredSubscriber.php @@ -13,6 +13,8 @@ use PHPUnit\Event\Test\Errored; use PHPUnit\Event\Test\ErroredSubscriber; /** + * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit + * * @internal This class is not covered by the backward compatibility promise for PHPUnit */ final class TestErroredSubscriber extends Subscriber implements ErroredSubscriber diff --git a/vendor/phpunit/phpunit/src/TextUI/Output/Default/ProgressPrinter/Subscriber/TestFailedSubscriber.php b/vendor/phpunit/phpunit/src/TextUI/Output/Default/ProgressPrinter/Subscriber/TestFailedSubscriber.php index 48ed642c..27f33037 100644 --- a/vendor/phpunit/phpunit/src/TextUI/Output/Default/ProgressPrinter/Subscriber/TestFailedSubscriber.php +++ b/vendor/phpunit/phpunit/src/TextUI/Output/Default/ProgressPrinter/Subscriber/TestFailedSubscriber.php @@ -13,6 +13,8 @@ use PHPUnit\Event\Test\Failed; use PHPUnit\Event\Test\FailedSubscriber; /** + * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit + * * @internal This class is not covered by the backward compatibility promise for PHPUnit */ final class TestFailedSubscriber extends Subscriber implements FailedSubscriber diff --git a/vendor/phpunit/phpunit/src/TextUI/Output/Default/ProgressPrinter/Subscriber/TestFinishedSubscriber.php b/vendor/phpunit/phpunit/src/TextUI/Output/Default/ProgressPrinter/Subscriber/TestFinishedSubscriber.php index 6322c128..fa4d95cb 100644 --- a/vendor/phpunit/phpunit/src/TextUI/Output/Default/ProgressPrinter/Subscriber/TestFinishedSubscriber.php +++ b/vendor/phpunit/phpunit/src/TextUI/Output/Default/ProgressPrinter/Subscriber/TestFinishedSubscriber.php @@ -13,6 +13,8 @@ use PHPUnit\Event\Test\Finished; use PHPUnit\Event\Test\FinishedSubscriber; /** + * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit + * * @internal This class is not covered by the backward compatibility promise for PHPUnit */ final class TestFinishedSubscriber extends Subscriber implements FinishedSubscriber diff --git a/vendor/phpunit/phpunit/src/TextUI/Output/Default/ProgressPrinter/Subscriber/TestMarkedIncompleteSubscriber.php b/vendor/phpunit/phpunit/src/TextUI/Output/Default/ProgressPrinter/Subscriber/TestMarkedIncompleteSubscriber.php index aa3bdb92..2be2d1f1 100644 --- a/vendor/phpunit/phpunit/src/TextUI/Output/Default/ProgressPrinter/Subscriber/TestMarkedIncompleteSubscriber.php +++ b/vendor/phpunit/phpunit/src/TextUI/Output/Default/ProgressPrinter/Subscriber/TestMarkedIncompleteSubscriber.php @@ -13,6 +13,8 @@ use PHPUnit\Event\Test\MarkedIncomplete; use PHPUnit\Event\Test\MarkedIncompleteSubscriber; /** + * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit + * * @internal This class is not covered by the backward compatibility promise for PHPUnit */ final class TestMarkedIncompleteSubscriber extends Subscriber implements MarkedIncompleteSubscriber diff --git a/vendor/phpunit/phpunit/src/TextUI/Output/Default/ProgressPrinter/Subscriber/TestPreparedSubscriber.php b/vendor/phpunit/phpunit/src/TextUI/Output/Default/ProgressPrinter/Subscriber/TestPreparedSubscriber.php index 0924178e..2225ea0e 100644 --- a/vendor/phpunit/phpunit/src/TextUI/Output/Default/ProgressPrinter/Subscriber/TestPreparedSubscriber.php +++ b/vendor/phpunit/phpunit/src/TextUI/Output/Default/ProgressPrinter/Subscriber/TestPreparedSubscriber.php @@ -13,6 +13,8 @@ use PHPUnit\Event\Test\Prepared; use PHPUnit\Event\Test\PreparedSubscriber; /** + * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit + * * @internal This class is not covered by the backward compatibility promise for PHPUnit */ final class TestPreparedSubscriber extends Subscriber implements PreparedSubscriber diff --git a/vendor/phpunit/phpunit/src/TextUI/Output/Default/ProgressPrinter/Subscriber/TestPrintedUnexpectedOutputSubscriber.php b/vendor/phpunit/phpunit/src/TextUI/Output/Default/ProgressPrinter/Subscriber/TestPrintedUnexpectedOutputSubscriber.php deleted file mode 100644 index bda5e76e..00000000 --- a/vendor/phpunit/phpunit/src/TextUI/Output/Default/ProgressPrinter/Subscriber/TestPrintedUnexpectedOutputSubscriber.php +++ /dev/null @@ -1,24 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace PHPUnit\TextUI\Output\Default\ProgressPrinter; - -use PHPUnit\Event\Test\PrintedUnexpectedOutput; -use PHPUnit\Event\Test\PrintedUnexpectedOutputSubscriber; - -/** - * @internal This class is not covered by the backward compatibility promise for PHPUnit - */ -final class TestPrintedUnexpectedOutputSubscriber extends Subscriber implements PrintedUnexpectedOutputSubscriber -{ - public function notify(PrintedUnexpectedOutput $event): void - { - $this->printer()->testPrintedOutput($event); - } -} diff --git a/vendor/phpunit/phpunit/src/TextUI/Output/Default/ProgressPrinter/Subscriber/TestRunnerExecutionStartedSubscriber.php b/vendor/phpunit/phpunit/src/TextUI/Output/Default/ProgressPrinter/Subscriber/TestRunnerExecutionStartedSubscriber.php index 6735462c..666dcc93 100644 --- a/vendor/phpunit/phpunit/src/TextUI/Output/Default/ProgressPrinter/Subscriber/TestRunnerExecutionStartedSubscriber.php +++ b/vendor/phpunit/phpunit/src/TextUI/Output/Default/ProgressPrinter/Subscriber/TestRunnerExecutionStartedSubscriber.php @@ -13,6 +13,8 @@ use PHPUnit\Event\TestRunner\ExecutionStarted; use PHPUnit\Event\TestRunner\ExecutionStartedSubscriber; /** + * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit + * * @internal This class is not covered by the backward compatibility promise for PHPUnit */ final class TestRunnerExecutionStartedSubscriber extends Subscriber implements ExecutionStartedSubscriber diff --git a/vendor/phpunit/phpunit/src/TextUI/Output/Default/ProgressPrinter/Subscriber/TestSkippedSubscriber.php b/vendor/phpunit/phpunit/src/TextUI/Output/Default/ProgressPrinter/Subscriber/TestSkippedSubscriber.php index c7b29fe2..2b05a753 100644 --- a/vendor/phpunit/phpunit/src/TextUI/Output/Default/ProgressPrinter/Subscriber/TestSkippedSubscriber.php +++ b/vendor/phpunit/phpunit/src/TextUI/Output/Default/ProgressPrinter/Subscriber/TestSkippedSubscriber.php @@ -13,6 +13,8 @@ use PHPUnit\Event\Test\Skipped; use PHPUnit\Event\Test\SkippedSubscriber; /** + * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit + * * @internal This class is not covered by the backward compatibility promise for PHPUnit */ final class TestSkippedSubscriber extends Subscriber implements SkippedSubscriber diff --git a/vendor/phpunit/phpunit/src/TextUI/Output/Default/ProgressPrinter/Subscriber/TestTriggeredDeprecationSubscriber.php b/vendor/phpunit/phpunit/src/TextUI/Output/Default/ProgressPrinter/Subscriber/TestTriggeredDeprecationSubscriber.php index 530579fa..d7eb7970 100644 --- a/vendor/phpunit/phpunit/src/TextUI/Output/Default/ProgressPrinter/Subscriber/TestTriggeredDeprecationSubscriber.php +++ b/vendor/phpunit/phpunit/src/TextUI/Output/Default/ProgressPrinter/Subscriber/TestTriggeredDeprecationSubscriber.php @@ -13,12 +13,14 @@ use PHPUnit\Event\Test\DeprecationTriggered; use PHPUnit\Event\Test\DeprecationTriggeredSubscriber; /** + * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit + * * @internal This class is not covered by the backward compatibility promise for PHPUnit */ final class TestTriggeredDeprecationSubscriber extends Subscriber implements DeprecationTriggeredSubscriber { public function notify(DeprecationTriggered $event): void { - $this->printer()->testTriggeredDeprecation(); + $this->printer()->testTriggeredDeprecation($event); } } diff --git a/vendor/phpunit/phpunit/src/TextUI/Output/Default/ProgressPrinter/Subscriber/TestTriggeredNoticeSubscriber.php b/vendor/phpunit/phpunit/src/TextUI/Output/Default/ProgressPrinter/Subscriber/TestTriggeredNoticeSubscriber.php index 4dbbec17..e396c961 100644 --- a/vendor/phpunit/phpunit/src/TextUI/Output/Default/ProgressPrinter/Subscriber/TestTriggeredNoticeSubscriber.php +++ b/vendor/phpunit/phpunit/src/TextUI/Output/Default/ProgressPrinter/Subscriber/TestTriggeredNoticeSubscriber.php @@ -13,12 +13,14 @@ use PHPUnit\Event\Test\NoticeTriggered; use PHPUnit\Event\Test\NoticeTriggeredSubscriber; /** + * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit + * * @internal This class is not covered by the backward compatibility promise for PHPUnit */ final class TestTriggeredNoticeSubscriber extends Subscriber implements NoticeTriggeredSubscriber { public function notify(NoticeTriggered $event): void { - $this->printer()->testTriggeredNotice(); + $this->printer()->testTriggeredNotice($event); } } diff --git a/vendor/phpunit/phpunit/src/TextUI/Output/Default/ProgressPrinter/Subscriber/TestTriggeredPhpDeprecationSubscriber.php b/vendor/phpunit/phpunit/src/TextUI/Output/Default/ProgressPrinter/Subscriber/TestTriggeredPhpDeprecationSubscriber.php index 42e7b261..65a24208 100644 --- a/vendor/phpunit/phpunit/src/TextUI/Output/Default/ProgressPrinter/Subscriber/TestTriggeredPhpDeprecationSubscriber.php +++ b/vendor/phpunit/phpunit/src/TextUI/Output/Default/ProgressPrinter/Subscriber/TestTriggeredPhpDeprecationSubscriber.php @@ -13,12 +13,14 @@ use PHPUnit\Event\Test\PhpDeprecationTriggered; use PHPUnit\Event\Test\PhpDeprecationTriggeredSubscriber; /** + * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit + * * @internal This class is not covered by the backward compatibility promise for PHPUnit */ final class TestTriggeredPhpDeprecationSubscriber extends Subscriber implements PhpDeprecationTriggeredSubscriber { public function notify(PhpDeprecationTriggered $event): void { - $this->printer()->testTriggeredDeprecation(); + $this->printer()->testTriggeredPhpDeprecation($event); } } diff --git a/vendor/phpunit/phpunit/src/TextUI/Output/Default/ProgressPrinter/Subscriber/TestTriggeredPhpNoticeSubscriber.php b/vendor/phpunit/phpunit/src/TextUI/Output/Default/ProgressPrinter/Subscriber/TestTriggeredPhpNoticeSubscriber.php index 04d7b22c..f783fbc1 100644 --- a/vendor/phpunit/phpunit/src/TextUI/Output/Default/ProgressPrinter/Subscriber/TestTriggeredPhpNoticeSubscriber.php +++ b/vendor/phpunit/phpunit/src/TextUI/Output/Default/ProgressPrinter/Subscriber/TestTriggeredPhpNoticeSubscriber.php @@ -13,12 +13,14 @@ use PHPUnit\Event\Test\PhpNoticeTriggered; use PHPUnit\Event\Test\PhpNoticeTriggeredSubscriber; /** + * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit + * * @internal This class is not covered by the backward compatibility promise for PHPUnit */ final class TestTriggeredPhpNoticeSubscriber extends Subscriber implements PhpNoticeTriggeredSubscriber { public function notify(PhpNoticeTriggered $event): void { - $this->printer()->testTriggeredNotice(); + $this->printer()->testTriggeredPhpNotice($event); } } diff --git a/vendor/phpunit/phpunit/src/TextUI/Output/Default/ProgressPrinter/Subscriber/TestTriggeredPhpWarningSubscriber.php b/vendor/phpunit/phpunit/src/TextUI/Output/Default/ProgressPrinter/Subscriber/TestTriggeredPhpWarningSubscriber.php index 5c9fd0af..18e723bd 100644 --- a/vendor/phpunit/phpunit/src/TextUI/Output/Default/ProgressPrinter/Subscriber/TestTriggeredPhpWarningSubscriber.php +++ b/vendor/phpunit/phpunit/src/TextUI/Output/Default/ProgressPrinter/Subscriber/TestTriggeredPhpWarningSubscriber.php @@ -13,12 +13,14 @@ use PHPUnit\Event\Test\PhpWarningTriggered; use PHPUnit\Event\Test\PhpWarningTriggeredSubscriber; /** + * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit + * * @internal This class is not covered by the backward compatibility promise for PHPUnit */ final class TestTriggeredPhpWarningSubscriber extends Subscriber implements PhpWarningTriggeredSubscriber { public function notify(PhpWarningTriggered $event): void { - $this->printer()->testTriggeredWarning(); + $this->printer()->testTriggeredPhpWarning($event); } } diff --git a/vendor/phpunit/phpunit/src/TextUI/Output/Default/ProgressPrinter/Subscriber/TestTriggeredPhpunitDeprecationSubscriber.php b/vendor/phpunit/phpunit/src/TextUI/Output/Default/ProgressPrinter/Subscriber/TestTriggeredPhpunitDeprecationSubscriber.php index 78e3a380..f273f8aa 100644 --- a/vendor/phpunit/phpunit/src/TextUI/Output/Default/ProgressPrinter/Subscriber/TestTriggeredPhpunitDeprecationSubscriber.php +++ b/vendor/phpunit/phpunit/src/TextUI/Output/Default/ProgressPrinter/Subscriber/TestTriggeredPhpunitDeprecationSubscriber.php @@ -13,12 +13,14 @@ use PHPUnit\Event\Test\PhpunitDeprecationTriggered; use PHPUnit\Event\Test\PhpunitDeprecationTriggeredSubscriber; /** + * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit + * * @internal This class is not covered by the backward compatibility promise for PHPUnit */ final class TestTriggeredPhpunitDeprecationSubscriber extends Subscriber implements PhpunitDeprecationTriggeredSubscriber { public function notify(PhpunitDeprecationTriggered $event): void { - $this->printer()->testTriggeredDeprecation(); + $this->printer()->testTriggeredPhpunitDeprecation(); } } diff --git a/vendor/phpunit/phpunit/src/TextUI/Output/Default/ProgressPrinter/Subscriber/TestTriggeredPhpunitWarningSubscriber.php b/vendor/phpunit/phpunit/src/TextUI/Output/Default/ProgressPrinter/Subscriber/TestTriggeredPhpunitWarningSubscriber.php index dc7d722d..12087c4d 100644 --- a/vendor/phpunit/phpunit/src/TextUI/Output/Default/ProgressPrinter/Subscriber/TestTriggeredPhpunitWarningSubscriber.php +++ b/vendor/phpunit/phpunit/src/TextUI/Output/Default/ProgressPrinter/Subscriber/TestTriggeredPhpunitWarningSubscriber.php @@ -13,12 +13,14 @@ use PHPUnit\Event\Test\PhpunitWarningTriggered; use PHPUnit\Event\Test\PhpunitWarningTriggeredSubscriber; /** + * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit + * * @internal This class is not covered by the backward compatibility promise for PHPUnit */ final class TestTriggeredPhpunitWarningSubscriber extends Subscriber implements PhpunitWarningTriggeredSubscriber { public function notify(PhpunitWarningTriggered $event): void { - $this->printer()->testTriggeredWarning(); + $this->printer()->testTriggeredPhpunitWarning(); } } diff --git a/vendor/phpunit/phpunit/src/TextUI/Output/Default/ProgressPrinter/Subscriber/TestTriggeredWarningSubscriber.php b/vendor/phpunit/phpunit/src/TextUI/Output/Default/ProgressPrinter/Subscriber/TestTriggeredWarningSubscriber.php index 965a4f55..05188dce 100644 --- a/vendor/phpunit/phpunit/src/TextUI/Output/Default/ProgressPrinter/Subscriber/TestTriggeredWarningSubscriber.php +++ b/vendor/phpunit/phpunit/src/TextUI/Output/Default/ProgressPrinter/Subscriber/TestTriggeredWarningSubscriber.php @@ -13,12 +13,14 @@ use PHPUnit\Event\Test\WarningTriggered; use PHPUnit\Event\Test\WarningTriggeredSubscriber; /** + * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit + * * @internal This class is not covered by the backward compatibility promise for PHPUnit */ final class TestTriggeredWarningSubscriber extends Subscriber implements WarningTriggeredSubscriber { public function notify(WarningTriggered $event): void { - $this->printer()->testTriggeredWarning(); + $this->printer()->testTriggeredWarning($event); } } diff --git a/vendor/phpunit/phpunit/src/TextUI/Output/Default/ResultPrinter.php b/vendor/phpunit/phpunit/src/TextUI/Output/Default/ResultPrinter.php index d95b6723..c57035cd 100644 --- a/vendor/phpunit/phpunit/src/TextUI/Output/Default/ResultPrinter.php +++ b/vendor/phpunit/phpunit/src/TextUI/Output/Default/ResultPrinter.php @@ -10,11 +10,14 @@ namespace PHPUnit\TextUI\Output\Default; use const PHP_EOL; +use function array_keys; use function array_merge; use function array_reverse; +use function array_unique; use function assert; use function count; use function explode; +use function ksort; use function range; use function sprintf; use function str_starts_with; @@ -23,6 +26,7 @@ use function substr; use function trim; use PHPUnit\Event\Code\Test; use PHPUnit\Event\Code\TestMethod; +use PHPUnit\Event\Test\AfterLastTestMethodErrored; use PHPUnit\Event\Test\BeforeFirstTestMethodErrored; use PHPUnit\Event\Test\ConsideredRisky; use PHPUnit\Event\Test\DeprecationTriggered; @@ -35,11 +39,13 @@ use PHPUnit\Event\Test\PhpunitErrorTriggered; use PHPUnit\Event\Test\PhpunitWarningTriggered; use PHPUnit\Event\Test\PhpWarningTriggered; use PHPUnit\Event\Test\WarningTriggered; -use PHPUnit\Event\TestData\NoDataSetFromDataProviderException; +use PHPUnit\TestRunner\TestResult\Issues\Issue; use PHPUnit\TestRunner\TestResult\TestResult; use PHPUnit\TextUI\Output\Printer; /** + * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit + * * @internal This class is not covered by the backward compatibility promise for PHPUnit */ final class ResultPrinter @@ -50,7 +56,7 @@ final class ResultPrinter private readonly bool $displayTestsWithErrors; private readonly bool $displayTestsWithFailedAssertions; private readonly bool $displayRiskyTests; - private readonly bool $displayDetailsOnTestsThatTriggeredPhpunitDeprecations; + private readonly bool $displayPhpunitDeprecations; private readonly bool $displayDetailsOnIncompleteTests; private readonly bool $displayDetailsOnSkippedTests; private readonly bool $displayDetailsOnTestsThatTriggerDeprecations; @@ -60,22 +66,22 @@ final class ResultPrinter private readonly bool $displayDefectsInReverseOrder; private bool $listPrinted = false; - public function __construct(Printer $printer, bool $displayPhpunitErrors, bool $displayPhpunitWarnings, bool $displayTestsWithErrors, bool $displayTestsWithFailedAssertions, bool $displayRiskyTests, bool $displayDetailsOnTestsThatTriggeredPhpunitDeprecations, bool $displayDetailsOnIncompleteTests, bool $displayDetailsOnSkippedTests, bool $displayDetailsOnTestsThatTriggerDeprecations, bool $displayDetailsOnTestsThatTriggerErrors, bool $displayDetailsOnTestsThatTriggerNotices, bool $displayDetailsOnTestsThatTriggerWarnings, bool $displayDefectsInReverseOrder) + public function __construct(Printer $printer, bool $displayPhpunitErrors, bool $displayPhpunitWarnings, bool $displayPhpunitDeprecations, bool $displayTestsWithErrors, bool $displayTestsWithFailedAssertions, bool $displayRiskyTests, bool $displayDetailsOnIncompleteTests, bool $displayDetailsOnSkippedTests, bool $displayDetailsOnTestsThatTriggerDeprecations, bool $displayDetailsOnTestsThatTriggerErrors, bool $displayDetailsOnTestsThatTriggerNotices, bool $displayDetailsOnTestsThatTriggerWarnings, bool $displayDefectsInReverseOrder) { - $this->printer = $printer; - $this->displayPhpunitErrors = $displayPhpunitErrors; - $this->displayPhpunitWarnings = $displayPhpunitWarnings; - $this->displayTestsWithErrors = $displayTestsWithErrors; - $this->displayTestsWithFailedAssertions = $displayTestsWithFailedAssertions; - $this->displayRiskyTests = $displayRiskyTests; - $this->displayDetailsOnTestsThatTriggeredPhpunitDeprecations = $displayDetailsOnTestsThatTriggeredPhpunitDeprecations; - $this->displayDetailsOnIncompleteTests = $displayDetailsOnIncompleteTests; - $this->displayDetailsOnSkippedTests = $displayDetailsOnSkippedTests; - $this->displayDetailsOnTestsThatTriggerDeprecations = $displayDetailsOnTestsThatTriggerDeprecations; - $this->displayDetailsOnTestsThatTriggerErrors = $displayDetailsOnTestsThatTriggerErrors; - $this->displayDetailsOnTestsThatTriggerNotices = $displayDetailsOnTestsThatTriggerNotices; - $this->displayDetailsOnTestsThatTriggerWarnings = $displayDetailsOnTestsThatTriggerWarnings; - $this->displayDefectsInReverseOrder = $displayDefectsInReverseOrder; + $this->printer = $printer; + $this->displayPhpunitErrors = $displayPhpunitErrors; + $this->displayPhpunitWarnings = $displayPhpunitWarnings; + $this->displayPhpunitDeprecations = $displayPhpunitDeprecations; + $this->displayTestsWithErrors = $displayTestsWithErrors; + $this->displayTestsWithFailedAssertions = $displayTestsWithFailedAssertions; + $this->displayRiskyTests = $displayRiskyTests; + $this->displayDetailsOnIncompleteTests = $displayDetailsOnIncompleteTests; + $this->displayDetailsOnSkippedTests = $displayDetailsOnSkippedTests; + $this->displayDetailsOnTestsThatTriggerDeprecations = $displayDetailsOnTestsThatTriggerDeprecations; + $this->displayDetailsOnTestsThatTriggerErrors = $displayDetailsOnTestsThatTriggerErrors; + $this->displayDetailsOnTestsThatTriggerNotices = $displayDetailsOnTestsThatTriggerNotices; + $this->displayDetailsOnTestsThatTriggerWarnings = $displayDetailsOnTestsThatTriggerWarnings; + $this->displayDefectsInReverseOrder = $displayDefectsInReverseOrder; } public function print(TestResult $result): void @@ -85,7 +91,11 @@ final class ResultPrinter } if ($this->displayPhpunitWarnings) { - $this->printPhpunitWarnings($result); + $this->printTestRunnerWarnings($result); + } + + if ($this->displayPhpunitDeprecations) { + $this->printTestRunnerDeprecations($result); } if ($this->displayTestsWithErrors) { @@ -96,14 +106,18 @@ final class ResultPrinter $this->printTestsWithFailedAssertions($result); } - if ($this->displayRiskyTests) { - $this->printRiskyTests($result); + if ($this->displayPhpunitWarnings) { + $this->printDetailsOnTestsThatTriggeredPhpunitWarnings($result); } - if ($this->displayDetailsOnTestsThatTriggeredPhpunitDeprecations) { + if ($this->displayPhpunitDeprecations) { $this->printDetailsOnTestsThatTriggeredPhpunitDeprecations($result); } + if ($this->displayRiskyTests) { + $this->printRiskyTests($result); + } + if ($this->displayDetailsOnIncompleteTests) { $this->printIncompleteTests($result); } @@ -113,29 +127,24 @@ final class ResultPrinter $this->printSkippedTests($result); } - if ($this->displayDetailsOnTestsThatTriggerDeprecations) { - $this->printDetailsOnTestsThatTriggerPhpDeprecations($result); - $this->printDetailsOnTestsThatTriggerDeprecations($result); - } - if ($this->displayDetailsOnTestsThatTriggerErrors) { - $this->printDetailsOnTestsThatTriggerErrors($result); - } - - if ($this->displayDetailsOnTestsThatTriggerNotices) { - $this->printDetailsOnTestsThatTriggerPhpNotices($result); - $this->printDetailsOnTestsThatTriggerNotices($result); + $this->printIssueList('error', $result->errors()); } if ($this->displayDetailsOnTestsThatTriggerWarnings) { - $this->printDetailsOnTestsThatTriggerPhpWarnings($result); - $this->printDetailsOnTestsThatTriggerWarnings($result); + $this->printIssueList('PHP warning', $result->phpWarnings()); + $this->printIssueList('warning', $result->warnings()); } - } - public function flush(): void - { - $this->printer->flush(); + if ($this->displayDetailsOnTestsThatTriggerNotices) { + $this->printIssueList('PHP notice', $result->phpNotices()); + $this->printIssueList('notice', $result->notices()); + } + + if ($this->displayDetailsOnTestsThatTriggerDeprecations) { + $this->printIssueList('PHP deprecation', $result->phpDeprecations()); + $this->printIssueList('deprecation', $result->deprecations()); + } } private function printPhpunitErrors(TestResult $result): void @@ -144,39 +153,10 @@ final class ResultPrinter return; } - $this->printList( - $result->numberOfTestsWithTestTriggeredPhpunitErrorEvents(), - $this->mapTestsWithIssuesEventsToElements($result->testTriggeredPhpunitErrorEvents()), - 'PHPUnit error' - ); - } + $elements = $this->mapTestsWithIssuesEventsToElements($result->testTriggeredPhpunitErrorEvents()); - private function printPhpunitWarnings(TestResult $result): void - { - if (!$result->hasTestRunnerTriggeredWarningEvents() && - !$result->hasTestTriggeredPhpunitWarningEvents()) { - return; - } - - $elements = []; - - foreach ($result->testRunnerTriggeredWarningEvents() as $event) { - $elements[] = [ - 'title' => $event->message(), - 'body' => '', - ]; - } - - $elements = array_merge( - $elements, - $this->mapTestsWithIssuesEventsToElements($result->testTriggeredPhpunitWarningEvents()) - ); - - $this->printList( - $result->numberOfTestRunnerTriggeredWarningEvents() + $result->numberOfTestsWithTestTriggeredPhpunitWarningEvents(), - $elements, - 'PHPUnit warning' - ); + $this->printListHeaderWithNumber($elements['numberOfTestsWithIssues'], 'PHPUnit error'); + $this->printList($elements['elements']); } private function printDetailsOnTestsThatTriggeredPhpunitDeprecations(TestResult $result): void @@ -185,11 +165,77 @@ final class ResultPrinter return; } - $this->printList( - $result->numberOfTestsWithTestTriggeredPhpunitDeprecationEvents(), - $this->mapTestsWithIssuesEventsToElements($result->testTriggeredPhpunitDeprecationEvents()), - 'PHPUnit deprecation' + $elements = $this->mapTestsWithIssuesEventsToElements($result->testTriggeredPhpunitDeprecationEvents()); + + $this->printListHeaderWithNumberOfTestsAndNumberOfIssues( + $elements['numberOfTestsWithIssues'], + $elements['numberOfIssues'], + 'PHPUnit deprecation', ); + + $this->printList($elements['elements']); + } + + private function printTestRunnerWarnings(TestResult $result): void + { + if (!$result->hasTestRunnerTriggeredWarningEvents()) { + return; + } + + $elements = []; + $messages = []; + + foreach ($result->testRunnerTriggeredWarningEvents() as $event) { + if (isset($messages[$event->message()])) { + continue; + } + + $elements[] = [ + 'title' => $event->message(), + 'body' => '', + ]; + + $messages[$event->message()] = true; + } + + $this->printListHeaderWithNumber(count($elements), 'PHPUnit test runner warning'); + $this->printList($elements); + } + + private function printTestRunnerDeprecations(TestResult $result): void + { + if (!$result->hasTestRunnerTriggeredDeprecationEvents()) { + return; + } + + $elements = []; + + foreach ($result->testRunnerTriggeredDeprecationEvents() as $event) { + $elements[] = [ + 'title' => $event->message(), + 'body' => '', + ]; + } + + $this->printListHeaderWithNumber(count($elements), 'PHPUnit test runner deprecation'); + $this->printList($elements); + } + + private function printDetailsOnTestsThatTriggeredPhpunitWarnings(TestResult $result): void + { + if (!$result->hasTestTriggeredPhpunitWarningEvents()) { + return; + } + + $elements = $this->mapTestsWithIssuesEventsToElements($result->testTriggeredPhpunitWarningEvents()); + + $this->printListHeaderWithNumberOfTestsAndNumberOfIssues( + $elements['numberOfTestsWithIssues'], + $elements['numberOfIssues'], + 'PHPUnit warning', + ); + + $this->printList($elements['elements']); } private function printTestsWithErrors(TestResult $result): void @@ -201,7 +247,7 @@ final class ResultPrinter $elements = []; foreach ($result->testErroredEvents() as $event) { - if ($event instanceof BeforeFirstTestMethodErrored) { + if ($event instanceof AfterLastTestMethodErrored || $event instanceof BeforeFirstTestMethodErrored) { $title = $event->testClassName(); } else { $title = $this->name($event->test()); @@ -213,7 +259,8 @@ final class ResultPrinter ]; } - $this->printList(count($elements), $elements, 'error'); + $this->printListHeaderWithNumber(count($elements), 'error'); + $this->printList($elements); } private function printTestsWithFailedAssertions(TestResult $result): void @@ -237,7 +284,8 @@ final class ResultPrinter ]; } - $this->printList(count($elements), $elements, 'failure'); + $this->printListHeaderWithNumber(count($elements), 'failure'); + $this->printList($elements); } private function printRiskyTests(TestResult $result): void @@ -246,11 +294,10 @@ final class ResultPrinter return; } - $this->printList( - $result->numberOfTestsWithTestConsideredRiskyEvents(), - $this->mapTestsWithIssuesEventsToElements($result->testConsideredRiskyEvents()), - 'risky test' - ); + $elements = $this->mapTestsWithIssuesEventsToElements($result->testConsideredRiskyEvents()); + + $this->printListHeaderWithNumber($elements['numberOfTestsWithIssues'], 'risky test'); + $this->printList($elements['elements']); } private function printIncompleteTests(TestResult $result): void @@ -268,7 +315,8 @@ final class ResultPrinter ]; } - $this->printList(count($elements), $elements, 'incomplete test'); + $this->printListHeaderWithNumber(count($elements), 'incomplete test'); + $this->printList($elements); } private function printSkippedTestSuites(TestResult $result): void @@ -286,7 +334,8 @@ final class ResultPrinter ]; } - $this->printList(count($elements), $elements, 'skipped test suite'); + $this->printListHeaderWithNumber(count($elements), 'skipped test suite'); + $this->printList($elements); } private function printSkippedTests(TestResult $result): void @@ -304,104 +353,105 @@ final class ResultPrinter ]; } - $this->printList(count($elements), $elements, 'skipped test'); - } - - private function printDetailsOnTestsThatTriggerPhpDeprecations(TestResult $result): void - { - if (!$result->hasTestTriggeredPhpDeprecationEvents()) { - return; - } - - $this->printList( - $result->numberOfTestsWithTestTriggeredPhpDeprecationEvents(), - $this->mapTestsWithIssuesEventsToElements($result->testTriggeredPhpDeprecationEvents()), - 'PHP deprecation' - ); - } - - private function printDetailsOnTestsThatTriggerDeprecations(TestResult $result): void - { - if (!$result->hasTestTriggeredDeprecationEvents()) { - return; - } - - $this->printList( - $result->numberOfTestsWithTestTriggeredDeprecationEvents(), - $this->mapTestsWithIssuesEventsToElements($result->testTriggeredDeprecationEvents()), - 'deprecation' - ); - } - - private function printDetailsOnTestsThatTriggerErrors(TestResult $result): void - { - if (!$result->hasTestTriggeredErrorEvents()) { - return; - } - - $this->printList( - $result->numberOfTestsWithTestTriggeredErrorEvents(), - $this->mapTestsWithIssuesEventsToElements($result->testTriggeredErrorEvents()), - 'error' - ); - } - - private function printDetailsOnTestsThatTriggerPhpNotices(TestResult $result): void - { - if (!$result->hasTestTriggeredPhpNoticeEvents()) { - return; - } - - $this->printList( - $result->numberOfTestsWithTestTriggeredPhpNoticeEvents(), - $this->mapTestsWithIssuesEventsToElements($result->testTriggeredPhpNoticeEvents()), - 'PHP notice' - ); - } - - private function printDetailsOnTestsThatTriggerNotices(TestResult $result): void - { - if (!$result->hasTestTriggeredNoticeEvents()) { - return; - } - - $this->printList( - $result->numberOfTestsWithTestTriggeredNoticeEvents(), - $this->mapTestsWithIssuesEventsToElements($result->testTriggeredNoticeEvents()), - 'notice' - ); - } - - private function printDetailsOnTestsThatTriggerPhpWarnings(TestResult $result): void - { - if (!$result->hasTestTriggeredPhpWarningEvents()) { - return; - } - - $this->printList( - $result->numberOfTestsWithTestTriggeredPhpWarningEvents(), - $this->mapTestsWithIssuesEventsToElements($result->testTriggeredPhpWarningEvents()), - 'PHP warning' - ); - } - - private function printDetailsOnTestsThatTriggerWarnings(TestResult $result): void - { - if (!$result->hasTestTriggeredWarningEvents()) { - return; - } - - $this->printList( - $result->numberOfTestsWithTestTriggeredWarningEvents(), - $this->mapTestsWithIssuesEventsToElements($result->testTriggeredWarningEvents()), - 'warning' - ); + $this->printListHeaderWithNumber(count($elements), 'skipped test'); + $this->printList($elements); } /** - * @psalm-param list $elements + * @psalm-param non-empty-string $type + * @psalm-param list $issues */ - private function printList(int $count, array $elements, string $type): void + private function printIssueList(string $type, array $issues): void + { + if (empty($issues)) { + return; + } + + $numberOfUniqueIssues = count($issues); + $triggeringTests = []; + + foreach ($issues as $issue) { + $triggeringTests = array_merge($triggeringTests, array_keys($issue->triggeringTests())); + } + + $numberOfTests = count(array_unique($triggeringTests)); + unset($triggeringTests); + + $this->printListHeader( + sprintf( + '%d test%s triggered %d %s%s:' . PHP_EOL . PHP_EOL, + $numberOfTests, + $numberOfTests !== 1 ? 's' : '', + $numberOfUniqueIssues, + $type, + $numberOfUniqueIssues !== 1 ? 's' : '', + ), + ); + + $i = 1; + + foreach ($issues as $issue) { + $title = sprintf( + '%s:%d', + $issue->file(), + $issue->line(), + ); + + $body = trim($issue->description()) . PHP_EOL . PHP_EOL . 'Triggered by:'; + + $triggeringTests = $issue->triggeringTests(); + + ksort($triggeringTests); + + foreach ($triggeringTests as $triggeringTest) { + $body .= PHP_EOL . PHP_EOL . '* ' . $triggeringTest['test']->id(); + + if ($triggeringTest['count'] > 1) { + $body .= sprintf( + ' (%d times)', + $triggeringTest['count'], + ); + } + + if ($triggeringTest['test']->isTestMethod()) { + $body .= PHP_EOL . ' ' . $triggeringTest['test']->file() . ':' . $triggeringTest['test']->line(); + } + } + + $this->printIssueListElement($i++, $title, $body); + + $this->printer->print(PHP_EOL); + } + } + + private function printListHeaderWithNumberOfTestsAndNumberOfIssues(int $numberOfTestsWithIssues, int $numberOfIssues, string $type): void + { + $this->printListHeader( + sprintf( + "%d test%s triggered %d %s%s:\n\n", + $numberOfTestsWithIssues, + $numberOfTestsWithIssues !== 1 ? 's' : '', + $numberOfIssues, + $type, + $numberOfIssues !== 1 ? 's' : '', + ), + ); + } + + private function printListHeaderWithNumber(int $number, string $type): void + { + $this->printListHeader( + sprintf( + "There %s %d %s%s:\n\n", + ($number === 1) ? 'was' : 'were', + $number, + $type, + ($number === 1) ? '' : 's', + ), + ); + } + + private function printListHeader(string $header): void { if ($this->listPrinted) { $this->printer->print("--\n\n"); @@ -409,16 +459,14 @@ final class ResultPrinter $this->listPrinted = true; - $this->printer->print( - sprintf( - "There %s %d %s%s:\n\n", - ($count === 1) ? 'was' : 'were', - $count, - $type, - ($count === 1) ? '' : 's' - ) - ); + $this->printer->print($header); + } + /** + * @psalm-param list $elements + */ + private function printList(array $elements): void + { $i = 1; if ($this->displayDefectsInReverseOrder) { @@ -443,82 +491,74 @@ final class ResultPrinter $number, $title, $body, - !empty($body) ? "\n" : '' - ) + !empty($body) ? "\n" : '', + ), + ); + } + + private function printIssueListElement(int $number, string $title, string $body): void + { + $body = trim($body); + + $this->printer->print( + sprintf( + "%d) %s\n%s%s", + $number, + $title, + $body, + !empty($body) ? "\n" : '', + ), ); } - /** - * @throws NoDataSetFromDataProviderException - */ private function name(Test $test): string { if ($test->isTestMethod()) { assert($test instanceof TestMethod); - return $test->nameWithClass(); + if (!$test->testData()->hasDataFromDataProvider()) { + return $test->nameWithClass(); + } + + return $test->className() . '::' . $test->methodName() . $test->testData()->dataFromDataProvider()->dataAsStringForResultOutput(); } return $test->name(); } - private function location(Test $test): string - { - if (!$test->isTestMethod()) { - return ''; - } - assert($test instanceof TestMethod); - - return sprintf( - '%s%s:%d%s', - PHP_EOL, - $test->file(), - $test->line(), - PHP_EOL - ); - } - /** * @psalm-param array> $events * - * @psalm-return list + * @psalm-return array{numberOfTestsWithIssues: int, numberOfIssues: int, elements: list} */ private function mapTestsWithIssuesEventsToElements(array $events): array { $elements = []; + $issues = 0; foreach ($events as $reasons) { - $test = $reasons[0]->test(); - $title = $this->name($test); - $location = $this->location($test); + $test = $reasons[0]->test(); + $testLocation = $this->testLocation($test); + $title = $this->name($test); + $body = ''; + $first = true; + $single = count($reasons) === 1; - if (count($reasons) === 1) { - $body = trim($reasons[0]->message()) . PHP_EOL; - } else { - $body = ''; - $first = true; - - foreach ($reasons as $reason) { - if ($first) { - $first = false; - } else { - $body .= PHP_EOL; - } - - $lines = explode(PHP_EOL, trim($reason->message())); - - $body .= '* ' . $lines[0] . PHP_EOL; - - if (count($lines) > 1) { - foreach (range(1, count($lines) - 1) as $line) { - $body .= ' ' . $lines[$line] . PHP_EOL; - } - } + foreach ($reasons as $reason) { + if ($first) { + $first = false; + } else { + $body .= PHP_EOL; } + + $body .= $this->reasonMessage($reason, $single); + $body .= $this->reasonLocation($reason, $single); + + $issues++; } - if (!empty($location)) { - $body .= $location; + if (!empty($testLocation)) { + $body .= $testLocation; } $elements[] = [ @@ -527,6 +567,68 @@ final class ResultPrinter ]; } - return $elements; + return [ + 'numberOfTestsWithIssues' => count($events), + 'numberOfIssues' => $issues, + 'elements' => $elements, + ]; + } + + private function testLocation(Test $test): string + { + if (!$test->isTestMethod()) { + return ''; + } + + assert($test instanceof TestMethod); + + return sprintf( + '%s%s:%d%s', + PHP_EOL, + $test->file(), + $test->line(), + PHP_EOL, + ); + } + + private function reasonMessage(ConsideredRisky|DeprecationTriggered|ErrorTriggered|NoticeTriggered|PhpDeprecationTriggered|PhpNoticeTriggered|PhpunitDeprecationTriggered|PhpunitErrorTriggered|PhpunitWarningTriggered|PhpWarningTriggered|WarningTriggered $reason, bool $single): string + { + $message = trim($reason->message()); + + if ($single) { + return $message . PHP_EOL; + } + + $lines = explode(PHP_EOL, $message); + $buffer = '* ' . $lines[0] . PHP_EOL; + + if (count($lines) > 1) { + foreach (range(1, count($lines) - 1) as $line) { + $buffer .= ' ' . $lines[$line] . PHP_EOL; + } + } + + return $buffer; + } + + private function reasonLocation(ConsideredRisky|DeprecationTriggered|ErrorTriggered|NoticeTriggered|PhpDeprecationTriggered|PhpNoticeTriggered|PhpunitDeprecationTriggered|PhpunitErrorTriggered|PhpunitWarningTriggered|PhpWarningTriggered|WarningTriggered $reason, bool $single): string + { + if (!$reason instanceof DeprecationTriggered && + !$reason instanceof PhpDeprecationTriggered && + !$reason instanceof ErrorTriggered && + !$reason instanceof NoticeTriggered && + !$reason instanceof PhpNoticeTriggered && + !$reason instanceof WarningTriggered && + !$reason instanceof PhpWarningTriggered) { + return ''; + } + + return sprintf( + '%s%s:%d%s', + $single ? '' : ' ', + $reason->file(), + $reason->line(), + PHP_EOL, + ); } } diff --git a/vendor/phpunit/phpunit/src/TextUI/Output/Facade.php b/vendor/phpunit/phpunit/src/TextUI/Output/Facade.php index bc9ea205..0306e983 100644 --- a/vendor/phpunit/phpunit/src/TextUI/Output/Facade.php +++ b/vendor/phpunit/phpunit/src/TextUI/Output/Facade.php @@ -9,20 +9,28 @@ */ namespace PHPUnit\TextUI\Output; +use const PHP_EOL; use function assert; +use PHPUnit\Event\EventFacadeIsSealedException; +use PHPUnit\Event\Facade as EventFacade; +use PHPUnit\Event\UnknownSubscriberTypeException; use PHPUnit\Logging\TeamCity\TeamCityLogger; use PHPUnit\Logging\TestDox\TestResultCollection; +use PHPUnit\Runner\DirectoryDoesNotExistException; use PHPUnit\TestRunner\TestResult\TestResult; +use PHPUnit\TextUI\CannotOpenSocketException; use PHPUnit\TextUI\Configuration\Configuration; +use PHPUnit\TextUI\InvalidSocketException; use PHPUnit\TextUI\Output\Default\ProgressPrinter\ProgressPrinter as DefaultProgressPrinter; use PHPUnit\TextUI\Output\Default\ResultPrinter as DefaultResultPrinter; +use PHPUnit\TextUI\Output\Default\UnexpectedOutputPrinter; use PHPUnit\TextUI\Output\TestDox\ResultPrinter as TestDoxResultPrinter; -use PHPUnit\Util\DirectoryDoesNotExistException; -use PHPUnit\Util\InvalidSocketException; use SebastianBergmann\Timer\Duration; use SebastianBergmann\Timer\ResourceUsageFormatter; /** + * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit + * * @internal This class is not covered by the backward compatibility promise for PHPUnit */ final class Facade @@ -31,24 +39,39 @@ final class Facade private static ?DefaultResultPrinter $defaultResultPrinter = null; private static ?TestDoxResultPrinter $testDoxResultPrinter = null; private static ?SummaryPrinter $summaryPrinter = null; - private static bool $colors = false; private static bool $defaultProgressPrinter = false; - public static function init(Configuration $configuration): Printer + /** + * @throws EventFacadeIsSealedException + * @throws UnknownSubscriberTypeException + */ + public static function init(Configuration $configuration, bool $extensionReplacesProgressOutput, bool $extensionReplacesResultOutput): Printer { self::createPrinter($configuration); assert(self::$printer !== null); - self::createProgressPrinter($configuration); - self::createResultPrinter($configuration); - self::createSummaryPrinter($configuration); - - if ($configuration->outputIsTeamCity()) { - new TeamCityLogger(DefaultPrinter::standardOutput()); + if ($configuration->debug()) { + return self::$printer; } - self::$colors = $configuration->colors(); + self::createUnexpectedOutputPrinter(); + + if (!$extensionReplacesProgressOutput) { + self::createProgressPrinter($configuration); + } + + if (!$extensionReplacesResultOutput) { + self::createResultPrinter($configuration); + self::createSummaryPrinter($configuration); + } + + if ($configuration->outputIsTeamCity()) { + new TeamCityLogger( + DefaultPrinter::standardOutput(), + EventFacade::instance(), + ); + } return self::$printer; } @@ -82,6 +105,7 @@ final class Facade } /** + * @throws CannotOpenSocketException * @throws DirectoryDoesNotExistException * @throws InvalidSocketException */ @@ -102,6 +126,10 @@ final class Facade { $printerNeeded = false; + if ($configuration->debug()) { + $printerNeeded = true; + } + if ($configuration->outputIsTeamCity()) { $printerNeeded = true; } @@ -143,8 +171,10 @@ final class Facade new DefaultProgressPrinter( self::$printer, + EventFacade::instance(), $configuration->colors(), - $configuration->columns() + $configuration->columns(), + $configuration->source(), ); self::$defaultProgressPrinter = true; @@ -171,29 +201,29 @@ final class Facade { assert(self::$printer !== null); - if ($configuration->outputIsTeamCity() || $configuration->outputIsTestDox()) { + if ($configuration->outputIsTestDox()) { self::$defaultResultPrinter = new DefaultResultPrinter( self::$printer, true, true, + $configuration->displayDetailsOnPhpunitDeprecations() || $configuration->displayDetailsOnAllIssues(), false, false, + true, false, false, - false, - false, - false, - false, - false, - false, - false, + $configuration->displayDetailsOnTestsThatTriggerDeprecations() || $configuration->displayDetailsOnAllIssues(), + $configuration->displayDetailsOnTestsThatTriggerErrors() || $configuration->displayDetailsOnAllIssues(), + $configuration->displayDetailsOnTestsThatTriggerNotices() || $configuration->displayDetailsOnAllIssues(), + $configuration->displayDetailsOnTestsThatTriggerWarnings() || $configuration->displayDetailsOnAllIssues(), + $configuration->reverseDefectList(), ); } if ($configuration->outputIsTestDox()) { self::$testDoxResultPrinter = new TestDoxResultPrinter( self::$printer, - $configuration->colors() + $configuration->colors(), ); } @@ -209,17 +239,17 @@ final class Facade self::$printer, true, true, + $configuration->displayDetailsOnPhpunitDeprecations() || $configuration->displayDetailsOnAllIssues(), true, true, true, - true, - $configuration->displayDetailsOnIncompleteTests(), - $configuration->displayDetailsOnSkippedTests(), - $configuration->displayDetailsOnTestsThatTriggerDeprecations(), - $configuration->displayDetailsOnTestsThatTriggerErrors(), - $configuration->displayDetailsOnTestsThatTriggerNotices(), - $configuration->displayDetailsOnTestsThatTriggerWarnings(), - $configuration->reverseDefectList() + $configuration->displayDetailsOnIncompleteTests() || $configuration->displayDetailsOnAllIssues(), + $configuration->displayDetailsOnSkippedTests() || $configuration->displayDetailsOnAllIssues(), + $configuration->displayDetailsOnTestsThatTriggerDeprecations() || $configuration->displayDetailsOnAllIssues(), + $configuration->displayDetailsOnTestsThatTriggerErrors() || $configuration->displayDetailsOnAllIssues(), + $configuration->displayDetailsOnTestsThatTriggerNotices() || $configuration->displayDetailsOnAllIssues(), + $configuration->displayDetailsOnTestsThatTriggerWarnings() || $configuration->displayDetailsOnAllIssues(), + $configuration->reverseDefectList(), ); } @@ -237,4 +267,15 @@ final class Facade $configuration->colors(), ); } + + /** + * @throws EventFacadeIsSealedException + * @throws UnknownSubscriberTypeException + */ + private static function createUnexpectedOutputPrinter(): void + { + assert(self::$printer !== null); + + new UnexpectedOutputPrinter(self::$printer, EventFacade::instance()); + } } diff --git a/vendor/phpunit/phpunit/src/TextUI/Output/Printer/DefaultPrinter.php b/vendor/phpunit/phpunit/src/TextUI/Output/Printer/DefaultPrinter.php index 53b1d821..38f3b2b5 100644 --- a/vendor/phpunit/phpunit/src/TextUI/Output/Printer/DefaultPrinter.php +++ b/vendor/phpunit/phpunit/src/TextUI/Output/Printer/DefaultPrinter.php @@ -17,14 +17,16 @@ use function fclose; use function fopen; use function fsockopen; use function fwrite; -use function sprintf; use function str_replace; use function str_starts_with; -use PHPUnit\Util\DirectoryDoesNotExistException; +use PHPUnit\Runner\DirectoryDoesNotExistException; +use PHPUnit\TextUI\CannotOpenSocketException; +use PHPUnit\TextUI\InvalidSocketException; use PHPUnit\Util\Filesystem; -use PHPUnit\Util\InvalidSocketException; /** + * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit + * * @internal This class is not covered by the backward compatibility promise for PHPUnit */ final class DefaultPrinter implements Printer @@ -37,6 +39,7 @@ final class DefaultPrinter implements Printer private bool $isOpen; /** + * @throws CannotOpenSocketException * @throws DirectoryDoesNotExistException * @throws InvalidSocketException */ @@ -46,6 +49,7 @@ final class DefaultPrinter implements Printer } /** + * @throws CannotOpenSocketException * @throws DirectoryDoesNotExistException * @throws InvalidSocketException */ @@ -55,6 +59,7 @@ final class DefaultPrinter implements Printer } /** + * @throws CannotOpenSocketException * @throws DirectoryDoesNotExistException * @throws InvalidSocketException */ @@ -64,31 +69,33 @@ final class DefaultPrinter implements Printer } /** + * @throws CannotOpenSocketException * @throws DirectoryDoesNotExistException * @throws InvalidSocketException */ private function __construct(string $out) { + $this->isPhpStream = str_starts_with($out, 'php://'); + if (str_starts_with($out, 'socket://')) { $tmp = explode(':', str_replace('socket://', '', $out)); if (count($tmp) !== 2) { - throw new InvalidSocketException( - sprintf( - '"%s" does not match "socket://hostname:port" format', - $out - ) - ); + throw new InvalidSocketException($out); } - $this->stream = fsockopen($tmp[0], (int) $tmp[1]); + $stream = @fsockopen($tmp[0], (int) $tmp[1]); + + if ($stream === false) { + throw new CannotOpenSocketException($tmp[0], (int) $tmp[1]); + } + + $this->stream = $stream; $this->isOpen = true; return; } - $this->isPhpStream = str_starts_with($out, 'php://'); - if (!$this->isPhpStream && !Filesystem::createDirectory(dirname($out))) { throw new DirectoryDoesNotExistException(dirname($out)); } diff --git a/vendor/phpunit/phpunit/src/TextUI/Output/Printer/NullPrinter.php b/vendor/phpunit/phpunit/src/TextUI/Output/Printer/NullPrinter.php index e4a50101..cf27e6b3 100644 --- a/vendor/phpunit/phpunit/src/TextUI/Output/Printer/NullPrinter.php +++ b/vendor/phpunit/phpunit/src/TextUI/Output/Printer/NullPrinter.php @@ -10,6 +10,8 @@ namespace PHPUnit\TextUI\Output; /** + * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit + * * @internal This class is not covered by the backward compatibility promise for PHPUnit */ final class NullPrinter implements Printer diff --git a/vendor/phpunit/phpunit/src/TextUI/Output/Printer/Printer.php b/vendor/phpunit/phpunit/src/TextUI/Output/Printer/Printer.php index bc2e8bb5..c9b0fb97 100644 --- a/vendor/phpunit/phpunit/src/TextUI/Output/Printer/Printer.php +++ b/vendor/phpunit/phpunit/src/TextUI/Output/Printer/Printer.php @@ -10,6 +10,8 @@ namespace PHPUnit\TextUI\Output; /** + * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit + * * @internal This interface is not covered by the backward compatibility promise for PHPUnit */ interface Printer diff --git a/vendor/phpunit/phpunit/src/TextUI/Output/SummaryPrinter.php b/vendor/phpunit/phpunit/src/TextUI/Output/SummaryPrinter.php index 2d1b4de1..7ca6cdff 100644 --- a/vendor/phpunit/phpunit/src/TextUI/Output/SummaryPrinter.php +++ b/vendor/phpunit/phpunit/src/TextUI/Output/SummaryPrinter.php @@ -9,11 +9,14 @@ */ namespace PHPUnit\TextUI\Output; +use const PHP_EOL; use function sprintf; use PHPUnit\TestRunner\TestResult\TestResult; use PHPUnit\Util\Color; /** + * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit + * * @internal This class is not covered by the backward compatibility promise for PHPUnit */ final class SummaryPrinter @@ -33,13 +36,14 @@ final class SummaryPrinter if ($result->numberOfTestsRun() === 0) { $this->printWithColor( 'fg-black, bg-yellow', - 'No tests executed!' + 'No tests executed!', ); return; } - if ($result->wasSuccessfulAndNoTestHasIssues() && + if ($result->wasSuccessful() && + !$result->hasIssues() && !$result->hasTestSuiteSkippedEvents() && !$result->hasTestSkippedEvents()) { $this->printWithColor( @@ -49,71 +53,62 @@ final class SummaryPrinter $result->numberOfTestsRun(), $result->numberOfTestsRun() === 1 ? '' : 's', $result->numberOfAssertions(), - $result->numberOfAssertions() === 1 ? '' : 's' - ) + $result->numberOfAssertions() === 1 ? '' : 's', + ), ); + $this->printNumberOfIssuesIgnoredByBaseline($result); + return; } $color = 'fg-black, bg-yellow'; if ($result->wasSuccessful()) { - if (!$result->hasTestsWithIssues()) { + if ($result->hasIssues()) { $this->printWithColor( $color, - 'OK, but some tests were skipped!' + 'OK, but there were issues!', ); } else { $this->printWithColor( $color, - 'OK, but some tests have issues!' + 'OK, but some tests were skipped!', ); } } else { - if ($result->hasTestErroredEvents()) { + if ($result->hasTestErroredEvents() || $result->hasTestTriggeredPhpunitErrorEvents()) { $color = 'fg-white, bg-red'; $this->printWithColor( $color, - 'ERRORS!' + 'ERRORS!', ); } elseif ($result->hasTestFailedEvents()) { $color = 'fg-white, bg-red'; $this->printWithColor( $color, - 'FAILURES!' - ); - } elseif ($result->hasWarningEvents()) { - $this->printWithColor( - $color, - 'WARNINGS!' - ); - } elseif ($result->hasDeprecationEvents()) { - $this->printWithColor( - $color, - 'DEPRECATIONS!' - ); - } elseif ($result->hasNoticeEvents()) { - $this->printWithColor( - $color, - 'NOTICES!' + 'FAILURES!', ); } } $this->printCountString($result->numberOfTestsRun(), 'Tests', $color, true); $this->printCountString($result->numberOfAssertions(), 'Assertions', $color, true); - $this->printCountString($result->numberOfTestErroredEvents() + $result->numberOfTestsWithTestTriggeredErrorEvents(), 'Errors', $color); + $this->printCountString($result->numberOfErrors(), 'Errors', $color); $this->printCountString($result->numberOfTestFailedEvents(), 'Failures', $color); - $this->printCountString($result->numberOfWarningEvents(), 'Warnings', $color); - $this->printCountString($result->numberOfDeprecationEvents(), 'Deprecations', $color); - $this->printCountString($result->numberOfNoticeEvents(), 'Notices', $color); + $this->printCountString($result->numberOfPhpunitWarnings(), 'PHPUnit Warnings', $color); + $this->printCountString($result->numberOfWarnings(), 'Warnings', $color); + $this->printCountString($result->numberOfPhpOrUserDeprecations(), 'Deprecations', $color); + $this->printCountString($result->numberOfPhpunitDeprecations(), 'PHPUnit Deprecations', $color); + $this->printCountString($result->numberOfNotices(), 'Notices', $color); $this->printCountString($result->numberOfTestSuiteSkippedEvents() + $result->numberOfTestSkippedEvents(), 'Skipped', $color); $this->printCountString($result->numberOfTestMarkedIncompleteEvents(), 'Incomplete', $color); $this->printCountString($result->numberOfTestsWithTestConsideredRiskyEvents(), 'Risky', $color); $this->printWithColor($color, '.'); + + $this->printNumberOfIssuesIgnoredByBaseline($result); } private function printCountString(int $count, string $name, string $color, bool $always = false): void @@ -125,9 +120,9 @@ final class SummaryPrinter '%s%s: %d', $this->countPrinted ? ', ' : '', $name, - $count + $count, ), - false + false, ); $this->countPrinted = true; @@ -146,4 +141,20 @@ final class SummaryPrinter $this->printer->print(PHP_EOL); } } + + private function printNumberOfIssuesIgnoredByBaseline(TestResult $result): void + { + if ($result->hasIssuesIgnoredByBaseline()) { + $this->printer->print( + sprintf( + '%s%d issue%s %s ignored by baseline.%s', + PHP_EOL, + $result->numberOfIssuesIgnoredByBaseline(), + $result->numberOfIssuesIgnoredByBaseline() > 1 ? 's' : '', + $result->numberOfIssuesIgnoredByBaseline() > 1 ? 'were' : 'was', + PHP_EOL, + ), + ); + } + } } diff --git a/vendor/phpunit/phpunit/src/TextUI/Output/TestDox/ResultPrinter.php b/vendor/phpunit/phpunit/src/TextUI/Output/TestDox/ResultPrinter.php index 4ca8cf0e..e063b909 100644 --- a/vendor/phpunit/phpunit/src/TextUI/Output/TestDox/ResultPrinter.php +++ b/vendor/phpunit/phpunit/src/TextUI/Output/TestDox/ResultPrinter.php @@ -20,7 +20,6 @@ use function rtrim; use function str_starts_with; use function trim; use PHPUnit\Event\Code\Throwable; -use PHPUnit\Event\TestData\NoDataSetFromDataProviderException; use PHPUnit\Framework\TestStatus\TestStatus; use PHPUnit\Logging\TestDox\TestResult as TestDoxTestResult; use PHPUnit\Logging\TestDox\TestResultCollection; @@ -28,6 +27,8 @@ use PHPUnit\TextUI\Output\Printer; use PHPUnit\Util\Color; /** + * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit + * * @internal This class is not covered by the backward compatibility promise for PHPUnit */ final class ResultPrinter @@ -57,11 +58,6 @@ final class ResultPrinter } } - public function flush(): void - { - $this->printer->flush(); - } - /** * @psalm-param string $prettifiedClassName */ @@ -76,18 +72,12 @@ final class ResultPrinter $this->printer->print($buffer . PHP_EOL); } - /** - * @throws NoDataSetFromDataProviderException - */ private function printTestResult(TestDoxTestResult $test): void { $this->printTestResultHeader($test); $this->printTestResultBody($test); } - /** - * @throws NoDataSetFromDataProviderException - */ private function printTestResultHeader(TestDoxTestResult $test): void { $buffer = ' ' . $this->symbolFor($test->status()) . ' '; @@ -96,8 +86,8 @@ final class ResultPrinter $this->printer->print( Color::colorizeTextBox( $this->colorFor($test->status()), - $buffer - ) + $buffer, + ), ); } else { $this->printer->print($buffer); @@ -126,8 +116,8 @@ final class ResultPrinter $this->printer->print( $this->prefixLines( $this->prefixFor('start', $test->status()), - '' - ) + '', + ), ); $this->printer->print(PHP_EOL); @@ -140,8 +130,8 @@ final class ResultPrinter $this->printer->print( $this->prefixLines( $this->prefixFor('last', $test->status()), - '' - ) + '', + ), ); $this->printer->print(PHP_EOL); @@ -160,7 +150,7 @@ final class ResultPrinter if (!empty($message) && $this->colors) { ['message' => $message, 'diff' => $diff] = $this->colorizeMessageAndDiff( $message, - $this->messageColorFor($test->status()) + $this->messageColorFor($test->status()), ); } @@ -168,8 +158,8 @@ final class ResultPrinter $this->printer->print( $this->prefixLines( $this->prefixFor('message', $test->status()), - $message - ) + $message, + ), ); $this->printer->print(PHP_EOL); @@ -179,8 +169,8 @@ final class ResultPrinter $this->printer->print( $this->prefixLines( $this->prefixFor('diff', $test->status()), - $diff - ) + $diff, + ), ); $this->printer->print(PHP_EOL); @@ -194,7 +184,7 @@ final class ResultPrinter } $this->printer->print( - $this->prefixLines($prefix, PHP_EOL . $stackTrace) + $this->prefixLines($prefix, PHP_EOL . $stackTrace), ); } } @@ -272,8 +262,8 @@ final class ResultPrinter PHP_EOL, array_map( static fn (string $line) => ' ' . $prefix . ($line ? ' ' . $line : ''), - preg_split('/\r\n|\r|\n/', $message) - ) + preg_split('/\r\n|\r|\n/', $message), + ), ); } @@ -294,8 +284,8 @@ final class ResultPrinter 'message' => '├', 'diff' => '┊', 'trace' => '╵', - 'last' => '┴' - } + 'last' => '┴', + }, ); } @@ -317,7 +307,7 @@ final class ResultPrinter return 'fg-cyan'; } - if ($status->isRisky() || $status->isIncomplete() || $status->isWarning()) { + if ($status->isIncomplete() || $status->isDeprecation() || $status->isNotice() || $status->isRisky() || $status->isWarning()) { return 'fg-yellow'; } @@ -342,7 +332,7 @@ final class ResultPrinter return 'fg-cyan'; } - if ($status->isRisky() || $status->isIncomplete() || $status->isWarning()) { + if ($status->isIncomplete() || $status->isDeprecation() || $status->isNotice() || $status->isRisky() || $status->isWarning()) { return 'fg-yellow'; } @@ -363,18 +353,14 @@ final class ResultPrinter return '↩'; } - if ($status->isRisky()) { - return '☢'; + if ($status->isDeprecation() || $status->isNotice() || $status->isRisky() || $status->isWarning()) { + return '⚠'; } if ($status->isIncomplete()) { return '∅'; } - if ($status->isWarning()) { - return '⚠'; - } - return '?'; } } diff --git a/vendor/phpunit/phpunit/src/TextUI/ShellExitCodeCalculator.php b/vendor/phpunit/phpunit/src/TextUI/ShellExitCodeCalculator.php index 1a1b86e5..ea80d16b 100644 --- a/vendor/phpunit/phpunit/src/TextUI/ShellExitCodeCalculator.php +++ b/vendor/phpunit/phpunit/src/TextUI/ShellExitCodeCalculator.php @@ -10,49 +10,158 @@ namespace PHPUnit\TextUI; use PHPUnit\TestRunner\TestResult\TestResult; +use PHPUnit\TextUI\Configuration\Configuration; /** + * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit + * * @internal This class is not covered by the backward compatibility promise for PHPUnit */ final class ShellExitCodeCalculator { - private const SUCCESS_EXIT = 0; - - private const FAILURE_EXIT = 1; - + private const SUCCESS_EXIT = 0; + private const FAILURE_EXIT = 1; private const EXCEPTION_EXIT = 2; - public function calculate(bool $failOnEmptyTestSuite, bool $failOnRisky, bool $failOnWarning, bool $failOnIncomplete, bool $failOnSkipped, TestResult $result): int + public function calculate(Configuration $configuration, TestResult $result): int { + $failOnDeprecation = false; + $failOnPhpunitDeprecation = false; + $failOnPhpunitWarning = false; + $failOnEmptyTestSuite = false; + $failOnIncomplete = false; + $failOnNotice = false; + $failOnRisky = false; + $failOnSkipped = false; + $failOnWarning = false; + + if ($configuration->failOnAllIssues()) { + $failOnDeprecation = true; + $failOnPhpunitDeprecation = true; + $failOnPhpunitWarning = true; + $failOnEmptyTestSuite = true; + $failOnIncomplete = true; + $failOnNotice = true; + $failOnRisky = true; + $failOnSkipped = true; + $failOnWarning = true; + } + + if ($configuration->failOnDeprecation()) { + $failOnDeprecation = true; + } + + if ($configuration->doNotFailOnDeprecation()) { + $failOnDeprecation = false; + } + + if ($configuration->failOnPhpunitDeprecation()) { + $failOnPhpunitDeprecation = true; + } + + if ($configuration->doNotFailOnPhpunitDeprecation()) { + $failOnPhpunitDeprecation = false; + } + + if ($configuration->failOnPhpunitWarning()) { + $failOnPhpunitWarning = true; + } + + if ($configuration->doNotFailOnPhpunitWarning()) { + $failOnPhpunitWarning = false; + } + + if ($configuration->failOnEmptyTestSuite()) { + $failOnEmptyTestSuite = true; + } + + if ($configuration->doNotFailOnEmptyTestSuite()) { + $failOnEmptyTestSuite = false; + } + + if ($configuration->failOnIncomplete()) { + $failOnIncomplete = true; + } + + if ($configuration->doNotFailOnIncomplete()) { + $failOnIncomplete = false; + } + + if ($configuration->failOnNotice()) { + $failOnNotice = true; + } + + if ($configuration->doNotFailOnNotice()) { + $failOnNotice = false; + } + + if ($configuration->failOnRisky()) { + $failOnRisky = true; + } + + if ($configuration->doNotFailOnRisky()) { + $failOnRisky = false; + } + + if ($configuration->failOnSkipped()) { + $failOnSkipped = true; + } + + if ($configuration->doNotFailOnSkipped()) { + $failOnSkipped = false; + } + + if ($configuration->failOnWarning()) { + $failOnWarning = true; + } + + if ($configuration->doNotFailOnWarning()) { + $failOnWarning = false; + } + $returnCode = self::FAILURE_EXIT; if ($result->wasSuccessful()) { $returnCode = self::SUCCESS_EXIT; } - if ($failOnEmptyTestSuite && $result->numberOfTests() === 0) { + if ($failOnEmptyTestSuite && !$result->hasTests()) { $returnCode = self::FAILURE_EXIT; } - if ($result->wasSuccessfulIgnoringPhpunitWarnings()) { - if ($failOnRisky && $result->hasTestConsideredRiskyEvents()) { - $returnCode = self::FAILURE_EXIT; - } - - if ($failOnWarning && $result->hasWarningEvents()) { - $returnCode = self::FAILURE_EXIT; - } - - if ($failOnIncomplete && $result->hasTestMarkedIncompleteEvents()) { - $returnCode = self::FAILURE_EXIT; - } - - if ($failOnSkipped && $result->hasTestSkippedEvents()) { - $returnCode = self::FAILURE_EXIT; - } + if ($failOnDeprecation && $result->hasPhpOrUserDeprecations()) { + $returnCode = self::FAILURE_EXIT; } - if ($result->hasTestErroredEvents()) { + if ($failOnPhpunitDeprecation && $result->hasPhpunitDeprecations()) { + $returnCode = self::FAILURE_EXIT; + } + + if ($failOnPhpunitWarning && $result->hasPhpunitWarnings()) { + $returnCode = self::FAILURE_EXIT; + } + + if ($failOnIncomplete && $result->hasIncompleteTests()) { + $returnCode = self::FAILURE_EXIT; + } + + if ($failOnNotice && $result->hasNotices()) { + $returnCode = self::FAILURE_EXIT; + } + + if ($failOnRisky && $result->hasRiskyTests()) { + $returnCode = self::FAILURE_EXIT; + } + + if ($failOnSkipped && $result->hasSkippedTests()) { + $returnCode = self::FAILURE_EXIT; + } + + if ($failOnWarning && $result->hasWarnings()) { + $returnCode = self::FAILURE_EXIT; + } + + if ($result->hasErrors()) { $returnCode = self::EXCEPTION_EXIT; } diff --git a/vendor/phpunit/phpunit/src/TextUI/TestRunner.php b/vendor/phpunit/phpunit/src/TextUI/TestRunner.php index b567827c..2363ca29 100644 --- a/vendor/phpunit/phpunit/src/TextUI/TestRunner.php +++ b/vendor/phpunit/phpunit/src/TextUI/TestRunner.php @@ -12,13 +12,14 @@ namespace PHPUnit\TextUI; use function mt_srand; use PHPUnit\Event; use PHPUnit\Framework\TestSuite; -use PHPUnit\Runner\Filter\Factory; use PHPUnit\Runner\ResultCache\ResultCache; use PHPUnit\Runner\TestSuiteSorter; use PHPUnit\TextUI\Configuration\Configuration; use Throwable; /** + * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit + * * @internal This class is not covered by the backward compatibility promise for PHPUnit */ final class TestRunner @@ -44,20 +45,20 @@ final class TestRunner $suite, $configuration->executionOrder(), $configuration->resolveDependencies(), - $configuration->executionOrderDefects() + $configuration->executionOrderDefects(), ); Event\Facade::emitter()->testSuiteSorted( $configuration->executionOrder(), $configuration->executionOrderDefects(), - $configuration->resolveDependencies() + $configuration->resolveDependencies(), ); } - (new TestSuiteFilterProcessor(new Factory))->process($configuration, $suite); + (new TestSuiteFilterProcessor)->process($configuration, $suite); Event\Facade::emitter()->testRunnerExecutionStarted( - Event\TestSuite\TestSuiteBuilder::from($suite) + Event\TestSuite\TestSuiteBuilder::from($suite), ); $suite->run(); @@ -68,7 +69,7 @@ final class TestRunner throw new RuntimeException( $t->getMessage(), (int) $t->getCode(), - $t + $t, ); } } diff --git a/vendor/phpunit/phpunit/src/TextUI/TestSuiteFilterProcessor.php b/vendor/phpunit/phpunit/src/TextUI/TestSuiteFilterProcessor.php index e7a43ad9..63ba1b38 100644 --- a/vendor/phpunit/phpunit/src/TextUI/TestSuiteFilterProcessor.php +++ b/vendor/phpunit/phpunit/src/TextUI/TestSuiteFilterProcessor.php @@ -17,23 +17,20 @@ use PHPUnit\TextUI\Configuration\Configuration; use PHPUnit\TextUI\Configuration\FilterNotConfiguredException; /** + * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit + * * @internal This class is not covered by the backward compatibility promise for PHPUnit */ final class TestSuiteFilterProcessor { - private Factory $filterFactory; - - public function __construct(Factory $factory = new Factory) - { - $this->filterFactory = $factory; - } - /** * @throws Event\RuntimeException * @throws FilterNotConfiguredException */ public function process(Configuration $configuration, TestSuite $suite): void { + $factory = new Factory; + if (!$configuration->hasFilter() && !$configuration->hasGroups() && !$configuration->hasExcludeGroups() && @@ -43,45 +40,45 @@ final class TestSuiteFilterProcessor } if ($configuration->hasExcludeGroups()) { - $this->filterFactory->addExcludeGroupFilter( - $configuration->excludeGroups() + $factory->addExcludeGroupFilter( + $configuration->excludeGroups(), ); } if ($configuration->hasGroups()) { - $this->filterFactory->addIncludeGroupFilter( - $configuration->groups() + $factory->addIncludeGroupFilter( + $configuration->groups(), ); } if ($configuration->hasTestsCovering()) { - $this->filterFactory->addIncludeGroupFilter( + $factory->addIncludeGroupFilter( array_map( static fn (string $name): string => '__phpunit_covers_' . $name, - $configuration->testsCovering() - ) + $configuration->testsCovering(), + ), ); } if ($configuration->hasTestsUsing()) { - $this->filterFactory->addIncludeGroupFilter( + $factory->addIncludeGroupFilter( array_map( static fn (string $name): string => '__phpunit_uses_' . $name, - $configuration->testsUsing() - ) + $configuration->testsUsing(), + ), ); } if ($configuration->hasFilter()) { - $this->filterFactory->addNameFilter( - $configuration->filter() + $factory->addNameFilter( + $configuration->filter(), ); } - $suite->injectFilter($this->filterFactory); + $suite->injectFilter($factory); Event\Facade::emitter()->testSuiteFiltered( - Event\TestSuite\TestSuiteBuilder::from($suite) + Event\TestSuite\TestSuiteBuilder::from($suite), ); } } diff --git a/vendor/phpunit/phpunit/src/Util/Cloner.php b/vendor/phpunit/phpunit/src/Util/Cloner.php index 0102b51b..7e3e5aa0 100644 --- a/vendor/phpunit/phpunit/src/Util/Cloner.php +++ b/vendor/phpunit/phpunit/src/Util/Cloner.php @@ -12,12 +12,14 @@ namespace PHPUnit\Util; use Throwable; /** + * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit + * * @internal This class is not covered by the backward compatibility promise for PHPUnit */ final class Cloner { /** - * @psalm-template OriginalType + * @psalm-template OriginalType of object * * @psalm-param OriginalType $original * diff --git a/vendor/phpunit/phpunit/src/Util/Color.php b/vendor/phpunit/phpunit/src/Util/Color.php index 914fb4fa..0e3642ca 100644 --- a/vendor/phpunit/phpunit/src/Util/Color.php +++ b/vendor/phpunit/phpunit/src/Util/Color.php @@ -26,6 +26,8 @@ use function strtr; use function trim; /** + * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit + * * @internal This class is not covered by the backward compatibility promise for PHPUnit */ final class Color @@ -133,7 +135,7 @@ final class Color $path[$last] = preg_replace_callback( '/([\-_.]+|phpt$)/', static fn ($matches) => self::dim($matches[0]), - $path[$last] + $path[$last], ); } @@ -156,7 +158,7 @@ final class Color return preg_replace_callback( '/\s+/', static fn ($matches) => self::dim(strtr($matches[0], $replaceMap)), - $buffer + $buffer, ); } @@ -173,7 +175,7 @@ final class Color "\e[$1;$2m", '$2', ], - $buffer + $buffer, ); } } diff --git a/vendor/phpunit/phpunit/src/Util/ErrorHandler.php b/vendor/phpunit/phpunit/src/Util/ErrorHandler.php deleted file mode 100644 index fd442930..00000000 --- a/vendor/phpunit/phpunit/src/Util/ErrorHandler.php +++ /dev/null @@ -1,182 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace PHPUnit\Util; - -use const E_DEPRECATED; -use const E_NOTICE; -use const E_STRICT; -use const E_USER_DEPRECATED; -use const E_USER_NOTICE; -use const E_USER_WARNING; -use const E_WARNING; -use function debug_backtrace; -use function error_reporting; -use function in_array; -use function restore_error_handler; -use function set_error_handler; -use PHPUnit\Event; -use PHPUnit\Framework\TestCase; - -/** - * @internal This class is not covered by the backward compatibility promise for PHPUnit - */ -final class ErrorHandler -{ - private static ?self $instance = null; - private bool $enabled = false; - - public static function instance(): self - { - return self::$instance ?? self::$instance = new self; - } - - /** - * @throws Exception - */ - public function __invoke(int $errorNumber, string $errorString, string $errorFile, int $errorLine): bool - { - $suppressed = !($errorNumber & error_reporting()); - - if ($suppressed && - in_array($errorNumber, [E_DEPRECATED, E_NOTICE, E_STRICT, E_WARNING], true)) { - return false; - } - - switch ($errorNumber) { - case E_NOTICE: - case E_STRICT: - Event\Facade::emitter()->testTriggeredPhpNotice( - $this->testValueObjectForEvents(), - $errorString, - $errorFile, - $errorLine - ); - - return true; - - case E_USER_NOTICE: - Event\Facade::emitter()->testTriggeredNotice( - $this->testValueObjectForEvents(), - $errorString, - $errorFile, - $errorLine - ); - - break; - - case E_WARNING: - Event\Facade::emitter()->testTriggeredPhpWarning( - $this->testValueObjectForEvents(), - $errorString, - $errorFile, - $errorLine - ); - - break; - - case E_USER_WARNING: - Event\Facade::emitter()->testTriggeredWarning( - $this->testValueObjectForEvents(), - $errorString, - $errorFile, - $errorLine - ); - - break; - - case E_DEPRECATED: - Event\Facade::emitter()->testTriggeredPhpDeprecation( - $this->testValueObjectForEvents(), - $errorString, - $errorFile, - $errorLine - ); - - break; - - case E_USER_DEPRECATED: - Event\Facade::emitter()->testTriggeredDeprecation( - $this->testValueObjectForEvents(), - $errorString, - $errorFile, - $errorLine - ); - - break; - - case E_USER_ERROR: - Event\Facade::emitter()->testTriggeredError( - $this->testValueObjectForEvents(), - $errorString, - $errorFile, - $errorLine - ); - - break; - - default: - // @codeCoverageIgnoreStart - return false; - // @codeCoverageIgnoreEnd - } - - return true; - } - - public function enable(): void - { - if ($this->enabled) { - // @codeCoverageIgnoreStart - return; - // @codeCoverageIgnoreEnd - } - - $oldErrorHandler = set_error_handler($this); - - if ($oldErrorHandler !== null) { - // @codeCoverageIgnoreStart - restore_error_handler(); - - return; - // @codeCoverageIgnoreEnd - } - - $this->enabled = true; - } - - public function disable(): void - { - if (!$this->enabled) { - // @codeCoverageIgnoreStart - return; - // @codeCoverageIgnoreEnd - } - - restore_error_handler(); - - $this->enabled = false; - } - - /** - * @throws NoTestCaseObjectOnCallStackException - */ - private function testValueObjectForEvents(): Event\Code\Test - { - foreach (debug_backtrace() as $frame) { - if (isset($frame['object']) && $frame['object'] instanceof TestCase) { - return $frame['object']->valueObjectForEvents(); - } - } - - // @codeCoverageIgnoreStart - throw new NoTestCaseObjectOnCallStackException; - // @codeCoverageIgnoreEnd - } -} diff --git a/vendor/phpunit/phpunit/src/Util/Exception/DirectoryDoesNotExistException.php b/vendor/phpunit/phpunit/src/Util/Exception/DirectoryDoesNotExistException.php deleted file mode 100644 index 23bd756c..00000000 --- a/vendor/phpunit/phpunit/src/Util/Exception/DirectoryDoesNotExistException.php +++ /dev/null @@ -1,29 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace PHPUnit\Util; - -use function sprintf; -use RuntimeException; - -/** - * @internal This class is not covered by the backward compatibility promise for PHPUnit - */ -final class DirectoryDoesNotExistException extends RuntimeException implements Exception -{ - public function __construct(string $directory) - { - parent::__construct( - sprintf( - 'Directory "%s" does not exist and could not be created', - $directory - ) - ); - } -} diff --git a/vendor/phpunit/phpunit/src/Util/Exception/Exception.php b/vendor/phpunit/phpunit/src/Util/Exception/Exception.php index a66f00b0..58f42db7 100644 --- a/vendor/phpunit/phpunit/src/Util/Exception/Exception.php +++ b/vendor/phpunit/phpunit/src/Util/Exception/Exception.php @@ -12,6 +12,8 @@ namespace PHPUnit\Util; use Throwable; /** + * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit + * * @internal This interface is not covered by the backward compatibility promise for PHPUnit */ interface Exception extends Throwable diff --git a/vendor/phpunit/phpunit/src/Util/Exception/InvalidDirectoryException.php b/vendor/phpunit/phpunit/src/Util/Exception/InvalidDirectoryException.php index e68f007d..623af2de 100644 --- a/vendor/phpunit/phpunit/src/Util/Exception/InvalidDirectoryException.php +++ b/vendor/phpunit/phpunit/src/Util/Exception/InvalidDirectoryException.php @@ -13,6 +13,8 @@ use function sprintf; use RuntimeException; /** + * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit + * * @internal This class is not covered by the backward compatibility promise for PHPUnit */ final class InvalidDirectoryException extends RuntimeException implements Exception @@ -22,8 +24,8 @@ final class InvalidDirectoryException extends RuntimeException implements Except parent::__construct( sprintf( '"%s" is not a directory', - $directory - ) + $directory, + ), ); } } diff --git a/vendor/phpunit/phpunit/src/Util/Exception/InvalidJsonException.php b/vendor/phpunit/phpunit/src/Util/Exception/InvalidJsonException.php index 3d30ce4b..224f7115 100644 --- a/vendor/phpunit/phpunit/src/Util/Exception/InvalidJsonException.php +++ b/vendor/phpunit/phpunit/src/Util/Exception/InvalidJsonException.php @@ -12,6 +12,8 @@ namespace PHPUnit\Util; use RuntimeException; /** + * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit + * * @internal This class is not covered by the backward compatibility promise for PHPUnit */ final class InvalidJsonException extends RuntimeException implements Exception diff --git a/vendor/phpunit/phpunit/src/Util/Exception/InvalidSocketException.php b/vendor/phpunit/phpunit/src/Util/Exception/InvalidSocketException.php deleted file mode 100644 index da4498fa..00000000 --- a/vendor/phpunit/phpunit/src/Util/Exception/InvalidSocketException.php +++ /dev/null @@ -1,29 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace PHPUnit\Util; - -use function sprintf; -use RuntimeException; - -/** - * @internal This class is not covered by the backward compatibility promise for PHPUnit - */ -final class InvalidSocketException extends RuntimeException implements Exception -{ - public function __construct(string $socket) - { - parent::__construct( - sprintf( - '"%s" does not match "socket://hostname:port" format', - $socket - ) - ); - } -} diff --git a/vendor/phpunit/phpunit/src/Util/Exception/InvalidVersionOperatorException.php b/vendor/phpunit/phpunit/src/Util/Exception/InvalidVersionOperatorException.php index 52dddb44..bc2fe9a0 100644 --- a/vendor/phpunit/phpunit/src/Util/Exception/InvalidVersionOperatorException.php +++ b/vendor/phpunit/phpunit/src/Util/Exception/InvalidVersionOperatorException.php @@ -13,6 +13,8 @@ use function sprintf; use RuntimeException; /** + * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit + * * @internal This class is not covered by the backward compatibility promise for PHPUnit */ final class InvalidVersionOperatorException extends RuntimeException implements Exception @@ -22,8 +24,8 @@ final class InvalidVersionOperatorException extends RuntimeException implements parent::__construct( sprintf( '"%s" is not a valid version_compare() operator', - $operator - ) + $operator, + ), ); } } diff --git a/vendor/phpunit/phpunit/src/Util/Exception/NoTestCaseObjectOnCallStackException.php b/vendor/phpunit/phpunit/src/Util/Exception/NoTestCaseObjectOnCallStackException.php deleted file mode 100644 index eae142fa..00000000 --- a/vendor/phpunit/phpunit/src/Util/Exception/NoTestCaseObjectOnCallStackException.php +++ /dev/null @@ -1,23 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace PHPUnit\Util; - -use RuntimeException; - -/** - * @internal This class is not covered by the backward compatibility promise for PHPUnit - */ -final class NoTestCaseObjectOnCallStackException extends RuntimeException implements Exception -{ - public function __construct() - { - parent::__construct('Cannot find TestCase object on call stack'); - } -} diff --git a/vendor/phpunit/phpunit/src/Util/Exception/PhpProcessException.php b/vendor/phpunit/phpunit/src/Util/Exception/PhpProcessException.php index 0a6b6ee7..05069ef0 100644 --- a/vendor/phpunit/phpunit/src/Util/Exception/PhpProcessException.php +++ b/vendor/phpunit/phpunit/src/Util/Exception/PhpProcessException.php @@ -13,6 +13,8 @@ use PHPUnit\Util\Exception; use RuntimeException; /** + * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit + * * @internal This class is not covered by the backward compatibility promise for PHPUnit */ final class PhpProcessException extends RuntimeException implements Exception diff --git a/vendor/phpunit/phpunit/src/Util/Exception/XmlException.php b/vendor/phpunit/phpunit/src/Util/Exception/XmlException.php index f2dc45d3..127e1eca 100644 --- a/vendor/phpunit/phpunit/src/Util/Exception/XmlException.php +++ b/vendor/phpunit/phpunit/src/Util/Exception/XmlException.php @@ -13,6 +13,8 @@ use PHPUnit\Util\Exception; use RuntimeException; /** + * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit + * * @internal This class is not covered by the backward compatibility promise for PHPUnit */ final class XmlException extends RuntimeException implements Exception diff --git a/vendor/phpunit/phpunit/src/Util/ExcludeList.php b/vendor/phpunit/phpunit/src/Util/ExcludeList.php index 25e99e60..88e80ba4 100644 --- a/vendor/phpunit/phpunit/src/Util/ExcludeList.php +++ b/vendor/phpunit/phpunit/src/Util/ExcludeList.php @@ -9,7 +9,7 @@ */ namespace PHPUnit\Util; -use const DIRECTORY_SEPARATOR; +use const PHP_OS_FAMILY; use function class_exists; use function defined; use function dirname; @@ -38,6 +38,7 @@ use SebastianBergmann\GlobalState\Snapshot; use SebastianBergmann\Invoker\Invoker; use SebastianBergmann\LinesOfCode\Counter; use SebastianBergmann\ObjectEnumerator\Enumerator; +use SebastianBergmann\ObjectReflector\ObjectReflector; use SebastianBergmann\RecursionContext\Context; use SebastianBergmann\Template\Template; use SebastianBergmann\Timer\Timer; @@ -120,6 +121,9 @@ final class ExcludeList // sebastian/object-enumerator Enumerator::class => 1, + // sebastian/object-reflector + ObjectReflector::class => 1, + // sebastian/recursion-context Context::class => 1, @@ -138,6 +142,7 @@ final class ExcludeList */ private static array $directories = []; private static bool $initialized = false; + private readonly bool $enabled; /** * @psalm-param non-empty-string $directory @@ -153,6 +158,15 @@ final class ExcludeList self::$directories[] = realpath($directory); } + public function __construct(?bool $enabled = null) + { + if ($enabled === null) { + $enabled = !defined('PHPUNIT_TESTSUITE'); + } + + $this->enabled = $enabled; + } + /** * @psalm-return list */ @@ -165,7 +179,7 @@ final class ExcludeList public function isExcluded(string $file): bool { - if (defined('PHPUNIT_TESTSUITE')) { + if (!$this->enabled) { return false; } @@ -200,11 +214,16 @@ final class ExcludeList self::$directories[] = $directory; } - // Hide process isolation workaround on Windows. - if (DIRECTORY_SEPARATOR === '\\') { - // tempnam() prefix is limited to first 3 chars. - // @see https://php.net/manual/en/function.tempnam.php + /** + * Hide process isolation workaround on Windows: + * tempnam() prefix is limited to first 3 characters. + * + * @see https://php.net/manual/en/function.tempnam.php + */ + if (PHP_OS_FAMILY === 'Windows') { + // @codeCoverageIgnoreStart self::$directories[] = sys_get_temp_dir() . '\\PHP'; + // @codeCoverageIgnoreEnd } self::$initialized = true; diff --git a/vendor/phpunit/phpunit/src/Util/Filesystem.php b/vendor/phpunit/phpunit/src/Util/Filesystem.php index 173338e7..948ee285 100644 --- a/vendor/phpunit/phpunit/src/Util/Filesystem.php +++ b/vendor/phpunit/phpunit/src/Util/Filesystem.php @@ -9,16 +9,43 @@ */ namespace PHPUnit\Util; +use const DIRECTORY_SEPARATOR; +use function basename; +use function dirname; use function is_dir; use function mkdir; +use function realpath; +use function str_starts_with; /** + * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit + * * @internal This class is not covered by the backward compatibility promise for PHPUnit */ final class Filesystem { public static function createDirectory(string $directory): bool { - return !(!is_dir($directory) && !@mkdir($directory, 0777, true) && !is_dir($directory)); + return !(!is_dir($directory) && !@mkdir($directory, 0o777, true) && !is_dir($directory)); + } + + /** + * @psalm-param non-empty-string $path + * + * @return false|non-empty-string + */ + public static function resolveStreamOrFile(string $path): false|string + { + if (str_starts_with($path, 'php://') || str_starts_with($path, 'socket://')) { + return $path; + } + + $directory = dirname($path); + + if (is_dir($directory)) { + return realpath($directory) . DIRECTORY_SEPARATOR . basename($path); + } + + return false; } } diff --git a/vendor/phpunit/phpunit/src/Util/Filter.php b/vendor/phpunit/phpunit/src/Util/Filter.php index 3514c585..424e35af 100644 --- a/vendor/phpunit/phpunit/src/Util/Filter.php +++ b/vendor/phpunit/phpunit/src/Util/Filter.php @@ -21,6 +21,8 @@ use PHPUnit\Framework\PhptAssertionFailedError; use Throwable; /** + * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit + * * @internal This class is not covered by the backward compatibility promise for PHPUnit */ final class Filter @@ -28,7 +30,7 @@ final class Filter /** * @throws Exception */ - public static function getFilteredStacktrace(Throwable $t): string + public static function getFilteredStacktrace(Throwable $t, bool $unwrap = true): string { $filteredStacktrace = ''; @@ -41,7 +43,7 @@ final class Filter $eFile = $t->getFile(); $eLine = $t->getLine(); } else { - if ($t->getPrevious()) { + if ($unwrap && $t->getPrevious()) { $t = $t->getPrevious(); } @@ -53,7 +55,7 @@ final class Filter if (!self::frameExists($eTrace, $eFile, $eLine)) { array_unshift( $eTrace, - ['file' => $eFile, 'line' => $eLine] + ['file' => $eFile, 'line' => $eLine], ); } @@ -65,7 +67,7 @@ final class Filter $filteredStacktrace .= sprintf( "%s:%s\n", $frame['file'], - $frame['line'] ?? '?' + $frame['line'] ?? '?', ); } } @@ -73,7 +75,7 @@ final class Filter return $filteredStacktrace; } - private static function shouldPrintFrame(array $frame, string|false $prefix, ExcludeList $excludeList): bool + private static function shouldPrintFrame(array $frame, false|string $prefix, ExcludeList $excludeList): bool { if (!isset($frame['file'])) { return false; @@ -89,10 +91,10 @@ final class Filter $script = ''; } - return is_file($file) && + return $fileIsNotPrefixed && + $file !== $script && self::fileIsExcluded($file, $excludeList) && - $fileIsNotPrefixed && - $file !== $script; + is_file($file); } private static function fileIsExcluded(string $file, ExcludeList $excludeList): bool diff --git a/vendor/phpunit/phpunit/src/Util/GlobalState.php b/vendor/phpunit/phpunit/src/Util/GlobalState.php index d8e6d81b..99184097 100644 --- a/vendor/phpunit/phpunit/src/Util/GlobalState.php +++ b/vendor/phpunit/phpunit/src/Util/GlobalState.php @@ -9,6 +9,8 @@ */ namespace PHPUnit\Util; +use const PHP_MAJOR_VERSION; +use const PHP_MINOR_VERSION; use function array_keys; use function array_reverse; use function array_shift; @@ -30,6 +32,8 @@ use function var_export; use Closure; /** + * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit + * * @internal This class is not covered by the backward compatibility promise for PHPUnit */ final class GlobalState @@ -47,6 +51,115 @@ final class GlobalState '_REQUEST', ]; + /** + * @psalm-var array> + */ + private const DEPRECATED_INI_SETTINGS = [ + '7.3' => [ + 'iconv.input_encoding' => true, + 'iconv.output_encoding' => true, + 'iconv.internal_encoding' => true, + 'mbstring.func_overload' => true, + 'mbstring.http_input' => true, + 'mbstring.http_output' => true, + 'mbstring.internal_encoding' => true, + 'string.strip_tags' => true, + ], + + '7.4' => [ + 'iconv.input_encoding' => true, + 'iconv.output_encoding' => true, + 'iconv.internal_encoding' => true, + 'mbstring.func_overload' => true, + 'mbstring.http_input' => true, + 'mbstring.http_output' => true, + 'mbstring.internal_encoding' => true, + 'pdo_odbc.db2_instance_name' => true, + 'string.strip_tags' => true, + ], + + '8.0' => [ + 'iconv.input_encoding' => true, + 'iconv.output_encoding' => true, + 'iconv.internal_encoding' => true, + 'mbstring.http_input' => true, + 'mbstring.http_output' => true, + 'mbstring.internal_encoding' => true, + ], + + '8.1' => [ + 'auto_detect_line_endings' => true, + 'filter.default' => true, + 'iconv.input_encoding' => true, + 'iconv.output_encoding' => true, + 'iconv.internal_encoding' => true, + 'mbstring.http_input' => true, + 'mbstring.http_output' => true, + 'mbstring.internal_encoding' => true, + 'oci8.old_oci_close_semantics' => true, + ], + + '8.2' => [ + 'auto_detect_line_endings' => true, + 'filter.default' => true, + 'iconv.input_encoding' => true, + 'iconv.output_encoding' => true, + 'iconv.internal_encoding' => true, + 'mbstring.http_input' => true, + 'mbstring.http_output' => true, + 'mbstring.internal_encoding' => true, + 'oci8.old_oci_close_semantics' => true, + ], + + '8.3' => [ + 'auto_detect_line_endings' => true, + 'filter.default' => true, + 'iconv.input_encoding' => true, + 'iconv.output_encoding' => true, + 'iconv.internal_encoding' => true, + 'mbstring.http_input' => true, + 'mbstring.http_output' => true, + 'mbstring.internal_encoding' => true, + 'oci8.old_oci_close_semantics' => true, + ], + + '8.4' => [ + 'auto_detect_line_endings' => true, + 'filter.default' => true, + 'iconv.input_encoding' => true, + 'iconv.output_encoding' => true, + 'iconv.internal_encoding' => true, + 'mbstring.http_input' => true, + 'mbstring.http_output' => true, + 'mbstring.internal_encoding' => true, + 'oci8.old_oci_close_semantics' => true, + ], + + '8.5' => [ + 'auto_detect_line_endings' => true, + 'filter.default' => true, + 'iconv.input_encoding' => true, + 'iconv.output_encoding' => true, + 'iconv.internal_encoding' => true, + 'mbstring.http_input' => true, + 'mbstring.http_output' => true, + 'mbstring.internal_encoding' => true, + 'oci8.old_oci_close_semantics' => true, + ], + + '8.6' => [ + 'auto_detect_line_endings' => true, + 'filter.default' => true, + 'iconv.input_encoding' => true, + 'iconv.output_encoding' => true, + 'iconv.internal_encoding' => true, + 'mbstring.http_input' => true, + 'mbstring.http_output' => true, + 'mbstring.internal_encoding' => true, + 'oci8.old_oci_close_semantics' => true, + ], + ]; + /** * @throws Exception */ @@ -106,10 +219,14 @@ final class GlobalState $result = ''; foreach (ini_get_all(null, false) as $key => $value) { + if (self::isIniSettingDeprecated($key)) { + continue; + } + $result .= sprintf( '@ini_set(%s, %s);' . "\n", self::exportVariable($key), - self::exportVariable((string) $value) + self::exportVariable((string) $value), ); } @@ -127,7 +244,7 @@ final class GlobalState 'if (!defined(\'%s\')) define(\'%s\', %s);' . "\n", $name, $name, - self::exportVariable($value) + self::exportVariable($value), ); } } @@ -150,7 +267,7 @@ final class GlobalState '$GLOBALS[\'%s\'][\'%s\'] = %s;' . "\n", $superGlobalArray, $key, - self::exportVariable($GLOBALS[$superGlobalArray][$key]) + self::exportVariable($GLOBALS[$superGlobalArray][$key]), ); } } @@ -164,7 +281,7 @@ final class GlobalState $result .= sprintf( '$GLOBALS[\'%s\'] = %s;' . "\n", $key, - self::exportVariable($GLOBALS[$key]) + self::exportVariable($GLOBALS[$key]), ); } } @@ -200,4 +317,9 @@ final class GlobalState return $result; } + + private static function isIniSettingDeprecated(string $iniSetting): bool + { + return isset(self::DEPRECATED_INI_SETTINGS[PHP_MAJOR_VERSION . '.' . PHP_MINOR_VERSION][$iniSetting]); + } } diff --git a/vendor/phpunit/phpunit/src/Util/Json.php b/vendor/phpunit/phpunit/src/Util/Json.php index cd52c7cd..a9b5e2dc 100644 --- a/vendor/phpunit/phpunit/src/Util/Json.php +++ b/vendor/phpunit/phpunit/src/Util/Json.php @@ -12,15 +12,17 @@ namespace PHPUnit\Util; use const JSON_PRETTY_PRINT; use const JSON_UNESCAPED_SLASHES; use const JSON_UNESCAPED_UNICODE; -use function count; -use function is_array; +use const SORT_STRING; use function is_object; +use function is_scalar; use function json_decode; use function json_encode; use function json_last_error; use function ksort; /** + * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit + * * @internal This class is not covered by the backward compatibility promise for PHPUnit */ final class Json @@ -70,24 +72,31 @@ final class Json */ private static function recursiveSort(mixed &$json): void { - if (!is_array($json)) { - // If the object is not empty, change it to an associative array - // so we can sort the keys (and we will still re-encode it - // correctly, since PHP encodes associative arrays as JSON objects.) - // But EMPTY objects MUST remain empty objects. (Otherwise we will - // re-encode it as a JSON array rather than a JSON object.) - // See #2919. - if (is_object($json) && count((array) $json) > 0) { - $json = (array) $json; - } else { - return; - } + // Nulls, empty arrays, and scalars need no further handling. + if (!$json || is_scalar($json)) { + return; } - ksort($json); + $isObject = is_object($json); + + if ($isObject) { + // Objects need to be sorted during canonicalization to ensure + // correct comparsion since JSON objects are unordered. It must be + // kept as an object so that the value correctly stays as a JSON + // object instead of potentially being converted to an array. This + // approach ensures that numeric string JSON keys are preserved and + // don't risk being flattened due to PHP's array semantics. + // See #2919, #4584, #4674 + $json = (array) $json; + ksort($json, SORT_STRING); + } foreach ($json as &$value) { self::recursiveSort($value); } + + if ($isObject) { + $json = (object) $json; + } } } diff --git a/vendor/phpunit/phpunit/src/Util/PHP/AbstractPhpProcess.php b/vendor/phpunit/phpunit/src/Util/PHP/AbstractPhpProcess.php index 12311ffa..7e20155b 100644 --- a/vendor/phpunit/phpunit/src/Util/PHP/AbstractPhpProcess.php +++ b/vendor/phpunit/phpunit/src/Util/PHP/AbstractPhpProcess.php @@ -9,19 +9,19 @@ */ namespace PHPUnit\Util\PHP; -use const DIRECTORY_SEPARATOR; +use const PHP_BINARY; use const PHP_SAPI; use function array_keys; use function array_merge; use function assert; -use function escapeshellarg; +use function explode; +use function file_get_contents; use function ini_get_all; +use function is_file; use function restore_error_handler; use function set_error_handler; -use function str_replace; -use function str_starts_with; -use function substr; use function trim; +use function unlink; use function unserialize; use ErrorException; use PHPUnit\Event\Code\TestMethodBuilder; @@ -38,11 +38,12 @@ use PHPUnit\TestRunner\TestResult\PassedTests; use SebastianBergmann\Environment\Runtime; /** + * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit + * * @internal This class is not covered by the backward compatibility promise for PHPUnit */ abstract class AbstractPhpProcess { - protected Runtime $runtime; protected bool $stderrRedirection = false; protected string $stdin = ''; protected string $arguments = ''; @@ -50,23 +51,13 @@ abstract class AbstractPhpProcess /** * @psalm-var array */ - protected array $env = []; - protected int $timeout = 0; + protected array $env = []; public static function factory(): self { - if (DIRECTORY_SEPARATOR === '\\') { - return new WindowsPhpProcess; - } - return new DefaultPhpProcess; } - public function __construct() - { - $this->runtime = new Runtime; - } - /** * Defines if should use STDERR redirection or not. * @@ -135,22 +126,6 @@ abstract class AbstractPhpProcess return $this->env; } - /** - * Sets the amount of seconds to wait before timing out. - */ - public function setTimeout(int $timeout): void - { - $this->timeout = $timeout; - } - - /** - * Returns the amount of seconds to wait before timing out. - */ - public function getTimeout(): int - { - return $this->timeout; - } - /** * Runs a single test in a separate PHP process. * @@ -159,63 +134,76 @@ abstract class AbstractPhpProcess * @throws MoreThanOneDataSetFromDataProviderException * @throws NoPreviousThrowableException */ - public function runTestJob(string $job, Test $test): void + public function runTestJob(string $job, Test $test, string $processResultFile): void { $_result = $this->runJob($job); + $processResult = ''; + + if (is_file($processResultFile)) { + $processResult = file_get_contents($processResultFile); + + @unlink($processResultFile); + } + $this->processChildResult( $test, - $_result['stdout'], - $_result['stderr'] + $processResult, + $_result['stderr'], ); } /** * Returns the command based into the configurations. + * + * @return string[] */ - public function getCommand(array $settings, string $file = null): string + public function getCommand(array $settings, ?string $file = null): array { - $command = $this->runtime->getBinary(); + $runtime = new Runtime; - if ($this->runtime->hasPCOV()) { + $command = []; + $command[] = PHP_BINARY; + + if ($runtime->hasPCOV()) { $settings = array_merge( $settings, - $this->runtime->getCurrentSettings( - array_keys(ini_get_all('pcov')) - ) + $runtime->getCurrentSettings( + array_keys(ini_get_all('pcov')), + ), ); - } elseif ($this->runtime->hasXdebug()) { + } elseif ($runtime->hasXdebug()) { $settings = array_merge( $settings, - $this->runtime->getCurrentSettings( - array_keys(ini_get_all('xdebug')) - ) + $runtime->getCurrentSettings( + array_keys(ini_get_all('xdebug')), + ), ); } - $command .= $this->settingsToParameters($settings); + $command = array_merge($command, $this->settingsToParameters($settings)); if (PHP_SAPI === 'phpdbg') { - $command .= ' -qrr'; + $command[] = '-qrr'; if (!$file) { - $command .= 's='; + $command[] = 's='; } } if ($file) { - $command .= ' ' . escapeshellarg($file); + $command[] = '-f'; + $command[] = $file; } if ($this->arguments) { if (!$file) { - $command .= ' --'; + $command[] = '--'; } - $command .= ' ' . $this->arguments; - } - if ($this->stderrRedirection) { - $command .= ' 2>&1'; + foreach (explode(' ', $this->arguments) as $arg) { + $command[] = trim($arg); + } } return $command; @@ -226,12 +214,16 @@ abstract class AbstractPhpProcess */ abstract public function runJob(string $job, array $settings = []): array; - protected function settingsToParameters(array $settings): string + /** + * @return list + */ + protected function settingsToParameters(array $settings): array { - $buffer = ''; + $buffer = []; foreach ($settings as $setting) { - $buffer .= ' -d ' . escapeshellarg($setting); + $buffer[] = '-d'; + $buffer[] = $setting; } return $buffer; @@ -252,7 +244,7 @@ abstract class AbstractPhpProcess Facade::emitter()->testErrored( TestMethodBuilder::fromTestCase($test), - ThrowableBuilder::from($exception) + ThrowableBuilder::from($exception), ); return; @@ -265,15 +257,12 @@ abstract class AbstractPhpProcess static function (int $errno, string $errstr, string $errfile, int $errline): never { throw new ErrorException($errstr, $errno, $errno, $errfile, $errline); - } + }, ); try { - if (str_starts_with($stdout, "#!/usr/bin/env php\n")) { - $stdout = substr($stdout, 19); - } + $childResult = unserialize($stdout); - $childResult = unserialize(str_replace("#!/usr/bin/env php\n", '', $stdout)); restore_error_handler(); if ($childResult === false) { @@ -283,16 +272,17 @@ abstract class AbstractPhpProcess Facade::emitter()->testErrored( TestMethodBuilder::fromTestCase($test), - ThrowableBuilder::from($exception) + ThrowableBuilder::from($exception), ); Facade::emitter()->testFinished( TestMethodBuilder::fromTestCase($test), - 0 + 0, ); } } catch (ErrorException $e) { restore_error_handler(); + $childResult = false; $exception = new Exception(trim($stdout), 0, $e); @@ -301,16 +291,12 @@ abstract class AbstractPhpProcess Facade::emitter()->testErrored( TestMethodBuilder::fromTestCase($test), - ThrowableBuilder::from($exception) + ThrowableBuilder::from($exception), ); } if ($childResult !== false) { - if (!empty($childResult['output'])) { - $output = $childResult['output']; - } - - Facade::forward($childResult['events']); + Facade::instance()->forward($childResult['events']); PassedTests::instance()->import($childResult['passedTests']); assert($test instanceof TestCase); @@ -320,13 +306,9 @@ abstract class AbstractPhpProcess if (CodeCoverage::instance()->isActive() && $childResult['codeCoverage'] instanceof \SebastianBergmann\CodeCoverage\CodeCoverage) { CodeCoverage::instance()->codeCoverage()->merge( - $childResult['codeCoverage'] + $childResult['codeCoverage'], ); } } - - if (!empty($output)) { - print $output; - } } } diff --git a/vendor/phpunit/phpunit/src/Util/PHP/DefaultPhpProcess.php b/vendor/phpunit/phpunit/src/Util/PHP/DefaultPhpProcess.php index f0fa9564..3cc0fc1a 100644 --- a/vendor/phpunit/phpunit/src/Util/PHP/DefaultPhpProcess.php +++ b/vendor/phpunit/phpunit/src/Util/PHP/DefaultPhpProcess.php @@ -12,23 +12,20 @@ namespace PHPUnit\Util\PHP; use function array_merge; use function fclose; use function file_put_contents; -use function fread; use function fwrite; use function is_array; use function is_resource; use function proc_close; use function proc_open; -use function proc_terminate; -use function rewind; -use function sprintf; use function stream_get_contents; -use function stream_select; use function sys_get_temp_dir; use function tempnam; use function unlink; use PHPUnit\Framework\Exception; /** + * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit + * * @internal This class is not covered by the backward compatibility promise for PHPUnit */ class DefaultPhpProcess extends AbstractPhpProcess @@ -40,14 +37,16 @@ class DefaultPhpProcess extends AbstractPhpProcess * * @throws Exception * @throws PhpProcessException + * + * @psalm-return array{stdout: string, stderr: string} */ public function runJob(string $job, array $settings = []): array { - if ($this->stdin || $this->useTemporaryFile()) { - if (!($this->tempFile = tempnam(sys_get_temp_dir(), 'PHPUnit')) || + if ($this->stdin) { + if (!($this->tempFile = tempnam(sys_get_temp_dir(), 'phpunit_')) || file_put_contents($this->tempFile, $job) === false) { throw new PhpProcessException( - 'Unable to write temporary file' + 'Unable to write temporary file', ); } @@ -57,24 +56,16 @@ class DefaultPhpProcess extends AbstractPhpProcess return $this->runProcess($job, $settings); } - /** - * Returns an array of file handles to be used in place of pipes. - */ - protected function getHandles(): array - { - return []; - } - /** * Handles creating the child process and returning the STDOUT and STDERR. * * @throws Exception * @throws PhpProcessException + * + * @psalm-return array{stdout: string, stderr: string} */ protected function runProcess(string $job, array $settings): array { - $handles = $this->getHandles(); - $env = null; if ($this->env) { @@ -90,22 +81,26 @@ class DefaultPhpProcess extends AbstractPhpProcess } $pipeSpec = [ - 0 => $handles[0] ?? ['pipe', 'r'], - 1 => $handles[1] ?? ['pipe', 'w'], - 2 => $handles[2] ?? ['pipe', 'w'], + 0 => ['pipe', 'r'], + 1 => ['pipe', 'w'], + 2 => ['pipe', 'w'], ]; + if ($this->stderrRedirection) { + $pipeSpec[2] = ['redirect', 1]; + } + $process = proc_open( $this->getCommand($settings, $this->tempFile), $pipeSpec, $pipes, null, - $env + $env, ); if (!is_resource($process)) { throw new PhpProcessException( - 'Unable to spawn worker process' + 'Unable to spawn worker process', ); } @@ -117,93 +112,16 @@ class DefaultPhpProcess extends AbstractPhpProcess $stderr = $stdout = ''; - if ($this->timeout) { - unset($pipes[0]); + if (isset($pipes[1])) { + $stdout = stream_get_contents($pipes[1]); - while (true) { - $r = $pipes; - $w = null; - $e = null; - - $n = @stream_select($r, $w, $e, $this->timeout); - - if ($n === false) { - break; - } - - if ($n === 0) { - proc_terminate($process, 9); - - throw new PhpProcessException( - sprintf( - 'Job execution aborted after %d seconds', - $this->timeout - ) - ); - } - - if ($n > 0) { - foreach ($r as $pipe) { - $pipeOffset = 0; - - foreach ($pipes as $i => $origPipe) { - if ($pipe === $origPipe) { - $pipeOffset = $i; - - break; - } - } - - if (!$pipeOffset) { - break; - } - - $line = fread($pipe, 8192); - - if ($line === '' || $line === false) { - fclose($pipes[$pipeOffset]); - - unset($pipes[$pipeOffset]); - } elseif ($pipeOffset === 1) { - $stdout .= $line; - } else { - $stderr .= $line; - } - } - - if (empty($pipes)) { - break; - } - } - } - } else { - if (isset($pipes[1])) { - $stdout = stream_get_contents($pipes[1]); - - fclose($pipes[1]); - } - - if (isset($pipes[2])) { - $stderr = stream_get_contents($pipes[2]); - - fclose($pipes[2]); - } + fclose($pipes[1]); } - if (isset($handles[1])) { - rewind($handles[1]); + if (isset($pipes[2])) { + $stderr = stream_get_contents($pipes[2]); - $stdout = stream_get_contents($handles[1]); - - fclose($handles[1]); - } - - if (isset($handles[2])) { - rewind($handles[2]); - - $stderr = stream_get_contents($handles[2]); - - fclose($handles[2]); + fclose($pipes[2]); } proc_close($process); @@ -227,9 +145,4 @@ class DefaultPhpProcess extends AbstractPhpProcess unlink($this->tempFile); } } - - protected function useTemporaryFile(): bool - { - return false; - } } diff --git a/vendor/phpunit/phpunit/src/Util/PHP/Template/TestCaseClass.tpl b/vendor/phpunit/phpunit/src/Util/PHP/Template/TestCaseClass.tpl index f64e0b49..0a869c4d 100644 --- a/vendor/phpunit/phpunit/src/Util/PHP/Template/TestCaseClass.tpl +++ b/vendor/phpunit/phpunit/src/Util/PHP/Template/TestCaseClass.tpl @@ -3,7 +3,6 @@ use PHPUnit\Event\Facade; use PHPUnit\Runner\CodeCoverage; use PHPUnit\TextUI\Configuration\Registry as ConfigurationRegistry; use PHPUnit\TextUI\Configuration\CodeCoverageFilterRegistry; -use PHPUnit\TextUI\XmlConfiguration\Loader; use PHPUnit\TextUI\Configuration\PhpHandler; use PHPUnit\TestRunner\TestResult\PassedTests; @@ -33,20 +32,23 @@ if ($composerAutoload) { function __phpunit_run_isolated_test() { - $dispatcher = Facade::initForIsolation( + $dispatcher = Facade::instance()->initForIsolation( PHPUnit\Event\Telemetry\HRTime::fromSecondsAndNanoseconds( {offsetSeconds}, {offsetNanoseconds} - ) + ), + {exportObjects}, ); require_once '{filename}'; if ({collectCodeCoverageInformation}) { - CodeCoverage::instance()->init(ConfigurationRegistry::get(), CodeCoverageFilterRegistry::instance()); + CodeCoverage::instance()->init(ConfigurationRegistry::get(), CodeCoverageFilterRegistry::instance(), true); + CodeCoverage::instance()->ignoreLines({linesToBeIgnored}); } $test = new {className}('{name}'); + $test->setData('{dataName}', unserialize('{data}')); $test->setDependencyInput(unserialize('{dependencyInput}')); $test->setInIsolation(true); @@ -57,7 +59,7 @@ function __phpunit_run_isolated_test() $output = ''; - if (!$test->hasExpectationOnOutput()) { + if (!$test->expectsOutput()) { $output = $test->output(); } @@ -76,15 +78,18 @@ function __phpunit_run_isolated_test() } } - print serialize( - [ - 'testResult' => $test->result(), - 'codeCoverage' => {collectCodeCoverageInformation} ? CodeCoverage::instance()->codeCoverage() : null, - 'numAssertions' => $test->numberOfAssertionsPerformed(), - 'output' => $output, - 'events' => $dispatcher->flush(), - 'passedTests' => PassedTests::instance() - ] + file_put_contents( + '{processResultFile}', + serialize( + [ + 'testResult' => $test->result(), + 'codeCoverage' => {collectCodeCoverageInformation} ? CodeCoverage::instance()->codeCoverage() : null, + 'numAssertions' => $test->numberOfAssertionsPerformed(), + 'output' => $output, + 'events' => $dispatcher->flush(), + 'passedTests' => PassedTests::instance() + ] + ) ); } diff --git a/vendor/phpunit/phpunit/src/Util/PHP/Template/TestCaseMethod.tpl b/vendor/phpunit/phpunit/src/Util/PHP/Template/TestCaseMethod.tpl index 25f21414..3e508ef6 100644 --- a/vendor/phpunit/phpunit/src/Util/PHP/Template/TestCaseMethod.tpl +++ b/vendor/phpunit/phpunit/src/Util/PHP/Template/TestCaseMethod.tpl @@ -3,7 +3,6 @@ use PHPUnit\Event\Facade; use PHPUnit\Runner\CodeCoverage; use PHPUnit\TextUI\Configuration\Registry as ConfigurationRegistry; use PHPUnit\TextUI\Configuration\CodeCoverageFilterRegistry; -use PHPUnit\TextUI\XmlConfiguration\Loader; use PHPUnit\TextUI\Configuration\PhpHandler; use PHPUnit\TestRunner\TestResult\PassedTests; @@ -33,17 +32,19 @@ if ($composerAutoload) { function __phpunit_run_isolated_test() { - $dispatcher = Facade::initForIsolation( + $dispatcher = Facade::instance()->initForIsolation( PHPUnit\Event\Telemetry\HRTime::fromSecondsAndNanoseconds( {offsetSeconds}, {offsetNanoseconds} - ) + ), + {exportObjects}, ); require_once '{filename}'; if ({collectCodeCoverageInformation}) { - CodeCoverage::instance()->init(ConfigurationRegistry::get(), CodeCoverageFilterRegistry::instance()); + CodeCoverage::instance()->init(ConfigurationRegistry::get(), CodeCoverageFilterRegistry::instance(), true); + CodeCoverage::instance()->ignoreLines({linesToBeIgnored}); } $test = new {className}('{methodName}'); @@ -58,7 +59,7 @@ function __phpunit_run_isolated_test() $output = ''; - if (!$test->hasExpectationOnOutput()) { + if (!$test->expectsOutput()) { $output = $test->output(); } @@ -77,15 +78,18 @@ function __phpunit_run_isolated_test() } } - print serialize( - [ - 'testResult' => $test->result(), - 'codeCoverage' => {collectCodeCoverageInformation} ? CodeCoverage::instance()->codeCoverage() : null, - 'numAssertions' => $test->numberOfAssertionsPerformed(), - 'output' => $output, - 'events' => $dispatcher->flush(), - 'passedTests' => PassedTests::instance() - ] + file_put_contents( + '{processResultFile}', + serialize( + [ + 'testResult' => $test->result(), + 'codeCoverage' => {collectCodeCoverageInformation} ? CodeCoverage::instance()->codeCoverage() : null, + 'numAssertions' => $test->numberOfAssertionsPerformed(), + 'output' => $output, + 'events' => $dispatcher->flush(), + 'passedTests' => PassedTests::instance() + ] + ) ); } diff --git a/vendor/phpunit/phpunit/src/Util/PHP/WindowsPhpProcess.php b/vendor/phpunit/phpunit/src/Util/PHP/WindowsPhpProcess.php deleted file mode 100644 index 70f38d7c..00000000 --- a/vendor/phpunit/phpunit/src/Util/PHP/WindowsPhpProcess.php +++ /dev/null @@ -1,43 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace PHPUnit\Util\PHP; - -use function tmpfile; -use PHPUnit\Framework\Exception; - -/** - * @internal This class is not covered by the backward compatibility promise for PHPUnit - * - * @see https://bugs.php.net/bug.php?id=51800 - */ -final class WindowsPhpProcess extends DefaultPhpProcess -{ - /** - * @throws Exception - * @throws PhpProcessException - */ - protected function getHandles(): array - { - if (false === $stdout_handle = tmpfile()) { - throw new PhpProcessException( - 'A temporary file could not be created; verify that your TEMP environment variable is writable' - ); - } - - return [ - 1 => $stdout_handle, - ]; - } - - protected function useTemporaryFile(): bool - { - return true; - } -} diff --git a/vendor/phpunit/phpunit/src/Util/Reflection.php b/vendor/phpunit/phpunit/src/Util/Reflection.php index 46aeeb93..0aac9259 100644 --- a/vendor/phpunit/phpunit/src/Util/Reflection.php +++ b/vendor/phpunit/phpunit/src/Util/Reflection.php @@ -9,6 +9,9 @@ */ namespace PHPUnit\Util; +use function array_keys; +use function array_merge; +use function array_reverse; use PHPUnit\Framework\Assert; use PHPUnit\Framework\TestCase; use ReflectionClass; @@ -16,6 +19,8 @@ use ReflectionException; use ReflectionMethod; /** + * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit + * * @internal This class is not covered by the backward compatibility promise for PHPUnit */ final class Reflection @@ -24,7 +29,7 @@ final class Reflection * @psalm-param class-string $className * @psalm-param non-empty-string $methodName * - * @psalm-return array{file: string, line: int} + * @psalm-return array{file: non-empty-string, line: non-negative-int} */ public static function sourceLocationFor(string $className, string $methodName): array { @@ -47,36 +52,54 @@ final class Reflection /** * @psalm-return list */ - public function publicMethodsInTestClass(ReflectionClass $class): array + public static function publicMethodsInTestClass(ReflectionClass $class): array { - return $this->filterMethods($class, ReflectionMethod::IS_PUBLIC); + return self::filterAndSortMethods($class, ReflectionMethod::IS_PUBLIC, true); } /** * @psalm-return list */ - public function methodsInTestClass(ReflectionClass $class): array + public static function methodsInTestClass(ReflectionClass $class): array { - return $this->filterMethods($class, null); + return self::filterAndSortMethods($class, null, false); } /** * @psalm-return list */ - private function filterMethods(ReflectionClass $class, ?int $filter): array + private static function filterAndSortMethods(ReflectionClass $class, ?int $filter, bool $sortHighestToLowest): array { - $methods = []; + $methodsByClass = []; foreach ($class->getMethods($filter) as $method) { - if ($method->getDeclaringClass()->getName() === TestCase::class) { + $declaringClassName = $method->getDeclaringClass()->getName(); + + if ($declaringClassName === TestCase::class) { continue; } - if ($method->getDeclaringClass()->getName() === Assert::class) { + if ($declaringClassName === Assert::class) { continue; } - $methods[] = $method; + if (!isset($methodsByClass[$declaringClassName])) { + $methodsByClass[$declaringClassName] = []; + } + + $methodsByClass[$declaringClassName][] = $method; + } + + $classNames = array_keys($methodsByClass); + + if ($sortHighestToLowest) { + $classNames = array_reverse($classNames); + } + + $methods = []; + + foreach ($classNames as $className) { + $methods = array_merge($methods, $methodsByClass[$className]); } return $methods; diff --git a/vendor/phpunit/phpunit/src/Util/Test.php b/vendor/phpunit/phpunit/src/Util/Test.php index e1f429af..51d90769 100644 --- a/vendor/phpunit/phpunit/src/Util/Test.php +++ b/vendor/phpunit/phpunit/src/Util/Test.php @@ -14,6 +14,8 @@ use PHPUnit\Metadata\Parser\Registry; use ReflectionMethod; /** + * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit + * * @internal This class is not covered by the backward compatibility promise for PHPUnit */ final class Test @@ -30,7 +32,7 @@ final class Test $metadata = Registry::parser()->forMethod( $method->getDeclaringClass()->getName(), - $method->getName() + $method->getName(), ); return $metadata->isTest()->isNotEmpty(); diff --git a/vendor/phpunit/phpunit/src/Util/ThrowableToStringMapper.php b/vendor/phpunit/phpunit/src/Util/ThrowableToStringMapper.php index a8f3eb86..a0c1289a 100644 --- a/vendor/phpunit/phpunit/src/Util/ThrowableToStringMapper.php +++ b/vendor/phpunit/phpunit/src/Util/ThrowableToStringMapper.php @@ -13,15 +13,22 @@ use function trim; use PHPUnit\Framework\ExpectationFailedException; use PHPUnit\Framework\PhptAssertionFailedError; use PHPUnit\Framework\SelfDescribing; +use PHPUnit\Runner\ErrorException; use Throwable; /** + * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit + * * @internal This class is not covered by the backward compatibility promise for PHPUnit */ final class ThrowableToStringMapper { public static function map(Throwable $t): string { + if ($t instanceof ErrorException) { + return $t->getMessage(); + } + if ($t instanceof SelfDescribing) { $buffer = $t->toString(); diff --git a/vendor/phpunit/phpunit/src/Util/VersionComparisonOperator.php b/vendor/phpunit/phpunit/src/Util/VersionComparisonOperator.php index ad108335..3a4e1c4e 100644 --- a/vendor/phpunit/phpunit/src/Util/VersionComparisonOperator.php +++ b/vendor/phpunit/phpunit/src/Util/VersionComparisonOperator.php @@ -19,7 +19,7 @@ use function in_array; final class VersionComparisonOperator { /** - * @psalm-var '<'|'lt'|'<='|'le'|'>'|'gt'|'>='|'ge'|'=='|'='|'eq'|'!='|'<>'|'ne' + * @psalm-var '!='|'<'|'<='|'<>'|'='|'=='|'>'|'>='|'eq'|'ge'|'gt'|'le'|'lt'|'ne' */ private readonly string $operator; diff --git a/vendor/phpunit/phpunit/src/Util/Xml.php b/vendor/phpunit/phpunit/src/Util/Xml.php deleted file mode 100644 index a7c4f836..00000000 --- a/vendor/phpunit/phpunit/src/Util/Xml.php +++ /dev/null @@ -1,79 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace PHPUnit\Util; - -use const ENT_QUOTES; -use function htmlspecialchars; -use function mb_convert_encoding; -use function ord; -use function preg_replace; -use function strlen; - -/** - * @internal This class is not covered by the backward compatibility promise for PHPUnit - */ -final class Xml -{ - /** - * Escapes a string for the use in XML documents. - * - * Any Unicode character is allowed, excluding the surrogate blocks, FFFE, - * and FFFF (not even as character reference). - * - * @see https://www.w3.org/TR/xml/#charsets - */ - public static function prepareString(string $string): string - { - return preg_replace( - '/[\\x00-\\x08\\x0b\\x0c\\x0e-\\x1f\\x7f]/', - '', - htmlspecialchars( - self::convertToUtf8($string), - ENT_QUOTES - ) - ); - } - - private static function convertToUtf8(string $string): string - { - if (!self::isUtf8($string)) { - $string = mb_convert_encoding($string, 'UTF-8'); - } - - return $string; - } - - private static function isUtf8(string $string): bool - { - $length = strlen($string); - - for ($i = 0; $i < $length; $i++) { - if (ord($string[$i]) < 0x80) { - $n = 0; - } elseif ((ord($string[$i]) & 0xE0) === 0xC0) { - $n = 1; - } elseif ((ord($string[$i]) & 0xF0) === 0xE0) { - $n = 2; - } elseif ((ord($string[$i]) & 0xF0) === 0xF0) { - $n = 3; - } else { - return false; - } - - for ($j = 0; $j < $n; $j++) { - if ((++$i === $length) || ((ord($string[$i]) & 0xC0) !== 0x80)) { - return false; - } - } - } - - return true; - } -} diff --git a/vendor/phpunit/phpunit/src/Util/Xml/Exception.php b/vendor/phpunit/phpunit/src/Util/Xml/Exception.php deleted file mode 100644 index 09b73d8f..00000000 --- a/vendor/phpunit/phpunit/src/Util/Xml/Exception.php +++ /dev/null @@ -1,19 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace PHPUnit\Util\Xml; - -use RuntimeException; - -/** - * @internal This class is not covered by the backward compatibility promise for PHPUnit - */ -final class Exception extends RuntimeException implements \PHPUnit\Exception -{ -} diff --git a/vendor/phpunit/phpunit/src/Util/Xml/FailedSchemaDetectionResult.php b/vendor/phpunit/phpunit/src/Util/Xml/FailedSchemaDetectionResult.php deleted file mode 100644 index 0949f568..00000000 --- a/vendor/phpunit/phpunit/src/Util/Xml/FailedSchemaDetectionResult.php +++ /dev/null @@ -1,19 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace PHPUnit\Util\Xml; - -/** - * @internal This class is not covered by the backward compatibility promise for PHPUnit - * - * @psalm-immutable - */ -final class FailedSchemaDetectionResult extends SchemaDetectionResult -{ -} diff --git a/vendor/phpunit/phpunit/src/Util/Xml/Loader.php b/vendor/phpunit/phpunit/src/Util/Xml/Loader.php index 5b4cb1b6..927927d1 100644 --- a/vendor/phpunit/phpunit/src/Util/Xml/Loader.php +++ b/vendor/phpunit/phpunit/src/Util/Xml/Loader.php @@ -9,6 +9,7 @@ */ namespace PHPUnit\Util\Xml; +use const PHP_OS_FAMILY; use function chdir; use function dirname; use function error_reporting; @@ -20,6 +21,8 @@ use function sprintf; use DOMDocument; /** + * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit + * * @internal This class is not covered by the backward compatibility promise for PHPUnit */ final class Loader @@ -27,7 +30,7 @@ final class Loader /** * @throws XmlException */ - public function loadFile(string $filename, bool $isHtml = false, bool $xinclude = false, bool $strict = false): DOMDocument + public function loadFile(string $filename): DOMDocument { $reporting = error_reporting(0); $contents = file_get_contents($filename); @@ -37,28 +40,31 @@ final class Loader if ($contents === false) { throw new XmlException( sprintf( - 'Could not read "%s".', - $filename - ) + 'Could not read XML from file "%s"', + $filename, + ), ); } - return $this->load($contents, $isHtml, $filename, $xinclude, $strict); + return $this->load($contents, $filename); } /** * @throws XmlException */ - public function load(string $actual, bool $isHtml = false, string $filename = '', bool $xinclude = false, bool $strict = false): DOMDocument + public function load(string $actual, ?string $filename = null): DOMDocument { if ($actual === '') { - throw new XmlException('Could not load XML from empty string'); - } + if ($filename === null) { + throw new XmlException('Could not parse XML from empty string'); + } - // Required for XInclude on Windows. - if ($xinclude) { - $cwd = getcwd(); - @chdir(dirname($filename)); + throw new XmlException( + sprintf( + 'Could not parse XML from empty file "%s"', + $filename, + ), + ); } $document = new DOMDocument; @@ -68,18 +74,20 @@ final class Loader $message = ''; $reporting = error_reporting(0); - if ($filename !== '') { - // Required for XInclude + // Required for XInclude + if ($filename !== null) { + // Required for XInclude on Windows + if (PHP_OS_FAMILY === 'Windows') { + $cwd = getcwd(); + @chdir(dirname($filename)); + } + $document->documentURI = $filename; } - if ($isHtml) { - $loaded = $document->loadHTML($actual); - } else { - $loaded = $document->loadXML($actual); - } + $loaded = $document->loadXML($actual); - if (!$isHtml && $xinclude) { + if ($filename !== null) { $document->xinclude(); } @@ -94,19 +102,21 @@ final class Loader @chdir($cwd); } - if ($loaded === false || ($strict && $message !== '')) { - if ($filename !== '') { + if ($loaded === false || $message !== '') { + if ($filename !== null) { throw new XmlException( sprintf( - 'Could not load "%s".%s', + 'Could not load "%s"%s', $filename, - $message !== '' ? "\n" . $message : '' - ) + $message !== '' ? ":\n" . $message : '', + ), ); } if ($message === '') { + // @codeCoverageIgnoreStart $message = 'Could not load XML for unknown reason'; + // @codeCoverageIgnoreEnd } throw new XmlException($message); diff --git a/vendor/phpunit/phpunit/src/Util/Xml/SchemaDetectionResult.php b/vendor/phpunit/phpunit/src/Util/Xml/SchemaDetectionResult.php deleted file mode 100644 index bfe389ac..00000000 --- a/vendor/phpunit/phpunit/src/Util/Xml/SchemaDetectionResult.php +++ /dev/null @@ -1,31 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace PHPUnit\Util\Xml; - -/** - * @internal This class is not covered by the backward compatibility promise for PHPUnit - * - * @psalm-immutable - */ -abstract class SchemaDetectionResult -{ - public function detected(): bool - { - return false; - } - - /** - * @throws XmlException - */ - public function version(): string - { - throw new XmlException('No supported schema was detected'); - } -} diff --git a/vendor/phpunit/phpunit/src/Util/Xml/SchemaDetector.php b/vendor/phpunit/phpunit/src/Util/Xml/SchemaDetector.php deleted file mode 100644 index 2e6183ef..00000000 --- a/vendor/phpunit/phpunit/src/Util/Xml/SchemaDetector.php +++ /dev/null @@ -1,39 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace PHPUnit\Util\Xml; - -/** - * @internal This class is not covered by the backward compatibility promise for PHPUnit - */ -final class SchemaDetector -{ - /** - * @throws XmlException - */ - public function detect(string $filename): SchemaDetectionResult - { - $document = (new Loader)->loadFile( - $filename, - false, - true, - true - ); - - foreach (['9.5', '9.2', '8.5'] as $candidate) { - $schema = (new SchemaFinder)->find($candidate); - - if (!(new Validator)->validate($document, $schema)->hasValidationErrors()) { - return new SuccessfulSchemaDetectionResult($candidate); - } - } - - return new FailedSchemaDetectionResult; - } -} diff --git a/vendor/phpunit/phpunit/src/Util/Xml/SchemaFinder.php b/vendor/phpunit/phpunit/src/Util/Xml/SchemaFinder.php deleted file mode 100644 index 7865b414..00000000 --- a/vendor/phpunit/phpunit/src/Util/Xml/SchemaFinder.php +++ /dev/null @@ -1,53 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace PHPUnit\Util\Xml; - -use function defined; -use function is_file; -use function sprintf; -use PHPUnit\Runner\Version; - -/** - * @internal This class is not covered by the backward compatibility promise for PHPUnit - */ -final class SchemaFinder -{ - /** - * @throws XmlException - */ - public function find(string $version): string - { - if ($version === Version::series()) { - $filename = $this->path() . 'phpunit.xsd'; - } else { - $filename = $this->path() . 'schema/' . $version . '.xsd'; - } - - if (!is_file($filename)) { - throw new XmlException( - sprintf( - 'Schema for PHPUnit %s is not available', - $version - ) - ); - } - - return $filename; - } - - private function path(): string - { - if (defined('__PHPUNIT_PHAR_ROOT__')) { - return __PHPUNIT_PHAR_ROOT__ . '/'; - } - - return __DIR__ . '/../../../'; - } -} diff --git a/vendor/phpunit/phpunit/src/Util/Xml/SnapshotNodeList.php b/vendor/phpunit/phpunit/src/Util/Xml/SnapshotNodeList.php deleted file mode 100644 index 675645ae..00000000 --- a/vendor/phpunit/phpunit/src/Util/Xml/SnapshotNodeList.php +++ /dev/null @@ -1,51 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace PHPUnit\Util\Xml; - -use function count; -use ArrayIterator; -use Countable; -use DOMNode; -use DOMNodeList; -use IteratorAggregate; - -/** - * @internal This class is not covered by the backward compatibility promise for PHPUnit - * - * @template-implements IteratorAggregate - */ -final class SnapshotNodeList implements Countable, IteratorAggregate -{ - /** - * @psalm-var list - */ - private array $nodes = []; - - public static function fromNodeList(DOMNodeList $list): self - { - $snapshot = new self; - - foreach ($list as $node) { - $snapshot->nodes[] = $node; - } - - return $snapshot; - } - - public function count(): int - { - return count($this->nodes); - } - - public function getIterator(): ArrayIterator - { - return new ArrayIterator($this->nodes); - } -} diff --git a/vendor/phpunit/phpunit/src/Util/Xml/SuccessfulSchemaDetectionResult.php b/vendor/phpunit/phpunit/src/Util/Xml/SuccessfulSchemaDetectionResult.php deleted file mode 100644 index 354d664f..00000000 --- a/vendor/phpunit/phpunit/src/Util/Xml/SuccessfulSchemaDetectionResult.php +++ /dev/null @@ -1,35 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace PHPUnit\Util\Xml; - -/** - * @internal This class is not covered by the backward compatibility promise for PHPUnit - * - * @psalm-immutable - */ -final class SuccessfulSchemaDetectionResult extends SchemaDetectionResult -{ - private readonly string $version; - - public function __construct(string $version) - { - $this->version = $version; - } - - public function detected(): bool - { - return true; - } - - public function version(): string - { - return $this->version; - } -} diff --git a/vendor/phpunit/phpunit/src/Util/Xml/ValidationResult.php b/vendor/phpunit/phpunit/src/Util/Xml/ValidationResult.php deleted file mode 100644 index d760aa1a..00000000 --- a/vendor/phpunit/phpunit/src/Util/Xml/ValidationResult.php +++ /dev/null @@ -1,69 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace PHPUnit\Util\Xml; - -use function sprintf; -use function trim; - -/** - * @internal This class is not covered by the backward compatibility promise for PHPUnit - * - * @psalm-immutable - */ -final class ValidationResult -{ - /** - * @psalm-var array> - */ - private readonly array $validationErrors; - - /** - * @psalm-param array $errors - */ - public static function fromArray(array $errors): self - { - $validationErrors = []; - - foreach ($errors as $error) { - if (!isset($validationErrors[$error->line])) { - $validationErrors[$error->line] = []; - } - - $validationErrors[$error->line][] = trim($error->message); - } - - return new self($validationErrors); - } - - private function __construct(array $validationErrors) - { - $this->validationErrors = $validationErrors; - } - - public function hasValidationErrors(): bool - { - return !empty($this->validationErrors); - } - - public function asString(): string - { - $buffer = ''; - - foreach ($this->validationErrors as $line => $validationErrorsOnLine) { - $buffer .= sprintf(PHP_EOL . ' Line %d:' . PHP_EOL, $line); - - foreach ($validationErrorsOnLine as $validationError) { - $buffer .= sprintf(' - %s' . PHP_EOL, $validationError); - } - } - - return $buffer; - } -} diff --git a/vendor/phpunit/phpunit/src/Util/Xml/Validator.php b/vendor/phpunit/phpunit/src/Util/Xml/Validator.php deleted file mode 100644 index b3c4e05b..00000000 --- a/vendor/phpunit/phpunit/src/Util/Xml/Validator.php +++ /dev/null @@ -1,35 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace PHPUnit\Util\Xml; - -use function file_get_contents; -use function libxml_clear_errors; -use function libxml_get_errors; -use function libxml_use_internal_errors; -use DOMDocument; - -/** - * @internal This class is not covered by the backward compatibility promise for PHPUnit - */ -final class Validator -{ - public function validate(DOMDocument $document, string $xsdFilename): ValidationResult - { - $originalErrorHandling = libxml_use_internal_errors(true); - - $document->schemaValidateSource(file_get_contents($xsdFilename)); - - $errors = libxml_get_errors(); - libxml_clear_errors(); - libxml_use_internal_errors($originalErrorHandling); - - return ValidationResult::fromArray($errors); - } -} diff --git a/vendor/psr/log/src/LoggerAwareInterface.php b/vendor/psr/log/src/LoggerAwareInterface.php index cc46a951..06218705 100644 --- a/vendor/psr/log/src/LoggerAwareInterface.php +++ b/vendor/psr/log/src/LoggerAwareInterface.php @@ -9,10 +9,6 @@ interface LoggerAwareInterface { /** * Sets a logger instance on the object. - * - * @param LoggerInterface $logger - * - * @return void */ public function setLogger(LoggerInterface $logger): void; } diff --git a/vendor/psr/log/src/LoggerAwareTrait.php b/vendor/psr/log/src/LoggerAwareTrait.php index 4fb57a29..85104dbc 100644 --- a/vendor/psr/log/src/LoggerAwareTrait.php +++ b/vendor/psr/log/src/LoggerAwareTrait.php @@ -9,15 +9,11 @@ trait LoggerAwareTrait { /** * The logger instance. - * - * @var LoggerInterface|null */ protected ?LoggerInterface $logger = null; /** * Sets a logger. - * - * @param LoggerInterface $logger */ public function setLogger(LoggerInterface $logger): void { diff --git a/vendor/psr/log/src/LoggerInterface.php b/vendor/psr/log/src/LoggerInterface.php index b3a24b5f..cb4cf648 100644 --- a/vendor/psr/log/src/LoggerInterface.php +++ b/vendor/psr/log/src/LoggerInterface.php @@ -22,10 +22,7 @@ interface LoggerInterface /** * System is unusable. * - * @param string|\Stringable $message * @param mixed[] $context - * - * @return void */ public function emergency(string|\Stringable $message, array $context = []): void; @@ -35,10 +32,7 @@ interface LoggerInterface * Example: Entire website down, database unavailable, etc. This should * trigger the SMS alerts and wake you up. * - * @param string|\Stringable $message * @param mixed[] $context - * - * @return void */ public function alert(string|\Stringable $message, array $context = []): void; @@ -47,10 +41,7 @@ interface LoggerInterface * * Example: Application component unavailable, unexpected exception. * - * @param string|\Stringable $message * @param mixed[] $context - * - * @return void */ public function critical(string|\Stringable $message, array $context = []): void; @@ -58,10 +49,7 @@ interface LoggerInterface * Runtime errors that do not require immediate action but should typically * be logged and monitored. * - * @param string|\Stringable $message * @param mixed[] $context - * - * @return void */ public function error(string|\Stringable $message, array $context = []): void; @@ -71,20 +59,14 @@ interface LoggerInterface * Example: Use of deprecated APIs, poor use of an API, undesirable things * that are not necessarily wrong. * - * @param string|\Stringable $message * @param mixed[] $context - * - * @return void */ public function warning(string|\Stringable $message, array $context = []): void; /** * Normal but significant events. * - * @param string|\Stringable $message * @param mixed[] $context - * - * @return void */ public function notice(string|\Stringable $message, array $context = []): void; @@ -93,32 +75,23 @@ interface LoggerInterface * * Example: User logs in, SQL logs. * - * @param string|\Stringable $message * @param mixed[] $context - * - * @return void */ public function info(string|\Stringable $message, array $context = []): void; /** * Detailed debug information. * - * @param string|\Stringable $message * @param mixed[] $context - * - * @return void */ public function debug(string|\Stringable $message, array $context = []): void; /** * Logs with an arbitrary level. * - * @param mixed $level - * @param string|\Stringable $message + * @param mixed $level * @param mixed[] $context * - * @return void - * * @throws \Psr\Log\InvalidArgumentException */ public function log($level, string|\Stringable $message, array $context = []): void; diff --git a/vendor/psr/log/src/LoggerTrait.php b/vendor/psr/log/src/LoggerTrait.php index 9c8733f9..a5d9980b 100644 --- a/vendor/psr/log/src/LoggerTrait.php +++ b/vendor/psr/log/src/LoggerTrait.php @@ -14,11 +14,6 @@ trait LoggerTrait { /** * System is unusable. - * - * @param string|\Stringable $message - * @param array $context - * - * @return void */ public function emergency(string|\Stringable $message, array $context = []): void { @@ -30,11 +25,6 @@ trait LoggerTrait * * Example: Entire website down, database unavailable, etc. This should * trigger the SMS alerts and wake you up. - * - * @param string|\Stringable $message - * @param array $context - * - * @return void */ public function alert(string|\Stringable $message, array $context = []): void { @@ -45,11 +35,6 @@ trait LoggerTrait * Critical conditions. * * Example: Application component unavailable, unexpected exception. - * - * @param string|\Stringable $message - * @param array $context - * - * @return void */ public function critical(string|\Stringable $message, array $context = []): void { @@ -59,11 +44,6 @@ trait LoggerTrait /** * Runtime errors that do not require immediate action but should typically * be logged and monitored. - * - * @param string|\Stringable $message - * @param array $context - * - * @return void */ public function error(string|\Stringable $message, array $context = []): void { @@ -75,11 +55,6 @@ trait LoggerTrait * * Example: Use of deprecated APIs, poor use of an API, undesirable things * that are not necessarily wrong. - * - * @param string|\Stringable $message - * @param array $context - * - * @return void */ public function warning(string|\Stringable $message, array $context = []): void { @@ -88,11 +63,6 @@ trait LoggerTrait /** * Normal but significant events. - * - * @param string|\Stringable $message - * @param array $context - * - * @return void */ public function notice(string|\Stringable $message, array $context = []): void { @@ -103,11 +73,6 @@ trait LoggerTrait * Interesting events. * * Example: User logs in, SQL logs. - * - * @param string|\Stringable $message - * @param array $context - * - * @return void */ public function info(string|\Stringable $message, array $context = []): void { @@ -116,11 +81,6 @@ trait LoggerTrait /** * Detailed debug information. - * - * @param string|\Stringable $message - * @param array $context - * - * @return void */ public function debug(string|\Stringable $message, array $context = []): void { @@ -130,11 +90,7 @@ trait LoggerTrait /** * Logs with an arbitrary level. * - * @param mixed $level - * @param string|\Stringable $message - * @param array $context - * - * @return void + * @param mixed $level * * @throws \Psr\Log\InvalidArgumentException */ diff --git a/vendor/psr/log/src/NullLogger.php b/vendor/psr/log/src/NullLogger.php index c1cc3c06..de0561e2 100644 --- a/vendor/psr/log/src/NullLogger.php +++ b/vendor/psr/log/src/NullLogger.php @@ -15,11 +15,7 @@ class NullLogger extends AbstractLogger /** * Logs with an arbitrary level. * - * @param mixed $level - * @param string|\Stringable $message - * @param array $context - * - * @return void + * @param mixed[] $context * * @throws \Psr\Log\InvalidArgumentException */ diff --git a/vendor/sebastian/cli-parser/ChangeLog.md b/vendor/sebastian/cli-parser/ChangeLog.md index 2880ddbb..0cc528ea 100644 --- a/vendor/sebastian/cli-parser/ChangeLog.md +++ b/vendor/sebastian/cli-parser/ChangeLog.md @@ -2,6 +2,12 @@ All notable changes are documented in this file using the [Keep a CHANGELOG](https://keepachangelog.com/) principles. +## [2.0.1] - 2024-03-02 + +### Changed + +* Do not use implicitly nullable parameters + ## [2.0.0] - 2023-02-03 ### Removed @@ -18,6 +24,7 @@ All notable changes are documented in this file using the [Keep a CHANGELOG](htt * Initial release +[2.0.1]: https://github.com/sebastianbergmann/cli-parser/compare/2.0.0...2.0.1 [2.0.0]: https://github.com/sebastianbergmann/cli-parser/compare/1.0.1...2.0.0 [1.0.1]: https://github.com/sebastianbergmann/cli-parser/compare/1.0.0...1.0.1 [1.0.0]: https://github.com/sebastianbergmann/cli-parser/compare/bb7bb3297957927962b0a3335befe7b66f7462e9...1.0.0 diff --git a/vendor/sebastian/cli-parser/LICENSE b/vendor/sebastian/cli-parser/LICENSE index 5716d965..edaedf61 100644 --- a/vendor/sebastian/cli-parser/LICENSE +++ b/vendor/sebastian/cli-parser/LICENSE @@ -1,6 +1,6 @@ BSD 3-Clause License -Copyright (c) 2020-2023, Sebastian Bergmann +Copyright (c) 2020-2024, Sebastian Bergmann All rights reserved. Redistribution and use in source and binary forms, with or without diff --git a/vendor/sebastian/cli-parser/SECURITY.md b/vendor/sebastian/cli-parser/SECURITY.md index d4ee967b..d88ff001 100644 --- a/vendor/sebastian/cli-parser/SECURITY.md +++ b/vendor/sebastian/cli-parser/SECURITY.md @@ -1,9 +1,30 @@ # Security Policy -This library is intended to be used in development environments only. For instance, it is used by the testing framework PHPUnit. There is no reason why this library should be installed on a webserver. +If you believe you have found a security vulnerability in the library that is developed in this repository, please report it to us through coordinated disclosure. -**If you upload this library to a webserver then your deployment process is broken. On a more general note, if your `vendor` directory is publicly accessible on your webserver then your deployment process is also broken.** +**Please do not report security vulnerabilities through public GitHub issues, discussions, or pull requests.** -## Security Contact Information +Instead, please email `sebastian@phpunit.de`. + +Please include as much of the information listed below as you can to help us better understand and resolve the issue: + +* The type of issue +* Full paths of source file(s) related to the manifestation of the issue +* The location of the affected source code (tag/branch/commit or direct URL) +* Any special configuration required to reproduce the issue +* Step-by-step instructions to reproduce the issue +* Proof-of-concept or exploit code (if possible) +* Impact of the issue, including how an attacker might exploit the issue + +This information will help us triage your report more quickly. + +## Web Context + +The library that is developed in this repository was either extracted from [PHPUnit](https://github.com/sebastianbergmann/phpunit) or developed specifically as a dependency for PHPUnit. + +The library is developed with a focus on development environments and the command-line. No specific testing or hardening with regard to using the library in an HTTP or web context or with untrusted input data is performed. The library might also contain functionality that intentionally exposes internal application data for debugging purposes. + +If the library is used in a web application, the application developer is responsible for filtering inputs or escaping outputs as necessary and for verifying that the used functionality is safe for use within the intended context. + +Vulnerabilities specific to the use outside a development context will be fixed as applicable, provided that the fix does not have an averse effect on the primary use case for development purposes. -After the above, if you still would like to report a security vulnerability, please email `sebastian@phpunit.de`. diff --git a/vendor/sebastian/cli-parser/composer.json b/vendor/sebastian/cli-parser/composer.json index f33a1969..51b74472 100644 --- a/vendor/sebastian/cli-parser/composer.json +++ b/vendor/sebastian/cli-parser/composer.json @@ -12,7 +12,8 @@ } ], "support": { - "issues": "https://github.com/sebastianbergmann/cli-parser/issues" + "issues": "https://github.com/sebastianbergmann/cli-parser/issues", + "security": "https://github.com/sebastianbergmann/cli-parser/security/policy" }, "prefer-stable": true, "require": { diff --git a/vendor/sebastian/cli-parser/src/Parser.php b/vendor/sebastian/cli-parser/src/Parser.php index 795e95b7..ab2d975c 100644 --- a/vendor/sebastian/cli-parser/src/Parser.php +++ b/vendor/sebastian/cli-parser/src/Parser.php @@ -44,7 +44,7 @@ final class Parser * @throws RequiredOptionArgumentMissingException * @throws UnknownOptionException */ - public function parse(array $argv, string $shortOptions, array $longOptions = null): array + public function parse(array $argv, string $shortOptions, ?array $longOptions = null): array { if (empty($argv)) { return [[], []]; @@ -93,7 +93,7 @@ final class Parser substr($arg, 2), $longOptions, $options, - $argv + $argv, ); continue; @@ -103,7 +103,7 @@ final class Parser substr($arg, 1), $shortOptions, $options, - $argv + $argv, ); } diff --git a/vendor/sebastian/cli-parser/src/exceptions/AmbiguousOptionException.php b/vendor/sebastian/cli-parser/src/exceptions/AmbiguousOptionException.php index a99f6369..99eb625a 100644 --- a/vendor/sebastian/cli-parser/src/exceptions/AmbiguousOptionException.php +++ b/vendor/sebastian/cli-parser/src/exceptions/AmbiguousOptionException.php @@ -19,8 +19,8 @@ final class AmbiguousOptionException extends RuntimeException implements Excepti parent::__construct( sprintf( 'Option "%s" is ambiguous', - $option - ) + $option, + ), ); } } diff --git a/vendor/sebastian/cli-parser/src/exceptions/OptionDoesNotAllowArgumentException.php b/vendor/sebastian/cli-parser/src/exceptions/OptionDoesNotAllowArgumentException.php index 0aad29ac..7fea616b 100644 --- a/vendor/sebastian/cli-parser/src/exceptions/OptionDoesNotAllowArgumentException.php +++ b/vendor/sebastian/cli-parser/src/exceptions/OptionDoesNotAllowArgumentException.php @@ -19,8 +19,8 @@ final class OptionDoesNotAllowArgumentException extends RuntimeException impleme parent::__construct( sprintf( 'Option "%s" does not allow an argument', - $option - ) + $option, + ), ); } } diff --git a/vendor/sebastian/cli-parser/src/exceptions/RequiredOptionArgumentMissingException.php b/vendor/sebastian/cli-parser/src/exceptions/RequiredOptionArgumentMissingException.php index d2a930b6..9add49a9 100644 --- a/vendor/sebastian/cli-parser/src/exceptions/RequiredOptionArgumentMissingException.php +++ b/vendor/sebastian/cli-parser/src/exceptions/RequiredOptionArgumentMissingException.php @@ -19,8 +19,8 @@ final class RequiredOptionArgumentMissingException extends RuntimeException impl parent::__construct( sprintf( 'Required argument for option "%s" is missing', - $option - ) + $option, + ), ); } } diff --git a/vendor/sebastian/cli-parser/src/exceptions/UnknownOptionException.php b/vendor/sebastian/cli-parser/src/exceptions/UnknownOptionException.php index e98d9fd0..560c7ad2 100644 --- a/vendor/sebastian/cli-parser/src/exceptions/UnknownOptionException.php +++ b/vendor/sebastian/cli-parser/src/exceptions/UnknownOptionException.php @@ -19,8 +19,8 @@ final class UnknownOptionException extends RuntimeException implements Exception parent::__construct( sprintf( 'Unknown option "%s"', - $option - ) + $option, + ), ); } } diff --git a/vendor/sebastian/comparator/ChangeLog.md b/vendor/sebastian/comparator/ChangeLog.md index fd35f3bc..bdd88fd8 100644 --- a/vendor/sebastian/comparator/ChangeLog.md +++ b/vendor/sebastian/comparator/ChangeLog.md @@ -2,6 +2,37 @@ All notable changes are documented in this file using the [Keep a CHANGELOG](http://keepachangelog.com/) principles. +## [5.0.5] - 2026-01-24 + +### Changed + +* [#134](https://github.com/sebastianbergmann/comparator/issues/134): Suppress warning introduced in PHP 8.5 + +## [5.0.4] - 2025-09-07 + +### Changed + +* Do not use `SplObjectStorage` methods that will be deprecated in PHP 8.5 + +## [5.0.3] - 2024-10-18 + +### Fixed + +* Reverted [#113](https://github.com/sebastianbergmann/comparator/pull/113) as it broke backward compatibility + +## [5.0.2] - 2024-08-12 + +### Fixed + +* [#112](https://github.com/sebastianbergmann/comparator/issues/112): Arrays with different keys and the same values are considered equal in canonicalize mode + +## [5.0.1] - 2023-08-14 + +### Fixed + +* `MockObjectComparator` only works on instances of `PHPUnit\Framework\MockObject\MockObject`, but not on instances of `PHPUnit\Framework\MockObject\Stub` +* `MockObjectComparator` only ignores the `$__phpunit_invocationMocker` property, but not other properties with names prefixed with `__phpunit_` + ## [5.0.0] - 2023-02-03 ### Changed @@ -137,7 +168,14 @@ All notable changes are documented in this file using the [Keep a CHANGELOG](htt * Added `SebastianBergmann\Comparator\Factory::reset()` to unregister all non-default comparators * Added support for `phpunit/phpunit-mock-objects` version `^5.0` -[5.0.0]: https://github.com/sebastianbergmann/comparator/compare/4.0.8...5.0.0 +[5.0.5]: https://github.com/sebastianbergmann/comparator/compare/5.0.4...5.0.5 +[5.0.4]: https://github.com/sebastianbergmann/comparator/compare/5.0.3...5.0.4 +[5.0.3]: https://github.com/sebastianbergmann/comparator/compare/5.0.2...5.0.3 +[5.0.2]: https://github.com/sebastianbergmann/comparator/compare/5.0.1...5.0.2 +[5.0.1]: https://github.com/sebastianbergmann/comparator/compare/5.0.0...5.0.1 +[5.0.0]: https://github.com/sebastianbergmann/comparator/compare/4.0...5.0.0 +[4.0.10]: https://github.com/sebastianbergmann/comparator/compare/4.0.9...4.0.10 +[4.0.9]: https://github.com/sebastianbergmann/comparator/compare/4.0.8...4.0.9 [4.0.8]: https://github.com/sebastianbergmann/comparator/compare/4.0.7...4.0.8 [4.0.7]: https://github.com/sebastianbergmann/comparator/compare/4.0.6...4.0.7 [4.0.6]: https://github.com/sebastianbergmann/comparator/compare/4.0.5...4.0.6 @@ -146,7 +184,9 @@ All notable changes are documented in this file using the [Keep a CHANGELOG](htt [4.0.3]: https://github.com/sebastianbergmann/comparator/compare/4.0.2...4.0.3 [4.0.2]: https://github.com/sebastianbergmann/comparator/compare/4.0.1...4.0.2 [4.0.1]: https://github.com/sebastianbergmann/comparator/compare/4.0.0...4.0.1 -[4.0.0]: https://github.com/sebastianbergmann/comparator/compare/3.0.5...4.0.0 +[4.0.0]: https://github.com/sebastianbergmann/comparator/compare/3.0...4.0.0 +[3.0.7]: https://github.com/sebastianbergmann/comparator/compare/3.0.6...3.0.7 +[3.0.6]: https://github.com/sebastianbergmann/comparator/compare/3.0.5...3.0.6 [3.0.5]: https://github.com/sebastianbergmann/comparator/compare/3.0.4...3.0.5 [3.0.4]: https://github.com/sebastianbergmann/comparator/compare/3.0.3...3.0.4 [3.0.3]: https://github.com/sebastianbergmann/comparator/compare/3.0.2...3.0.3 diff --git a/vendor/sebastian/comparator/LICENSE b/vendor/sebastian/comparator/LICENSE index a453252d..c5268a91 100644 --- a/vendor/sebastian/comparator/LICENSE +++ b/vendor/sebastian/comparator/LICENSE @@ -1,6 +1,6 @@ BSD 3-Clause License -Copyright (c) 2002-2023, Sebastian Bergmann +Copyright (c) 2002-2025, Sebastian Bergmann All rights reserved. Redistribution and use in source and binary forms, with or without diff --git a/vendor/sebastian/comparator/SECURITY.md b/vendor/sebastian/comparator/SECURITY.md index d4ee967b..d88ff001 100644 --- a/vendor/sebastian/comparator/SECURITY.md +++ b/vendor/sebastian/comparator/SECURITY.md @@ -1,9 +1,30 @@ # Security Policy -This library is intended to be used in development environments only. For instance, it is used by the testing framework PHPUnit. There is no reason why this library should be installed on a webserver. +If you believe you have found a security vulnerability in the library that is developed in this repository, please report it to us through coordinated disclosure. -**If you upload this library to a webserver then your deployment process is broken. On a more general note, if your `vendor` directory is publicly accessible on your webserver then your deployment process is also broken.** +**Please do not report security vulnerabilities through public GitHub issues, discussions, or pull requests.** -## Security Contact Information +Instead, please email `sebastian@phpunit.de`. + +Please include as much of the information listed below as you can to help us better understand and resolve the issue: + +* The type of issue +* Full paths of source file(s) related to the manifestation of the issue +* The location of the affected source code (tag/branch/commit or direct URL) +* Any special configuration required to reproduce the issue +* Step-by-step instructions to reproduce the issue +* Proof-of-concept or exploit code (if possible) +* Impact of the issue, including how an attacker might exploit the issue + +This information will help us triage your report more quickly. + +## Web Context + +The library that is developed in this repository was either extracted from [PHPUnit](https://github.com/sebastianbergmann/phpunit) or developed specifically as a dependency for PHPUnit. + +The library is developed with a focus on development environments and the command-line. No specific testing or hardening with regard to using the library in an HTTP or web context or with untrusted input data is performed. The library might also contain functionality that intentionally exposes internal application data for debugging purposes. + +If the library is used in a web application, the application developer is responsible for filtering inputs or escaping outputs as necessary and for verifying that the used functionality is safe for use within the intended context. + +Vulnerabilities specific to the use outside a development context will be fixed as applicable, provided that the fix does not have an averse effect on the primary use case for development purposes. -After the above, if you still would like to report a security vulnerability, please email `sebastian@phpunit.de`. diff --git a/vendor/sebastian/comparator/composer.json b/vendor/sebastian/comparator/composer.json index 03c8aed8..16bf5255 100644 --- a/vendor/sebastian/comparator/composer.json +++ b/vendor/sebastian/comparator/composer.json @@ -22,6 +22,10 @@ "email": "bschussek@2bepublished.at" } ], + "support": { + "issues": "https://github.com/sebastianbergmann/comparator/issues", + "security": "https://github.com/sebastianbergmann/comparator/security/policy" + }, "prefer-stable": true, "require": { "php": ">=8.1", @@ -31,7 +35,7 @@ "ext-mbstring": "*" }, "require-dev": { - "phpunit/phpunit": "^10.0" + "phpunit/phpunit": "^10.5" }, "config": { "platform": { diff --git a/vendor/sebastian/comparator/src/ArrayComparator.php b/vendor/sebastian/comparator/src/ArrayComparator.php index 07eba9d3..75508327 100644 --- a/vendor/sebastian/comparator/src/ArrayComparator.php +++ b/vendor/sebastian/comparator/src/ArrayComparator.php @@ -56,7 +56,7 @@ class ArrayComparator extends Comparator $expectedAsString .= sprintf( " %s => %s\n", $exporter->export($key), - $exporter->shortenedExport($value) + $exporter->shortenedExport($value), ); $equal = false; @@ -71,25 +71,25 @@ class ArrayComparator extends Comparator $expectedAsString .= sprintf( " %s => %s\n", $exporter->export($key), - $exporter->shortenedExport($value) + $exporter->shortenedExport($value), ); $actualAsString .= sprintf( " %s => %s\n", $exporter->export($key), - $exporter->shortenedExport($actual[$key]) + $exporter->shortenedExport($actual[$key]), ); } catch (ComparisonFailure $e) { $expectedAsString .= sprintf( " %s => %s\n", $exporter->export($key), - $e->getExpectedAsString() ? $this->indent($e->getExpectedAsString()) : $exporter->shortenedExport($e->getExpected()) + $e->getExpectedAsString() ? $this->indent($e->getExpectedAsString()) : $exporter->shortenedExport($e->getExpected()), ); $actualAsString .= sprintf( " %s => %s\n", $exporter->export($key), - $e->getActualAsString() ? $this->indent($e->getActualAsString()) : $exporter->shortenedExport($e->getActual()) + $e->getActualAsString() ? $this->indent($e->getActualAsString()) : $exporter->shortenedExport($e->getActual()), ); $equal = false; @@ -100,7 +100,7 @@ class ArrayComparator extends Comparator $actualAsString .= sprintf( " %s => %s\n", $exporter->export($key), - $exporter->shortenedExport($value) + $exporter->shortenedExport($value), ); $equal = false; @@ -115,7 +115,7 @@ class ArrayComparator extends Comparator $actual, $expectedAsString, $actualAsString, - 'Failed asserting that two arrays are equal.' + 'Failed asserting that two arrays are equal.', ); } } diff --git a/vendor/sebastian/comparator/src/DOMNodeComparator.php b/vendor/sebastian/comparator/src/DOMNodeComparator.php index b57aef1d..e78a401f 100644 --- a/vendor/sebastian/comparator/src/DOMNodeComparator.php +++ b/vendor/sebastian/comparator/src/DOMNodeComparator.php @@ -42,7 +42,7 @@ final class DOMNodeComparator extends ObjectComparator $actual, $expectedAsString, $actualAsString, - sprintf("Failed asserting that two DOM %s are equal.\n", $type) + sprintf("Failed asserting that two DOM %s are equal.\n", $type), ); } } diff --git a/vendor/sebastian/comparator/src/DateTimeComparator.php b/vendor/sebastian/comparator/src/DateTimeComparator.php index b32c0af2..16792d77 100644 --- a/vendor/sebastian/comparator/src/DateTimeComparator.php +++ b/vendor/sebastian/comparator/src/DateTimeComparator.php @@ -54,7 +54,7 @@ final class DateTimeComparator extends ObjectComparator $actual, $this->dateTimeToString($expected), $this->dateTimeToString($actual), - 'Failed asserting that two DateTime objects are equal.' + 'Failed asserting that two DateTime objects are equal.', ); } } diff --git a/vendor/sebastian/comparator/src/ExceptionComparator.php b/vendor/sebastian/comparator/src/ExceptionComparator.php index 1c41c0a7..b44dd816 100644 --- a/vendor/sebastian/comparator/src/ExceptionComparator.php +++ b/vendor/sebastian/comparator/src/ExceptionComparator.php @@ -17,12 +17,6 @@ use Exception; */ final class ExceptionComparator extends ObjectComparator { - /** - * Returns whether the comparator can compare two values. - * - * @param mixed $expected The first value to compare - * @param mixed $actual The second value to compare - */ public function accepts(mixed $expected, mixed $actual): bool { return $expected instanceof Exception && $actual instanceof Exception; @@ -39,7 +33,7 @@ final class ExceptionComparator extends ObjectComparator $array['line'], $array['trace'], $array['string'], - $array['xdebug_message'] + $array['xdebug_message'], ); return $array; diff --git a/vendor/sebastian/comparator/src/MockObjectComparator.php b/vendor/sebastian/comparator/src/MockObjectComparator.php index ff73f198..67d5ade0 100644 --- a/vendor/sebastian/comparator/src/MockObjectComparator.php +++ b/vendor/sebastian/comparator/src/MockObjectComparator.php @@ -9,32 +9,34 @@ */ namespace SebastianBergmann\Comparator; +use function array_keys; use function assert; -use PHPUnit\Framework\MockObject\MockObject; +use function str_starts_with; +use PHPUnit\Framework\MockObject\Stub; /** * Compares PHPUnit\Framework\MockObject\MockObject instances for equality. */ final class MockObjectComparator extends ObjectComparator { - /** - * Returns whether the comparator can compare two values. - * - * @param mixed $expected The first value to compare - * @param mixed $actual The second value to compare - */ public function accepts(mixed $expected, mixed $actual): bool { - return $expected instanceof MockObject && $actual instanceof MockObject; + return $expected instanceof Stub && $actual instanceof Stub; } protected function toArray(object $object): array { - assert($object instanceof MockObject); + assert($object instanceof Stub); $array = parent::toArray($object); - unset($array['__phpunit_invocationMocker']); + foreach (array_keys($array) as $key) { + if (!str_starts_with($key, '__phpunit_')) { + continue; + } + + unset($array[$key]); + } return $array; } diff --git a/vendor/sebastian/comparator/src/NumericComparator.php b/vendor/sebastian/comparator/src/NumericComparator.php index 576c839d..3d783edb 100644 --- a/vendor/sebastian/comparator/src/NumericComparator.php +++ b/vendor/sebastian/comparator/src/NumericComparator.php @@ -49,8 +49,8 @@ final class NumericComparator extends ScalarComparator sprintf( 'Failed asserting that %s matches expected %s.', $exporter->export($actual), - $exporter->export($expected) - ) + $exporter->export($expected), + ), ); } } diff --git a/vendor/sebastian/comparator/src/ObjectComparator.php b/vendor/sebastian/comparator/src/ObjectComparator.php index 09fc78db..95f97ed1 100644 --- a/vendor/sebastian/comparator/src/ObjectComparator.php +++ b/vendor/sebastian/comparator/src/ObjectComparator.php @@ -42,8 +42,8 @@ class ObjectComparator extends ArrayComparator sprintf( '%s is not instance of expected class "%s".', $exporter->export($actual), - $expected::class - ) + $expected::class, + ), ); } @@ -66,7 +66,7 @@ class ObjectComparator extends ArrayComparator $delta, $canonicalize, $ignoreCase, - $processed + $processed, ); } catch (ComparisonFailure $e) { throw new ComparisonFailure( @@ -75,7 +75,7 @@ class ObjectComparator extends ArrayComparator // replace "Array" with "MyClass object" substr_replace($e->getExpectedAsString(), $expected::class . ' Object', 0, 5), substr_replace($e->getActualAsString(), $actual::class . ' Object', 0, 5), - 'Failed asserting that two objects are equal.' + 'Failed asserting that two objects are equal.', ); } } diff --git a/vendor/sebastian/comparator/src/ResourceComparator.php b/vendor/sebastian/comparator/src/ResourceComparator.php index 91440ced..16995623 100644 --- a/vendor/sebastian/comparator/src/ResourceComparator.php +++ b/vendor/sebastian/comparator/src/ResourceComparator.php @@ -35,7 +35,7 @@ final class ResourceComparator extends Comparator $expected, $actual, $exporter->export($expected), - $exporter->export($actual) + $exporter->export($actual), ); } } diff --git a/vendor/sebastian/comparator/src/ScalarComparator.php b/vendor/sebastian/comparator/src/ScalarComparator.php index 50a71ac1..68b924ca 100644 --- a/vendor/sebastian/comparator/src/ScalarComparator.php +++ b/vendor/sebastian/comparator/src/ScalarComparator.php @@ -44,8 +44,8 @@ class ScalarComparator extends Comparator // always compare as strings to avoid strange behaviour // otherwise 0 == 'Foobar' if ((is_string($expected) && !is_bool($actual)) || (is_string($actual) && !is_bool($expected))) { - $expectedToCompare = (string) $expectedToCompare; - $actualToCompare = (string) $actualToCompare; + $expectedToCompare = @(string) $expectedToCompare; + $actualToCompare = @(string) $actualToCompare; if ($ignoreCase) { $expectedToCompare = mb_strtolower($expectedToCompare, 'UTF-8'); @@ -59,7 +59,7 @@ class ScalarComparator extends Comparator $actual, $exporter->export($expected), $exporter->export($actual), - 'Failed asserting that two strings are equal.' + 'Failed asserting that two strings are equal.', ); } @@ -73,8 +73,8 @@ class ScalarComparator extends Comparator sprintf( 'Failed asserting that %s matches expected %s.', $exporter->export($actual), - $exporter->export($expected) - ) + $exporter->export($expected), + ), ); } } diff --git a/vendor/sebastian/comparator/src/SplObjectStorageComparator.php b/vendor/sebastian/comparator/src/SplObjectStorageComparator.php index 144622d6..ee37f4fb 100644 --- a/vendor/sebastian/comparator/src/SplObjectStorageComparator.php +++ b/vendor/sebastian/comparator/src/SplObjectStorageComparator.php @@ -31,25 +31,25 @@ final class SplObjectStorageComparator extends Comparator $exporter = new Exporter; foreach ($actual as $object) { - if (!$expected->contains($object)) { + if (!$expected->offsetExists($object)) { throw new ComparisonFailure( $expected, $actual, $exporter->export($expected), $exporter->export($actual), - 'Failed asserting that two objects are equal.' + 'Failed asserting that two objects are equal.', ); } } foreach ($expected as $object) { - if (!$actual->contains($object)) { + if (!$actual->offsetExists($object)) { throw new ComparisonFailure( $expected, $actual, $exporter->export($expected), $exporter->export($actual), - 'Failed asserting that two objects are equal.' + 'Failed asserting that two objects are equal.', ); } } diff --git a/vendor/sebastian/comparator/src/TypeComparator.php b/vendor/sebastian/comparator/src/TypeComparator.php index 8e9dfacc..67994e9f 100644 --- a/vendor/sebastian/comparator/src/TypeComparator.php +++ b/vendor/sebastian/comparator/src/TypeComparator.php @@ -35,8 +35,8 @@ final class TypeComparator extends Comparator sprintf( '%s does not match expected type "%s".', (new Exporter)->shortenedExport($actual), - gettype($expected) - ) + gettype($expected), + ), ); } } diff --git a/vendor/sebastian/complexity/ChangeLog.md b/vendor/sebastian/complexity/ChangeLog.md index 8040d9b8..eb168af7 100644 --- a/vendor/sebastian/complexity/ChangeLog.md +++ b/vendor/sebastian/complexity/ChangeLog.md @@ -2,6 +2,34 @@ All notable changes are documented in this file using the [Keep a CHANGELOG](https://keepachangelog.com/) principles. +## [3.2.0] - 2023-12-21 + +### Added + +* `ComplexityCollection::sortByDescendingCyclomaticComplexity()` + +### Changed + +* This component is now compatible with `nikic/php-parser` 5.0 + +## [3.1.0] - 2023-09-28 + +### Added + +* `Complexity::isFunction()` and `Complexity::isMethod()` +* `ComplexityCollection::isFunction()` and `ComplexityCollection::isMethod()` +* `ComplexityCollection::mergeWith()` + +### Fixed + +* Anonymous classes are not processed correctly + +## [3.0.1] - 2023-08-31 + +### Fixed + +* [#7](https://github.com/sebastianbergmann/complexity/pull/7): `ComplexityCalculatingVisitor` tries to process interface methods + ## [3.0.0] - 2023-02-03 ### Removed @@ -30,6 +58,9 @@ All notable changes are documented in this file using the [Keep a CHANGELOG](htt * Initial release +[3.2.0]: https://github.com/sebastianbergmann/complexity/compare/3.1.0...3.2.0 +[3.1.0]: https://github.com/sebastianbergmann/complexity/compare/3.0.1...3.1.0 +[3.0.1]: https://github.com/sebastianbergmann/complexity/compare/3.0.0...3.0.1 [3.0.0]: https://github.com/sebastianbergmann/complexity/compare/2.0.2...3.0.0 [2.0.2]: https://github.com/sebastianbergmann/complexity/compare/2.0.1...2.0.2 [2.0.1]: https://github.com/sebastianbergmann/complexity/compare/2.0.0...2.0.1 diff --git a/vendor/sebastian/complexity/SECURITY.md b/vendor/sebastian/complexity/SECURITY.md index d4ee967b..d88ff001 100644 --- a/vendor/sebastian/complexity/SECURITY.md +++ b/vendor/sebastian/complexity/SECURITY.md @@ -1,9 +1,30 @@ # Security Policy -This library is intended to be used in development environments only. For instance, it is used by the testing framework PHPUnit. There is no reason why this library should be installed on a webserver. +If you believe you have found a security vulnerability in the library that is developed in this repository, please report it to us through coordinated disclosure. -**If you upload this library to a webserver then your deployment process is broken. On a more general note, if your `vendor` directory is publicly accessible on your webserver then your deployment process is also broken.** +**Please do not report security vulnerabilities through public GitHub issues, discussions, or pull requests.** -## Security Contact Information +Instead, please email `sebastian@phpunit.de`. + +Please include as much of the information listed below as you can to help us better understand and resolve the issue: + +* The type of issue +* Full paths of source file(s) related to the manifestation of the issue +* The location of the affected source code (tag/branch/commit or direct URL) +* Any special configuration required to reproduce the issue +* Step-by-step instructions to reproduce the issue +* Proof-of-concept or exploit code (if possible) +* Impact of the issue, including how an attacker might exploit the issue + +This information will help us triage your report more quickly. + +## Web Context + +The library that is developed in this repository was either extracted from [PHPUnit](https://github.com/sebastianbergmann/phpunit) or developed specifically as a dependency for PHPUnit. + +The library is developed with a focus on development environments and the command-line. No specific testing or hardening with regard to using the library in an HTTP or web context or with untrusted input data is performed. The library might also contain functionality that intentionally exposes internal application data for debugging purposes. + +If the library is used in a web application, the application developer is responsible for filtering inputs or escaping outputs as necessary and for verifying that the used functionality is safe for use within the intended context. + +Vulnerabilities specific to the use outside a development context will be fixed as applicable, provided that the fix does not have an averse effect on the primary use case for development purposes. -After the above, if you still would like to report a security vulnerability, please email `sebastian@phpunit.de`. diff --git a/vendor/sebastian/complexity/composer.json b/vendor/sebastian/complexity/composer.json index 5432125f..77001bb2 100644 --- a/vendor/sebastian/complexity/composer.json +++ b/vendor/sebastian/complexity/composer.json @@ -12,12 +12,13 @@ } ], "support": { - "issues": "https://github.com/sebastianbergmann/complexity/issues" + "issues": "https://github.com/sebastianbergmann/complexity/issues", + "security": "https://github.com/sebastianbergmann/complexity/security/policy" }, "prefer-stable": true, "require": { "php": ">=8.1", - "nikic/php-parser": "^4.10" + "nikic/php-parser": "^4.18 || ^5.0" }, "require-dev": { "phpunit/phpunit": "^10.0" @@ -36,7 +37,7 @@ }, "extra": { "branch-alias": { - "dev-main": "3.0-dev" + "dev-main": "3.2-dev" } } } diff --git a/vendor/sebastian/complexity/src/Calculator.php b/vendor/sebastian/complexity/src/Calculator.php index 9c945aae..18580bdb 100644 --- a/vendor/sebastian/complexity/src/Calculator.php +++ b/vendor/sebastian/complexity/src/Calculator.php @@ -12,12 +12,10 @@ namespace SebastianBergmann\Complexity; use function assert; use function file_get_contents; use PhpParser\Error; -use PhpParser\Lexer; use PhpParser\Node; use PhpParser\NodeTraverser; use PhpParser\NodeVisitor\NameResolver; use PhpParser\NodeVisitor\ParentConnectingVisitor; -use PhpParser\Parser; use PhpParser\ParserFactory; final class Calculator @@ -36,7 +34,7 @@ final class Calculator public function calculateForSourceString(string $source): ComplexityCollection { try { - $nodes = $this->parser()->parse($source); + $nodes = (new ParserFactory)->createForHostVersion()->parse($source); assert($nodes !== null); @@ -47,7 +45,7 @@ final class Calculator throw new RuntimeException( $error->getMessage(), $error->getCode(), - $error + $error, ); } // @codeCoverageIgnoreEnd @@ -75,16 +73,11 @@ final class Calculator throw new RuntimeException( $error->getMessage(), $error->getCode(), - $error + $error, ); } // @codeCoverageIgnoreEnd return $complexityCalculatingVisitor->result(); } - - private function parser(): Parser - { - return (new ParserFactory)->create(ParserFactory::PREFER_PHP7, new Lexer); - } } diff --git a/vendor/sebastian/complexity/src/Complexity/Complexity.php b/vendor/sebastian/complexity/src/Complexity/Complexity.php index 5608a7e1..5203454b 100644 --- a/vendor/sebastian/complexity/src/Complexity/Complexity.php +++ b/vendor/sebastian/complexity/src/Complexity/Complexity.php @@ -9,27 +9,56 @@ */ namespace SebastianBergmann\Complexity; +use function str_contains; + /** * @psalm-immutable */ final class Complexity { - private string $name; + /** + * @psalm-var non-empty-string + */ + private readonly string $name; + + /** + * @psalm-var positive-int + */ private int $cyclomaticComplexity; + /** + * @psalm-param non-empty-string $name + * @psalm-param positive-int $cyclomaticComplexity + */ public function __construct(string $name, int $cyclomaticComplexity) { $this->name = $name; $this->cyclomaticComplexity = $cyclomaticComplexity; } + /** + * @psalm-return non-empty-string + */ public function name(): string { return $this->name; } + /** + * @psalm-return positive-int + */ public function cyclomaticComplexity(): int { return $this->cyclomaticComplexity; } + + public function isFunction(): bool + { + return !$this->isMethod(); + } + + public function isMethod(): bool + { + return str_contains($this->name, '::'); + } } diff --git a/vendor/sebastian/complexity/src/Complexity/ComplexityCollection.php b/vendor/sebastian/complexity/src/Complexity/ComplexityCollection.php index 2f782792..0f851c2a 100644 --- a/vendor/sebastian/complexity/src/Complexity/ComplexityCollection.php +++ b/vendor/sebastian/complexity/src/Complexity/ComplexityCollection.php @@ -9,7 +9,12 @@ */ namespace SebastianBergmann\Complexity; +use function array_filter; +use function array_merge; +use function array_reverse; +use function array_values; use function count; +use function usort; use Countable; use IteratorAggregate; @@ -21,7 +26,7 @@ final class ComplexityCollection implements Countable, IteratorAggregate /** * @psalm-var list */ - private array $items; + private readonly array $items; public static function fromList(Complexity ...$items): self { @@ -49,6 +54,9 @@ final class ComplexityCollection implements Countable, IteratorAggregate return new ComplexityCollectionIterator($this); } + /** + * @psalm-return non-negative-int + */ public function count(): int { return count($this->items); @@ -59,6 +67,9 @@ final class ComplexityCollection implements Countable, IteratorAggregate return empty($this->items); } + /** + * @psalm-return non-negative-int + */ public function cyclomaticComplexity(): int { $cyclomaticComplexity = 0; @@ -69,4 +80,53 @@ final class ComplexityCollection implements Countable, IteratorAggregate return $cyclomaticComplexity; } + + public function isFunction(): self + { + return new self( + array_values( + array_filter( + $this->items, + static fn (Complexity $complexity): bool => $complexity->isFunction(), + ), + ), + ); + } + + public function isMethod(): self + { + return new self( + array_values( + array_filter( + $this->items, + static fn (Complexity $complexity): bool => $complexity->isMethod(), + ), + ), + ); + } + + public function mergeWith(self $other): self + { + return new self( + array_merge( + $this->asArray(), + $other->asArray(), + ), + ); + } + + public function sortByDescendingCyclomaticComplexity(): self + { + $items = $this->items; + + usort( + $items, + static function (Complexity $a, Complexity $b): int + { + return $a->cyclomaticComplexity() <=> $b->cyclomaticComplexity(); + }, + ); + + return new self(array_reverse($items)); + } } diff --git a/vendor/sebastian/complexity/src/Complexity/ComplexityCollectionIterator.php b/vendor/sebastian/complexity/src/Complexity/ComplexityCollectionIterator.php index 3e1ecfd7..c3ac6908 100644 --- a/vendor/sebastian/complexity/src/Complexity/ComplexityCollectionIterator.php +++ b/vendor/sebastian/complexity/src/Complexity/ComplexityCollectionIterator.php @@ -16,7 +16,7 @@ final class ComplexityCollectionIterator implements Iterator /** * @psalm-var list */ - private array $items; + private readonly array $items; private int $position = 0; public function __construct(ComplexityCollection $items) diff --git a/vendor/sebastian/complexity/src/Visitor/ComplexityCalculatingVisitor.php b/vendor/sebastian/complexity/src/Visitor/ComplexityCalculatingVisitor.php index 8e543778..0314bf1d 100644 --- a/vendor/sebastian/complexity/src/Visitor/ComplexityCalculatingVisitor.php +++ b/vendor/sebastian/complexity/src/Visitor/ComplexityCalculatingVisitor.php @@ -12,11 +12,13 @@ namespace SebastianBergmann\Complexity; use function assert; use function is_array; use PhpParser\Node; +use PhpParser\Node\Expr\New_; use PhpParser\Node\Name; use PhpParser\Node\Stmt; use PhpParser\Node\Stmt\Class_; use PhpParser\Node\Stmt\ClassMethod; use PhpParser\Node\Stmt\Function_; +use PhpParser\Node\Stmt\Interface_; use PhpParser\Node\Stmt\Trait_; use PhpParser\NodeTraverser; use PhpParser\NodeVisitorAbstract; @@ -41,6 +43,14 @@ final class ComplexityCalculatingVisitor extends NodeVisitorAbstract } if ($node instanceof ClassMethod) { + if ($node->getAttribute('parent') instanceof Interface_) { + return null; + } + + if ($node->isAbstract()) { + return null; + } + $name = $this->classMethodName($node); } else { $name = $this->functionName($node); @@ -52,7 +62,7 @@ final class ComplexityCalculatingVisitor extends NodeVisitorAbstract $this->result[] = new Complexity( $name, - $this->cyclomaticComplexity($statements) + $this->cyclomaticComplexity($statements), ); if ($this->shortCircuitTraversal) { @@ -69,6 +79,8 @@ final class ComplexityCalculatingVisitor extends NodeVisitorAbstract /** * @param Stmt[] $statements + * + * @psalm-return positive-int */ private function cyclomaticComplexity(array $statements): int { @@ -84,22 +96,37 @@ final class ComplexityCalculatingVisitor extends NodeVisitorAbstract return $cyclomaticComplexityCalculatingVisitor->cyclomaticComplexity(); } + /** + * @psalm-return non-empty-string + */ private function classMethodName(ClassMethod $node): string { $parent = $node->getAttribute('parent'); assert($parent instanceof Class_ || $parent instanceof Trait_); + + if ($parent->getAttribute('parent') instanceof New_) { + return 'anonymous class'; + } + assert(isset($parent->namespacedName)); assert($parent->namespacedName instanceof Name); return $parent->namespacedName->toString() . '::' . $node->name->toString(); } + /** + * @psalm-return non-empty-string + */ private function functionName(Function_ $node): string { assert(isset($node->namespacedName)); assert($node->namespacedName instanceof Name); - return $node->namespacedName->toString(); + $functionName = $node->namespacedName->toString(); + + assert($functionName !== ''); + + return $functionName; } } diff --git a/vendor/sebastian/complexity/src/Visitor/CyclomaticComplexityCalculatingVisitor.php b/vendor/sebastian/complexity/src/Visitor/CyclomaticComplexityCalculatingVisitor.php index 8edd1eec..551ed1a0 100644 --- a/vendor/sebastian/complexity/src/Visitor/CyclomaticComplexityCalculatingVisitor.php +++ b/vendor/sebastian/complexity/src/Visitor/CyclomaticComplexityCalculatingVisitor.php @@ -26,6 +26,9 @@ use PhpParser\NodeVisitorAbstract; final class CyclomaticComplexityCalculatingVisitor extends NodeVisitorAbstract { + /** + * @psalm-var positive-int + */ private int $cyclomaticComplexity = 1; public function enterNode(Node $node): void @@ -47,6 +50,9 @@ final class CyclomaticComplexityCalculatingVisitor extends NodeVisitorAbstract } } + /** + * @psalm-return positive-int + */ public function cyclomaticComplexity(): int { return $this->cyclomaticComplexity; diff --git a/vendor/sebastian/diff/ChangeLog.md b/vendor/sebastian/diff/ChangeLog.md index 7db073c7..10c54529 100644 --- a/vendor/sebastian/diff/ChangeLog.md +++ b/vendor/sebastian/diff/ChangeLog.md @@ -2,7 +2,51 @@ All notable changes are documented in this file using the [Keep a CHANGELOG](http://keepachangelog.com/) principles. -## [5.0.0] - 2022-02-03 +## [5.1.1] - 2024-03-02 + +### Changed + +* Do not use implicitly nullable parameters + +## [5.1.0] - 2023-12-22 + +### Added + +* `SebastianBergmann\Diff\Chunk::start()`, `SebastianBergmann\Diff\Chunk::startRange()`, `SebastianBergmann\Diff\Chunk::end()`, `SebastianBergmann\Diff\Chunk::endRange()`, and `SebastianBergmann\Diff\Chunk::lines()` +* `SebastianBergmann\Diff\Diff::from()`, `SebastianBergmann\Diff\Diff::to()`, and `SebastianBergmann\Diff\Diff::chunks()` +* `SebastianBergmann\Diff\Line::content()` and `SebastianBergmann\Diff\Diff::type()` +* `SebastianBergmann\Diff\Line::isAdded()`,`SebastianBergmann\Diff\Line::isRemoved()`, and `SebastianBergmann\Diff\Line::isUnchanged()` + +### Changed + +* `SebastianBergmann\Diff\Diff` now implements `IteratorAggregate`, iterating over it yields the aggregated `SebastianBergmann\Diff\Chunk` objects +* `SebastianBergmann\Diff\Chunk` now implements `IteratorAggregate`, iterating over it yields the aggregated `SebastianBergmann\Diff\Line` objects + +### Deprecated + +* `SebastianBergmann\Diff\Chunk::getStart()`, `SebastianBergmann\Diff\Chunk::getStartRange()`, `SebastianBergmann\Diff\Chunk::getEnd()`, `SebastianBergmann\Diff\Chunk::getEndRange()`, and `SebastianBergmann\Diff\Chunk::getLines()` +* `SebastianBergmann\Diff\Diff::getFrom()`, `SebastianBergmann\Diff\Diff::getTo()`, and `SebastianBergmann\Diff\Diff::getChunks()` +* `SebastianBergmann\Diff\Line::getContent()` and `SebastianBergmann\Diff\Diff::getType()` + +## [5.0.3] - 2023-05-01 + +### Changed + +* [#119](https://github.com/sebastianbergmann/diff/pull/119): Improve performance of `TimeEfficientLongestCommonSubsequenceCalculator` + +## [5.0.2] - 2023-05-01 + +### Changed + +* [#118](https://github.com/sebastianbergmann/diff/pull/118): Improve performance of `MemoryEfficientLongestCommonSubsequenceCalculator` + +## [5.0.1] - 2023-03-23 + +### Fixed + +* [#115](https://github.com/sebastianbergmann/diff/pull/115): `Parser::parseFileDiff()` does not handle diffs correctly that only add lines or only remove lines + +## [5.0.0] - 2023-02-03 ### Changed @@ -86,6 +130,11 @@ All notable changes are documented in this file using the [Keep a CHANGELOG](htt * This component is no longer supported on PHP 5.6 +[5.1.1]: https://github.com/sebastianbergmann/diff/compare/5.1.0...5.1.1 +[5.1.0]: https://github.com/sebastianbergmann/diff/compare/5.0.3...5.1.0 +[5.0.3]: https://github.com/sebastianbergmann/diff/compare/5.0.2...5.0.3 +[5.0.2]: https://github.com/sebastianbergmann/diff/compare/5.0.1...5.0.2 +[5.0.1]: https://github.com/sebastianbergmann/diff/compare/5.0.0...5.0.1 [5.0.0]: https://github.com/sebastianbergmann/diff/compare/4.0.4...5.0.0 [4.0.4]: https://github.com/sebastianbergmann/diff/compare/4.0.3...4.0.4 [4.0.3]: https://github.com/sebastianbergmann/diff/compare/4.0.2...4.0.3 diff --git a/vendor/sebastian/diff/LICENSE b/vendor/sebastian/diff/LICENSE index a453252d..5b4705a4 100644 --- a/vendor/sebastian/diff/LICENSE +++ b/vendor/sebastian/diff/LICENSE @@ -1,6 +1,6 @@ BSD 3-Clause License -Copyright (c) 2002-2023, Sebastian Bergmann +Copyright (c) 2002-2024, Sebastian Bergmann All rights reserved. Redistribution and use in source and binary forms, with or without diff --git a/vendor/sebastian/diff/README.md b/vendor/sebastian/diff/README.md index 3e84a35b..539dc59e 100644 --- a/vendor/sebastian/diff/README.md +++ b/vendor/sebastian/diff/README.md @@ -202,3 +202,5 @@ The code above yields the output below: ) ) ) + +Note: If the chunk size is 0 lines, i.e., `getStartRange()` or `getEndRange()` return 0, the number of line returned by `getStart()` or `getEnd()` is one lower than one would expect. It is the line number after which the chunk should be inserted or deleted; in all other cases, it gives the first line number of the replaced range of lines. diff --git a/vendor/sebastian/diff/SECURITY.md b/vendor/sebastian/diff/SECURITY.md index d4ee967b..d88ff001 100644 --- a/vendor/sebastian/diff/SECURITY.md +++ b/vendor/sebastian/diff/SECURITY.md @@ -1,9 +1,30 @@ # Security Policy -This library is intended to be used in development environments only. For instance, it is used by the testing framework PHPUnit. There is no reason why this library should be installed on a webserver. +If you believe you have found a security vulnerability in the library that is developed in this repository, please report it to us through coordinated disclosure. -**If you upload this library to a webserver then your deployment process is broken. On a more general note, if your `vendor` directory is publicly accessible on your webserver then your deployment process is also broken.** +**Please do not report security vulnerabilities through public GitHub issues, discussions, or pull requests.** -## Security Contact Information +Instead, please email `sebastian@phpunit.de`. + +Please include as much of the information listed below as you can to help us better understand and resolve the issue: + +* The type of issue +* Full paths of source file(s) related to the manifestation of the issue +* The location of the affected source code (tag/branch/commit or direct URL) +* Any special configuration required to reproduce the issue +* Step-by-step instructions to reproduce the issue +* Proof-of-concept or exploit code (if possible) +* Impact of the issue, including how an attacker might exploit the issue + +This information will help us triage your report more quickly. + +## Web Context + +The library that is developed in this repository was either extracted from [PHPUnit](https://github.com/sebastianbergmann/phpunit) or developed specifically as a dependency for PHPUnit. + +The library is developed with a focus on development environments and the command-line. No specific testing or hardening with regard to using the library in an HTTP or web context or with untrusted input data is performed. The library might also contain functionality that intentionally exposes internal application data for debugging purposes. + +If the library is used in a web application, the application developer is responsible for filtering inputs or escaping outputs as necessary and for verifying that the used functionality is safe for use within the intended context. + +Vulnerabilities specific to the use outside a development context will be fixed as applicable, provided that the fix does not have an averse effect on the primary use case for development purposes. -After the above, if you still would like to report a security vulnerability, please email `sebastian@phpunit.de`. diff --git a/vendor/sebastian/diff/composer.json b/vendor/sebastian/diff/composer.json index b8e778b5..c6ebec9c 100644 --- a/vendor/sebastian/diff/composer.json +++ b/vendor/sebastian/diff/composer.json @@ -14,6 +14,10 @@ "email": "mail@kore-nordmann.de" } ], + "support": { + "issues": "https://github.com/sebastianbergmann/diff/issues", + "security": "https://github.com/sebastianbergmann/diff/security/policy" + }, "prefer-stable": true, "config": { "platform": { @@ -27,7 +31,7 @@ }, "require-dev": { "phpunit/phpunit": "^10.0", - "symfony/process": "^4.2 || ^5" + "symfony/process": "^6.4" }, "autoload": { "classmap": [ @@ -41,7 +45,7 @@ }, "extra": { "branch-alias": { - "dev-main": "5.0-dev" + "dev-main": "5.1-dev" } } } diff --git a/vendor/sebastian/diff/src/Chunk.php b/vendor/sebastian/diff/src/Chunk.php index cdfdf00b..a9568545 100644 --- a/vendor/sebastian/diff/src/Chunk.php +++ b/vendor/sebastian/diff/src/Chunk.php @@ -9,7 +9,14 @@ */ namespace SebastianBergmann\Diff; -final class Chunk +use ArrayIterator; +use IteratorAggregate; +use Traversable; + +/** + * @template-implements IteratorAggregate + */ +final class Chunk implements IteratorAggregate { private int $start; private int $startRange; @@ -26,22 +33,22 @@ final class Chunk $this->lines = $lines; } - public function getStart(): int + public function start(): int { return $this->start; } - public function getStartRange(): int + public function startRange(): int { return $this->startRange; } - public function getEnd(): int + public function end(): int { return $this->end; } - public function getEndRange(): int + public function endRange(): int { return $this->endRange; } @@ -49,7 +56,7 @@ final class Chunk /** * @psalm-return list */ - public function getLines(): array + public function lines(): array { return $this->lines; } @@ -67,4 +74,51 @@ final class Chunk $this->lines = $lines; } + + /** + * @deprecated Use start() instead + */ + public function getStart(): int + { + return $this->start; + } + + /** + * @deprecated Use startRange() instead + */ + public function getStartRange(): int + { + return $this->startRange; + } + + /** + * @deprecated Use end() instead + */ + public function getEnd(): int + { + return $this->end; + } + + /** + * @deprecated Use endRange() instead + */ + public function getEndRange(): int + { + return $this->endRange; + } + + /** + * @psalm-return list + * + * @deprecated Use lines() instead + */ + public function getLines(): array + { + return $this->lines; + } + + public function getIterator(): Traversable + { + return new ArrayIterator($this->lines); + } } diff --git a/vendor/sebastian/diff/src/Diff.php b/vendor/sebastian/diff/src/Diff.php index 3376b723..5dc8dd08 100644 --- a/vendor/sebastian/diff/src/Diff.php +++ b/vendor/sebastian/diff/src/Diff.php @@ -9,9 +9,23 @@ */ namespace SebastianBergmann\Diff; -final class Diff +use ArrayIterator; +use IteratorAggregate; +use Traversable; + +/** + * @template-implements IteratorAggregate + */ +final class Diff implements IteratorAggregate { + /** + * @psalm-var non-empty-string + */ private string $from; + + /** + * @psalm-var non-empty-string + */ private string $to; /** @@ -20,6 +34,8 @@ final class Diff private array $chunks; /** + * @psalm-param non-empty-string $from + * @psalm-param non-empty-string $to * @psalm-param list $chunks */ public function __construct(string $from, string $to, array $chunks = []) @@ -29,12 +45,18 @@ final class Diff $this->chunks = $chunks; } - public function getFrom(): string + /** + * @psalm-return non-empty-string + */ + public function from(): string { return $this->from; } - public function getTo(): string + /** + * @psalm-return non-empty-string + */ + public function to(): string { return $this->to; } @@ -42,7 +64,7 @@ final class Diff /** * @psalm-return list */ - public function getChunks(): array + public function chunks(): array { return $this->chunks; } @@ -54,4 +76,39 @@ final class Diff { $this->chunks = $chunks; } + + /** + * @psalm-return non-empty-string + * + * @deprecated + */ + public function getFrom(): string + { + return $this->from; + } + + /** + * @psalm-return non-empty-string + * + * @deprecated + */ + public function getTo(): string + { + return $this->to; + } + + /** + * @psalm-return list + * + * @deprecated + */ + public function getChunks(): array + { + return $this->chunks; + } + + public function getIterator(): Traversable + { + return new ArrayIterator($this->chunks); + } } diff --git a/vendor/sebastian/diff/src/Differ.php b/vendor/sebastian/diff/src/Differ.php index edf2dcc4..801fe02a 100644 --- a/vendor/sebastian/diff/src/Differ.php +++ b/vendor/sebastian/diff/src/Differ.php @@ -30,14 +30,10 @@ use SebastianBergmann\Diff\Output\DiffOutputBuilderInterface; final class Differ { - public const OLD = 0; - - public const ADDED = 1; - - public const REMOVED = 2; - - public const DIFF_LINE_END_WARNING = 3; - + public const OLD = 0; + public const ADDED = 1; + public const REMOVED = 2; + public const DIFF_LINE_END_WARNING = 3; public const NO_LINE_END_EOF_WARNING = 4; private DiffOutputBuilderInterface $outputBuilder; @@ -46,14 +42,14 @@ final class Differ $this->outputBuilder = $outputBuilder; } - public function diff(array|string $from, array|string $to, LongestCommonSubsequenceCalculator $lcs = null): string + public function diff(array|string $from, array|string $to, ?LongestCommonSubsequenceCalculator $lcs = null): string { $diff = $this->diffToArray($from, $to, $lcs); return $this->outputBuilder->getDiff($diff); } - public function diffToArray(array|string $from, array|string $to, LongestCommonSubsequenceCalculator $lcs = null): array + public function diffToArray(array|string $from, array|string $to, ?LongestCommonSubsequenceCalculator $lcs = null): array { if (is_string($from)) { $from = $this->splitStringByLines($from); diff --git a/vendor/sebastian/diff/src/Exception/ConfigurationException.php b/vendor/sebastian/diff/src/Exception/ConfigurationException.php index 85f066c2..b2abf0cb 100644 --- a/vendor/sebastian/diff/src/Exception/ConfigurationException.php +++ b/vendor/sebastian/diff/src/Exception/ConfigurationException.php @@ -21,17 +21,17 @@ final class ConfigurationException extends InvalidArgumentException string $expected, $value, int $code = 0, - Exception $previous = null + ?Exception $previous = null ) { parent::__construct( sprintf( 'Option "%s" must be %s, got "%s".', $option, $expected, - is_object($value) ? $value::class : (null === $value ? '' : gettype($value) . '#' . $value) + is_object($value) ? $value::class : (null === $value ? '' : gettype($value) . '#' . $value), ), $code, - $previous + $previous, ); } } diff --git a/vendor/sebastian/diff/src/Line.php b/vendor/sebastian/diff/src/Line.php index ecb2f794..4e708abb 100644 --- a/vendor/sebastian/diff/src/Line.php +++ b/vendor/sebastian/diff/src/Line.php @@ -11,10 +11,8 @@ namespace SebastianBergmann\Diff; final class Line { - public const ADDED = 1; - - public const REMOVED = 2; - + public const ADDED = 1; + public const REMOVED = 2; public const UNCHANGED = 3; private int $type; private string $content; @@ -25,11 +23,42 @@ final class Line $this->content = $content; } + public function content(): string + { + return $this->content; + } + + public function type(): int + { + return $this->type; + } + + public function isAdded(): bool + { + return $this->type === self::ADDED; + } + + public function isRemoved(): bool + { + return $this->type === self::REMOVED; + } + + public function isUnchanged(): bool + { + return $this->type === self::UNCHANGED; + } + + /** + * @deprecated + */ public function getContent(): string { return $this->content; } + /** + * @deprecated + */ public function getType(): int { return $this->type; diff --git a/vendor/sebastian/diff/src/MemoryEfficientLongestCommonSubsequenceCalculator.php b/vendor/sebastian/diff/src/MemoryEfficientLongestCommonSubsequenceCalculator.php index dde08027..b9846c37 100644 --- a/vendor/sebastian/diff/src/MemoryEfficientLongestCommonSubsequenceCalculator.php +++ b/vendor/sebastian/diff/src/MemoryEfficientLongestCommonSubsequenceCalculator.php @@ -61,7 +61,7 @@ final class MemoryEfficientLongestCommonSubsequenceCalculator implements Longest return array_merge( $this->calculate($fromStart, $toStart), - $this->calculate($fromEnd, $toEnd) + $this->calculate($fromEnd, $toEnd), ); } @@ -78,7 +78,16 @@ final class MemoryEfficientLongestCommonSubsequenceCalculator implements Longest if ($from[$i] === $to[$j]) { $current[$j + 1] = $prev[$j] + 1; } else { - $current[$j + 1] = max($current[$j], $prev[$j + 1]); + /** + * @noinspection PhpConditionCanBeReplacedWithMinMaxCallInspection + * + * We do not use max() here to avoid the function call overhead + */ + if ($current[$j] > $prev[$j + 1]) { + $current[$j + 1] = $current[$j]; + } else { + $current[$j + 1] = $prev[$j + 1]; + } } } } diff --git a/vendor/sebastian/diff/src/Output/StrictUnifiedDiffOutputBuilder.php b/vendor/sebastian/diff/src/Output/StrictUnifiedDiffOutputBuilder.php index 3eb7428d..a2a73b67 100644 --- a/vendor/sebastian/diff/src/Output/StrictUnifiedDiffOutputBuilder.php +++ b/vendor/sebastian/diff/src/Output/StrictUnifiedDiffOutputBuilder.php @@ -82,7 +82,7 @@ final class StrictUnifiedDiffOutputBuilder implements DiffOutputBuilderInterface $options['fromFile'], null === $options['fromFileDate'] ? '' : "\t" . $options['fromFileDate'], $options['toFile'], - null === $options['toFileDate'] ? '' : "\t" . $options['toFileDate'] + null === $options['toFileDate'] ? '' : "\t" . $options['toFileDate'], ); $this->collapseRanges = $options['collapseRanges']; @@ -201,11 +201,11 @@ final class StrictUnifiedDiffOutputBuilder implements DiffOutputBuilderInterface $fromRange - $cutOff + $contextStartOffset + $this->contextLines, $toStart - $contextStartOffset, $toRange - $cutOff + $contextStartOffset + $this->contextLines, - $output + $output, ); $fromStart += $fromRange; - $toStart += $toRange; + $toStart += $toRange; $hunkCapture = false; $sameCount = $toRange = $fromRange = 0; @@ -251,7 +251,7 @@ final class StrictUnifiedDiffOutputBuilder implements DiffOutputBuilderInterface $contextEndOffset = min($sameCount, $this->contextLines); $fromRange -= $sameCount; - $toRange -= $sameCount; + $toRange -= $sameCount; $this->writeHunk( $diff, @@ -261,7 +261,7 @@ final class StrictUnifiedDiffOutputBuilder implements DiffOutputBuilderInterface $fromRange + $contextStartOffset + $contextEndOffset, $toStart - $contextStartOffset, $toRange + $contextStartOffset + $contextEndOffset, - $output + $output, ); } @@ -302,11 +302,11 @@ final class StrictUnifiedDiffOutputBuilder implements DiffOutputBuilderInterface $this->changed = true; fwrite($output, $diff[$i][0]); } - //} elseif ($diff[$i][1] === Differ::DIFF_LINE_END_WARNING) { // custom comment inserted by PHPUnit/diff package + // } elseif ($diff[$i][1] === Differ::DIFF_LINE_END_WARNING) { // custom comment inserted by PHPUnit/diff package // skip - //} else { + // } else { // unknown/invalid - //} + // } } } diff --git a/vendor/sebastian/diff/src/Output/UnifiedDiffOutputBuilder.php b/vendor/sebastian/diff/src/Output/UnifiedDiffOutputBuilder.php index 1483b3af..683ab1b6 100644 --- a/vendor/sebastian/diff/src/Output/UnifiedDiffOutputBuilder.php +++ b/vendor/sebastian/diff/src/Output/UnifiedDiffOutputBuilder.php @@ -18,7 +18,6 @@ use function max; use function min; use function str_ends_with; use function stream_get_contents; -use function strlen; use function substr; use SebastianBergmann\Diff\Differ; @@ -67,7 +66,7 @@ final class UnifiedDiffOutputBuilder extends AbstractChunkOutputBuilder // This might happen when both the `from` and `to` do not have a trailing linebreak $last = substr($diff, -1); - return 0 !== strlen($diff) && "\n" !== $last && "\r" !== $last + return '' !== $diff && "\n" !== $last && "\r" !== $last ? $diff . "\n" : $diff; } @@ -151,11 +150,11 @@ final class UnifiedDiffOutputBuilder extends AbstractChunkOutputBuilder $fromRange - $cutOff + $contextStartOffset + $this->contextLines, $toStart - $contextStartOffset, $toRange - $cutOff + $contextStartOffset + $this->contextLines, - $output + $output, ); $fromStart += $fromRange; - $toStart += $toRange; + $toStart += $toRange; $hunkCapture = false; $sameCount = $toRange = $fromRange = 0; @@ -199,7 +198,7 @@ final class UnifiedDiffOutputBuilder extends AbstractChunkOutputBuilder $contextEndOffset = min($sameCount, $this->contextLines); $fromRange -= $sameCount; - $toRange -= $sameCount; + $toRange -= $sameCount; $this->writeHunk( $diff, @@ -209,7 +208,7 @@ final class UnifiedDiffOutputBuilder extends AbstractChunkOutputBuilder $fromRange + $contextStartOffset + $contextEndOffset, $toStart - $contextStartOffset, $toRange + $contextStartOffset + $contextEndOffset, - $output + $output, ); } diff --git a/vendor/sebastian/diff/src/Parser.php b/vendor/sebastian/diff/src/Parser.php index b0ec6403..9293fc91 100644 --- a/vendor/sebastian/diff/src/Parser.php +++ b/vendor/sebastian/diff/src/Parser.php @@ -10,6 +10,7 @@ namespace SebastianBergmann\Diff; use function array_pop; +use function assert; use function count; use function max; use function preg_match; @@ -46,6 +47,9 @@ final class Parser $collected = []; } + assert(!empty($fromMatch['file'])); + assert(!empty($toMatch['file'])); + $diff = new Diff($fromMatch['file'], $toMatch['file']); $i++; @@ -74,12 +78,12 @@ final class Parser $diffLines = []; foreach ($lines as $line) { - if (preg_match('/^@@\s+-(?P\d+)(?:,\s*(?P\d+))?\s+\+(?P\d+)(?:,\s*(?P\d+))?\s+@@/', $line, $match)) { + if (preg_match('/^@@\s+-(?P\d+)(?:,\s*(?P\d+))?\s+\+(?P\d+)(?:,\s*(?P\d+))?\s+@@/', $line, $match, PREG_UNMATCHED_AS_NULL)) { $chunk = new Chunk( (int) $match['start'], - isset($match['startrange']) ? max(1, (int) $match['startrange']) : 1, + isset($match['startrange']) ? max(0, (int) $match['startrange']) : 1, (int) $match['end'], - isset($match['endrange']) ? max(1, (int) $match['endrange']) : 1 + isset($match['endrange']) ? max(0, (int) $match['endrange']) : 1, ); $chunks[] = $chunk; diff --git a/vendor/sebastian/diff/src/TimeEfficientLongestCommonSubsequenceCalculator.php b/vendor/sebastian/diff/src/TimeEfficientLongestCommonSubsequenceCalculator.php index 51bac1f1..93b76288 100644 --- a/vendor/sebastian/diff/src/TimeEfficientLongestCommonSubsequenceCalculator.php +++ b/vendor/sebastian/diff/src/TimeEfficientLongestCommonSubsequenceCalculator.php @@ -37,12 +37,24 @@ final class TimeEfficientLongestCommonSubsequenceCalculator implements LongestCo for ($i = 1; $i <= $fromLength; $i++) { for ($j = 1; $j <= $toLength; $j++) { - $o = ($j * $width) + $i; - $matrix[$o] = max( - $matrix[$o - 1], - $matrix[$o - $width], - $from[$i - 1] === $to[$j - 1] ? $matrix[$o - $width - 1] + 1 : 0 - ); + $o = ($j * $width) + $i; + + // don't use max() to avoid function call overhead + $firstOrLast = $from[$i - 1] === $to[$j - 1] ? $matrix[$o - $width - 1] + 1 : 0; + + if ($matrix[$o - 1] > $matrix[$o - $width]) { + if ($firstOrLast > $matrix[$o - 1]) { + $matrix[$o] = $firstOrLast; + } else { + $matrix[$o] = $matrix[$o - 1]; + } + } else { + if ($firstOrLast > $matrix[$o - $width]) { + $matrix[$o] = $firstOrLast; + } else { + $matrix[$o] = $matrix[$o - $width]; + } + } } } diff --git a/vendor/sebastian/environment/ChangeLog.md b/vendor/sebastian/environment/ChangeLog.md index 8c4887b1..d3f29e16 100644 --- a/vendor/sebastian/environment/ChangeLog.md +++ b/vendor/sebastian/environment/ChangeLog.md @@ -2,6 +2,19 @@ All notable changes in `sebastianbergmann/environment` are documented in this file using the [Keep a CHANGELOG](http://keepachangelog.com/) principles. +## [6.1.0] - 2024-03-23 + +### Added + +* [#72](https://github.com/sebastianbergmann/environment/pull/72): `Runtime::getRawBinary()` + +## [6.0.1] - 2023-04-11 + +### Fixed + +* [#68](https://github.com/sebastianbergmann/environment/pull/68): The Just-in-Time compiler is disabled when `opcache.jit_buffer_size` is set to `0` +* [#70](https://github.com/sebastianbergmann/environment/pull/70): The first `0` of `opcache.jit` only disables CPU-specific optimizations, not the Just-in-Time compiler itself + ## [6.0.0] - 2023-02-03 ### Removed @@ -165,6 +178,8 @@ All notable changes in `sebastianbergmann/environment` are documented in this fi * This component is no longer supported on PHP 5.6 +[6.1.0]: https://github.com/sebastianbergmann/environment/compare/6.0.1...6.1.0 +[6.0.1]: https://github.com/sebastianbergmann/environment/compare/6.0.0...6.0.1 [6.0.0]: https://github.com/sebastianbergmann/environment/compare/5.1.5...6.0.0 [5.1.5]: https://github.com/sebastianbergmann/environment/compare/5.1.4...5.1.5 [5.1.4]: https://github.com/sebastianbergmann/environment/compare/5.1.3...5.1.4 diff --git a/vendor/sebastian/environment/LICENSE b/vendor/sebastian/environment/LICENSE index 2acd6c8d..aecdbc7e 100644 --- a/vendor/sebastian/environment/LICENSE +++ b/vendor/sebastian/environment/LICENSE @@ -1,6 +1,6 @@ BSD 3-Clause License -Copyright (c) 2014-2023, Sebastian Bergmann +Copyright (c) 2014-2024, Sebastian Bergmann All rights reserved. Redistribution and use in source and binary forms, with or without diff --git a/vendor/sebastian/environment/SECURITY.md b/vendor/sebastian/environment/SECURITY.md index d4ee967b..d88ff001 100644 --- a/vendor/sebastian/environment/SECURITY.md +++ b/vendor/sebastian/environment/SECURITY.md @@ -1,9 +1,30 @@ # Security Policy -This library is intended to be used in development environments only. For instance, it is used by the testing framework PHPUnit. There is no reason why this library should be installed on a webserver. +If you believe you have found a security vulnerability in the library that is developed in this repository, please report it to us through coordinated disclosure. -**If you upload this library to a webserver then your deployment process is broken. On a more general note, if your `vendor` directory is publicly accessible on your webserver then your deployment process is also broken.** +**Please do not report security vulnerabilities through public GitHub issues, discussions, or pull requests.** -## Security Contact Information +Instead, please email `sebastian@phpunit.de`. + +Please include as much of the information listed below as you can to help us better understand and resolve the issue: + +* The type of issue +* Full paths of source file(s) related to the manifestation of the issue +* The location of the affected source code (tag/branch/commit or direct URL) +* Any special configuration required to reproduce the issue +* Step-by-step instructions to reproduce the issue +* Proof-of-concept or exploit code (if possible) +* Impact of the issue, including how an attacker might exploit the issue + +This information will help us triage your report more quickly. + +## Web Context + +The library that is developed in this repository was either extracted from [PHPUnit](https://github.com/sebastianbergmann/phpunit) or developed specifically as a dependency for PHPUnit. + +The library is developed with a focus on development environments and the command-line. No specific testing or hardening with regard to using the library in an HTTP or web context or with untrusted input data is performed. The library might also contain functionality that intentionally exposes internal application data for debugging purposes. + +If the library is used in a web application, the application developer is responsible for filtering inputs or escaping outputs as necessary and for verifying that the used functionality is safe for use within the intended context. + +Vulnerabilities specific to the use outside a development context will be fixed as applicable, provided that the fix does not have an averse effect on the primary use case for development purposes. -After the above, if you still would like to report a security vulnerability, please email `sebastian@phpunit.de`. diff --git a/vendor/sebastian/environment/composer.json b/vendor/sebastian/environment/composer.json index fdff87a2..61e41932 100644 --- a/vendor/sebastian/environment/composer.json +++ b/vendor/sebastian/environment/composer.json @@ -10,6 +10,10 @@ "email": "sebastian@phpunit.de" } ], + "support": { + "issues": "https://github.com/sebastianbergmann/environment/issues", + "security": "https://github.com/sebastianbergmann/environment/security/policy" + }, "config": { "platform": { "php": "8.1.0" @@ -34,7 +38,7 @@ }, "extra": { "branch-alias": { - "dev-main": "6.0-dev" + "dev-main": "6.1-dev" } } } diff --git a/vendor/sebastian/environment/src/Console.php b/vendor/sebastian/environment/src/Console.php index 180eb60b..4f5943c7 100644 --- a/vendor/sebastian/environment/src/Console.php +++ b/vendor/sebastian/environment/src/Console.php @@ -97,7 +97,7 @@ final class Console /** * Returns if the file descriptor is an interactive terminal or not. * - * Normally, we want to use a resource as a parameter, yet sadly it's not always awailable, + * Normally, we want to use a resource as a parameter, yet sadly it's not always available, * eg when running code in interactive console (`php -a`), STDIN/STDOUT/STDERR constants are not defined. * * @param int|resource $fileDescriptor @@ -112,7 +112,7 @@ final class Console if (function_exists('fstat')) { $stat = @fstat(STDOUT); - return $stat && 0020000 === ($stat['mode'] & 0170000); + return $stat && 0o020000 === ($stat['mode'] & 0o170000); } return false; @@ -166,7 +166,7 @@ final class Console $pipes, null, null, - ['suppress_errors' => true] + ['suppress_errors' => true], ); if (is_resource($process)) { diff --git a/vendor/sebastian/environment/src/Runtime.php b/vendor/sebastian/environment/src/Runtime.php index 2fd58edd..f9ec057e 100644 --- a/vendor/sebastian/environment/src/Runtime.php +++ b/vendor/sebastian/environment/src/Runtime.php @@ -26,11 +26,11 @@ use function php_ini_loaded_file; use function php_ini_scanned_files; use function phpversion; use function sprintf; -use function strpos; +use function strrpos; final class Runtime { - private static string $binary; + private static string $rawBinary; private static bool $initialized = false; /** @@ -73,7 +73,17 @@ final class Runtime return false; } - if (strpos(ini_get('opcache.jit'), '0') === 0) { + if (ini_get('opcache.jit_buffer_size') === '0') { + return false; + } + + $jit = ini_get('opcache.jit'); + + if (($jit === 'disable') || ($jit === 'off')) { + return false; + } + + if (strrpos($jit, '0') === 3) { return false; } @@ -81,19 +91,19 @@ final class Runtime } /** - * Returns the path to the binary of the current runtime. + * Returns the raw path to the binary of the current runtime. */ - public function getBinary(): string + public function getRawBinary(): string { if (self::$initialized) { - return self::$binary; + return self::$rawBinary; } if (PHP_BINARY !== '') { - self::$binary = escapeshellarg(PHP_BINARY); + self::$rawBinary = PHP_BINARY; self::$initialized = true; - return self::$binary; + return self::$rawBinary; } // @codeCoverageIgnoreStart @@ -105,19 +115,26 @@ final class Runtime foreach ($possibleBinaryLocations as $binary) { if (is_readable($binary)) { - self::$binary = escapeshellarg($binary); + self::$rawBinary = $binary; self::$initialized = true; - return self::$binary; + return self::$rawBinary; } } - // @codeCoverageIgnoreStart - self::$binary = 'php'; + self::$rawBinary = 'php'; self::$initialized = true; - // @codeCoverageIgnoreEnd - return self::$binary; + return self::$rawBinary; + // @codeCoverageIgnoreEnd + } + + /** + * Returns the escaped path to the binary of the current runtime. + */ + public function getBinary(): string + { + return escapeshellarg($this->getRawBinary()); } public function getNameWithVersion(): string @@ -131,7 +148,7 @@ final class Runtime return sprintf( '%s with PCOV %s', $this->getNameWithVersion(), - phpversion('pcov') + phpversion('pcov'), ); } @@ -139,7 +156,7 @@ final class Runtime return sprintf( '%s with Xdebug %s', $this->getNameWithVersion(), - phpversion('xdebug') + phpversion('xdebug'), ); } @@ -234,8 +251,8 @@ final class Runtime $files, array_map( 'trim', - explode(",\n", $scanned) - ) + explode(",\n", $scanned), + ), ); } diff --git a/vendor/sebastian/exporter/ChangeLog.md b/vendor/sebastian/exporter/ChangeLog.md index 4ec1b5ed..89fd353f 100644 --- a/vendor/sebastian/exporter/ChangeLog.md +++ b/vendor/sebastian/exporter/ChangeLog.md @@ -2,88 +2,38 @@ All notable changes are documented in this file using the [Keep a CHANGELOG](https://keepachangelog.com/) principles. -## [5.0.0] - 2023-02-03 +## [5.1.4] - 2025-09-24 ### Changed -* [#42](https://github.com/sebastianbergmann/exporter/pull/42): Improve export of enumerations +* Suppress `unexpected NAN value was coerced to string` warning triggered on PHP 8.5 -### Removed - -* This component is no longer supported on PHP 7.3, PHP 7.4 and PHP 8.0 - -## [4.0.5] - 2022-09-14 - -### Fixed - -* [#47](https://github.com/sebastianbergmann/exporter/pull/47): Fix `float` export precision - -## [4.0.4] - 2021-11-11 +## [5.1.3] - 2025-09-22 ### Changed -* [#37](https://github.com/sebastianbergmann/exporter/pull/37): Improve export of closed resources +* Suppress `not representable as an int, cast occurred` warning triggered on PHP 8.5 -## [4.0.3] - 2020-09-28 +## [5.1.2] - 2024-03-02 ### Changed -* Changed PHP version constraint in `composer.json` from `^7.3 || ^8.0` to `>=7.3` +* Do not use implicitly nullable parameters -## [4.0.2] - 2020-06-26 - -### Added - -* This component is now supported on PHP 8 - -## [4.0.1] - 2020-06-15 +## [5.1.1] - 2023-09-24 ### Changed -* Tests etc. are now ignored for archive exports +* [#52](https://github.com/sebastianbergmann/exporter/pull/52): Optimize export of large arrays and object graphs -## [4.0.0] - 2020-02-07 - -### Removed - -* This component is no longer supported on PHP 7.0, PHP 7.1, and PHP 7.2 - -## [3.1.5] - 2022-09-14 - -### Fixed - -* [#47](https://github.com/sebastianbergmann/exporter/pull/47): Fix `float` export precision - -## [3.1.4] - 2021-11-11 +## [5.1.0] - 2023-09-18 ### Changed -* [#38](https://github.com/sebastianbergmann/exporter/pull/38): Improve export of closed resources +* [#51](https://github.com/sebastianbergmann/exporter/pull/51): Export arrays using short array syntax -## [3.1.3] - 2020-11-30 - -### Changed - -* Changed PHP version constraint in `composer.json` from `^7.0` to `>=7.0` - -## [3.1.2] - 2019-09-14 - -### Fixed - -* [#29](https://github.com/sebastianbergmann/exporter/pull/29): Second parameter for `str_repeat()` must be an integer - -### Removed - -* Remove HHVM-specific code that is no longer needed - -[5.0.0]: https://github.com/sebastianbergmann/exporter/compare/4.0.5...5.0.0 -[4.0.5]: https://github.com/sebastianbergmann/exporter/compare/4.0.4...4.0.5 -[4.0.4]: https://github.com/sebastianbergmann/exporter/compare/4.0.3...4.0.4 -[4.0.3]: https://github.com/sebastianbergmann/exporter/compare/4.0.2...4.0.3 -[4.0.2]: https://github.com/sebastianbergmann/exporter/compare/4.0.1...4.0.2 -[4.0.1]: https://github.com/sebastianbergmann/exporter/compare/4.0.0...4.0.1 -[4.0.0]: https://github.com/sebastianbergmann/exporter/compare/3.1.2...4.0.0 -[3.1.5]: https://github.com/sebastianbergmann/exporter/compare/3.1.4...3.1.5 -[3.1.4]: https://github.com/sebastianbergmann/exporter/compare/3.1.3...3.1.4 -[3.1.3]: https://github.com/sebastianbergmann/exporter/compare/3.1.2...3.1.3 -[3.1.2]: https://github.com/sebastianbergmann/exporter/compare/3.1.1...3.1.2 +[5.1.4]: https://github.com/sebastianbergmann/exporter/compare/5.1.3...5.1.4 +[5.1.3]: https://github.com/sebastianbergmann/exporter/compare/5.1.2...5.1.3 +[5.1.2]: https://github.com/sebastianbergmann/exporter/compare/5.1.1...5.1.2 +[5.1.1]: https://github.com/sebastianbergmann/exporter/compare/5.1.0...5.1.1 +[5.1.0]: https://github.com/sebastianbergmann/exporter/compare/5.0.1...5.1.0 diff --git a/vendor/sebastian/exporter/LICENSE b/vendor/sebastian/exporter/LICENSE index a453252d..c5268a91 100644 --- a/vendor/sebastian/exporter/LICENSE +++ b/vendor/sebastian/exporter/LICENSE @@ -1,6 +1,6 @@ BSD 3-Clause License -Copyright (c) 2002-2023, Sebastian Bergmann +Copyright (c) 2002-2025, Sebastian Bergmann All rights reserved. Redistribution and use in source and binary forms, with or without diff --git a/vendor/sebastian/exporter/SECURITY.md b/vendor/sebastian/exporter/SECURITY.md index d4ee967b..d88ff001 100644 --- a/vendor/sebastian/exporter/SECURITY.md +++ b/vendor/sebastian/exporter/SECURITY.md @@ -1,9 +1,30 @@ # Security Policy -This library is intended to be used in development environments only. For instance, it is used by the testing framework PHPUnit. There is no reason why this library should be installed on a webserver. +If you believe you have found a security vulnerability in the library that is developed in this repository, please report it to us through coordinated disclosure. -**If you upload this library to a webserver then your deployment process is broken. On a more general note, if your `vendor` directory is publicly accessible on your webserver then your deployment process is also broken.** +**Please do not report security vulnerabilities through public GitHub issues, discussions, or pull requests.** -## Security Contact Information +Instead, please email `sebastian@phpunit.de`. + +Please include as much of the information listed below as you can to help us better understand and resolve the issue: + +* The type of issue +* Full paths of source file(s) related to the manifestation of the issue +* The location of the affected source code (tag/branch/commit or direct URL) +* Any special configuration required to reproduce the issue +* Step-by-step instructions to reproduce the issue +* Proof-of-concept or exploit code (if possible) +* Impact of the issue, including how an attacker might exploit the issue + +This information will help us triage your report more quickly. + +## Web Context + +The library that is developed in this repository was either extracted from [PHPUnit](https://github.com/sebastianbergmann/phpunit) or developed specifically as a dependency for PHPUnit. + +The library is developed with a focus on development environments and the command-line. No specific testing or hardening with regard to using the library in an HTTP or web context or with untrusted input data is performed. The library might also contain functionality that intentionally exposes internal application data for debugging purposes. + +If the library is used in a web application, the application developer is responsible for filtering inputs or escaping outputs as necessary and for verifying that the used functionality is safe for use within the intended context. + +Vulnerabilities specific to the use outside a development context will be fixed as applicable, provided that the fix does not have an averse effect on the primary use case for development purposes. -After the above, if you still would like to report a security vulnerability, please email `sebastian@phpunit.de`. diff --git a/vendor/sebastian/exporter/composer.json b/vendor/sebastian/exporter/composer.json index 4d1e169f..591dc368 100644 --- a/vendor/sebastian/exporter/composer.json +++ b/vendor/sebastian/exporter/composer.json @@ -26,6 +26,10 @@ "email": "bschussek@gmail.com" } ], + "support": { + "issues": "https://github.com/sebastianbergmann/exporter/issues", + "security": "https://github.com/sebastianbergmann/exporter/security/policy" + }, "config": { "platform": { "php": "8.1.0" @@ -40,7 +44,7 @@ "sebastian/recursion-context": "^5.0" }, "require-dev": { - "phpunit/phpunit": "^10.0" + "phpunit/phpunit": "^10.5" }, "autoload": { "classmap": [ @@ -54,7 +58,7 @@ }, "extra": { "branch-alias": { - "dev-main": "5.0-dev" + "dev-main": "5.1-dev" } } } diff --git a/vendor/sebastian/exporter/src/Exporter.php b/vendor/sebastian/exporter/src/Exporter.php index dcde0d7d..36613bd1 100644 --- a/vendor/sebastian/exporter/src/Exporter.php +++ b/vendor/sebastian/exporter/src/Exporter.php @@ -17,6 +17,7 @@ use function implode; use function ini_get; use function ini_set; use function is_array; +use function is_bool; use function is_float; use function is_object; use function is_resource; @@ -34,17 +35,6 @@ use SebastianBergmann\RecursionContext\Context; use SplObjectStorage; use UnitEnum; -/** - * A nifty utility for visualizing PHP variables. - * - * - * export(new Exception); - * - */ final class Exporter { /** @@ -65,7 +55,7 @@ final class Exporter return $this->recursiveExport($value, $indentation); } - public function shortenedRecursiveExport(array &$data, Context $context = null): string + public function shortenedRecursiveExport(array &$data, ?Context $context = null): string { $result = []; $exporter = new self; @@ -84,10 +74,7 @@ final class Exporter if ($context->contains($data[$key]) !== false) { $result[] = '*RECURSION*'; } else { - $result[] = sprintf( - 'array(%s)', - $this->shortenedRecursiveExport($data[$key], $context) - ); + $result[] = sprintf('[%s]', $this->shortenedRecursiveExport($data[$key], $context)); } } else { $result[] = $exporter->shortenedExport($value); @@ -123,7 +110,7 @@ final class Exporter '%s Enum (%s, %s)', $value::class, $value->name, - $this->export($value->value) + $this->export($value->value), ); } @@ -131,7 +118,7 @@ final class Exporter return sprintf( '%s Enum (%s)', $value::class, - $value->name + $value->name, ); } @@ -139,14 +126,14 @@ final class Exporter return sprintf( '%s Object (%s)', $value::class, - count($this->toArray($value)) > 0 ? '...' : '' + count($this->toArray($value)) > 0 ? '...' : '', ); } if (is_array($value)) { return sprintf( - 'Array (%s)', - count($value) > 0 ? '...' : '' + '[%s]', + count($value) > 0 ? '...' : '', ); } @@ -174,10 +161,10 @@ final class Exporter } // properties are transformed to keys in the following way: - // private $property => "\0Classname\0property" - // protected $property => "\0*\0property" - // public $property => "property" - if (preg_match('/^\0.+\0(.+)$/', (string) $key, $matches)) { + // private $propertyName => "\0ClassName\0propertyName" + // protected $propertyName => "\0*\0propertyName" + // public $propertyName => "propertyName" + if (preg_match('/\0.+\0(.+)/', (string) $key, $matches)) { $key = $matches[1]; } @@ -189,7 +176,7 @@ final class Exporter $array[$key] = $val; } - // Some internal classes like SplObjectStorage don't work with the + // Some internal classes like SplObjectStorage do not work with the // above (fast) mechanism nor with reflection in Zend. // Format the output similarly to print_r() in this case if ($value instanceof SplObjectStorage) { @@ -199,26 +186,21 @@ final class Exporter 'inf' => $value->getInfo(), ]; } + + $value->rewind(); } return $array; } - /** - * Recursive implementation of export. - */ private function recursiveExport(mixed &$value, int $indentation, ?Context $processed = null): string { if ($value === null) { return 'null'; } - if ($value === true) { - return 'true'; - } - - if ($value === false) { - return 'false'; + if (is_bool($value)) { + return $value ? 'true' : 'false'; } if (is_float($value)) { @@ -226,17 +208,15 @@ final class Exporter ini_set('precision', '-1'); - try { - $valueStr = (string) $value; + $valueAsString = @(string) $value; - if ((string) (int) $value === $valueStr) { - return $valueStr . '.0'; - } + ini_set('precision', $precisionBackup); - return $valueStr; - } finally { - ini_set('precision', $precisionBackup); + if ((string) @(int) $value === $valueAsString) { + return $valueAsString . '.0'; } + + return $valueAsString; } if (gettype($value) === 'resource (closed)') { @@ -246,8 +226,8 @@ final class Exporter if (is_resource($value)) { return sprintf( 'resource(%d) of type (%s)', - $value, - get_resource_type($value) + (int) $value, + get_resource_type($value), ); } @@ -257,7 +237,7 @@ final class Exporter $value::class, spl_object_id($value), $value->name, - $this->export($value->value, $indentation) + $this->export($value->value, $indentation), ); } @@ -266,12 +246,12 @@ final class Exporter '%s Enum #%d (%s)', $value::class, spl_object_id($value), - $value->name + $value->name, ); } if (is_string($value)) { - // Match for most non printable chars somewhat taking multibyte chars into account + // Match for most non-printable chars somewhat taking multibyte chars into account if (preg_match('/[^\x09-\x0d\x1b\x20-\xff]/', $value)) { return 'Binary String: 0x' . bin2hex($value); } @@ -283,8 +263,8 @@ final class Exporter str_replace( ["\r\n", "\n\r", "\r", "\n"], ['\r\n', '\n\r', '\r', '\n'], - $value - ) + $value, + ), ) . "'"; } @@ -306,25 +286,26 @@ final class Exporter if (count($array) > 0) { foreach ($array as $k => $v) { - $values .= sprintf( - '%s %s => %s' . "\n", - $whitespace, - $this->recursiveExport($k, $indentation), + $values .= + $whitespace + . ' ' . + $this->recursiveExport($k, $indentation) + . ' => ' . $this->recursiveExport($value[$k], $indentation + 1, $processed) - ); + . ",\n"; } $values = "\n" . $values . $whitespace; } - return sprintf('Array &%s (%s)', $key, $values); + return 'Array &' . (string) $key . ' [' . $values . ']'; } if (is_object($value)) { $class = $value::class; - if ($processed->contains($value)) { - return sprintf('%s Object #%d', $class, spl_object_id($value)); + if ($processed->contains($value) !== false) { + return $class . ' Object #' . spl_object_id($value); } $processed->add($value); @@ -333,18 +314,19 @@ final class Exporter if (count($array) > 0) { foreach ($array as $k => $v) { - $values .= sprintf( - '%s %s => %s' . "\n", - $whitespace, - $this->recursiveExport($k, $indentation), + $values .= + $whitespace + . ' ' . + $this->recursiveExport($k, $indentation) + . ' => ' . $this->recursiveExport($v, $indentation + 1, $processed) - ); + . ",\n"; } $values = "\n" . $values . $whitespace; } - return sprintf('%s Object #%d (%s)', $class, spl_object_id($value), $values); + return $class . ' Object #' . spl_object_id($value) . ' (' . $values . ')'; } return var_export($value, true); diff --git a/vendor/sebastian/global-state/ChangeLog.md b/vendor/sebastian/global-state/ChangeLog.md index 7a73e958..03f25470 100644 --- a/vendor/sebastian/global-state/ChangeLog.md +++ b/vendor/sebastian/global-state/ChangeLog.md @@ -2,6 +2,18 @@ All notable changes in `sebastian/global-state` are documented in this file using the [Keep a CHANGELOG](https://keepachangelog.com/) principles. +## [6.0.2] - 2024-03-02 + +### Changed + +* Do not use implicitly nullable parameters + +## [6.0.1] - 2023-07-19 + +### Changed + +* Changed usage of `ReflectionProperty::setValue()` to be compatible with PHP 8.3 + ## [6.0.0] - 2023-02-03 ### Changed @@ -80,6 +92,8 @@ All notable changes in `sebastian/global-state` are documented in this file usin * This component is no longer supported on PHP 7.0 and PHP 7.1 +[6.0.2]: https://github.com/sebastianbergmann/global-state/compare/6.0.1...6.0.2 +[6.0.1]: https://github.com/sebastianbergmann/global-state/compare/6.0.0...6.0.1 [6.0.0]: https://github.com/sebastianbergmann/global-state/compare/5.0.5...6.0.0 [5.0.5]: https://github.com/sebastianbergmann/global-state/compare/5.0.4...5.0.5 [5.0.4]: https://github.com/sebastianbergmann/global-state/compare/5.0.3...5.0.4 diff --git a/vendor/sebastian/global-state/LICENSE b/vendor/sebastian/global-state/LICENSE index 73e95512..bdb57ec6 100644 --- a/vendor/sebastian/global-state/LICENSE +++ b/vendor/sebastian/global-state/LICENSE @@ -1,6 +1,6 @@ BSD 3-Clause License -Copyright (c) 2001-2023, Sebastian Bergmann +Copyright (c) 2001-2024, Sebastian Bergmann All rights reserved. Redistribution and use in source and binary forms, with or without diff --git a/vendor/sebastian/global-state/SECURITY.md b/vendor/sebastian/global-state/SECURITY.md index d4ee967b..d88ff001 100644 --- a/vendor/sebastian/global-state/SECURITY.md +++ b/vendor/sebastian/global-state/SECURITY.md @@ -1,9 +1,30 @@ # Security Policy -This library is intended to be used in development environments only. For instance, it is used by the testing framework PHPUnit. There is no reason why this library should be installed on a webserver. +If you believe you have found a security vulnerability in the library that is developed in this repository, please report it to us through coordinated disclosure. -**If you upload this library to a webserver then your deployment process is broken. On a more general note, if your `vendor` directory is publicly accessible on your webserver then your deployment process is also broken.** +**Please do not report security vulnerabilities through public GitHub issues, discussions, or pull requests.** -## Security Contact Information +Instead, please email `sebastian@phpunit.de`. + +Please include as much of the information listed below as you can to help us better understand and resolve the issue: + +* The type of issue +* Full paths of source file(s) related to the manifestation of the issue +* The location of the affected source code (tag/branch/commit or direct URL) +* Any special configuration required to reproduce the issue +* Step-by-step instructions to reproduce the issue +* Proof-of-concept or exploit code (if possible) +* Impact of the issue, including how an attacker might exploit the issue + +This information will help us triage your report more quickly. + +## Web Context + +The library that is developed in this repository was either extracted from [PHPUnit](https://github.com/sebastianbergmann/phpunit) or developed specifically as a dependency for PHPUnit. + +The library is developed with a focus on development environments and the command-line. No specific testing or hardening with regard to using the library in an HTTP or web context or with untrusted input data is performed. The library might also contain functionality that intentionally exposes internal application data for debugging purposes. + +If the library is used in a web application, the application developer is responsible for filtering inputs or escaping outputs as necessary and for verifying that the used functionality is safe for use within the intended context. + +Vulnerabilities specific to the use outside a development context will be fixed as applicable, provided that the fix does not have an averse effect on the primary use case for development purposes. -After the above, if you still would like to report a security vulnerability, please email `sebastian@phpunit.de`. diff --git a/vendor/sebastian/global-state/composer.json b/vendor/sebastian/global-state/composer.json index b8c9b723..d38d64d2 100644 --- a/vendor/sebastian/global-state/composer.json +++ b/vendor/sebastian/global-state/composer.json @@ -2,7 +2,7 @@ "name": "sebastian/global-state", "description": "Snapshotting of global state", "keywords": ["global state"], - "homepage": "http://www.github.com/sebastianbergmann/global-state", + "homepage": "https://www.github.com/sebastianbergmann/global-state", "license": "BSD-3-Clause", "authors": [ { @@ -10,6 +10,10 @@ "email": "sebastian@phpunit.de" } ], + "support": { + "issues": "https://github.com/sebastianbergmann/global-state/issues", + "security": "https://github.com/sebastianbergmann/global-state/security/policy" + }, "prefer-stable": true, "config": { "platform": { diff --git a/vendor/sebastian/global-state/src/CodeExporter.php b/vendor/sebastian/global-state/src/CodeExporter.php index e7c5fd08..6b720811 100644 --- a/vendor/sebastian/global-state/src/CodeExporter.php +++ b/vendor/sebastian/global-state/src/CodeExporter.php @@ -27,7 +27,7 @@ final class CodeExporter 'if (!defined(\'%s\')) define(\'%s\', %s);' . "\n", $name, $name, - $this->exportVariable($value) + $this->exportVariable($value), ); } @@ -53,7 +53,7 @@ EOT; $result .= sprintf( '$GLOBALS[%s] = %s;' . PHP_EOL, $this->exportVariable($name), - $this->exportVariable($value) + $this->exportVariable($value), ); } @@ -68,7 +68,7 @@ EOT; $result .= sprintf( '@ini_set(%s, %s);' . "\n", $this->exportVariable($key), - $this->exportVariable($value) + $this->exportVariable($value), ); } diff --git a/vendor/sebastian/global-state/src/ExcludeList.php b/vendor/sebastian/global-state/src/ExcludeList.php index a8ceb684..3754e814 100644 --- a/vendor/sebastian/global-state/src/ExcludeList.php +++ b/vendor/sebastian/global-state/src/ExcludeList.php @@ -10,7 +10,7 @@ namespace SebastianBergmann\GlobalState; use function in_array; -use function strpos; +use function str_starts_with; use ReflectionClass; final class ExcludeList @@ -71,7 +71,7 @@ final class ExcludeList } foreach ($this->classNamePrefixes as $prefix) { - if (strpos($className, $prefix) === 0) { + if (str_starts_with($className, $prefix)) { return true; } } diff --git a/vendor/sebastian/global-state/src/Restorer.php b/vendor/sebastian/global-state/src/Restorer.php index 90606225..d84e155e 100644 --- a/vendor/sebastian/global-state/src/Restorer.php +++ b/vendor/sebastian/global-state/src/Restorer.php @@ -53,8 +53,7 @@ final class Restorer foreach ($snapshot->staticProperties() as $className => $staticProperties) { foreach ($staticProperties as $name => $value) { $reflector = new ReflectionProperty($className, $name); - $reflector->setAccessible(true); - $reflector->setValue($value); + $reflector->setValue(null, $value); } } @@ -77,8 +76,7 @@ final class Restorer continue; } - $property->setAccessible(true); - $property->setValue($defaults[$name]); + $property->setValue(null, $defaults[$name]); } } } @@ -92,8 +90,8 @@ final class Restorer $keys = array_keys( array_merge( $GLOBALS[$superGlobalArray], - $superGlobalVariables[$superGlobalArray] - ) + $superGlobalVariables[$superGlobalArray], + ), ); foreach ($keys as $key) { diff --git a/vendor/sebastian/global-state/src/Snapshot.php b/vendor/sebastian/global-state/src/Snapshot.php index 4f14d982..310c8566 100644 --- a/vendor/sebastian/global-state/src/Snapshot.php +++ b/vendor/sebastian/global-state/src/Snapshot.php @@ -51,7 +51,7 @@ class Snapshot private array $classes = []; private array $traits = []; - public function __construct(ExcludeList $excludeList = null, bool $includeGlobalVariables = true, bool $includeStaticProperties = true, bool $includeConstants = true, bool $includeFunctions = true, bool $includeClasses = true, bool $includeInterfaces = true, bool $includeTraits = true, bool $includeIniSettings = true, bool $includeIncludedFiles = true) + public function __construct(?ExcludeList $excludeList = null, bool $includeGlobalVariables = true, bool $includeStaticProperties = true, bool $includeConstants = true, bool $includeFunctions = true, bool $includeClasses = true, bool $includeInterfaces = true, bool $includeTraits = true, bool $includeIniSettings = true, bool $includeIncludedFiles = true) { $this->excludeList = $excludeList ?: new ExcludeList; @@ -244,8 +244,6 @@ class Snapshot continue; } - $property->setAccessible(true); - if (!$property->isInitialized()) { continue; } @@ -342,7 +340,7 @@ class Snapshot /** @noinspection SlowArrayOperationsInLoopInspection */ $result = array_merge( $result, - $this->enumerateObjectsAndResources($element, $processed) + $this->enumerateObjectsAndResources($element, $processed), ); } else { $result[] = $element; @@ -360,7 +358,7 @@ class Snapshot /** @noinspection SlowArrayOperationsInLoopInspection */ $result = array_merge( $result, - $this->enumerateObjectsAndResources($value, $processed) + $this->enumerateObjectsAndResources($value, $processed), ); } else { $result[] = $value; diff --git a/vendor/sebastian/lines-of-code/ChangeLog.md b/vendor/sebastian/lines-of-code/ChangeLog.md index fe25b11a..27db5805 100644 --- a/vendor/sebastian/lines-of-code/ChangeLog.md +++ b/vendor/sebastian/lines-of-code/ChangeLog.md @@ -2,6 +2,18 @@ All notable changes are documented in this file using the [Keep a CHANGELOG](https://keepachangelog.com/) principles. +## [2.0.2] - 2023-12-21 + +### Changed + +* This component is now compatible with `nikic/php-parser` 5.0 + +## [2.0.1] - 2023-08-31 + +### Changed + +* Improved type information + ## [2.0.0] - 2023-02-03 ### Removed @@ -34,6 +46,8 @@ All notable changes are documented in this file using the [Keep a CHANGELOG](htt * Initial release +[2.0.2]: https://github.com/sebastianbergmann/lines-of-code/compare/2.0.1...2.0.2 +[2.0.1]: https://github.com/sebastianbergmann/lines-of-code/compare/2.0.0...2.0.1 [2.0.0]: https://github.com/sebastianbergmann/lines-of-code/compare/1.0.3...2.0.0 [1.0.3]: https://github.com/sebastianbergmann/lines-of-code/compare/1.0.2...1.0.3 [1.0.2]: https://github.com/sebastianbergmann/lines-of-code/compare/1.0.1...1.0.2 diff --git a/vendor/sebastian/lines-of-code/SECURITY.md b/vendor/sebastian/lines-of-code/SECURITY.md index d4ee967b..d88ff001 100644 --- a/vendor/sebastian/lines-of-code/SECURITY.md +++ b/vendor/sebastian/lines-of-code/SECURITY.md @@ -1,9 +1,30 @@ # Security Policy -This library is intended to be used in development environments only. For instance, it is used by the testing framework PHPUnit. There is no reason why this library should be installed on a webserver. +If you believe you have found a security vulnerability in the library that is developed in this repository, please report it to us through coordinated disclosure. -**If you upload this library to a webserver then your deployment process is broken. On a more general note, if your `vendor` directory is publicly accessible on your webserver then your deployment process is also broken.** +**Please do not report security vulnerabilities through public GitHub issues, discussions, or pull requests.** -## Security Contact Information +Instead, please email `sebastian@phpunit.de`. + +Please include as much of the information listed below as you can to help us better understand and resolve the issue: + +* The type of issue +* Full paths of source file(s) related to the manifestation of the issue +* The location of the affected source code (tag/branch/commit or direct URL) +* Any special configuration required to reproduce the issue +* Step-by-step instructions to reproduce the issue +* Proof-of-concept or exploit code (if possible) +* Impact of the issue, including how an attacker might exploit the issue + +This information will help us triage your report more quickly. + +## Web Context + +The library that is developed in this repository was either extracted from [PHPUnit](https://github.com/sebastianbergmann/phpunit) or developed specifically as a dependency for PHPUnit. + +The library is developed with a focus on development environments and the command-line. No specific testing or hardening with regard to using the library in an HTTP or web context or with untrusted input data is performed. The library might also contain functionality that intentionally exposes internal application data for debugging purposes. + +If the library is used in a web application, the application developer is responsible for filtering inputs or escaping outputs as necessary and for verifying that the used functionality is safe for use within the intended context. + +Vulnerabilities specific to the use outside a development context will be fixed as applicable, provided that the fix does not have an averse effect on the primary use case for development purposes. -After the above, if you still would like to report a security vulnerability, please email `sebastian@phpunit.de`. diff --git a/vendor/sebastian/lines-of-code/composer.json b/vendor/sebastian/lines-of-code/composer.json index 1e72f96b..1f3b7479 100644 --- a/vendor/sebastian/lines-of-code/composer.json +++ b/vendor/sebastian/lines-of-code/composer.json @@ -12,12 +12,13 @@ } ], "support": { - "issues": "https://github.com/sebastianbergmann/lines-of-code/issues" + "issues": "https://github.com/sebastianbergmann/lines-of-code/issues", + "security": "https://github.com/sebastianbergmann/lines-of-code/security/policy" }, "prefer-stable": true, "require": { "php": ">=8.1", - "nikic/php-parser": "^4.10" + "nikic/php-parser": "^4.18 || ^5.0" }, "require-dev": { "phpunit/phpunit": "^10.0" diff --git a/vendor/sebastian/lines-of-code/src/Counter.php b/vendor/sebastian/lines-of-code/src/Counter.php index b8a8d5d8..9519268b 100644 --- a/vendor/sebastian/lines-of-code/src/Counter.php +++ b/vendor/sebastian/lines-of-code/src/Counter.php @@ -13,10 +13,8 @@ use function assert; use function file_get_contents; use function substr_count; use PhpParser\Error; -use PhpParser\Lexer; use PhpParser\Node; use PhpParser\NodeTraverser; -use PhpParser\Parser; use PhpParser\ParserFactory; final class Counter @@ -40,8 +38,10 @@ final class Counter $linesOfCode = 1; } + assert($linesOfCode >= 0); + try { - $nodes = $this->parser()->parse($source); + $nodes = (new ParserFactory)->createForHostVersion()->parse($source); assert($nodes !== null); @@ -52,13 +52,15 @@ final class Counter throw new RuntimeException( $error->getMessage(), $error->getCode(), - $error + $error, ); } // @codeCoverageIgnoreEnd } /** + * @psalm-param non-negative-int $linesOfCode + * * @param Node[] $nodes * * @throws RuntimeException @@ -78,16 +80,11 @@ final class Counter throw new RuntimeException( $error->getMessage(), $error->getCode(), - $error + $error, ); } // @codeCoverageIgnoreEnd return $visitor->result(); } - - private function parser(): Parser - { - return (new ParserFactory)->create(ParserFactory::PREFER_PHP7, new Lexer); - } } diff --git a/vendor/sebastian/lines-of-code/src/LineCountingVisitor.php b/vendor/sebastian/lines-of-code/src/LineCountingVisitor.php index 7f57b8cf..ec394d98 100644 --- a/vendor/sebastian/lines-of-code/src/LineCountingVisitor.php +++ b/vendor/sebastian/lines-of-code/src/LineCountingVisitor.php @@ -11,6 +11,7 @@ namespace SebastianBergmann\LinesOfCode; use function array_merge; use function array_unique; +use function assert; use function count; use PhpParser\Comment; use PhpParser\Node; @@ -19,7 +20,10 @@ use PhpParser\NodeVisitorAbstract; final class LineCountingVisitor extends NodeVisitorAbstract { - private int $linesOfCode; + /** + * @psalm-var non-negative-int + */ + private readonly int $linesOfCode; /** * @var Comment[] @@ -31,6 +35,9 @@ final class LineCountingVisitor extends NodeVisitorAbstract */ private array $linesWithStatements = []; + /** + * @psalm-param non-negative-int $linesOfCode + */ public function __construct(int $linesOfCode) { $this->linesOfCode = $linesOfCode; @@ -55,11 +62,18 @@ final class LineCountingVisitor extends NodeVisitorAbstract $commentLinesOfCode += ($comment->getEndLine() - $comment->getStartLine() + 1); } + $nonCommentLinesOfCode = $this->linesOfCode - $commentLinesOfCode; + $logicalLinesOfCode = count(array_unique($this->linesWithStatements)); + + assert($commentLinesOfCode >= 0); + assert($nonCommentLinesOfCode >= 0); + assert($logicalLinesOfCode >= 0); + return new LinesOfCode( $this->linesOfCode, $commentLinesOfCode, - $this->linesOfCode - $commentLinesOfCode, - count(array_unique($this->linesWithStatements)) + $nonCommentLinesOfCode, + $logicalLinesOfCode, ); } diff --git a/vendor/sebastian/lines-of-code/src/LinesOfCode.php b/vendor/sebastian/lines-of-code/src/LinesOfCode.php index 6d8343fa..729eba52 100644 --- a/vendor/sebastian/lines-of-code/src/LinesOfCode.php +++ b/vendor/sebastian/lines-of-code/src/LinesOfCode.php @@ -14,29 +14,53 @@ namespace SebastianBergmann\LinesOfCode; */ final class LinesOfCode { - private int $linesOfCode; - private int $commentLinesOfCode; - private int $nonCommentLinesOfCode; - private int $logicalLinesOfCode; + /** + * @psalm-var non-negative-int + */ + private readonly int $linesOfCode; /** + * @psalm-var non-negative-int + */ + private readonly int $commentLinesOfCode; + + /** + * @psalm-var non-negative-int + */ + private readonly int $nonCommentLinesOfCode; + + /** + * @psalm-var non-negative-int + */ + private readonly int $logicalLinesOfCode; + + /** + * @psalm-param non-negative-int $linesOfCode + * @psalm-param non-negative-int $commentLinesOfCode + * @psalm-param non-negative-int $nonCommentLinesOfCode + * @psalm-param non-negative-int $logicalLinesOfCode + * * @throws IllogicalValuesException * @throws NegativeValueException */ public function __construct(int $linesOfCode, int $commentLinesOfCode, int $nonCommentLinesOfCode, int $logicalLinesOfCode) { + /** @psalm-suppress DocblockTypeContradiction */ if ($linesOfCode < 0) { throw new NegativeValueException('$linesOfCode must not be negative'); } + /** @psalm-suppress DocblockTypeContradiction */ if ($commentLinesOfCode < 0) { throw new NegativeValueException('$commentLinesOfCode must not be negative'); } + /** @psalm-suppress DocblockTypeContradiction */ if ($nonCommentLinesOfCode < 0) { throw new NegativeValueException('$nonCommentLinesOfCode must not be negative'); } + /** @psalm-suppress DocblockTypeContradiction */ if ($logicalLinesOfCode < 0) { throw new NegativeValueException('$logicalLinesOfCode must not be negative'); } @@ -51,21 +75,33 @@ final class LinesOfCode $this->logicalLinesOfCode = $logicalLinesOfCode; } + /** + * @psalm-return non-negative-int + */ public function linesOfCode(): int { return $this->linesOfCode; } + /** + * @psalm-return non-negative-int + */ public function commentLinesOfCode(): int { return $this->commentLinesOfCode; } + /** + * @psalm-return non-negative-int + */ public function nonCommentLinesOfCode(): int { return $this->nonCommentLinesOfCode; } + /** + * @psalm-return non-negative-int + */ public function logicalLinesOfCode(): int { return $this->logicalLinesOfCode; diff --git a/vendor/sebastian/recursion-context/ChangeLog.md b/vendor/sebastian/recursion-context/ChangeLog.md index 836de86c..d888e436 100644 --- a/vendor/sebastian/recursion-context/ChangeLog.md +++ b/vendor/sebastian/recursion-context/ChangeLog.md @@ -2,6 +2,12 @@ All notable changes are documented in this file using the [Keep a CHANGELOG](https://keepachangelog.com/) principles. +## [5.0.1] - 2025-08-10 + +### Changed + +* Do not use `SplObjectStorage` methods that will be deprecated in PHP 8.5 + ## [5.0.0] - 2023-02-03 ### Removed @@ -39,6 +45,7 @@ All notable changes are documented in this file using the [Keep a CHANGELOG](htt * Tests etc. are now ignored for archive exports +[5.0.1]: https://github.com/sebastianbergmann/recursion-context/compare/5.0.0...5.0.1 [5.0.0]: https://github.com/sebastianbergmann/recursion-context/compare/4.0.5...5.0.0 [4.0.5]: https://github.com/sebastianbergmann/recursion-context/compare/4.0.4...4.0.5 [4.0.4]: https://github.com/sebastianbergmann/recursion-context/compare/4.0.3...4.0.4 diff --git a/vendor/sebastian/recursion-context/LICENSE b/vendor/sebastian/recursion-context/LICENSE index a453252d..c5268a91 100644 --- a/vendor/sebastian/recursion-context/LICENSE +++ b/vendor/sebastian/recursion-context/LICENSE @@ -1,6 +1,6 @@ BSD 3-Clause License -Copyright (c) 2002-2023, Sebastian Bergmann +Copyright (c) 2002-2025, Sebastian Bergmann All rights reserved. Redistribution and use in source and binary forms, with or without diff --git a/vendor/sebastian/recursion-context/SECURITY.md b/vendor/sebastian/recursion-context/SECURITY.md index d4ee967b..d88ff001 100644 --- a/vendor/sebastian/recursion-context/SECURITY.md +++ b/vendor/sebastian/recursion-context/SECURITY.md @@ -1,9 +1,30 @@ # Security Policy -This library is intended to be used in development environments only. For instance, it is used by the testing framework PHPUnit. There is no reason why this library should be installed on a webserver. +If you believe you have found a security vulnerability in the library that is developed in this repository, please report it to us through coordinated disclosure. -**If you upload this library to a webserver then your deployment process is broken. On a more general note, if your `vendor` directory is publicly accessible on your webserver then your deployment process is also broken.** +**Please do not report security vulnerabilities through public GitHub issues, discussions, or pull requests.** -## Security Contact Information +Instead, please email `sebastian@phpunit.de`. + +Please include as much of the information listed below as you can to help us better understand and resolve the issue: + +* The type of issue +* Full paths of source file(s) related to the manifestation of the issue +* The location of the affected source code (tag/branch/commit or direct URL) +* Any special configuration required to reproduce the issue +* Step-by-step instructions to reproduce the issue +* Proof-of-concept or exploit code (if possible) +* Impact of the issue, including how an attacker might exploit the issue + +This information will help us triage your report more quickly. + +## Web Context + +The library that is developed in this repository was either extracted from [PHPUnit](https://github.com/sebastianbergmann/phpunit) or developed specifically as a dependency for PHPUnit. + +The library is developed with a focus on development environments and the command-line. No specific testing or hardening with regard to using the library in an HTTP or web context or with untrusted input data is performed. The library might also contain functionality that intentionally exposes internal application data for debugging purposes. + +If the library is used in a web application, the application developer is responsible for filtering inputs or escaping outputs as necessary and for verifying that the used functionality is safe for use within the intended context. + +Vulnerabilities specific to the use outside a development context will be fixed as applicable, provided that the fix does not have an averse effect on the primary use case for development purposes. -After the above, if you still would like to report a security vulnerability, please email `sebastian@phpunit.de`. diff --git a/vendor/sebastian/recursion-context/composer.json b/vendor/sebastian/recursion-context/composer.json index 3a00b680..b3a827fb 100644 --- a/vendor/sebastian/recursion-context/composer.json +++ b/vendor/sebastian/recursion-context/composer.json @@ -17,6 +17,10 @@ "email": "aharvey@php.net" } ], + "support": { + "issues": "https://github.com/sebastianbergmann/recursion-context/issues", + "security": "https://github.com/sebastianbergmann/recursion-context/security/policy" + }, "prefer-stable": true, "config": { "platform": { @@ -29,7 +33,7 @@ "php": ">=8.1" }, "require-dev": { - "phpunit/phpunit": "^10.0" + "phpunit/phpunit": "^10.5" }, "autoload": { "classmap": [ diff --git a/vendor/sebastian/recursion-context/src/Context.php b/vendor/sebastian/recursion-context/src/Context.php index e900e21d..4be8704a 100644 --- a/vendor/sebastian/recursion-context/src/Context.php +++ b/vendor/sebastian/recursion-context/src/Context.php @@ -44,13 +44,13 @@ final class Context } /** - * @psalm-template T + * @psalm-template T of object|array * * @psalm-param T $value * * @param-out T $value */ - public function add(object|array &$value): int|string|false + public function add(array|object &$value): false|int|string { if (is_array($value)) { return $this->addArray($value); @@ -60,13 +60,13 @@ final class Context } /** - * @psalm-template T + * @psalm-template T of object|array * * @psalm-param T $value * * @param-out T $value */ - public function contains(object|array &$value): int|string|false + public function contains(array|object &$value): false|int|string { if (is_array($value)) { return $this->containsArray($value); @@ -116,23 +116,23 @@ final class Context private function addObject(object $object): string { - if (!$this->objects->contains($object)) { - $this->objects->attach($object); + if (!$this->objects->offsetExists($object)) { + $this->objects->offsetSet($object); } return spl_object_hash($object); } - private function containsArray(array $array): int|false + private function containsArray(array $array): false|int { $end = array_slice($array, -2); return isset($end[1]) && $end[1] === $this->objects ? $end[0] : false; } - private function containsObject(object $value): string|false + private function containsObject(object $value): false|string { - if ($this->objects->contains($value)) { + if ($this->objects->offsetExists($value)) { return spl_object_hash($value); } diff --git a/vendor/symfony/console/Application.php b/vendor/symfony/console/Application.php index 41548a3e..cc8c02ab 100644 --- a/vendor/symfony/console/Application.php +++ b/vendor/symfony/console/Application.php @@ -79,6 +79,7 @@ class Application implements ResetInterface private string $version; private ?CommandLoaderInterface $commandLoader = null; private bool $catchExceptions = true; + private bool $catchErrors = false; private bool $autoExit = true; private InputDefinition $definition; private HelperSet $helperSet; @@ -105,11 +106,14 @@ class Application implements ResetInterface /** * @final */ - public function setDispatcher(EventDispatcherInterface $dispatcher) + public function setDispatcher(EventDispatcherInterface $dispatcher): void { $this->dispatcher = $dispatcher; } + /** + * @return void + */ public function setCommandLoader(CommandLoaderInterface $commandLoader) { $this->commandLoader = $commandLoader; @@ -118,12 +122,15 @@ class Application implements ResetInterface public function getSignalRegistry(): SignalRegistry { if (!$this->signalRegistry) { - throw new RuntimeException('Signals are not supported. Make sure that the `pcntl` extension is installed and that "pcntl_*" functions are not disabled by your php.ini\'s "disable_functions" directive.'); + throw new RuntimeException('Signals are not supported. Make sure that the "pcntl" extension is installed and that "pcntl_*" functions are not disabled by your php.ini\'s "disable_functions" directive.'); } return $this->signalRegistry; } + /** + * @return void + */ public function setSignalsToDispatchEvent(int ...$signalsToDispatchEvent) { $this->signalsToDispatchEvent = $signalsToDispatchEvent; @@ -136,7 +143,7 @@ class Application implements ResetInterface * * @throws \Exception When running fails. Bypass this when {@link setCatchExceptions()}. */ - public function run(InputInterface $input = null, OutputInterface $output = null): int + public function run(?InputInterface $input = null, ?OutputInterface $output = null): int { if (\function_exists('putenv')) { @putenv('LINES='.$this->terminal->getHeight()); @@ -162,12 +169,15 @@ class Application implements ResetInterface } } - $this->configureIO($input, $output); - try { + $this->configureIO($input, $output); + $exitCode = $this->doRun($input, $output); - } catch (\Exception $e) { - if (!$this->catchExceptions) { + } catch (\Throwable $e) { + if ($e instanceof \Exception && !$this->catchExceptions) { + throw $e; + } + if (!$e instanceof \Exception && !$this->catchErrors) { throw $e; } @@ -260,9 +270,9 @@ class Application implements ResetInterface $style = new SymfonyStyle($input, $output); $output->writeln(''); - $formattedBlock = (new FormatterHelper())->formatBlock(sprintf('Command "%s" is not defined.', $name), 'error', true); + $formattedBlock = (new FormatterHelper())->formatBlock(\sprintf('Command "%s" is not defined.', $name), 'error', true); $output->writeln($formattedBlock); - if (!$style->confirm(sprintf('Do you want to run "%s" instead? ', $alternative), false)) { + if (!$style->confirm(\sprintf('Do you want to run "%s" instead? ', $alternative), false)) { if (null !== $this->dispatcher) { $event = new ConsoleErrorEvent($input, $output, $e); $this->dispatcher->dispatch($event, ConsoleEvents::ERROR); @@ -317,10 +327,16 @@ class Application implements ResetInterface return $exitCode; } + /** + * @return void + */ public function reset() { } + /** + * @return void + */ public function setHelperSet(HelperSet $helperSet) { $this->helperSet = $helperSet; @@ -334,6 +350,9 @@ class Application implements ResetInterface return $this->helperSet ??= $this->getDefaultHelperSet(); } + /** + * @return void + */ public function setDefinition(InputDefinition $definition) { $this->definition = $definition; @@ -384,6 +403,15 @@ class Application implements ResetInterface return; } + + if ( + CompletionInput::TYPE_OPTION_VALUE === $input->getCompletionType() + && ($definition = $this->getDefinition())->hasOption($input->getCompletionName()) + ) { + $definition->getOption($input->getCompletionName())->complete($input, $suggestions); + + return; + } } /** @@ -404,12 +432,22 @@ class Application implements ResetInterface /** * Sets whether to catch exceptions or not during commands execution. + * + * @return void */ public function setCatchExceptions(bool $boolean) { $this->catchExceptions = $boolean; } + /** + * Sets whether to catch errors or not during commands execution. + */ + public function setCatchErrors(bool $catchErrors = true): void + { + $this->catchErrors = $catchErrors; + } + /** * Gets whether to automatically exit after a command execution or not. */ @@ -420,6 +458,8 @@ class Application implements ResetInterface /** * Sets whether to automatically exit after a command execution or not. + * + * @return void */ public function setAutoExit(bool $boolean) { @@ -436,7 +476,9 @@ class Application implements ResetInterface /** * Sets the application name. - **/ + * + * @return void + */ public function setName(string $name) { $this->name = $name; @@ -452,6 +494,8 @@ class Application implements ResetInterface /** * Sets the application version. + * + * @return void */ public function setVersion(string $version) { @@ -467,7 +511,7 @@ class Application implements ResetInterface { if ('UNKNOWN' !== $this->getName()) { if ('UNKNOWN' !== $this->getVersion()) { - return sprintf('%s %s', $this->getName(), $this->getVersion()); + return \sprintf('%s %s', $this->getName(), $this->getVersion()); } return $this->getName(); @@ -490,6 +534,8 @@ class Application implements ResetInterface * If a Command is not enabled it will not be added. * * @param Command[] $commands An array of commands + * + * @return void */ public function addCommands(array $commands) { @@ -524,7 +570,7 @@ class Application implements ResetInterface } if (!$command->getName()) { - throw new LogicException(sprintf('The command defined in "%s" cannot have an empty name.', get_debug_type($command))); + throw new LogicException(\sprintf('The command defined in "%s" cannot have an empty name.', get_debug_type($command))); } $this->commands[$command->getName()] = $command; @@ -548,12 +594,12 @@ class Application implements ResetInterface $this->init(); if (!$this->has($name)) { - throw new CommandNotFoundException(sprintf('The command "%s" does not exist.', $name)); + throw new CommandNotFoundException(\sprintf('The command "%s" does not exist.', $name)); } // When the command has a different name than the one used at the command loader level if (!isset($this->commands[$name])) { - throw new CommandNotFoundException(sprintf('The "%s" command cannot be found because it is registered under multiple names. Make sure you don\'t set a different name via constructor or "setName()".', $name)); + throw new CommandNotFoundException(\sprintf('The "%s" command cannot be found because it is registered under multiple names. Make sure you don\'t set a different name via constructor or "setName()".', $name)); } $command = $this->commands[$name]; @@ -617,7 +663,7 @@ class Application implements ResetInterface $namespaces = preg_grep('{^'.$expr.'}', $allNamespaces); if (empty($namespaces)) { - $message = sprintf('There are no commands defined in the "%s" namespace.', $namespace); + $message = \sprintf('There are no commands defined in the "%s" namespace.', $namespace); if ($alternatives = $this->findAlternatives($namespace, $allNamespaces)) { if (1 == \count($alternatives)) { @@ -634,7 +680,7 @@ class Application implements ResetInterface $exact = \in_array($namespace, $namespaces, true); if (\count($namespaces) > 1 && !$exact) { - throw new NamespaceNotFoundException(sprintf("The namespace \"%s\" is ambiguous.\nDid you mean one of these?\n%s.", $namespace, $this->getAbbreviationSuggestions(array_values($namespaces))), array_values($namespaces)); + throw new NamespaceNotFoundException(\sprintf("The namespace \"%s\" is ambiguous.\nDid you mean one of these?\n%s.", $namespace, $this->getAbbreviationSuggestions(array_values($namespaces))), array_values($namespaces)); } return $exact ? $namespace : reset($namespaces); @@ -683,20 +729,17 @@ class Application implements ResetInterface $this->findNamespace(substr($name, 0, $pos)); } - $message = sprintf('Command "%s" is not defined.', $name); + $message = \sprintf('Command "%s" is not defined.', $name); if ($alternatives = $this->findAlternatives($name, $allCommands)) { - // remove hidden commands - $alternatives = array_filter($alternatives, function ($name) { - return !$this->get($name)->isHidden(); - }); + $wantHelps = $this->wantHelps; + $this->wantHelps = false; - if (1 == \count($alternatives)) { - $message .= "\n\nDid you mean this?\n "; - } else { - $message .= "\n\nDid you mean one of these?\n "; + // remove hidden commands + if ($alternatives = array_filter($alternatives, fn ($name) => !$this->get($name)->isHidden())) { + $message .= \sprintf("\n\nDid you mean %s?\n %s", 1 === \count($alternatives) ? 'this' : 'one of these', implode("\n ", $alternatives)); } - $message .= implode("\n ", $alternatives); + $this->wantHelps = $wantHelps; } throw new CommandNotFoundException($message, array_values($alternatives)); @@ -718,6 +761,21 @@ class Application implements ResetInterface })); } + // check whether all commands left are aliases to the same one + if (\count($commands) > 1) { + $uniqueCommands = array_unique(array_map(function ($nameOrAlias) use (&$commandList) { + if (!$commandList[$nameOrAlias] instanceof Command) { + $commandList[$nameOrAlias] = $this->commandLoader->get($nameOrAlias); + } + + return $commandList[$nameOrAlias]->getName(); + }, $commands)); + + if (1 === \count($uniqueCommands)) { + $commands = [reset($uniqueCommands)]; + } + } + if (\count($commands) > 1) { $usableWidth = $this->terminal->getWidth() - 10; $abbrevs = array_values($commands); @@ -725,7 +783,7 @@ class Application implements ResetInterface foreach ($abbrevs as $abbrev) { $maxLen = max(Helper::width($abbrev), $maxLen); } - $abbrevs = array_map(function ($cmd) use ($commandList, $usableWidth, $maxLen, &$commands) { + $abbrevs = array_map(static function ($cmd) use ($commandList, $usableWidth, $maxLen, &$commands) { if ($commandList[$cmd]->isHidden()) { unset($commands[array_search($cmd, $commands)]); @@ -740,14 +798,14 @@ class Application implements ResetInterface if (\count($commands) > 1) { $suggestions = $this->getAbbreviationSuggestions(array_filter($abbrevs)); - throw new CommandNotFoundException(sprintf("Command \"%s\" is ambiguous.\nDid you mean one of these?\n%s.", $name, $suggestions), array_values($commands)); + throw new CommandNotFoundException(\sprintf("Command \"%s\" is ambiguous.\nDid you mean one of these?\n%s.", $name, $suggestions), array_values($commands)); } } - $command = $this->get(reset($commands)); + $command = $commands ? $this->get(reset($commands)) : null; - if ($command->isHidden()) { - throw new CommandNotFoundException(sprintf('The command "%s" does not exist.', $name)); + if (!$command || $command->isHidden()) { + throw new CommandNotFoundException(\sprintf('The command "%s" does not exist.', $name)); } return $command; @@ -760,7 +818,7 @@ class Application implements ResetInterface * * @return Command[] */ - public function all(string $namespace = null) + public function all(?string $namespace = null) { $this->init(); @@ -822,7 +880,7 @@ class Application implements ResetInterface $this->doRenderThrowable($e, $output); if (null !== $this->runningCommand) { - $output->writeln(sprintf('%s', OutputFormatter::escape(sprintf($this->runningCommand->getSynopsis(), $this->getName()))), OutputInterface::VERBOSITY_QUIET); + $output->writeln(\sprintf('%s', OutputFormatter::escape(\sprintf($this->runningCommand->getSynopsis(), $this->getName()))), OutputInterface::VERBOSITY_QUIET); $output->writeln('', OutputInterface::VERBOSITY_QUIET); } } @@ -833,16 +891,14 @@ class Application implements ResetInterface $message = trim($e->getMessage()); if ('' === $message || OutputInterface::VERBOSITY_VERBOSE <= $output->getVerbosity()) { $class = get_debug_type($e); - $title = sprintf(' [%s%s] ', $class, 0 !== ($code = $e->getCode()) ? ' ('.$code.')' : ''); + $title = \sprintf(' [%s%s] ', $class, 0 !== ($code = $e->getCode()) ? ' ('.$code.')' : ''); $len = Helper::width($title); } else { $len = 0; } if (str_contains($message, "@anonymous\0")) { - $message = preg_replace_callback('/[a-zA-Z_\x7f-\xff][\\\\a-zA-Z0-9_\x7f-\xff]*+@anonymous\x00.*?\.php(?:0x?|:[0-9]++\$)[0-9a-fA-F]++/', function ($m) { - return class_exists($m[0], false) ? (get_parent_class($m[0]) ?: key(class_implements($m[0])) ?: 'class').'@anonymous' : $m[0]; - }, $message); + $message = preg_replace_callback('/[a-zA-Z_\x7f-\xff][\\\\a-zA-Z0-9_\x7f-\xff]*+@anonymous\x00.*?\.php(?:0x?|:[0-9]++\$)?[0-9a-fA-F]++/', static fn ($m) => class_exists($m[0], false) ? (get_parent_class($m[0]) ?: key(class_implements($m[0])) ?: 'class').'@anonymous' : $m[0], $message); } $width = $this->terminal->getWidth() ? $this->terminal->getWidth() - 1 : \PHP_INT_MAX; @@ -859,14 +915,14 @@ class Application implements ResetInterface $messages = []; if (!$e instanceof ExceptionInterface || OutputInterface::VERBOSITY_VERBOSE <= $output->getVerbosity()) { - $messages[] = sprintf('%s', OutputFormatter::escape(sprintf('In %s line %s:', basename($e->getFile()) ?: 'n/a', $e->getLine() ?: 'n/a'))); + $messages[] = \sprintf('%s', OutputFormatter::escape(\sprintf('In %s line %s:', basename($e->getFile()) ?: 'n/a', $e->getLine() ?: 'n/a'))); } - $messages[] = $emptyLine = sprintf('%s', str_repeat(' ', $len)); + $messages[] = $emptyLine = \sprintf('%s', str_repeat(' ', $len)); if ('' === $message || OutputInterface::VERBOSITY_VERBOSE <= $output->getVerbosity()) { - $messages[] = sprintf('%s%s', $title, str_repeat(' ', max(0, $len - Helper::width($title)))); + $messages[] = \sprintf('%s%s', $title, str_repeat(' ', max(0, $len - Helper::width($title)))); } foreach ($lines as $line) { - $messages[] = sprintf(' %s %s', OutputFormatter::escape($line[0]), str_repeat(' ', $len - $line[1])); + $messages[] = \sprintf(' %s %s', OutputFormatter::escape($line[0]), str_repeat(' ', $len - $line[1])); } $messages[] = $emptyLine; $messages[] = ''; @@ -893,7 +949,7 @@ class Application implements ResetInterface $file = $trace[$i]['file'] ?? 'n/a'; $line = $trace[$i]['line'] ?? 'n/a'; - $output->writeln(sprintf(' %s%s at %s:%s', $class, $function ? $type.$function.'()' : '', $file, $line), OutputInterface::VERBOSITY_QUIET); + $output->writeln(\sprintf(' %s%s at %s:%s', $class, $function ? $type.$function.'()' : '', $file, $line), OutputInterface::VERBOSITY_QUIET); } $output->writeln('', OutputInterface::VERBOSITY_QUIET); @@ -903,6 +959,8 @@ class Application implements ResetInterface /** * Configures the input and output instances based on the user arguments and options. + * + * @return void */ protected function configureIO(InputInterface $input, OutputInterface $output) { @@ -977,49 +1035,72 @@ class Application implements ResetInterface } } - if ($this->signalsToDispatchEvent) { - $commandSignals = $command instanceof SignalableCommandInterface ? $command->getSubscribedSignals() : []; - - if ($commandSignals || null !== $this->dispatcher) { - if (!$this->signalRegistry) { - throw new RuntimeException('Unable to subscribe to signal events. Make sure that the `pcntl` extension is installed and that "pcntl_*" functions are not disabled by your php.ini\'s "disable_functions" directive.'); - } - - if (Terminal::hasSttyAvailable()) { - $sttyMode = shell_exec('stty -g'); - - foreach ([\SIGINT, \SIGTERM] as $signal) { - $this->signalRegistry->register($signal, static function () use ($sttyMode) { - shell_exec('stty '.$sttyMode); - }); - } - } + $registeredSignals = false; + $commandSignals = $command instanceof SignalableCommandInterface ? $command->getSubscribedSignals() : []; + if ($commandSignals || $this->dispatcher && $this->signalsToDispatchEvent) { + if (!$this->signalRegistry) { + throw new RuntimeException('Unable to subscribe to signal events. Make sure that the "pcntl" extension is installed and that "pcntl_*" functions are not disabled by your php.ini\'s "disable_functions" directive.'); } - if (null !== $this->dispatcher) { + $registeredSignals = true; + $this->getSignalRegistry()->pushCurrentHandlers(); + + if ($this->dispatcher) { + // We register application signals, so that we can dispatch the event foreach ($this->signalsToDispatchEvent as $signal) { $event = new ConsoleSignalEvent($command, $input, $output, $signal); - $this->signalRegistry->register($signal, function ($signal, $hasNext) use ($event) { + $this->signalRegistry->register($signal, function ($signal) use ($event, $command, $commandSignals) { $this->dispatcher->dispatch($event, ConsoleEvents::SIGNAL); + $exitCode = $event->getExitCode(); - // No more handlers, we try to simulate PHP default behavior - if (!$hasNext) { - if (!\in_array($signal, [\SIGUSR1, \SIGUSR2], true)) { - exit(0); + // If the command is signalable, we call the handleSignal() method + if (\in_array($signal, $commandSignals, true)) { + $exitCode = $command->handleSignal($signal, $exitCode); + // BC layer for Symfony <= 5 + if (null === $exitCode) { + trigger_deprecation('symfony/console', '6.3', 'Not returning an exit code from "%s::handleSignal()" is deprecated, return "false" to keep the command running or "0" to exit successfully.', get_debug_type($command)); + $exitCode = 0; } } + + if (false !== $exitCode) { + $event = new ConsoleTerminateEvent($command, $event->getInput(), $event->getOutput(), $exitCode, $signal); + $this->dispatcher->dispatch($event, ConsoleEvents::TERMINATE); + + exit($event->getExitCode()); + } }); } + + // then we register command signals, but not if already handled after the dispatcher + $commandSignals = array_diff($commandSignals, $this->signalsToDispatchEvent); } foreach ($commandSignals as $signal) { - $this->signalRegistry->register($signal, [$command, 'handleSignal']); + $this->signalRegistry->register($signal, static function (int $signal) use ($command): void { + $exitCode = $command->handleSignal($signal); + // BC layer for Symfony <= 5 + if (null === $exitCode) { + trigger_deprecation('symfony/console', '6.3', 'Not returning an exit code from "%s::handleSignal()" is deprecated, return "false" to keep the command running or "0" to exit successfully.', get_debug_type($command)); + $exitCode = 0; + } + + if (false !== $exitCode) { + exit($exitCode); + } + }); } } if (null === $this->dispatcher) { - return $command->run($input, $output); + try { + return $command->run($input, $output); + } finally { + if ($registeredSignals) { + $this->getSignalRegistry()->popPreviousHandlers(); + } + } } // bind before the console.command event, so the listeners have access to input options/arguments @@ -1049,6 +1130,10 @@ class Application implements ResetInterface if (0 === $exitCode = $event->getExitCode()) { $e = null; } + } finally { + if ($registeredSignals) { + $this->getSignalRegistry()->popPreviousHandlers(); + } } $event = new ConsoleTerminateEvent($command, $input, $output, $exitCode); @@ -1121,7 +1206,7 @@ class Application implements ResetInterface * * This method is not part of public API and should not be used directly. */ - public function extractNamespace(string $name, int $limit = null): string + public function extractNamespace(string $name, ?int $limit = null): string { $parts = explode(':', $name, -1); @@ -1170,7 +1255,7 @@ class Application implements ResetInterface } } - $alternatives = array_filter($alternatives, function ($lev) use ($threshold) { return $lev < 2 * $threshold; }); + $alternatives = array_filter($alternatives, static fn ($lev) => $lev < 2 * $threshold); ksort($alternatives, \SORT_NATURAL | \SORT_FLAG_CASE); return array_keys($alternatives); @@ -1222,7 +1307,7 @@ class Application implements ResetInterface foreach (preg_split('//u', $m[0]) as $char) { // test if $char could be appended to current line - if (mb_strwidth($line.$char, 'utf8') <= $width) { + if (Helper::width($line.$char) <= $width) { $line .= $char; continue; } @@ -1234,9 +1319,7 @@ class Application implements ResetInterface $lines[] = \count($lines) ? str_pad($line, $width) : $line; - mb_convert_variables($encoding, 'utf8', $lines); - - return $lines; + return mb_convert_encoding($lines, $encoding, 'utf8'); } /** @@ -1261,7 +1344,7 @@ class Application implements ResetInterface return $namespaces; } - private function init() + private function init(): void { if ($this->initialized) { return; diff --git a/vendor/symfony/console/CHANGELOG.md b/vendor/symfony/console/CHANGELOG.md index 61c36b0e..9ccb41d9 100644 --- a/vendor/symfony/console/CHANGELOG.md +++ b/vendor/symfony/console/CHANGELOG.md @@ -1,6 +1,22 @@ CHANGELOG ========= +6.4 +--- + + * Add `SignalMap` to map signal value to its name + * Multi-line text in vertical tables is aligned properly + * The application can also catch errors with `Application::setCatchErrors(true)` + * Add `RunCommandMessage` and `RunCommandMessageHandler` + * Dispatch `ConsoleTerminateEvent` after an exit on signal handling and add `ConsoleTerminateEvent::getInterruptingSignal()` + +6.3 +--- + + * Add support for choosing exit code while handling signal, or to not exit at all + * Add `ProgressBar::setPlaceholderFormatter` to set a placeholder attached to a instance, instead of being global. + * Add `ReStructuredTextDescriptor` + 6.2 --- diff --git a/vendor/symfony/console/CI/GithubActionReporter.php b/vendor/symfony/console/CI/GithubActionReporter.php index 7e556546..28112c2a 100644 --- a/vendor/symfony/console/CI/GithubActionReporter.php +++ b/vendor/symfony/console/CI/GithubActionReporter.php @@ -57,7 +57,7 @@ class GithubActionReporter * * @see https://docs.github.com/en/free-pro-team@latest/actions/reference/workflow-commands-for-github-actions#setting-an-error-message */ - public function error(string $message, string $file = null, int $line = null, int $col = null): void + public function error(string $message, ?string $file = null, ?int $line = null, ?int $col = null): void { $this->log('error', $message, $file, $line, $col); } @@ -67,7 +67,7 @@ class GithubActionReporter * * @see https://docs.github.com/en/free-pro-team@latest/actions/reference/workflow-commands-for-github-actions#setting-a-warning-message */ - public function warning(string $message, string $file = null, int $line = null, int $col = null): void + public function warning(string $message, ?string $file = null, ?int $line = null, ?int $col = null): void { $this->log('warning', $message, $file, $line, $col); } @@ -77,23 +77,23 @@ class GithubActionReporter * * @see https://docs.github.com/en/free-pro-team@latest/actions/reference/workflow-commands-for-github-actions#setting-a-debug-message */ - public function debug(string $message, string $file = null, int $line = null, int $col = null): void + public function debug(string $message, ?string $file = null, ?int $line = null, ?int $col = null): void { $this->log('debug', $message, $file, $line, $col); } - private function log(string $type, string $message, string $file = null, int $line = null, int $col = null): void + private function log(string $type, string $message, ?string $file = null, ?int $line = null, ?int $col = null): void { // Some values must be encoded. $message = strtr($message, self::ESCAPED_DATA); if (!$file) { // No file provided, output the message solely: - $this->output->writeln(sprintf('::%s::%s', $type, $message)); + $this->output->writeln(\sprintf('::%s::%s', $type, $message)); return; } - $this->output->writeln(sprintf('::%s file=%s,line=%s,col=%s::%s', $type, strtr($file, self::ESCAPED_PROPERTIES), strtr($line ?? 1, self::ESCAPED_PROPERTIES), strtr($col ?? 0, self::ESCAPED_PROPERTIES), $message)); + $this->output->writeln(\sprintf('::%s file=%s,line=%s,col=%s::%s', $type, strtr($file, self::ESCAPED_PROPERTIES), strtr($line ?? 1, self::ESCAPED_PROPERTIES), strtr($col ?? 0, self::ESCAPED_PROPERTIES), $message)); } } diff --git a/vendor/symfony/console/Color.php b/vendor/symfony/console/Color.php index 60ed046a..b1914c19 100644 --- a/vendor/symfony/console/Color.php +++ b/vendor/symfony/console/Color.php @@ -60,7 +60,7 @@ final class Color foreach ($options as $option) { if (!isset(self::AVAILABLE_OPTIONS[$option])) { - throw new InvalidArgumentException(sprintf('Invalid option specified: "%s". Expected one of (%s).', $option, implode(', ', array_keys(self::AVAILABLE_OPTIONS)))); + throw new InvalidArgumentException(\sprintf('Invalid option specified: "%s". Expected one of (%s).', $option, implode(', ', array_keys(self::AVAILABLE_OPTIONS)))); } $this->options[$option] = self::AVAILABLE_OPTIONS[$option]; @@ -88,7 +88,7 @@ final class Color return ''; } - return sprintf("\033[%sm", implode(';', $setCodes)); + return \sprintf("\033[%sm", implode(';', $setCodes)); } public function unset(): string @@ -107,7 +107,7 @@ final class Color return ''; } - return sprintf("\033[%sm", implode(';', $unsetCodes)); + return \sprintf("\033[%sm", implode(';', $unsetCodes)); } private function parseColor(string $color, bool $background = false): string @@ -128,6 +128,6 @@ final class Color return ($background ? '10' : '9').self::BRIGHT_COLORS[$color]; } - throw new InvalidArgumentException(sprintf('Invalid "%s" color; expected one of (%s).', $color, implode(', ', array_merge(array_keys(self::COLORS), array_keys(self::BRIGHT_COLORS))))); + throw new InvalidArgumentException(\sprintf('Invalid "%s" color; expected one of (%s).', $color, implode(', ', array_merge(array_keys(self::COLORS), array_keys(self::BRIGHT_COLORS))))); } } diff --git a/vendor/symfony/console/Command/Command.php b/vendor/symfony/console/Command/Command.php index 1e3c1a5a..3ede6ca6 100644 --- a/vendor/symfony/console/Command/Command.php +++ b/vendor/symfony/console/Command/Command.php @@ -111,7 +111,7 @@ class Command * * @throws LogicException When the command name is empty */ - public function __construct(string $name = null) + public function __construct(?string $name = null) { $this->definition = new InputDefinition(); @@ -141,13 +141,18 @@ class Command * Ignores validation errors. * * This is mainly useful for the help command. + * + * @return void */ public function ignoreValidationErrors() { $this->ignoreValidationErrors = true; } - public function setApplication(Application $application = null) + /** + * @return void + */ + public function setApplication(?Application $application = null) { if (1 > \func_num_args()) { trigger_deprecation('symfony/console', '6.2', 'Calling "%s()" without any arguments is deprecated, pass null explicitly instead.', __METHOD__); @@ -162,6 +167,9 @@ class Command $this->fullDefinition = null; } + /** + * @return void + */ public function setHelperSet(HelperSet $helperSet) { $this->helperSet = $helperSet; @@ -198,6 +206,8 @@ class Command /** * Configures the current command. + * + * @return void */ protected function configure() { @@ -228,6 +238,8 @@ class Command * This method is executed before the InputDefinition is validated. * This means that this is the only place where the command can * interactively ask for values of missing required arguments. + * + * @return void */ protected function interact(InputInterface $input, OutputInterface $output) { @@ -242,6 +254,8 @@ class Command * * @see InputInterface::bind() * @see InputInterface::validate() + * + * @return void */ protected function initialize(InputInterface $input, OutputInterface $output) { @@ -312,7 +326,7 @@ class Command $statusCode = $this->execute($input, $output); if (!\is_int($statusCode)) { - throw new \TypeError(sprintf('Return value of "%s::execute()" must be of the type int, "%s" returned.', static::class, get_debug_type($statusCode))); + throw new \TypeError(\sprintf('Return value of "%s::execute()" must be of the type int, "%s" returned.', static::class, get_debug_type($statusCode))); } } @@ -378,7 +392,7 @@ class Command * * @internal */ - public function mergeApplicationDefinition(bool $mergeArgs = true) + public function mergeApplicationDefinition(bool $mergeArgs = true): void { if (null === $this->application) { return; @@ -432,7 +446,7 @@ class Command */ public function getNativeDefinition(): InputDefinition { - return $this->definition ?? throw new LogicException(sprintf('Command class "%s" is not correctly initialized. You probably forgot to call the parent constructor.', static::class)); + return $this->definition ?? throw new LogicException(\sprintf('Command class "%s" is not correctly initialized. You probably forgot to call the parent constructor.', static::class)); } /** @@ -446,11 +460,11 @@ class Command * * @throws InvalidArgumentException When argument mode is not valid */ - public function addArgument(string $name, int $mode = null, string $description = '', mixed $default = null /* array|\Closure $suggestedValues = null */): static + public function addArgument(string $name, ?int $mode = null, string $description = '', mixed $default = null /* array|\Closure $suggestedValues = null */): static { $suggestedValues = 5 <= \func_num_args() ? func_get_arg(4) : []; if (!\is_array($suggestedValues) && !$suggestedValues instanceof \Closure) { - throw new \TypeError(sprintf('Argument 5 passed to "%s()" must be array or \Closure, "%s" given.', __METHOD__, get_debug_type($suggestedValues))); + throw new \TypeError(\sprintf('Argument 5 passed to "%s()" must be array or \Closure, "%s" given.', __METHOD__, get_debug_type($suggestedValues))); } $this->definition->addArgument(new InputArgument($name, $mode, $description, $default, $suggestedValues)); $this->fullDefinition?->addArgument(new InputArgument($name, $mode, $description, $default, $suggestedValues)); @@ -470,11 +484,11 @@ class Command * * @throws InvalidArgumentException If option mode is invalid or incompatible */ - public function addOption(string $name, string|array $shortcut = null, int $mode = null, string $description = '', mixed $default = null /* array|\Closure $suggestedValues = [] */): static + public function addOption(string $name, string|array|null $shortcut = null, ?int $mode = null, string $description = '', mixed $default = null /* array|\Closure $suggestedValues = [] */): static { $suggestedValues = 6 <= \func_num_args() ? func_get_arg(5) : []; if (!\is_array($suggestedValues) && !$suggestedValues instanceof \Closure) { - throw new \TypeError(sprintf('Argument 5 passed to "%s()" must be array or \Closure, "%s" given.', __METHOD__, get_debug_type($suggestedValues))); + throw new \TypeError(\sprintf('Argument 5 passed to "%s()" must be array or \Closure, "%s" given.', __METHOD__, get_debug_type($suggestedValues))); } $this->definition->addOption(new InputOption($name, $shortcut, $mode, $description, $default, $suggestedValues)); $this->fullDefinition?->addOption(new InputOption($name, $shortcut, $mode, $description, $default, $suggestedValues)); @@ -648,7 +662,7 @@ class Command $key = $short ? 'short' : 'long'; if (!isset($this->synopsis[$key])) { - $this->synopsis[$key] = trim(sprintf('%s %s', $this->name, $this->definition->getSynopsis($short))); + $this->synopsis[$key] = trim(\sprintf('%s %s', $this->name, $this->definition->getSynopsis($short))); } return $this->synopsis[$key]; @@ -662,7 +676,7 @@ class Command public function addUsage(string $usage): static { if (!str_starts_with($usage, $this->name)) { - $usage = sprintf('%s %s', $this->name, $usage); + $usage = \sprintf('%s %s', $this->name, $usage); } $this->usages[] = $usage; @@ -689,7 +703,7 @@ class Command public function getHelper(string $name): mixed { if (null === $this->helperSet) { - throw new LogicException(sprintf('Cannot retrieve helper "%s" because there is no HelperSet defined. Did you forget to add your command to the application or to set the application on the command using the setApplication() method? You can also set the HelperSet directly using the setHelperSet() method.', $name)); + throw new LogicException(\sprintf('Cannot retrieve helper "%s" because there is no HelperSet defined. Did you forget to add your command to the application or to set the application on the command using the setApplication() method? You can also set the HelperSet directly using the setHelperSet() method.', $name)); } return $this->helperSet->get($name); @@ -702,10 +716,10 @@ class Command * * @throws InvalidArgumentException When the name is invalid */ - private function validateName(string $name) + private function validateName(string $name): void { if (!preg_match('/^[^\:]++(\:[^\:]++)*$/', $name)) { - throw new InvalidArgumentException(sprintf('Command name "%s" is invalid.', $name)); + throw new InvalidArgumentException(\sprintf('Command name "%s" is invalid.', $name)); } } } diff --git a/vendor/symfony/console/Command/CompleteCommand.php b/vendor/symfony/console/Command/CompleteCommand.php index e65b334c..1af8bf7a 100644 --- a/vendor/symfony/console/Command/CompleteCommand.php +++ b/vendor/symfony/console/Command/CompleteCommand.php @@ -44,9 +44,9 @@ final class CompleteCommand extends Command */ protected static $defaultDescription = 'Internal command to provide shell completion suggestions'; - private $completionOutputs; + private array $completionOutputs; - private $isDebug = false; + private bool $isDebug = false; /** * @param array> $completionOutputs A list of additional completion outputs, with shell name as key and FQCN as value @@ -74,7 +74,7 @@ final class CompleteCommand extends Command ; } - protected function initialize(InputInterface $input, OutputInterface $output) + protected function initialize(InputInterface $input, OutputInterface $output): void { $this->isDebug = filter_var(getenv('SYMFONY_COMPLETION_DEBUG'), \FILTER_VALIDATE_BOOL); } @@ -85,7 +85,7 @@ final class CompleteCommand extends Command // "symfony" must be kept for compat with the shell scripts generated by Symfony Console 5.4 - 6.1 $version = $input->getOption('symfony') ? '1' : $input->getOption('api-version'); if ($version && version_compare($version, self::COMPLETION_API_VERSION, '<')) { - $message = sprintf('Completion script version is not supported ("%s" given, ">=%s" required).', $version, self::COMPLETION_API_VERSION); + $message = \sprintf('Completion script version is not supported ("%s" given, ">=%s" required).', $version, self::COMPLETION_API_VERSION); $this->log($message); $output->writeln($message.' Install the Symfony completion script again by using the "completion" command.'); @@ -99,7 +99,7 @@ final class CompleteCommand extends Command } if (!$completionOutput = $this->completionOutputs[$shell] ?? false) { - throw new \RuntimeException(sprintf('Shell completion is not supported for your shell: "%s" (supported: "%s").', $shell, implode('", "', array_keys($this->completionOutputs)))); + throw new \RuntimeException(\sprintf('Shell completion is not supported for your shell: "%s" (supported: "%s").', $shell, implode('", "', array_keys($this->completionOutputs)))); } $completionInput = $this->createCompletionInput($input); @@ -115,31 +115,37 @@ final class CompleteCommand extends Command 'Messages:', ]); - $command = $this->findCommand($completionInput, $output); + if ($command = $this->findCommand($completionInput, $output)) { + $command->mergeApplicationDefinition(); + $completionInput->bind($command->getDefinition()); + } + if (null === $command) { $this->log(' No command found, completing using the Application class.'); $this->getApplication()->complete($completionInput, $suggestions); } elseif ( $completionInput->mustSuggestArgumentValuesFor('command') - && $command->getName() !== $completionInput->getCompletionValue() - && !\in_array($completionInput->getCompletionValue(), $command->getAliases(), true) ) { - $this->log(' No command found, completing using the Application class.'); + $this->log(' Command found, completing command name.'); // expand shortcut names ("cache:cl") into their full name ("cache:clear") - $suggestions->suggestValues(array_filter(array_merge([$command->getName()], $command->getAliases()))); + $commandNames = array_filter(array_merge([$command->getName()], $command->getAliases())); + foreach ($commandNames as $name) { + if (str_starts_with($name, $completionInput->getCompletionValue())) { + $commandNames = [$name]; + break; + } + } + $suggestions->suggestValues($commandNames); } else { - $command->mergeApplicationDefinition(); - $completionInput->bind($command->getDefinition()); - if (CompletionInput::TYPE_OPTION_NAME === $completionInput->getCompletionType()) { - $this->log(' Completing option names for the '.\get_class($command instanceof LazyCommand ? $command->getCommand() : $command).' command.'); + $this->log(' Completing option names for the '.($command instanceof LazyCommand ? $command->getCommand() : $command)::class.' command.'); $suggestions->suggestOptions($command->getDefinition()->getOptions()); } else { $this->log([ - ' Completing using the '.\get_class($command instanceof LazyCommand ? $command->getCommand() : $command).' class.', + ' Completing using the '.($command instanceof LazyCommand ? $command->getCommand() : $command)::class.' class.', ' Completing '.$completionInput->getCompletionType().' for '.$completionInput->getCompletionName().'', ]); if (null !== $compval = $completionInput->getCompletionValue()) { @@ -155,7 +161,7 @@ final class CompleteCommand extends Command $this->log('Suggestions:'); if ($options = $suggestions->getOptionSuggestions()) { - $this->log(' --'.implode(' --', array_map(function ($o) { return $o->getName(); }, $options))); + $this->log(' --'.implode(' --', array_map(static fn ($o) => $o->getName(), $options))); } elseif ($values = $suggestions->getValueSuggestions()) { $this->log(' '.implode(' ', $values)); } else { @@ -173,10 +179,10 @@ final class CompleteCommand extends Command throw $e; } - return self::FAILURE; + return 2; } - return self::SUCCESS; + return 0; } private function createCompletionInput(InputInterface $input): CompletionInput diff --git a/vendor/symfony/console/Command/DumpCompletionCommand.php b/vendor/symfony/console/Command/DumpCompletionCommand.php index 1ad1c0e7..088a8921 100644 --- a/vendor/symfony/console/Command/DumpCompletionCommand.php +++ b/vendor/symfony/console/Command/DumpCompletionCommand.php @@ -39,7 +39,7 @@ final class DumpCompletionCommand extends Command private array $supportedShells; - protected function configure() + protected function configure(): void { $fullCommand = $_SERVER['PHP_SELF']; $commandName = basename($fullCommand); @@ -48,39 +48,41 @@ final class DumpCompletionCommand extends Command $shell = $this->guessShell(); [$rcFile, $completionFile] = match ($shell) { 'fish' => ['~/.config/fish/config.fish', "/etc/fish/completions/$commandName.fish"], - 'zsh' => ['~/.zshrc', '$fpath[1]/'.$commandName], + 'zsh' => ['~/.zshrc', '$fpath[1]/_'.$commandName], default => ['~/.bashrc', "/etc/bash_completion.d/$commandName"], }; + $supportedShells = implode(', ', $this->getSupportedShells()); + $this ->setHelp(<<%command.name% command dumps the shell completion script required -to use shell autocompletion (currently, bash and fish completion is supported). + The %command.name% command dumps the shell completion script required + to use shell autocompletion (currently, {$supportedShells} completion are supported). -Static installation -------------------- + Static installation + ------------------- -Dump the script to a global completion file and restart your shell: + Dump the script to a global completion file and restart your shell: - %command.full_name% {$shell} | sudo tee {$completionFile} + %command.full_name% {$shell} | sudo tee {$completionFile} -Or dump the script to a local file and source it: + Or dump the script to a local file and source it: - %command.full_name% {$shell} > completion.sh + %command.full_name% {$shell} > completion.sh - # source the file whenever you use the project - source completion.sh + # source the file whenever you use the project + source completion.sh - # or add this line at the end of your "{$rcFile}" file: - source /path/to/completion.sh + # or add this line at the end of your "{$rcFile}" file: + source /path/to/completion.sh -Dynamic installation --------------------- + Dynamic installation + -------------------- -Add this to the end of your shell configuration file (e.g. "{$rcFile}"): + Add this to the end of your shell configuration file (e.g. "{$rcFile}"): - eval "$({$fullCommand} completion {$shell})" -EOH + eval "$({$fullCommand} completion {$shell})" + EOH ) ->addArgument('shell', InputArgument::OPTIONAL, 'The shell type (e.g. "bash"), the value of the "$SHELL" env var will be used if this is not given', null, $this->getSupportedShells(...)) ->addOption('debug', null, InputOption::VALUE_NONE, 'Tail the completion debug log') @@ -94,7 +96,7 @@ EOH if ($input->getOption('debug')) { $this->tailDebugLog($commandName, $output); - return self::SUCCESS; + return 0; } $shell = $input->getArgument('shell') ?? self::guessShell(); @@ -106,17 +108,17 @@ EOH $output = $output->getErrorOutput(); } if ($shell) { - $output->writeln(sprintf('Detected shell "%s", which is not supported by Symfony shell completion (supported shells: "%s").', $shell, implode('", "', $supportedShells))); + $output->writeln(\sprintf('Detected shell "%s", which is not supported by Symfony shell completion (supported shells: "%s").', $shell, implode('", "', $supportedShells))); } else { - $output->writeln(sprintf('Shell not detected, Symfony shell completion only supports "%s").', implode('", "', $supportedShells))); + $output->writeln(\sprintf('Shell not detected, Symfony shell completion only supports "%s").', implode('", "', $supportedShells))); } - return self::INVALID; + return 2; } $output->write(str_replace(['{{ COMMAND_NAME }}', '{{ VERSION }}'], [$commandName, CompleteCommand::COMPLETION_API_VERSION], file_get_contents($completionFile))); - return self::SUCCESS; + return 0; } private static function guessShell(): string @@ -131,7 +133,7 @@ EOH touch($debugFile); } $process = new Process(['tail', '-f', $debugFile], null, null, null, 0); - $process->run(function (string $type, string $line) use ($output): void { + $process->run(static function (string $type, string $line) use ($output): void { $output->write($line); }); } @@ -141,8 +143,19 @@ EOH */ private function getSupportedShells(): array { - return $this->supportedShells ??= array_map(function ($f) { - return pathinfo($f, \PATHINFO_EXTENSION); - }, glob(__DIR__.'/../Resources/completion.*')); + if (isset($this->supportedShells)) { + return $this->supportedShells; + } + + $shells = []; + + foreach (new \DirectoryIterator(__DIR__.'/../Resources/') as $file) { + if (str_starts_with($file->getBasename(), 'completion.') && $file->isFile()) { + $shells[] = $file->getExtension(); + } + } + sort($shells); + + return $this->supportedShells = $shells; } } diff --git a/vendor/symfony/console/Command/HelpCommand.php b/vendor/symfony/console/Command/HelpCommand.php index d4134e17..96972210 100644 --- a/vendor/symfony/console/Command/HelpCommand.php +++ b/vendor/symfony/console/Command/HelpCommand.php @@ -27,6 +27,9 @@ class HelpCommand extends Command { private Command $command; + /** + * @return void + */ protected function configure() { $this->ignoreValidationErrors(); @@ -34,30 +37,29 @@ class HelpCommand extends Command $this ->setName('help') ->setDefinition([ - new InputArgument('command_name', InputArgument::OPTIONAL, 'The command name', 'help', function () { - return array_keys((new ApplicationDescription($this->getApplication()))->getCommands()); - }), - new InputOption('format', null, InputOption::VALUE_REQUIRED, 'The output format (txt, xml, json, or md)', 'txt', function () { - return (new DescriptorHelper())->getFormats(); - }), + new InputArgument('command_name', InputArgument::OPTIONAL, 'The command name', 'help', fn () => array_keys((new ApplicationDescription($this->getApplication()))->getCommands())), + new InputOption('format', null, InputOption::VALUE_REQUIRED, 'The output format (txt, xml, json, or md)', 'txt', static fn () => (new DescriptorHelper())->getFormats()), new InputOption('raw', null, InputOption::VALUE_NONE, 'To output raw command help'), ]) ->setDescription('Display help for a command') ->setHelp(<<<'EOF' -The %command.name% command displays help for a given command: + The %command.name% command displays help for a given command: - %command.full_name% list + %command.full_name% list -You can also output the help in other formats by using the --format option: + You can also output the help in other formats by using the --format option: - %command.full_name% --format=xml list + %command.full_name% --format=xml list -To display the list of available commands, please use the list command. -EOF + To display the list of available commands, please use the list command. + EOF ) ; } + /** + * @return void + */ public function setCommand(Command $command) { $this->command = $command; diff --git a/vendor/symfony/console/Command/LazyCommand.php b/vendor/symfony/console/Command/LazyCommand.php index d5605822..b94da666 100644 --- a/vendor/symfony/console/Command/LazyCommand.php +++ b/vendor/symfony/console/Command/LazyCommand.php @@ -45,7 +45,7 @@ final class LazyCommand extends Command $this->getCommand()->ignoreValidationErrors(); } - public function setApplication(Application $application = null): void + public function setApplication(?Application $application = null): void { if (1 > \func_num_args()) { trigger_deprecation('symfony/console', '6.2', 'Calling "%s()" without any arguments is deprecated, pass null explicitly instead.', __METHOD__); @@ -116,7 +116,7 @@ final class LazyCommand extends Command /** * @param array|\Closure(CompletionInput,CompletionSuggestions):list $suggestedValues The values used for input completion */ - public function addArgument(string $name, int $mode = null, string $description = '', mixed $default = null /* array|\Closure $suggestedValues = [] */): static + public function addArgument(string $name, ?int $mode = null, string $description = '', mixed $default = null /* array|\Closure $suggestedValues = [] */): static { $suggestedValues = 5 <= \func_num_args() ? func_get_arg(4) : []; $this->getCommand()->addArgument($name, $mode, $description, $default, $suggestedValues); @@ -127,7 +127,7 @@ final class LazyCommand extends Command /** * @param array|\Closure(CompletionInput,CompletionSuggestions):list $suggestedValues The values used for input completion */ - public function addOption(string $name, string|array $shortcut = null, int $mode = null, string $description = '', mixed $default = null /* array|\Closure $suggestedValues = [] */): static + public function addOption(string $name, string|array|null $shortcut = null, ?int $mode = null, string $description = '', mixed $default = null /* array|\Closure $suggestedValues = [] */): static { $suggestedValues = 6 <= \func_num_args() ? func_get_arg(5) : []; $this->getCommand()->addOption($name, $shortcut, $mode, $description, $default, $suggestedValues); diff --git a/vendor/symfony/console/Command/ListCommand.php b/vendor/symfony/console/Command/ListCommand.php index cab88b43..b6c44679 100644 --- a/vendor/symfony/console/Command/ListCommand.php +++ b/vendor/symfony/console/Command/ListCommand.php @@ -25,38 +25,37 @@ use Symfony\Component\Console\Output\OutputInterface; */ class ListCommand extends Command { + /** + * @return void + */ protected function configure() { $this ->setName('list') ->setDefinition([ - new InputArgument('namespace', InputArgument::OPTIONAL, 'The namespace name', null, function () { - return array_keys((new ApplicationDescription($this->getApplication()))->getNamespaces()); - }), + new InputArgument('namespace', InputArgument::OPTIONAL, 'The namespace name', null, fn () => array_keys((new ApplicationDescription($this->getApplication()))->getNamespaces())), new InputOption('raw', null, InputOption::VALUE_NONE, 'To output raw command list'), - new InputOption('format', null, InputOption::VALUE_REQUIRED, 'The output format (txt, xml, json, or md)', 'txt', function () { - return (new DescriptorHelper())->getFormats(); - }), + new InputOption('format', null, InputOption::VALUE_REQUIRED, 'The output format (txt, xml, json, or md)', 'txt', static fn () => (new DescriptorHelper())->getFormats()), new InputOption('short', null, InputOption::VALUE_NONE, 'To skip describing commands\' arguments'), ]) ->setDescription('List commands') ->setHelp(<<<'EOF' -The %command.name% command lists all commands: + The %command.name% command lists all commands: - %command.full_name% + %command.full_name% -You can also display the commands for a specific namespace: + You can also display the commands for a specific namespace: - %command.full_name% test + %command.full_name% test -You can also output the information in other formats by using the --format option: + You can also output the information in other formats by using the --format option: - %command.full_name% --format=xml + %command.full_name% --format=xml -It's also possible to get raw list of commands (useful for embedding command runner): + It's also possible to get raw list of commands (useful for embedding command runner): - %command.full_name% --raw -EOF + %command.full_name% --raw + EOF ) ; } diff --git a/vendor/symfony/console/Command/LockableTrait.php b/vendor/symfony/console/Command/LockableTrait.php index 67923a9e..cd7548f0 100644 --- a/vendor/symfony/console/Command/LockableTrait.php +++ b/vendor/symfony/console/Command/LockableTrait.php @@ -29,10 +29,10 @@ trait LockableTrait /** * Locks a command. */ - private function lock(string $name = null, bool $blocking = false): bool + private function lock(?string $name = null, bool $blocking = false): bool { if (!class_exists(SemaphoreStore::class)) { - throw new LogicException('To enable the locking feature you must install the symfony/lock component.'); + throw new LogicException('To enable the locking feature you must install the symfony/lock component. Try running "composer require symfony/lock".'); } if (null !== $this->lock) { @@ -58,7 +58,7 @@ trait LockableTrait /** * Releases the command lock if there is one. */ - private function release() + private function release(): void { if ($this->lock) { $this->lock->release(); diff --git a/vendor/symfony/console/Command/SignalableCommandInterface.php b/vendor/symfony/console/Command/SignalableCommandInterface.php index d439728b..74d59b08 100644 --- a/vendor/symfony/console/Command/SignalableCommandInterface.php +++ b/vendor/symfony/console/Command/SignalableCommandInterface.php @@ -25,6 +25,10 @@ interface SignalableCommandInterface /** * The method will be called when the application is signaled. + * + * @param int|false $previousExitCode + * + * @return int|false The exit code to return or false to continue the normal execution */ - public function handleSignal(int $signal): void; + public function handleSignal(int $signal/* , int|false $previousExitCode = 0 */); } diff --git a/vendor/symfony/console/CommandLoader/ContainerCommandLoader.php b/vendor/symfony/console/CommandLoader/ContainerCommandLoader.php index bfa0ac46..1638f2fd 100644 --- a/vendor/symfony/console/CommandLoader/ContainerCommandLoader.php +++ b/vendor/symfony/console/CommandLoader/ContainerCommandLoader.php @@ -37,7 +37,7 @@ class ContainerCommandLoader implements CommandLoaderInterface public function get(string $name): Command { if (!$this->has($name)) { - throw new CommandNotFoundException(sprintf('Command "%s" does not exist.', $name)); + throw new CommandNotFoundException(\sprintf('Command "%s" does not exist.', $name)); } return $this->container->get($this->commandMap[$name]); diff --git a/vendor/symfony/console/CommandLoader/FactoryCommandLoader.php b/vendor/symfony/console/CommandLoader/FactoryCommandLoader.php index 9ced75ae..ffe1b520 100644 --- a/vendor/symfony/console/CommandLoader/FactoryCommandLoader.php +++ b/vendor/symfony/console/CommandLoader/FactoryCommandLoader.php @@ -39,7 +39,7 @@ class FactoryCommandLoader implements CommandLoaderInterface public function get(string $name): Command { if (!isset($this->factories[$name])) { - throw new CommandNotFoundException(sprintf('Command "%s" does not exist.', $name)); + throw new CommandNotFoundException(\sprintf('Command "%s" does not exist.', $name)); } $factory = $this->factories[$name]; diff --git a/vendor/symfony/console/Completion/CompletionInput.php b/vendor/symfony/console/Completion/CompletionInput.php index 3ef8db5d..79c2f659 100644 --- a/vendor/symfony/console/Completion/CompletionInput.php +++ b/vendor/symfony/console/Completion/CompletionInput.php @@ -31,11 +31,11 @@ final class CompletionInput extends ArgvInput public const TYPE_OPTION_NAME = 'option_name'; public const TYPE_NONE = 'none'; - private $tokens; - private $currentIndex; - private $completionType; - private $completionName = null; - private $completionValue = ''; + private array $tokens; + private int $currentIndex; + private string $completionType; + private ?string $completionName = null; + private string $completionValue = ''; /** * Converts a terminal string into tokens. @@ -53,7 +53,7 @@ final class CompletionInput extends ArgvInput * Create an input based on an COMP_WORDS token list. * * @param string[] $tokens the set of split tokens (e.g. COMP_WORDS or argv) - * @param $currentIndex the index of the cursor (e.g. COMP_CWORD) + * @param int $currentIndex the index of the cursor (e.g. COMP_CWORD) */ public static function fromTokens(array $tokens, int $currentIndex): self { @@ -141,7 +141,9 @@ final class CompletionInput extends ArgvInput * TYPE_OPTION_NAME when completing the name of an input option * TYPE_NONE when nothing should be completed * - * @return string One of self::TYPE_* constants. TYPE_OPTION_NAME and TYPE_NONE are already implemented by the Console component + * TYPE_OPTION_NAME and TYPE_NONE are already implemented by the Console component. + * + * @return self::TYPE_* */ public function getCompletionType(): string { diff --git a/vendor/symfony/console/Completion/CompletionSuggestions.php b/vendor/symfony/console/Completion/CompletionSuggestions.php index 71911817..549bbafb 100644 --- a/vendor/symfony/console/Completion/CompletionSuggestions.php +++ b/vendor/symfony/console/Completion/CompletionSuggestions.php @@ -20,8 +20,8 @@ use Symfony\Component\Console\Input\InputOption; */ final class CompletionSuggestions { - private $valueSuggestions = []; - private $optionSuggestions = []; + private array $valueSuggestions = []; + private array $optionSuggestions = []; /** * Add a suggested value for an input option or argument. diff --git a/vendor/symfony/console/Completion/Suggestion.php b/vendor/symfony/console/Completion/Suggestion.php index 7392965a..3251b079 100644 --- a/vendor/symfony/console/Completion/Suggestion.php +++ b/vendor/symfony/console/Completion/Suggestion.php @@ -20,7 +20,7 @@ class Suggestion implements \Stringable { public function __construct( private readonly string $value, - private readonly string $description = '' + private readonly string $description = '', ) { } diff --git a/vendor/symfony/console/Cursor.php b/vendor/symfony/console/Cursor.php index b7f5a17e..45243c79 100644 --- a/vendor/symfony/console/Cursor.php +++ b/vendor/symfony/console/Cursor.php @@ -19,6 +19,7 @@ use Symfony\Component\Console\Output\OutputInterface; final class Cursor { private OutputInterface $output; + /** @var resource */ private $input; /** @@ -35,7 +36,7 @@ final class Cursor */ public function moveUp(int $lines = 1): static { - $this->output->write(sprintf("\x1b[%dA", $lines)); + $this->output->write(\sprintf("\x1b[%dA", $lines)); return $this; } @@ -45,7 +46,7 @@ final class Cursor */ public function moveDown(int $lines = 1): static { - $this->output->write(sprintf("\x1b[%dB", $lines)); + $this->output->write(\sprintf("\x1b[%dB", $lines)); return $this; } @@ -55,7 +56,7 @@ final class Cursor */ public function moveRight(int $columns = 1): static { - $this->output->write(sprintf("\x1b[%dC", $columns)); + $this->output->write(\sprintf("\x1b[%dC", $columns)); return $this; } @@ -65,7 +66,7 @@ final class Cursor */ public function moveLeft(int $columns = 1): static { - $this->output->write(sprintf("\x1b[%dD", $columns)); + $this->output->write(\sprintf("\x1b[%dD", $columns)); return $this; } @@ -75,7 +76,7 @@ final class Cursor */ public function moveToColumn(int $column): static { - $this->output->write(sprintf("\x1b[%dG", $column)); + $this->output->write(\sprintf("\x1b[%dG", $column)); return $this; } @@ -85,7 +86,7 @@ final class Cursor */ public function moveToPosition(int $column, int $row): static { - $this->output->write(sprintf("\x1b[%d;%dH", $row + 1, $column)); + $this->output->write(\sprintf("\x1b[%d;%dH", $row + 1, $column)); return $this; } @@ -194,7 +195,7 @@ final class Cursor $code = trim(fread($this->input, 1024)); - shell_exec(sprintf('stty %s', $sttyMode)); + shell_exec(\sprintf('stty %s', $sttyMode)); sscanf($code, "\033[%d;%dR", $row, $col); diff --git a/vendor/symfony/console/DependencyInjection/AddConsoleCommandPass.php b/vendor/symfony/console/DependencyInjection/AddConsoleCommandPass.php index 62c80c3b..3cf05734 100644 --- a/vendor/symfony/console/DependencyInjection/AddConsoleCommandPass.php +++ b/vendor/symfony/console/DependencyInjection/AddConsoleCommandPass.php @@ -29,6 +29,9 @@ use Symfony\Component\DependencyInjection\TypedReference; */ class AddConsoleCommandPass implements CompilerPassInterface { + /** + * @return void + */ public function process(ContainerBuilder $container) { $commandServices = $container->findTaggedServiceIds('console.command', true); @@ -45,10 +48,10 @@ class AddConsoleCommandPass implements CompilerPassInterface $aliases = $tags[0]['command']; } else { if (!$r = $container->getReflectionClass($class)) { - throw new InvalidArgumentException(sprintf('Class "%s" used for service "%s" cannot be found.', $class, $id)); + throw new InvalidArgumentException(\sprintf('Class "%s" used for service "%s" cannot be found.', $class, $id)); } if (!$r->isSubclassOf(Command::class)) { - throw new InvalidArgumentException(sprintf('The service "%s" tagged "%s" must be a subclass of "%s".', $id, 'console.command', Command::class)); + throw new InvalidArgumentException(\sprintf('The service "%s" tagged "%s" must be a subclass of "%s".', $id, 'console.command', Command::class)); } $aliases = str_replace('%', '%%', $class::getDefaultName() ?? ''); } @@ -102,10 +105,10 @@ class AddConsoleCommandPass implements CompilerPassInterface if (!$description) { if (!$r = $container->getReflectionClass($class)) { - throw new InvalidArgumentException(sprintf('Class "%s" used for service "%s" cannot be found.', $class, $id)); + throw new InvalidArgumentException(\sprintf('Class "%s" used for service "%s" cannot be found.', $class, $id)); } if (!$r->isSubclassOf(Command::class)) { - throw new InvalidArgumentException(sprintf('The service "%s" tagged "%s" must be a subclass of "%s".', $id, 'console.command', Command::class)); + throw new InvalidArgumentException(\sprintf('The service "%s" tagged "%s" must be a subclass of "%s".', $id, 'console.command', Command::class)); } $description = str_replace('%', '%%', $class::getDefaultDescription() ?? ''); } diff --git a/vendor/symfony/console/Descriptor/ApplicationDescription.php b/vendor/symfony/console/Descriptor/ApplicationDescription.php index 2158339e..3f38379c 100644 --- a/vendor/symfony/console/Descriptor/ApplicationDescription.php +++ b/vendor/symfony/console/Descriptor/ApplicationDescription.php @@ -39,7 +39,7 @@ class ApplicationDescription */ private array $aliases = []; - public function __construct(Application $application, string $namespace = null, bool $showHidden = false) + public function __construct(Application $application, ?string $namespace = null, bool $showHidden = false) { $this->application = $application; $this->namespace = $namespace; @@ -73,13 +73,13 @@ class ApplicationDescription public function getCommand(string $name): Command { if (!isset($this->commands[$name]) && !isset($this->aliases[$name])) { - throw new CommandNotFoundException(sprintf('Command "%s" does not exist.', $name)); + throw new CommandNotFoundException(\sprintf('Command "%s" does not exist.', $name)); } return $this->commands[$name] ?? $this->aliases[$name]; } - private function inspectApplication() + private function inspectApplication(): void { $this->commands = []; $this->namespaces = []; diff --git a/vendor/symfony/console/Descriptor/Descriptor.php b/vendor/symfony/console/Descriptor/Descriptor.php index 1476f575..2143a17c 100644 --- a/vendor/symfony/console/Descriptor/Descriptor.php +++ b/vendor/symfony/console/Descriptor/Descriptor.php @@ -26,12 +26,9 @@ use Symfony\Component\Console\Output\OutputInterface; */ abstract class Descriptor implements DescriptorInterface { - /** - * @var OutputInterface - */ - protected $output; + protected OutputInterface $output; - public function describe(OutputInterface $output, object $object, array $options = []) + public function describe(OutputInterface $output, object $object, array $options = []): void { $this->output = $output; @@ -41,14 +38,11 @@ abstract class Descriptor implements DescriptorInterface $object instanceof InputDefinition => $this->describeInputDefinition($object, $options), $object instanceof Command => $this->describeCommand($object, $options), $object instanceof Application => $this->describeApplication($object, $options), - default => throw new InvalidArgumentException(sprintf('Object of type "%s" is not describable.', get_debug_type($object))), + default => throw new InvalidArgumentException(\sprintf('Object of type "%s" is not describable.', get_debug_type($object))), }; } - /** - * Writes content to output. - */ - protected function write(string $content, bool $decorated = false) + protected function write(string $content, bool $decorated = false): void { $this->output->write($content, false, $decorated ? OutputInterface::OUTPUT_NORMAL : OutputInterface::OUTPUT_RAW); } @@ -56,25 +50,25 @@ abstract class Descriptor implements DescriptorInterface /** * Describes an InputArgument instance. */ - abstract protected function describeInputArgument(InputArgument $argument, array $options = []); + abstract protected function describeInputArgument(InputArgument $argument, array $options = []): void; /** * Describes an InputOption instance. */ - abstract protected function describeInputOption(InputOption $option, array $options = []); + abstract protected function describeInputOption(InputOption $option, array $options = []): void; /** * Describes an InputDefinition instance. */ - abstract protected function describeInputDefinition(InputDefinition $definition, array $options = []); + abstract protected function describeInputDefinition(InputDefinition $definition, array $options = []): void; /** * Describes a Command instance. */ - abstract protected function describeCommand(Command $command, array $options = []); + abstract protected function describeCommand(Command $command, array $options = []): void; /** * Describes an Application instance. */ - abstract protected function describeApplication(Application $application, array $options = []); + abstract protected function describeApplication(Application $application, array $options = []): void; } diff --git a/vendor/symfony/console/Descriptor/DescriptorInterface.php b/vendor/symfony/console/Descriptor/DescriptorInterface.php index ebea3036..ab468a25 100644 --- a/vendor/symfony/console/Descriptor/DescriptorInterface.php +++ b/vendor/symfony/console/Descriptor/DescriptorInterface.php @@ -20,5 +20,8 @@ use Symfony\Component\Console\Output\OutputInterface; */ interface DescriptorInterface { + /** + * @return void + */ public function describe(OutputInterface $output, object $object, array $options = []); } diff --git a/vendor/symfony/console/Descriptor/JsonDescriptor.php b/vendor/symfony/console/Descriptor/JsonDescriptor.php index 6f79a17a..9a8e696c 100644 --- a/vendor/symfony/console/Descriptor/JsonDescriptor.php +++ b/vendor/symfony/console/Descriptor/JsonDescriptor.php @@ -26,12 +26,12 @@ use Symfony\Component\Console\Input\InputOption; */ class JsonDescriptor extends Descriptor { - protected function describeInputArgument(InputArgument $argument, array $options = []) + protected function describeInputArgument(InputArgument $argument, array $options = []): void { $this->writeData($this->getInputArgumentData($argument), $options); } - protected function describeInputOption(InputOption $option, array $options = []) + protected function describeInputOption(InputOption $option, array $options = []): void { $this->writeData($this->getInputOptionData($option), $options); if ($option->isNegatable()) { @@ -39,17 +39,17 @@ class JsonDescriptor extends Descriptor } } - protected function describeInputDefinition(InputDefinition $definition, array $options = []) + protected function describeInputDefinition(InputDefinition $definition, array $options = []): void { $this->writeData($this->getInputDefinitionData($definition), $options); } - protected function describeCommand(Command $command, array $options = []) + protected function describeCommand(Command $command, array $options = []): void { $this->writeData($this->getCommandData($command, $options['short'] ?? false), $options); } - protected function describeApplication(Application $application, array $options = []) + protected function describeApplication(Application $application, array $options = []): void { $describedNamespace = $options['namespace'] ?? null; $description = new ApplicationDescription($application, $describedNamespace, true); @@ -81,7 +81,7 @@ class JsonDescriptor extends Descriptor /** * Writes data as json. */ - private function writeData(array $data, array $options) + private function writeData(array $data, array $options): void { $flags = $options['json_encoding'] ?? 0; @@ -108,7 +108,7 @@ class JsonDescriptor extends Descriptor 'is_value_required' => false, 'is_multiple' => false, 'description' => 'Negate the "--'.$option->getName().'" option', - 'default' => false, + 'default' => null === $option->getDefault() ? null : !$option->getDefault(), ] : [ 'name' => '--'.$option->getName(), 'shortcut' => $option->getShortcut() ? '-'.str_replace('|', '|-', $option->getShortcut()) : '', diff --git a/vendor/symfony/console/Descriptor/MarkdownDescriptor.php b/vendor/symfony/console/Descriptor/MarkdownDescriptor.php index fbd9c534..15fad8de 100644 --- a/vendor/symfony/console/Descriptor/MarkdownDescriptor.php +++ b/vendor/symfony/console/Descriptor/MarkdownDescriptor.php @@ -28,7 +28,7 @@ use Symfony\Component\Console\Output\OutputInterface; */ class MarkdownDescriptor extends Descriptor { - public function describe(OutputInterface $output, object $object, array $options = []) + public function describe(OutputInterface $output, object $object, array $options = []): void { $decorated = $output->isDecorated(); $output->setDecorated(false); @@ -38,12 +38,12 @@ class MarkdownDescriptor extends Descriptor $output->setDecorated($decorated); } - protected function write(string $content, bool $decorated = true) + protected function write(string $content, bool $decorated = true): void { parent::write($content, $decorated); } - protected function describeInputArgument(InputArgument $argument, array $options = []) + protected function describeInputArgument(InputArgument $argument, array $options = []): void { $this->write( '#### `'.($argument->getName() ?: '')."`\n\n" @@ -54,7 +54,7 @@ class MarkdownDescriptor extends Descriptor ); } - protected function describeInputOption(InputOption $option, array $options = []) + protected function describeInputOption(InputOption $option, array $options = []): void { $name = '--'.$option->getName(); if ($option->isNegatable()) { @@ -75,15 +75,13 @@ class MarkdownDescriptor extends Descriptor ); } - protected function describeInputDefinition(InputDefinition $definition, array $options = []) + protected function describeInputDefinition(InputDefinition $definition, array $options = []): void { if ($showArguments = \count($definition->getArguments()) > 0) { $this->write('### Arguments'); foreach ($definition->getArguments() as $argument) { $this->write("\n\n"); - if (null !== $describeInputArgument = $this->describeInputArgument($argument)) { - $this->write($describeInputArgument); - } + $this->describeInputArgument($argument); } } @@ -95,14 +93,12 @@ class MarkdownDescriptor extends Descriptor $this->write('### Options'); foreach ($definition->getOptions() as $option) { $this->write("\n\n"); - if (null !== $describeInputOption = $this->describeInputOption($option)) { - $this->write($describeInputOption); - } + $this->describeInputOption($option); } } } - protected function describeCommand(Command $command, array $options = []) + protected function describeCommand(Command $command, array $options = []): void { if ($options['short'] ?? false) { $this->write( @@ -110,9 +106,7 @@ class MarkdownDescriptor extends Descriptor .str_repeat('-', Helper::width($command->getName()) + 2)."\n\n" .($command->getDescription() ? $command->getDescription()."\n\n" : '') .'### Usage'."\n\n" - .array_reduce($command->getAliases(), function ($carry, $usage) { - return $carry.'* `'.$usage.'`'."\n"; - }) + .array_reduce($command->getAliases(), static fn ($carry, $usage) => $carry.'* `'.$usage.'`'."\n") ); return; @@ -125,9 +119,7 @@ class MarkdownDescriptor extends Descriptor .str_repeat('-', Helper::width($command->getName()) + 2)."\n\n" .($command->getDescription() ? $command->getDescription()."\n\n" : '') .'### Usage'."\n\n" - .array_reduce(array_merge([$command->getSynopsis()], $command->getAliases(), $command->getUsages()), function ($carry, $usage) { - return $carry.'* `'.$usage.'`'."\n"; - }) + .array_reduce(array_merge([$command->getSynopsis()], $command->getAliases(), $command->getUsages()), static fn ($carry, $usage) => $carry.'* `'.$usage.'`'."\n") ); if ($help = $command->getProcessedHelp()) { @@ -142,7 +134,7 @@ class MarkdownDescriptor extends Descriptor } } - protected function describeApplication(Application $application, array $options = []) + protected function describeApplication(Application $application, array $options = []): void { $describedNamespace = $options['namespace'] ?? null; $description = new ApplicationDescription($application, $describedNamespace); @@ -157,16 +149,12 @@ class MarkdownDescriptor extends Descriptor } $this->write("\n\n"); - $this->write(implode("\n", array_map(function ($commandName) use ($description) { - return sprintf('* [`%s`](#%s)', $commandName, str_replace(':', '', $description->getCommand($commandName)->getName())); - }, $namespace['commands']))); + $this->write(implode("\n", array_map(static fn ($commandName) => \sprintf('* [`%s`](#%s)', $commandName, str_replace(':', '', $description->getCommand($commandName)->getName())), $namespace['commands']))); } foreach ($description->getCommands() as $command) { $this->write("\n\n"); - if (null !== $describeCommand = $this->describeCommand($command, $options)) { - $this->write($describeCommand); - } + $this->describeCommand($command, $options); } } @@ -174,7 +162,7 @@ class MarkdownDescriptor extends Descriptor { if ('UNKNOWN' !== $application->getName()) { if ('UNKNOWN' !== $application->getVersion()) { - return sprintf('%s %s', $application->getName(), $application->getVersion()); + return \sprintf('%s %s', $application->getName(), $application->getVersion()); } return $application->getName(); diff --git a/vendor/symfony/console/Descriptor/TextDescriptor.php b/vendor/symfony/console/Descriptor/TextDescriptor.php index 48a0b42a..b2e9df56 100644 --- a/vendor/symfony/console/Descriptor/TextDescriptor.php +++ b/vendor/symfony/console/Descriptor/TextDescriptor.php @@ -28,18 +28,18 @@ use Symfony\Component\Console\Input\InputOption; */ class TextDescriptor extends Descriptor { - protected function describeInputArgument(InputArgument $argument, array $options = []) + protected function describeInputArgument(InputArgument $argument, array $options = []): void { if (null !== $argument->getDefault() && (!\is_array($argument->getDefault()) || \count($argument->getDefault()))) { - $default = sprintf(' [default: %s]', $this->formatDefaultValue($argument->getDefault())); + $default = \sprintf(' [default: %s]', $this->formatDefaultValue($argument->getDefault())); } else { $default = ''; } $totalWidth = $options['total_width'] ?? Helper::width($argument->getName()); - $spacingWidth = $totalWidth - \strlen($argument->getName()); + $spacingWidth = $totalWidth - Helper::width($argument->getName()); - $this->writeText(sprintf(' %s %s%s%s', + $this->writeText(\sprintf(' %s %s%s%s', $argument->getName(), str_repeat(' ', $spacingWidth), // + 4 = 2 spaces before , 2 spaces after @@ -48,10 +48,10 @@ class TextDescriptor extends Descriptor ), $options); } - protected function describeInputOption(InputOption $option, array $options = []) + protected function describeInputOption(InputOption $option, array $options = []): void { if ($option->acceptValue() && null !== $option->getDefault() && (!\is_array($option->getDefault()) || \count($option->getDefault()))) { - $default = sprintf(' [default: %s]', $this->formatDefaultValue($option->getDefault())); + $default = \sprintf(' [default: %s]', $this->formatDefaultValue($option->getDefault())); } else { $default = ''; } @@ -66,14 +66,14 @@ class TextDescriptor extends Descriptor } $totalWidth = $options['total_width'] ?? $this->calculateTotalWidthForOptions([$option]); - $synopsis = sprintf('%s%s', - $option->getShortcut() ? sprintf('-%s, ', $option->getShortcut()) : ' ', - sprintf($option->isNegatable() ? '--%1$s|--no-%1$s' : '--%1$s%2$s', $option->getName(), $value) + $synopsis = \sprintf('%s%s', + $option->getShortcut() ? \sprintf('-%s, ', $option->getShortcut()) : ' ', + \sprintf($option->isNegatable() ? '--%1$s|--no-%1$s' : '--%1$s%2$s', $option->getName(), $value) ); $spacingWidth = $totalWidth - Helper::width($synopsis); - $this->writeText(sprintf(' %s %s%s%s%s', + $this->writeText(\sprintf(' %s %s%s%s%s', $synopsis, str_repeat(' ', $spacingWidth), // + 4 = 2 spaces before , 2 spaces after @@ -83,7 +83,7 @@ class TextDescriptor extends Descriptor ), $options); } - protected function describeInputDefinition(InputDefinition $definition, array $options = []) + protected function describeInputDefinition(InputDefinition $definition, array $options = []): void { $totalWidth = $this->calculateTotalWidthForOptions($definition->getOptions()); foreach ($definition->getArguments() as $argument) { @@ -122,7 +122,7 @@ class TextDescriptor extends Descriptor } } - protected function describeCommand(Command $command, array $options = []) + protected function describeCommand(Command $command, array $options = []): void { $command->mergeApplicationDefinition(false); @@ -157,7 +157,7 @@ class TextDescriptor extends Descriptor } } - protected function describeApplication(Application $application, array $options = []) + protected function describeApplication(Application $application, array $options = []): void { $describedNamespace = $options['namespace'] ?? null; $description = new ApplicationDescription($application, $describedNamespace); @@ -166,7 +166,7 @@ class TextDescriptor extends Descriptor $width = $this->getColumnWidth($description->getCommands()); foreach ($description->getCommands() as $command) { - $this->writeText(sprintf("%-{$width}s %s", $command->getName(), $command->getDescription()), $options); + $this->writeText(\sprintf("%-{$width}s %s", $command->getName(), $command->getDescription()), $options); $this->writeText("\n"); } } else { @@ -193,20 +193,16 @@ class TextDescriptor extends Descriptor } // calculate max. width based on available commands per namespace - $width = $this->getColumnWidth(array_merge(...array_values(array_map(function ($namespace) use ($commands) { - return array_intersect($namespace['commands'], array_keys($commands)); - }, array_values($namespaces))))); + $width = $this->getColumnWidth(array_merge(...array_values(array_map(static fn ($namespace) => array_intersect($namespace['commands'], array_keys($commands)), array_values($namespaces))))); if ($describedNamespace) { - $this->writeText(sprintf('Available commands for the "%s" namespace:', $describedNamespace), $options); + $this->writeText(\sprintf('Available commands for the "%s" namespace:', $describedNamespace), $options); } else { $this->writeText('Available commands:', $options); } foreach ($namespaces as $namespace) { - $namespace['commands'] = array_filter($namespace['commands'], function ($name) use ($commands) { - return isset($commands[$name]); - }); + $namespace['commands'] = array_filter($namespace['commands'], static fn ($name) => isset($commands[$name])); if (!$namespace['commands']) { continue; @@ -222,7 +218,7 @@ class TextDescriptor extends Descriptor $spacingWidth = $width - Helper::width($name); $command = $commands[$name]; $commandAliases = $name === $command->getName() ? $this->getCommandAliasesText($command) : ''; - $this->writeText(sprintf(' %s%s%s', $name, str_repeat(' ', $spacingWidth), $commandAliases.$command->getDescription()), $options); + $this->writeText(\sprintf(' %s%s%s', $name, str_repeat(' ', $spacingWidth), $commandAliases.$command->getDescription()), $options); } } @@ -230,7 +226,7 @@ class TextDescriptor extends Descriptor } } - private function writeText(string $content, array $options = []) + private function writeText(string $content, array $options = []): void { $this->write( isset($options['raw_text']) && $options['raw_text'] ? strip_tags($content) : $content, diff --git a/vendor/symfony/console/Descriptor/XmlDescriptor.php b/vendor/symfony/console/Descriptor/XmlDescriptor.php index f4643a9a..866c7185 100644 --- a/vendor/symfony/console/Descriptor/XmlDescriptor.php +++ b/vendor/symfony/console/Descriptor/XmlDescriptor.php @@ -79,7 +79,7 @@ class XmlDescriptor extends Descriptor return $dom; } - public function getApplicationDocument(Application $application, string $namespace = null, bool $short = false): \DOMDocument + public function getApplicationDocument(Application $application, ?string $namespace = null, bool $short = false): \DOMDocument { $dom = new \DOMDocument('1.0', 'UTF-8'); $dom->appendChild($rootXml = $dom->createElement('symfony')); @@ -120,27 +120,27 @@ class XmlDescriptor extends Descriptor return $dom; } - protected function describeInputArgument(InputArgument $argument, array $options = []) + protected function describeInputArgument(InputArgument $argument, array $options = []): void { $this->writeDocument($this->getInputArgumentDocument($argument)); } - protected function describeInputOption(InputOption $option, array $options = []) + protected function describeInputOption(InputOption $option, array $options = []): void { $this->writeDocument($this->getInputOptionDocument($option)); } - protected function describeInputDefinition(InputDefinition $definition, array $options = []) + protected function describeInputDefinition(InputDefinition $definition, array $options = []): void { $this->writeDocument($this->getInputDefinitionDocument($definition)); } - protected function describeCommand(Command $command, array $options = []) + protected function describeCommand(Command $command, array $options = []): void { $this->writeDocument($this->getCommandDocument($command, $options['short'] ?? false)); } - protected function describeApplication(Application $application, array $options = []) + protected function describeApplication(Application $application, array $options = []): void { $this->writeDocument($this->getApplicationDocument($application, $options['namespace'] ?? null, $options['short'] ?? false)); } @@ -148,7 +148,7 @@ class XmlDescriptor extends Descriptor /** * Appends document children to parent node. */ - private function appendDocument(\DOMNode $parentNode, \DOMNode $importedParent) + private function appendDocument(\DOMNode $parentNode, \DOMNode $importedParent): void { foreach ($importedParent->childNodes as $childNode) { $parentNode->appendChild($parentNode->ownerDocument->importNode($childNode, true)); @@ -158,7 +158,7 @@ class XmlDescriptor extends Descriptor /** * Writes DOM document. */ - private function writeDocument(\DOMDocument $dom) + private function writeDocument(\DOMDocument $dom): void { $dom->formatOutput = true; $this->write($dom->saveXML()); diff --git a/vendor/symfony/console/Event/ConsoleCommandEvent.php b/vendor/symfony/console/Event/ConsoleCommandEvent.php index 31c9ee99..0757a23f 100644 --- a/vendor/symfony/console/Event/ConsoleCommandEvent.php +++ b/vendor/symfony/console/Event/ConsoleCommandEvent.php @@ -12,7 +12,10 @@ namespace Symfony\Component\Console\Event; /** - * Allows to do things before the command is executed, like skipping the command or changing the input. + * Allows to do things before the command is executed, like skipping the command or executing code before the command is + * going to be executed. + * + * Changing the input arguments will have no effect. * * @author Fabien Potencier */ diff --git a/vendor/symfony/console/Event/ConsoleErrorEvent.php b/vendor/symfony/console/Event/ConsoleErrorEvent.php index d4a69121..7be2ff83 100644 --- a/vendor/symfony/console/Event/ConsoleErrorEvent.php +++ b/vendor/symfony/console/Event/ConsoleErrorEvent.php @@ -25,7 +25,7 @@ final class ConsoleErrorEvent extends ConsoleEvent private \Throwable $error; private int $exitCode; - public function __construct(InputInterface $input, OutputInterface $output, \Throwable $error, Command $command = null) + public function __construct(InputInterface $input, OutputInterface $output, \Throwable $error, ?Command $command = null) { parent::__construct($command, $input, $output); diff --git a/vendor/symfony/console/Event/ConsoleSignalEvent.php b/vendor/symfony/console/Event/ConsoleSignalEvent.php index 766af691..95af1f91 100644 --- a/vendor/symfony/console/Event/ConsoleSignalEvent.php +++ b/vendor/symfony/console/Event/ConsoleSignalEvent.php @@ -21,15 +21,36 @@ use Symfony\Component\Console\Output\OutputInterface; final class ConsoleSignalEvent extends ConsoleEvent { private int $handlingSignal; + private int|false $exitCode; - public function __construct(Command $command, InputInterface $input, OutputInterface $output, int $handlingSignal) + public function __construct(Command $command, InputInterface $input, OutputInterface $output, int $handlingSignal, int|false $exitCode = 0) { parent::__construct($command, $input, $output); $this->handlingSignal = $handlingSignal; + $this->exitCode = $exitCode; } public function getHandlingSignal(): int { return $this->handlingSignal; } + + public function setExitCode(int $exitCode): void + { + if ($exitCode < 0 || $exitCode > 255) { + throw new \InvalidArgumentException('Exit code must be between 0 and 255.'); + } + + $this->exitCode = $exitCode; + } + + public function abortExit(): void + { + $this->exitCode = false; + } + + public function getExitCode(): int|false + { + return $this->exitCode; + } } diff --git a/vendor/symfony/console/Event/ConsoleTerminateEvent.php b/vendor/symfony/console/Event/ConsoleTerminateEvent.php index de63c8ff..38f7253a 100644 --- a/vendor/symfony/console/Event/ConsoleTerminateEvent.php +++ b/vendor/symfony/console/Event/ConsoleTerminateEvent.php @@ -19,16 +19,18 @@ use Symfony\Component\Console\Output\OutputInterface; * Allows to manipulate the exit code of a command after its execution. * * @author Francesco Levorato + * @author Jules Pietri */ final class ConsoleTerminateEvent extends ConsoleEvent { - private int $exitCode; - - public function __construct(Command $command, InputInterface $input, OutputInterface $output, int $exitCode) - { + public function __construct( + Command $command, + InputInterface $input, + OutputInterface $output, + private int $exitCode, + private readonly ?int $interruptingSignal = null, + ) { parent::__construct($command, $input, $output); - - $this->setExitCode($exitCode); } public function setExitCode(int $exitCode): void @@ -40,4 +42,9 @@ final class ConsoleTerminateEvent extends ConsoleEvent { return $this->exitCode; } + + public function getInterruptingSignal(): ?int + { + return $this->interruptingSignal; + } } diff --git a/vendor/symfony/console/EventListener/ErrorListener.php b/vendor/symfony/console/EventListener/ErrorListener.php index 773a13a1..c9ec2443 100644 --- a/vendor/symfony/console/EventListener/ErrorListener.php +++ b/vendor/symfony/console/EventListener/ErrorListener.php @@ -26,11 +26,14 @@ class ErrorListener implements EventSubscriberInterface { private ?LoggerInterface $logger; - public function __construct(LoggerInterface $logger = null) + public function __construct(?LoggerInterface $logger = null) { $this->logger = $logger; } + /** + * @return void + */ public function onConsoleError(ConsoleErrorEvent $event) { if (null === $this->logger) { @@ -48,6 +51,9 @@ class ErrorListener implements EventSubscriberInterface $this->logger->critical('Error thrown while running command "{command}". Message: "{message}"', ['exception' => $error, 'command' => $inputString, 'message' => $error->getMessage()]); } + /** + * @return void + */ public function onConsoleTerminate(ConsoleTerminateEvent $event) { if (null === $this->logger) { diff --git a/vendor/symfony/console/Exception/CommandNotFoundException.php b/vendor/symfony/console/Exception/CommandNotFoundException.php index 1e9f1c79..541b32b2 100644 --- a/vendor/symfony/console/Exception/CommandNotFoundException.php +++ b/vendor/symfony/console/Exception/CommandNotFoundException.php @@ -26,7 +26,7 @@ class CommandNotFoundException extends \InvalidArgumentException implements Exce * @param int $code Exception code * @param \Throwable|null $previous Previous exception used for the exception chaining */ - public function __construct(string $message, array $alternatives = [], int $code = 0, \Throwable $previous = null) + public function __construct(string $message, array $alternatives = [], int $code = 0, ?\Throwable $previous = null) { parent::__construct($message, $code, $previous); diff --git a/vendor/symfony/console/Formatter/NullOutputFormatterStyle.php b/vendor/symfony/console/Formatter/NullOutputFormatterStyle.php index c2ce7d14..ae23decb 100644 --- a/vendor/symfony/console/Formatter/NullOutputFormatterStyle.php +++ b/vendor/symfony/console/Formatter/NullOutputFormatterStyle.php @@ -21,7 +21,7 @@ final class NullOutputFormatterStyle implements OutputFormatterStyleInterface return $text; } - public function setBackground(string $color = null): void + public function setBackground(?string $color = null): void { if (1 > \func_num_args()) { trigger_deprecation('symfony/console', '6.2', 'Calling "%s()" without any arguments is deprecated, pass null explicitly instead.', __METHOD__); @@ -29,7 +29,7 @@ final class NullOutputFormatterStyle implements OutputFormatterStyleInterface // do nothing } - public function setForeground(string $color = null): void + public function setForeground(?string $color = null): void { if (1 > \func_num_args()) { trigger_deprecation('symfony/console', '6.2', 'Calling "%s()" without any arguments is deprecated, pass null explicitly instead.', __METHOD__); diff --git a/vendor/symfony/console/Formatter/OutputFormatter.php b/vendor/symfony/console/Formatter/OutputFormatter.php index 38e75c31..d60365f8 100644 --- a/vendor/symfony/console/Formatter/OutputFormatter.php +++ b/vendor/symfony/console/Formatter/OutputFormatter.php @@ -12,6 +12,9 @@ namespace Symfony\Component\Console\Formatter; use Symfony\Component\Console\Exception\InvalidArgumentException; +use Symfony\Component\Console\Helper\Helper; + +use function Symfony\Component\String\b; /** * Formatter class for console output. @@ -81,6 +84,9 @@ class OutputFormatter implements WrappableOutputFormatterInterface $this->styleStack = new OutputFormatterStyleStack(); } + /** + * @return void + */ public function setDecorated(bool $decorated) { $this->decorated = $decorated; @@ -91,6 +97,9 @@ class OutputFormatter implements WrappableOutputFormatterInterface return $this->decorated; } + /** + * @return void + */ public function setStyle(string $name, OutputFormatterStyleInterface $style) { $this->styles[strtolower($name)] = $style; @@ -104,7 +113,7 @@ class OutputFormatter implements WrappableOutputFormatterInterface public function getStyle(string $name): OutputFormatterStyleInterface { if (!$this->hasStyle($name)) { - throw new InvalidArgumentException(sprintf('Undefined style: "%s".', $name)); + throw new InvalidArgumentException(\sprintf('Undefined style: "%s".', $name)); } return $this->styles[strtolower($name)]; @@ -115,12 +124,19 @@ class OutputFormatter implements WrappableOutputFormatterInterface return $this->formatAndWrap($message, 0); } + /** + * @return string + */ public function formatAndWrap(?string $message, int $width) { if (null === $message) { return ''; } + // For ASCII-only strings, byte positions equal character positions, + // so we can use native strlen/substr which is much faster than Helper::length/substr. + $isAscii = !preg_match('/[\x80-\xFF]/', $message); + $offset = 0; $output = ''; $openTagRegex = '[a-z](?:[^\\\\<>]*+ | \\\\.)*'; @@ -135,9 +151,17 @@ class OutputFormatter implements WrappableOutputFormatterInterface continue; } - // add the text up to the next tag - $output .= $this->applyCurrentStyle(substr($message, $offset, $pos - $offset), $output, $width, $currentLineLength); - $offset = $pos + \strlen($text); + if ($isAscii) { + // For ASCII, byte position = character position, no conversion needed + $output .= $this->applyCurrentStyle(substr($message, $offset, $pos - $offset), $output, $width, $currentLineLength); + $offset = $pos + \strlen($text); + } else { + // convert byte position to character position. + $pos = Helper::length(substr($message, 0, $pos)); + // add the text up to the next tag + $output .= $this->applyCurrentStyle(Helper::substr($message, $offset, $pos - $offset), $output, $width, $currentLineLength); + $offset = $pos + Helper::length($text); + } // opening tag? if ($open = '/' !== $text[1]) { @@ -158,7 +182,7 @@ class OutputFormatter implements WrappableOutputFormatterInterface } } - $output .= $this->applyCurrentStyle(substr($message, $offset), $output, $width, $currentLineLength); + $output .= $this->applyCurrentStyle($isAscii ? substr($message, $offset) : Helper::substr($message, $offset), $output, $width, $currentLineLength); return strtr($output, ["\0" => '\\', '\\<' => '<', '\\>' => '>']); } @@ -225,14 +249,24 @@ class OutputFormatter implements WrappableOutputFormatterInterface } if ($currentLineLength) { - $prefix = substr($text, 0, $i = $width - $currentLineLength)."\n"; - $text = substr($text, $i); + $lines = explode("\n", $text, 2); + $prefix = Helper::substr($lines[0], 0, $i = $width - $currentLineLength)."\n"; + $text = Helper::substr($lines[0], $i); + + if (isset($lines[1])) { + // $prefix may contain the full first line in which the \n is already a part of $prefix. + if ('' !== $text) { + $text .= "\n"; + } + + $text .= $lines[1]; + } } else { $prefix = ''; } preg_match('~(\\n)$~', $text, $matches); - $text = $prefix.preg_replace('~([^\\n]{'.$width.'})\\ *~', "\$1\n", $text); + $text = $prefix.$this->addLineBreaks($text, $width); $text = rtrim($text, "\n").($matches[1] ?? ''); if (!$currentLineLength && '' !== $current && !str_ends_with($current, "\n")) { @@ -241,8 +275,8 @@ class OutputFormatter implements WrappableOutputFormatterInterface $lines = explode("\n", $text); - foreach ($lines as $line) { - $currentLineLength += \strlen($line); + foreach ($lines as $i => $line) { + $currentLineLength = 0 === $i ? $currentLineLength + Helper::length($line) : Helper::length($line); if ($width <= $currentLineLength) { $currentLineLength = 0; } @@ -256,4 +290,11 @@ class OutputFormatter implements WrappableOutputFormatterInterface return implode("\n", $lines); } + + private function addLineBreaks(string $text, int $width): string + { + $encoding = mb_detect_encoding($text, null, true) ?: 'UTF-8'; + + return b($text)->toUnicodeString($encoding)->wordwrap($width, "\n", true)->toByteString($encoding); + } } diff --git a/vendor/symfony/console/Formatter/OutputFormatterInterface.php b/vendor/symfony/console/Formatter/OutputFormatterInterface.php index b94e51de..433cd419 100644 --- a/vendor/symfony/console/Formatter/OutputFormatterInterface.php +++ b/vendor/symfony/console/Formatter/OutputFormatterInterface.php @@ -20,6 +20,8 @@ interface OutputFormatterInterface { /** * Sets the decorated flag. + * + * @return void */ public function setDecorated(bool $decorated); @@ -30,6 +32,8 @@ interface OutputFormatterInterface /** * Sets a new style. + * + * @return void */ public function setStyle(string $name, OutputFormatterStyleInterface $style); diff --git a/vendor/symfony/console/Formatter/OutputFormatterStyle.php b/vendor/symfony/console/Formatter/OutputFormatterStyle.php index 1659986e..21e7f5ab 100644 --- a/vendor/symfony/console/Formatter/OutputFormatterStyle.php +++ b/vendor/symfony/console/Formatter/OutputFormatterStyle.php @@ -33,12 +33,15 @@ class OutputFormatterStyle implements OutputFormatterStyleInterface * @param string|null $foreground The style foreground color name * @param string|null $background The style background color name */ - public function __construct(string $foreground = null, string $background = null, array $options = []) + public function __construct(?string $foreground = null, ?string $background = null, array $options = []) { $this->color = new Color($this->foreground = $foreground ?: '', $this->background = $background ?: '', $this->options = $options); } - public function setForeground(string $color = null) + /** + * @return void + */ + public function setForeground(?string $color = null) { if (1 > \func_num_args()) { trigger_deprecation('symfony/console', '6.2', 'Calling "%s()" without any arguments is deprecated, pass null explicitly instead.', __METHOD__); @@ -46,7 +49,10 @@ class OutputFormatterStyle implements OutputFormatterStyleInterface $this->color = new Color($this->foreground = $color ?: '', $this->background, $this->options); } - public function setBackground(string $color = null) + /** + * @return void + */ + public function setBackground(?string $color = null) { if (1 > \func_num_args()) { trigger_deprecation('symfony/console', '6.2', 'Calling "%s()" without any arguments is deprecated, pass null explicitly instead.', __METHOD__); @@ -59,12 +65,18 @@ class OutputFormatterStyle implements OutputFormatterStyleInterface $this->href = $url; } + /** + * @return void + */ public function setOption(string $option) { $this->options[] = $option; $this->color = new Color($this->foreground, $this->background, $this->options); } + /** + * @return void + */ public function unsetOption(string $option) { $pos = array_search($option, $this->options); @@ -75,6 +87,9 @@ class OutputFormatterStyle implements OutputFormatterStyleInterface $this->color = new Color($this->foreground, $this->background, $this->options); } + /** + * @return void + */ public function setOptions(array $options) { $this->color = new Color($this->foreground, $this->background, $this->options = $options); @@ -83,7 +98,8 @@ class OutputFormatterStyle implements OutputFormatterStyleInterface public function apply(string $text): string { $this->handlesHrefGracefully ??= 'JetBrains-JediTerm' !== getenv('TERMINAL_EMULATOR') - && (!getenv('KONSOLE_VERSION') || (int) getenv('KONSOLE_VERSION') > 201100); + && (!getenv('KONSOLE_VERSION') || (int) getenv('KONSOLE_VERSION') > 201100) + && !isset($_SERVER['IDEA_INITIAL_DIRECTORY']); if (null !== $this->href && $this->handlesHrefGracefully) { $text = "\033]8;;$this->href\033\\$text\033]8;;\033\\"; diff --git a/vendor/symfony/console/Formatter/OutputFormatterStyleInterface.php b/vendor/symfony/console/Formatter/OutputFormatterStyleInterface.php index 7ed67d9a..3b15098c 100644 --- a/vendor/symfony/console/Formatter/OutputFormatterStyleInterface.php +++ b/vendor/symfony/console/Formatter/OutputFormatterStyleInterface.php @@ -20,26 +20,36 @@ interface OutputFormatterStyleInterface { /** * Sets style foreground color. + * + * @return void */ public function setForeground(?string $color); /** * Sets style background color. + * + * @return void */ public function setBackground(?string $color); /** * Sets some specific style option. + * + * @return void */ public function setOption(string $option); /** * Unsets some specific style option. + * + * @return void */ public function unsetOption(string $option); /** * Sets multiple style options at once. + * + * @return void */ public function setOptions(array $options); diff --git a/vendor/symfony/console/Formatter/OutputFormatterStyleStack.php b/vendor/symfony/console/Formatter/OutputFormatterStyleStack.php index 2c5cdf9b..62d2ca0e 100644 --- a/vendor/symfony/console/Formatter/OutputFormatterStyleStack.php +++ b/vendor/symfony/console/Formatter/OutputFormatterStyleStack.php @@ -26,7 +26,7 @@ class OutputFormatterStyleStack implements ResetInterface private OutputFormatterStyleInterface $emptyStyle; - public function __construct(OutputFormatterStyleInterface $emptyStyle = null) + public function __construct(?OutputFormatterStyleInterface $emptyStyle = null) { $this->emptyStyle = $emptyStyle ?? new OutputFormatterStyle(); $this->reset(); @@ -34,6 +34,8 @@ class OutputFormatterStyleStack implements ResetInterface /** * Resets stack (ie. empty internal arrays). + * + * @return void */ public function reset() { @@ -42,6 +44,8 @@ class OutputFormatterStyleStack implements ResetInterface /** * Pushes a style in the stack. + * + * @return void */ public function push(OutputFormatterStyleInterface $style) { @@ -53,7 +57,7 @@ class OutputFormatterStyleStack implements ResetInterface * * @throws InvalidArgumentException When style tags incorrectly nested */ - public function pop(OutputFormatterStyleInterface $style = null): OutputFormatterStyleInterface + public function pop(?OutputFormatterStyleInterface $style = null): OutputFormatterStyleInterface { if (!$this->styles) { return $this->emptyStyle; diff --git a/vendor/symfony/console/Helper/DebugFormatterHelper.php b/vendor/symfony/console/Helper/DebugFormatterHelper.php index 9ea7fb91..dfdb8a82 100644 --- a/vendor/symfony/console/Helper/DebugFormatterHelper.php +++ b/vendor/symfony/console/Helper/DebugFormatterHelper.php @@ -31,7 +31,7 @@ class DebugFormatterHelper extends Helper { $this->started[$id] = ['border' => ++$this->count % \count(self::COLORS)]; - return sprintf("%s %s %s\n", $this->getBorder($id), $prefix, $message); + return \sprintf("%s %s %s\n", $this->getBorder($id), $prefix, $message); } /** @@ -47,22 +47,22 @@ class DebugFormatterHelper extends Helper unset($this->started[$id]['out']); } if (!isset($this->started[$id]['err'])) { - $message .= sprintf('%s %s ', $this->getBorder($id), $errorPrefix); + $message .= \sprintf('%s %s ', $this->getBorder($id), $errorPrefix); $this->started[$id]['err'] = true; } - $message .= str_replace("\n", sprintf("\n%s %s ", $this->getBorder($id), $errorPrefix), $buffer); + $message .= str_replace("\n", \sprintf("\n%s %s ", $this->getBorder($id), $errorPrefix), $buffer); } else { if (isset($this->started[$id]['err'])) { $message .= "\n"; unset($this->started[$id]['err']); } if (!isset($this->started[$id]['out'])) { - $message .= sprintf('%s %s ', $this->getBorder($id), $prefix); + $message .= \sprintf('%s %s ', $this->getBorder($id), $prefix); $this->started[$id]['out'] = true; } - $message .= str_replace("\n", sprintf("\n%s %s ", $this->getBorder($id), $prefix), $buffer); + $message .= str_replace("\n", \sprintf("\n%s %s ", $this->getBorder($id), $prefix), $buffer); } return $message; @@ -76,10 +76,10 @@ class DebugFormatterHelper extends Helper $trailingEOL = isset($this->started[$id]['out']) || isset($this->started[$id]['err']) ? "\n" : ''; if ($successful) { - return sprintf("%s%s %s %s\n", $trailingEOL, $this->getBorder($id), $prefix, $message); + return \sprintf("%s%s %s %s\n", $trailingEOL, $this->getBorder($id), $prefix, $message); } - $message = sprintf("%s%s %s %s\n", $trailingEOL, $this->getBorder($id), $prefix, $message); + $message = \sprintf("%s%s %s %s\n", $trailingEOL, $this->getBorder($id), $prefix, $message); unset($this->started[$id]['out'], $this->started[$id]['err']); @@ -88,7 +88,7 @@ class DebugFormatterHelper extends Helper private function getBorder(string $id): string { - return sprintf(' ', self::COLORS[$this->started[$id]['border']]); + return \sprintf(' ', self::COLORS[$this->started[$id]['border']]); } public function getName(): string diff --git a/vendor/symfony/console/Helper/DescriptorHelper.php b/vendor/symfony/console/Helper/DescriptorHelper.php index 3015ff08..fda6779b 100644 --- a/vendor/symfony/console/Helper/DescriptorHelper.php +++ b/vendor/symfony/console/Helper/DescriptorHelper.php @@ -14,6 +14,7 @@ namespace Symfony\Component\Console\Helper; use Symfony\Component\Console\Descriptor\DescriptorInterface; use Symfony\Component\Console\Descriptor\JsonDescriptor; use Symfony\Component\Console\Descriptor\MarkdownDescriptor; +use Symfony\Component\Console\Descriptor\ReStructuredTextDescriptor; use Symfony\Component\Console\Descriptor\TextDescriptor; use Symfony\Component\Console\Descriptor\XmlDescriptor; use Symfony\Component\Console\Exception\InvalidArgumentException; @@ -38,6 +39,7 @@ class DescriptorHelper extends Helper ->register('xml', new XmlDescriptor()) ->register('json', new JsonDescriptor()) ->register('md', new MarkdownDescriptor()) + ->register('rst', new ReStructuredTextDescriptor()) ; } @@ -48,6 +50,8 @@ class DescriptorHelper extends Helper * * format: string, the output format name * * raw_text: boolean, sets output type as raw * + * @return void + * * @throws InvalidArgumentException when the given format is not supported */ public function describe(OutputInterface $output, ?object $object, array $options = []) @@ -58,7 +62,7 @@ class DescriptorHelper extends Helper ], $options); if (!isset($this->descriptors[$options['format']])) { - throw new InvalidArgumentException(sprintf('Unsupported format "%s".', $options['format'])); + throw new InvalidArgumentException(\sprintf('Unsupported format "%s".', $options['format'])); } $descriptor = $this->descriptors[$options['format']]; diff --git a/vendor/symfony/console/Helper/Dumper.php b/vendor/symfony/console/Helper/Dumper.php index ac7571ce..316237a5 100644 --- a/vendor/symfony/console/Helper/Dumper.php +++ b/vendor/symfony/console/Helper/Dumper.php @@ -26,7 +26,7 @@ final class Dumper private ?ClonerInterface $cloner; private \Closure $handler; - public function __construct(OutputInterface $output, CliDumper $dumper = null, ClonerInterface $cloner = null) + public function __construct(OutputInterface $output, ?CliDumper $dumper = null, ?ClonerInterface $cloner = null) { $this->output = $output; $this->dumper = $dumper; @@ -40,14 +40,12 @@ final class Dumper return rtrim($dumper->dump(($this->cloner ??= new VarCloner())->cloneVar($var)->withRefHandles(false), true)); }; } else { - $this->handler = function ($var): string { - return match (true) { - null === $var => 'null', - true === $var => 'true', - false === $var => 'false', - \is_string($var) => '"'.$var.'"', - default => rtrim(print_r($var, true)), - }; + $this->handler = static fn ($var): string => match (true) { + null === $var => 'null', + true === $var => 'true', + false === $var => 'false', + \is_string($var) => '"'.$var.'"', + default => rtrim(print_r($var, true)), }; } } diff --git a/vendor/symfony/console/Helper/FormatterHelper.php b/vendor/symfony/console/Helper/FormatterHelper.php index 279e4c79..3646b3d6 100644 --- a/vendor/symfony/console/Helper/FormatterHelper.php +++ b/vendor/symfony/console/Helper/FormatterHelper.php @@ -25,7 +25,7 @@ class FormatterHelper extends Helper */ public function formatSection(string $section, string $message, string $style = 'info'): string { - return sprintf('<%s>[%s] %s', $style, $section, $style, $message); + return \sprintf('<%s>[%s] %s', $style, $section, $style, $message); } /** @@ -41,7 +41,7 @@ class FormatterHelper extends Helper $lines = []; foreach ($messages as $message) { $message = OutputFormatter::escape($message); - $lines[] = sprintf($large ? ' %s ' : ' %s ', $message); + $lines[] = \sprintf($large ? ' %s ' : ' %s ', $message); $len = max(self::width($message) + ($large ? 4 : 2), $len); } @@ -54,7 +54,7 @@ class FormatterHelper extends Helper } for ($i = 0; isset($messages[$i]); ++$i) { - $messages[$i] = sprintf('<%s>%s', $style, $messages[$i], $style); + $messages[$i] = \sprintf('<%s>%s', $style, $messages[$i], $style); } return implode("\n", $messages); diff --git a/vendor/symfony/console/Helper/Helper.php b/vendor/symfony/console/Helper/Helper.php index 920196e0..468d0668 100644 --- a/vendor/symfony/console/Helper/Helper.php +++ b/vendor/symfony/console/Helper/Helper.php @@ -21,9 +21,12 @@ use Symfony\Component\String\UnicodeString; */ abstract class Helper implements HelperInterface { - protected $helperSet = null; + protected $helperSet; - public function setHelperSet(HelperSet $helperSet = null) + /** + * @return void + */ + public function setHelperSet(?HelperSet $helperSet = null) { if (1 > \func_num_args()) { trigger_deprecation('symfony/console', '6.2', 'Calling "%s()" without any arguments is deprecated, pass null explicitly instead.', __METHOD__); @@ -45,7 +48,9 @@ abstract class Helper implements HelperInterface $string ??= ''; if (preg_match('//u', $string)) { - return (new UnicodeString($string))->width(false); + $string = preg_replace('/[\p{Cc}\x7F]++/u', '', $string, -1, $count); + + return (new UnicodeString($string))->width(false) + $count; } if (false === $encoding = mb_detect_encoding($string, null, true)) { @@ -77,10 +82,14 @@ abstract class Helper implements HelperInterface /** * Returns the subset of a string, using mb_substr if it is available. */ - public static function substr(?string $string, int $from, int $length = null): string + public static function substr(?string $string, int $from, ?int $length = null): string { $string ??= ''; + if (preg_match('//u', $string)) { + return (new UnicodeString($string))->slice($from, $length); + } + if (false === $encoding = mb_detect_encoding($string, null, true)) { return substr($string, $from, $length); } @@ -88,52 +97,72 @@ abstract class Helper implements HelperInterface return mb_substr($string, $from, $length, $encoding); } - public static function formatTime(int|float $secs) + /** + * @return string + */ + public static function formatTime(int|float $secs, int $precision = 1) { + $secs = (int) floor($secs); + + if (0 === $secs) { + return '< 1 sec'; + } + static $timeFormats = [ - [0, '< 1 sec'], - [1, '1 sec'], - [2, 'secs', 1], - [60, '1 min'], - [120, 'mins', 60], - [3600, '1 hr'], - [7200, 'hrs', 3600], - [86400, '1 day'], - [172800, 'days', 86400], + [1, '1 sec', 'secs'], + [60, '1 min', 'mins'], + [3600, '1 hr', 'hrs'], + [86400, '1 day', 'days'], ]; + $times = []; foreach ($timeFormats as $index => $format) { - if ($secs >= $format[0]) { - if ((isset($timeFormats[$index + 1]) && $secs < $timeFormats[$index + 1][0]) - || $index == \count($timeFormats) - 1 - ) { - if (2 == \count($format)) { - return $format[1]; - } + $seconds = isset($timeFormats[$index + 1]) ? $secs % $timeFormats[$index + 1][0] : $secs; - return floor($secs / $format[2]).' '.$format[1]; - } + if (isset($times[$index - $precision])) { + unset($times[$index - $precision]); } + + if (0 === $seconds) { + continue; + } + + $unitCount = ($seconds / $format[0]); + $times[$index] = 1 === $unitCount ? $format[1] : $unitCount.' '.$format[2]; + + if ($secs === $seconds) { + break; + } + + $secs -= $seconds; } + + return implode(', ', array_reverse($times)); } + /** + * @return string + */ public static function formatMemory(int $memory) { if ($memory >= 1024 * 1024 * 1024) { - return sprintf('%.1f GiB', $memory / 1024 / 1024 / 1024); + return \sprintf('%.1f GiB', $memory / 1024 / 1024 / 1024); } if ($memory >= 1024 * 1024) { - return sprintf('%.1f MiB', $memory / 1024 / 1024); + return \sprintf('%.1f MiB', $memory / 1024 / 1024); } if ($memory >= 1024) { - return sprintf('%d KiB', $memory / 1024); + return \sprintf('%d KiB', $memory / 1024); } - return sprintf('%d B', $memory); + return \sprintf('%d B', $memory); } + /** + * @return string + */ public static function removeDecoration(OutputFormatterInterface $formatter, ?string $string) { $isDecorated = $formatter->isDecorated(); diff --git a/vendor/symfony/console/Helper/HelperInterface.php b/vendor/symfony/console/Helper/HelperInterface.php index 2762cdf0..ab626c93 100644 --- a/vendor/symfony/console/Helper/HelperInterface.php +++ b/vendor/symfony/console/Helper/HelperInterface.php @@ -20,6 +20,8 @@ interface HelperInterface { /** * Sets the helper set associated with this helper. + * + * @return void */ public function setHelperSet(?HelperSet $helperSet); diff --git a/vendor/symfony/console/Helper/HelperSet.php b/vendor/symfony/console/Helper/HelperSet.php index cefe62be..8deb22ee 100644 --- a/vendor/symfony/console/Helper/HelperSet.php +++ b/vendor/symfony/console/Helper/HelperSet.php @@ -35,7 +35,10 @@ class HelperSet implements \IteratorAggregate } } - public function set(HelperInterface $helper, string $alias = null) + /** + * @return void + */ + public function set(HelperInterface $helper, ?string $alias = null) { $this->helpers[$helper->getName()] = $helper; if (null !== $alias) { @@ -61,7 +64,7 @@ class HelperSet implements \IteratorAggregate public function get(string $name): HelperInterface { if (!$this->has($name)) { - throw new InvalidArgumentException(sprintf('The helper "%s" is not defined.', $name)); + throw new InvalidArgumentException(\sprintf('The helper "%s" is not defined.', $name)); } return $this->helpers[$name]; diff --git a/vendor/symfony/console/Helper/InputAwareHelper.php b/vendor/symfony/console/Helper/InputAwareHelper.php index ba81e377..6f822597 100644 --- a/vendor/symfony/console/Helper/InputAwareHelper.php +++ b/vendor/symfony/console/Helper/InputAwareHelper.php @@ -23,6 +23,9 @@ abstract class InputAwareHelper extends Helper implements InputAwareInterface { protected $input; + /** + * @return void + */ public function setInput(InputInterface $input) { $this->input = $input; diff --git a/vendor/symfony/console/Helper/OutputWrapper.php b/vendor/symfony/console/Helper/OutputWrapper.php index 2ec819c7..a615ed2f 100644 --- a/vendor/symfony/console/Helper/OutputWrapper.php +++ b/vendor/symfony/console/Helper/OutputWrapper.php @@ -49,7 +49,7 @@ final class OutputWrapper private const URL_PATTERN = 'https?://\S+'; public function __construct( - private bool $allowCutUrls = false + private bool $allowCutUrls = false, ) { } @@ -59,7 +59,7 @@ final class OutputWrapper return $text; } - $tagPattern = sprintf('<(?:(?:%s)|/(?:%s)?)>', self::TAG_OPEN_REGEX_SEGMENT, self::TAG_CLOSE_REGEX_SEGMENT); + $tagPattern = \sprintf('<(?:(?:%s)|/(?:%s)?)>', self::TAG_OPEN_REGEX_SEGMENT, self::TAG_CLOSE_REGEX_SEGMENT); $limitPattern = "{1,$width}"; $patternBlocks = [$tagPattern]; if (!$this->allowCutUrls) { @@ -68,7 +68,7 @@ final class OutputWrapper $patternBlocks[] = '.'; $blocks = implode('|', $patternBlocks); $rowPattern = "(?:$blocks)$limitPattern"; - $pattern = sprintf('#(?:((?>(%1$s)((?<=[^\S\r\n])[^\S\r\n]?|(?=\r?\n)|$|[^\S\r\n]))|(%1$s))(?:\r?\n)?|(?:\r?\n|$))#imux', $rowPattern); + $pattern = \sprintf('#(?:((?>(%1$s)((?<=[^\S\r\n])[^\S\r\n]?|(?=\r?\n)|$|[^\S\r\n]))|(%1$s))(?:\r?\n)?|(?:\r?\n|$))#imux', $rowPattern); $output = rtrim(preg_replace($pattern, '\\1'.$break, $text), $break); return str_replace(' '.$break, $break, $output); diff --git a/vendor/symfony/console/Helper/ProcessHelper.php b/vendor/symfony/console/Helper/ProcessHelper.php index 26d35a1a..ae55a83c 100644 --- a/vendor/symfony/console/Helper/ProcessHelper.php +++ b/vendor/symfony/console/Helper/ProcessHelper.php @@ -32,7 +32,7 @@ class ProcessHelper extends Helper * @param callable|null $callback A PHP callback to run whenever there is some * output available on STDOUT or STDERR */ - public function run(OutputInterface $output, array|Process $cmd, string $error = null, callable $callback = null, int $verbosity = OutputInterface::VERBOSITY_VERY_VERBOSE): Process + public function run(OutputInterface $output, array|Process $cmd, ?string $error = null, ?callable $callback = null, int $verbosity = OutputInterface::VERBOSITY_VERY_VERBOSE): Process { if (!class_exists(Process::class)) { throw new \LogicException('The ProcessHelper cannot be run as the Process component is not installed. Try running "compose require symfony/process".'); @@ -55,7 +55,7 @@ class ProcessHelper extends Helper $process = $cmd[0]; unset($cmd[0]); } else { - throw new \InvalidArgumentException(sprintf('Invalid command provided to "%s()": the command should be an array whose first element is either the path to the binary to run or a "Process" object.', __METHOD__)); + throw new \InvalidArgumentException(\sprintf('Invalid command provided to "%s()": the command should be an array whose first element is either the path to the binary to run or a "Process" object.', __METHOD__)); } if ($verbosity <= $output->getVerbosity()) { @@ -69,12 +69,12 @@ class ProcessHelper extends Helper $process->run($callback, $cmd); if ($verbosity <= $output->getVerbosity()) { - $message = $process->isSuccessful() ? 'Command ran successfully' : sprintf('%s Command did not run successfully', $process->getExitCode()); + $message = $process->isSuccessful() ? 'Command ran successfully' : \sprintf('%s Command did not run successfully', $process->getExitCode()); $output->write($formatter->stop(spl_object_hash($process), $message, $process->isSuccessful())); } if (!$process->isSuccessful() && null !== $error) { - $output->writeln(sprintf('%s', $this->escapeString($error))); + $output->writeln(\sprintf('%s', $this->escapeString($error))); } return $process; @@ -94,7 +94,7 @@ class ProcessHelper extends Helper * * @see run() */ - public function mustRun(OutputInterface $output, array|Process $cmd, string $error = null, callable $callback = null): Process + public function mustRun(OutputInterface $output, array|Process $cmd, ?string $error = null, ?callable $callback = null): Process { $process = $this->run($output, $cmd, $error, $callback); @@ -108,7 +108,7 @@ class ProcessHelper extends Helper /** * Wraps a Process callback to add debugging output. */ - public function wrapCallback(OutputInterface $output, Process $process, callable $callback = null): callable + public function wrapCallback(OutputInterface $output, Process $process, ?callable $callback = null): callable { if ($output instanceof ConsoleOutputInterface) { $output = $output->getErrorOutput(); diff --git a/vendor/symfony/console/Helper/ProgressBar.php b/vendor/symfony/console/Helper/ProgressBar.php index 0d112609..3ab67026 100644 --- a/vendor/symfony/console/Helper/ProgressBar.php +++ b/vendor/symfony/console/Helper/ProgressBar.php @@ -59,6 +59,7 @@ final class ProgressBar private Terminal $terminal; private ?string $previousMessage = null; private Cursor $cursor; + private array $placeholders = []; private static array $formatters; private static array $formats; @@ -94,12 +95,12 @@ final class ProgressBar } /** - * Sets a placeholder formatter for a given name. + * Sets a placeholder formatter for a given name, globally for all instances of ProgressBar. * * This method also allow you to override an existing placeholder. * - * @param string $name The placeholder name (including the delimiter char like %) - * @param callable $callable A PHP callable + * @param string $name The placeholder name (including the delimiter char like %) + * @param callable(ProgressBar):string $callable A PHP callable */ public static function setPlaceholderFormatterDefinition(string $name, callable $callable): void { @@ -120,6 +121,26 @@ final class ProgressBar return self::$formatters[$name] ?? null; } + /** + * Sets a placeholder formatter for a given name, for this instance only. + * + * @param callable(ProgressBar):string $callable A PHP callable + */ + public function setPlaceholderFormatter(string $name, callable $callable): void + { + $this->placeholders[$name] = $callable; + } + + /** + * Gets the placeholder formatter for a given name. + * + * @param string $name The placeholder name (including the delimiter char like %) + */ + public function getPlaceholderFormatter(string $name): ?callable + { + return $this->placeholders[$name] ?? $this::getPlaceholderFormatterDefinition($name); + } + /** * Sets a format for a given name. * @@ -157,14 +178,14 @@ final class ProgressBar * @param string $message The text to associate with the placeholder * @param string $name The name of the placeholder */ - public function setMessage(string $message, string $name = 'message') + public function setMessage(string $message, string $name = 'message'): void { $this->messages[$name] = $message; } - public function getMessage(string $name = 'message') + public function getMessage(string $name = 'message'): ?string { - return $this->messages[$name]; + return $this->messages[$name] ?? null; } public function getStartTime(): int @@ -208,14 +229,14 @@ final class ProgressBar public function getRemaining(): float { - if (!$this->step) { + if (0 === $this->step || $this->step === $this->startingStep) { return 0; } return round((time() - $this->startTime) / ($this->step - $this->startingStep) * ($this->max - $this->step)); } - public function setBarWidth(int $size) + public function setBarWidth(int $size): void { $this->barWidth = max(1, $size); } @@ -225,7 +246,7 @@ final class ProgressBar return $this->barWidth; } - public function setBarCharacter(string $char) + public function setBarCharacter(string $char): void { $this->barChar = $char; } @@ -235,7 +256,7 @@ final class ProgressBar return $this->barChar ?? ($this->max ? '=' : $this->emptyBarChar); } - public function setEmptyBarCharacter(string $char) + public function setEmptyBarCharacter(string $char): void { $this->emptyBarChar = $char; } @@ -245,7 +266,7 @@ final class ProgressBar return $this->emptyBarChar; } - public function setProgressCharacter(string $char) + public function setProgressCharacter(string $char): void { $this->progressChar = $char; } @@ -255,7 +276,7 @@ final class ProgressBar return $this->progressChar; } - public function setFormat(string $format) + public function setFormat(string $format): void { $this->format = null; $this->internalFormat = $format; @@ -266,7 +287,7 @@ final class ProgressBar * * @param int|null $freq The frequency in steps */ - public function setRedrawFrequency(?int $freq) + public function setRedrawFrequency(?int $freq): void { $this->redrawFreq = null !== $freq ? max(1, $freq) : null; } @@ -284,9 +305,15 @@ final class ProgressBar /** * Returns an iterator that will automatically update the progress bar when iterated. * - * @param int|null $max Number of steps to complete the bar (0 if indeterminate), if null it will be inferred from $iterable + * @template TKey + * @template TValue + * + * @param iterable $iterable + * @param int|null $max Number of steps to complete the bar (0 if indeterminate), if null it will be inferred from $iterable + * + * @return iterable */ - public function iterate(iterable $iterable, int $max = null): iterable + public function iterate(iterable $iterable, ?int $max = null): iterable { $this->start($max ?? (is_countable($iterable) ? \count($iterable) : 0)); @@ -305,7 +332,7 @@ final class ProgressBar * @param int|null $max Number of steps to complete the bar (0 if indeterminate), null to leave unchanged * @param int $startAt The starting point of the bar (useful e.g. when resuming a previously started bar) */ - public function start(int $max = null, int $startAt = 0): void + public function start(?int $max = null, int $startAt = 0): void { $this->startTime = time(); $this->step = $startAt; @@ -325,7 +352,7 @@ final class ProgressBar * * @param int $step Number of steps to advance */ - public function advance(int $step = 1) + public function advance(int $step = 1): void { $this->setProgress($this->step + $step); } @@ -333,12 +360,12 @@ final class ProgressBar /** * Sets whether to overwrite the progressbar, false for new line. */ - public function setOverwrite(bool $overwrite) + public function setOverwrite(bool $overwrite): void { $this->overwrite = $overwrite; } - public function setProgress(int $step) + public function setProgress(int $step): void { if ($this->max && $step > $this->max) { $this->max = $step; @@ -371,7 +398,7 @@ final class ProgressBar } } - public function setMaxSteps(int $max) + public function setMaxSteps(int $max): void { $this->format = null; $this->max = max(0, $max); @@ -431,7 +458,7 @@ final class ProgressBar $this->overwrite(''); } - private function setRealFormat(string $format) + private function setRealFormat(string $format): void { // try to use the _nomax variant if available if (!$this->max && null !== self::getFormatDefinition($format.'_nomax')) { @@ -459,12 +486,21 @@ final class ProgressBar if ($this->output instanceof ConsoleSectionOutput) { $messageLines = explode("\n", $this->previousMessage); $lineCount = \count($messageLines); + + $lastLineWithoutDecoration = Helper::removeDecoration($this->output->getFormatter(), end($messageLines) ?? ''); + + // When the last previous line is empty (without formatting) it is already cleared by the section output, so we don't need to clear it again + if ('' === $lastLineWithoutDecoration) { + --$lineCount; + } + foreach ($messageLines as $messageLine) { $messageLineLength = Helper::width(Helper::removeDecoration($this->output->getFormatter(), $messageLine)); if ($messageLineLength > $this->terminal->getWidth()) { $lineCount += floor($messageLineLength / $this->terminal->getWidth()); } } + $this->output->clear($lineCount); } else { $lineCount = substr_count($this->previousMessage, "\n"); @@ -503,45 +539,35 @@ final class ProgressBar private static function initPlaceholderFormatters(): array { return [ - 'bar' => function (self $bar, OutputInterface $output) { + 'bar' => static function (self $bar, OutputInterface $output) { $completeBars = $bar->getBarOffset(); $display = str_repeat($bar->getBarCharacter(), $completeBars); if ($completeBars < $bar->getBarWidth()) { $emptyBars = $bar->getBarWidth() - $completeBars - Helper::length(Helper::removeDecoration($output->getFormatter(), $bar->getProgressCharacter())); - $display .= $bar->getProgressCharacter().str_repeat($bar->getEmptyBarCharacter(), $emptyBars); + $display .= $bar->getProgressCharacter().str_repeat($bar->getEmptyBarCharacter(), max(0, $emptyBars)); } return $display; }, - 'elapsed' => function (self $bar) { - return Helper::formatTime(time() - $bar->getStartTime()); - }, - 'remaining' => function (self $bar) { + 'elapsed' => static fn (self $bar) => Helper::formatTime(time() - $bar->getStartTime(), 2), + 'remaining' => static function (self $bar) { if (!$bar->getMaxSteps()) { throw new LogicException('Unable to display the remaining time if the maximum number of steps is not set.'); } - return Helper::formatTime($bar->getRemaining()); + return Helper::formatTime($bar->getRemaining(), 2); }, - 'estimated' => function (self $bar) { + 'estimated' => static function (self $bar) { if (!$bar->getMaxSteps()) { throw new LogicException('Unable to display the estimated time if the maximum number of steps is not set.'); } - return Helper::formatTime($bar->getEstimated()); - }, - 'memory' => function (self $bar) { - return Helper::formatMemory(memory_get_usage(true)); - }, - 'current' => function (self $bar) { - return str_pad($bar->getProgress(), $bar->getStepWidth(), ' ', \STR_PAD_LEFT); - }, - 'max' => function (self $bar) { - return $bar->getMaxSteps(); - }, - 'percent' => function (self $bar) { - return floor($bar->getProgressPercent() * 100); + return Helper::formatTime($bar->getEstimated(), 2); }, + 'memory' => static fn (self $bar) => Helper::formatMemory(memory_get_usage(true)), + 'current' => static fn (self $bar) => str_pad($bar->getProgress(), $bar->getStepWidth(), ' ', \STR_PAD_LEFT), + 'max' => static fn (self $bar) => $bar->getMaxSteps(), + 'percent' => static fn (self $bar) => floor($bar->getProgressPercent() * 100), ]; } @@ -568,7 +594,7 @@ final class ProgressBar $regex = "{%([a-z\-_]+)(?:\:([^%]+))?%}i"; $callback = function ($matches) { - if ($formatter = $this::getPlaceholderFormatterDefinition($matches[1])) { + if ($formatter = $this->getPlaceholderFormatter($matches[1])) { $text = $formatter($this, $this->output); } elseif (isset($this->messages[$matches[1]])) { $text = $this->messages[$matches[1]]; @@ -577,7 +603,7 @@ final class ProgressBar } if (isset($matches[2])) { - $text = sprintf('%'.$matches[2], $text); + $text = \sprintf('%'.$matches[2], $text); } return $text; @@ -585,9 +611,7 @@ final class ProgressBar $line = preg_replace_callback($regex, $callback, $this->format); // gets string length for each sub line with multiline format - $linesLength = array_map(function ($subLine) { - return Helper::width(Helper::removeDecoration($this->output->getFormatter(), rtrim($subLine, "\r"))); - }, explode("\n", $line)); + $linesLength = array_map(fn ($subLine) => Helper::width(Helper::removeDecoration($this->output->getFormatter(), rtrim($subLine, "\r"))), explode("\n", $line)); $linesWidth = max($linesLength); diff --git a/vendor/symfony/console/Helper/ProgressIndicator.php b/vendor/symfony/console/Helper/ProgressIndicator.php index b5fa24c4..ed17bde3 100644 --- a/vendor/symfony/console/Helper/ProgressIndicator.php +++ b/vendor/symfony/console/Helper/ProgressIndicator.php @@ -13,6 +13,7 @@ namespace Symfony\Component\Console\Helper; use Symfony\Component\Console\Exception\InvalidArgumentException; use Symfony\Component\Console\Exception\LogicException; +use Symfony\Component\Console\Output\ConsoleSectionOutput; use Symfony\Component\Console\Output\OutputInterface; /** @@ -50,7 +51,7 @@ class ProgressIndicator * @param int $indicatorChangeInterval Change interval in milliseconds * @param array|null $indicatorValues Animated indicator characters */ - public function __construct(OutputInterface $output, string $format = null, int $indicatorChangeInterval = 100, array $indicatorValues = null) + public function __construct(OutputInterface $output, ?string $format = null, int $indicatorChangeInterval = 100, ?array $indicatorValues = null) { $this->output = $output; @@ -70,6 +71,8 @@ class ProgressIndicator /** * Sets the current indicator message. + * + * @return void */ public function setMessage(?string $message) { @@ -80,6 +83,8 @@ class ProgressIndicator /** * Starts the indicator output. + * + * @return void */ public function start(string $message) { @@ -98,6 +103,8 @@ class ProgressIndicator /** * Advances the indicator. + * + * @return void */ public function advance() { @@ -123,6 +130,8 @@ class ProgressIndicator /** * Finish the indicator with message. + * + * @return void */ public function finish(string $message) { @@ -132,7 +141,9 @@ class ProgressIndicator $this->message = $message; $this->display(); - $this->output->writeln(''); + if (!$this->output instanceof ConsoleSectionOutput) { + $this->output->writeln(''); + } $this->started = false; } @@ -148,6 +159,8 @@ class ProgressIndicator * Sets a placeholder formatter for a given name. * * This method also allow you to override an existing placeholder. + * + * @return void */ public static function setPlaceholderFormatterDefinition(string $name, callable $callable) { @@ -166,7 +179,7 @@ class ProgressIndicator return self::$formatters[$name] ?? null; } - private function display() + private function display(): void { if (OutputInterface::VERBOSITY_QUIET === $this->output->getVerbosity()) { return; @@ -195,9 +208,11 @@ class ProgressIndicator /** * Overwrites a previous message to the output. */ - private function overwrite(string $message) + private function overwrite(string $message): void { - if ($this->output->isDecorated()) { + if ($this->output instanceof ConsoleSectionOutput) { + $this->output->overwrite($message); + } elseif ($this->output->isDecorated()) { $this->output->write("\x0D\x1B[2K"); $this->output->write($message); } else { @@ -216,18 +231,10 @@ class ProgressIndicator private static function initPlaceholderFormatters(): array { return [ - 'indicator' => function (self $indicator) { - return $indicator->indicatorValues[$indicator->indicatorCurrent % \count($indicator->indicatorValues)]; - }, - 'message' => function (self $indicator) { - return $indicator->message; - }, - 'elapsed' => function (self $indicator) { - return Helper::formatTime(time() - $indicator->startTime); - }, - 'memory' => function () { - return Helper::formatMemory(memory_get_usage(true)); - }, + 'indicator' => static fn (self $indicator) => $indicator->indicatorValues[$indicator->indicatorCurrent % \count($indicator->indicatorValues)], + 'message' => static fn (self $indicator) => $indicator->message, + 'elapsed' => static fn (self $indicator) => Helper::formatTime(time() - $indicator->startTime, 2), + 'memory' => static fn () => Helper::formatMemory(memory_get_usage(true)), ]; } } diff --git a/vendor/symfony/console/Helper/QuestionHelper.php b/vendor/symfony/console/Helper/QuestionHelper.php index c345b4af..c1c84c04 100644 --- a/vendor/symfony/console/Helper/QuestionHelper.php +++ b/vendor/symfony/console/Helper/QuestionHelper.php @@ -68,9 +68,7 @@ class QuestionHelper extends Helper return $this->doAsk($output, $question); } - $interviewer = function () use ($output, $question) { - return $this->doAsk($output, $question); - }; + $interviewer = fn () => $this->doAsk($output, $question); return $this->validateAttempts($interviewer, $output, $question); } catch (MissingInputException $exception) { @@ -91,6 +89,8 @@ class QuestionHelper extends Helper /** * Prevents usage of stty. + * + * @return void */ public static function disableStty() { @@ -123,7 +123,18 @@ class QuestionHelper extends Helper } if (false === $ret) { + $isBlocked = stream_get_meta_data($inputStream)['blocked'] ?? true; + + if (!$isBlocked) { + stream_set_blocking($inputStream, true); + } + $ret = $this->readInput($inputStream, $question); + + if (!$isBlocked) { + stream_set_blocking($inputStream, false); + } + if (false === $ret) { throw new MissingInputException('Aborted.'); } @@ -159,7 +170,7 @@ class QuestionHelper extends Helper } if ($validator = $question->getValidator()) { - return \call_user_func($question->getValidator(), $default); + return \call_user_func($validator, $default); } elseif ($question instanceof ChoiceQuestion) { $choices = $question->getChoices(); @@ -179,6 +190,8 @@ class QuestionHelper extends Helper /** * Outputs the question prompt. + * + * @return void */ protected function writePrompt(OutputInterface $output, Question $question) { @@ -207,7 +220,7 @@ class QuestionHelper extends Helper foreach ($choices as $key => $value) { $padding = str_repeat(' ', $maxWidth - self::width($key)); - $messages[] = sprintf(" [<$tag>%s$padding] %s", $key, $value); + $messages[] = \sprintf(" [<$tag>%s$padding] %s", $key, $value); } return $messages; @@ -215,6 +228,8 @@ class QuestionHelper extends Helper /** * Outputs an error message. + * + * @return void */ protected function writeError(OutputInterface $output, \Exception $error) { @@ -243,11 +258,7 @@ class QuestionHelper extends Helper $ofs = -1; $matches = $autocomplete($ret); $numMatches = \count($matches); - - $sttyMode = shell_exec('stty -g'); - $isStdin = 'php://stdin' === (stream_get_meta_data($inputStream)['uri'] ?? null); - $r = [$inputStream]; - $w = []; + $inputHelper = new TerminalInputHelper($inputStream); // Disable icanon (so we can fread each keypress) and echo (we'll do echoing here instead) shell_exec('stty -icanon -echo'); @@ -257,15 +268,13 @@ class QuestionHelper extends Helper // Read a keypress while (!feof($inputStream)) { - while ($isStdin && 0 === @stream_select($r, $w, $w, 0, 100)) { - // Give signal handlers a chance to run - $r = [$inputStream]; - } + $inputHelper->waitForInput(); $c = fread($inputStream, 1); // as opposed to fgets(), fread() returns an empty string when the stream content is empty, not false. if (false === $c || ('' === $ret && '' === $c && null === $question->getDefault())) { - shell_exec('stty '.$sttyMode); + // Restore the terminal so it behaves normally again + $inputHelper->finish(); throw new MissingInputException('Aborted.'); } elseif ("\177" === $c) { // Backspace Character if (0 === $numMatches && 0 !== $i) { @@ -302,21 +311,19 @@ class QuestionHelper extends Helper $ofs += ('A' === $c[2]) ? -1 : 1; $ofs = ($numMatches + $ofs) % $numMatches; } - } elseif (\ord($c) < 32) { + } elseif ('' === $c || \ord($c) < 32) { if ("\t" === $c || "\n" === $c) { if ($numMatches > 0 && -1 !== $ofs) { $ret = (string) $matches[$ofs]; // Echo out remaining chars for current match - $remainingCharacters = substr($ret, \strlen(trim($this->mostRecentlyEnteredValue($fullChoice)))); + $remainingCharacters = substr($ret, \strlen($this->mostRecentlyEnteredValue($fullChoice))); $output->write($remainingCharacters); $fullChoice .= $remainingCharacters; $i = (false === $encoding = mb_detect_encoding($fullChoice, null, true)) ? \strlen($fullChoice) : mb_strlen($fullChoice, $encoding); $matches = array_filter( $autocomplete($ret), - function ($match) use ($ret) { - return '' === $ret || str_starts_with($match, $ret); - } + static fn ($match) => '' === $ret || str_starts_with($match, $ret) ); $numMatches = \count($matches); $ofs = -1; @@ -363,14 +370,14 @@ class QuestionHelper extends Helper if ($numMatches > 0 && -1 !== $ofs) { $cursor->savePosition(); // Write highlighted text, complete the partially entered response - $charactersEntered = \strlen(trim($this->mostRecentlyEnteredValue($fullChoice))); + $charactersEntered = \strlen($this->mostRecentlyEnteredValue($fullChoice)); $output->write(''.OutputFormatter::escapeTrailingBackslash(substr($matches[$ofs], $charactersEntered)).''); $cursor->restorePosition(); } } - // Reset stty so it behaves normally again - shell_exec('stty '.$sttyMode); + // Restore the terminal so it behaves normally again + $inputHelper->finish(); return $fullChoice; } @@ -421,27 +428,25 @@ class QuestionHelper extends Helper return $value; } + $inputHelper = null; + if (self::$stty && Terminal::hasSttyAvailable()) { - $sttyMode = shell_exec('stty -g'); + $inputHelper = new TerminalInputHelper($inputStream); shell_exec('stty -echo'); } elseif ($this->isInteractiveInput($inputStream)) { throw new RuntimeException('Unable to hide the response.'); } - $value = fgets($inputStream, 4096); + $value = $this->doReadInput($inputStream, helper: $inputHelper); if (4095 === \strlen($value)) { $errOutput = $output instanceof ConsoleOutputInterface ? $output->getErrorOutput() : $output; $errOutput->warning('The value was possibly truncated by your shell or terminal emulator'); } - if (self::$stty && Terminal::hasSttyAvailable()) { - shell_exec('stty '.$sttyMode); - } + // Restore the terminal so it behaves normally again + $inputHelper?->finish(); - if (false === $value) { - throw new MissingInputException('Aborted.'); - } if ($trimmable) { $value = trim($value); } @@ -469,6 +474,8 @@ class QuestionHelper extends Helper try { return $question->getValidator()($interviewer()); + } catch (MissingInputException $e) { + throw $error ?? $e; } catch (RuntimeException $e) { throw $e; } catch (\Exception $error) { @@ -488,21 +495,7 @@ class QuestionHelper extends Helper return self::$stdinIsInteractive; } - if (\function_exists('stream_isatty')) { - return self::$stdinIsInteractive = @stream_isatty(fopen('php://stdin', 'r')); - } - - if (\function_exists('posix_isatty')) { - return self::$stdinIsInteractive = @posix_isatty(fopen('php://stdin', 'r')); - } - - if (!\function_exists('exec')) { - return self::$stdinIsInteractive = true; - } - - exec('stty 2> /dev/null', $output, $status); - - return self::$stdinIsInteractive = 1 !== $status; + return self::$stdinIsInteractive = @stream_isatty(fopen('php://stdin', 'r')); } /** @@ -515,7 +508,7 @@ class QuestionHelper extends Helper { if (!$question->isMultiline()) { $cp = $this->setIOCodepage(); - $ret = fgets($inputStream, 4096); + $ret = $this->doReadInput($inputStream); return $this->resetIOCodepage($cp, $ret); } @@ -525,13 +518,11 @@ class QuestionHelper extends Helper return false; } - $ret = ''; $cp = $this->setIOCodepage(); - while (false !== ($char = fgetc($multiLineStreamReader))) { - if (\PHP_EOL === "{$ret}{$char}") { - break; - } - $ret .= $char; + $ret = $this->doReadInput($multiLineStreamReader, "\x4"); + + if (stream_get_meta_data($inputStream)['seekable']) { + fseek($inputStream, ftell($multiLineStreamReader)); } return $this->resetIOCodepage($cp, $ret); @@ -598,4 +589,35 @@ class QuestionHelper extends Helper return $cloneStream; } + + /** + * @param resource $inputStream + */ + private function doReadInput($inputStream, ?string $exitChar = null, ?TerminalInputHelper $helper = null): string + { + $ret = ''; + $helper ??= new TerminalInputHelper($inputStream, false); + + while (!feof($inputStream)) { + $helper->waitForInput(); + $char = fread($inputStream, 1); + + // as opposed to fgets(), fread() returns an empty string when the stream content is empty, not false. + if (false === $char || ('' === $ret && '' === $char)) { + throw new MissingInputException('Aborted.'); + } + + if (\PHP_EOL === "{$ret}{$char}" || $exitChar === $char) { + break; + } + + $ret .= $char; + + if (null === $exitChar && "\n" === $char) { + break; + } + } + + return $ret; + } } diff --git a/vendor/symfony/console/Helper/SymfonyQuestionHelper.php b/vendor/symfony/console/Helper/SymfonyQuestionHelper.php index 109045d0..89866fe3 100644 --- a/vendor/symfony/console/Helper/SymfonyQuestionHelper.php +++ b/vendor/symfony/console/Helper/SymfonyQuestionHelper.php @@ -25,23 +25,26 @@ use Symfony\Component\Console\Style\SymfonyStyle; */ class SymfonyQuestionHelper extends QuestionHelper { + /** + * @return void + */ protected function writePrompt(OutputInterface $output, Question $question) { $text = OutputFormatter::escapeTrailingBackslash($question->getQuestion()); $default = $question->getDefault(); if ($question->isMultiline()) { - $text .= sprintf(' (press %s to continue)', $this->getEofShortcut()); + $text .= \sprintf(' (press %s to continue)', $this->getEofShortcut($output)); } switch (true) { case null === $default: - $text = sprintf(' %s:', $text); + $text = \sprintf(' %s:', $text); break; case $question instanceof ConfirmationQuestion: - $text = sprintf(' %s (yes/no) [%s]:', $text, $default ? 'yes' : 'no'); + $text = \sprintf(' %s (yes/no) [%s]:', $text, $default ? 'yes' : 'no'); break; @@ -53,18 +56,18 @@ class SymfonyQuestionHelper extends QuestionHelper $default[$key] = $choices[trim($value)]; } - $text = sprintf(' %s [%s]:', $text, OutputFormatter::escape(implode(', ', $default))); + $text = \sprintf(' %s [%s]:', $text, implode(', ', $default)); break; case $question instanceof ChoiceQuestion: $choices = $question->getChoices(); - $text = sprintf(' %s [%s]:', $text, OutputFormatter::escape($choices[$default] ?? $default)); + $text = \sprintf(' %s [%s]:', $text, $choices[$default] ?? $default); break; default: - $text = sprintf(' %s [%s]:', $text, OutputFormatter::escape($default)); + $text = \sprintf(' %s [%s]:', $text, OutputFormatter::escape($default)); } $output->writeln($text); @@ -80,6 +83,9 @@ class SymfonyQuestionHelper extends QuestionHelper $output->write($prompt); } + /** + * @return void + */ protected function writeError(OutputInterface $output, \Exception $error) { if ($output instanceof SymfonyStyle) { @@ -92,9 +98,9 @@ class SymfonyQuestionHelper extends QuestionHelper parent::writeError($output, $error); } - private function getEofShortcut(): string + private function getEofShortcut(OutputInterface $output): string { - if ('Windows' === \PHP_OS_FAMILY) { + if ('\\' === \DIRECTORY_SEPARATOR && !$output->isDecorated()) { return 'Ctrl+Z then Enter'; } diff --git a/vendor/symfony/console/Helper/Table.php b/vendor/symfony/console/Helper/Table.php index 893b3192..d45285f8 100644 --- a/vendor/symfony/console/Helper/Table.php +++ b/vendor/symfony/console/Helper/Table.php @@ -66,6 +66,8 @@ class Table /** * Sets a style definition. + * + * @return void */ public static function setStyleDefinition(string $name, TableStyle $style) { @@ -81,7 +83,7 @@ class Table { self::$styles ??= self::initStyles(); - return self::$styles[$name] ?? throw new InvalidArgumentException(sprintf('Style "%s" is not defined.', $name)); + return self::$styles[$name] ?? throw new InvalidArgumentException(\sprintf('Style "%s" is not defined.', $name)); } /** @@ -166,7 +168,7 @@ class Table public function setColumnMaxWidth(int $columnIndex, int $width): static { if (!$this->output->getFormatter() instanceof WrappableOutputFormatterInterface) { - throw new \LogicException(sprintf('Setting a maximum column width is only supported when using a "%s" formatter, got "%s".', WrappableOutputFormatterInterface::class, get_debug_type($this->output->getFormatter()))); + throw new \LogicException(\sprintf('Setting a maximum column width is only supported when using a "%s" formatter, got "%s".', WrappableOutputFormatterInterface::class, get_debug_type($this->output->getFormatter()))); } $this->columnMaxWidths[$columnIndex] = $width; @@ -235,7 +237,7 @@ class Table public function appendRow(TableSeparator|array $row): static { if (!$this->output instanceof ConsoleSectionOutput) { - throw new RuntimeException(sprintf('Output should be an instance of "%s" when calling "%s".', ConsoleSectionOutput::class, __METHOD__)); + throw new RuntimeException(\sprintf('Output should be an instance of "%s" when calling "%s".', ConsoleSectionOutput::class, __METHOD__)); } if ($this->rendered) { @@ -310,6 +312,8 @@ class Table * | 9971-5-0210-0 | A Tale of Two Cities | Charles Dickens | * | 960-425-059-0 | The Lord of the Rings | J. R. R. Tolkien | * +---------------+-----------------------+------------------+ + * + * @return void */ public function render() { @@ -360,14 +364,28 @@ class Table $maxRows = max(\count($headers), \count($row)); for ($i = 0; $i < $maxRows; ++$i) { $cell = (string) ($row[$i] ?? ''); - if ($headers && !$containsColspan) { - $rows[] = [sprintf( - '%s: %s', - str_pad($headers[$i] ?? '', $maxHeaderLength, ' ', \STR_PAD_LEFT), - $cell - )]; - } elseif ('' !== $cell) { - $rows[] = [$cell]; + + $eol = str_contains($cell, "\r\n") ? "\r\n" : "\n"; + $parts = explode($eol, $cell); + foreach ($parts as $idx => $part) { + if ($headers && !$containsColspan) { + if (0 === $idx) { + $rows[] = [\sprintf( + '%s%s: %s', + str_repeat(' ', $maxHeaderLength - Helper::width(Helper::removeDecoration($formatter, $headers[$i] ?? ''))), + $headers[$i] ?? '', + $part + )]; + } else { + $rows[] = [\sprintf( + '%s %s', + str_pad('', $maxHeaderLength, ' ', \STR_PAD_LEFT), + $part + )]; + } + } elseif ('' !== $cell) { + $rows[] = [$part]; + } } } } @@ -383,6 +401,8 @@ class Table $isHeader = !$horizontal; $isFirstRow = $horizontal; $hasTitle = (bool) $this->headerTitle; + $previousRow = null; + $pendingSeparators = 0; foreach ($rowGroups as $rowGroup) { $isHeaderSeparatorRendered = false; @@ -396,7 +416,8 @@ class Table } if ($row instanceof TableSeparator) { - $this->renderRowSeparator(); + // defer rendering until the row below is known, to align crossings with it + ++$pendingSeparators; continue; } @@ -405,11 +426,17 @@ class Table continue; } + for (; $pendingSeparators > 0; --$pendingSeparators) { + $this->renderRowSeparator(self::SEPARATOR_MID, null, null, $previousRow, $row); + } + if ($isHeader && !$isHeaderSeparatorRendered) { $this->renderRowSeparator( - $isHeader ? self::SEPARATOR_TOP : self::SEPARATOR_TOP_BOTTOM, + self::SEPARATOR_TOP, $hasTitle ? $this->headerTitle : null, - $hasTitle ? $this->style->getHeaderTitleFormat() : null + $hasTitle ? $this->style->getHeaderTitleFormat() : null, + null, + $row ); $hasTitle = false; $isHeaderSeparatorRendered = true; @@ -417,9 +444,11 @@ class Table if ($isFirstRow) { $this->renderRowSeparator( - $isHeader ? self::SEPARATOR_TOP : self::SEPARATOR_TOP_BOTTOM, + $horizontal || !array_filter($this->headers) ? self::SEPARATOR_TOP : self::SEPARATOR_TOP_BOTTOM, $hasTitle ? $this->headerTitle : null, - $hasTitle ? $this->style->getHeaderTitleFormat() : null + $hasTitle ? $this->style->getHeaderTitleFormat() : null, + $previousRow, + $row ); $isFirstRow = false; $hasTitle = false; @@ -435,9 +464,16 @@ class Table } else { $this->renderRow($row, $isHeader ? $this->style->getCellHeaderFormat() : $this->style->getCellRowFormat()); } + + $previousRow = $row; } } - $this->renderRowSeparator(self::SEPARATOR_BOTTOM, $this->footerTitle, $this->style->getFooterTitleFormat()); + + for (; $pendingSeparators > 0; --$pendingSeparators) { + $this->renderRowSeparator(self::SEPARATOR_MID, null, null, $previousRow); + } + + $this->renderRowSeparator(self::SEPARATOR_BOTTOM, $this->footerTitle, $this->style->getFooterTitleFormat(), $previousRow); $this->cleanup(); $this->rendered = true; @@ -450,7 +486,7 @@ class Table * * +-----+-----------+-------+ */ - private function renderRowSeparator(int $type = self::SEPARATOR_MID, string $title = null, string $titleFormat = null) + private function renderRowSeparator(int $type = self::SEPARATOR_MID, ?string $title = null, ?string $titleFormat = null, ?array $rowAbove = null, ?array $rowBelow = null): void { if (!$count = $this->numberOfColumns) { return; @@ -472,19 +508,42 @@ class Table [$horizontal, $leftChar, $midChar, $rightChar] = [$borders[0], $crossings[7], $crossings[6], $crossings[5]]; } + // only draw a crossing where a vertical border meets the separator; a cell + // spanning several columns has no border on the columns it covers + $hasLineAbove = self::SEPARATOR_TOP !== $type; + $hasLineBelow = self::SEPARATOR_BOTTOM !== $type; + $columnsAbove = null !== $rowAbove ? $this->getRowColumns($rowAbove) : null; + $columnsBelow = null !== $rowBelow ? $this->getRowColumns($rowBelow) : null; + $markup = $leftChar; for ($column = 0; $column < $count; ++$column) { $markup .= str_repeat($horizontal, $this->effectiveColumnWidths[$column]); - $markup .= $column === $count - 1 ? $rightChar : $midChar; + if ($column === $count - 1) { + $markup .= $rightChar; + + continue; + } + + $borderAbove = $hasLineAbove && (null === $columnsAbove || \in_array($column + 1, $columnsAbove, true)); + $borderBelow = $hasLineBelow && (null === $columnsBelow || \in_array($column + 1, $columnsBelow, true)); + // the one-sided junctions reuse the top/bottom crossing chars; for the "box-double" + // style these are double-horizontal (╤/╧) while an inner separator is single (─), as + // that style has no single-line ┬/┴ to fall back to + $markup .= match (true) { + $borderAbove && $borderBelow => $midChar, + $borderBelow => $crossings[2], + $borderAbove => $crossings[6], + default => $horizontal, + }; } if (null !== $title) { - $titleLength = Helper::width(Helper::removeDecoration($formatter = $this->output->getFormatter(), $formattedTitle = sprintf($titleFormat, $title))); + $titleLength = Helper::width(Helper::removeDecoration($formatter = $this->output->getFormatter(), $formattedTitle = \sprintf($titleFormat, $title))); $markupLength = Helper::width($markup); if ($titleLength > $limit = $markupLength - 4) { $titleLength = $limit; - $formatLength = Helper::width(Helper::removeDecoration($formatter, sprintf($titleFormat, ''))); - $formattedTitle = sprintf($titleFormat, Helper::substr($title, 0, $limit - $formatLength - 3).'...'); + $formatLength = Helper::width(Helper::removeDecoration($formatter, \sprintf($titleFormat, ''))); + $formattedTitle = \sprintf($titleFormat, Helper::substr($title, 0, $limit - $formatLength - 3).'...'); } $titleStart = intdiv($markupLength - $titleLength, 2); @@ -495,7 +554,7 @@ class Table } } - $this->output->writeln(sprintf($this->style->getBorderFormat(), $markup)); + $this->output->writeln(\sprintf($this->style->getBorderFormat(), $markup)); } /** @@ -505,7 +564,7 @@ class Table { $borders = $this->style->getBorderChars(); - return sprintf($this->style->getBorderFormat(), self::BORDER_OUTSIDE === $type ? $borders[1] : $borders[3]); + return \sprintf($this->style->getBorderFormat(), self::BORDER_OUTSIDE === $type ? $borders[1] : $borders[3]); } /** @@ -515,11 +574,11 @@ class Table * * | 9971-5-0210-0 | A Tale of Two Cities | Charles Dickens | */ - private function renderRow(array $row, string $cellFormat, string $firstCellFormat = null) + private function renderRow(array $row, string $cellFormat, ?string $firstCellFormat = null): void { $rowContent = $this->renderColumnSeparator(self::BORDER_OUTSIDE); $columns = $this->getRowColumns($row); - $last = \count($columns) - 1; + $last = array_key_last($columns); foreach ($columns as $i => $column) { if ($firstCellFormat && 0 === $i) { $rowContent .= $this->renderCell($row, $column, $firstCellFormat); @@ -546,18 +605,15 @@ class Table } // str_pad won't work properly with multi-byte strings, we need to fix the padding - if (false !== $encoding = mb_detect_encoding($cell, null, true)) { - $width += \strlen($cell) - mb_strwidth($cell, $encoding); - } - + $width += \strlen($cell) - Helper::width($cell) - substr_count($cell, "\0"); $style = $this->getColumnStyle($column); if ($cell instanceof TableSeparator) { - return sprintf($style->getBorderFormat(), str_repeat($style->getBorderChars()[2], $width)); + return \sprintf($style->getBorderFormat(), str_repeat($style->getBorderChars()[2], $width)); } $width += Helper::length($cell) - Helper::length(Helper::removeDecoration($this->output->getFormatter(), $cell)); - $content = sprintf($style->getCellRowContentFormat(), $cell); + $content = \sprintf($style->getCellRowContentFormat(), $cell); $padType = $style->getPadType(); if ($cell instanceof TableCell && $cell->getStyle() instanceof TableCellStyle) { @@ -582,13 +638,13 @@ class Table $padType = $cell->getStyle()->getPadByAlign(); } - return sprintf($cellFormat, str_pad($content, $width, $style->getPaddingChar(), $padType)); + return \sprintf($cellFormat, str_pad($content, $width, $style->getPaddingChar(), $padType)); } /** * Calculate number of columns for this table. */ - private function calculateNumberOfColumns(array $rows) + private function calculateNumberOfColumns(array $rows): void { $columns = [0]; foreach ($rows as $row) { @@ -614,15 +670,56 @@ class Table foreach ($rows[$rowKey] as $column => $cell) { $colspan = $cell instanceof TableCell ? $cell->getColspan() : 1; - if (isset($this->columnMaxWidths[$column]) && Helper::width(Helper::removeDecoration($formatter, $cell)) > $this->columnMaxWidths[$column]) { - $cell = $formatter->formatAndWrap($cell, $this->columnMaxWidths[$column] * $colspan); + $minWrappedWidth = 0; + $widthApplied = []; + $lengthColumnBorder = $this->getColumnSeparatorWidth() + Helper::width($this->style->getCellRowContentFormat()) - 2; + for ($i = $column; $i < ($column + $colspan); ++$i) { + if (isset($this->columnMaxWidths[$i])) { + $minWrappedWidth += $this->columnMaxWidths[$i]; + $widthApplied[] = ['type' => 'max', 'column' => $i]; + } elseif (($this->columnWidths[$i] ?? 0) > 0 && $colspan > 1) { + $minWrappedWidth += $this->columnWidths[$i]; + $widthApplied[] = ['type' => 'min', 'column' => $i]; + } + } + if (1 === \count($widthApplied)) { + if ($colspan > 1) { + $minWrappedWidth *= $colspan; // previous logic + } + } elseif (\count($widthApplied) > 1) { + $minWrappedWidth += (\count($widthApplied) - 1) * $lengthColumnBorder; + } + + $cellWidth = Helper::width(Helper::removeDecoration($formatter, $cell)); + if ($minWrappedWidth && $cellWidth > $minWrappedWidth) { + $cell = $formatter->formatAndWrap($cell, $minWrappedWidth); + } + // update minimal columnWidths for spanned columns + if ($colspan > 1 && $minWrappedWidth > 0) { + $columnsMinWidthProcessed = []; + $cellWidth = min($cellWidth, $minWrappedWidth); + foreach ($widthApplied as $item) { + if ('max' === $item['type'] && $cellWidth >= $this->columnMaxWidths[$item['column']]) { + $minWidthColumn = $this->columnMaxWidths[$item['column']]; + $this->columnWidths[$item['column']] = $minWidthColumn; + $columnsMinWidthProcessed[$item['column']] = true; + $cellWidth -= $minWidthColumn + $lengthColumnBorder; + } + } + for ($i = $column; $i < ($column + $colspan); ++$i) { + if (isset($columnsMinWidthProcessed[$i])) { + continue; + } + $this->columnWidths[$i] = $cellWidth + $lengthColumnBorder; + } } if (!str_contains($cell ?? '', "\n")) { continue; } - $escaped = implode("\n", array_map(OutputFormatter::escapeTrailingBackslash(...), explode("\n", $cell))); + $eol = str_contains($cell ?? '', "\r\n") ? "\r\n" : "\n"; + $escaped = implode($eol, array_map(OutputFormatter::escapeTrailingBackslash(...), explode($eol, $cell))); $cell = $cell instanceof TableCell ? new TableCell($escaped, ['colspan' => $cell->getColspan()]) : $escaped; - $lines = explode("\n", str_replace("\n", "\n", $cell)); + $lines = explode($eol, str_replace($eol, ''.$eol, $cell)); foreach ($lines as $lineKey => $line) { if ($colspan > 1) { $line = new TableCell($line, ['colspan' => $colspan]); @@ -678,14 +775,15 @@ class Table $unmergedRows = []; foreach ($rows[$line] as $column => $cell) { if (null !== $cell && !$cell instanceof TableCell && !\is_scalar($cell) && !$cell instanceof \Stringable) { - throw new InvalidArgumentException(sprintf('A cell must be a TableCell, a scalar or an object implementing "__toString()", "%s" given.', get_debug_type($cell))); + throw new InvalidArgumentException(\sprintf('A cell must be a TableCell, a scalar or an object implementing "__toString()", "%s" given.', get_debug_type($cell))); } if ($cell instanceof TableCell && $cell->getRowspan() > 1) { $nbLines = $cell->getRowspan() - 1; $lines = [$cell]; if (str_contains($cell, "\n")) { - $lines = explode("\n", str_replace("\n", "\n", $cell)); - $nbLines = \count($lines) > $nbLines ? substr_count($cell, "\n") : $nbLines; + $eol = str_contains($cell, "\r\n") ? "\r\n" : "\n"; + $lines = explode($eol, str_replace($eol, ''.$eol.'', $cell)); + $nbLines = \count($lines) > $nbLines ? substr_count($cell, $eol) : $nbLines; $rows[$line][$column] = new TableCell($lines[0], ['colspan' => $cell->getColspan(), 'style' => $cell->getStyle()]); unset($lines[0]); @@ -727,7 +825,7 @@ class Table /** * fill cells for a row that contains colspan > 1. */ - private function fillCells(iterable $row) + private function fillCells(iterable $row): iterable { $newRow = []; @@ -789,7 +887,7 @@ class Table /** * Calculates columns widths. */ - private function calculateColumnsWidth(iterable $groups) + private function calculateColumnsWidth(iterable $groups): void { for ($column = 0; $column < $this->numberOfColumns; ++$column) { $lengths = []; @@ -804,7 +902,7 @@ class Table $textContent = Helper::removeDecoration($this->output->getFormatter(), $cell); $textLength = Helper::width($textContent); if ($textLength > 0) { - $contentColumns = str_split($textContent, ceil($textLength / $cell->getColspan())); + $contentColumns = mb_str_split($textContent, ceil($textLength / $cell->getColspan())); foreach ($contentColumns as $position => $content) { $row[$i + $position] = $content; } @@ -822,7 +920,7 @@ class Table private function getColumnSeparatorWidth(): int { - return Helper::width(sprintf($this->style->getBorderFormat(), $this->style->getBorderChars()[3])); + return Helper::width(\sprintf($this->style->getBorderFormat(), $this->style->getBorderChars()[3])); } private function getCellWidth(array $row, int $column): int @@ -843,7 +941,7 @@ class Table /** * Called after rendering to cleanup cache data. */ - private function cleanup() + private function cleanup(): void { $this->effectiveColumnWidths = []; unset($this->numberOfColumns); @@ -905,6 +1003,6 @@ class Table return $name; } - return self::$styles[$name] ?? throw new InvalidArgumentException(sprintf('Style "%s" is not defined.', $name)); + return self::$styles[$name] ?? throw new InvalidArgumentException(\sprintf('Style "%s" is not defined.', $name)); } } diff --git a/vendor/symfony/console/Helper/TableCell.php b/vendor/symfony/console/Helper/TableCell.php index 394b2bc9..ead32f28 100644 --- a/vendor/symfony/console/Helper/TableCell.php +++ b/vendor/symfony/console/Helper/TableCell.php @@ -31,7 +31,7 @@ class TableCell // check option names if ($diff = array_diff(array_keys($options), array_keys($this->options))) { - throw new InvalidArgumentException(sprintf('The TableCell does not support the following options: \'%s\'.', implode('\', \'', $diff))); + throw new InvalidArgumentException(\sprintf('The TableCell does not support the following options: \'%s\'.', implode('\', \'', $diff))); } if (isset($options['style']) && !$options['style'] instanceof TableCellStyle) { diff --git a/vendor/symfony/console/Helper/TableCellStyle.php b/vendor/symfony/console/Helper/TableCellStyle.php index 65ae9e72..1b1ef276 100644 --- a/vendor/symfony/console/Helper/TableCellStyle.php +++ b/vendor/symfony/console/Helper/TableCellStyle.php @@ -43,11 +43,11 @@ class TableCellStyle public function __construct(array $options = []) { if ($diff = array_diff(array_keys($options), array_keys($this->options))) { - throw new InvalidArgumentException(sprintf('The TableCellStyle does not support the following options: \'%s\'.', implode('\', \'', $diff))); + throw new InvalidArgumentException(\sprintf('The TableCellStyle does not support the following options: \'%s\'.', implode('\', \'', $diff))); } if (isset($options['align']) && !\array_key_exists($options['align'], self::ALIGN_MAP)) { - throw new InvalidArgumentException(sprintf('Wrong align value. Value must be following: \'%s\'.', implode('\', \'', array_keys(self::ALIGN_MAP)))); + throw new InvalidArgumentException(\sprintf('Wrong align value. Value must be following: \'%s\'.', implode('\', \'', array_keys(self::ALIGN_MAP)))); } $this->options = array_merge($this->options, $options); @@ -67,9 +67,7 @@ class TableCellStyle { return array_filter( $this->getOptions(), - function ($key) { - return \in_array($key, self::TAG_OPTIONS) && isset($this->options[$key]); - }, + fn ($key) => \in_array($key, self::TAG_OPTIONS) && isset($this->options[$key]), \ARRAY_FILTER_USE_KEY ); } diff --git a/vendor/symfony/console/Helper/TableStyle.php b/vendor/symfony/console/Helper/TableStyle.php index bbad98e7..b0c94deb 100644 --- a/vendor/symfony/console/Helper/TableStyle.php +++ b/vendor/symfony/console/Helper/TableStyle.php @@ -77,30 +77,6 @@ class TableStyle * * * ╔═══════════════╤══════════════════════════╤══════════════════╗ - * 1 ISBN 2 Title │ Author ║ - * ╠═══════════════╪══════════════════════════╪══════════════════╣ - * ║ 99921-58-10-7 │ Divine Comedy │ Dante Alighieri ║ - * ║ 9971-5-0210-0 │ A Tale of Two Cities │ Charles Dickens ║ - * ║ 960-425-059-0 │ The Lord of the Rings │ J. R. R. Tolkien ║ - * ║ 80-902734-1-6 │ And Then There Were None │ Agatha Christie ║ - * ╚═══════════════╧══════════════════════════╧══════════════════╝ - * - * - * @return $this - */ - public function setHorizontalBorderChars(string $outside, string $inside = null): static - { - $this->horizontalOutsideBorderChar = $outside; - $this->horizontalInsideBorderChar = $inside ?? $outside; - - return $this; - } - - /** - * Sets vertical border characters. - * - * - * ╔═══════════════╤══════════════════════════╤══════════════════╗ * ║ ISBN │ Title │ Author ║ * ╠═══════1═══════╪══════════════════════════╪══════════════════╣ * ║ 99921-58-10-7 │ Divine Comedy │ Dante Alighieri ║ @@ -113,7 +89,31 @@ class TableStyle * * @return $this */ - public function setVerticalBorderChars(string $outside, string $inside = null): static + public function setHorizontalBorderChars(string $outside, ?string $inside = null): static + { + $this->horizontalOutsideBorderChar = $outside; + $this->horizontalInsideBorderChar = $inside ?? $outside; + + return $this; + } + + /** + * Sets vertical border characters. + * + * + * ╔═══════════════╤══════════════════════════╤══════════════════╗ + * 1 ISBN 2 Title │ Author ║ + * ╠═══════════════╪══════════════════════════╪══════════════════╣ + * ║ 99921-58-10-7 │ Divine Comedy │ Dante Alighieri ║ + * ║ 9971-5-0210-0 │ A Tale of Two Cities │ Charles Dickens ║ + * ║ 960-425-059-0 │ The Lord of the Rings │ J. R. R. Tolkien ║ + * ║ 80-902734-1-6 │ And Then There Were None │ Agatha Christie ║ + * ╚═══════════════╧══════════════════════════╧══════════════════╝ + * + * + * @return $this + */ + public function setVerticalBorderChars(string $outside, ?string $inside = null): static { $this->verticalOutsideBorderChar = $outside; $this->verticalInsideBorderChar = $inside ?? $outside; @@ -167,7 +167,7 @@ class TableStyle * * @return $this */ - public function setCrossingChars(string $cross, string $topLeft, string $topMid, string $topRight, string $midRight, string $bottomRight, string $bottomMid, string $bottomLeft, string $midLeft, string $topLeftBottom = null, string $topMidBottom = null, string $topRightBottom = null): static + public function setCrossingChars(string $cross, string $topLeft, string $topMid, string $topRight, string $midRight, string $bottomRight, string $bottomMid, string $bottomLeft, string $midLeft, ?string $topLeftBottom = null, ?string $topMidBottom = null, ?string $topRightBottom = null): static { $this->crossingChar = $cross; $this->crossingTopLeftChar = $topLeft; diff --git a/vendor/symfony/console/Input/ArgvInput.php b/vendor/symfony/console/Input/ArgvInput.php index c0c28bb5..83b3f0cf 100644 --- a/vendor/symfony/console/Input/ArgvInput.php +++ b/vendor/symfony/console/Input/ArgvInput.php @@ -43,7 +43,7 @@ class ArgvInput extends Input private array $tokens; private array $parsed; - public function __construct(array $argv = null, InputDefinition $definition = null) + public function __construct(?array $argv = null, ?InputDefinition $definition = null) { $argv ??= $_SERVER['argv'] ?? []; @@ -55,11 +55,17 @@ class ArgvInput extends Input parent::__construct($definition); } + /** + * @return void + */ protected function setTokens(array $tokens) { $this->tokens = $tokens; } + /** + * @return void + */ protected function parse() { $parseOptions = true; @@ -89,7 +95,7 @@ class ArgvInput extends Input /** * Parses a short option. */ - private function parseShortOption(string $token) + private function parseShortOption(string $token): void { $name = substr($token, 1); @@ -110,13 +116,13 @@ class ArgvInput extends Input * * @throws RuntimeException When option given doesn't exist */ - private function parseShortOptionSet(string $name) + private function parseShortOptionSet(string $name): void { $len = \strlen($name); for ($i = 0; $i < $len; ++$i) { if (!$this->definition->hasShortcut($name[$i])) { $encoding = mb_detect_encoding($name, null, true); - throw new RuntimeException(sprintf('The "-%s" option does not exist.', false === $encoding ? $name[$i] : mb_substr($name, $i, 1, $encoding))); + throw new RuntimeException(\sprintf('The "-%s" option does not exist.', false === $encoding ? $name[$i] : mb_substr($name, $i, 1, $encoding))); } $option = $this->definition->getOptionForShortcut($name[$i]); @@ -124,16 +130,15 @@ class ArgvInput extends Input $this->addLongOption($option->getName(), $i === $len - 1 ? null : substr($name, $i + 1)); break; - } else { - $this->addLongOption($option->getName(), null); } + $this->addLongOption($option->getName(), null); } } /** * Parses a long option. */ - private function parseLongOption(string $token) + private function parseLongOption(string $token): void { $name = substr($token, 2); @@ -152,7 +157,7 @@ class ArgvInput extends Input * * @throws RuntimeException When too many arguments are given */ - private function parseArgument(string $token) + private function parseArgument(string $token): void { $c = \count($this->arguments); @@ -170,21 +175,21 @@ class ArgvInput extends Input } else { $all = $this->definition->getArguments(); $symfonyCommandName = null; - if (($inputArgument = $all[$key = array_key_first($all)] ?? null) && 'command' === $inputArgument->getName()) { + if (($inputArgument = $all[$key = array_key_first($all) ?? ''] ?? null) && 'command' === $inputArgument->getName()) { $symfonyCommandName = $this->arguments['command'] ?? null; unset($all[$key]); } if (\count($all)) { if ($symfonyCommandName) { - $message = sprintf('Too many arguments to "%s" command, expected arguments "%s".', $symfonyCommandName, implode('" "', array_keys($all))); + $message = \sprintf('Too many arguments to "%s" command, expected arguments "%s".', $symfonyCommandName, implode('" "', array_keys($all))); } else { - $message = sprintf('Too many arguments, expected arguments "%s".', implode('" "', array_keys($all))); + $message = \sprintf('Too many arguments, expected arguments "%s".', implode('" "', array_keys($all))); } } elseif ($symfonyCommandName) { - $message = sprintf('No arguments expected for "%s" command, got "%s".', $symfonyCommandName, $token); + $message = \sprintf('No arguments expected for "%s" command, got "%s".', $symfonyCommandName, $token); } else { - $message = sprintf('No arguments expected, got "%s".', $token); + $message = \sprintf('No arguments expected, got "%s".', $token); } throw new RuntimeException($message); @@ -196,10 +201,10 @@ class ArgvInput extends Input * * @throws RuntimeException When option given doesn't exist */ - private function addShortOption(string $shortcut, mixed $value) + private function addShortOption(string $shortcut, mixed $value): void { if (!$this->definition->hasShortcut($shortcut)) { - throw new RuntimeException(sprintf('The "-%s" option does not exist.', $shortcut)); + throw new RuntimeException(\sprintf('The "-%s" option does not exist.', $shortcut)); } $this->addLongOption($this->definition->getOptionForShortcut($shortcut)->getName(), $value); @@ -210,16 +215,16 @@ class ArgvInput extends Input * * @throws RuntimeException When option given doesn't exist */ - private function addLongOption(string $name, mixed $value) + private function addLongOption(string $name, mixed $value): void { if (!$this->definition->hasOption($name)) { if (!$this->definition->hasNegation($name)) { - throw new RuntimeException(sprintf('The "--%s" option does not exist.', $name)); + throw new RuntimeException(\sprintf('The "--%s" option does not exist.', $name)); } $optionName = $this->definition->negationToName($name); if (null !== $value) { - throw new RuntimeException(sprintf('The "--%s" option does not accept a value.', $name)); + throw new RuntimeException(\sprintf('The "--%s" option does not accept a value.', $name)); } $this->options[$optionName] = false; @@ -229,7 +234,7 @@ class ArgvInput extends Input $option = $this->definition->getOption($name); if (null !== $value && !$option->acceptValue()) { - throw new RuntimeException(sprintf('The "--%s" option does not accept a value.', $name)); + throw new RuntimeException(\sprintf('The "--%s" option does not accept a value.', $name)); } if (\in_array($value, ['', null], true) && $option->acceptValue() && \count($this->parsed)) { @@ -245,7 +250,7 @@ class ArgvInput extends Input if (null === $value) { if ($option->isValueRequired()) { - throw new RuntimeException(sprintf('The "--%s" option requires a value.', $name)); + throw new RuntimeException(\sprintf('The "--%s" option requires a value.', $name)); } if (!$option->isArray() && !$option->isValueOptional()) { diff --git a/vendor/symfony/console/Input/ArrayInput.php b/vendor/symfony/console/Input/ArrayInput.php index 02fb4e8e..b9f75339 100644 --- a/vendor/symfony/console/Input/ArrayInput.php +++ b/vendor/symfony/console/Input/ArrayInput.php @@ -27,7 +27,7 @@ class ArrayInput extends Input { private array $parameters; - public function __construct(array $parameters, InputDefinition $definition = null) + public function __construct(array $parameters, ?InputDefinition $definition = null) { $this->parameters = $parameters; @@ -113,6 +113,9 @@ class ArrayInput extends Input return implode(' ', $params); } + /** + * @return void + */ protected function parse() { foreach ($this->parameters as $key => $value) { @@ -134,10 +137,10 @@ class ArrayInput extends Input * * @throws InvalidOptionException When option given doesn't exist */ - private function addShortOption(string $shortcut, mixed $value) + private function addShortOption(string $shortcut, mixed $value): void { if (!$this->definition->hasShortcut($shortcut)) { - throw new InvalidOptionException(sprintf('The "-%s" option does not exist.', $shortcut)); + throw new InvalidOptionException(\sprintf('The "-%s" option does not exist.', $shortcut)); } $this->addLongOption($this->definition->getOptionForShortcut($shortcut)->getName(), $value); @@ -149,11 +152,11 @@ class ArrayInput extends Input * @throws InvalidOptionException When option given doesn't exist * @throws InvalidOptionException When a required value is missing */ - private function addLongOption(string $name, mixed $value) + private function addLongOption(string $name, mixed $value): void { if (!$this->definition->hasOption($name)) { if (!$this->definition->hasNegation($name)) { - throw new InvalidOptionException(sprintf('The "--%s" option does not exist.', $name)); + throw new InvalidOptionException(\sprintf('The "--%s" option does not exist.', $name)); } $optionName = $this->definition->negationToName($name); @@ -166,7 +169,7 @@ class ArrayInput extends Input if (null === $value) { if ($option->isValueRequired()) { - throw new InvalidOptionException(sprintf('The "--%s" option requires a value.', $name)); + throw new InvalidOptionException(\sprintf('The "--%s" option requires a value.', $name)); } if (!$option->isValueOptional()) { @@ -182,10 +185,10 @@ class ArrayInput extends Input * * @throws InvalidArgumentException When argument given doesn't exist */ - private function addArgument(string|int $name, mixed $value) + private function addArgument(string|int $name, mixed $value): void { if (!$this->definition->hasArgument($name)) { - throw new InvalidArgumentException(sprintf('The "%s" argument does not exist.', $name)); + throw new InvalidArgumentException(\sprintf('The "%s" argument does not exist.', $name)); } $this->arguments[$name] = $value; diff --git a/vendor/symfony/console/Input/Input.php b/vendor/symfony/console/Input/Input.php index 7b90713c..3f4f3242 100644 --- a/vendor/symfony/console/Input/Input.php +++ b/vendor/symfony/console/Input/Input.php @@ -28,12 +28,13 @@ use Symfony\Component\Console\Exception\RuntimeException; abstract class Input implements InputInterface, StreamableInputInterface { protected $definition; + /** @var resource */ protected $stream; protected $options = []; protected $arguments = []; protected $interactive = true; - public function __construct(InputDefinition $definition = null) + public function __construct(?InputDefinition $definition = null) { if (null === $definition) { $this->definition = new InputDefinition(); @@ -43,6 +44,9 @@ abstract class Input implements InputInterface, StreamableInputInterface } } + /** + * @return void + */ public function bind(InputDefinition $definition) { $this->arguments = []; @@ -54,20 +58,23 @@ abstract class Input implements InputInterface, StreamableInputInterface /** * Processes command line arguments. + * + * @return void */ abstract protected function parse(); + /** + * @return void + */ public function validate() { $definition = $this->definition; $givenArguments = $this->arguments; - $missingArguments = array_filter(array_keys($definition->getArguments()), function ($argument) use ($definition, $givenArguments) { - return !\array_key_exists($argument, $givenArguments) && $definition->getArgument($argument)->isRequired(); - }); + $missingArguments = array_filter(array_keys($definition->getArguments()), static fn ($argument) => !\array_key_exists($argument, $givenArguments) && $definition->getArgument($argument)->isRequired()); if (\count($missingArguments) > 0) { - throw new RuntimeException(sprintf('Not enough arguments (missing: "%s").', implode(', ', $missingArguments))); + throw new RuntimeException(\sprintf('Not enough arguments (missing: "%s").', implode(', ', $missingArguments))); } } @@ -76,6 +83,9 @@ abstract class Input implements InputInterface, StreamableInputInterface return $this->interactive; } + /** + * @return void + */ public function setInteractive(bool $interactive) { $this->interactive = $interactive; @@ -89,16 +99,19 @@ abstract class Input implements InputInterface, StreamableInputInterface public function getArgument(string $name): mixed { if (!$this->definition->hasArgument($name)) { - throw new InvalidArgumentException(sprintf('The "%s" argument does not exist.', $name)); + throw new InvalidArgumentException(\sprintf('The "%s" argument does not exist.', $name)); } return $this->arguments[$name] ?? $this->definition->getArgument($name)->getDefault(); } + /** + * @return void + */ public function setArgument(string $name, mixed $value) { if (!$this->definition->hasArgument($name)) { - throw new InvalidArgumentException(sprintf('The "%s" argument does not exist.', $name)); + throw new InvalidArgumentException(\sprintf('The "%s" argument does not exist.', $name)); } $this->arguments[$name] = $value; @@ -125,12 +138,15 @@ abstract class Input implements InputInterface, StreamableInputInterface } if (!$this->definition->hasOption($name)) { - throw new InvalidArgumentException(sprintf('The "%s" option does not exist.', $name)); + throw new InvalidArgumentException(\sprintf('The "%s" option does not exist.', $name)); } return \array_key_exists($name, $this->options) ? $this->options[$name] : $this->definition->getOption($name)->getDefault(); } + /** + * @return void + */ public function setOption(string $name, mixed $value) { if ($this->definition->hasNegation($name)) { @@ -138,7 +154,7 @@ abstract class Input implements InputInterface, StreamableInputInterface return; } elseif (!$this->definition->hasOption($name)) { - throw new InvalidArgumentException(sprintf('The "%s" option does not exist.', $name)); + throw new InvalidArgumentException(\sprintf('The "%s" option does not exist.', $name)); } $this->options[$name] = $value; @@ -157,11 +173,19 @@ abstract class Input implements InputInterface, StreamableInputInterface return preg_match('{^[\w-]+$}', $token) ? $token : escapeshellarg($token); } + /** + * @param resource $stream + * + * @return void + */ public function setStream($stream) { $this->stream = $stream; } + /** + * @return resource + */ public function getStream() { return $this->stream; diff --git a/vendor/symfony/console/Input/InputArgument.php b/vendor/symfony/console/Input/InputArgument.php index a130c412..fd203919 100644 --- a/vendor/symfony/console/Input/InputArgument.php +++ b/vendor/symfony/console/Input/InputArgument.php @@ -31,25 +31,25 @@ class InputArgument private string $name; private int $mode; - private string|int|bool|array|null|float $default; + private string|int|bool|array|float|null $default; private array|\Closure $suggestedValues; private string $description; /** * @param string $name The argument name - * @param int|null $mode The argument mode: self::REQUIRED or self::OPTIONAL + * @param int|null $mode The argument mode: a bit mask of self::REQUIRED, self::OPTIONAL and self::IS_ARRAY * @param string $description A description text * @param string|bool|int|float|array|null $default The default value (for self::OPTIONAL mode only) * @param array|\Closure(CompletionInput,CompletionSuggestions):list $suggestedValues The values used for input completion * * @throws InvalidArgumentException When argument mode is not valid */ - public function __construct(string $name, int $mode = null, string $description = '', string|bool|int|float|array $default = null, \Closure|array $suggestedValues = []) + public function __construct(string $name, ?int $mode = null, string $description = '', string|bool|int|float|array|null $default = null, \Closure|array $suggestedValues = []) { if (null === $mode) { $mode = self::OPTIONAL; } elseif ($mode > 7 || $mode < 1) { - throw new InvalidArgumentException(sprintf('Argument mode "%s" is not valid.', $mode)); + throw new InvalidArgumentException(\sprintf('Argument mode "%s" is not valid.', $mode)); } $this->name = $name; @@ -91,9 +91,11 @@ class InputArgument /** * Sets the default value. * + * @return void + * * @throws LogicException When incorrect default value is given */ - public function setDefault(string|bool|int|float|array $default = null) + public function setDefault(string|bool|int|float|array|null $default = null) { if (1 > \func_num_args()) { trigger_deprecation('symfony/console', '6.2', 'Calling "%s()" without any arguments is deprecated, pass null explicitly instead.', __METHOD__); @@ -135,7 +137,7 @@ class InputArgument { $values = $this->suggestedValues; if ($values instanceof \Closure && !\is_array($values = $values($input))) { - throw new LogicException(sprintf('Closure for argument "%s" must return an array. Got "%s".', $this->name, get_debug_type($values))); + throw new LogicException(\sprintf('Closure for argument "%s" must return an array. Got "%s".', $this->name, get_debug_type($values))); } if ($values) { $suggestions->suggestValues($values); diff --git a/vendor/symfony/console/Input/InputAwareInterface.php b/vendor/symfony/console/Input/InputAwareInterface.php index 5a288de5..0ad27b45 100644 --- a/vendor/symfony/console/Input/InputAwareInterface.php +++ b/vendor/symfony/console/Input/InputAwareInterface.php @@ -21,6 +21,8 @@ interface InputAwareInterface { /** * Sets the Console Input. + * + * @return void */ public function setInput(InputInterface $input); } diff --git a/vendor/symfony/console/Input/InputDefinition.php b/vendor/symfony/console/Input/InputDefinition.php index f4b14a1c..b5c20283 100644 --- a/vendor/symfony/console/Input/InputDefinition.php +++ b/vendor/symfony/console/Input/InputDefinition.php @@ -46,6 +46,8 @@ class InputDefinition /** * Sets the definition of the input. + * + * @return void */ public function setDefinition(array $definition) { @@ -67,6 +69,8 @@ class InputDefinition * Sets the InputArgument objects. * * @param InputArgument[] $arguments An array of InputArgument objects + * + * @return void */ public function setArguments(array $arguments = []) { @@ -81,6 +85,8 @@ class InputDefinition * Adds an array of InputArgument objects. * * @param InputArgument[] $arguments An array of InputArgument objects + * + * @return void */ public function addArguments(?array $arguments = []) { @@ -92,20 +98,22 @@ class InputDefinition } /** + * @return void + * * @throws LogicException When incorrect argument is given */ public function addArgument(InputArgument $argument) { if (isset($this->arguments[$argument->getName()])) { - throw new LogicException(sprintf('An argument with name "%s" already exists.', $argument->getName())); + throw new LogicException(\sprintf('An argument with name "%s" already exists.', $argument->getName())); } if (null !== $this->lastArrayArgument) { - throw new LogicException(sprintf('Cannot add a required argument "%s" after an array argument "%s".', $argument->getName(), $this->lastArrayArgument->getName())); + throw new LogicException(\sprintf('Cannot add a required argument "%s" after an array argument "%s".', $argument->getName(), $this->lastArrayArgument->getName())); } if ($argument->isRequired() && null !== $this->lastOptionalArgument) { - throw new LogicException(sprintf('Cannot add a required argument "%s" after an optional one "%s".', $argument->getName(), $this->lastOptionalArgument->getName())); + throw new LogicException(\sprintf('Cannot add a required argument "%s" after an optional one "%s".', $argument->getName(), $this->lastOptionalArgument->getName())); } if ($argument->isArray()) { @@ -129,7 +137,7 @@ class InputDefinition public function getArgument(string|int $name): InputArgument { if (!$this->hasArgument($name)) { - throw new InvalidArgumentException(sprintf('The "%s" argument does not exist.', $name)); + throw new InvalidArgumentException(\sprintf('The "%s" argument does not exist.', $name)); } $arguments = \is_int($name) ? array_values($this->arguments) : $this->arguments; @@ -190,6 +198,8 @@ class InputDefinition * Sets the InputOption objects. * * @param InputOption[] $options An array of InputOption objects + * + * @return void */ public function setOptions(array $options = []) { @@ -203,6 +213,8 @@ class InputDefinition * Adds an array of InputOption objects. * * @param InputOption[] $options An array of InputOption objects + * + * @return void */ public function addOptions(array $options = []) { @@ -212,21 +224,23 @@ class InputDefinition } /** + * @return void + * * @throws LogicException When option given already exist */ public function addOption(InputOption $option) { if (isset($this->options[$option->getName()]) && !$option->equals($this->options[$option->getName()])) { - throw new LogicException(sprintf('An option named "%s" already exists.', $option->getName())); + throw new LogicException(\sprintf('An option named "%s" already exists.', $option->getName())); } if (isset($this->negations[$option->getName()])) { - throw new LogicException(sprintf('An option named "%s" already exists.', $option->getName())); + throw new LogicException(\sprintf('An option named "%s" already exists.', $option->getName())); } if ($option->getShortcut()) { foreach (explode('|', $option->getShortcut()) as $shortcut) { if (isset($this->shortcuts[$shortcut]) && !$option->equals($this->options[$this->shortcuts[$shortcut]])) { - throw new LogicException(sprintf('An option with shortcut "%s" already exists.', $shortcut)); + throw new LogicException(\sprintf('An option with shortcut "%s" already exists.', $shortcut)); } } } @@ -241,7 +255,7 @@ class InputDefinition if ($option->isNegatable()) { $negatedName = 'no-'.$option->getName(); if (isset($this->options[$negatedName])) { - throw new LogicException(sprintf('An option named "%s" already exists.', $negatedName)); + throw new LogicException(\sprintf('An option named "%s" already exists.', $negatedName)); } $this->negations[$negatedName] = $option->getName(); } @@ -255,7 +269,7 @@ class InputDefinition public function getOption(string $name): InputOption { if (!$this->hasOption($name)) { - throw new InvalidArgumentException(sprintf('The "--%s" option does not exist.', $name)); + throw new InvalidArgumentException(\sprintf('The "--%s" option does not exist.', $name)); } return $this->options[$name]; @@ -329,7 +343,7 @@ class InputDefinition public function shortcutToName(string $shortcut): string { if (!isset($this->shortcuts[$shortcut])) { - throw new InvalidArgumentException(sprintf('The "-%s" option does not exist.', $shortcut)); + throw new InvalidArgumentException(\sprintf('The "-%s" option does not exist.', $shortcut)); } return $this->shortcuts[$shortcut]; @@ -345,7 +359,7 @@ class InputDefinition public function negationToName(string $negation): string { if (!isset($this->negations[$negation])) { - throw new InvalidArgumentException(sprintf('The "--%s" option does not exist.', $negation)); + throw new InvalidArgumentException(\sprintf('The "--%s" option does not exist.', $negation)); } return $this->negations[$negation]; @@ -364,7 +378,7 @@ class InputDefinition foreach ($this->getOptions() as $option) { $value = ''; if ($option->acceptValue()) { - $value = sprintf( + $value = \sprintf( ' %s%s%s', $option->isValueOptional() ? '[' : '', strtoupper($option->getName()), @@ -372,9 +386,9 @@ class InputDefinition ); } - $shortcut = $option->getShortcut() ? sprintf('-%s|', $option->getShortcut()) : ''; - $negation = $option->isNegatable() ? sprintf('|--no-%s', $option->getName()) : ''; - $elements[] = sprintf('[%s--%s%s%s]', $shortcut, $option->getName(), $value, $negation); + $shortcut = $option->getShortcut() ? \sprintf('-%s|', $option->getShortcut()) : ''; + $negation = $option->isNegatable() ? \sprintf('|--no-%s', $option->getName()) : ''; + $elements[] = \sprintf('[%s--%s%s%s]', $shortcut, $option->getName(), $value, $negation); } } diff --git a/vendor/symfony/console/Input/InputInterface.php b/vendor/symfony/console/Input/InputInterface.php index 3af991a7..aaed5fd0 100644 --- a/vendor/symfony/console/Input/InputInterface.php +++ b/vendor/symfony/console/Input/InputInterface.php @@ -61,6 +61,8 @@ interface InputInterface /** * Binds the current Input instance with the given arguments and options. * + * @return void + * * @throws RuntimeException */ public function bind(InputDefinition $definition); @@ -68,6 +70,8 @@ interface InputInterface /** * Validates the input. * + * @return void + * * @throws RuntimeException When not enough arguments are given */ public function validate(); @@ -91,6 +95,8 @@ interface InputInterface /** * Sets an argument value by name. * + * @return void + * * @throws InvalidArgumentException When argument given doesn't exist */ public function setArgument(string $name, mixed $value); @@ -119,6 +125,8 @@ interface InputInterface /** * Sets an option value by name. * + * @return void + * * @throws InvalidArgumentException When option given doesn't exist */ public function setOption(string $name, mixed $value); @@ -135,6 +143,8 @@ interface InputInterface /** * Sets the input interactivity. + * + * @return void */ public function setInteractive(bool $interactive); } diff --git a/vendor/symfony/console/Input/InputOption.php b/vendor/symfony/console/Input/InputOption.php index 9a7032a0..3adc8c42 100644 --- a/vendor/symfony/console/Input/InputOption.php +++ b/vendor/symfony/console/Input/InputOption.php @@ -53,7 +53,7 @@ class InputOption private string $name; private string|array|null $shortcut; private int $mode; - private string|int|bool|array|null|float $default; + private string|int|bool|array|float|null $default; private array|\Closure $suggestedValues; private string $description; @@ -65,7 +65,7 @@ class InputOption * * @throws InvalidArgumentException If option mode is invalid or incompatible */ - public function __construct(string $name, string|array $shortcut = null, int $mode = null, string $description = '', string|bool|int|float|array $default = null, array|\Closure $suggestedValues = []) + public function __construct(string $name, string|array|null $shortcut = null, ?int $mode = null, string $description = '', string|bool|int|float|array|null $default = null, array|\Closure $suggestedValues = []) { if (str_starts_with($name, '--')) { $name = substr($name, 2); @@ -75,7 +75,7 @@ class InputOption throw new InvalidArgumentException('An option name cannot be empty.'); } - if (empty($shortcut)) { + if ('' === $shortcut || [] === $shortcut || false === $shortcut) { $shortcut = null; } @@ -84,10 +84,10 @@ class InputOption $shortcut = implode('|', $shortcut); } $shortcuts = preg_split('{(\|)-?}', ltrim($shortcut, '-')); - $shortcuts = array_filter($shortcuts); + $shortcuts = array_filter($shortcuts, 'strlen'); $shortcut = implode('|', $shortcuts); - if (empty($shortcut)) { + if ('' === $shortcut) { throw new InvalidArgumentException('An option shortcut cannot be empty.'); } } @@ -95,7 +95,7 @@ class InputOption if (null === $mode) { $mode = self::VALUE_NONE; } elseif ($mode >= (self::VALUE_NEGATABLE << 1) || $mode < 1) { - throw new InvalidArgumentException(sprintf('Option mode "%s" is not valid.', $mode)); + throw new InvalidArgumentException(\sprintf('Option mode "%s" is not valid.', $mode)); } $this->name = $name; @@ -178,7 +178,10 @@ class InputOption return self::VALUE_NEGATABLE === (self::VALUE_NEGATABLE & $this->mode); } - public function setDefault(string|bool|int|float|array $default = null) + /** + * @return void + */ + public function setDefault(string|bool|int|float|array|null $default = null) { if (1 > \func_num_args()) { trigger_deprecation('symfony/console', '6.2', 'Calling "%s()" without any arguments is deprecated, pass null explicitly instead.', __METHOD__); @@ -228,7 +231,7 @@ class InputOption { $values = $this->suggestedValues; if ($values instanceof \Closure && !\is_array($values = $values($input))) { - throw new LogicException(sprintf('Closure for option "%s" must return an array. Got "%s".', $this->name, get_debug_type($values))); + throw new LogicException(\sprintf('Closure for option "%s" must return an array. Got "%s".', $this->name, get_debug_type($values))); } if ($values) { $suggestions->suggestValues($values); diff --git a/vendor/symfony/console/Input/StreamableInputInterface.php b/vendor/symfony/console/Input/StreamableInputInterface.php index d7e462f2..4b95fcb1 100644 --- a/vendor/symfony/console/Input/StreamableInputInterface.php +++ b/vendor/symfony/console/Input/StreamableInputInterface.php @@ -25,6 +25,8 @@ interface StreamableInputInterface extends InputInterface * This is mainly useful for testing purpose. * * @param resource $stream The input stream + * + * @return void */ public function setStream($stream); diff --git a/vendor/symfony/console/Input/StringInput.php b/vendor/symfony/console/Input/StringInput.php index 82bd2144..9b94784a 100644 --- a/vendor/symfony/console/Input/StringInput.php +++ b/vendor/symfony/console/Input/StringInput.php @@ -72,7 +72,7 @@ class StringInput extends ArgvInput $token .= $match[1]; } else { // should never happen - throw new InvalidArgumentException(sprintf('Unable to parse input near "... %s ...".', substr($input, $cursor, 10))); + throw new InvalidArgumentException(\sprintf('Unable to parse input near "... %s ...".', substr($input, $cursor, 10))); } $cursor += \strlen($match[0]); diff --git a/vendor/symfony/console/Logger/ConsoleLogger.php b/vendor/symfony/console/Logger/ConsoleLogger.php index fddef50c..70432b7d 100644 --- a/vendor/symfony/console/Logger/ConsoleLogger.php +++ b/vendor/symfony/console/Logger/ConsoleLogger.php @@ -62,7 +62,7 @@ class ConsoleLogger extends AbstractLogger public function log($level, $message, array $context = []): void { if (!isset($this->verbosityLevelMap[$level])) { - throw new InvalidArgumentException(sprintf('The log level "%s" does not exist.', $level)); + throw new InvalidArgumentException(\sprintf('The log level "%s" does not exist.', $level)); } $output = $this->output; @@ -78,7 +78,7 @@ class ConsoleLogger extends AbstractLogger // the if condition check isn't necessary -- it's the same one that $output will do internally anyway. // We only do it for efficiency here as the message formatting is relatively expensive. if ($output->getVerbosity() >= $this->verbosityLevelMap[$level]) { - $output->writeln(sprintf('<%1$s>[%2$s] %3$s', $this->formatLevelMap[$level], $level, $this->interpolate($message, $context)), $this->verbosityLevelMap[$level]); + $output->writeln(\sprintf('<%1$s>[%2$s] %3$s', $this->formatLevelMap[$level], $level, $this->interpolate($message, $context)), $this->verbosityLevelMap[$level]); } } diff --git a/vendor/symfony/console/Output/AnsiColorMode.php b/vendor/symfony/console/Output/AnsiColorMode.php index c6cc5c12..65037d83 100644 --- a/vendor/symfony/console/Output/AnsiColorMode.php +++ b/vendor/symfony/console/Output/AnsiColorMode.php @@ -26,7 +26,7 @@ enum AnsiColorMode case Ansi4; /* - * 8-bit Ansi colors (240 differents colors + 16 duplicate color codes, ensuring backward compatibility). + * 8-bit Ansi colors (240 different colors + 16 duplicate color codes, ensuring backward compatibility). * Output syntax is: "ESC[38;5;${foreGroundColorcode};48;5;${backGroundColorcode}m" * Should be compatible with most terminals. */ @@ -51,7 +51,7 @@ enum AnsiColorMode } if (6 !== \strlen($hexColor)) { - throw new InvalidArgumentException(sprintf('Invalid "#%s" color.', $hexColor)); + throw new InvalidArgumentException(\sprintf('Invalid "#%s" color.', $hexColor)); } $color = hexdec($hexColor); @@ -63,7 +63,7 @@ enum AnsiColorMode return match ($this) { self::Ansi4 => (string) $this->convertFromRGB($r, $g, $b), self::Ansi8 => '8;5;'.((string) $this->convertFromRGB($r, $g, $b)), - self::Ansi24 => sprintf('8;2;%d;%d;%d', $r, $g, $b) + self::Ansi24 => \sprintf('8;2;%d;%d;%d', $r, $g, $b), }; } @@ -72,31 +72,13 @@ enum AnsiColorMode return match ($this) { self::Ansi4 => $this->degradeHexColorToAnsi4($r, $g, $b), self::Ansi8 => $this->degradeHexColorToAnsi8($r, $g, $b), - default => throw new InvalidArgumentException("RGB cannot be converted to {$this->name}.") + default => throw new InvalidArgumentException("RGB cannot be converted to {$this->name}."), }; } private function degradeHexColorToAnsi4(int $r, int $g, int $b): int { - if (0 === round($this->getSaturation($r, $g, $b) / 50)) { - return 0; - } - - return (int) ((round($b / 255) << 2) | (round($g / 255) << 1) | round($r / 255)); - } - - private function getSaturation(int $r, int $g, int $b): int - { - $r = $r / 255; - $g = $g / 255; - $b = $b / 255; - $v = max($r, $g, $b); - - if (0 === $diff = $v - min($r, $g, $b)) { - return 0; - } - - return (int) ((int) $diff * 100 / $v); + return round($b / 255) << 2 | (round($g / 255) << 1) | round($r / 255); } /** @@ -114,11 +96,11 @@ enum AnsiColorMode } return (int) round(($r - 8) / 247 * 24) + 232; - } else { - return 16 + - (36 * (int) round($r / 255 * 5)) + - (6 * (int) round($g / 255 * 5)) + - (int) round($b / 255 * 5); } + + return 16 + + (36 * (int) round($r / 255 * 5)) + + (6 * (int) round($g / 255 * 5)) + + (int) round($b / 255 * 5); } } diff --git a/vendor/symfony/console/Output/BufferedOutput.php b/vendor/symfony/console/Output/BufferedOutput.php index 94d4e414..ef5099bf 100644 --- a/vendor/symfony/console/Output/BufferedOutput.php +++ b/vendor/symfony/console/Output/BufferedOutput.php @@ -29,6 +29,9 @@ class BufferedOutput extends Output return $content; } + /** + * @return void + */ protected function doWrite(string $message, bool $newline) { $this->buffer .= $message; diff --git a/vendor/symfony/console/Output/ConsoleOutput.php b/vendor/symfony/console/Output/ConsoleOutput.php index e3aa92c7..0276b33d 100644 --- a/vendor/symfony/console/Output/ConsoleOutput.php +++ b/vendor/symfony/console/Output/ConsoleOutput.php @@ -37,23 +37,13 @@ class ConsoleOutput extends StreamOutput implements ConsoleOutputInterface * @param bool|null $decorated Whether to decorate messages (null for auto-guessing) * @param OutputFormatterInterface|null $formatter Output formatter instance (null to use default OutputFormatter) */ - public function __construct(int $verbosity = self::VERBOSITY_NORMAL, bool $decorated = null, OutputFormatterInterface $formatter = null) + public function __construct(int $verbosity = self::VERBOSITY_NORMAL, ?bool $decorated = null, ?OutputFormatterInterface $formatter = null) { parent::__construct($this->openOutputStream(), $verbosity, $decorated, $formatter); - if (null === $formatter) { - // for BC reasons, stdErr has it own Formatter only when user don't inject a specific formatter. - $this->stderr = new StreamOutput($this->openErrorStream(), $verbosity, $decorated); - - return; - } - - $actualDecorated = $this->isDecorated(); - $this->stderr = new StreamOutput($this->openErrorStream(), $verbosity, $decorated, $this->getFormatter()); - - if (null === $decorated) { - $this->setDecorated($actualDecorated && $this->stderr->isDecorated()); - } + // stderr gets its own formatter: decoration is held by the formatter, so a shared one + // would force both streams to the same state instead of detecting each independently + $this->stderr = new StreamOutput($this->openErrorStream(), $verbosity, $decorated, $formatter ? clone $formatter : null); } /** @@ -64,18 +54,27 @@ class ConsoleOutput extends StreamOutput implements ConsoleOutputInterface return new ConsoleSectionOutput($this->getStream(), $this->consoleSectionOutputs, $this->getVerbosity(), $this->isDecorated(), $this->getFormatter()); } + /** + * @return void + */ public function setDecorated(bool $decorated) { parent::setDecorated($decorated); $this->stderr->setDecorated($decorated); } + /** + * @return void + */ public function setFormatter(OutputFormatterInterface $formatter) { parent::setFormatter($formatter); $this->stderr->setFormatter($formatter); } + /** + * @return void + */ public function setVerbosity(int $level) { parent::setVerbosity($level); @@ -87,6 +86,9 @@ class ConsoleOutput extends StreamOutput implements ConsoleOutputInterface return $this->stderr; } + /** + * @return void + */ public function setErrorOutput(OutputInterface $error) { $this->stderr = $error; @@ -130,12 +132,27 @@ class ConsoleOutput extends StreamOutput implements ConsoleOutputInterface */ private function openOutputStream() { + static $stdout; + + if ($stdout) { + return $stdout; + } + if (!$this->hasStdoutSupport()) { - return fopen('php://output', 'w'); + return $stdout = fopen('php://output', 'w'); } // Use STDOUT when possible to prevent from opening too many file descriptors - return \defined('STDOUT') ? \STDOUT : (@fopen('php://stdout', 'w') ?: fopen('php://output', 'w')); + if (!\defined('STDOUT')) { + return $stdout = @fopen('php://stdout', 'w') ?: fopen('php://output', 'w'); + } + + // On Windows, STDOUT is opened in text mode; reopen in binary mode to prevent \n to \r\n conversion + if ('\\' === \DIRECTORY_SEPARATOR) { + return $stdout = @fopen('php://stdout', 'w') ?: \STDOUT; + } + + return $stdout = \STDOUT; } /** @@ -143,11 +160,26 @@ class ConsoleOutput extends StreamOutput implements ConsoleOutputInterface */ private function openErrorStream() { + static $stderr; + + if ($stderr) { + return $stderr; + } + if (!$this->hasStderrSupport()) { - return fopen('php://output', 'w'); + return $stderr = fopen('php://output', 'w'); } // Use STDERR when possible to prevent from opening too many file descriptors - return \defined('STDERR') ? \STDERR : (@fopen('php://stderr', 'w') ?: fopen('php://output', 'w')); + if (!\defined('STDERR')) { + return $stderr = @fopen('php://stderr', 'w') ?: fopen('php://output', 'w'); + } + + // On Windows, STDERR is opened in text mode; reopen in binary mode to prevent \n → \r\n conversion + if ('\\' === \DIRECTORY_SEPARATOR) { + return $stderr = @fopen('php://stderr', 'w') ?: \STDERR; + } + + return $stderr ??= \STDERR; } } diff --git a/vendor/symfony/console/Output/ConsoleOutputInterface.php b/vendor/symfony/console/Output/ConsoleOutputInterface.php index 6b4babc6..9c0049c8 100644 --- a/vendor/symfony/console/Output/ConsoleOutputInterface.php +++ b/vendor/symfony/console/Output/ConsoleOutputInterface.php @@ -24,6 +24,9 @@ interface ConsoleOutputInterface extends OutputInterface */ public function getErrorOutput(): OutputInterface; + /** + * @return void + */ public function setErrorOutput(OutputInterface $error); public function section(): ConsoleSectionOutput; diff --git a/vendor/symfony/console/Output/ConsoleSectionOutput.php b/vendor/symfony/console/Output/ConsoleSectionOutput.php index c813c811..a81c6818 100644 --- a/vendor/symfony/console/Output/ConsoleSectionOutput.php +++ b/vendor/symfony/console/Output/ConsoleSectionOutput.php @@ -48,9 +48,9 @@ class ConsoleSectionOutput extends StreamOutput public function setMaxHeight(int $maxHeight): void { // when changing max height, clear output of current section and redraw again with the new height - $existingContent = $this->popStreamContentUntilCurrentSection($this->maxHeight ? min($this->maxHeight, $this->lines) : $this->lines); - + $previousMaxHeight = $this->maxHeight; $this->maxHeight = $maxHeight; + $existingContent = $this->popStreamContentUntilCurrentSection($previousMaxHeight ? min($previousMaxHeight, $this->lines) : $this->lines); parent::doWrite($this->getVisibleContent(), false); parent::doWrite($existingContent, false); @@ -60,8 +60,10 @@ class ConsoleSectionOutput extends StreamOutput * Clears previous output for this section. * * @param int $lines Number of lines to clear. If null, then the entire output of this section is cleared + * + * @return void */ - public function clear(int $lines = null) + public function clear(?int $lines = null) { if (empty($this->content) || !$this->isDecorated()) { return; @@ -81,11 +83,36 @@ class ConsoleSectionOutput extends StreamOutput /** * Overwrites the previous output with a new message. + * + * @return void */ public function overwrite(string|iterable $message) { - $this->clear(); - $this->writeln($message); + if (!$this->content || !$this->isDecorated()) { + $this->writeln($message); + + return; + } + + // Replace own content and write everything in a single cursor-up + erase + // pass, to avoid the flicker (and the line-eating artifacts on some + // terminals) caused by calling clear() then writeln() back-to-back. + $linesCleared = $this->lines; + $this->content = []; + $this->lines = 0; + + if (!is_iterable($message)) { + $message = [$message]; + } + + foreach ($message as $line) { + $this->addContent($this->getFormatter()->format($line) ?? '', true); + } + + $erasedContent = $this->popStreamContentUntilCurrentSection($this->maxHeight ? min($this->maxHeight, $linesCleared) : $linesCleared); + + parent::doWrite($this->getVisibleContent(), false); + parent::doWrite($erasedContent, false); } public function getContent(): string @@ -115,8 +142,7 @@ class ConsoleSectionOutput extends StreamOutput // re-add the line break (that has been removed in the above `explode()` for // - every line that is not the last line // - if $newline is required, also add it to the last line - // - if it's not new line, but input ending with `\PHP_EOL` - if ($i < $count || $newline || str_ends_with($input, \PHP_EOL)) { + if ($i < $count || $newline) { $lineContent .= \PHP_EOL; } @@ -153,14 +179,23 @@ class ConsoleSectionOutput extends StreamOutput /** * @internal */ - public function addNewLineOfInputSubmit() + public function addNewLineOfInputSubmit(): void { $this->content[] = \PHP_EOL; ++$this->lines; } + /** + * @return void + */ protected function doWrite(string $message, bool $newline) { + // Simulate newline behavior for consistent output formatting, avoiding extra logic + if (!$newline && str_ends_with($message, \PHP_EOL)) { + $message = substr($message, 0, -\strlen(\PHP_EOL)); + $newline = true; + } + if (!$this->isDecorated()) { parent::doWrite($message, $newline); @@ -206,7 +241,7 @@ class ConsoleSectionOutput extends StreamOutput break; } - $numberOfLinesToClear += $section->lines; + $numberOfLinesToClear += $section->maxHeight ? min($section->lines, $section->maxHeight) : $section->lines; if ('' !== $sectionContent = $section->getVisibleContent()) { if (!str_ends_with($sectionContent, \PHP_EOL)) { $sectionContent .= \PHP_EOL; @@ -217,7 +252,7 @@ class ConsoleSectionOutput extends StreamOutput if ($numberOfLinesToClear > 0) { // move cursor up n lines - parent::doWrite(sprintf("\x1b[%dA", $numberOfLinesToClear), false); + parent::doWrite(\sprintf("\x1b[%dA", $numberOfLinesToClear), false); // erase to end of screen parent::doWrite("\x1b[0J", false); } diff --git a/vendor/symfony/console/Output/NullOutput.php b/vendor/symfony/console/Output/NullOutput.php index 4884cbad..f3aa15b1 100644 --- a/vendor/symfony/console/Output/NullOutput.php +++ b/vendor/symfony/console/Output/NullOutput.php @@ -26,6 +26,9 @@ class NullOutput implements OutputInterface { private NullOutputFormatter $formatter; + /** + * @return void + */ public function setFormatter(OutputFormatterInterface $formatter) { // do nothing @@ -37,6 +40,9 @@ class NullOutput implements OutputInterface return $this->formatter ??= new NullOutputFormatter(); } + /** + * @return void + */ public function setDecorated(bool $decorated) { // do nothing @@ -47,6 +53,9 @@ class NullOutput implements OutputInterface return false; } + /** + * @return void + */ public function setVerbosity(int $level) { // do nothing @@ -77,11 +86,17 @@ class NullOutput implements OutputInterface return false; } + /** + * @return void + */ public function writeln(string|iterable $messages, int $options = self::OUTPUT_NORMAL) { // do nothing } + /** + * @return void + */ public function write(string|iterable $messages, bool $newline = false, int $options = self::OUTPUT_NORMAL) { // do nothing diff --git a/vendor/symfony/console/Output/Output.php b/vendor/symfony/console/Output/Output.php index 4cb71acb..00f481e0 100644 --- a/vendor/symfony/console/Output/Output.php +++ b/vendor/symfony/console/Output/Output.php @@ -37,13 +37,16 @@ abstract class Output implements OutputInterface * @param bool $decorated Whether to decorate messages * @param OutputFormatterInterface|null $formatter Output formatter instance (null to use default OutputFormatter) */ - public function __construct(?int $verbosity = self::VERBOSITY_NORMAL, bool $decorated = false, OutputFormatterInterface $formatter = null) + public function __construct(?int $verbosity = self::VERBOSITY_NORMAL, bool $decorated = false, ?OutputFormatterInterface $formatter = null) { $this->verbosity = $verbosity ?? self::VERBOSITY_NORMAL; $this->formatter = $formatter ?? new OutputFormatter(); $this->formatter->setDecorated($decorated); } + /** + * @return void + */ public function setFormatter(OutputFormatterInterface $formatter) { $this->formatter = $formatter; @@ -54,6 +57,9 @@ abstract class Output implements OutputInterface return $this->formatter; } + /** + * @return void + */ public function setDecorated(bool $decorated) { $this->formatter->setDecorated($decorated); @@ -64,6 +70,9 @@ abstract class Output implements OutputInterface return $this->formatter->isDecorated(); } + /** + * @return void + */ public function setVerbosity(int $level) { $this->verbosity = $level; @@ -94,11 +103,17 @@ abstract class Output implements OutputInterface return self::VERBOSITY_DEBUG <= $this->verbosity; } + /** + * @return void + */ public function writeln(string|iterable $messages, int $options = self::OUTPUT_NORMAL) { $this->write($messages, true, $options); } + /** + * @return void + */ public function write(string|iterable $messages, bool $newline = false, int $options = self::OUTPUT_NORMAL) { if (!is_iterable($messages)) { @@ -133,6 +148,8 @@ abstract class Output implements OutputInterface /** * Writes a message to the output. + * + * @return void */ abstract protected function doWrite(string $message, bool $newline); } diff --git a/vendor/symfony/console/Output/OutputInterface.php b/vendor/symfony/console/Output/OutputInterface.php index bc927c51..19a81790 100644 --- a/vendor/symfony/console/Output/OutputInterface.php +++ b/vendor/symfony/console/Output/OutputInterface.php @@ -36,6 +36,8 @@ interface OutputInterface * @param bool $newline Whether to add a newline * @param int $options A bitmask of options (one of the OUTPUT or VERBOSITY constants), * 0 is considered the same as self::OUTPUT_NORMAL | self::VERBOSITY_NORMAL + * + * @return void */ public function write(string|iterable $messages, bool $newline = false, int $options = 0); @@ -44,16 +46,24 @@ interface OutputInterface * * @param int $options A bitmask of options (one of the OUTPUT or VERBOSITY constants), * 0 is considered the same as self::OUTPUT_NORMAL | self::VERBOSITY_NORMAL + * + * @return void */ public function writeln(string|iterable $messages, int $options = 0); /** * Sets the verbosity of the output. + * + * @param self::VERBOSITY_* $level + * + * @return void */ public function setVerbosity(int $level); /** * Gets the current verbosity of the output. + * + * @return self::VERBOSITY_* */ public function getVerbosity(): int; @@ -79,6 +89,8 @@ interface OutputInterface /** * Sets the decorated flag. + * + * @return void */ public function setDecorated(bool $decorated); @@ -87,6 +99,9 @@ interface OutputInterface */ public function isDecorated(): bool; + /** + * @return void + */ public function setFormatter(OutputFormatterInterface $formatter); /** diff --git a/vendor/symfony/console/Output/StreamOutput.php b/vendor/symfony/console/Output/StreamOutput.php index 9ec524e4..f51d0376 100644 --- a/vendor/symfony/console/Output/StreamOutput.php +++ b/vendor/symfony/console/Output/StreamOutput.php @@ -29,6 +29,7 @@ use Symfony\Component\Console\Formatter\OutputFormatterInterface; */ class StreamOutput extends Output { + /** @var resource */ private $stream; /** @@ -39,7 +40,7 @@ class StreamOutput extends Output * * @throws InvalidArgumentException When first argument is not a real stream */ - public function __construct($stream, int $verbosity = self::VERBOSITY_NORMAL, bool $decorated = null, OutputFormatterInterface $formatter = null) + public function __construct($stream, int $verbosity = self::VERBOSITY_NORMAL, ?bool $decorated = null, ?OutputFormatterInterface $formatter = null) { if (!\is_resource($stream) || 'stream' !== get_resource_type($stream)) { throw new InvalidArgumentException('The StreamOutput class needs a stream as its first argument.'); @@ -62,6 +63,9 @@ class StreamOutput extends Output return $this->stream; } + /** + * @return void + */ protected function doWrite(string $message, bool $newline) { if ($newline) { @@ -89,22 +93,33 @@ class StreamOutput extends Output protected function hasColorSupport(): bool { // Follow https://no-color.org/ - if (isset($_SERVER['NO_COLOR']) || false !== getenv('NO_COLOR')) { + if ('' !== (($_SERVER['NO_COLOR'] ?? getenv('NO_COLOR'))[0] ?? '')) { return false; } - if ('Hyper' === getenv('TERM_PROGRAM')) { + // Detect msysgit/mingw and assume this is a tty because detection + // does not work correctly, see https://github.com/composer/composer/issues/9690 + if (!@stream_isatty($this->stream) && !\in_array(strtoupper((string) getenv('MSYSTEM')), ['MINGW32', 'MINGW64'], true)) { + return false; + } + + if ('\\' === \DIRECTORY_SEPARATOR && @sapi_windows_vt100_support($this->stream)) { return true; } - if (\DIRECTORY_SEPARATOR === '\\') { - return (\function_exists('sapi_windows_vt100_support') - && @sapi_windows_vt100_support($this->stream)) - || false !== getenv('ANSICON') - || 'ON' === getenv('ConEmuANSI') - || 'xterm' === getenv('TERM'); + if ('Hyper' === getenv('TERM_PROGRAM') + || false !== getenv('COLORTERM') + || false !== getenv('ANSICON') + || 'ON' === getenv('ConEmuANSI') + ) { + return true; } - return stream_isatty($this->stream); + if ('dumb' === $term = (string) getenv('TERM')) { + return false; + } + + // See https://github.com/chalk/supports-color/blob/d4f413efaf8da045c5ab440ed418ef02dbb28bf1/index.js#L157 + return preg_match('/^((screen|xterm|vt100|vt220|putty|rxvt|ansi|cygwin|linux).*)|(.*-256(color)?(-bce)?)$/', $term); } } diff --git a/vendor/symfony/console/Output/TrimmedBufferOutput.php b/vendor/symfony/console/Output/TrimmedBufferOutput.php index 1ca5a13e..90ee45aa 100644 --- a/vendor/symfony/console/Output/TrimmedBufferOutput.php +++ b/vendor/symfony/console/Output/TrimmedBufferOutput.php @@ -24,10 +24,10 @@ class TrimmedBufferOutput extends Output private int $maxLength; private string $buffer = ''; - public function __construct(int $maxLength, ?int $verbosity = self::VERBOSITY_NORMAL, bool $decorated = false, OutputFormatterInterface $formatter = null) + public function __construct(int $maxLength, ?int $verbosity = self::VERBOSITY_NORMAL, bool $decorated = false, ?OutputFormatterInterface $formatter = null) { if ($maxLength <= 0) { - throw new InvalidArgumentException(sprintf('"%s()" expects a strictly positive maxLength. Got %d.', __METHOD__, $maxLength)); + throw new InvalidArgumentException(\sprintf('"%s()" expects a strictly positive maxLength. Got %d.', __METHOD__, $maxLength)); } parent::__construct($verbosity, $decorated, $formatter); @@ -45,6 +45,9 @@ class TrimmedBufferOutput extends Output return $content; } + /** + * @return void + */ protected function doWrite(string $message, bool $newline) { $this->buffer .= $message; diff --git a/vendor/symfony/console/Question/ChoiceQuestion.php b/vendor/symfony/console/Question/ChoiceQuestion.php index e449ff68..bcfe4dc4 100644 --- a/vendor/symfony/console/Question/ChoiceQuestion.php +++ b/vendor/symfony/console/Question/ChoiceQuestion.php @@ -26,11 +26,11 @@ class ChoiceQuestion extends Question private string $errorMessage = 'Value "%s" is invalid'; /** - * @param string $question The question to ask to the user - * @param array $choices The list of available choices - * @param mixed $default The default answer to return + * @param string $question The question to ask to the user + * @param array $choices The list of available choices + * @param string|bool|int|float|null $default The default answer to return */ - public function __construct(string $question, array $choices, mixed $default = null) + public function __construct(string $question, array $choices, string|bool|int|float|null $default = null) { if (!$choices) { throw new \LogicException('Choice question must have at least 1 choice available.'); @@ -44,7 +44,7 @@ class ChoiceQuestion extends Question } /** - * Returns available choices. + * @return array */ public function getChoices(): array { @@ -120,7 +120,7 @@ class ChoiceQuestion extends Question if ($multiselect) { // Check for a separated comma values if (!preg_match('/^[^,]+(?:,[^,]+)*$/', (string) $selected, $matches)) { - throw new InvalidArgumentException(sprintf($errorMessage, $selected)); + throw new InvalidArgumentException(\sprintf($errorMessage, $selected)); } $selectedChoices = explode(',', (string) $selected); @@ -144,7 +144,7 @@ class ChoiceQuestion extends Question } if (\count($results) > 1) { - throw new InvalidArgumentException(sprintf('The provided answer is ambiguous. Value should be one of "%s".', implode('" or "', $results))); + throw new InvalidArgumentException(\sprintf('The provided answer is ambiguous. Value should be one of "%s".', implode('" or "', $results))); } $result = array_search($value, $choices); @@ -160,7 +160,7 @@ class ChoiceQuestion extends Question } if (false === $result) { - throw new InvalidArgumentException(sprintf($errorMessage, $value)); + throw new InvalidArgumentException(\sprintf($errorMessage, $value)); } // For associative choices, consistently return the key as string: diff --git a/vendor/symfony/console/Question/ConfirmationQuestion.php b/vendor/symfony/console/Question/ConfirmationQuestion.php index 40eab242..ea8d46e8 100644 --- a/vendor/symfony/console/Question/ConfirmationQuestion.php +++ b/vendor/symfony/console/Question/ConfirmationQuestion.php @@ -41,7 +41,7 @@ class ConfirmationQuestion extends Question $default = $this->getDefault(); $regex = $this->trueAnswerRegex; - return function ($answer) use ($default, $regex) { + return static function ($answer) use ($default, $regex) { if (\is_bool($answer)) { return $answer; } diff --git a/vendor/symfony/console/Question/Question.php b/vendor/symfony/console/Question/Question.php index b06db945..ecbde56d 100644 --- a/vendor/symfony/console/Question/Question.php +++ b/vendor/symfony/console/Question/Question.php @@ -27,7 +27,7 @@ class Question private bool $hiddenFallback = true; private ?\Closure $autocompleterCallback = null; private ?\Closure $validator = null; - private string|int|bool|null|float $default; + private string|int|bool|float|null $default; private ?\Closure $normalizer = null; private bool $trimmable = true; private bool $multiline = false; @@ -36,7 +36,7 @@ class Question * @param string $question The question to ask to the user * @param string|bool|int|float|null $default The default answer to return if the user enters nothing */ - public function __construct(string $question, string|bool|int|float $default = null) + public function __construct(string $question, string|bool|int|float|null $default = null) { $this->question = $question; $this->default = $default; @@ -146,12 +146,11 @@ class Question if (\is_array($values)) { $values = $this->isAssoc($values) ? array_merge(array_keys($values), array_values($values)) : array_values($values); - $callback = static function () use ($values) { - return $values; - }; + $callback = static fn () => $values; } elseif ($values instanceof \Traversable) { - $valueCache = null; - $callback = static function () use ($values, &$valueCache) { + $callback = static function () use ($values) { + static $valueCache; + return $valueCache ??= iterator_to_array($values, false); }; } else { @@ -176,7 +175,7 @@ class Question * * @return $this */ - public function setAutocompleterCallback(callable $callback = null): static + public function setAutocompleterCallback(?callable $callback = null): static { if (1 > \func_num_args()) { trigger_deprecation('symfony/console', '6.2', 'Calling "%s()" without any arguments is deprecated, pass null explicitly instead.', __METHOD__); @@ -195,7 +194,7 @@ class Question * * @return $this */ - public function setValidator(callable $validator = null): static + public function setValidator(?callable $validator = null): static { if (1 > \func_num_args()) { trigger_deprecation('symfony/console', '6.2', 'Calling "%s()" without any arguments is deprecated, pass null explicitly instead.', __METHOD__); @@ -267,6 +266,9 @@ class Question return $this->normalizer; } + /** + * @return bool + */ protected function isAssoc(array $array) { return (bool) \count(array_filter(array_keys($array), 'is_string')); diff --git a/vendor/symfony/console/README.md b/vendor/symfony/console/README.md index c89b4a1a..e9013182 100644 --- a/vendor/symfony/console/README.md +++ b/vendor/symfony/console/README.md @@ -4,6 +4,18 @@ Console Component The Console component eases the creation of beautiful and testable command line interfaces. +Sponsor +------- + +The Console component for Symfony 6.4 is [backed][1] by [Les-Tilleuls.coop][2]. + +Les-Tilleuls.coop is a team of 70+ Symfony experts who can help you design, develop and +fix your projects. They provide a wide range of professional services including development, +consulting, coaching, training and audits. They also are highly skilled in JS, Go and DevOps. +They are a worker cooperative! + +Help Symfony by [sponsoring][3] its development! + Resources --------- @@ -18,3 +30,7 @@ Credits `Resources/bin/hiddeninput.exe` is a third party binary provided within this component. Find sources and license at https://github.com/Seldaek/hidden-input. + +[1]: https://symfony.com/backers +[2]: https://les-tilleuls.coop +[3]: https://symfony.com/sponsor diff --git a/vendor/symfony/console/Resources/completion.bash b/vendor/symfony/console/Resources/completion.bash index ad69eab0..a32338e1 100644 --- a/vendor/symfony/console/Resources/completion.bash +++ b/vendor/symfony/console/Resources/completion.bash @@ -6,8 +6,18 @@ # https://symfony.com/doc/current/contributing/code/license.html _sf_{{ COMMAND_NAME }}() { + + # Use the default completion for shell redirect operators. + for w in '>' '>>' '&>' '<'; do + if [[ $w = "${COMP_WORDS[COMP_CWORD-1]}" ]]; then + compopt -o filenames + COMPREPLY=($(compgen -f -- "${COMP_WORDS[COMP_CWORD]}")) + return 0 + fi + done + # Use newline as only separator to allow space in completion values - IFS=$'\n' + local IFS=$'\n' local sf_cmd="${COMP_WORDS[0]}" # for an alias, get the real script behind it @@ -27,7 +37,7 @@ _sf_{{ COMMAND_NAME }}() { local completecmd=("$sf_cmd" "_complete" "--no-interaction" "-sbash" "-c$cword" "-a{{ VERSION }}") for w in ${words[@]}; do - w=$(printf -- '%b' "$w") + w="${w//\\\\/\\}" # remove quotes from typed values quote="${w:0:1}" if [ "$quote" == \' ]; then @@ -44,7 +54,7 @@ _sf_{{ COMMAND_NAME }}() { done local sfcomplete - if sfcomplete=$(${completecmd[@]} 2>&1); then + if sfcomplete=$(SHELL_VERBOSITY=0 ${completecmd[@]} 2>&1); then local quote suggestions quote=${cur:0:1} diff --git a/vendor/symfony/console/Resources/completion.fish b/vendor/symfony/console/Resources/completion.fish index 1c34292a..d2309b36 100644 --- a/vendor/symfony/console/Resources/completion.fish +++ b/vendor/symfony/console/Resources/completion.fish @@ -19,7 +19,7 @@ function _sf_{{ COMMAND_NAME }} set completecmd $completecmd "-c$c" - set sfcomplete ($completecmd) + set sfcomplete (env SHELL_VERBOSITY=0 $completecmd) for i in $sfcomplete echo $i diff --git a/vendor/symfony/console/Resources/completion.zsh b/vendor/symfony/console/Resources/completion.zsh index 97a9e88c..eabeefb5 100644 --- a/vendor/symfony/console/Resources/completion.zsh +++ b/vendor/symfony/console/Resources/completion.zsh @@ -1,3 +1,5 @@ +#compdef {{ COMMAND_NAME }} + # This file is part of the Symfony package. # # (c) Fabien Potencier @@ -57,7 +59,7 @@ _sf_{{ COMMAND_NAME }}() { fi # Use eval to handle any environment variables and such - out=$(eval ${requestComp} 2>/dev/null) + out=$(eval SHELL_VERBOSITY=0 ${requestComp} 2>/dev/null) while IFS='\n' read -r comp; do if [ -n "$comp" ]; then diff --git a/vendor/symfony/console/SignalRegistry/SignalRegistry.php b/vendor/symfony/console/SignalRegistry/SignalRegistry.php index ef2e5f04..f826dbc8 100644 --- a/vendor/symfony/console/SignalRegistry/SignalRegistry.php +++ b/vendor/symfony/console/SignalRegistry/SignalRegistry.php @@ -13,8 +13,21 @@ namespace Symfony\Component\Console\SignalRegistry; final class SignalRegistry { + /** + * @var array> + */ private array $signalHandlers = []; + /** + * @var array>> + */ + private array $stack = []; + + /** + * @var array + */ + private array $originalHandlers = []; + public function __construct() { if (\function_exists('pcntl_async_signals')) { @@ -24,17 +37,21 @@ final class SignalRegistry public function register(int $signal, callable $signalHandler): void { - if (!isset($this->signalHandlers[$signal])) { - $previousCallback = pcntl_signal_get_handler($signal); + $previous = pcntl_signal_get_handler($signal); - if (\is_callable($previousCallback)) { - $this->signalHandlers[$signal][] = $previousCallback; + if (!isset($this->originalHandlers[$signal])) { + $this->originalHandlers[$signal] = $previous; + } + + if (!isset($this->signalHandlers[$signal])) { + if (\is_callable($previous) && [$this, 'handle'] !== $previous) { + $this->signalHandlers[$signal][] = $previous; } } $this->signalHandlers[$signal][] = $signalHandler; - pcntl_signal($signal, $this->handle(...)); + pcntl_signal($signal, [$this, 'handle']); } public static function isSupported(): bool @@ -54,4 +71,57 @@ final class SignalRegistry $signalHandler($signal, $hasNext); } } + + /** + * Pushes the current active handlers onto the stack and clears the active list. + * + * This prepares the registry for a new set of handlers within a specific scope. + * + * @internal + */ + public function pushCurrentHandlers(): void + { + // Restore the original OS-level disposition while the active map is empty, + // so signals are not routed through handle() without a registered handler. + foreach ($this->signalHandlers as $signal => $handlers) { + if (isset($this->originalHandlers[$signal])) { + pcntl_signal($signal, $this->originalHandlers[$signal]); + } + } + + $this->stack[] = $this->signalHandlers; + $this->signalHandlers = []; + } + + /** + * Restores the previous handlers from the stack, making them active. + * + * This also restores the original OS-level signal handler if no + * more handlers are registered for a signal that was just popped. + * + * @internal + */ + public function popPreviousHandlers(): void + { + $popped = $this->signalHandlers; + $previous = array_pop($this->stack) ?? []; + + // Expose a transitional superset so handle() never reads a missing key + // if a signal lands while the OS-level handlers below are being swapped. + $this->signalHandlers = $previous + $popped; + + // Reinstall the registry handler for signals owned by the restored scope. + foreach ($previous as $signal => $handlers) { + pcntl_signal($signal, [$this, 'handle']); + } + + // Restore the original OS-level handler for signals no scope owns anymore. + foreach ($popped as $signal => $handlers) { + if (!isset($previous[$signal]) && isset($this->originalHandlers[$signal])) { + pcntl_signal($signal, $this->originalHandlers[$signal]); + } + } + + $this->signalHandlers = $previous; + } } diff --git a/vendor/symfony/console/SingleCommandApplication.php b/vendor/symfony/console/SingleCommandApplication.php index 4f0b5ba3..ff1c1724 100644 --- a/vendor/symfony/console/SingleCommandApplication.php +++ b/vendor/symfony/console/SingleCommandApplication.php @@ -46,7 +46,7 @@ class SingleCommandApplication extends Command return $this; } - public function run(InputInterface $input = null, OutputInterface $output = null): int + public function run(?InputInterface $input = null, ?OutputInterface $output = null): int { if ($this->running) { return parent::run($input, $output); diff --git a/vendor/symfony/console/Style/OutputStyle.php b/vendor/symfony/console/Style/OutputStyle.php index b694bb53..ddfa8dec 100644 --- a/vendor/symfony/console/Style/OutputStyle.php +++ b/vendor/symfony/console/Style/OutputStyle.php @@ -30,6 +30,9 @@ abstract class OutputStyle implements OutputInterface, StyleInterface $this->output = $output; } + /** + * @return void + */ public function newLine(int $count = 1) { $this->output->write(str_repeat(\PHP_EOL, $count)); @@ -40,16 +43,25 @@ abstract class OutputStyle implements OutputInterface, StyleInterface return new ProgressBar($this->output, $max); } + /** + * @return void + */ public function write(string|iterable $messages, bool $newline = false, int $type = self::OUTPUT_NORMAL) { $this->output->write($messages, $newline, $type); } + /** + * @return void + */ public function writeln(string|iterable $messages, int $type = self::OUTPUT_NORMAL) { $this->output->writeln($messages, $type); } + /** + * @return void + */ public function setVerbosity(int $level) { $this->output->setVerbosity($level); @@ -60,6 +72,9 @@ abstract class OutputStyle implements OutputInterface, StyleInterface return $this->output->getVerbosity(); } + /** + * @return void + */ public function setDecorated(bool $decorated) { $this->output->setDecorated($decorated); @@ -70,6 +85,9 @@ abstract class OutputStyle implements OutputInterface, StyleInterface return $this->output->isDecorated(); } + /** + * @return void + */ public function setFormatter(OutputFormatterInterface $formatter) { $this->output->setFormatter($formatter); @@ -100,6 +118,9 @@ abstract class OutputStyle implements OutputInterface, StyleInterface return $this->output->isDebug(); } + /** + * @return OutputInterface + */ protected function getErrorOutput() { if (!$this->output instanceof ConsoleOutputInterface) { diff --git a/vendor/symfony/console/Style/StyleInterface.php b/vendor/symfony/console/Style/StyleInterface.php index 0bb12339..6bced158 100644 --- a/vendor/symfony/console/Style/StyleInterface.php +++ b/vendor/symfony/console/Style/StyleInterface.php @@ -20,63 +20,83 @@ interface StyleInterface { /** * Formats a command title. + * + * @return void */ public function title(string $message); /** * Formats a section title. + * + * @return void */ public function section(string $message); /** * Formats a list. + * + * @return void */ public function listing(array $elements); /** * Formats informational text. + * + * @return void */ public function text(string|array $message); /** * Formats a success result bar. + * + * @return void */ public function success(string|array $message); /** * Formats an error result bar. + * + * @return void */ public function error(string|array $message); /** * Formats an warning result bar. + * + * @return void */ public function warning(string|array $message); /** * Formats a note admonition. + * + * @return void */ public function note(string|array $message); /** * Formats a caution admonition. + * + * @return void */ public function caution(string|array $message); /** * Formats a table. + * + * @return void */ public function table(array $headers, array $rows); /** * Asks a question. */ - public function ask(string $question, string $default = null, callable $validator = null): mixed; + public function ask(string $question, ?string $default = null, ?callable $validator = null): mixed; /** * Asks a question with the user input hidden. */ - public function askHidden(string $question, callable $validator = null): mixed; + public function askHidden(string $question, ?callable $validator = null): mixed; /** * Asks for confirmation. @@ -90,21 +110,29 @@ interface StyleInterface /** * Add newline(s). + * + * @return void */ public function newLine(int $count = 1); /** * Starts the progress output. + * + * @return void */ public function progressStart(int $max = 0); /** * Advances the progress output X steps. + * + * @return void */ public function progressAdvance(int $step = 1); /** * Finishes the progress output. + * + * @return void */ public function progressFinish(); } diff --git a/vendor/symfony/console/Style/SymfonyStyle.php b/vendor/symfony/console/Style/SymfonyStyle.php index 8fd6f849..e365de0e 100644 --- a/vendor/symfony/console/Style/SymfonyStyle.php +++ b/vendor/symfony/console/Style/SymfonyStyle.php @@ -60,8 +60,10 @@ class SymfonyStyle extends OutputStyle /** * Formats a message as a block of text. + * + * @return void */ - public function block(string|array $messages, string $type = null, string $style = null, string $prefix = ' ', bool $padding = false, bool $escape = true) + public function block(string|array $messages, ?string $type = null, ?string $style = null, string $prefix = ' ', bool $padding = false, bool $escape = true) { $messages = \is_array($messages) ? array_values($messages) : [$messages]; @@ -70,70 +72,94 @@ class SymfonyStyle extends OutputStyle $this->newLine(); } + /** + * @return void + */ public function title(string $message) { $this->autoPrependBlock(); $this->writeln([ - sprintf('%s', OutputFormatter::escapeTrailingBackslash($message)), - sprintf('%s', str_repeat('=', Helper::width(Helper::removeDecoration($this->getFormatter(), $message)))), + \sprintf('%s', OutputFormatter::escapeTrailingBackslash($message)), + \sprintf('%s', str_repeat('=', Helper::width(Helper::removeDecoration($this->getFormatter(), $message)))), ]); $this->newLine(); } + /** + * @return void + */ public function section(string $message) { $this->autoPrependBlock(); $this->writeln([ - sprintf('%s', OutputFormatter::escapeTrailingBackslash($message)), - sprintf('%s', str_repeat('-', Helper::width(Helper::removeDecoration($this->getFormatter(), $message)))), + \sprintf('%s', OutputFormatter::escapeTrailingBackslash($message)), + \sprintf('%s', str_repeat('-', Helper::width(Helper::removeDecoration($this->getFormatter(), $message)))), ]); $this->newLine(); } + /** + * @return void + */ public function listing(array $elements) { $this->autoPrependText(); - $elements = array_map(function ($element) { - return sprintf(' * %s', $element); - }, $elements); + $elements = array_map(static fn ($element) => \sprintf(' * %s', $element), $elements); $this->writeln($elements); $this->newLine(); } + /** + * @return void + */ public function text(string|array $message) { $this->autoPrependText(); $messages = \is_array($message) ? array_values($message) : [$message]; foreach ($messages as $message) { - $this->writeln(sprintf(' %s', $message)); + $this->writeln(\sprintf(' %s', $message)); } } /** * Formats a command comment. + * + * @return void */ public function comment(string|array $message) { $this->block($message, null, null, ' // ', false, false); } + /** + * @return void + */ public function success(string|array $message) { $this->block($message, 'OK', 'fg=black;bg=green', ' ', true); } + /** + * @return void + */ public function error(string|array $message) { $this->block($message, 'ERROR', 'fg=white;bg=red', ' ', true); } + /** + * @return void + */ public function warning(string|array $message) { $this->block($message, 'WARNING', 'fg=black;bg=yellow', ' ', true); } + /** + * @return void + */ public function note(string|array $message) { $this->block($message, 'NOTE', 'fg=yellow', ' ! '); @@ -141,17 +167,25 @@ class SymfonyStyle extends OutputStyle /** * Formats an info message. + * + * @return void */ public function info(string|array $message) { $this->block($message, 'INFO', 'fg=green', ' ', true); } + /** + * @return void + */ public function caution(string|array $message) { $this->block($message, 'CAUTION', 'fg=white;bg=red', ' ! ', true); } + /** + * @return void + */ public function table(array $headers, array $rows) { $this->createTable() @@ -165,6 +199,8 @@ class SymfonyStyle extends OutputStyle /** * Formats a horizontal table. + * + * @return void */ public function horizontalTable(array $headers, array $rows) { @@ -185,6 +221,8 @@ class SymfonyStyle extends OutputStyle * * 'A title' * * ['key' => 'value'] * * new TableSeparator() + * + * @return void */ public function definitionList(string|array|TableSeparator ...$list) { @@ -211,7 +249,7 @@ class SymfonyStyle extends OutputStyle $this->horizontalTable($headers, [$row]); } - public function ask(string $question, string $default = null, callable $validator = null): mixed + public function ask(string $question, ?string $default = null, ?callable $validator = null): mixed { $question = new Question($question, $default); $question->setValidator($validator); @@ -219,7 +257,7 @@ class SymfonyStyle extends OutputStyle return $this->askQuestion($question); } - public function askHidden(string $question, callable $validator = null): mixed + public function askHidden(string $question, ?callable $validator = null): mixed { $question = new Question($question); @@ -247,17 +285,26 @@ class SymfonyStyle extends OutputStyle return $this->askQuestion($questionChoice); } + /** + * @return void + */ public function progressStart(int $max = 0) { $this->progressBar = $this->createProgressBar($max); $this->progressBar->start(); } + /** + * @return void + */ public function progressAdvance(int $step = 1) { $this->getProgressBar()->advance($step); } + /** + * @return void + */ public function progressFinish() { $this->getProgressBar()->finish(); @@ -280,8 +327,16 @@ class SymfonyStyle extends OutputStyle /** * @see ProgressBar::iterate() + * + * @template TKey + * @template TValue + * + * @param iterable $iterable + * @param int|null $max Number of steps to complete the bar (0 if indeterminate), if null it will be inferred from $iterable + * + * @return iterable */ - public function progressIterate(iterable $iterable, int $max = null): iterable + public function progressIterate(iterable $iterable, ?int $max = null): iterable { yield from $this->createProgressBar()->iterate($iterable, $max); @@ -302,15 +357,23 @@ class SymfonyStyle extends OutputStyle if ($this->output instanceof ConsoleSectionOutput) { // add the new line of the `return` to submit the input to ConsoleSectionOutput, because ConsoleSectionOutput is holding all it's lines. // this is relevant when a `ConsoleSectionOutput::clear` is called. + // the section already renders the prompt as a whole line, so an extra + // newLine() here would leave a doubled blank line below the answer; only + // keep the buffer in sync so autoPrependBlock() spaces the next block. $this->output->addNewLineOfInputSubmit(); + $this->bufferedOutput->write("\n\n"); + } else { + $this->newLine(); + $this->bufferedOutput->write("\n"); } - $this->newLine(); - $this->bufferedOutput->write("\n"); } return $answer; } + /** + * @return void + */ public function writeln(string|iterable $messages, int $type = self::OUTPUT_NORMAL) { if (!is_iterable($messages)) { @@ -323,6 +386,9 @@ class SymfonyStyle extends OutputStyle } } + /** + * @return void + */ public function write(string|iterable $messages, bool $newline = false, int $type = self::OUTPUT_NORMAL) { if (!is_iterable($messages)) { @@ -335,6 +401,9 @@ class SymfonyStyle extends OutputStyle } } + /** + * @return void + */ public function newLine(int $count = 1) { parent::newLine($count); @@ -381,7 +450,7 @@ class SymfonyStyle extends OutputStyle { $fetched = $this->bufferedOutput->fetch(); // Prepend new line if last char isn't EOL: - if (!str_ends_with($fetched, "\n")) { + if ($fetched && !str_ends_with($fetched, "\n")) { $this->newLine(); } } @@ -392,14 +461,14 @@ class SymfonyStyle extends OutputStyle $this->bufferedOutput->write($message, $newLine, $type); } - private function createBlock(iterable $messages, string $type = null, string $style = null, string $prefix = ' ', bool $padding = false, bool $escape = false): array + private function createBlock(iterable $messages, ?string $type = null, ?string $style = null, string $prefix = ' ', bool $padding = false, bool $escape = false): array { $indentLength = 0; $prefixLength = Helper::width(Helper::removeDecoration($this->getFormatter(), $prefix)); $lines = []; if (null !== $type) { - $type = sprintf('[%s] ', $type); + $type = \sprintf('[%s] ', $type); $indentLength = Helper::width($type); $lineIndentation = str_repeat(' ', $indentLength); } @@ -411,12 +480,14 @@ class SymfonyStyle extends OutputStyle $message = OutputFormatter::escape($message); } + $message = str_replace("\r\n", "\n", $message); + $lines = array_merge( $lines, - explode(\PHP_EOL, $outputWrapper->wrap( + explode("\n", $outputWrapper->wrap( $message, $this->lineLength - $prefixLength - $indentLength, - \PHP_EOL + "\n" )) ); @@ -441,7 +512,7 @@ class SymfonyStyle extends OutputStyle $line .= str_repeat(' ', max($this->lineLength - Helper::width(Helper::removeDecoration($this->getFormatter(), $line)), 0)); if ($style) { - $line = sprintf('<%s>%s', $style, $line); + $line = \sprintf('<%s>%s', $style, $line); } } diff --git a/vendor/symfony/console/Terminal.php b/vendor/symfony/console/Terminal.php index 216c609f..b8708060 100644 --- a/vendor/symfony/console/Terminal.php +++ b/vendor/symfony/console/Terminal.php @@ -123,20 +123,19 @@ class Terminal return self::$stty; } - // skip check if exec function is disabled - if (!\function_exists('exec')) { + // skip check if shell_exec function is disabled + if (!\function_exists('shell_exec')) { return false; } - exec('stty 2>&1', $output, $exitcode); - - return self::$stty = 0 === $exitcode; + return self::$stty = (bool) @shell_exec('stty 2> '.('\\' === \DIRECTORY_SEPARATOR ? 'NUL' : '/dev/null')); } - private static function initDimensions() + private static function initDimensions(): void { if ('\\' === \DIRECTORY_SEPARATOR) { - if (preg_match('/^(\d+)x(\d+)(?: \((\d+)x(\d+)\))?$/', trim(getenv('ANSICON')), $matches)) { + $ansicon = getenv('ANSICON'); + if (false !== $ansicon && preg_match('/^(\d+)x(\d+)(?: \((\d+)x(\d+)\))?$/', trim($ansicon), $matches)) { // extract [w, H] from "wxh (WxH)" // or [w, h] from "wxh" self::$width = (int) $matches[1]; @@ -166,7 +165,7 @@ class Terminal /** * Initializes dimensions using the output of an stty columns line. */ - private static function initDimensionsUsingStty() + private static function initDimensionsUsingStty(): void { if ($sttyString = self::getSttyColumns()) { if (preg_match('/rows.(\d+);.columns.(\d+);/is', $sttyString, $matches)) { @@ -216,8 +215,9 @@ class Terminal 2 => ['pipe', 'w'], ]; - $process = proc_open($command, $descriptorspec, $pipes, null, null, ['suppress_errors' => true]); - if (!\is_resource($process)) { + $cp = \function_exists('sapi_windows_cp_set') ? sapi_windows_cp_get() : 0; + + if (!$process = @proc_open($command, $descriptorspec, $pipes, null, null, ['suppress_errors' => true])) { return null; } @@ -226,6 +226,10 @@ class Terminal fclose($pipes[2]); proc_close($process); + if ($cp) { + sapi_windows_cp_set($cp); + } + return $info; } } diff --git a/vendor/symfony/console/Tester/ApplicationTester.php b/vendor/symfony/console/Tester/ApplicationTester.php index 58aee54d..dfb04a18 100644 --- a/vendor/symfony/console/Tester/ApplicationTester.php +++ b/vendor/symfony/console/Tester/ApplicationTester.php @@ -49,7 +49,7 @@ class ApplicationTester */ public function run(array $input, array $options = []): int { - $prevShellVerbosity = getenv('SHELL_VERBOSITY'); + $prevShellVerbosity = [getenv('SHELL_VERBOSITY'), $_ENV['SHELL_VERBOSITY'] ?? false, $_SERVER['SHELL_VERBOSITY'] ?? false]; try { $this->input = new ArrayInput($input); @@ -63,22 +63,35 @@ class ApplicationTester $this->initOutput($options); + // Temporarily clear SHELL_VERBOSITY to prevent Application::configureIO + // from overriding the interactive and verbosity settings set above + if (\function_exists('putenv')) { + @putenv('SHELL_VERBOSITY'); + } + unset($_ENV['SHELL_VERBOSITY'], $_SERVER['SHELL_VERBOSITY']); + return $this->statusCode = $this->application->run($this->input, $this->output); } finally { // SHELL_VERBOSITY is set by Application::configureIO so we need to unset/reset it // to its previous value to avoid one test's verbosity to spread to the following tests - if (false === $prevShellVerbosity) { + if (false === $prevShellVerbosity[0]) { if (\function_exists('putenv')) { @putenv('SHELL_VERBOSITY'); } - unset($_ENV['SHELL_VERBOSITY']); - unset($_SERVER['SHELL_VERBOSITY']); } else { if (\function_exists('putenv')) { - @putenv('SHELL_VERBOSITY='.$prevShellVerbosity); + @putenv('SHELL_VERBOSITY='.$prevShellVerbosity[0]); } - $_ENV['SHELL_VERBOSITY'] = $prevShellVerbosity; - $_SERVER['SHELL_VERBOSITY'] = $prevShellVerbosity; + } + if (false === $prevShellVerbosity[1]) { + unset($_ENV['SHELL_VERBOSITY']); + } else { + $_ENV['SHELL_VERBOSITY'] = $prevShellVerbosity[1]; + } + if (false === $prevShellVerbosity[2]) { + unset($_SERVER['SHELL_VERBOSITY']); + } else { + $_SERVER['SHELL_VERBOSITY'] = $prevShellVerbosity[2]; } } } diff --git a/vendor/symfony/console/Tester/CommandCompletionTester.php b/vendor/symfony/console/Tester/CommandCompletionTester.php index ade73275..a90fe52e 100644 --- a/vendor/symfony/console/Tester/CommandCompletionTester.php +++ b/vendor/symfony/console/Tester/CommandCompletionTester.php @@ -22,7 +22,7 @@ use Symfony\Component\Console\Completion\CompletionSuggestions; */ class CommandCompletionTester { - private $command; + private Command $command; public function __construct(Command $command) { diff --git a/vendor/symfony/console/Tester/Constraint/CommandIsSuccessful.php b/vendor/symfony/console/Tester/Constraint/CommandIsSuccessful.php index 09c6194b..d677c27a 100644 --- a/vendor/symfony/console/Tester/Constraint/CommandIsSuccessful.php +++ b/vendor/symfony/console/Tester/Constraint/CommandIsSuccessful.php @@ -38,6 +38,6 @@ final class CommandIsSuccessful extends Constraint Command::INVALID => 'Command was invalid.', ]; - return $mapping[$other] ?? sprintf('Command returned exit status %d.', $other); + return $mapping[$other] ?? \sprintf('Command returned exit status %d.', $other); } } diff --git a/vendor/symfony/console/Tester/TesterTrait.php b/vendor/symfony/console/Tester/TesterTrait.php index 9670a496..238c7b7e 100644 --- a/vendor/symfony/console/Tester/TesterTrait.php +++ b/vendor/symfony/console/Tester/TesterTrait.php @@ -128,9 +128,9 @@ trait TesterTrait * * verbosity: Sets the output verbosity flag * * capture_stderr_separately: Make output of stdOut and stdErr separately available */ - private function initOutput(array $options) + private function initOutput(array $options): void { - $this->captureStreamsIndependently = \array_key_exists('capture_stderr_separately', $options) && $options['capture_stderr_separately']; + $this->captureStreamsIndependently = $options['capture_stderr_separately'] ?? false; if (!$this->captureStreamsIndependently) { $this->output = new StreamOutput(fopen('php://memory', 'w', false)); if (isset($options['decorated'])) { @@ -168,7 +168,11 @@ trait TesterTrait $stream = fopen('php://memory', 'r+', false); foreach ($inputs as $input) { - fwrite($stream, $input.\PHP_EOL); + fwrite($stream, $input); + + if (!str_ends_with($input, "\x4")) { + fwrite($stream, \PHP_EOL); + } } rewind($stream); diff --git a/vendor/symfony/console/composer.json b/vendor/symfony/console/composer.json index bafe5d16..1610f734 100644 --- a/vendor/symfony/console/composer.json +++ b/vendor/symfony/console/composer.json @@ -2,7 +2,7 @@ "name": "symfony/console", "type": "library", "description": "Eases the creation of beautiful and testable command line interfaces", - "keywords": ["console", "cli", "command line", "terminal"], + "keywords": ["console", "cli", "command-line", "terminal"], "homepage": "https://symfony.com", "license": "MIT", "authors": [ @@ -17,29 +17,27 @@ ], "require": { "php": ">=8.1", - "symfony/deprecation-contracts": "^2.1|^3", + "symfony/deprecation-contracts": "^2.5|^3", "symfony/polyfill-mbstring": "~1.0", - "symfony/service-contracts": "^1.1|^2|^3", - "symfony/string": "^5.4|^6.0" + "symfony/service-contracts": "^2.5|^3", + "symfony/string": "^5.4|^6.0|^7.0" }, "require-dev": { - "symfony/config": "^5.4|^6.0", - "symfony/event-dispatcher": "^5.4|^6.0", - "symfony/dependency-injection": "^5.4|^6.0", - "symfony/lock": "^5.4|^6.0", - "symfony/process": "^5.4|^6.0", - "symfony/var-dumper": "^5.4|^6.0", + "symfony/config": "^5.4|^6.0|^7.0", + "symfony/event-dispatcher": "^5.4|^6.0|^7.0", + "symfony/dependency-injection": "^5.4|^6.0|^7.0", + "symfony/http-foundation": "^6.4|^7.0", + "symfony/http-kernel": "^6.4|^7.0", + "symfony/lock": "^5.4|^6.0|^7.0", + "symfony/messenger": "^5.4|^6.0|^7.0", + "symfony/process": "^5.4|^6.0|^7.0", + "symfony/stopwatch": "^5.4|^6.0|^7.0", + "symfony/var-dumper": "^5.4|^6.0|^7.0", "psr/log": "^1|^2|^3" }, "provide": { "psr/log-implementation": "1.0|2.0|3.0" }, - "suggest": { - "symfony/event-dispatcher": "", - "symfony/lock": "", - "symfony/process": "", - "psr/log": "For using the console logger" - }, "conflict": { "symfony/dependency-injection": "<5.4", "symfony/dotenv": "<5.4", diff --git a/vendor/symfony/deprecation-contracts/composer.json b/vendor/symfony/deprecation-contracts/composer.json index 774200fd..9279eb1b 100644 --- a/vendor/symfony/deprecation-contracts/composer.json +++ b/vendor/symfony/deprecation-contracts/composer.json @@ -25,7 +25,7 @@ "minimum-stability": "dev", "extra": { "branch-alias": { - "dev-main": "3.3-dev" + "dev-main": "3.7-dev" }, "thanks": { "name": "symfony/contracts", diff --git a/vendor/symfony/event-dispatcher-contracts/EventDispatcherInterface.php b/vendor/symfony/event-dispatcher-contracts/EventDispatcherInterface.php index 610d6ac0..2d7840d3 100644 --- a/vendor/symfony/event-dispatcher-contracts/EventDispatcherInterface.php +++ b/vendor/symfony/event-dispatcher-contracts/EventDispatcherInterface.php @@ -29,5 +29,5 @@ interface EventDispatcherInterface extends PsrEventDispatcherInterface * * @return T The passed $event MUST be returned */ - public function dispatch(object $event, string $eventName = null): object; + public function dispatch(object $event, ?string $eventName = null): object; } diff --git a/vendor/symfony/event-dispatcher-contracts/composer.json b/vendor/symfony/event-dispatcher-contracts/composer.json index 89d7cec9..2c17159c 100644 --- a/vendor/symfony/event-dispatcher-contracts/composer.json +++ b/vendor/symfony/event-dispatcher-contracts/composer.json @@ -19,16 +19,13 @@ "php": ">=8.1", "psr/event-dispatcher": "^1" }, - "suggest": { - "symfony/event-dispatcher-implementation": "" - }, "autoload": { "psr-4": { "Symfony\\Contracts\\EventDispatcher\\": "" } }, "minimum-stability": "dev", "extra": { "branch-alias": { - "dev-main": "3.3-dev" + "dev-main": "3.7-dev" }, "thanks": { "name": "symfony/contracts", diff --git a/vendor/symfony/polyfill-ctype/Ctype.php b/vendor/symfony/polyfill-ctype/Ctype.php index ba75a2c9..e26cc022 100644 --- a/vendor/symfony/polyfill-ctype/Ctype.php +++ b/vendor/symfony/polyfill-ctype/Ctype.php @@ -211,6 +211,10 @@ final class Ctype */ private static function convert_int_to_char_for_ctype($int, $function) { + if (\PHP_VERSION_ID >= 80100 && !\is_string($int)) { + @trigger_error($function.'(): Argument of type '.get_debug_type($int).' will be interpreted as string in the future', \E_USER_DEPRECATED); + } + if (!\is_int($int)) { return $int; } @@ -219,10 +223,6 @@ final class Ctype return (string) $int; } - if (\PHP_VERSION_ID >= 80100) { - @trigger_error($function.'(): Argument of type int will be interpreted as string in the future', \E_USER_DEPRECATED); - } - if ($int < 0) { $int += 256; } diff --git a/vendor/symfony/polyfill-ctype/LICENSE b/vendor/symfony/polyfill-ctype/LICENSE index 3f853aaf..7536caea 100644 --- a/vendor/symfony/polyfill-ctype/LICENSE +++ b/vendor/symfony/polyfill-ctype/LICENSE @@ -1,4 +1,4 @@ -Copyright (c) 2018-2019 Fabien Potencier +Copyright (c) 2018-present Fabien Potencier Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal diff --git a/vendor/symfony/polyfill-ctype/composer.json b/vendor/symfony/polyfill-ctype/composer.json index 1b3efff5..131ca7ad 100644 --- a/vendor/symfony/polyfill-ctype/composer.json +++ b/vendor/symfony/polyfill-ctype/composer.json @@ -16,7 +16,7 @@ } ], "require": { - "php": ">=7.1" + "php": ">=7.2" }, "provide": { "ext-ctype": "*" @@ -30,9 +30,6 @@ }, "minimum-stability": "dev", "extra": { - "branch-alias": { - "dev-main": "1.27-dev" - }, "thanks": { "name": "symfony/polyfill", "url": "https://github.com/symfony/polyfill" diff --git a/vendor/symfony/polyfill-intl-grapheme/Grapheme.php b/vendor/symfony/polyfill-intl-grapheme/Grapheme.php index 5373f168..cad3b838 100644 --- a/vendor/symfony/polyfill-intl-grapheme/Grapheme.php +++ b/vendor/symfony/polyfill-intl-grapheme/Grapheme.php @@ -11,7 +11,7 @@ namespace Symfony\Polyfill\Intl\Grapheme; -\define('SYMFONY_GRAPHEME_CLUSTER_RX', ((float) \PCRE_VERSION < 10 ? (float) \PCRE_VERSION >= 8.32 : (float) \PCRE_VERSION >= 10.39) ? '\X' : Grapheme::GRAPHEME_CLUSTER_RX); +\define('SYMFONY_GRAPHEME_CLUSTER_RX', ((float) \PCRE_VERSION >= 10.44) ? '\X' : Grapheme::GRAPHEME_CLUSTER_RX); /** * Partial intl implementation in pure PHP. @@ -26,6 +26,9 @@ namespace Symfony\Polyfill\Intl\Grapheme; * - grapheme_strrpos - Find position (in grapheme units) of last occurrence of a string * - grapheme_strstr - Returns part of haystack string from the first occurrence of needle to the end of haystack * - grapheme_substr - Return part of a string + * - grapheme_str_split - Splits a string into an array of individual or chunks of graphemes + * - grapheme_levenshtein - Calculate the grapheme-unit Levenshtein distance between two strings + * - grapheme_strrev - Reverse a string by grapheme clusters * * @author Nicolas Grekas * @@ -33,15 +36,18 @@ namespace Symfony\Polyfill\Intl\Grapheme; */ final class Grapheme { - // (CRLF|([ZWNJ-ZWJ]|T+|L*(LV?V+|LV|LVT)T*|L+|[^Control])[Extend]*|[Control]) + // (CRLF|RI RI?|(([ZWNJ-ZWJ]|T+|L*(LV?V+|LV|LVT)T*|L+|[^Control])[Extend]*)(ZWJ([ZWNJ-ZWJ]|T+|L*(LV?V+|LV|LVT)T*|L+|[^Control])[Extend]*)*|[Control]) // This regular expression is a work around for http://bugs.exim.org/1279 - public const GRAPHEME_CLUSTER_RX = '(?:\r\n|(?:[ -~\x{200C}\x{200D}]|[ᆨ-ᇹ]+|[ᄀ-ᅟ]*(?:[가개갸걔거게겨계고과괘괴교구궈궤귀규그긔기까깨꺄꺠꺼께껴꼐꼬꽈꽤꾀꾜꾸꿔꿰뀌뀨끄끠끼나내냐냬너네녀녜노놔놰뇌뇨누눠눼뉘뉴느늬니다대댜댸더데뎌뎨도돠돼되됴두둬뒈뒤듀드듸디따때땨떄떠떼뗘뗴또똬뙈뙤뚀뚜뚸뛔뛰뜌뜨띄띠라래랴럐러레려례로롸뢔뢰료루뤄뤠뤼류르릐리마매먀먜머메며몌모뫄뫠뫼묘무뭐뭬뮈뮤므믜미바배뱌뱨버베벼볘보봐봬뵈뵤부붜붸뷔뷰브븨비빠빼뺘뺴뻐뻬뼈뼤뽀뽜뽸뾔뾰뿌뿨쀄쀠쀼쁘쁴삐사새샤섀서세셔셰소솨쇄쇠쇼수숴쉐쉬슈스싀시싸쌔쌰썌써쎄쎠쎼쏘쏴쐐쐬쑈쑤쒀쒜쒸쓔쓰씌씨아애야얘어에여예오와왜외요우워웨위유으의이자재쟈쟤저제져졔조좌좨죄죠주줘줴쥐쥬즈즤지짜째쨔쨰쩌쩨쪄쪠쪼쫘쫴쬐쬬쭈쭤쮀쮜쮸쯔쯰찌차채챠챼처체쳐쳬초촤쵀최쵸추춰췌취츄츠츼치카캐캬컈커케켜켸코콰쾌쾨쿄쿠쿼퀘퀴큐크킈키타태탸턔터테텨톄토톼퇘퇴툐투퉈퉤튀튜트틔티파패퍄퍠퍼페펴폐포퐈퐤푀표푸풔풰퓌퓨프픠피하해햐햬허헤혀혜호화홰회효후훠훼휘휴흐희히]?[ᅠ-ᆢ]+|[가-힣])[ᆨ-ᇹ]*|[ᄀ-ᅟ]+|[^\p{Cc}\p{Cf}\p{Zl}\p{Zp}])[\p{Mn}\p{Me}\x{09BE}\x{09D7}\x{0B3E}\x{0B57}\x{0BBE}\x{0BD7}\x{0CC2}\x{0CD5}\x{0CD6}\x{0D3E}\x{0D57}\x{0DCF}\x{0DDF}\x{200C}\x{200D}\x{1D165}\x{1D16E}-\x{1D172}]*|[\p{Cc}\p{Cf}\p{Zl}\p{Zp}])'; + public const GRAPHEME_CLUSTER_RX = '(?:\r\n|[\x{1F1E6}-\x{1F1FF}][\x{1F1E6}-\x{1F1FF}]?|(?:[ -~\x{200C}\x{200D}]|[ᆨ-ᇹ]+|[ᄀ-ᅟ]*(?:[가개갸걔거게겨계고과괘괴교구궈궤귀규그긔기까깨꺄꺠꺼께껴꼐꼬꽈꽤꾀꾜꾸꿔꿰뀌뀨끄끠끼나내냐냬너네녀녜노놔놰뇌뇨누눠눼뉘뉴느늬니다대댜댸더데뎌뎨도돠돼되됴두둬뒈뒤듀드듸디따때땨떄떠떼뗘뗴또똬뙈뙤뚀뚜뚸뛔뛰뜌뜨띄띠라래랴럐러레려례로롸뢔뢰료루뤄뤠뤼류르릐리마매먀먜머메며몌모뫄뫠뫼묘무뭐뭬뮈뮤므믜미바배뱌뱨버베벼볘보봐봬뵈뵤부붜붸뷔뷰브븨비빠빼뺘뺴뻐뻬뼈뼤뽀뽜뽸뾔뾰뿌뿨쀄쀠쀼쁘쁴삐사새샤섀서세셔셰소솨쇄쇠쇼수숴쉐쉬슈스싀시싸쌔쌰썌써쎄쎠쎼쏘쏴쐐쐬쑈쑤쒀쒜쒸쓔쓰씌씨아애야얘어에여예오와왜외요우워웨위유으의이자재쟈쟤저제져졔조좌좨죄죠주줘줴쥐쥬즈즤지짜째쨔쨰쩌쩨쪄쪠쪼쫘쫴쬐쬬쭈쭤쮀쮜쮸쯔쯰찌차채챠챼처체쳐쳬초촤쵀최쵸추춰췌취츄츠츼치카캐캬컈커케켜켸코콰쾌쾨쿄쿠쿼퀘퀴큐크킈키타태탸턔터테텨톄토톼퇘퇴툐투퉈퉤튀튜트틔티파패퍄퍠퍼페펴폐포퐈퐤푀표푸풔풰퓌퓨프픠피하해햐햬허헤혀혜호화홰회효후훠훼휘휴흐희히]?[ᅠ-ᆢ]+|[가-힣])[ᆨ-ᇹ]*|[ᄀ-ᅟ]+|[^\p{Cc}\p{Cf}\p{Zl}\p{Zp}])[\p{Mn}\p{Mc}\p{Me}\x{09BE}\x{09D7}\x{0B3E}\x{0B57}\x{0BBE}\x{0BD7}\x{0CC2}\x{0CD5}\x{0CD6}\x{0D3E}\x{0D57}\x{0DCF}\x{0DDF}\x{200C}\x{1D165}\x{1D16E}-\x{1D172}\x{1F3FB}-\x{1F3FF}\x{FE0E}-\x{FE0F}\x{E0020}-\x{E007F}]*(?:\x{200D}(?:[\x{1F1E6}-\x{1F1FF}]|[ -~\x{200C}\x{200D}]|[ᆨ-ᇹ]+|[ᄀ-ᅟ]*(?:[가-힣]?[ᅠ-ᆢ]+|[가-힣])[ᆨ-ᇹ]*|[ᄀ-ᅟ]+|[^\p{Cc}\p{Cf}\p{Zl}\p{Zp}])[\p{Mn}\p{Mc}\p{Me}\x{09BE}\x{09D7}\x{0B3E}\x{0B57}\x{0BBE}\x{0BD7}\x{0CC2}\x{0CD5}\x{0CD6}\x{0D3E}\x{0D57}\x{0DCF}\x{0DDF}\x{200C}\x{1D165}\x{1D16E}-\x{1D172}\x{1F3FB}-\x{1F3FF}\x{FE0E}-\x{FE0F}\x{E0020}-\x{E007F}]*)*|[\p{Cc}\p{Cf}\p{Zl}\p{Zp}])'; private const CASE_FOLD = [ ['µ', 'ſ', "\xCD\x85", 'ς', "\xCF\x90", "\xCF\x91", "\xCF\x95", "\xCF\x96", "\xCF\xB0", "\xCF\xB1", "\xCF\xB5", "\xE1\xBA\x9B", "\xE1\xBE\xBE"], ['μ', 's', 'ι', 'σ', 'β', 'θ', 'φ', 'π', 'κ', 'ρ', 'ε', "\xE1\xB9\xA1", 'ι'], ]; + // indexed by the $mode argument of grapheme_position() + private const POSITION_FUNCTIONS = ['grapheme_strpos', 'grapheme_stripos', 'grapheme_strrpos', 'grapheme_strripos']; + public static function grapheme_extract($s, $size, $type = \GRAPHEME_EXTR_COUNT, $start = 0, &$next = 0) { if (0 > $start) { @@ -50,7 +56,7 @@ final class Grapheme if (!\is_scalar($s)) { $hasError = false; - set_error_handler(function () use (&$hasError) { $hasError = true; }); + set_error_handler(static function () use (&$hasError) { $hasError = true; }); $next = substr($s, $start); restore_error_handler(); if ($hasError) { @@ -191,6 +197,77 @@ final class Grapheme return mb_strstr($s, $needle, $beforeNeedle, 'UTF-8'); } + public static function grapheme_str_split($s, $len = 1) + { + if (0 > $len || 1073741823 < $len) { + throw new \ValueError('grapheme_str_split(): Argument #2 ($length) must be greater than 0 and less than or equal to 1073741823.'); + } + + if ('' === $s) { + return []; + } + + if (!preg_match_all('/('.SYMFONY_GRAPHEME_CLUSTER_RX.')/u', $s, $matches)) { + return false; + } + + if (1 === $len) { + return $matches[0]; + } + + $chunks = array_chunk($matches[0], $len); + + foreach ($chunks as &$chunk) { + $chunk = implode('', $chunk); + } + + return $chunks; + } + + public static function grapheme_levenshtein($s1, $s2, $insertion_cost = 1, $replacement_cost = 1, $deletion_cost = 1) + { + if (!preg_match('//u', $s1) || !preg_match('//u', $s2)) { + return false; + } + + if (0 > $insertion_cost || 0 > $replacement_cost || 0 > $deletion_cost) { + throw new \ValueError('grapheme_levenshtein(): Argument #3 ($insertion_cost), #4 ($replacement_cost), and #5 ($deletion_cost) must be greater than or equal to 0'); + } + + preg_match_all('/'.SYMFONY_GRAPHEME_CLUSTER_RX.'/u', $s1, $s1); + preg_match_all('/'.SYMFONY_GRAPHEME_CLUSTER_RX.'/u', $s2, $s2); + + $s1 = $s1[0]; + $s2 = $s2[0]; + $l1 = \count($s1); + $l2 = \count($s2); + + if (0 === $l1) { + return $l2 * $insertion_cost; + } + if (0 === $l2) { + return $l1 * $deletion_cost; + } + + $dp = array_fill(0, $l1 + 1, array_fill(0, $l2 + 1, 0)); + + for ($i = 1; $i <= $l1; ++$i) { + $dp[$i][0] = $dp[$i - 1][0] + $deletion_cost; + } + for ($j = 1; $j <= $l2; ++$j) { + $dp[0][$j] = $dp[0][$j - 1] + $insertion_cost; + } + + for ($i = 1; $i <= $l1; ++$i) { + for ($j = 1; $j <= $l2; ++$j) { + $cost = ($s1[$i - 1] === $s2[$j - 1]) ? 0 : $replacement_cost; + $dp[$i][$j] = min($dp[$i - 1][$j] + $deletion_cost, $dp[$i][$j - 1] + $insertion_cost, $dp[$i - 1][$j - 1] + $cost); + } + } + + return $dp[$l1][$l2]; + } + private static function grapheme_position($s, $needle, $offset, $mode) { $needle = (string) $needle; @@ -198,14 +275,25 @@ final class Grapheme return false; } $s = (string) $s; - if (!preg_match('/./us', $s)) { + // let the empty string through: it accepts no offset but 0, which is checked below + if ('' !== $s && !preg_match('/./us', $s)) { + return false; + } + if ($offset && ($offset > ($len = self::grapheme_strlen($s)) || $offset < -$len)) { + if (80000 > \PHP_VERSION_ID) { + return false; + } + + throw new \ValueError(self::POSITION_FUNCTIONS[$mode].'(): Argument #3 ($offset) must be contained in argument #1 ($haystack)'); + } + if ('' === $s) { return false; } if ($offset > 0) { $s = self::grapheme_substr($s, $offset); } elseif ($offset < 0) { if (2 > $mode) { - $offset += self::grapheme_strlen($s); + $offset += $len; $s = self::grapheme_substr($s, $offset); if (0 > $offset) { $offset = 0; @@ -244,4 +332,19 @@ final class Grapheme return false !== $needlePos ? self::grapheme_strlen(substr($s, 0, $needlePos)) + $offset : false; } + + public static function grapheme_strrev(string $string) + { + if (!preg_match('//u', $string)) { + return false; + } + + $units = grapheme_str_split($string); + + if (false === $units) { + return false; + } + + return implode('', array_reverse($units)); + } } diff --git a/vendor/symfony/polyfill-intl-grapheme/LICENSE b/vendor/symfony/polyfill-intl-grapheme/LICENSE index 4cd8bdd3..6e3afce6 100644 --- a/vendor/symfony/polyfill-intl-grapheme/LICENSE +++ b/vendor/symfony/polyfill-intl-grapheme/LICENSE @@ -1,4 +1,4 @@ -Copyright (c) 2015-2019 Fabien Potencier +Copyright (c) 2015-present Fabien Potencier Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal diff --git a/vendor/symfony/polyfill-intl-grapheme/README.md b/vendor/symfony/polyfill-intl-grapheme/README.md index f55d92c5..5d7c6787 100644 --- a/vendor/symfony/polyfill-intl-grapheme/README.md +++ b/vendor/symfony/polyfill-intl-grapheme/README.md @@ -21,6 +21,7 @@ This component provides a partial, native PHP implementation of the - [`grapheme_strstr`](https://php.net/grapheme_strstr): Returns part of haystack string from the first occurrence of needle to the end of haystack - [`grapheme_substr`](https://php.net/grapheme_substr): Return part of a string +- [`grapheme_str_split`](https://php.net/grapheme_str_split): Splits a string into an array of individual or chunks of graphemes More information can be found in the [main Polyfill README](https://github.com/symfony/polyfill/blob/main/README.md). diff --git a/vendor/symfony/polyfill-intl-grapheme/bootstrap.php b/vendor/symfony/polyfill-intl-grapheme/bootstrap.php index a9ea03c7..4fd87741 100644 --- a/vendor/symfony/polyfill-intl-grapheme/bootstrap.php +++ b/vendor/symfony/polyfill-intl-grapheme/bootstrap.php @@ -11,14 +11,16 @@ use Symfony\Polyfill\Intl\Grapheme as p; -if (extension_loaded('intl')) { - return; -} - if (\PHP_VERSION_ID >= 80000) { return require __DIR__.'/bootstrap80.php'; } +if (!class_exists('ValueError', false)) { + class ValueError extends Error + { + } +} + if (!defined('GRAPHEME_EXTR_COUNT')) { define('GRAPHEME_EXTR_COUNT', 0); } @@ -56,3 +58,12 @@ if (!function_exists('grapheme_strstr')) { if (!function_exists('grapheme_substr')) { function grapheme_substr($string, $offset, $length = null) { return p\Grapheme::grapheme_substr($string, $offset, $length); } } +if (!function_exists('grapheme_str_split')) { + function grapheme_str_split(string $string, int $length = 1) { return p\Grapheme::grapheme_str_split($string, $length); } +} +if (!function_exists('grapheme_levenshtein')) { + function grapheme_levenshtein(string $string1, string $string2, int $insertion_cost = 1, int $replacement_cost = 1, int $deletion_cost = 1, string $locale = '') { return p\Grapheme::grapheme_levenshtein($string1, $string2, $insertion_cost, $replacement_cost, $deletion_cost); } +} +if (!function_exists('grapheme_strrev')) { + function grapheme_strrev(string $string) { return p\Grapheme::grapheme_strrev($string); } +} diff --git a/vendor/symfony/polyfill-intl-grapheme/bootstrap80.php b/vendor/symfony/polyfill-intl-grapheme/bootstrap80.php index b8c07867..b05cfde5 100644 --- a/vendor/symfony/polyfill-intl-grapheme/bootstrap80.php +++ b/vendor/symfony/polyfill-intl-grapheme/bootstrap80.php @@ -11,6 +11,20 @@ use Symfony\Polyfill\Intl\Grapheme as p; +if (!function_exists('grapheme_str_split')) { + function grapheme_str_split(string $string, int $length = 1): array|false { return p\Grapheme::grapheme_str_split($string, $length); } +} +if (!function_exists('grapheme_levenshtein')) { + function grapheme_levenshtein(string $string1, string $string2, int $insertion_cost = 1, int $replacement_cost = 1, int $deletion_cost = 1, string $locale = ''): int|false { return p\Grapheme::grapheme_levenshtein($string1, $string2, $insertion_cost, $replacement_cost, $deletion_cost); } +} +if (!function_exists('grapheme_strrev')) { + function grapheme_strrev(string $string): string|false { return p\Grapheme::grapheme_strrev($string); } +} + +if (extension_loaded('intl')) { + return; +} + if (!defined('GRAPHEME_EXTR_COUNT')) { define('GRAPHEME_EXTR_COUNT', 0); } @@ -24,6 +38,10 @@ if (!defined('GRAPHEME_EXTR_MAXCHARS')) { if (!function_exists('grapheme_extract')) { function grapheme_extract(?string $haystack, ?int $size, ?int $type = GRAPHEME_EXTR_COUNT, ?int $offset = 0, &$next = null): string|false { return p\Grapheme::grapheme_extract((string) $haystack, (int) $size, (int) $type, (int) $offset, $next); } } +if (\PHP_VERSION_ID >= 80500) { + return require __DIR__.'/bootstrap85.php'; +} + if (!function_exists('grapheme_stripos')) { function grapheme_stripos(?string $haystack, ?string $needle, ?int $offset = 0): int|false { return p\Grapheme::grapheme_stripos((string) $haystack, (string) $needle, (int) $offset); } } diff --git a/vendor/symfony/polyfill-intl-grapheme/composer.json b/vendor/symfony/polyfill-intl-grapheme/composer.json index fde5537f..0eea417d 100644 --- a/vendor/symfony/polyfill-intl-grapheme/composer.json +++ b/vendor/symfony/polyfill-intl-grapheme/composer.json @@ -16,7 +16,7 @@ } ], "require": { - "php": ">=7.1" + "php": ">=7.2" }, "autoload": { "psr-4": { "Symfony\\Polyfill\\Intl\\Grapheme\\": "" }, @@ -27,9 +27,6 @@ }, "minimum-stability": "dev", "extra": { - "branch-alias": { - "dev-main": "1.27-dev" - }, "thanks": { "name": "symfony/polyfill", "url": "https://github.com/symfony/polyfill" diff --git a/vendor/symfony/polyfill-intl-normalizer/LICENSE b/vendor/symfony/polyfill-intl-normalizer/LICENSE index 4cd8bdd3..6e3afce6 100644 --- a/vendor/symfony/polyfill-intl-normalizer/LICENSE +++ b/vendor/symfony/polyfill-intl-normalizer/LICENSE @@ -1,4 +1,4 @@ -Copyright (c) 2015-2019 Fabien Potencier +Copyright (c) 2015-present Fabien Potencier Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal diff --git a/vendor/symfony/polyfill-intl-normalizer/Normalizer.php b/vendor/symfony/polyfill-intl-normalizer/Normalizer.php index 81704ab3..e43092dd 100644 --- a/vendor/symfony/polyfill-intl-normalizer/Normalizer.php +++ b/vendor/symfony/polyfill-intl-normalizer/Normalizer.php @@ -36,6 +36,8 @@ class Normalizer private static $D; private static $KD; private static $cC; + private static $rawD; + private static $rawKD; private static $ulenMask = ["\xC0" => 2, "\xD0" => 2, "\xE0" => 3, "\xF0" => 4]; private static $ASCII = "\x20\x65\x69\x61\x73\x6E\x74\x72\x6F\x6C\x75\x64\x5D\x5B\x63\x6D\x70\x27\x0A\x67\x7C\x68\x76\x2E\x66\x62\x2C\x3A\x3D\x2D\x71\x31\x30\x43\x32\x2A\x79\x78\x29\x28\x4C\x39\x41\x53\x2F\x50\x22\x45\x6A\x4D\x49\x6B\x33\x3E\x35\x54\x3C\x44\x34\x7D\x42\x7B\x38\x46\x77\x52\x36\x37\x55\x47\x4E\x3B\x4A\x7A\x56\x23\x48\x4F\x57\x5F\x26\x21\x4B\x3F\x58\x51\x25\x59\x5C\x09\x5A\x2B\x7E\x5E\x24\x40\x60\x7F\x00\x01\x02\x03\x04\x05\x06\x07\x08\x0B\x0C\x0D\x0E\x0F\x10\x11\x12\x13\x14\x15\x16\x17\x18\x19\x1A\x1B\x1C\x1D\x1E\x1F"; @@ -54,6 +56,59 @@ class Normalizer return self::normalize($s, $form) === $s; } + public static function getRawDecomposition(string $s, int $form = self::FORM_C) + { + if ('' === $s || !preg_match('//u', $s)) { + return null; + } + + $ulen = $s[0] < "\x80" ? 1 : (self::$ulenMask[$s[0] & "\xF0"] ?? 0); + if (!$ulen || \strlen($s) !== $ulen) { + return null; + } + + if (self::NFC !== $form && self::NFD !== $form && self::NFKC !== $form && self::NFKD !== $form) { + return ''; + } + + if ($s >= "\xEA\xB0\x80" && $s <= "\xED\x9E\xA3") { + $u = unpack('C*', $s); + $j = (($u[1] - 224) << 12) + (($u[2] - 128) << 6) + $u[3] - 0xAC80; + + if ($t = $j % 28) { + $j -= $t; + $lv = 0xAC00 + $j; + $r = \chr(0xE0 | $lv >> 12).\chr(0x80 | $lv >> 6 & 0x3F).\chr(0x80 | $lv & 0x3F); + $r .= $t < 25 + ? ("\xE1\x86".\chr(0xA7 + $t)) + : ("\xE1\x87".\chr(0x67 + $t)); + + return $r; + } + + return "\xE1\x84".\chr(0x80 + (int) ($j / 588)) + ."\xE1\x85".\chr(0xA1 + (int) (($j % 588) / 28)); + } + + if (null === self::$rawD) { + self::$rawD = self::getData('rawCanonicalDecomposition'); + } + + if (isset(self::$rawD[$s])) { + return self::$rawD[$s]; + } + + if (self::NFKC === $form || self::NFKD === $form) { + if (null === self::$rawKD) { + self::$rawKD = self::getData('rawCompatibilityDecomposition'); + } + + return self::$rawKD[$s] ?? null; + } + + return null; + } + public static function normalize(string $s, int $form = self::FORM_C) { if (!preg_match('//u', $s)) { diff --git a/vendor/symfony/polyfill-intl-normalizer/bootstrap.php b/vendor/symfony/polyfill-intl-normalizer/bootstrap.php index 3608e5c0..e5af1cfd 100644 --- a/vendor/symfony/polyfill-intl-normalizer/bootstrap.php +++ b/vendor/symfony/polyfill-intl-normalizer/bootstrap.php @@ -21,3 +21,6 @@ if (!function_exists('normalizer_is_normalized')) { if (!function_exists('normalizer_normalize')) { function normalizer_normalize($string, $form = p\Normalizer::FORM_C) { return p\Normalizer::normalize($string, $form); } } +if (!function_exists('normalizer_get_raw_decomposition')) { + function normalizer_get_raw_decomposition(?string $string, ?int $form = p\Normalizer::FORM_C) { return p\Normalizer::getRawDecomposition((string) $string, (int) $form); } +} diff --git a/vendor/symfony/polyfill-intl-normalizer/bootstrap80.php b/vendor/symfony/polyfill-intl-normalizer/bootstrap80.php index e36d1a94..af04267a 100644 --- a/vendor/symfony/polyfill-intl-normalizer/bootstrap80.php +++ b/vendor/symfony/polyfill-intl-normalizer/bootstrap80.php @@ -17,3 +17,6 @@ if (!function_exists('normalizer_is_normalized')) { if (!function_exists('normalizer_normalize')) { function normalizer_normalize(?string $string, ?int $form = p\Normalizer::FORM_C): string|false { return p\Normalizer::normalize((string) $string, (int) $form); } } +if (!function_exists('normalizer_get_raw_decomposition')) { + function normalizer_get_raw_decomposition(?string $string, ?int $form = p\Normalizer::FORM_C): ?string { return p\Normalizer::getRawDecomposition((string) $string, (int) $form); } +} diff --git a/vendor/symfony/polyfill-intl-normalizer/composer.json b/vendor/symfony/polyfill-intl-normalizer/composer.json index 65f72d64..9bd04e88 100644 --- a/vendor/symfony/polyfill-intl-normalizer/composer.json +++ b/vendor/symfony/polyfill-intl-normalizer/composer.json @@ -16,7 +16,7 @@ } ], "require": { - "php": ">=7.1" + "php": ">=7.2" }, "autoload": { "psr-4": { "Symfony\\Polyfill\\Intl\\Normalizer\\": "" }, @@ -28,9 +28,6 @@ }, "minimum-stability": "dev", "extra": { - "branch-alias": { - "dev-main": "1.27-dev" - }, "thanks": { "name": "symfony/polyfill", "url": "https://github.com/symfony/polyfill" diff --git a/vendor/symfony/polyfill-mbstring/LICENSE b/vendor/symfony/polyfill-mbstring/LICENSE index 4cd8bdd3..6e3afce6 100644 --- a/vendor/symfony/polyfill-mbstring/LICENSE +++ b/vendor/symfony/polyfill-mbstring/LICENSE @@ -1,4 +1,4 @@ -Copyright (c) 2015-2019 Fabien Potencier +Copyright (c) 2015-present Fabien Potencier Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal diff --git a/vendor/symfony/polyfill-mbstring/Mbstring.php b/vendor/symfony/polyfill-mbstring/Mbstring.php index bce5c4a8..e3d1f965 100644 --- a/vendor/symfony/polyfill-mbstring/Mbstring.php +++ b/vendor/symfony/polyfill-mbstring/Mbstring.php @@ -48,6 +48,11 @@ namespace Symfony\Polyfill\Mbstring; * - mb_strstr - Finds first occurrence of a string within another * - mb_strwidth - Return width of string * - mb_substr_count - Count the number of substring occurrences + * - mb_ucfirst - Make a string's first character uppercase + * - mb_lcfirst - Make a string's first character lowercase + * - mb_trim - Strip whitespace (or other characters) from the beginning and end of a string + * - mb_ltrim - Strip whitespace (or other characters) from the beginning of a string + * - mb_rtrim - Strip whitespace (or other characters) from the end of a string * * Not implemented: * - mb_convert_kana - Convert "kana" one from another ("zen-kaku", "han-kaku" and more) @@ -69,7 +74,7 @@ final class Mbstring { public const MB_CASE_FOLD = \PHP_INT_MAX; - private const CASE_FOLD = [ + private const SIMPLE_CASE_FOLD = [ ['µ', 'ſ', "\xCD\x85", 'ς', "\xCF\x90", "\xCF\x91", "\xCF\x95", "\xCF\x96", "\xCF\xB0", "\xCF\xB1", "\xCF\xB5", "\xE1\xBA\x9B", "\xE1\xBE\xBE"], ['μ', 's', 'ι', 'σ', 'β', 'θ', 'φ', 'π', 'κ', 'ρ', 'ε', "\xE1\xB9\xA1", 'ι'], ]; @@ -77,9 +82,19 @@ final class Mbstring private static $encodingList = ['ASCII', 'UTF-8']; private static $language = 'neutral'; private static $internalEncoding = 'UTF-8'; + private static $iconvSupportsIgnore; public static function mb_convert_encoding($s, $toEncoding, $fromEncoding = null) { + if (\is_array($s)) { + $r = []; + foreach ($s as $str) { + $r[] = self::mb_convert_encoding($str, $toEncoding, $fromEncoding); + } + + return $r; + } + if (\is_array($fromEncoding) || (null !== $fromEncoding && false !== strpos($fromEncoding, ','))) { $fromEncoding = self::mb_detect_encoding($s, $fromEncoding); } else { @@ -102,24 +117,53 @@ final class Mbstring $fromEncoding = 'Windows-1252'; } if ('UTF-8' !== $fromEncoding) { - $s = iconv($fromEncoding, 'UTF-8//IGNORE', $s); + $s = self::iconv($fromEncoding, 'UTF-8', $s); } return preg_replace_callback('/[\x80-\xFF]+/', [__CLASS__, 'html_encoding_callback'], $s); } if ('HTML-ENTITIES' === $fromEncoding) { - $s = html_entity_decode($s, \ENT_COMPAT, 'UTF-8'); + $decodeControlChars = static function ($m) { + $code = '' !== ($m[2] ?? '') ? hexdec($m[2]) : (int) $m[1]; + + if ($code < 32 || 127 === $code) { + return \chr($code); + } + if (128 <= $code && $code <= 159) { + return "\xC2".\chr(0x80 | ($code & 0x3F)); + } + + return $m[0]; + }; + + if (\PHP_VERSION_ID >= 70400) { + $s = html_entity_decode($s, \ENT_QUOTES, 'UTF-8'); + // html_entity_decode() leaves numeric entities for C0/C1 control + // characters as-is (HTML spec), but mb_convert_encoding() decodes + // them. Catch what html_entity_decode() missed. + if (false !== strpos($s, '&#')) { + $s = preg_replace_callback('/&#(?:0*([0-9]++)|[xX]0*([0-9a-fA-F]++));/', $decodeControlChars, $s); + } + } else { + // PHP < 7.4: html_entity_decode() truncates strings at NUL bytes, + // so decode the control character entities first then call + // html_entity_decode() on each NUL-delimited chunk independently. + $s = preg_replace_callback('/&#(?:0*([0-9]++)|[xX]0*([0-9a-fA-F]++));/', $decodeControlChars, $s); + $s = implode("\0", array_map(static function ($chunk) { + return html_entity_decode($chunk, \ENT_QUOTES, 'UTF-8'); + }, explode("\0", $s))); + } $fromEncoding = 'UTF-8'; } - return iconv($fromEncoding, $toEncoding.'//IGNORE', $s); + return self::iconv($fromEncoding, $toEncoding, $s); } public static function mb_convert_variables($toEncoding, $fromEncoding, &...$vars) { $ok = true; - array_walk_recursive($vars, function (&$v) use (&$ok, $toEncoding, $fromEncoding) { + array_walk_recursive($vars, static function (&$v) use (&$ok, $toEncoding, $fromEncoding) { if (false === $v = self::mb_convert_encoding($v, $toEncoding, $fromEncoding)) { $ok = false; } @@ -166,10 +210,10 @@ final class Mbstring if ('UTF-8' === $encoding) { $encoding = null; if (!preg_match('//u', $s)) { - $s = @iconv('UTF-8', 'UTF-8//IGNORE', $s); + $s = @self::iconv('UTF-8', 'UTF-8', $s); } } else { - $s = iconv($encoding, 'UTF-8//IGNORE', $s); + $s = self::iconv($encoding, 'UTF-8', $s); } $cnt = floor(\count($convmap) / 4) * 4; @@ -180,7 +224,7 @@ final class Mbstring $convmap[$i + 1] += $convmap[$i + 2]; } - $s = preg_replace_callback('/&#(?:0*([0-9]+)|x0*([0-9a-fA-F]+))(?!&);?/', function (array $m) use ($cnt, $convmap) { + $s = preg_replace_callback('/&#(?:0*([0-9]+)|x0*([0-9a-fA-F]+))'.(\PHP_VERSION_ID >= 80200 ? '' : '(?!&)').';?/', static function (array $m) use ($cnt, $convmap) { $c = isset($m[2]) ? (int) hexdec($m[2]) : $m[1]; for ($i = 0; $i < $cnt; $i += 4) { if ($c >= $convmap[$i] && $c <= $convmap[$i + 1]) { @@ -195,7 +239,7 @@ final class Mbstring return $s; } - return iconv('UTF-8', $encoding.'//IGNORE', $s); + return self::iconv('UTF-8', $encoding, $s); } public static function mb_encode_numericentity($s, $convmap, $encoding = null, $is_hex = false) @@ -232,10 +276,10 @@ final class Mbstring if ('UTF-8' === $encoding) { $encoding = null; if (!preg_match('//u', $s)) { - $s = @iconv('UTF-8', 'UTF-8//IGNORE', $s); + $s = @self::iconv('UTF-8', 'UTF-8', $s); } } else { - $s = iconv($encoding, 'UTF-8//IGNORE', $s); + $s = self::iconv($encoding, 'UTF-8', $s); } static $ulenMask = ["\xC0" => 2, "\xD0" => 2, "\xE0" => 3, "\xF0" => 4]; @@ -254,7 +298,7 @@ final class Mbstring for ($j = 0; $j < $cnt; $j += 4) { if ($c >= $convmap[$j] && $c <= $convmap[$j + 1]) { $cOffset = ($c + $convmap[$j + 2]) & $convmap[$j + 3]; - $result .= $is_hex ? sprintf('&#x%X;', $cOffset) : '&#'.$cOffset.';'; + $result .= $is_hex ? \sprintf('&#x%X;', $cOffset) : '&#'.$cOffset.';'; continue 2; } } @@ -265,7 +309,7 @@ final class Mbstring return $result; } - return iconv('UTF-8', $encoding.'//IGNORE', $result); + return self::iconv('UTF-8', $encoding, $result); } public static function mb_convert_case($s, $mode, $encoding = null) @@ -280,10 +324,10 @@ final class Mbstring if ('UTF-8' === $encoding) { $encoding = null; if (!preg_match('//u', $s)) { - $s = @iconv('UTF-8', 'UTF-8//IGNORE', $s); + $s = @self::iconv('UTF-8', 'UTF-8', $s); } } else { - $s = iconv($encoding, 'UTF-8//IGNORE', $s); + $s = self::iconv($encoding, 'UTF-8', $s); } if (\MB_CASE_TITLE == $mode) { @@ -301,7 +345,11 @@ final class Mbstring $map = $upper; } else { if (self::MB_CASE_FOLD === $mode) { - $s = str_replace(self::CASE_FOLD[0], self::CASE_FOLD[1], $s); + static $caseFolding = null; + if (null === $caseFolding) { + $caseFolding = self::getData('caseFolding'); + } + $s = strtr($s, $caseFolding); } static $lower = null; @@ -343,7 +391,7 @@ final class Mbstring return $s; } - return iconv('UTF-8', $encoding.'//IGNORE', $s); + return self::iconv('UTF-8', $encoding, $s); } public static function mb_internal_encoding($encoding = null) @@ -364,7 +412,7 @@ final class Mbstring return false; } - throw new \ValueError(sprintf('Argument #1 ($encoding) must be a valid encoding, "%s" given', $encoding)); + throw new \ValueError(\sprintf('Argument #1 ($encoding) must be a valid encoding, "%s" given', $encoding)); } public static function mb_language($lang = null) @@ -385,7 +433,7 @@ final class Mbstring return false; } - throw new \ValueError(sprintf('Argument #1 ($language) must be a valid language, "%s" given', $lang)); + throw new \ValueError(\sprintf('Argument #1 ($language) must be a valid language, "%s" given', $lang)); } public static function mb_list_encodings() @@ -413,7 +461,20 @@ final class Mbstring $encoding = self::$internalEncoding; } - return self::mb_detect_encoding($var, [$encoding]) || false !== @iconv($encoding, $encoding, $var); + if (!\is_array($var)) { + return self::mb_detect_encoding($var, [$encoding]) || false !== @iconv($encoding, $encoding, $var); + } + + foreach ($var as $key => $value) { + if (!self::mb_check_encoding($key, $encoding)) { + return false; + } + if (!self::mb_check_encoding($value, $encoding)) { + return false; + } + } + + return true; } public static function mb_detect_encoding($str, $encodingList = null, $strict = false) @@ -488,7 +549,15 @@ final class Mbstring return \strlen($s); } - return @iconv_strlen($s, $encoding); + if (false !== $len = @iconv_strlen($s, $encoding)) { + return $len; + } + + if ('UTF-8' !== $encoding) { + return $len; + } + + return preg_match_all('/[\x00-\x7F]|[\xC0-\xDF][\x80-\xBF]?|[\xE0-\xEF][\x80-\xBF]{0,2}|[\xF0-\xF7][\x80-\xBF]{0,3}|[\xF8-\xFB][\x80-\xBF]{0,4}|[\xFC-\xFD][\x80-\xBF]{0,5}|[\x80-\xBF\xFE\xFF]/s', $s); } public static function mb_strpos($haystack, $needle, $offset = 0, $encoding = null) @@ -638,8 +707,10 @@ final class Mbstring public static function mb_stripos($haystack, $needle, $offset = 0, $encoding = null) { - $haystack = self::mb_convert_case($haystack, self::MB_CASE_FOLD, $encoding); - $needle = self::mb_convert_case($needle, self::MB_CASE_FOLD, $encoding); + [$haystack, $needle] = str_replace(self::SIMPLE_CASE_FOLD[0], self::SIMPLE_CASE_FOLD[1], [ + self::mb_convert_case($haystack, \MB_CASE_LOWER, $encoding), + self::mb_convert_case($needle, \MB_CASE_LOWER, $encoding), + ]); return self::mb_strpos($haystack, $needle, $offset, $encoding); } @@ -674,8 +745,11 @@ final class Mbstring public static function mb_strripos($haystack, $needle, $offset = 0, $encoding = null) { - $haystack = self::mb_convert_case($haystack, self::MB_CASE_FOLD, $encoding); - $needle = self::mb_convert_case($needle, self::MB_CASE_FOLD, $encoding); + $haystack = self::mb_convert_case($haystack, \MB_CASE_LOWER, $encoding); + $needle = self::mb_convert_case($needle, \MB_CASE_LOWER, $encoding); + + $haystack = str_replace(self::SIMPLE_CASE_FOLD[0], self::SIMPLE_CASE_FOLD[1], $haystack); + $needle = str_replace(self::SIMPLE_CASE_FOLD[0], self::SIMPLE_CASE_FOLD[1], $needle); return self::mb_strrpos($haystack, $needle, $offset, $encoding); } @@ -737,7 +811,7 @@ final class Mbstring $encoding = self::getEncoding($encoding); if ('UTF-8' !== $encoding) { - $s = iconv($encoding, 'UTF-8//IGNORE', $s); + $s = self::iconv($encoding, 'UTF-8', $s); } $s = preg_replace('/[\x{1100}-\x{115F}\x{2329}\x{232A}\x{2E80}-\x{303E}\x{3040}-\x{A4CF}\x{AC00}-\x{D7A3}\x{F900}-\x{FAFF}\x{FE10}-\x{FE19}\x{FE30}-\x{FE6F}\x{FF00}-\x{FF60}\x{FFE0}-\x{FFE6}\x{20000}-\x{2FFFD}\x{30000}-\x{3FFFD}]/u', '', $s, -1, $wide); @@ -798,6 +872,114 @@ final class Mbstring return $code; } + /** @return string|false */ + public static function mb_scrub(?string $string, ?string $encoding = null): string + { + if (null === $encoding) { + $encoding = self::mb_internal_encoding(); + } elseif (!self::assertEncoding($encoding, 'mb_scrub(): Argument #2 ($encoding) must be a valid encoding, "%s" given')) { + return false; + } + + return self::mb_convert_encoding((string) $string, $encoding, $encoding); + } + + /** @return string|false */ + public static function mb_str_pad(string $string, int $length, string $pad_string = ' ', int $pad_type = \STR_PAD_RIGHT, ?string $encoding = null) + { + if (null === $encoding) { + $encoding = self::mb_internal_encoding(); + } elseif (!self::assertEncoding($encoding, 'mb_str_pad(): Argument #5 ($encoding) must be a valid encoding, "%s" given')) { + return false; + } + + if (self::mb_strlen($pad_string, $encoding) <= 0) { + if (\PHP_VERSION_ID < 80000) { + trigger_error('mb_str_pad(): Argument #3 ($pad_string) must be a non-empty string', \E_USER_WARNING); + + return false; + } + + throw new \ValueError('mb_str_pad(): Argument #3 ($pad_string) must be a non-empty string'); + } + + if (!\in_array($pad_type, [\STR_PAD_RIGHT, \STR_PAD_LEFT, \STR_PAD_BOTH], true)) { + if (\PHP_VERSION_ID < 80000) { + trigger_error('mb_str_pad(): Argument #4 ($pad_type) must be STR_PAD_LEFT, STR_PAD_RIGHT, or STR_PAD_BOTH', \E_USER_WARNING); + + return false; + } + + throw new \ValueError('mb_str_pad(): Argument #4 ($pad_type) must be STR_PAD_LEFT, STR_PAD_RIGHT, or STR_PAD_BOTH'); + } + + $paddingRequired = $length - self::mb_strlen($string, $encoding); + + if ($paddingRequired < 1) { + return $string; + } + + switch ($pad_type) { + case \STR_PAD_LEFT: + return self::mb_substr(str_repeat($pad_string, $paddingRequired), 0, $paddingRequired, $encoding).$string; + case \STR_PAD_RIGHT: + return $string.self::mb_substr(str_repeat($pad_string, $paddingRequired), 0, $paddingRequired, $encoding); + default: + $leftPaddingLength = floor($paddingRequired / 2); + $rightPaddingLength = $paddingRequired - $leftPaddingLength; + + return self::mb_substr(str_repeat($pad_string, $leftPaddingLength), 0, $leftPaddingLength, $encoding).$string.self::mb_substr(str_repeat($pad_string, $rightPaddingLength), 0, $rightPaddingLength, $encoding); + } + } + + /** @return string|false */ + public static function mb_ucfirst(string $string, ?string $encoding = null) + { + if (null === $encoding) { + $encoding = self::mb_internal_encoding(); + } elseif (!self::assertEncoding($encoding, 'mb_ucfirst(): Argument #2 ($encoding) must be a valid encoding, "%s" given')) { + return false; + } + + $firstChar = mb_substr($string, 0, 1, $encoding); + $firstChar = mb_convert_case($firstChar, \MB_CASE_TITLE, $encoding); + + return $firstChar.mb_substr($string, 1, null, $encoding); + } + + /** @return string|false */ + public static function mb_lcfirst(string $string, ?string $encoding = null) + { + if (null === $encoding) { + $encoding = self::mb_internal_encoding(); + } elseif (!self::assertEncoding($encoding, 'mb_lcfirst(): Argument #2 ($encoding) must be a valid encoding, "%s" given')) { + return false; + } + + $firstChar = mb_substr($string, 0, 1, $encoding); + $firstChar = mb_convert_case($firstChar, \MB_CASE_LOWER, $encoding); + + return $firstChar.mb_substr($string, 1, null, $encoding); + } + + /** @return string|false */ + public static function mb_trim(string $string, ?string $characters = null, ?string $encoding = null) + { + return self::mb_internal_trim('{^[%s]+|[%1$s]+$}Du', $string, $characters, $encoding, __FUNCTION__); + } + + /** @return string|false */ + public static function mb_ltrim(string $string, ?string $characters = null, ?string $encoding = null) + { + return self::mb_internal_trim('{^[%s]+}Du', $string, $characters, $encoding, __FUNCTION__); + } + + /** @return string|false */ + public static function mb_rtrim(string $string, ?string $characters = null, ?string $encoding = null) + { + return self::mb_internal_trim('{[%s]+$}Du', $string, $characters, $encoding, __FUNCTION__); + } + private static function getSubpart($pos, $part, $haystack, $encoding) { if (false === $pos) { @@ -869,6 +1051,88 @@ final class Mbstring return 'UTF-8'; } + if ('UTF-32' === $encoding) { + return 'UTF-32BE'; + } + + if ('UTF-16' === $encoding) { + return 'UTF-16BE'; + } + return $encoding; } + + private static function iconv($fromEncoding, $toEncoding, $s) + { + if (null === self::$iconvSupportsIgnore) { + self::$iconvSupportsIgnore = false !== @iconv('UTF-8', 'UTF-8//IGNORE', ''); + } + + return self::$iconvSupportsIgnore + ? iconv($fromEncoding, $toEncoding.'//IGNORE', $s) + : iconv($fromEncoding, $toEncoding, $s); + } + + /** @return string|false */ + private static function mb_internal_trim(string $regex, string $string, ?string $characters, ?string $encoding, string $function) + { + if (null === $encoding) { + $encoding = self::mb_internal_encoding(); + } elseif (!self::assertEncoding($encoding, $function.'(): Argument #3 ($encoding) must be a valid encoding, "%s" given')) { + return false; + } + + if ('' === $characters) { + return null === $encoding ? $string : self::mb_convert_encoding($string, $encoding); + } + + if ('UTF-8' === $encoding) { + $encoding = null; + if (!preg_match('//u', $string)) { + $string = @self::iconv('UTF-8', 'UTF-8', $string); + } + if (null !== $characters && !preg_match('//u', $characters)) { + $characters = @self::iconv('UTF-8', 'UTF-8', $characters); + } + } else { + $string = self::iconv($encoding, 'UTF-8', $string); + + if (null !== $characters) { + $characters = self::iconv($encoding, 'UTF-8', $characters); + } + } + + if (null === $characters) { + $characters = "\\0 \f\n\r\t\v\u{00A0}\u{1680}\u{2000}\u{2001}\u{2002}\u{2003}\u{2004}\u{2005}\u{2006}\u{2007}\u{2008}\u{2009}\u{200A}\u{2028}\u{2029}\u{202F}\u{205F}\u{3000}\u{0085}\u{180E}"; + } else { + $characters = preg_quote($characters); + } + + $string = preg_replace(\sprintf($regex, $characters), '', $string); + + if (null === $encoding) { + return $string; + } + + return self::iconv('UTF-8', $encoding, $string); + } + + private static function assertEncoding(string $encoding, string $errorFormat): bool + { + try { + $validEncoding = @self::mb_check_encoding('', $encoding); + } catch (\ValueError $e) { + throw new \ValueError(\sprintf($errorFormat, $encoding)); + } + + if (!$validEncoding) { + if (80000 > \PHP_VERSION_ID) { + trigger_error(\sprintf($errorFormat, $encoding), \E_USER_WARNING); + } else { + throw new \ValueError(\sprintf($errorFormat, $encoding)); + } + } + + return $validEncoding; + } } diff --git a/vendor/symfony/polyfill-mbstring/bootstrap.php b/vendor/symfony/polyfill-mbstring/bootstrap.php index 1fedd1f7..0e934d7a 100644 --- a/vendor/symfony/polyfill-mbstring/bootstrap.php +++ b/vendor/symfony/polyfill-mbstring/bootstrap.php @@ -9,139 +9,8 @@ * file that was distributed with this source code. */ -use Symfony\Polyfill\Mbstring as p; - if (\PHP_VERSION_ID >= 80000) { return require __DIR__.'/bootstrap80.php'; } -if (!function_exists('mb_convert_encoding')) { - function mb_convert_encoding($string, $to_encoding, $from_encoding = null) { return p\Mbstring::mb_convert_encoding($string, $to_encoding, $from_encoding); } -} -if (!function_exists('mb_decode_mimeheader')) { - function mb_decode_mimeheader($string) { return p\Mbstring::mb_decode_mimeheader($string); } -} -if (!function_exists('mb_encode_mimeheader')) { - function mb_encode_mimeheader($string, $charset = null, $transfer_encoding = null, $newline = "\r\n", $indent = 0) { return p\Mbstring::mb_encode_mimeheader($string, $charset, $transfer_encoding, $newline, $indent); } -} -if (!function_exists('mb_decode_numericentity')) { - function mb_decode_numericentity($string, $map, $encoding = null) { return p\Mbstring::mb_decode_numericentity($string, $map, $encoding); } -} -if (!function_exists('mb_encode_numericentity')) { - function mb_encode_numericentity($string, $map, $encoding = null, $hex = false) { return p\Mbstring::mb_encode_numericentity($string, $map, $encoding, $hex); } -} -if (!function_exists('mb_convert_case')) { - function mb_convert_case($string, $mode, $encoding = null) { return p\Mbstring::mb_convert_case($string, $mode, $encoding); } -} -if (!function_exists('mb_internal_encoding')) { - function mb_internal_encoding($encoding = null) { return p\Mbstring::mb_internal_encoding($encoding); } -} -if (!function_exists('mb_language')) { - function mb_language($language = null) { return p\Mbstring::mb_language($language); } -} -if (!function_exists('mb_list_encodings')) { - function mb_list_encodings() { return p\Mbstring::mb_list_encodings(); } -} -if (!function_exists('mb_encoding_aliases')) { - function mb_encoding_aliases($encoding) { return p\Mbstring::mb_encoding_aliases($encoding); } -} -if (!function_exists('mb_check_encoding')) { - function mb_check_encoding($value = null, $encoding = null) { return p\Mbstring::mb_check_encoding($value, $encoding); } -} -if (!function_exists('mb_detect_encoding')) { - function mb_detect_encoding($string, $encodings = null, $strict = false) { return p\Mbstring::mb_detect_encoding($string, $encodings, $strict); } -} -if (!function_exists('mb_detect_order')) { - function mb_detect_order($encoding = null) { return p\Mbstring::mb_detect_order($encoding); } -} -if (!function_exists('mb_parse_str')) { - function mb_parse_str($string, &$result = []) { parse_str($string, $result); return (bool) $result; } -} -if (!function_exists('mb_strlen')) { - function mb_strlen($string, $encoding = null) { return p\Mbstring::mb_strlen($string, $encoding); } -} -if (!function_exists('mb_strpos')) { - function mb_strpos($haystack, $needle, $offset = 0, $encoding = null) { return p\Mbstring::mb_strpos($haystack, $needle, $offset, $encoding); } -} -if (!function_exists('mb_strtolower')) { - function mb_strtolower($string, $encoding = null) { return p\Mbstring::mb_strtolower($string, $encoding); } -} -if (!function_exists('mb_strtoupper')) { - function mb_strtoupper($string, $encoding = null) { return p\Mbstring::mb_strtoupper($string, $encoding); } -} -if (!function_exists('mb_substitute_character')) { - function mb_substitute_character($substitute_character = null) { return p\Mbstring::mb_substitute_character($substitute_character); } -} -if (!function_exists('mb_substr')) { - function mb_substr($string, $start, $length = 2147483647, $encoding = null) { return p\Mbstring::mb_substr($string, $start, $length, $encoding); } -} -if (!function_exists('mb_stripos')) { - function mb_stripos($haystack, $needle, $offset = 0, $encoding = null) { return p\Mbstring::mb_stripos($haystack, $needle, $offset, $encoding); } -} -if (!function_exists('mb_stristr')) { - function mb_stristr($haystack, $needle, $before_needle = false, $encoding = null) { return p\Mbstring::mb_stristr($haystack, $needle, $before_needle, $encoding); } -} -if (!function_exists('mb_strrchr')) { - function mb_strrchr($haystack, $needle, $before_needle = false, $encoding = null) { return p\Mbstring::mb_strrchr($haystack, $needle, $before_needle, $encoding); } -} -if (!function_exists('mb_strrichr')) { - function mb_strrichr($haystack, $needle, $before_needle = false, $encoding = null) { return p\Mbstring::mb_strrichr($haystack, $needle, $before_needle, $encoding); } -} -if (!function_exists('mb_strripos')) { - function mb_strripos($haystack, $needle, $offset = 0, $encoding = null) { return p\Mbstring::mb_strripos($haystack, $needle, $offset, $encoding); } -} -if (!function_exists('mb_strrpos')) { - function mb_strrpos($haystack, $needle, $offset = 0, $encoding = null) { return p\Mbstring::mb_strrpos($haystack, $needle, $offset, $encoding); } -} -if (!function_exists('mb_strstr')) { - function mb_strstr($haystack, $needle, $before_needle = false, $encoding = null) { return p\Mbstring::mb_strstr($haystack, $needle, $before_needle, $encoding); } -} -if (!function_exists('mb_get_info')) { - function mb_get_info($type = 'all') { return p\Mbstring::mb_get_info($type); } -} -if (!function_exists('mb_http_output')) { - function mb_http_output($encoding = null) { return p\Mbstring::mb_http_output($encoding); } -} -if (!function_exists('mb_strwidth')) { - function mb_strwidth($string, $encoding = null) { return p\Mbstring::mb_strwidth($string, $encoding); } -} -if (!function_exists('mb_substr_count')) { - function mb_substr_count($haystack, $needle, $encoding = null) { return p\Mbstring::mb_substr_count($haystack, $needle, $encoding); } -} -if (!function_exists('mb_output_handler')) { - function mb_output_handler($string, $status) { return p\Mbstring::mb_output_handler($string, $status); } -} -if (!function_exists('mb_http_input')) { - function mb_http_input($type = null) { return p\Mbstring::mb_http_input($type); } -} - -if (!function_exists('mb_convert_variables')) { - function mb_convert_variables($to_encoding, $from_encoding, &...$vars) { return p\Mbstring::mb_convert_variables($to_encoding, $from_encoding, ...$vars); } -} - -if (!function_exists('mb_ord')) { - function mb_ord($string, $encoding = null) { return p\Mbstring::mb_ord($string, $encoding); } -} -if (!function_exists('mb_chr')) { - function mb_chr($codepoint, $encoding = null) { return p\Mbstring::mb_chr($codepoint, $encoding); } -} -if (!function_exists('mb_scrub')) { - function mb_scrub($string, $encoding = null) { $encoding = null === $encoding ? mb_internal_encoding() : $encoding; return mb_convert_encoding($string, $encoding, $encoding); } -} -if (!function_exists('mb_str_split')) { - function mb_str_split($string, $length = 1, $encoding = null) { return p\Mbstring::mb_str_split($string, $length, $encoding); } -} - -if (extension_loaded('mbstring')) { - return; -} - -if (!defined('MB_CASE_UPPER')) { - define('MB_CASE_UPPER', 0); -} -if (!defined('MB_CASE_LOWER')) { - define('MB_CASE_LOWER', 1); -} -if (!defined('MB_CASE_TITLE')) { - define('MB_CASE_TITLE', 2); -} +return require __DIR__.'/bootstrap72.php'; diff --git a/vendor/symfony/polyfill-mbstring/bootstrap80.php b/vendor/symfony/polyfill-mbstring/bootstrap80.php index 82f5ac4d..5fde10e8 100644 --- a/vendor/symfony/polyfill-mbstring/bootstrap80.php +++ b/vendor/symfony/polyfill-mbstring/bootstrap80.php @@ -93,7 +93,7 @@ if (!function_exists('mb_strstr')) { function mb_strstr(?string $haystack, ?string $needle, ?bool $before_needle = false, ?string $encoding = null): string|false { return p\Mbstring::mb_strstr((string) $haystack, (string) $needle, (bool) $before_needle, $encoding); } } if (!function_exists('mb_get_info')) { - function mb_get_info(?string $type = 'all'): array|string|int|false { return p\Mbstring::mb_get_info((string) $type); } + function mb_get_info(?string $type = 'all'): array|string|int|false|null { return p\Mbstring::mb_get_info((string) $type); } } if (!function_exists('mb_http_output')) { function mb_http_output(?string $encoding = null): string|bool { return p\Mbstring::mb_http_output($encoding); } @@ -122,12 +122,36 @@ if (!function_exists('mb_chr')) { function mb_chr(?int $codepoint, ?string $encoding = null): string|false { return p\Mbstring::mb_chr((int) $codepoint, $encoding); } } if (!function_exists('mb_scrub')) { - function mb_scrub(?string $string, ?string $encoding = null): string { $encoding ??= mb_internal_encoding(); return mb_convert_encoding((string) $string, $encoding, $encoding); } + function mb_scrub(?string $string, ?string $encoding = null): string { return p\Mbstring::mb_scrub($string, $encoding); } } if (!function_exists('mb_str_split')) { function mb_str_split(?string $string, ?int $length = 1, ?string $encoding = null): array { return p\Mbstring::mb_str_split((string) $string, (int) $length, $encoding); } } +if (!function_exists('mb_str_pad')) { + function mb_str_pad(?string $string, ?int $length, ?string $pad_string = ' ', ?int $pad_type = STR_PAD_RIGHT, ?string $encoding = null): string { return p\Mbstring::mb_str_pad((string) $string, (int) $length, (string) $pad_string, (int) $pad_type, $encoding); } +} + +if (!function_exists('mb_ucfirst')) { + function mb_ucfirst(?string $string, ?string $encoding = null): string { return p\Mbstring::mb_ucfirst((string) $string, $encoding); } +} + +if (!function_exists('mb_lcfirst')) { + function mb_lcfirst(?string $string, ?string $encoding = null): string { return p\Mbstring::mb_lcfirst((string) $string, $encoding); } +} + +if (!function_exists('mb_trim')) { + function mb_trim(?string $string, ?string $characters = null, ?string $encoding = null): string { return p\Mbstring::mb_trim((string) $string, $characters, $encoding); } +} + +if (!function_exists('mb_ltrim')) { + function mb_ltrim(?string $string, ?string $characters = null, ?string $encoding = null): string { return p\Mbstring::mb_ltrim((string) $string, $characters, $encoding); } +} + +if (!function_exists('mb_rtrim')) { + function mb_rtrim(?string $string, ?string $characters = null, ?string $encoding = null): string { return p\Mbstring::mb_rtrim((string) $string, $characters, $encoding); } +} + if (extension_loaded('mbstring')) { return; } diff --git a/vendor/symfony/polyfill-mbstring/composer.json b/vendor/symfony/polyfill-mbstring/composer.json index 44895536..daa07f86 100644 --- a/vendor/symfony/polyfill-mbstring/composer.json +++ b/vendor/symfony/polyfill-mbstring/composer.json @@ -16,7 +16,8 @@ } ], "require": { - "php": ">=7.1" + "php": ">=7.2", + "ext-iconv": "*" }, "provide": { "ext-mbstring": "*" @@ -30,9 +31,6 @@ }, "minimum-stability": "dev", "extra": { - "branch-alias": { - "dev-main": "1.27-dev" - }, "thanks": { "name": "symfony/polyfill", "url": "https://github.com/symfony/polyfill" diff --git a/vendor/symfony/polyfill-php80/LICENSE b/vendor/symfony/polyfill-php80/LICENSE index 5593b1d8..0ed3a246 100644 --- a/vendor/symfony/polyfill-php80/LICENSE +++ b/vendor/symfony/polyfill-php80/LICENSE @@ -1,4 +1,4 @@ -Copyright (c) 2020 Fabien Potencier +Copyright (c) 2020-present Fabien Potencier Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal diff --git a/vendor/symfony/polyfill-php80/Php80.php b/vendor/symfony/polyfill-php80/Php80.php index 362dd1a9..68fac391 100644 --- a/vendor/symfony/polyfill-php80/Php80.php +++ b/vendor/symfony/polyfill-php80/Php80.php @@ -60,7 +60,7 @@ final class Php80 public static function get_resource_id($res): int { if (!\is_resource($res) && null === @get_resource_type($res)) { - throw new \TypeError(sprintf('Argument 1 passed to get_resource_id() must be of the type resource, %s given', get_debug_type($res))); + throw new \TypeError(\sprintf('Argument 1 passed to get_resource_id() must be of the type resource, %s given', get_debug_type($res))); } return (int) $res; diff --git a/vendor/symfony/polyfill-php80/PhpToken.php b/vendor/symfony/polyfill-php80/PhpToken.php index fe6e6910..cd78c4cc 100644 --- a/vendor/symfony/polyfill-php80/PhpToken.php +++ b/vendor/symfony/polyfill-php80/PhpToken.php @@ -29,7 +29,7 @@ class PhpToken implements \Stringable public $text; /** - * @var int + * @var -1|positive-int */ public $line; @@ -38,6 +38,9 @@ class PhpToken implements \Stringable */ public $pos; + /** + * @param -1|positive-int $line + */ public function __construct(int $id, string $text, int $line = -1, int $position = -1) { $this->id = $id; @@ -80,7 +83,7 @@ class PhpToken implements \Stringable } /** - * @return static[] + * @return list */ public static function tokenize(string $code, int $flags = 0): array { diff --git a/vendor/symfony/polyfill-php80/composer.json b/vendor/symfony/polyfill-php80/composer.json index bd9a3262..a503b039 100644 --- a/vendor/symfony/polyfill-php80/composer.json +++ b/vendor/symfony/polyfill-php80/composer.json @@ -20,7 +20,7 @@ } ], "require": { - "php": ">=7.1" + "php": ">=7.2" }, "autoload": { "psr-4": { "Symfony\\Polyfill\\Php80\\": "" }, @@ -29,9 +29,6 @@ }, "minimum-stability": "dev", "extra": { - "branch-alias": { - "dev-main": "1.27-dev" - }, "thanks": { "name": "symfony/polyfill", "url": "https://github.com/symfony/polyfill" diff --git a/vendor/symfony/process/CHANGELOG.md b/vendor/symfony/process/CHANGELOG.md index 31b9ee6a..dc0a0cc5 100644 --- a/vendor/symfony/process/CHANGELOG.md +++ b/vendor/symfony/process/CHANGELOG.md @@ -1,6 +1,13 @@ CHANGELOG ========= +6.4 +--- + + * Add `PhpSubprocess` to handle PHP subprocesses that take over the + configuration from their parent + * Add `RunProcessMessage` and `RunProcessMessageHandler` + 5.2.0 ----- diff --git a/vendor/symfony/process/Exception/ProcessFailedException.php b/vendor/symfony/process/Exception/ProcessFailedException.php index 328acfde..29cd386b 100644 --- a/vendor/symfony/process/Exception/ProcessFailedException.php +++ b/vendor/symfony/process/Exception/ProcessFailedException.php @@ -20,7 +20,7 @@ use Symfony\Component\Process\Process; */ class ProcessFailedException extends RuntimeException { - private $process; + private Process $process; public function __construct(Process $process) { @@ -28,7 +28,7 @@ class ProcessFailedException extends RuntimeException throw new InvalidArgumentException('Expected a failed process, but the given process was successful.'); } - $error = sprintf('The command "%s" failed.'."\n\nExit Code: %s(%s)\n\nWorking directory: %s", + $error = \sprintf('The command "%s" failed.'."\n\nExit Code: %s(%s)\n\nWorking directory: %s", $process->getCommandLine(), $process->getExitCode(), $process->getExitCodeText(), @@ -36,7 +36,7 @@ class ProcessFailedException extends RuntimeException ); if (!$process->isOutputDisabled()) { - $error .= sprintf("\n\nOutput:\n================\n%s\n\nError Output:\n================\n%s", + $error .= \sprintf("\n\nOutput:\n================\n%s\n\nError Output:\n================\n%s", $process->getOutput(), $process->getErrorOutput() ); @@ -47,6 +47,9 @@ class ProcessFailedException extends RuntimeException $this->process = $process; } + /** + * @return Process + */ public function getProcess() { return $this->process; diff --git a/vendor/symfony/process/Exception/ProcessSignaledException.php b/vendor/symfony/process/Exception/ProcessSignaledException.php index d4d32275..12eb4b3b 100644 --- a/vendor/symfony/process/Exception/ProcessSignaledException.php +++ b/vendor/symfony/process/Exception/ProcessSignaledException.php @@ -20,13 +20,13 @@ use Symfony\Component\Process\Process; */ final class ProcessSignaledException extends RuntimeException { - private $process; + private Process $process; public function __construct(Process $process) { $this->process = $process; - parent::__construct(sprintf('The process has been signaled with signal "%s".', $process->getTermSignal())); + parent::__construct(\sprintf('The process has been signaled with signal "%s".', $process->getTermSignal())); } public function getProcess(): Process diff --git a/vendor/symfony/process/Exception/ProcessTimedOutException.php b/vendor/symfony/process/Exception/ProcessTimedOutException.php index b052d72c..94c1a33a 100644 --- a/vendor/symfony/process/Exception/ProcessTimedOutException.php +++ b/vendor/symfony/process/Exception/ProcessTimedOutException.php @@ -23,42 +23,51 @@ class ProcessTimedOutException extends RuntimeException public const TYPE_GENERAL = 1; public const TYPE_IDLE = 2; - private $process; - private $timeoutType; + private Process $process; + private int $timeoutType; public function __construct(Process $process, int $timeoutType) { $this->process = $process; $this->timeoutType = $timeoutType; - parent::__construct(sprintf( + parent::__construct(\sprintf( 'The process "%s" exceeded the timeout of %s seconds.', $process->getCommandLine(), $this->getExceededTimeout() )); } + /** + * @return Process + */ public function getProcess() { return $this->process; } + /** + * @return bool + */ public function isGeneralTimeout() { return self::TYPE_GENERAL === $this->timeoutType; } + /** + * @return bool + */ public function isIdleTimeout() { return self::TYPE_IDLE === $this->timeoutType; } - public function getExceededTimeout() + public function getExceededTimeout(): ?float { return match ($this->timeoutType) { self::TYPE_GENERAL => $this->process->getTimeout(), self::TYPE_IDLE => $this->process->getIdleTimeout(), - default => throw new \LogicException(sprintf('Unknown timeout type "%d".', $this->timeoutType)), + default => throw new \LogicException(\sprintf('Unknown timeout type "%d".', $this->timeoutType)), }; } } diff --git a/vendor/symfony/process/ExecutableFinder.php b/vendor/symfony/process/ExecutableFinder.php index d9d11102..4d820262 100644 --- a/vendor/symfony/process/ExecutableFinder.php +++ b/vendor/symfony/process/ExecutableFinder.php @@ -19,10 +19,20 @@ namespace Symfony\Component\Process; */ class ExecutableFinder { - private $suffixes = ['.exe', '.bat', '.cmd', '.com']; + private const CMD_BUILTINS = [ + 'assoc', 'break', 'call', 'cd', 'chdir', 'cls', 'color', 'copy', 'date', + 'del', 'dir', 'echo', 'endlocal', 'erase', 'exit', 'for', 'ftype', 'goto', + 'help', 'if', 'label', 'md', 'mkdir', 'mklink', 'move', 'path', 'pause', + 'popd', 'prompt', 'pushd', 'rd', 'rem', 'ren', 'rename', 'rmdir', 'set', + 'setlocal', 'shift', 'start', 'time', 'title', 'type', 'ver', 'vol', + ]; + + private array $suffixes = []; /** * Replaces default suffixes of executable. + * + * @return void */ public function setSuffixes(array $suffixes) { @@ -31,6 +41,8 @@ class ExecutableFinder /** * Adds new possible suffix to check for executable. + * + * @return void */ public function addSuffix(string $suffix) { @@ -44,41 +56,50 @@ class ExecutableFinder * @param string|null $default The default to return if no executable is found * @param array $extraDirs Additional dirs to check into */ - public function find(string $name, string $default = null, array $extraDirs = []): ?string + public function find(string $name, ?string $default = null, array $extraDirs = []): ?string { - if (\ini_get('open_basedir')) { - $searchPath = array_merge(explode(\PATH_SEPARATOR, \ini_get('open_basedir')), $extraDirs); - $dirs = []; - foreach ($searchPath as $path) { - // Silencing against https://bugs.php.net/69240 - if (@is_dir($path)) { - $dirs[] = $path; - } else { - if (basename($path) == $name && @is_executable($path)) { - return $path; - } - } - } - } else { - $dirs = array_merge( - explode(\PATH_SEPARATOR, getenv('PATH') ?: getenv('Path')), - $extraDirs - ); + // windows built-in commands that are present in cmd.exe should not be resolved using PATH as they do not exist as exes + if ('\\' === \DIRECTORY_SEPARATOR && \in_array(strtolower($name), self::CMD_BUILTINS, true)) { + return $name; } - $suffixes = ['']; + $dirs = array_merge( + explode(\PATH_SEPARATOR, getenv('PATH') ?: getenv('Path')), + $extraDirs + ); + + $suffixes = []; if ('\\' === \DIRECTORY_SEPARATOR) { $pathExt = getenv('PATHEXT'); - $suffixes = array_merge($pathExt ? explode(\PATH_SEPARATOR, $pathExt) : $this->suffixes, $suffixes); + $suffixes = $this->suffixes; + $suffixes = array_merge($suffixes, $pathExt ? explode(\PATH_SEPARATOR, $pathExt) : ['.exe', '.bat', '.cmd', '.com']); } + $suffixes = '' !== pathinfo($name, \PATHINFO_EXTENSION) ? array_merge([''], $suffixes) : array_merge($suffixes, ['']); foreach ($suffixes as $suffix) { foreach ($dirs as $dir) { + if ('' === $dir) { + $dir = '.'; + } if (@is_file($file = $dir.\DIRECTORY_SEPARATOR.$name.$suffix) && ('\\' === \DIRECTORY_SEPARATOR || @is_executable($file))) { return $file; } + + if (!@is_dir($dir) && basename($dir) === $name.$suffix && @is_executable($dir)) { + return $dir; + } } } + if ('\\' === \DIRECTORY_SEPARATOR || !\function_exists('exec') || \strlen($name) !== strcspn($name, '/'.\DIRECTORY_SEPARATOR)) { + return $default; + } + + $execResult = exec('command -v -- '.escapeshellarg($name)); + + if (($executablePath = substr($execResult, 0, strpos($execResult, \PHP_EOL) ?: null)) && @is_executable($executablePath)) { + return $executablePath; + } + return $default; } } diff --git a/vendor/symfony/process/InputStream.php b/vendor/symfony/process/InputStream.php index b8682bae..3bcbfe84 100644 --- a/vendor/symfony/process/InputStream.php +++ b/vendor/symfony/process/InputStream.php @@ -22,17 +22,18 @@ use Symfony\Component\Process\Exception\RuntimeException; */ class InputStream implements \IteratorAggregate { - /** @var callable|null */ - private $onEmpty = null; - private $input = []; - private $open = true; + private ?\Closure $onEmpty = null; + private array $input = []; + private bool $open = true; /** * Sets a callback that is called when the write buffer becomes empty. + * + * @return void */ - public function onEmpty(callable $onEmpty = null) + public function onEmpty(?callable $onEmpty = null) { - $this->onEmpty = $onEmpty; + $this->onEmpty = null !== $onEmpty ? $onEmpty(...) : null; } /** @@ -40,6 +41,8 @@ class InputStream implements \IteratorAggregate * * @param resource|string|int|float|bool|\Traversable|null $input The input to append as scalar, * stream resource or \Traversable + * + * @return void */ public function write(mixed $input) { @@ -47,13 +50,15 @@ class InputStream implements \IteratorAggregate return; } if ($this->isClosed()) { - throw new RuntimeException(sprintf('"%s" is closed.', static::class)); + throw new RuntimeException(\sprintf('"%s" is closed.', static::class)); } $this->input[] = ProcessUtils::validateInput(__METHOD__, $input); } /** * Closes the write buffer. + * + * @return void */ public function close() { @@ -62,6 +67,8 @@ class InputStream implements \IteratorAggregate /** * Tells whether the write buffer is closed or not. + * + * @return bool */ public function isClosed() { diff --git a/vendor/symfony/process/PhpExecutableFinder.php b/vendor/symfony/process/PhpExecutableFinder.php index 3fab03e3..e24ca008 100644 --- a/vendor/symfony/process/PhpExecutableFinder.php +++ b/vendor/symfony/process/PhpExecutableFinder.php @@ -19,7 +19,7 @@ namespace Symfony\Component\Process; */ class PhpExecutableFinder { - private $executableFinder; + private ExecutableFinder $executableFinder; public function __construct() { @@ -32,15 +32,8 @@ class PhpExecutableFinder public function find(bool $includeArgs = true): string|false { if ($php = getenv('PHP_BINARY')) { - if (!is_executable($php)) { - $command = '\\' === \DIRECTORY_SEPARATOR ? 'where' : 'command -v'; - if ($php = strtok(exec($command.' '.escapeshellarg($php)), \PHP_EOL)) { - if (!is_executable($php)) { - return false; - } - } else { - return false; - } + if (!is_executable($php) && !$php = $this->executableFinder->find($php)) { + return false; } if (@is_dir($php)) { @@ -54,7 +47,7 @@ class PhpExecutableFinder $args = $includeArgs && $args ? ' '.implode(' ', $args) : ''; // PHP_BINARY return the current sapi executable - if (\PHP_BINARY && \in_array(\PHP_SAPI, ['cgi-fcgi', 'cli', 'cli-server', 'phpdbg'], true)) { + if (\PHP_BINARY && \in_array(\PHP_SAPI, ['cli', 'cli-server', 'phpdbg'], true)) { return \PHP_BINARY.$args; } diff --git a/vendor/symfony/process/PhpProcess.php b/vendor/symfony/process/PhpProcess.php index 486bc1da..db6ebf2a 100644 --- a/vendor/symfony/process/PhpProcess.php +++ b/vendor/symfony/process/PhpProcess.php @@ -32,7 +32,7 @@ class PhpProcess extends Process * @param int $timeout The timeout in seconds * @param array|null $php Path to the PHP binary to use with any additional arguments */ - public function __construct(string $script, string $cwd = null, array $env = null, int $timeout = 60, array $php = null) + public function __construct(string $script, ?string $cwd = null, ?array $env = null, int $timeout = 60, ?array $php = null) { if (null === $php) { $executableFinder = new PhpExecutableFinder(); @@ -50,12 +50,15 @@ class PhpProcess extends Process parent::__construct($php, $cwd, $env, $script, $timeout); } - public static function fromShellCommandline(string $command, string $cwd = null, array $env = null, mixed $input = null, ?float $timeout = 60): static + public static function fromShellCommandline(string $command, ?string $cwd = null, ?array $env = null, mixed $input = null, ?float $timeout = 60): static { - throw new LogicException(sprintf('The "%s()" method cannot be called when using "%s".', __METHOD__, self::class)); + throw new LogicException(\sprintf('The "%s()" method cannot be called when using "%s".', __METHOD__, self::class)); } - public function start(callable $callback = null, array $env = []) + /** + * @return void + */ + public function start(?callable $callback = null, array $env = []) { if (null === $this->getCommandLine()) { throw new RuntimeException('Unable to find the PHP executable.'); diff --git a/vendor/symfony/process/Pipes/AbstractPipes.php b/vendor/symfony/process/Pipes/AbstractPipes.php index 51d3af0b..49a14da0 100644 --- a/vendor/symfony/process/Pipes/AbstractPipes.php +++ b/vendor/symfony/process/Pipes/AbstractPipes.php @@ -22,26 +22,25 @@ abstract class AbstractPipes implements PipesInterface { public array $pipes = []; - private $inputBuffer = ''; + private string $inputBuffer = ''; + /** @var resource|string|\Iterator */ private $input; - private $blocked = true; - private $lastError; + private bool $blocked = true; + private ?string $lastError = null; /** - * @param resource|string|int|float|bool|\Iterator|null $input + * @param resource|string|\Iterator $input */ - public function __construct(mixed $input) + public function __construct($input) { if (\is_resource($input) || $input instanceof \Iterator) { $this->input = $input; - } elseif (\is_string($input)) { - $this->inputBuffer = $input; } else { $this->inputBuffer = (string) $input; } } - public function close() + public function close(): void { foreach ($this->pipes as $pipe) { if (\is_resource($pipe)) { @@ -53,30 +52,42 @@ abstract class AbstractPipes implements PipesInterface /** * Returns true if a system call has been interrupted. + * + * stream_select() returns false when the `select` system call is interrupted by an incoming signal. */ protected function hasSystemCallBeenInterrupted(): bool { $lastError = $this->lastError; $this->lastError = null; - // stream_select returns false when the `select` system call is interrupted by an incoming signal - return null !== $lastError && false !== stripos($lastError, 'interrupted system call'); + if (null === $lastError) { + return false; + } + + if (false !== stripos($lastError, 'interrupted system call')) { + return true; + } + + // on applications with a different locale than english, the message above is not found because + // it's translated. So we also check for the SOCKET_EINTR constant which is defined under + // Windows and UNIX-like platforms (if available on the platform). + return \defined('SOCKET_EINTR') && str_starts_with($lastError, 'stream_select(): Unable to select ['.\SOCKET_EINTR.']'); } /** * Unblocks streams. */ - protected function unblock() + protected function unblock(): void { if (!$this->blocked) { return; } foreach ($this->pipes as $pipe) { - stream_set_blocking($pipe, 0); + stream_set_blocking($pipe, false); } if (\is_resource($this->input)) { - stream_set_blocking($this->input, 0); + stream_set_blocking($this->input, false); } $this->blocked = false; @@ -98,11 +109,11 @@ abstract class AbstractPipes implements PipesInterface if (!$input->valid()) { $input = null; } elseif (\is_resource($input = $input->current())) { - stream_set_blocking($input, 0); + stream_set_blocking($input, false); } elseif (!isset($this->inputBuffer[0])) { if (!\is_string($input)) { if (!\is_scalar($input)) { - throw new InvalidArgumentException(sprintf('"%s" yielded a value of type "%s", but only scalars and stream resources are supported.', get_debug_type($this->input), get_debug_type($input))); + throw new InvalidArgumentException(\sprintf('"%s" yielded a value of type "%s", but only scalars and stream resources are supported.', get_debug_type($this->input), get_debug_type($input))); } $input = (string) $input; } @@ -124,9 +135,11 @@ abstract class AbstractPipes implements PipesInterface foreach ($w as $stdin) { if (isset($this->inputBuffer[0])) { - $written = fwrite($stdin, $this->inputBuffer); + if (false === $written = @fwrite($stdin, $this->inputBuffer)) { + return $this->closeBrokenInputPipe(); + } $this->inputBuffer = substr($this->inputBuffer, $written); - if (isset($this->inputBuffer[0])) { + if (isset($this->inputBuffer[0]) && isset($this->pipes[0])) { return [$this->pipes[0]]; } } @@ -137,12 +150,14 @@ abstract class AbstractPipes implements PipesInterface if (!isset($data[0])) { break; } - $written = fwrite($stdin, $data); + if (false === $written = @fwrite($stdin, $data)) { + return $this->closeBrokenInputPipe(); + } $data = substr($data, $written); if (isset($data[0])) { $this->inputBuffer = $data; - return [$this->pipes[0]]; + return isset($this->pipes[0]) ? [$this->pipes[0]] : null; } } if (feof($input)) { @@ -167,10 +182,22 @@ abstract class AbstractPipes implements PipesInterface return null; } + private function closeBrokenInputPipe(): void + { + $this->lastError = error_get_last()['message'] ?? null; + if (\is_resource($this->pipes[0] ?? null)) { + fclose($this->pipes[0]); + } + unset($this->pipes[0]); + + $this->input = null; + $this->inputBuffer = ''; + } + /** * @internal */ - public function handleError(int $type, string $msg) + public function handleError(int $type, string $msg): void { $this->lastError = $msg; } diff --git a/vendor/symfony/process/Pipes/PipesInterface.php b/vendor/symfony/process/Pipes/PipesInterface.php index 50eb5c47..967f8de7 100644 --- a/vendor/symfony/process/Pipes/PipesInterface.php +++ b/vendor/symfony/process/Pipes/PipesInterface.php @@ -57,5 +57,5 @@ interface PipesInterface /** * Closes file handles and pipes. */ - public function close(); + public function close(): void; } diff --git a/vendor/symfony/process/Pipes/UnixPipes.php b/vendor/symfony/process/Pipes/UnixPipes.php index aba0efce..8838c68a 100644 --- a/vendor/symfony/process/Pipes/UnixPipes.php +++ b/vendor/symfony/process/Pipes/UnixPipes.php @@ -22,9 +22,9 @@ use Symfony\Component\Process\Process; */ class UnixPipes extends AbstractPipes { - private $ttyMode; - private $ptyMode; - private $haveReadSupport; + private ?bool $ttyMode; + private bool $ptyMode; + private bool $haveReadSupport; public function __construct(?bool $ttyMode, bool $ptyMode, mixed $input, bool $haveReadSupport) { @@ -35,12 +35,12 @@ class UnixPipes extends AbstractPipes parent::__construct($input); } - public function __sleep(): array + public function __serialize(): array { throw new \BadMethodCallException('Cannot serialize '.__CLASS__); } - public function __wakeup() + public function __unserialize(array $data): void { throw new \BadMethodCallException('Cannot unserialize '.__CLASS__); } @@ -74,7 +74,7 @@ class UnixPipes extends AbstractPipes return [ ['pty'], ['pty'], - ['pty'], + ['pipe', 'w'], // stderr needs to be in a pipe to correctly split error and output, since PHP will use the same stream for both ]; } diff --git a/vendor/symfony/process/Pipes/WindowsPipes.php b/vendor/symfony/process/Pipes/WindowsPipes.php index 9f4dedb2..0ca76df5 100644 --- a/vendor/symfony/process/Pipes/WindowsPipes.php +++ b/vendor/symfony/process/Pipes/WindowsPipes.php @@ -26,14 +26,14 @@ use Symfony\Component\Process\Process; */ class WindowsPipes extends AbstractPipes { - private $files = []; - private $fileHandles = []; - private $lockHandles = []; - private $readBytes = [ + private array $files = []; + private array $fileHandles = []; + private array $lockHandles = []; + private array $readBytes = [ Process::STDOUT => 0, Process::STDERR => 0, ]; - private $haveReadSupport; + private bool $haveReadSupport; public function __construct(mixed $input, bool $haveReadSupport) { @@ -50,10 +50,10 @@ class WindowsPipes extends AbstractPipes ]; $tmpDir = sys_get_temp_dir(); $lastError = 'unknown reason'; - set_error_handler(function ($type, $msg) use (&$lastError) { $lastError = $msg; }); + set_error_handler(static function ($type, $msg) use (&$lastError) { $lastError = $msg; }); for ($i = 0;; ++$i) { foreach ($pipes as $pipe => $name) { - $file = sprintf('%s\\sf_proc_%02X.%s', $tmpDir, $i, $name); + $file = \sprintf('%s\\sf_proc_%02X.%s', $tmpDir, $i, $name); if (!$h = fopen($file.'.lock', 'w')) { if (file_exists($file.'.lock')) { @@ -88,12 +88,12 @@ class WindowsPipes extends AbstractPipes parent::__construct($input); } - public function __sleep(): array + public function __serialize(): array { throw new \BadMethodCallException('Cannot serialize '.__CLASS__); } - public function __wakeup() + public function __unserialize(array $data): void { throw new \BadMethodCallException('Cannot unserialize '.__CLASS__); } @@ -140,7 +140,7 @@ class WindowsPipes extends AbstractPipes if ($w) { @stream_select($r, $w, $e, 0, Process::TIMEOUT_PRECISION * 1E6); } elseif ($this->fileHandles) { - usleep(Process::TIMEOUT_PRECISION * 1E6); + usleep((int) (Process::TIMEOUT_PRECISION * 1E6)); } } foreach ($this->fileHandles as $type => $fileHandle) { @@ -172,7 +172,7 @@ class WindowsPipes extends AbstractPipes return $this->pipes && $this->fileHandles; } - public function close() + public function close(): void { parent::close(); foreach ($this->fileHandles as $type => $handle) { diff --git a/vendor/symfony/process/Process.php b/vendor/symfony/process/Process.php index 63a402a5..b2ef02cd 100644 --- a/vendor/symfony/process/Process.php +++ b/vendor/symfony/process/Process.php @@ -17,7 +17,6 @@ use Symfony\Component\Process\Exception\ProcessFailedException; use Symfony\Component\Process\Exception\ProcessSignaledException; use Symfony\Component\Process\Exception\ProcessTimedOutException; use Symfony\Component\Process\Exception\RuntimeException; -use Symfony\Component\Process\Pipes\PipesInterface; use Symfony\Component\Process\Pipes\UnixPipes; use Symfony\Component\Process\Pipes\WindowsPipes; @@ -51,37 +50,38 @@ class Process implements \IteratorAggregate public const ITER_SKIP_OUT = 4; // Use this flag to skip STDOUT while iterating public const ITER_SKIP_ERR = 8; // Use this flag to skip STDERR while iterating - private $callback; - private $hasCallback = false; - private $commandline; - private $cwd; - private $env = []; + private ?\Closure $callback = null; + private array|string $commandline; + private ?string $cwd; + private array $env = []; + /** @var resource|string|\Iterator|null */ private $input; - private $starttime; - private $lastOutputTime; - private $timeout; - private $idleTimeout; - private $exitcode; - private $fallbackStatus = []; - private $processInformation; - private $outputDisabled = false; + private ?float $starttime = null; + private ?float $lastOutputTime = null; + private ?float $timeout = null; + private ?float $idleTimeout = null; + private ?int $exitcode = null; + private array $fallbackStatus = []; + private array $processInformation; + private bool $outputDisabled = false; + /** @var resource */ private $stdout; + /** @var resource */ private $stderr; + /** @var resource|null */ private $process; - private $status = self::STATUS_READY; - private $incrementalOutputOffset = 0; - private $incrementalErrorOutputOffset = 0; - private $tty = false; - private $pty; - private $options = ['suppress_errors' => true, 'bypass_shell' => true]; + private string $status = self::STATUS_READY; + private int $incrementalOutputOffset = 0; + private int $incrementalErrorOutputOffset = 0; + private bool $tty = false; + private bool $pty; + private array $options = ['suppress_errors' => true, 'bypass_shell' => true]; - private $useFileHandles = false; - /** @var PipesInterface */ - private $processPipes; + private WindowsPipes|UnixPipes $processPipes; - private $latestSignal; + private ?int $latestSignal = null; - private static $sigchild; + private static ?bool $sigchild = null; /** * Exit codes translation table. @@ -140,7 +140,7 @@ class Process implements \IteratorAggregate * * @throws LogicException When proc_open is not installed */ - public function __construct(array $command, string $cwd = null, array $env = null, mixed $input = null, ?float $timeout = 60) + public function __construct(array $command, ?string $cwd = null, ?array $env = null, mixed $input = null, ?float $timeout = 60) { if (!\function_exists('proc_open')) { throw new LogicException('The Process class relies on proc_open, which is not available on your PHP installation.'); @@ -162,7 +162,6 @@ class Process implements \IteratorAggregate $this->setInput($input); $this->setTimeout($timeout); - $this->useFileHandles = '\\' === \DIRECTORY_SEPARATOR; $this->pty = false; } @@ -187,7 +186,7 @@ class Process implements \IteratorAggregate * * @throws LogicException When proc_open is not installed */ - public static function fromShellCommandline(string $command, string $cwd = null, array $env = null, mixed $input = null, ?float $timeout = 60): static + public static function fromShellCommandline(string $command, ?string $cwd = null, ?array $env = null, mixed $input = null, ?float $timeout = 60): static { $process = new static([], $cwd, $env, $input, $timeout); $process->commandline = $command; @@ -195,12 +194,12 @@ class Process implements \IteratorAggregate return $process; } - public function __sleep(): array + public function __serialize(): array { throw new \BadMethodCallException('Cannot serialize '.__CLASS__); } - public function __wakeup() + public function __unserialize(array $data): void { throw new \BadMethodCallException('Cannot unserialize '.__CLASS__); } @@ -242,7 +241,7 @@ class Process implements \IteratorAggregate * * @final */ - public function run(callable $callback = null, array $env = []): int + public function run(?callable $callback = null, array $env = []): int { $this->start($callback, $env); @@ -257,11 +256,16 @@ class Process implements \IteratorAggregate * * @return $this * - * @throws ProcessFailedException if the process didn't terminate successfully + * @throws ProcessFailedException When process didn't terminate successfully + * @throws RuntimeException When process can't be launched + * @throws RuntimeException When process is already running + * @throws ProcessTimedOutException When process timed out + * @throws ProcessSignaledException When process stopped after receiving signal + * @throws LogicException In case a callback is provided and output has been disabled * * @final */ - public function mustRun(callable $callback = null, array $env = []): static + public function mustRun(?callable $callback = null, array $env = []): static { if (0 !== $this->run($callback, $env)) { throw new ProcessFailedException($this); @@ -285,11 +289,13 @@ class Process implements \IteratorAggregate * @param callable|null $callback A PHP callback to run whenever there is some * output available on STDOUT or STDERR * + * @return void + * * @throws RuntimeException When process can't be launched * @throws RuntimeException When process is already running * @throws LogicException In case a callback is provided and output has been disabled */ - public function start(callable $callback = null, array $env = []) + public function start(?callable $callback = null, array $env = []) { if ($this->isRunning()) { throw new RuntimeException('Process is already running.'); @@ -298,8 +304,7 @@ class Process implements \IteratorAggregate $this->resetProcessData(); $this->starttime = $this->lastOutputTime = microtime(true); $this->callback = $this->buildCallback($callback); - $this->hasCallback = null !== $callback; - $descriptors = $this->getDescriptors(); + $descriptors = $this->getDescriptors(null !== $callback); if ($this->env) { $env += '\\' === \DIRECTORY_SEPARATOR ? array_diff_ukey($this->env, $env, 'strcasecmp') : $this->env; @@ -320,35 +325,36 @@ class Process implements \IteratorAggregate if ('\\' === \DIRECTORY_SEPARATOR) { $commandline = $this->prepareWindowsCommandLine($commandline, $env); - } elseif (!$this->useFileHandles && $this->isSigchildEnabled()) { + } elseif ($this->isSigchildEnabled()) { // last exit code is output on the fourth pipe and caught to work around --enable-sigchild $descriptors[3] = ['pipe', 'w']; // See https://unix.stackexchange.com/questions/71205/background-process-pipe-input $commandline = '{ ('.$commandline.') <&3 3<&- 3>/dev/null & } 3<&0;'; - $commandline .= 'pid=$!; echo $pid >&3; wait $pid; code=$?; echo $code >&3; exit $code'; - - // Workaround for the bug, when PTS functionality is enabled. - // @see : https://bugs.php.net/69442 - $ptsWorkaround = fopen(__FILE__, 'r'); + $commandline .= 'pid=$!; echo $pid >&3; wait $pid 2>/dev/null; code=$?; echo $code >&3; exit $code'; } $envPairs = []; foreach ($env as $k => $v) { - if (false !== $v && false === \in_array($k, ['argc', 'argv', 'ARGC', 'ARGV'], true)) { + if (!\is_scalar($v ?? '') && !$v instanceof \Stringable) { + continue; + } + + if (false !== $v && !\in_array($k = (string) $k, ['', 'argc', 'argv', 'ARGC', 'ARGV'], true) && !str_contains($k, '=') && !str_contains($k, "\0")) { $envPairs[] = $k.'='.$v; } } if (!is_dir($this->cwd)) { - throw new RuntimeException(sprintf('The provided cwd "%s" does not exist.', $this->cwd)); + throw new RuntimeException(\sprintf('The provided cwd "%s" does not exist.', $this->cwd)); } - $this->process = @proc_open($commandline, $descriptors, $this->processPipes->pipes, $this->cwd, $envPairs, $this->options); + $process = @proc_open($commandline, $descriptors, $this->processPipes->pipes, $this->cwd, $envPairs, $this->options); - if (!\is_resource($this->process)) { + if (!$process) { throw new RuntimeException('Unable to launch a new process.'); } + $this->process = $process; $this->status = self::STATUS_STARTED; if (isset($descriptors[3])) { @@ -378,7 +384,7 @@ class Process implements \IteratorAggregate * * @final */ - public function restart(callable $callback = null, array $env = []): static + public function restart(?callable $callback = null, array $env = []): static { if ($this->isRunning()) { throw new RuntimeException('Process is already running.'); @@ -405,7 +411,7 @@ class Process implements \IteratorAggregate * @throws ProcessSignaledException When process stopped after receiving signal * @throws LogicException When process is not yet started */ - public function wait(callable $callback = null): int + public function wait(?callable $callback = null): int { $this->requireProcessIsStarted(__FUNCTION__); @@ -421,7 +427,7 @@ class Process implements \IteratorAggregate do { $this->checkTimeout(); - $running = '\\' === \DIRECTORY_SEPARATOR ? $this->isRunning() : $this->processPipes->areOpen(); + $running = $this->isRunning() && ('\\' === \DIRECTORY_SEPARATOR || $this->processPipes->areOpen()); $this->readPipes($running, '\\' !== \DIRECTORY_SEPARATOR || !$running); } while ($running); @@ -878,7 +884,7 @@ class Process implements \IteratorAggregate * * @return int|null The exit-code of the process or null if it's not running */ - public function stop(float $timeout = 10, int $signal = null): ?int + public function stop(float $timeout = 10, ?int $signal = null): ?int { $timeoutMicro = microtime(true) + $timeout; if ($this->isRunning()) { @@ -912,7 +918,7 @@ class Process implements \IteratorAggregate * * @internal */ - public function addOutput(string $line) + public function addOutput(string $line): void { $this->lastOutputTime = microtime(true); @@ -926,7 +932,7 @@ class Process implements \IteratorAggregate * * @internal */ - public function addErrorOutput(string $line) + public function addErrorOutput(string $line): void { $this->lastOutputTime = microtime(true); @@ -1117,7 +1123,7 @@ class Process implements \IteratorAggregate * * This content will be passed to the underlying process standard input. * - * @param string|int|float|bool|resource|\Traversable|null $input The content + * @param string|resource|\Traversable|self|null $input The content * * @return $this * @@ -1140,6 +1146,8 @@ class Process implements \IteratorAggregate * In case you run a background process (with the start method), you should * trigger this method regularly to ensure the process timeout * + * @return void + * * @throws ProcessTimedOutException In case the timeout was reached */ public function checkTimeout() @@ -1180,6 +1188,8 @@ class Process implements \IteratorAggregate * * Enabling the "create_new_console" option allows a subprocess to continue * to run after the main process exited, on both Windows and *nix + * + * @return void */ public function setOptions(array $options) { @@ -1193,7 +1203,7 @@ class Process implements \IteratorAggregate foreach ($options as $key => $value) { if (!\in_array($key, $existingOptions)) { $this->options = $defaultOptions; - throw new LogicException(sprintf('Invalid option "%s" passed to "%s()". Supported options are "%s".', $key, __METHOD__, implode('", "', $existingOptions))); + throw new LogicException(\sprintf('Invalid option "%s" passed to "%s()". Supported options are "%s".', $key, __METHOD__, implode('", "', $existingOptions))); } $this->options[$key] = $value; } @@ -1206,7 +1216,7 @@ class Process implements \IteratorAggregate { static $isTtySupported; - return $isTtySupported ??= ('/' === \DIRECTORY_SEPARATOR && stream_isatty(\STDOUT)); + return $isTtySupported ??= ('/' === \DIRECTORY_SEPARATOR && stream_isatty(\STDOUT) && @is_writable('/dev/tty')); } /** @@ -1230,15 +1240,15 @@ class Process implements \IteratorAggregate /** * Creates the descriptors needed by the proc_open. */ - private function getDescriptors(): array + private function getDescriptors(bool $hasCallback): array { if ($this->input instanceof \Iterator) { $this->input->rewind(); } if ('\\' === \DIRECTORY_SEPARATOR) { - $this->processPipes = new WindowsPipes($this->input, !$this->outputDisabled || $this->hasCallback); + $this->processPipes = new WindowsPipes($this->input, !$this->outputDisabled || $hasCallback); } else { - $this->processPipes = new UnixPipes($this->isTty(), $this->isPty(), $this->input, !$this->outputDisabled || $this->hasCallback); + $this->processPipes = new UnixPipes($this->isTty(), $this->isPty(), $this->input, !$this->outputDisabled || $hasCallback); } return $this->processPipes->getDescriptors(); @@ -1252,12 +1262,10 @@ class Process implements \IteratorAggregate * * @param callable|null $callback The user defined PHP callback */ - protected function buildCallback(callable $callback = null): \Closure + protected function buildCallback(?callable $callback = null): \Closure { if ($this->outputDisabled) { - return function ($type, $data) use ($callback): bool { - return null !== $callback && $callback($type, $data); - }; + return static fn ($type, $data): bool => null !== $callback && $callback($type, $data); } $out = self::OUT; @@ -1277,6 +1285,8 @@ class Process implements \IteratorAggregate * Updates the status of the process, reads pipes. * * @param bool $blocking Whether to use a blocking read call + * + * @return void */ protected function updateStatus(bool $blocking) { @@ -1284,7 +1294,9 @@ class Process implements \IteratorAggregate return; } - $this->processInformation = proc_get_status($this->process); + if ($this->processInformation['running'] ?? true) { + $this->processInformation = proc_get_status($this->process); + } $running = $this->processInformation['running']; $this->readPipes($running && $blocking, '\\' !== \DIRECTORY_SEPARATOR || !$running); @@ -1325,7 +1337,7 @@ class Process implements \IteratorAggregate * * @throws LogicException in case output has been disabled or process is not started */ - private function readPipesForOutput(string $caller, bool $blocking = false) + private function readPipesForOutput(string $caller, bool $blocking = false): void { if ($this->outputDisabled) { throw new LogicException('Output has been disabled.'); @@ -1360,7 +1372,7 @@ class Process implements \IteratorAggregate * @param bool $blocking Whether to use blocking calls or not * @param bool $close Whether to close file handles or not */ - private function readPipes(bool $blocking, bool $close) + private function readPipes(bool $blocking, bool $close): void { $result = $this->processPipes->readAndWrite($blocking, $close); @@ -1382,8 +1394,9 @@ class Process implements \IteratorAggregate private function close(): int { $this->processPipes->close(); - if (\is_resource($this->process)) { + if ($this->process) { proc_close($this->process); + $this->process = null; } $this->exitcode = $this->processInformation['exitcode']; $this->status = self::STATUS_TERMINATED; @@ -1409,13 +1422,13 @@ class Process implements \IteratorAggregate /** * Resets data related to the latest run of the process. */ - private function resetProcessData() + private function resetProcessData(): void { $this->starttime = null; $this->callback = null; $this->exitcode = null; $this->fallbackStatus = []; - $this->processInformation = null; + $this->processInformation = []; $this->stdout = fopen('php://temp/maxmemory:'.(1024 * 1024), 'w+'); $this->stderr = fopen('php://temp/maxmemory:'.(1024 * 1024), 'w+'); $this->process = null; @@ -1446,10 +1459,10 @@ class Process implements \IteratorAggregate } if ('\\' === \DIRECTORY_SEPARATOR) { - exec(sprintf('taskkill /F /T /PID %d 2>&1', $pid), $output, $exitCode); + exec(\sprintf('taskkill /F /T /PID %d 2>&1', $pid), $output, $exitCode); if ($exitCode && $this->isRunning()) { if ($throwException) { - throw new RuntimeException(sprintf('Unable to kill the process (%s).', implode(' ', $output))); + throw new RuntimeException(\sprintf('Unable to kill the process (%s).', implode(' ', $output))); } return false; @@ -1459,12 +1472,12 @@ class Process implements \IteratorAggregate $ok = @proc_terminate($this->process, $signal); } elseif (\function_exists('posix_kill')) { $ok = @posix_kill($pid, $signal); - } elseif ($ok = proc_open(sprintf('kill -%d %d', $signal, $pid), [2 => ['pipe', 'w']], $pipes)) { + } elseif ($ok = proc_open(\sprintf('kill -%d %d', $signal, $pid), [2 => ['pipe', 'w']], $pipes)) { $ok = false === fgets($pipes[2]); } if (!$ok) { if ($throwException) { - throw new RuntimeException(sprintf('Error while sending signal "%s".', $signal)); + throw new RuntimeException(\sprintf('Error while sending signal "%s".', $signal)); } return false; @@ -1482,8 +1495,6 @@ class Process implements \IteratorAggregate private function prepareWindowsCommandLine(string $cmd, array &$env): string { $uid = uniqid('', true); - $varCount = 0; - $varCache = []; $cmd = preg_replace_callback( '/"(?:( [^"%!^]*+ @@ -1492,7 +1503,9 @@ class Process implements \IteratorAggregate [^"%!^]*+ )++ ) | [^"]*+ )"/x', - function ($m) use (&$env, &$varCache, &$varCount, $uid) { + static function ($m) use (&$env, $uid) { + static $varCount = 0; + static $varCache = []; if (!isset($m[1])) { return $m[0]; } @@ -1517,7 +1530,14 @@ class Process implements \IteratorAggregate $cmd ); - $cmd = 'cmd /V:ON /E:ON /D /C ('.str_replace("\n", ' ', $cmd).')'; + static $comSpec; + + if (!$comSpec && $comSpec = (new ExecutableFinder())->find('cmd.exe')) { + // Escape according to CommandLineToArgvW rules + $comSpec = '"'.preg_replace('{(\\\\*+)"}', '$1$1\"', $comSpec).'"'; + } + + $cmd = ($comSpec ?? 'cmd').' /V:ON /E:ON /D /C ('.str_replace("\n", ' ', $cmd).')'; foreach ($this->processPipes->getFiles() as $offset => $filename) { $cmd .= ' '.$offset.'>"'.$filename.'"'; } @@ -1530,10 +1550,10 @@ class Process implements \IteratorAggregate * * @throws LogicException if the process has not run */ - private function requireProcessIsStarted(string $functionName) + private function requireProcessIsStarted(string $functionName): void { if (!$this->isStarted()) { - throw new LogicException(sprintf('Process must be started before calling "%s()".', $functionName)); + throw new LogicException(\sprintf('Process must be started before calling "%s()".', $functionName)); } } @@ -1542,10 +1562,10 @@ class Process implements \IteratorAggregate * * @throws LogicException if the process is not yet terminated */ - private function requireProcessIsTerminated(string $functionName) + private function requireProcessIsTerminated(string $functionName): void { if (!$this->isTerminated()) { - throw new LogicException(sprintf('Process must be terminated before calling "%s()".', $functionName)); + throw new LogicException(\sprintf('Process must be terminated before calling "%s()".', $functionName)); } } @@ -1563,7 +1583,7 @@ class Process implements \IteratorAggregate if (str_contains($argument, "\0")) { $argument = str_replace("\0", '?', $argument); } - if (!preg_match('/[\/()%!^"<>&|\s]/', $argument)) { + if (!preg_match('/[()%!^"<>&|\s[\]=;*?\'$]/', $argument)) { return $argument; } $argument = preg_replace('/(\\\\+)$/', '$1$1', $argument); @@ -1571,11 +1591,11 @@ class Process implements \IteratorAggregate return '"'.str_replace(['"', '^', '%', '!', "\n"], ['""', '"^^"', '"^%"', '"^!"', '!LF!'], $argument).'"'; } - private function replacePlaceholders(string $commandline, array $env) + private function replacePlaceholders(string $commandline, array $env): string { return preg_replace_callback('/"\$\{:([_a-zA-Z]++[_a-zA-Z0-9]*+)\}"/', function ($matches) use ($commandline, $env) { if (!isset($env[$matches[1]]) || false === $env[$matches[1]]) { - throw new InvalidArgumentException(sprintf('Command line is missing a value for parameter "%s": ', $matches[1]).$commandline); + throw new InvalidArgumentException(\sprintf('Command line is missing a value for parameter "%s": ', $matches[1]).$commandline); } return $this->escapeArgument($env[$matches[1]]); @@ -1586,7 +1606,35 @@ class Process implements \IteratorAggregate { $env = getenv(); $env = ('\\' === \DIRECTORY_SEPARATOR ? array_intersect_ukey($env, $_SERVER, 'strcasecmp') : array_intersect_key($env, $_SERVER)) ?: $env; + $env = $_ENV + ('\\' === \DIRECTORY_SEPARATOR ? array_diff_ukey($env, $_ENV, 'strcasecmp') : $env); - return $_ENV + ('\\' === \DIRECTORY_SEPARATOR ? array_diff_ukey($env, $_ENV, 'strcasecmp') : $env); + if (\in_array(\PHP_SAPI, ['cli', 'phpdbg', 'embed'], true)) { + return $env; + } + + // On non-CLI SAPIs (notably PHP-FPM and CGI), CGI/FastCGI request-context + // vars are exposed through $_SERVER, $_ENV and getenv(), and must not + // propagate to subprocesses. + foreach ($env as $k => $v) { + if (str_starts_with($k, 'HTTP_') + || str_starts_with($k, 'ORIG_') + || str_starts_with($k, 'REDIRECT_') + || \in_array($k, [ + 'AUTH_TYPE', 'CONTENT_LENGTH', 'CONTENT_TYPE', 'DOCUMENT_ROOT', + 'DOCUMENT_URI', 'GATEWAY_INTERFACE', 'HTTPS', 'PATH_INFO', + 'PATH_TRANSLATED', 'PHP_AUTH_DIGEST', 'PHP_AUTH_PW', 'PHP_AUTH_USER', + 'PHP_SELF', 'QUERY_STRING', 'REMOTE_ADDR', 'REMOTE_HOST', + 'REMOTE_IDENT', 'REMOTE_PORT', 'REMOTE_USER', 'REQUEST_METHOD', + 'REQUEST_SCHEME', 'REQUEST_TIME', 'REQUEST_TIME_FLOAT', 'REQUEST_URI', + 'SCRIPT_FILENAME', 'SCRIPT_NAME', 'SCRIPT_URI', 'SCRIPT_URL', + 'SERVER_ADDR', 'SERVER_ADMIN', 'SERVER_NAME', 'SERVER_PORT', + 'SERVER_PROTOCOL', 'SERVER_SIGNATURE', 'SERVER_SOFTWARE', + ], true) + ) { + unset($env[$k]); + } + } + + return $env; } } diff --git a/vendor/symfony/process/ProcessUtils.php b/vendor/symfony/process/ProcessUtils.php index 744399d9..a2dbde9f 100644 --- a/vendor/symfony/process/ProcessUtils.php +++ b/vendor/symfony/process/ProcessUtils.php @@ -43,9 +43,6 @@ class ProcessUtils if (\is_resource($input)) { return $input; } - if (\is_string($input)) { - return $input; - } if (\is_scalar($input)) { return (string) $input; } @@ -59,7 +56,7 @@ class ProcessUtils return new \IteratorIterator($input); } - throw new InvalidArgumentException(sprintf('"%s" only accepts strings, Traversable objects or stream resources.', $caller)); + throw new InvalidArgumentException(\sprintf('"%s" only accepts strings, Traversable objects or stream resources.', $caller)); } return $input; diff --git a/vendor/symfony/service-contracts/Attribute/SubscribedService.php b/vendor/symfony/service-contracts/Attribute/SubscribedService.php index d98e1dfd..a6f205c2 100644 --- a/vendor/symfony/service-contracts/Attribute/SubscribedService.php +++ b/vendor/symfony/service-contracts/Attribute/SubscribedService.php @@ -11,30 +11,30 @@ namespace Symfony\Contracts\Service\Attribute; +use Symfony\Contracts\Service\ServiceMethodsSubscriberTrait; use Symfony\Contracts\Service\ServiceSubscriberInterface; -use Symfony\Contracts\Service\ServiceSubscriberTrait; /** * For use as the return value for {@see ServiceSubscriberInterface}. * * @example new SubscribedService('http_client', HttpClientInterface::class, false, new Target('githubApi')) * - * Use with {@see ServiceSubscriberTrait} to mark a method's return type + * Use with {@see ServiceMethodsSubscriberTrait} to mark a method's return type * as a subscribed service. * * @author Kevin Bond */ -#[\Attribute(\Attribute::TARGET_METHOD)] +#[\Attribute(\Attribute::TARGET_METHOD | \Attribute::TARGET_PROPERTY)] final class SubscribedService { /** @var object[] */ public array $attributes; /** - * @param string|null $key The key to use for the service - * @param class-string|null $type The service class - * @param bool $nullable Whether the service is optional - * @param object|object[] $attributes One or more dependency injection attributes to use + * @param string|null $key The key to use for the service + * @param string|null $type The service type (a class name, "string", "iterable", etc.) + * @param bool $nullable Whether the service is optional + * @param object|object[] $attributes One or more dependency injection attributes to use */ public function __construct( public ?string $key = null, diff --git a/vendor/symfony/service-contracts/ServiceLocatorTrait.php b/vendor/symfony/service-contracts/ServiceLocatorTrait.php index 45c8d910..bbe45484 100644 --- a/vendor/symfony/service-contracts/ServiceLocatorTrait.php +++ b/vendor/symfony/service-contracts/ServiceLocatorTrait.php @@ -26,16 +26,15 @@ class_exists(NotFoundExceptionInterface::class); */ trait ServiceLocatorTrait { - private array $factories; private array $loading = []; private array $providedTypes; /** - * @param callable[] $factories + * @param array $factories */ - public function __construct(array $factories) - { - $this->factories = $factories; + public function __construct( + private array $factories, + ) { } public function has(string $id): bool @@ -91,16 +90,16 @@ trait ServiceLocatorTrait } else { $last = array_pop($alternatives); if ($alternatives) { - $message = sprintf('only knows about the "%s" and "%s" services.', implode('", "', $alternatives), $last); + $message = \sprintf('only knows about the "%s" and "%s" services.', implode('", "', $alternatives), $last); } else { - $message = sprintf('only knows about the "%s" service.', $last); + $message = \sprintf('only knows about the "%s" service.', $last); } } if ($this->loading) { - $message = sprintf('The service "%s" has a dependency on a non-existent service "%s". This locator %s', end($this->loading), $id, $message); + $message = \sprintf('The service "%s" has a dependency on a non-existent service "%s". This locator %s', end($this->loading), $id, $message); } else { - $message = sprintf('Service "%s" not found: the current service locator %s', $id, $message); + $message = \sprintf('Service "%s" not found: the current service locator %s', $id, $message); } return new class($message) extends \InvalidArgumentException implements NotFoundExceptionInterface { @@ -109,7 +108,7 @@ trait ServiceLocatorTrait private function createCircularReferenceException(string $id, array $path): ContainerExceptionInterface { - return new class(sprintf('Circular reference detected for service "%s", path: "%s".', $id, implode(' -> ', $path))) extends \RuntimeException implements ContainerExceptionInterface { + return new class(\sprintf('Circular reference detected for service "%s", path: "%s".', $id, implode(' -> ', $path))) extends \RuntimeException implements ContainerExceptionInterface { }; } } diff --git a/vendor/symfony/service-contracts/ServiceProviderInterface.php b/vendor/symfony/service-contracts/ServiceProviderInterface.php index c05e4bfe..2e71f00c 100644 --- a/vendor/symfony/service-contracts/ServiceProviderInterface.php +++ b/vendor/symfony/service-contracts/ServiceProviderInterface.php @@ -39,7 +39,7 @@ interface ServiceProviderInterface extends ContainerInterface * * ['foo' => '?'] means the container provides service name "foo" of unspecified type * * ['bar' => '?Bar\Baz'] means the container provides a service "bar" of type Bar\Baz|null * - * @return string[] The provided service types, keyed by service names + * @return array The provided service types, keyed by service names */ public function getProvidedServices(): array; } diff --git a/vendor/symfony/service-contracts/ServiceSubscriberTrait.php b/vendor/symfony/service-contracts/ServiceSubscriberTrait.php index f3b450cd..0af2d864 100644 --- a/vendor/symfony/service-contracts/ServiceSubscriberTrait.php +++ b/vendor/symfony/service-contracts/ServiceSubscriberTrait.php @@ -15,23 +15,29 @@ use Psr\Container\ContainerInterface; use Symfony\Contracts\Service\Attribute\Required; use Symfony\Contracts\Service\Attribute\SubscribedService; +trigger_deprecation('symfony/contracts', 'v3.5', '"%s" is deprecated, use "ServiceMethodsSubscriberTrait" instead.', ServiceSubscriberTrait::class); + /** - * Implementation of ServiceSubscriberInterface that determines subscribed services from - * method return types. Service ids are available as "ClassName::methodName". + * Implementation of ServiceSubscriberInterface that determines subscribed services + * from methods that have the #[SubscribedService] attribute. + * + * Service ids are available as "ClassName::methodName" so that the implementation + * of subscriber methods can be just `return $this->container->get(__METHOD__);`. + * + * @property ContainerInterface $container * * @author Kevin Bond + * + * @deprecated since symfony/contracts v3.5, use ServiceMethodsSubscriberTrait instead */ trait ServiceSubscriberTrait { - /** @var ContainerInterface */ - protected $container; - public static function getSubscribedServices(): array { $services = method_exists(get_parent_class(self::class) ?: '', __FUNCTION__) ? parent::getSubscribedServices() : []; foreach ((new \ReflectionClass(self::class))->getMethods() as $method) { - if (self::class !== $method->getDeclaringClass()->name) { + if (self::class !== $method->class) { continue; } @@ -40,18 +46,18 @@ trait ServiceSubscriberTrait } if ($method->isStatic() || $method->isAbstract() || $method->isGenerator() || $method->isInternal() || $method->getNumberOfRequiredParameters()) { - throw new \LogicException(sprintf('Cannot use "%s" on method "%s::%s()" (can only be used on non-static, non-abstract methods with no parameters).', SubscribedService::class, self::class, $method->name)); + throw new \LogicException(\sprintf('Cannot use "%s" on method "%s::%s()" (can only be used on non-static, non-abstract methods with no parameters).', SubscribedService::class, self::class, $method->name)); } if (!$returnType = $method->getReturnType()) { - throw new \LogicException(sprintf('Cannot use "%s" on methods without a return type in "%s::%s()".', SubscribedService::class, $method->name, self::class)); + throw new \LogicException(\sprintf('Cannot use "%s" on methods without a return type in "%s::%s()".', SubscribedService::class, $method->name, self::class)); } - /* @var SubscribedService $attribute */ + /** @var SubscribedService $attribute */ $attribute = $attribute->newInstance(); $attribute->key ??= self::class.'::'.$method->name; $attribute->type ??= $returnType instanceof \ReflectionNamedType ? $returnType->getName() : (string) $returnType; - $attribute->nullable = $returnType->allowsNull(); + $attribute->nullable = $attribute->nullable ?: $returnType->allowsNull(); if ($attribute->attributes) { $services[] = $attribute; diff --git a/vendor/symfony/service-contracts/Test/ServiceLocatorTest.php b/vendor/symfony/service-contracts/Test/ServiceLocatorTest.php index 88f6a068..015ca71e 100644 --- a/vendor/symfony/service-contracts/Test/ServiceLocatorTest.php +++ b/vendor/symfony/service-contracts/Test/ServiceLocatorTest.php @@ -11,82 +11,9 @@ namespace Symfony\Contracts\Service\Test; -use PHPUnit\Framework\TestCase; -use Psr\Container\ContainerInterface; -use Symfony\Contracts\Service\ServiceLocatorTrait; - -abstract class ServiceLocatorTest extends TestCase +/** + * @deprecated since PHPUnit 9.6 + */ +class ServiceLocatorTest extends ServiceLocatorTestCase { - protected function getServiceLocator(array $factories): ContainerInterface - { - return new class($factories) implements ContainerInterface { - use ServiceLocatorTrait; - }; - } - - public function testHas() - { - $locator = $this->getServiceLocator([ - 'foo' => function () { return 'bar'; }, - 'bar' => function () { return 'baz'; }, - function () { return 'dummy'; }, - ]); - - $this->assertTrue($locator->has('foo')); - $this->assertTrue($locator->has('bar')); - $this->assertFalse($locator->has('dummy')); - } - - public function testGet() - { - $locator = $this->getServiceLocator([ - 'foo' => function () { return 'bar'; }, - 'bar' => function () { return 'baz'; }, - ]); - - $this->assertSame('bar', $locator->get('foo')); - $this->assertSame('baz', $locator->get('bar')); - } - - public function testGetDoesNotMemoize() - { - $i = 0; - $locator = $this->getServiceLocator([ - 'foo' => function () use (&$i) { - ++$i; - - return 'bar'; - }, - ]); - - $this->assertSame('bar', $locator->get('foo')); - $this->assertSame('bar', $locator->get('foo')); - $this->assertSame(2, $i); - } - - public function testThrowsOnUndefinedInternalService() - { - if (!$this->getExpectedException()) { - $this->expectException(\Psr\Container\NotFoundExceptionInterface::class); - $this->expectExceptionMessage('The service "foo" has a dependency on a non-existent service "bar". This locator only knows about the "foo" service.'); - } - $locator = $this->getServiceLocator([ - 'foo' => function () use (&$locator) { return $locator->get('bar'); }, - ]); - - $locator->get('foo'); - } - - public function testThrowsOnCircularReference() - { - $this->expectException(\Psr\Container\ContainerExceptionInterface::class); - $this->expectExceptionMessage('Circular reference detected for service "bar", path: "bar -> baz -> bar".'); - $locator = $this->getServiceLocator([ - 'foo' => function () use (&$locator) { return $locator->get('bar'); }, - 'bar' => function () use (&$locator) { return $locator->get('baz'); }, - 'baz' => function () use (&$locator) { return $locator->get('bar'); }, - ]); - - $locator->get('foo'); - } } diff --git a/vendor/symfony/service-contracts/composer.json b/vendor/symfony/service-contracts/composer.json index 36b0d95e..4de70498 100644 --- a/vendor/symfony/service-contracts/composer.json +++ b/vendor/symfony/service-contracts/composer.json @@ -17,14 +17,12 @@ ], "require": { "php": ">=8.1", - "psr/container": "^2.0" + "psr/container": "^1.1|^2.0", + "symfony/deprecation-contracts": "^2.5|^3" }, "conflict": { "ext-psr": "<1.1|>=2" }, - "suggest": { - "symfony/service-implementation": "" - }, "autoload": { "psr-4": { "Symfony\\Contracts\\Service\\": "" }, "exclude-from-classmap": [ @@ -34,7 +32,7 @@ "minimum-stability": "dev", "extra": { "branch-alias": { - "dev-main": "3.3-dev" + "dev-main": "3.7-dev" }, "thanks": { "name": "symfony/contracts", diff --git a/vendor/symfony/string/AbstractString.php b/vendor/symfony/string/AbstractString.php index bf491f88..402839c5 100644 --- a/vendor/symfony/string/AbstractString.php +++ b/vendor/symfony/string/AbstractString.php @@ -39,8 +39,8 @@ abstract class AbstractString implements \Stringable, \JsonSerializable public const PREG_SPLIT_DELIM_CAPTURE = \PREG_SPLIT_DELIM_CAPTURE; public const PREG_SPLIT_OFFSET_CAPTURE = \PREG_SPLIT_OFFSET_CAPTURE; - protected $string = ''; - protected $ignoreCase = false; + protected string $string = ''; + protected ?bool $ignoreCase = false; abstract public function __construct(string $string = ''); @@ -263,7 +263,7 @@ abstract class AbstractString implements \Stringable, \JsonSerializable public function endsWith(string|iterable $suffix): bool { if (\is_string($suffix)) { - throw new \TypeError(sprintf('Method "%s()" must be overridden by class "%s" to deal with non-iterable values.', __FUNCTION__, static::class)); + throw new \TypeError(\sprintf('Method "%s()" must be overridden by class "%s" to deal with non-iterable values.', __FUNCTION__, static::class)); } foreach ($suffix as $s) { @@ -312,7 +312,7 @@ abstract class AbstractString implements \Stringable, \JsonSerializable public function equalsTo(string|iterable $string): bool { if (\is_string($string)) { - throw new \TypeError(sprintf('Method "%s()" must be overridden by class "%s" to deal with non-iterable values.', __FUNCTION__, static::class)); + throw new \TypeError(\sprintf('Method "%s()" must be overridden by class "%s" to deal with non-iterable values.', __FUNCTION__, static::class)); } foreach ($string as $s) { @@ -340,7 +340,7 @@ abstract class AbstractString implements \Stringable, \JsonSerializable public function indexOf(string|iterable $needle, int $offset = 0): ?int { if (\is_string($needle)) { - throw new \TypeError(sprintf('Method "%s()" must be overridden by class "%s" to deal with non-iterable values.', __FUNCTION__, static::class)); + throw new \TypeError(\sprintf('Method "%s()" must be overridden by class "%s" to deal with non-iterable values.', __FUNCTION__, static::class)); } $i = \PHP_INT_MAX; @@ -362,7 +362,7 @@ abstract class AbstractString implements \Stringable, \JsonSerializable public function indexOfLast(string|iterable $needle, int $offset = 0): ?int { if (\is_string($needle)) { - throw new \TypeError(sprintf('Method "%s()" must be overridden by class "%s" to deal with non-iterable values.', __FUNCTION__, static::class)); + throw new \TypeError(\sprintf('Method "%s()" must be overridden by class "%s" to deal with non-iterable values.', __FUNCTION__, static::class)); } $i = null; @@ -383,7 +383,7 @@ abstract class AbstractString implements \Stringable, \JsonSerializable return '' === $this->string; } - abstract public function join(array $strings, string $lastGlue = null): static; + abstract public function join(array $strings, ?string $lastGlue = null): static; public function jsonSerialize(): string { @@ -414,7 +414,7 @@ abstract class AbstractString implements \Stringable, \JsonSerializable public function repeat(int $multiplier): static { if (0 > $multiplier) { - throw new InvalidArgumentException(sprintf('Multiplier must be positive, %d given.', $multiplier)); + throw new InvalidArgumentException(\sprintf('Multiplier must be positive, %d given.', $multiplier)); } $str = clone $this; @@ -429,16 +429,26 @@ abstract class AbstractString implements \Stringable, \JsonSerializable abstract public function reverse(): static; - abstract public function slice(int $start = 0, int $length = null): static; + abstract public function slice(int $start = 0, ?int $length = null): static; abstract public function snake(): static; - abstract public function splice(string $replacement, int $start = 0, int $length = null): static; + public function kebab(): static + { + return $this->snake()->replace('_', '-'); + } + + public function pascal(): static + { + return $this->camel()->title(); + } + + abstract public function splice(string $replacement, int $start = 0, ?int $length = null): static; /** * @return static[] */ - public function split(string $delimiter, int $limit = null, int $flags = null): array + public function split(string $delimiter, ?int $limit = null, ?int $flags = null): array { if (null === $flags) { throw new \TypeError('Split behavior when $flags is null must be implemented by child classes.'); @@ -448,7 +458,7 @@ abstract class AbstractString implements \Stringable, \JsonSerializable $delimiter .= 'i'; } - set_error_handler(static function ($t, $m) { throw new InvalidArgumentException($m); }); + set_error_handler(static fn ($t, $m) => throw new InvalidArgumentException($m)); try { if (false === $chunks = preg_split($delimiter, $this->string, $limit, $flags)) { @@ -481,7 +491,7 @@ abstract class AbstractString implements \Stringable, \JsonSerializable public function startsWith(string|iterable $prefix): bool { if (\is_string($prefix)) { - throw new \TypeError(sprintf('Method "%s()" must be overridden by class "%s" to deal with non-iterable values.', __FUNCTION__, static::class)); + throw new \TypeError(\sprintf('Method "%s()" must be overridden by class "%s" to deal with non-iterable values.', __FUNCTION__, static::class)); } foreach ($prefix as $prefix) { @@ -495,7 +505,7 @@ abstract class AbstractString implements \Stringable, \JsonSerializable abstract public function title(bool $allWords = false): static; - public function toByteString(string $toEncoding = null): ByteString + public function toByteString(?string $toEncoding = null): ByteString { $b = new ByteString(); @@ -507,20 +517,14 @@ abstract class AbstractString implements \Stringable, \JsonSerializable return $b; } - set_error_handler(static function ($t, $m) { throw new InvalidArgumentException($m); }); - try { - try { - $b->string = mb_convert_encoding($this->string, $toEncoding, 'UTF-8'); - } catch (InvalidArgumentException $e) { - if (!\function_exists('iconv')) { - throw $e; - } - - $b->string = iconv('UTF-8', $toEncoding, $this->string); + $b->string = mb_convert_encoding($this->string, $toEncoding, 'UTF-8'); + } catch (\ValueError $e) { + if (!\function_exists('iconv')) { + throw new InvalidArgumentException($e->getMessage(), $e->getCode(), $e); } - } finally { - restore_error_handler(); + + $b->string = iconv('UTF-8', $toEncoding, $this->string); } return $b; @@ -611,7 +615,7 @@ abstract class AbstractString implements \Stringable, \JsonSerializable return $str; } - public function truncate(int $length, string $ellipsis = '', bool $cut = true): static + public function truncate(int $length, string $ellipsis = '', bool|TruncateMode $cut = TruncateMode::Char): static { $stringLength = $this->length(); @@ -625,16 +629,27 @@ abstract class AbstractString implements \Stringable, \JsonSerializable $ellipsisLength = 0; } - if (!$cut) { + $desiredLength = $length; + if (TruncateMode::WordAfter === $cut || !$cut) { if (null === $length = $this->indexOf([' ', "\r", "\n", "\t"], ($length ?: 1) - 1)) { return clone $this; } + $length += $ellipsisLength; + } elseif (TruncateMode::WordBefore === $cut && null !== $this->indexOf([' ', "\r", "\n", "\t"], ($length ?: 1) - 1)) { $length += $ellipsisLength; } $str = $this->slice(0, $length - $ellipsisLength); + if (TruncateMode::WordBefore === $cut) { + if (0 === $ellipsisLength && $desiredLength === $this->indexOf([' ', "\r", "\n", "\t"], $length)) { + return $str; + } + + $str = $str->beforeLast([' ', "\r", "\n", "\t"]); + } + return $ellipsisLength ? $str->trimEnd()->append($ellipsis) : $str; } @@ -691,8 +706,35 @@ abstract class AbstractString implements \Stringable, \JsonSerializable return $str; } + public function __serialize(): array + { + if (self::class === (new \ReflectionMethod($this, '__sleep'))->class || self::class !== (new \ReflectionMethod($this, '__serialize'))->class) { + return ['string' => $this->string]; + } + + trigger_deprecation('symfony/string', '7.4', 'Implementing "%s::__sleep()" is deprecated, use "__serialize()" instead.', get_debug_type($this)); + + $data = []; + foreach ($this->__sleep() as $key) { + try { + if (($r = new \ReflectionProperty($this, $key))->isInitialized($this)) { + $data[$key] = $r->getValue($this); + } + } catch (\ReflectionException) { + $data[$key] = $this->$key; + } + } + + return $data; + } + + /** + * @deprecated since Symfony 7.4, will be replaced by `__unserialize()` in 8.0 + */ public function __sleep(): array { + trigger_deprecation('symfony/string', '7.4', 'Calling "%s::__sleep()" is deprecated, use "__serialize()" instead.', get_debug_type($this)); + return ['string']; } diff --git a/vendor/symfony/string/AbstractUnicodeString.php b/vendor/symfony/string/AbstractUnicodeString.php index 2a2bed71..fcbe09a2 100644 --- a/vendor/symfony/string/AbstractUnicodeString.php +++ b/vendor/symfony/string/AbstractUnicodeString.php @@ -40,17 +40,13 @@ abstract class AbstractUnicodeString extends AbstractString private const FOLD_FROM = ['İ', 'µ', 'ſ', "\xCD\x85", 'ς', 'ϐ', 'ϑ', 'ϕ', 'ϖ', 'ϰ', 'ϱ', 'ϵ', 'ẛ', "\xE1\xBE\xBE", 'ß', 'ʼn', 'ǰ', 'ΐ', 'ΰ', 'և', 'ẖ', 'ẗ', 'ẘ', 'ẙ', 'ẚ', 'ẞ', 'ὐ', 'ὒ', 'ὔ', 'ὖ', 'ᾀ', 'ᾁ', 'ᾂ', 'ᾃ', 'ᾄ', 'ᾅ', 'ᾆ', 'ᾇ', 'ᾈ', 'ᾉ', 'ᾊ', 'ᾋ', 'ᾌ', 'ᾍ', 'ᾎ', 'ᾏ', 'ᾐ', 'ᾑ', 'ᾒ', 'ᾓ', 'ᾔ', 'ᾕ', 'ᾖ', 'ᾗ', 'ᾘ', 'ᾙ', 'ᾚ', 'ᾛ', 'ᾜ', 'ᾝ', 'ᾞ', 'ᾟ', 'ᾠ', 'ᾡ', 'ᾢ', 'ᾣ', 'ᾤ', 'ᾥ', 'ᾦ', 'ᾧ', 'ᾨ', 'ᾩ', 'ᾪ', 'ᾫ', 'ᾬ', 'ᾭ', 'ᾮ', 'ᾯ', 'ᾲ', 'ᾳ', 'ᾴ', 'ᾶ', 'ᾷ', 'ᾼ', 'ῂ', 'ῃ', 'ῄ', 'ῆ', 'ῇ', 'ῌ', 'ῒ', 'ῖ', 'ῗ', 'ῢ', 'ῤ', 'ῦ', 'ῧ', 'ῲ', 'ῳ', 'ῴ', 'ῶ', 'ῷ', 'ῼ', 'ff', 'fi', 'fl', 'ffi', 'ffl', 'ſt', 'st', 'ﬓ', 'ﬔ', 'ﬕ', 'ﬖ', 'ﬗ']; private const FOLD_TO = ['i̇', 'μ', 's', 'ι', 'σ', 'β', 'θ', 'φ', 'π', 'κ', 'ρ', 'ε', 'ṡ', 'ι', 'ss', 'ʼn', 'ǰ', 'ΐ', 'ΰ', 'եւ', 'ẖ', 'ẗ', 'ẘ', 'ẙ', 'aʾ', 'ss', 'ὐ', 'ὒ', 'ὔ', 'ὖ', 'ἀι', 'ἁι', 'ἂι', 'ἃι', 'ἄι', 'ἅι', 'ἆι', 'ἇι', 'ἀι', 'ἁι', 'ἂι', 'ἃι', 'ἄι', 'ἅι', 'ἆι', 'ἇι', 'ἠι', 'ἡι', 'ἢι', 'ἣι', 'ἤι', 'ἥι', 'ἦι', 'ἧι', 'ἠι', 'ἡι', 'ἢι', 'ἣι', 'ἤι', 'ἥι', 'ἦι', 'ἧι', 'ὠι', 'ὡι', 'ὢι', 'ὣι', 'ὤι', 'ὥι', 'ὦι', 'ὧι', 'ὠι', 'ὡι', 'ὢι', 'ὣι', 'ὤι', 'ὥι', 'ὦι', 'ὧι', 'ὰι', 'αι', 'άι', 'ᾶ', 'ᾶι', 'αι', 'ὴι', 'ηι', 'ήι', 'ῆ', 'ῆι', 'ηι', 'ῒ', 'ῖ', 'ῗ', 'ῢ', 'ῤ', 'ῦ', 'ῧ', 'ὼι', 'ωι', 'ώι', 'ῶ', 'ῶι', 'ωι', 'ff', 'fi', 'fl', 'ffi', 'ffl', 'st', 'st', 'մն', 'մե', 'մի', 'վն', 'մխ']; - // the subset of upper case mappings that map one code point to many code points - private const UPPER_FROM = ['ß', 'ff', 'fi', 'fl', 'ffi', 'ffl', 'ſt', 'st', 'և', 'ﬓ', 'ﬔ', 'ﬕ', 'ﬖ', 'ﬗ', 'ʼn', 'ΐ', 'ΰ', 'ǰ', 'ẖ', 'ẗ', 'ẘ', 'ẙ', 'ẚ', 'ὐ', 'ὒ', 'ὔ', 'ὖ', 'ᾶ', 'ῆ', 'ῒ', 'ΐ', 'ῖ', 'ῗ', 'ῢ', 'ΰ', 'ῤ', 'ῦ', 'ῧ', 'ῶ']; - private const UPPER_TO = ['SS', 'FF', 'FI', 'FL', 'FFI', 'FFL', 'ST', 'ST', 'ԵՒ', 'ՄՆ', 'ՄԵ', 'ՄԻ', 'ՎՆ', 'ՄԽ', 'ʼN', 'Ϊ́', 'Ϋ́', 'J̌', 'H̱', 'T̈', 'W̊', 'Y̊', 'Aʾ', 'Υ̓', 'Υ̓̀', 'Υ̓́', 'Υ̓͂', 'Α͂', 'Η͂', 'Ϊ̀', 'Ϊ́', 'Ι͂', 'Ϊ͂', 'Ϋ̀', 'Ϋ́', 'Ρ̓', 'Υ͂', 'Ϋ͂', 'Ω͂']; - // the subset of https://github.com/unicode-org/cldr/blob/master/common/transforms/Latin-ASCII.xml that is not in NFKD private const TRANSLIT_FROM = ['Æ', 'Ð', 'Ø', 'Þ', 'ß', 'æ', 'ð', 'ø', 'þ', 'Đ', 'đ', 'Ħ', 'ħ', 'ı', 'ĸ', 'Ŀ', 'ŀ', 'Ł', 'ł', 'ʼn', 'Ŋ', 'ŋ', 'Œ', 'œ', 'Ŧ', 'ŧ', 'ƀ', 'Ɓ', 'Ƃ', 'ƃ', 'Ƈ', 'ƈ', 'Ɖ', 'Ɗ', 'Ƌ', 'ƌ', 'Ɛ', 'Ƒ', 'ƒ', 'Ɠ', 'ƕ', 'Ɩ', 'Ɨ', 'Ƙ', 'ƙ', 'ƚ', 'Ɲ', 'ƞ', 'Ƣ', 'ƣ', 'Ƥ', 'ƥ', 'ƫ', 'Ƭ', 'ƭ', 'Ʈ', 'Ʋ', 'Ƴ', 'ƴ', 'Ƶ', 'ƶ', 'DŽ', 'Dž', 'dž', 'Ǥ', 'ǥ', 'ȡ', 'Ȥ', 'ȥ', 'ȴ', 'ȵ', 'ȶ', 'ȷ', 'ȸ', 'ȹ', 'Ⱥ', 'Ȼ', 'ȼ', 'Ƚ', 'Ⱦ', 'ȿ', 'ɀ', 'Ƀ', 'Ʉ', 'Ɇ', 'ɇ', 'Ɉ', 'ɉ', 'Ɍ', 'ɍ', 'Ɏ', 'ɏ', 'ɓ', 'ɕ', 'ɖ', 'ɗ', 'ɛ', 'ɟ', 'ɠ', 'ɡ', 'ɢ', 'ɦ', 'ɧ', 'ɨ', 'ɪ', 'ɫ', 'ɬ', 'ɭ', 'ɱ', 'ɲ', 'ɳ', 'ɴ', 'ɶ', 'ɼ', 'ɽ', 'ɾ', 'ʀ', 'ʂ', 'ʈ', 'ʉ', 'ʋ', 'ʏ', 'ʐ', 'ʑ', 'ʙ', 'ʛ', 'ʜ', 'ʝ', 'ʟ', 'ʠ', 'ʣ', 'ʥ', 'ʦ', 'ʪ', 'ʫ', 'ᴀ', 'ᴁ', 'ᴃ', 'ᴄ', 'ᴅ', 'ᴆ', 'ᴇ', 'ᴊ', 'ᴋ', 'ᴌ', 'ᴍ', 'ᴏ', 'ᴘ', 'ᴛ', 'ᴜ', 'ᴠ', 'ᴡ', 'ᴢ', 'ᵫ', 'ᵬ', 'ᵭ', 'ᵮ', 'ᵯ', 'ᵰ', 'ᵱ', 'ᵲ', 'ᵳ', 'ᵴ', 'ᵵ', 'ᵶ', 'ᵺ', 'ᵻ', 'ᵽ', 'ᵾ', 'ᶀ', 'ᶁ', 'ᶂ', 'ᶃ', 'ᶄ', 'ᶅ', 'ᶆ', 'ᶇ', 'ᶈ', 'ᶉ', 'ᶊ', 'ᶌ', 'ᶍ', 'ᶎ', 'ᶏ', 'ᶑ', 'ᶒ', 'ᶓ', 'ᶖ', 'ᶙ', 'ẚ', 'ẜ', 'ẝ', 'ẞ', 'Ỻ', 'ỻ', 'Ỽ', 'ỽ', 'Ỿ', 'ỿ', '©', '®', '₠', '₢', '₣', '₤', '₧', '₺', '₹', 'ℌ', '℞', '㎧', '㎮', '㏆', '㏗', '㏞', '㏟', '¼', '½', '¾', '⅓', '⅔', '⅕', '⅖', '⅗', '⅘', '⅙', '⅚', '⅛', '⅜', '⅝', '⅞', '⅟', '〇', '‘', '’', '‚', '‛', '“', '”', '„', '‟', '′', '″', '〝', '〞', '«', '»', '‹', '›', '‐', '‑', '‒', '–', '—', '―', '︱', '︲', '﹘', '‖', '⁄', '⁅', '⁆', '⁎', '、', '。', '〈', '〉', '《', '》', '〔', '〕', '〘', '〙', '〚', '〛', '︑', '︒', '︹', '︺', '︽', '︾', '︿', '﹀', '﹑', '﹝', '﹞', '⦅', '⦆', '。', '、', '×', '÷', '−', '∕', '∖', '∣', '∥', '≪', '≫', '⦅', '⦆']; private const TRANSLIT_TO = ['AE', 'D', 'O', 'TH', 'ss', 'ae', 'd', 'o', 'th', 'D', 'd', 'H', 'h', 'i', 'q', 'L', 'l', 'L', 'l', '\'n', 'N', 'n', 'OE', 'oe', 'T', 't', 'b', 'B', 'B', 'b', 'C', 'c', 'D', 'D', 'D', 'd', 'E', 'F', 'f', 'G', 'hv', 'I', 'I', 'K', 'k', 'l', 'N', 'n', 'OI', 'oi', 'P', 'p', 't', 'T', 't', 'T', 'V', 'Y', 'y', 'Z', 'z', 'DZ', 'Dz', 'dz', 'G', 'g', 'd', 'Z', 'z', 'l', 'n', 't', 'j', 'db', 'qp', 'A', 'C', 'c', 'L', 'T', 's', 'z', 'B', 'U', 'E', 'e', 'J', 'j', 'R', 'r', 'Y', 'y', 'b', 'c', 'd', 'd', 'e', 'j', 'g', 'g', 'G', 'h', 'h', 'i', 'I', 'l', 'l', 'l', 'm', 'n', 'n', 'N', 'OE', 'r', 'r', 'r', 'R', 's', 't', 'u', 'v', 'Y', 'z', 'z', 'B', 'G', 'H', 'j', 'L', 'q', 'dz', 'dz', 'ts', 'ls', 'lz', 'A', 'AE', 'B', 'C', 'D', 'D', 'E', 'J', 'K', 'L', 'M', 'O', 'P', 'T', 'U', 'V', 'W', 'Z', 'ue', 'b', 'd', 'f', 'm', 'n', 'p', 'r', 'r', 's', 't', 'z', 'th', 'I', 'p', 'U', 'b', 'd', 'f', 'g', 'k', 'l', 'm', 'n', 'p', 'r', 's', 'v', 'x', 'z', 'a', 'd', 'e', 'e', 'i', 'u', 'a', 's', 's', 'SS', 'LL', 'll', 'V', 'v', 'Y', 'y', '(C)', '(R)', 'CE', 'Cr', 'Fr.', 'L.', 'Pts', 'TL', 'Rs', 'x', 'Rx', 'm/s', 'rad/s', 'C/kg', 'pH', 'V/m', 'A/m', ' 1/4', ' 1/2', ' 3/4', ' 1/3', ' 2/3', ' 1/5', ' 2/5', ' 3/5', ' 4/5', ' 1/6', ' 5/6', ' 1/8', ' 3/8', ' 5/8', ' 7/8', ' 1/', '0', '\'', '\'', ',', '\'', '"', '"', ',,', '"', '\'', '"', '"', '"', '<<', '>>', '<', '>', '-', '-', '-', '-', '-', '-', '-', '-', '-', '||', '/', '[', ']', '*', ',', '.', '<', '>', '<<', '>>', '[', ']', '[', ']', '[', ']', ',', '.', '[', ']', '<<', '>>', '<', '>', ',', '[', ']', '((', '))', '.', ',', '*', '/', '-', '/', '\\', '|', '||', '<<', '>>', '((', '))']; - private static $transliterators = []; - private static $tableZero; - private static $tableWide; + private static array $transliterators = []; + private static array $tableZero; + private static array $tableWide; public static function fromCodePoints(int ...$codes): static { @@ -128,7 +124,7 @@ abstract class AbstractUnicodeString extends AbstractString } if (null === $transliterator) { - throw new InvalidArgumentException(sprintf('Unknown transliteration rule "%s".', $rule)); + throw new InvalidArgumentException(\sprintf('Unknown transliteration rule "%s".', $rule)); } self::$transliterators['any-latin/bgn'] = $transliterator; @@ -139,15 +135,21 @@ abstract class AbstractUnicodeString extends AbstractString } elseif (!\function_exists('iconv')) { $s = preg_replace('/[^\x00-\x7F]/u', '?', $s); } else { - $s = @preg_replace_callback('/[^\x00-\x7F]/u', static function ($c) { - $c = (string) iconv('UTF-8', 'ASCII//TRANSLIT', $c[0]); + $previousLocale = setlocale(\LC_CTYPE, 0); + try { + setlocale(\LC_CTYPE, 'C'); + $s = @preg_replace_callback('/[^\x00-\x7F]/u', static function ($c) { + $c = (string) iconv('UTF-8', 'ASCII//TRANSLIT', $c[0]); - if ('' === $c && '' === iconv('UTF-8', 'ASCII//TRANSLIT', '²')) { - throw new \LogicException(sprintf('"%s" requires a translit-able iconv implementation, try installing "gnu-libiconv" if you\'re using Alpine Linux.', static::class)); - } + if ('' === $c && '' === iconv('UTF-8', 'ASCII//TRANSLIT', '²')) { + throw new \LogicException(\sprintf('"%s" requires a translit-able iconv implementation, try installing "gnu-libiconv" if you\'re using Alpine Linux.', static::class)); + } - return 1 < \strlen($c) ? ltrim($c, '\'`"^~') : ('' !== $c ? $c : '?'); - }, $s); + return 1 < \strlen($c) ? ltrim($c, '\'`"^~') : ('' !== $c ? $c : '?'); + }, $s); + } finally { + setlocale(\LC_CTYPE, $previousLocale); + } } } @@ -159,7 +161,9 @@ abstract class AbstractUnicodeString extends AbstractString public function camel(): static { $str = clone $this; - $str->string = str_replace(' ', '', preg_replace_callback('/\b.(?![A-Z]{2,})/u', static function ($m) use (&$i) { + $str->string = str_replace(' ', '', preg_replace_callback('/\b.(?!\p{Lu})/u', static function ($m) { + static $i = 0; + return 1 === ++$i ? ('İ' === $m[0] ? 'i̇' : mb_strtolower($m[0], 'UTF-8')) : mb_convert_case($m[0], \MB_CASE_TITLE, 'UTF-8'); }, preg_replace('/[^\pL0-9]++/u', ' ', $this->string))); @@ -192,7 +196,7 @@ abstract class AbstractUnicodeString extends AbstractString if (!$compat || !\defined('Normalizer::NFKC_CF')) { $str->string = normalizer_normalize($str->string, $compat ? \Normalizer::NFKC : \Normalizer::NFC); - $str->string = mb_strtolower(str_replace(self::FOLD_FROM, self::FOLD_TO, $this->string), 'UTF-8'); + $str->string = mb_strtolower(str_replace(self::FOLD_FROM, self::FOLD_TO, $str->string), 'UTF-8'); } else { $str->string = normalizer_normalize($str->string, \Normalizer::NFKC_CF); } @@ -200,7 +204,7 @@ abstract class AbstractUnicodeString extends AbstractString return $str; } - public function join(array $strings, string $lastGlue = null): static + public function join(array $strings, ?string $lastGlue = null): static { $str = clone $this; @@ -222,6 +226,21 @@ abstract class AbstractUnicodeString extends AbstractString return $str; } + /** + * @param string $locale In the format language_region (e.g. tr_TR) + */ + public function localeLower(string $locale): static + { + if (null !== $transliterator = $this->getLocaleTransliterator($locale, 'Lower')) { + $str = clone $this; + $str->string = $transliterator->transliterate($str->string); + + return $str; + } + + return $this->lower(); + } + public function match(string $regexp, int $flags = 0, int $offset = 0): array { $match = ((\PREG_PATTERN_ORDER | \PREG_SET_ORDER) & $flags) ? 'preg_match_all' : 'preg_match'; @@ -230,7 +249,7 @@ abstract class AbstractUnicodeString extends AbstractString $regexp .= 'i'; } - set_error_handler(static function ($t, $m) { throw new InvalidArgumentException($m); }); + set_error_handler(static fn ($t, $m) => throw new InvalidArgumentException($m)); try { if (false === $match($regexp.'u', $this->string, $matches, $flags | \PREG_UNMATCHED_AS_NULL, $offset)) { @@ -245,7 +264,7 @@ abstract class AbstractUnicodeString extends AbstractString public function normalize(int $form = self::NFC): static { - if (!\in_array($form, [self::NFC, self::NFD, self::NFKC, self::NFKD])) { + if (!\in_array($form, [self::NFC, self::NFD, self::NFKC, self::NFKD], true)) { throw new InvalidArgumentException('Unsupported normalization form.'); } @@ -314,7 +333,7 @@ abstract class AbstractUnicodeString extends AbstractString $replace = 'preg_replace'; } - set_error_handler(static function ($t, $m) { throw new InvalidArgumentException($m); }); + set_error_handler(static fn ($t, $m) => throw new InvalidArgumentException($m)); try { if (null === $string = $replace($fromRegexp.'u', $to, $this->string)) { @@ -341,7 +360,7 @@ abstract class AbstractUnicodeString extends AbstractString public function reverse(): static { $str = clone $this; - $str->string = implode('', array_reverse(preg_split('/(\X)/u', $str->string, -1, \PREG_SPLIT_DELIM_CAPTURE | \PREG_SPLIT_NO_EMPTY))); + $str->string = implode('', array_reverse(grapheme_str_split($str->string))); return $str; } @@ -360,13 +379,26 @@ abstract class AbstractUnicodeString extends AbstractString $limit = $allWords ? -1 : 1; - $str->string = preg_replace_callback('/\b./u', static function (array $m): string { - return mb_convert_case($m[0], \MB_CASE_TITLE, 'UTF-8'); - }, $str->string, $limit); + $str->string = preg_replace_callback('/\b./u', static fn (array $m): string => mb_convert_case($m[0], \MB_CASE_TITLE, 'UTF-8'), $str->string, $limit); return $str; } + /** + * @param string $locale In the format language_region (e.g. tr_TR) + */ + public function localeTitle(string $locale): static + { + if (null !== $transliterator = $this->getLocaleTransliterator($locale, 'Title')) { + $str = clone $this; + $str->string = $transliterator->transliterate($str->string); + + return $str; + } + + return $this->title(); + } + public function trim(string $chars = " \t\n\r\0\x0B\x0C\u{A0}\u{FEFF}"): static { if (" \t\n\r\0\x0B\x0C\u{A0}\u{FEFF}" !== $chars && !preg_match('//u', $chars)) { @@ -454,6 +486,21 @@ abstract class AbstractUnicodeString extends AbstractString return $str; } + /** + * @param string $locale In the format language_region (e.g. tr_TR) + */ + public function localeUpper(string $locale): static + { + if (null !== $transliterator = $this->getLocaleTransliterator($locale, 'Upper')) { + $str = clone $this; + $str->string = $transliterator->transliterate($str->string); + + return $str; + } + + return $this->upper(); + } + public function width(bool $ignoreAnsiDecoration = true): int { $width = 0; @@ -528,6 +575,8 @@ abstract class AbstractUnicodeString extends AbstractString private function wcswidth(string $string): int { $width = 0; + $lastChar = null; + $lastWidth = null; foreach (preg_split('//u', $string, -1, \PREG_SPLIT_NO_EMPTY) as $c) { $codePoint = mb_ord($c, 'UTF-8'); @@ -550,6 +599,20 @@ abstract class AbstractUnicodeString extends AbstractString return -1; } + if (0xFE0F === $codePoint) { + if (\PCRE_VERSION_MAJOR < 10 || \PCRE_VERSION_MAJOR === 10 && \PCRE_VERSION_MINOR < 40) { + $regex = '/\p{So}/u'; + } else { + $regex = '/\p{Emoji}/u'; + } + if (null !== $lastChar && 1 === $lastWidth && preg_match($regex, $lastChar)) { + ++$width; + $lastWidth = 2; + } + + continue; + } + self::$tableZero ??= require __DIR__.'/Resources/data/wcswidth_table_zero.php'; if ($codePoint >= self::$tableZero[0][0] && $codePoint <= self::$tableZero[$ubound = \count(self::$tableZero) - 1][1]) { @@ -580,6 +643,8 @@ abstract class AbstractUnicodeString extends AbstractString $ubound = $mid - 1; } else { $width += 2; + $lastChar = $c; + $lastWidth = 2; continue 2; } @@ -587,8 +652,39 @@ abstract class AbstractUnicodeString extends AbstractString } ++$width; + $lastChar = $c; + $lastWidth = 1; } return $width; } + + private function getLocaleTransliterator(string $locale, string $id): ?\Transliterator + { + $rule = $locale.'-'.$id; + if (\array_key_exists($rule, self::$transliterators)) { + return self::$transliterators[$rule]; + } + + if (null !== $transliterator = self::$transliterators[$rule] = \Transliterator::create($rule)) { + return $transliterator; + } + + // Try to find a parent locale (nl_BE -> nl) + if (false === $i = strpos($locale, '_')) { + return null; + } + + $parentRule = substr_replace($locale, '-'.$id, $i); + + // Parent locale was already cached, return and store as current locale + if (\array_key_exists($parentRule, self::$transliterators)) { + return self::$transliterators[$rule] = self::$transliterators[$parentRule]; + } + + // Create transliterator based on parent locale and cache the result on both initial and parent locale values + $transliterator = \Transliterator::create($parentRule); + + return self::$transliterators[$rule] = self::$transliterators[$parentRule] = $transliterator; + } } diff --git a/vendor/symfony/string/ByteString.php b/vendor/symfony/string/ByteString.php index 212290fe..bd721fc4 100644 --- a/vendor/symfony/string/ByteString.php +++ b/vendor/symfony/string/ByteString.php @@ -11,6 +11,7 @@ namespace Symfony\Component\String; +use Random\Randomizer; use Symfony\Component\String\Exception\ExceptionInterface; use Symfony\Component\String\Exception\InvalidArgumentException; use Symfony\Component\String\Exception\RuntimeException; @@ -42,10 +43,10 @@ class ByteString extends AbstractString * Copyright (c) 2004-2020, Facebook, Inc. (https://www.facebook.com/) */ - public static function fromRandom(int $length = 16, string $alphabet = null): self + public static function fromRandom(int $length = 16, ?string $alphabet = null): self { if ($length <= 0) { - throw new InvalidArgumentException(sprintf('A strictly positive length is expected, "%d" given.', $length)); + throw new InvalidArgumentException(\sprintf('A strictly positive length is expected, "%d" given.', $length)); } $alphabet ??= self::ALPHABET_ALPHANUMERIC; @@ -55,6 +56,10 @@ class ByteString extends AbstractString throw new InvalidArgumentException('The length of the alphabet must in the [2^1, 2^56] range.'); } + if (\PHP_VERSION_ID >= 80300) { + return new static((new Randomizer())->getBytesFromString($alphabet, $length)); + } + $ret = ''; while ($length > 0) { $urandomLength = (int) ceil(2 * $length * $bits / 8.0); @@ -178,7 +183,11 @@ class ByteString extends AbstractString return null; } - $i = $this->ignoreCase ? stripos($this->string, $needle, $offset) : strpos($this->string, $needle, $offset); + try { + $i = $this->ignoreCase ? stripos($this->string, $needle, $offset) : strpos($this->string, $needle, $offset); + } catch (\ValueError) { + return null; + } return false === $i ? null : $i; } @@ -195,7 +204,11 @@ class ByteString extends AbstractString return null; } - $i = $this->ignoreCase ? strripos($this->string, $needle, $offset) : strrpos($this->string, $needle, $offset); + try { + $i = $this->ignoreCase ? strripos($this->string, $needle, $offset) : strrpos($this->string, $needle, $offset); + } catch (\ValueError) { + return null; + } return false === $i ? null : $i; } @@ -205,7 +218,7 @@ class ByteString extends AbstractString return '' === $this->string || preg_match('//u', $this->string); } - public function join(array $strings, string $lastGlue = null): static + public function join(array $strings, ?string $lastGlue = null): static { $str = clone $this; @@ -236,7 +249,7 @@ class ByteString extends AbstractString $regexp .= 'i'; } - set_error_handler(static function ($t, $m) { throw new InvalidArgumentException($m); }); + set_error_handler(static fn ($t, $m) => throw new InvalidArgumentException($m)); try { if (false === $match($regexp, $this->string, $matches, $flags | \PREG_UNMATCHED_AS_NULL, $offset)) { @@ -300,7 +313,7 @@ class ByteString extends AbstractString $replace = \is_array($to) || $to instanceof \Closure ? 'preg_replace_callback' : 'preg_replace'; - set_error_handler(static function ($t, $m) { throw new InvalidArgumentException($m); }); + set_error_handler(static fn ($t, $m) => throw new InvalidArgumentException($m)); try { if (null === $string = $replace($fromRegexp, $to, $this->string)) { @@ -332,10 +345,10 @@ class ByteString extends AbstractString return $str; } - public function slice(int $start = 0, int $length = null): static + public function slice(int $start = 0, ?int $length = null): static { $str = clone $this; - $str->string = (string) substr($this->string, $start, $length ?? \PHP_INT_MAX); + $str->string = substr($this->string, $start, $length ?? \PHP_INT_MAX); return $str; } @@ -348,7 +361,7 @@ class ByteString extends AbstractString return $str; } - public function splice(string $replacement, int $start = 0, int $length = null): static + public function splice(string $replacement, int $start = 0, ?int $length = null): static { $str = clone $this; $str->string = substr_replace($this->string, $replacement, $start, $length ?? \PHP_INT_MAX); @@ -356,7 +369,7 @@ class ByteString extends AbstractString return $str; } - public function split(string $delimiter, int $limit = null, int $flags = null): array + public function split(string $delimiter, ?int $limit = null, ?int $flags = null): array { if (1 > $limit ??= \PHP_INT_MAX) { throw new InvalidArgumentException('Split limit must be a positive integer.'); @@ -402,12 +415,12 @@ class ByteString extends AbstractString return $str; } - public function toUnicodeString(string $fromEncoding = null): UnicodeString + public function toUnicodeString(?string $fromEncoding = null): UnicodeString { return new UnicodeString($this->toCodePointString($fromEncoding)->string); } - public function toCodePointString(string $fromEncoding = null): CodePointString + public function toCodePointString(?string $fromEncoding = null): CodePointString { $u = new CodePointString(); @@ -417,7 +430,7 @@ class ByteString extends AbstractString return $u; } - set_error_handler(static function ($t, $m) { throw new InvalidArgumentException($m); }); + set_error_handler(static fn ($t, $m) => throw new InvalidArgumentException($m)); try { try { @@ -436,7 +449,7 @@ class ByteString extends AbstractString } if (!$validEncoding) { - throw new InvalidArgumentException(sprintf('Invalid "%s" string.', $fromEncoding ?? 'Windows-1252')); + throw new InvalidArgumentException(\sprintf('Invalid "%s" string.', $fromEncoding ?? 'Windows-1252')); } $u->string = mb_convert_encoding($this->string, 'UTF-8', $fromEncoding ?? 'Windows-1252'); diff --git a/vendor/symfony/string/CHANGELOG.md b/vendor/symfony/string/CHANGELOG.md index 31a3b54d..d5569bea 100644 --- a/vendor/symfony/string/CHANGELOG.md +++ b/vendor/symfony/string/CHANGELOG.md @@ -1,6 +1,27 @@ CHANGELOG ========= +7.4 +--- + + * Deprecate implementing `__sleep/wakeup()` on string implementations + +7.3 +--- + + * Add the `AbstractString::pascal()` method + +7.2 +--- + + * Add `TruncateMode` enum to handle more truncate methods + * Add the `AbstractString::kebab()` method + +7.1 +--- + + * Add `localeLower()`, `localeUpper()`, `localeTitle()` methods to `AbstractUnicodeString` + 6.2 --- @@ -29,7 +50,7 @@ CHANGELOG * added `LazyString` which provides memoizing stringable objects * The component is not marked as `@experimental` anymore * added the `s()` helper method to get either an `UnicodeString` or `ByteString` instance, - depending of the input string UTF-8 compliancy + depending of the input string UTF-8 compliance * added `$cut` parameter to `Symfony\Component\String\AbstractString::truncate()` * added `AbstractString::containsAny()` * allow passing a string of custom characters to `ByteString::fromRandom()` diff --git a/vendor/symfony/string/CodePointString.php b/vendor/symfony/string/CodePointString.php index f5c900fb..f699168e 100644 --- a/vendor/symfony/string/CodePointString.php +++ b/vendor/symfony/string/CodePointString.php @@ -126,7 +126,11 @@ class CodePointString extends AbstractUnicodeString return null; } - $i = $this->ignoreCase ? mb_stripos($this->string, $needle, $offset, 'UTF-8') : mb_strpos($this->string, $needle, $offset, 'UTF-8'); + try { + $i = $this->ignoreCase ? mb_stripos($this->string, $needle, $offset, 'UTF-8') : mb_strpos($this->string, $needle, $offset, 'UTF-8'); + } catch (\ValueError) { + return null; + } return false === $i ? null : $i; } @@ -143,7 +147,11 @@ class CodePointString extends AbstractUnicodeString return null; } - $i = $this->ignoreCase ? mb_strripos($this->string, $needle, $offset, 'UTF-8') : mb_strrpos($this->string, $needle, $offset, 'UTF-8'); + try { + $i = $this->ignoreCase ? mb_strripos($this->string, $needle, $offset, 'UTF-8') : mb_strrpos($this->string, $needle, $offset, 'UTF-8'); + } catch (\ValueError) { + return null; + } return false === $i ? null : $i; } @@ -186,7 +194,7 @@ class CodePointString extends AbstractUnicodeString return $str; } - public function slice(int $start = 0, int $length = null): static + public function slice(int $start = 0, ?int $length = null): static { $str = clone $this; $str->string = mb_substr($this->string, $start, $length, 'UTF-8'); @@ -194,7 +202,7 @@ class CodePointString extends AbstractUnicodeString return $str; } - public function splice(string $replacement, int $start = 0, int $length = null): static + public function splice(string $replacement, int $start = 0, ?int $length = null): static { if (!preg_match('//u', $replacement)) { throw new InvalidArgumentException('Invalid UTF-8 string.'); @@ -202,13 +210,13 @@ class CodePointString extends AbstractUnicodeString $str = clone $this; $start = $start ? \strlen(mb_substr($this->string, 0, $start, 'UTF-8')) : 0; - $length = $length ? \strlen(mb_substr($this->string, $start, $length, 'UTF-8')) : $length; + $length = $length ? \strlen(mb_substr(substr($this->string, $start), 0, $length, 'UTF-8')) : $length; $str->string = substr_replace($this->string, $replacement, $start, $length ?? \PHP_INT_MAX); return $str; } - public function split(string $delimiter, int $limit = null, int $flags = null): array + public function split(string $delimiter, ?int $limit = null, ?int $flags = null): array { if (1 > $limit ??= \PHP_INT_MAX) { throw new InvalidArgumentException('Split limit must be a positive integer.'); diff --git a/vendor/symfony/string/Inflector/EnglishInflector.php b/vendor/symfony/string/Inflector/EnglishInflector.php index 4474736a..9c82ccee 100644 --- a/vendor/symfony/string/Inflector/EnglishInflector.php +++ b/vendor/symfony/string/Inflector/EnglishInflector.php @@ -21,12 +21,52 @@ final class EnglishInflector implements InflectorInterface private const PLURAL_MAP = [ // First entry: plural suffix, reversed // Second entry: length of plural suffix - // Third entry: Whether the suffix may succeed a vocal + // Third entry: Whether the suffix may succeed a vowel // Fourth entry: Whether the suffix may succeed a consonant // Fifth entry: singular suffix, normal - // bacteria (bacterium), criteria (criterion), phenomena (phenomenon) - ['a', 1, true, true, ['on', 'um']], + // insignias (insigne), insignia (insigne) + ['saingisni', 9, true, true, 'insigne'], + ['aingisni', 8, true, true, 'insigne'], + + // passersby (passerby) + ['ybsressap', 9, true, true, 'passerby'], + + // nodes (node) + ['sedon', 5, true, true, 'node'], + + // bacteria (bacterium) + ['airetcab', 8, true, true, 'bacterium'], + + // issues (issue) + ['seussi', 6, true, true, 'issue'], + + // corpora (corpus) + ['aroproc', 7, true, true, 'corpus'], + + // criteria (criterion) + ['airetirc', 8, true, true, 'criterion'], + + // curricula (curriculum) + ['alucirruc', 9, true, true, 'curriculum'], + + // quora (quorum) + ['arouq', 5, true, true, 'quorum'], + + // genera (genus) + ['areneg', 6, true, true, 'genus'], + + // media (medium) + ['aidem', 5, true, true, 'medium'], + + // memoranda (memorandum) + ['adnaromem', 9, true, true, 'memorandum'], + + // phenomena (phenomenon) + ['anemonehp', 9, true, true, 'phenomenon'], + + // strata (stratum) + ['atarts', 6, true, true, 'stratum'], // nebulae (nebula) ['ea', 2, true, true, 'a'], @@ -55,6 +95,9 @@ final class EnglishInflector implements InflectorInterface // indices (index), appendices (appendix), prices (price) ['seci', 4, false, true, ['ex', 'ix', 'ice']], + // codes (code) + ['sedoc', 5, false, true, 'code'], + // selfies (selfie) ['seifles', 7, true, true, 'selfie'], @@ -64,6 +107,9 @@ final class EnglishInflector implements InflectorInterface // movies (movie) ['seivom', 6, true, true, 'movie'], + // names (name) + ['seman', 5, true, false, 'name'], + // conspectuses (conspectus), prospectuses (prospectus) ['sesutcep', 8, true, true, 'pectus'], @@ -88,6 +134,12 @@ final class EnglishInflector implements InflectorInterface // accesses (access), addresses (address), kisses (kiss) ['sess', 4, true, false, 'ss'], + // statuses (status) + ['sesutats', 8, true, true, 'status'], + + // article (articles), ancle (ancles) + ['sel', 3, true, true, 'le'], + // analyses (analysis), ellipses (ellipsis), fungi (fungus), // neuroses (neurosis), theses (thesis), emphases (emphasis), // oases (oasis), crises (crisis), houses (house), bases (base), @@ -127,11 +179,20 @@ final class EnglishInflector implements InflectorInterface // edges (edge) ['segd', 4, true, true, 'dge'], + // outages (outage) - specific fix to avoid 'outag' + ['segatuo', 7, true, true, 'outage'], + + // traces (trace), faces (face), places (place), pieces (piece) + ['sec', 3, true, true, 'ce'], + // roses (rose), garages (garage), cassettes (cassette), // waltzes (waltz), heroes (hero), bushes (bush), arches (arch), // shoes (shoe) ['se', 2, true, true, ['', 'e']], + // status (status) + ['sutats', 6, true, true, 'status'], + // tags (tag) ['s', 1, true, true, ''], @@ -150,10 +211,22 @@ final class EnglishInflector implements InflectorInterface private const SINGULAR_MAP = [ // First entry: singular suffix, reversed // Second entry: length of singular suffix - // Third entry: Whether the suffix may succeed a vocal + // Third entry: Whether the suffix may succeed a vowel // Fourth entry: Whether the suffix may succeed a consonant // Fifth entry: plural suffix, normal + // passerby (passersby) + ['ybressap', 8, true, true, 'passersby'], + + // insigne (insignia, insignias) + ['engisni', 7, true, true, ['insignia', 'insignias']], + + // nodes (node) + ['edon', 4, true, true, 'nodes'], + + // axes (axis) + ['sixa', 4, false, false, 'axes'], + // criterion (criteria) ['airetirc', 8, false, false, 'criterion'], @@ -223,7 +296,13 @@ final class EnglishInflector implements InflectorInterface // teeth (tooth) ['htoot', 5, true, true, 'teeth'], - // bacteria (bacterium), criteria (criterion), phenomena (phenomenon) + // albums (album) + ['mubla', 5, true, true, 'albums'], + + // quorums (quorum) + ['murouq', 6, true, true, ['quora', 'quorums']], + + // bacteria (bacterium), curricula (curriculum), media (medium), memoranda (memorandum), phenomena (phenomenon), strata (stratum) ['mu', 2, true, true, 'a'], // men (man), women (woman) @@ -232,17 +311,11 @@ final class EnglishInflector implements InflectorInterface // people (person) ['nosrep', 6, true, true, ['persons', 'people']], - // bacteria (bacterium), criteria (criterion), phenomena (phenomenon) - ['noi', 3, true, true, 'ions'], + // criteria (criterion) + ['noiretirc', 9, true, true, 'criteria'], - // coupon (coupons) - ['nop', 3, true, true, 'pons'], - - // seasons (season), treasons (treason), poisons (poison), lessons (lesson) - ['nos', 3, true, true, 'sons'], - - // bacteria (bacterium), criteria (criterion), phenomena (phenomenon) - ['no', 2, true, true, 'a'], + // phenomena (phenomenon) + ['nonemonehp', 10, true, true, 'phenomena'], // echoes (echo) ['ohce', 4, true, true, 'echoes'], @@ -253,6 +326,9 @@ final class EnglishInflector implements InflectorInterface // atlases (atlas) ['salta', 5, true, true, 'atlases'], + // aliases (alias) + ['saila', 5, true, true, 'aliases'], + // irises (iris) ['siri', 4, true, true, 'irises'], @@ -273,9 +349,21 @@ final class EnglishInflector implements InflectorInterface // circuses (circus) ['suc', 3, true, true, 'cuses'], + // hippocampi (hippocampus) + ['supmacoppih', 11, false, false, 'hippocampi'], + + // campuses (campus) + ['sup', 3, true, true, 'puses'], + + // status (status) + ['sutats', 6, true, true, ['status', 'statuses']], + // conspectuses (conspectus), prospectuses (prospectus) ['sutcep', 6, true, true, 'pectuses'], + // nexuses (nexus) + ['suxen', 5, false, false, 'nexuses'], + // fungi (fungus), alumni (alumnus), syllabi (syllabus), radii (radius) ['su', 2, true, true, 'i'], @@ -297,14 +385,14 @@ final class EnglishInflector implements InflectorInterface // indices (index) ['xedni', 5, false, true, ['indicies', 'indexes']], + // fax (faxes, faxxes) + ['xaf', 3, true, true, ['faxes', 'faxxes']], + // boxes (box) ['xo', 2, false, true, 'oxes'], - // indexes (index), matrixes (matrix) - ['x', 1, true, false, ['cies', 'xes']], - - // appendices (appendix) - ['xi', 2, false, true, 'ices'], + // indexes (index), matrixes (matrix), appendices (appendix) + ['x', 1, true, false, ['ces', 'xes']], // babies (baby) ['y', 1, false, true, 'ies'], @@ -328,15 +416,30 @@ final class EnglishInflector implements InflectorInterface // deer 'reed', + // equipment + 'tnempiuqe', + // feedback 'kcabdeef', // fish 'hsif', + // health + 'htlaeh', + + // history + 'yrotsih', + // info 'ofni', + // information + 'noitamrofni', + + // money + 'yenom', + // moose 'esoom', @@ -348,6 +451,15 @@ final class EnglishInflector implements InflectorInterface // species 'seiceps', + + // traffic + 'ciffart', + + // aircraft + 'tfarcria', + + // hardware + 'erawdrah', ]; public function singularize(string $plural): array @@ -381,14 +493,14 @@ final class EnglishInflector implements InflectorInterface if ($j === $suffixLength) { // Is there any character preceding the suffix in the plural string? if ($j < $pluralLength) { - $nextIsVocal = str_contains('aeiou', $lowerPluralRev[$j]); + $nextIsVowel = str_contains('aeiou', $lowerPluralRev[$j]); - if (!$map[2] && $nextIsVocal) { - // suffix may not succeed a vocal but next char is one + if (!$map[2] && $nextIsVowel) { + // suffix may not succeed a vowel but next char is one break; } - if (!$map[3] && !$nextIsVocal) { + if (!$map[3] && !$nextIsVowel) { // suffix may not succeed a consonant but next char is one break; } @@ -458,14 +570,14 @@ final class EnglishInflector implements InflectorInterface if ($j === $suffixLength) { // Is there any character preceding the suffix in the plural string? if ($j < $singularLength) { - $nextIsVocal = str_contains('aeiou', $lowerSingularRev[$j]); + $nextIsVowel = str_contains('aeiou', $lowerSingularRev[$j]); - if (!$map[2] && $nextIsVocal) { - // suffix may not succeed a vocal but next char is one + if (!$map[2] && $nextIsVowel) { + // suffix may not succeed a vowel but next char is one break; } - if (!$map[3] && !$nextIsVocal) { + if (!$map[3] && !$nextIsVowel) { // suffix may not succeed a consonant but next char is one break; } diff --git a/vendor/symfony/string/LazyString.php b/vendor/symfony/string/LazyString.php index 9523b8cd..c7a354c0 100644 --- a/vendor/symfony/string/LazyString.php +++ b/vendor/symfony/string/LazyString.php @@ -26,18 +26,20 @@ class LazyString implements \Stringable, \JsonSerializable public static function fromCallable(callable|array $callback, mixed ...$arguments): static { if (\is_array($callback) && !\is_callable($callback) && !(($callback[0] ?? null) instanceof \Closure || 2 < \count($callback))) { - throw new \TypeError(sprintf('Argument 1 passed to "%s()" must be a callable or a [Closure, method] lazy-callable, "%s" given.', __METHOD__, '['.implode(', ', array_map('get_debug_type', $callback)).']')); + throw new \TypeError(\sprintf('Argument 1 passed to "%s()" must be a callable or a [Closure, method] lazy-callable, "%s" given.', __METHOD__, '['.implode(', ', array_map('get_debug_type', $callback)).']')); } $lazyString = new static(); - $lazyString->value = static function () use (&$callback, &$arguments, &$value): string { + $lazyString->value = static function () use (&$callback, &$arguments): string { + static $value; + if (null !== $arguments) { if (!\is_callable($callback)) { $callback[0] = $callback[0](); $callback[1] ??= '__invoke'; } $value = $callback(...$arguments); - $callback = self::getPrettyName($callback); + $callback = !\is_scalar($value) && !$value instanceof \Stringable ? self::getPrettyName($callback) : 'callable'; $arguments = null; } @@ -92,15 +94,44 @@ class LazyString implements \Stringable, \JsonSerializable $r = new \ReflectionFunction($this->value); $callback = $r->getStaticVariables()['callback']; - $e = new \TypeError(sprintf('Return value of %s() passed to %s::fromCallable() must be of the type string, %s returned.', $callback, static::class, $type)); + $e = new \TypeError(\sprintf('Return value of %s() passed to %s::fromCallable() must be of the type string, %s returned.', $callback, static::class, $type)); } throw $e; } } + public function __serialize(): array + { + if (self::class === (new \ReflectionMethod($this, '__sleep'))->class || self::class !== (new \ReflectionMethod($this, '__serialize'))->class) { + $this->__toString(); + + return ['value' => $this->value]; + } + + trigger_deprecation('symfony/string', '7.4', 'Implementing "%s::__sleep()" is deprecated, use "__serialize()" instead.', get_debug_type($this)); + + $data = []; + foreach ($this->__sleep() as $key) { + try { + if (($r = new \ReflectionProperty($this, $key))->isInitialized($this)) { + $data[$key] = $r->getValue($this); + } + } catch (\ReflectionException) { + $data[$key] = $this->$key; + } + } + + return $data; + } + + /** + * @deprecated since Symfony 7.4, will be replaced by `__serialize()` in 8.0 + */ public function __sleep(): array { + trigger_deprecation('symfony/string', '7.4', 'Calling "%s::__sleep()" is deprecated, use "__serialize()" instead.', get_debug_type($this)); + $this->__toString(); return ['value']; @@ -127,7 +158,7 @@ class LazyString implements \Stringable, \JsonSerializable } elseif ($callback instanceof \Closure) { $r = new \ReflectionFunction($callback); - if (str_contains($r->name, '{closure}') || !$class = \PHP_VERSION_ID >= 80111 ? $r->getClosureCalledClass() : $r->getClosureScopeClass()) { + if ($r->isAnonymous() || !$class = $r->getClosureCalledClass()) { return $r->name; } diff --git a/vendor/symfony/string/Resources/data/wcswidth_table_wide.php b/vendor/symfony/string/Resources/data/wcswidth_table_wide.php index 5a647e67..6a750942 100644 --- a/vendor/symfony/string/Resources/data/wcswidth_table_wide.php +++ b/vendor/symfony/string/Resources/data/wcswidth_table_wide.php @@ -3,8 +3,8 @@ /* * This file has been auto-generated by the Symfony String Component for internal use. * - * Unicode version: 15.0.0 - * Date: 2022-10-05T17:16:36+02:00 + * Unicode version: 16.0.0 + * Date: 2024-09-11T08:21:22+00:00 */ return [ @@ -44,6 +44,10 @@ return [ 9748, 9749, ], + [ + 9776, + 9783, + ], [ 9800, 9811, @@ -52,6 +56,10 @@ return [ 9855, 9855, ], + [ + 9866, + 9871, + ], [ 9875, 9875, @@ -166,7 +174,7 @@ return [ ], [ 12272, - 12283, + 12287, ], [ 12288, @@ -394,7 +402,11 @@ return [ ], [ 12736, - 12771, + 12773, + ], + [ + 12783, + 12783, ], [ 12784, @@ -448,6 +460,10 @@ return [ 13312, 19903, ], + [ + 19904, + 19967, + ], [ 19968, 40959, @@ -832,6 +848,10 @@ return [ 101120, 101589, ], + [ + 101631, + 101631, + ], [ 101632, 101640, @@ -876,6 +896,14 @@ return [ 110960, 111355, ], + [ + 119552, + 119638, + ], + [ + 119648, + 119670, + ], [ 126980, 126980, @@ -1050,23 +1078,19 @@ return [ ], [ 129664, - 129672, + 129673, ], [ - 129680, - 129725, - ], - [ - 129727, - 129733, + 129679, + 129734, ], [ 129742, - 129755, + 129756, ], [ - 129760, - 129768, + 129759, + 129769, ], [ 129776, @@ -1110,6 +1134,14 @@ return [ ], [ 191457, + 191471, + ], + [ + 191472, + 192093, + ], + [ + 192094, 194559, ], [ diff --git a/vendor/symfony/string/Resources/data/wcswidth_table_zero.php b/vendor/symfony/string/Resources/data/wcswidth_table_zero.php index 9ae73303..fdd7f3c7 100644 --- a/vendor/symfony/string/Resources/data/wcswidth_table_zero.php +++ b/vendor/symfony/string/Resources/data/wcswidth_table_zero.php @@ -3,8 +3,8 @@ /* * This file has been auto-generated by the Symfony String Component for internal use. * - * Unicode version: 15.0.0 - * Date: 2022-10-05T17:16:37+02:00 + * Unicode version: 16.0.0 + * Date: 2024-09-11T08:21:22+00:00 */ return [ @@ -109,7 +109,7 @@ return [ 2139, ], [ - 2200, + 2199, 2207, ], [ @@ -916,12 +916,16 @@ return [ 68900, 68903, ], + [ + 68969, + 68973, + ], [ 69291, 69292, ], [ - 69373, + 69372, 69375, ], [ @@ -1044,6 +1048,26 @@ return [ 70512, 70516, ], + [ + 70587, + 70592, + ], + [ + 70606, + 70606, + ], + [ + 70608, + 70608, + ], + [ + 70610, + 70610, + ], + [ + 70625, + 70626, + ], [ 70712, 70719, @@ -1122,6 +1146,10 @@ return [ ], [ 71453, + 71453, + ], + [ + 71455, 71455, ], [ @@ -1276,6 +1304,10 @@ return [ 73538, 73538, ], + [ + 73562, + 73562, + ], [ 78912, 78912, @@ -1284,6 +1316,14 @@ return [ 78919, 78933, ], + [ + 90398, + 90409, + ], + [ + 90413, + 90415, + ], [ 92912, 92916, @@ -1400,6 +1440,10 @@ return [ 124140, 124143, ], + [ + 124398, + 124399, + ], [ 125136, 125142, diff --git a/vendor/symfony/string/Slugger/AsciiSlugger.php b/vendor/symfony/string/Slugger/AsciiSlugger.php index 826d07ca..689a4047 100644 --- a/vendor/symfony/string/Slugger/AsciiSlugger.php +++ b/vendor/symfony/string/Slugger/AsciiSlugger.php @@ -11,7 +11,7 @@ namespace Symfony\Component\String\Slugger; -use Symfony\Component\Intl\Transliterator\EmojiTransliterator; +use Symfony\Component\Emoji\EmojiTransliterator; use Symfony\Component\String\AbstractUnicodeString; use Symfony\Component\String\UnicodeString; use Symfony\Contracts\Translation\LocaleAwareInterface; @@ -55,7 +55,6 @@ class AsciiSlugger implements SluggerInterface, LocaleAwareInterface 'zh' => 'Han-Latin', ]; - private ?string $defaultLocale; private \Closure|array $symbolsMap = [ 'en' => ['@' => 'at', '&' => 'and'], ]; @@ -68,20 +67,21 @@ class AsciiSlugger implements SluggerInterface, LocaleAwareInterface */ private array $transliterators = []; - public function __construct(string $defaultLocale = null, array|\Closure $symbolsMap = null) - { - $this->defaultLocale = $defaultLocale; + public function __construct( + private ?string $defaultLocale = null, + array|\Closure|null $symbolsMap = null, + ) { $this->symbolsMap = $symbolsMap ?? $this->symbolsMap; } - public function setLocale(string $locale) + public function setLocale(string $locale): void { $this->defaultLocale = $locale; } public function getLocale(): string { - return $this->defaultLocale; + return $this->defaultLocale ?? ''; } /** @@ -92,7 +92,7 @@ class AsciiSlugger implements SluggerInterface, LocaleAwareInterface public function withEmoji(bool|string $emoji = true): static { if (false !== $emoji && !class_exists(EmojiTransliterator::class)) { - throw new \LogicException(sprintf('You cannot use the "%s()" method as the "symfony/intl" package is not installed. Try running "composer require symfony/intl".', __METHOD__)); + throw new \LogicException(\sprintf('You cannot use the "%s()" method as the "symfony/emoji" package is not installed. Try running "composer require symfony/emoji".', __METHOD__)); } $new = clone $this; @@ -101,7 +101,7 @@ class AsciiSlugger implements SluggerInterface, LocaleAwareInterface return $new; } - public function slug(string $string, string $separator = '-', string $locale = null): AbstractUnicodeString + public function slug(string $string, string $separator = '-', ?string $locale = null): AbstractUnicodeString { $locale ??= $this->defaultLocale; @@ -121,17 +121,15 @@ class AsciiSlugger implements SluggerInterface, LocaleAwareInterface // If the symbols map is passed as a closure, there is no need to fallback to the parent locale // as the closure can just provide substitutions for all locales of interest. $symbolsMap = $this->symbolsMap; - array_unshift($transliterator, static function ($s) use ($symbolsMap, $locale) { - return $symbolsMap($s, $locale); - }); + array_unshift($transliterator, static fn ($s) => $symbolsMap($s, $locale)); } $unicodeString = (new UnicodeString($string))->ascii($transliterator); if (\is_array($this->symbolsMap)) { $map = null; - if (isset($this->symbolsMap[$locale])) { - $map = $this->symbolsMap[$locale]; + if (isset($this->symbolsMap[$locale ?? ''])) { + $map = $this->symbolsMap[$locale ?? '']; } else { $parent = self::getParentLocale($locale); if ($parent && isset($this->symbolsMap[$parent])) { diff --git a/vendor/symfony/string/Slugger/SluggerInterface.php b/vendor/symfony/string/Slugger/SluggerInterface.php index c679ed93..dd0d5810 100644 --- a/vendor/symfony/string/Slugger/SluggerInterface.php +++ b/vendor/symfony/string/Slugger/SluggerInterface.php @@ -23,5 +23,5 @@ interface SluggerInterface /** * Creates a slug for the given string and locale, using appropriate transliteration when needed. */ - public function slug(string $string, string $separator = '-', string $locale = null): AbstractUnicodeString; + public function slug(string $string, string $separator = '-', ?string $locale = null): AbstractUnicodeString; } diff --git a/vendor/symfony/string/UnicodeString.php b/vendor/symfony/string/UnicodeString.php index a64c6a9d..ca3499ff 100644 --- a/vendor/symfony/string/UnicodeString.php +++ b/vendor/symfony/string/UnicodeString.php @@ -34,23 +34,32 @@ class UnicodeString extends AbstractUnicodeString { public function __construct(string $string = '') { - $this->string = normalizer_is_normalized($string) ? $string : normalizer_normalize($string); + if ('' === $string || normalizer_is_normalized($this->string = $string)) { + return; + } - if (false === $this->string) { + if (false === $string = normalizer_normalize($string)) { throw new InvalidArgumentException('Invalid UTF-8 string.'); } + + $this->string = $string; } public function append(string ...$suffix): static { $str = clone $this; $str->string = $this->string.(1 >= \count($suffix) ? ($suffix[0] ?? '') : implode('', $suffix)); - normalizer_is_normalized($str->string) ?: $str->string = normalizer_normalize($str->string); - if (false === $str->string) { + if (normalizer_is_normalized($str->string)) { + return $str; + } + + if (false === $string = normalizer_normalize($str->string)) { throw new InvalidArgumentException('Invalid UTF-8 string.'); } + $str->string = $string; + return $str; } @@ -97,11 +106,15 @@ class UnicodeString extends AbstractUnicodeString return false; } - if ($this->ignoreCase) { - return 0 === mb_stripos(grapheme_extract($this->string, \strlen($suffix), \GRAPHEME_EXTR_MAXBYTES, \strlen($this->string) - \strlen($suffix)), $suffix, 0, 'UTF-8'); + if (false === $grapheme = grapheme_extract($this->string, \strlen($suffix), \GRAPHEME_EXTR_MAXBYTES, \strlen($this->string) - \strlen($suffix))) { + $grapheme = ''; } - return $suffix === grapheme_extract($this->string, \strlen($suffix), \GRAPHEME_EXTR_MAXBYTES, \strlen($this->string) - \strlen($suffix)); + if ($this->ignoreCase) { + return 0 === mb_stripos($grapheme, $suffix, 0, 'UTF-8'); + } + + return $suffix === $grapheme; } public function equalsTo(string|iterable|AbstractString $string): bool @@ -171,12 +184,16 @@ class UnicodeString extends AbstractUnicodeString $offset = 0; } - $i = $this->ignoreCase ? grapheme_strripos($string, $needle, $offset) : grapheme_strrpos($string, $needle, $offset); + try { + $i = $this->ignoreCase ? grapheme_strripos($string, $needle, $offset) : grapheme_strrpos($string, $needle, $offset); + } catch (\ValueError) { + return null; + } return false === $i ? null : $i; } - public function join(array $strings, string $lastGlue = null): static + public function join(array $strings, ?string $lastGlue = null): static { $str = parent::join($strings, $lastGlue); normalizer_is_normalized($str->string) ?: $str->string = normalizer_normalize($str->string); @@ -209,12 +226,17 @@ class UnicodeString extends AbstractUnicodeString { $str = clone $this; $str->string = (1 >= \count($prefix) ? ($prefix[0] ?? '') : implode('', $prefix)).$this->string; - normalizer_is_normalized($str->string) ?: $str->string = normalizer_normalize($str->string); - if (false === $str->string) { + if (normalizer_is_normalized($str->string)) { + return $str; + } + + if (false === $string = normalizer_normalize($str->string)) { throw new InvalidArgumentException('Invalid UTF-8 string.'); } + $str->string = $string; + return $str; } @@ -235,11 +257,16 @@ class UnicodeString extends AbstractUnicodeString } $str->string = $result.$tail; - normalizer_is_normalized($str->string) ?: $str->string = normalizer_normalize($str->string); - if (false === $str->string) { + if (normalizer_is_normalized($str->string)) { + return $str; + } + + if (false === $string = normalizer_normalize($str->string)) { throw new InvalidArgumentException('Invalid UTF-8 string.'); } + + $str->string = $string; } return $str; @@ -253,7 +280,7 @@ class UnicodeString extends AbstractUnicodeString return $str; } - public function slice(int $start = 0, int $length = null): static + public function slice(int $start = 0, ?int $length = null): static { $str = clone $this; @@ -262,23 +289,28 @@ class UnicodeString extends AbstractUnicodeString return $str; } - public function splice(string $replacement, int $start = 0, int $length = null): static + public function splice(string $replacement, int $start = 0, ?int $length = null): static { $str = clone $this; $start = $start ? \strlen(grapheme_substr($this->string, 0, $start)) : 0; - $length = $length ? \strlen(grapheme_substr($this->string, $start, $length ?? 2147483647)) : $length; + $length = $length ? \strlen(grapheme_substr(substr($this->string, $start), 0, $length)) : $length; $str->string = substr_replace($this->string, $replacement, $start, $length ?? 2147483647); - normalizer_is_normalized($str->string) ?: $str->string = normalizer_normalize($str->string); - if (false === $str->string) { + if (normalizer_is_normalized($str->string)) { + return $str; + } + + if (false === $string = normalizer_normalize($str->string)) { throw new InvalidArgumentException('Invalid UTF-8 string.'); } + $str->string = $string; + return $str; } - public function split(string $delimiter, int $limit = null, int $flags = null): array + public function split(string $delimiter, ?int $limit = null, ?int $flags = null): array { if (1 > $limit ??= 2147483647) { throw new InvalidArgumentException('Split limit must be a positive integer.'); @@ -331,15 +363,101 @@ class UnicodeString extends AbstractUnicodeString return false; } - if ($this->ignoreCase) { - return 0 === mb_stripos(grapheme_extract($this->string, \strlen($prefix), \GRAPHEME_EXTR_MAXBYTES), $prefix, 0, 'UTF-8'); + if (false === $grapheme = grapheme_extract($this->string, \strlen($prefix), \GRAPHEME_EXTR_MAXBYTES)) { + $grapheme = ''; } - return $prefix === grapheme_extract($this->string, \strlen($prefix), \GRAPHEME_EXTR_MAXBYTES); + if ($this->ignoreCase) { + return 0 === mb_stripos($grapheme, $prefix, 0, 'UTF-8'); + } + + return $prefix === $grapheme; } - public function __wakeup() + public function trimPrefix($prefix): static { + if (\is_array($prefix) || $prefix instanceof \Traversable) { + return parent::trimPrefix($prefix); + } + + if ($prefix instanceof AbstractString) { + $prefix = $prefix->string; + } else { + $prefix = (string) $prefix; + } + + if (!normalizer_is_normalized($prefix, \Normalizer::NFC)) { + $prefix = normalizer_normalize($prefix, \Normalizer::NFC); + } + + return parent::trimPrefix($prefix); + } + + public function trimSuffix($suffix): static + { + if (\is_array($suffix) || $suffix instanceof \Traversable) { + return parent::trimSuffix($suffix); + } + + if ($suffix instanceof AbstractString) { + $suffix = $suffix->string; + } else { + $suffix = (string) $suffix; + } + + if (!normalizer_is_normalized($suffix, \Normalizer::NFC)) { + $suffix = normalizer_normalize($suffix, \Normalizer::NFC); + } + + return parent::trimSuffix($suffix); + } + + public function __unserialize(array $data): void + { + if ($wakeup = self::class !== (new \ReflectionMethod($this, '__wakeup'))->class && self::class === (new \ReflectionMethod($this, '__unserialize'))->class) { + trigger_deprecation('symfony/string', '7.4', 'Implementing "%s::__wakeup()" is deprecated, use "__unserialize()" instead.', get_debug_type($this)); + } + + if (($data['string'] ?? null) instanceof \Stringable || ($data["\0*\0string"] ?? null) instanceof \Stringable) { + throw new \BadMethodCallException('Cannot unserialize '.__CLASS__); + } + + try { + if (\in_array(array_keys($data), [['string'], ["\0*\0string"]], true)) { + $this->string = $data['string'] ?? $data["\0*\0string"]; + + if ($wakeup) { + $this->__wakeup(); + } + + return; + } + + trigger_deprecation('symfony/string', '7.4', 'Passing more than just key "string" to "%s::__unserialize()" is deprecated, populate properties in "%s::__unserialize()" instead.', self::class, get_debug_type($this)); + + \Closure::bind(function ($data) use ($wakeup) { + foreach ($data as $key => $value) { + $this->{("\0" === $key[0] ?? '') ? substr($key, 1 + strrpos($key, "\0")) : $key} = $value; + } + + if ($wakeup) { + $this->__wakeup(); + } + }, $this, static::class)($data); + } finally { + if (!$wakeup) { + normalizer_is_normalized($this->string) ?: $this->string = normalizer_normalize($this->string); + } + } + } + + /** + * @deprecated since Symfony 7.4, will be replaced by `__unserialize()` in 8.0 + */ + public function __wakeup(): void + { + trigger_deprecation('symfony/string', '7.4', 'Calling "%s::__wakeup()" is deprecated, use "__unserialize()" instead.', get_debug_type($this)); + if (!\is_string($this->string)) { throw new \BadMethodCallException('Cannot unserialize '.__CLASS__); } diff --git a/vendor/symfony/string/composer.json b/vendor/symfony/string/composer.json index 44a809d5..4023cd7f 100644 --- a/vendor/symfony/string/composer.json +++ b/vendor/symfony/string/composer.json @@ -16,21 +16,22 @@ } ], "require": { - "php": ">=8.1", + "php": ">=8.2", + "symfony/deprecation-contracts": "^2.5|^3.0", "symfony/polyfill-ctype": "~1.8", - "symfony/polyfill-intl-grapheme": "~1.0", + "symfony/polyfill-intl-grapheme": "~1.33", "symfony/polyfill-intl-normalizer": "~1.0", "symfony/polyfill-mbstring": "~1.0" }, "require-dev": { - "symfony/error-handler": "^5.4|^6.0", - "symfony/intl": "^6.2", - "symfony/http-client": "^5.4|^6.0", - "symfony/translation-contracts": "^2.0|^3.0", - "symfony/var-exporter": "^5.4|^6.0" + "symfony/emoji": "^7.1|^8.0", + "symfony/http-client": "^6.4|^7.0|^8.0", + "symfony/intl": "^6.4|^7.0|^8.0", + "symfony/translation-contracts": "^2.5|^3.0", + "symfony/var-exporter": "^6.4|^7.0|^8.0" }, "conflict": { - "symfony/translation-contracts": "<2.0" + "symfony/translation-contracts": "<2.5" }, "autoload": { "psr-4": { "Symfony\\Component\\String\\": "" }, diff --git a/vendor/symfony/translation-contracts/Test/TranslatorTest.php b/vendor/symfony/translation-contracts/Test/TranslatorTest.php index e4168cc1..c86efe17 100644 --- a/vendor/symfony/translation-contracts/Test/TranslatorTest.php +++ b/vendor/symfony/translation-contracts/Test/TranslatorTest.php @@ -11,7 +11,10 @@ namespace Symfony\Contracts\Translation\Test; +use PHPUnit\Framework\Attributes\DataProvider; +use PHPUnit\Framework\Attributes\RequiresPhpExtension; use PHPUnit\Framework\TestCase; +use Symfony\Component\Translation\TranslatableMessage; use Symfony\Contracts\Translation\TranslatorInterface; use Symfony\Contracts\Translation\TranslatorTrait; @@ -24,13 +27,13 @@ use Symfony\Contracts\Translation\TranslatorTrait; * * As mentioned by chx http://drupal.org/node/1273968 we can cover all by testing number from 0 to 199 * - * The goal to cover all languages is to far fetched so this test case is smaller. + * The goal to cover all languages is too far fetched so this test case is smaller. * * @author Clemens Tolboom clemens@build2be.nl */ class TranslatorTest extends TestCase { - private $defaultLocale; + private string $defaultLocale; protected function setUp(): void { @@ -45,7 +48,7 @@ class TranslatorTest extends TestCase public function getTranslator(): TranslatorInterface { - return new class() implements TranslatorInterface { + return new class implements TranslatorInterface { use TranslatorTrait; }; } @@ -53,6 +56,7 @@ class TranslatorTest extends TestCase /** * @dataProvider getTransTests */ + #[DataProvider('getTransTests')] public function testTrans($expected, $id, $parameters) { $translator = $this->getTranslator(); @@ -63,6 +67,7 @@ class TranslatorTest extends TestCase /** * @dataProvider getTransChoiceTests */ + #[DataProvider('getTransChoiceTests')] public function testTransChoiceWithExplicitLocale($expected, $id, $number) { $translator = $this->getTranslator(); @@ -75,6 +80,8 @@ class TranslatorTest extends TestCase * * @dataProvider getTransChoiceTests */ + #[DataProvider('getTransChoiceTests')] + #[RequiresPhpExtension('intl')] public function testTransChoiceWithDefaultLocale($expected, $id, $number) { $translator = $this->getTranslator(); @@ -85,6 +92,7 @@ class TranslatorTest extends TestCase /** * @dataProvider getTransChoiceTests */ + #[DataProvider('getTransChoiceTests')] public function testTransChoiceWithEnUsPosix($expected, $id, $number) { $translator = $this->getTranslator(); @@ -103,6 +111,7 @@ class TranslatorTest extends TestCase /** * @requires extension intl */ + #[RequiresPhpExtension('intl')] public function testGetLocaleReturnsDefaultLocaleIfNotSet() { $translator = $this->getTranslator(); @@ -116,10 +125,12 @@ class TranslatorTest extends TestCase public static function getTransTests() { - return [ - ['Symfony is great!', 'Symfony is great!', []], - ['Symfony is awesome!', 'Symfony is %what%!', ['%what%' => 'awesome']], - ]; + yield ['Symfony is great!', 'Symfony is great!', []]; + yield ['Symfony is awesome!', 'Symfony is %what%!', ['%what%' => 'awesome']]; + + if (class_exists(TranslatableMessage::class)) { + yield ['He said "Symfony is awesome!".', 'He said "%what%".', ['%what%' => new TranslatableMessage('Symfony is %what%!', ['%what%' => 'awesome'])]]; + } } public static function getTransChoiceTests() @@ -139,6 +150,7 @@ class TranslatorTest extends TestCase /** * @dataProvider getInterval */ + #[DataProvider('getInterval')] public function testInterval($expected, $number, $interval) { $translator = $this->getTranslator(); @@ -164,6 +176,7 @@ class TranslatorTest extends TestCase /** * @dataProvider getChooseTests */ + #[DataProvider('getChooseTests')] public function testChoose($expected, $id, $number, $locale = null) { $translator = $this->getTranslator(); @@ -181,11 +194,13 @@ class TranslatorTest extends TestCase /** * @dataProvider getNonMatchingMessages */ + #[DataProvider('getNonMatchingMessages')] public function testThrowExceptionIfMatchingMessageCannotBeFound($id, $number) { - $this->expectException(\InvalidArgumentException::class); $translator = $this->getTranslator(); + $this->expectException(\InvalidArgumentException::class); + $translator->trans($id, ['%count%' => $number]); } @@ -255,13 +270,13 @@ class TranslatorTest extends TestCase new-line in it. Selector = 0.|{1}This is a text with a new-line in it. Selector = 1.|[1,Inf]This is a text with a new-line in it. Selector > 1.', 5], - // with double-quotes and id split accros lines + // with double-quotes and id split across lines ['This is a text with a new-line in it. Selector = 1.', '{0}This is a text with a new-line in it. Selector = 0.|{1}This is a text with a new-line in it. Selector = 1.|[1,Inf]This is a text with a new-line in it. Selector > 1.', 1], - // with single-quotes and id split accros lines + // with single-quotes and id split across lines ['This is a text with a new-line in it. Selector > 1.', '{0}This is a text with a new-line in it. Selector = 0.|{1}This is a text with a @@ -269,7 +284,7 @@ class TranslatorTest extends TestCase new-line in it. Selector > 1.', 5], // with single-quotes and \n in text ['This is a text with a\nnew-line in it. Selector = 0.', '{0}This is a text with a\nnew-line in it. Selector = 0.|{1}This is a text with a\nnew-line in it. Selector = 1.|[1,Inf]This is a text with a\nnew-line in it. Selector > 1.', 0], - // with double-quotes and id split accros lines + // with double-quotes and id split across lines ["This is a text with a\nnew-line in it. Selector = 1.", "{0}This is a text with a\nnew-line in it. Selector = 0.|{1}This is a text with a\nnew-line in it. Selector = 1.|[1,Inf]This is a text with a\nnew-line in it. Selector > 1.", 1], // escape pipe ['This is a text with | in it. Selector = 0.', '{0}This is a text with || in it. Selector = 0.|{1}This is a text with || in it. Selector = 1.', 0], @@ -295,6 +310,7 @@ class TranslatorTest extends TestCase /** * @dataProvider failingLangcodes */ + #[DataProvider('failingLangcodes')] public function testFailedLangcodes($nplural, $langCodes) { $matrix = $this->generateTestData($langCodes); @@ -304,6 +320,7 @@ class TranslatorTest extends TestCase /** * @dataProvider successLangcodes */ + #[DataProvider('successLangcodes')] public function testLangcodes($nplural, $langCodes) { $matrix = $this->generateTestData($langCodes); @@ -332,7 +349,7 @@ class TranslatorTest extends TestCase * This both depends on a complete list trying to add above as understanding * the plural rules of the current failing languages. * - * @return array with nplural together with langcodes + * @return array With nplural together with langcodes */ public static function failingLangcodes(): array { @@ -358,14 +375,14 @@ class TranslatorTest extends TestCase if ($expectSuccess) { $this->assertCount($nplural, $indexes, "Langcode '$langCode' has '$nplural' plural forms."); } else { - $this->assertNotEquals((int) $nplural, \count($indexes), "Langcode '$langCode' has '$nplural' plural forms."); + $this->assertNotCount($nplural, $indexes, "Langcode '$langCode' has '$nplural' plural forms."); } } } protected function generateTestData($langCodes) { - $translator = new class() { + $translator = new class { use TranslatorTrait { getPluralizationRule as public; } diff --git a/vendor/symfony/translation-contracts/TranslatableInterface.php b/vendor/symfony/translation-contracts/TranslatableInterface.php index 47fd6fa0..8554697e 100644 --- a/vendor/symfony/translation-contracts/TranslatableInterface.php +++ b/vendor/symfony/translation-contracts/TranslatableInterface.php @@ -16,5 +16,5 @@ namespace Symfony\Contracts\Translation; */ interface TranslatableInterface { - public function trans(TranslatorInterface $translator, string $locale = null): string; + public function trans(TranslatorInterface $translator, ?string $locale = null): string; } diff --git a/vendor/symfony/translation-contracts/TranslatorInterface.php b/vendor/symfony/translation-contracts/TranslatorInterface.php index 018db07e..7fa69878 100644 --- a/vendor/symfony/translation-contracts/TranslatorInterface.php +++ b/vendor/symfony/translation-contracts/TranslatorInterface.php @@ -59,7 +59,7 @@ interface TranslatorInterface * * @throws \InvalidArgumentException If the locale contains invalid characters */ - public function trans(string $id, array $parameters = [], string $domain = null, string $locale = null): string; + public function trans(string $id, array $parameters = [], ?string $domain = null, ?string $locale = null): string; /** * Returns the default locale. diff --git a/vendor/symfony/translation-contracts/TranslatorTrait.php b/vendor/symfony/translation-contracts/TranslatorTrait.php index e3b0adff..06d3e305 100644 --- a/vendor/symfony/translation-contracts/TranslatorTrait.php +++ b/vendor/symfony/translation-contracts/TranslatorTrait.php @@ -35,12 +35,18 @@ trait TranslatorTrait return $this->locale ?: (class_exists(\Locale::class) ? \Locale::getDefault() : 'en'); } - public function trans(?string $id, array $parameters = [], string $domain = null, string $locale = null): string + public function trans(?string $id, array $parameters = [], ?string $domain = null, ?string $locale = null): string { if (null === $id || '' === $id) { return ''; } + foreach ($parameters as $k => $v) { + if ($v instanceof TranslatableInterface) { + $parameters[$k] = $v->trans($this, $locale); + } + } + if (!isset($parameters['%count%']) || !is_numeric($parameters['%count%'])) { return strtr($id, $parameters); } @@ -56,22 +62,22 @@ trait TranslatorTrait } $intervalRegexp = <<<'EOF' -/^(?P - ({\s* - (\-?\d+(\.\d+)?[\s*,\s*\-?\d+(\.\d+)?]*) - \s*}) + /^(?P + ({\s* + (\-?\d+(\.\d+)?[\s*,\s*\-?\d+(\.\d+)?]*) + \s*}) - | + | - (?P[\[\]]) - \s* - (?P-Inf|\-?\d+(\.\d+)?) - \s*,\s* - (?P\+?Inf|\-?\d+(\.\d+)?) - \s* - (?P[\[\]]) -)\s*(?P.*?)$/xs -EOF; + (?P[\[\]]) + \s* + (?P-Inf|\-?\d+(\.\d+)?) + \s*,\s* + (?P\+?Inf|\-?\d+(\.\d+)?) + \s* + (?P[\[\]]) + )\s*(?P.*?)$/xs + EOF; $standardRules = []; foreach ($parts as $part) { @@ -111,7 +117,7 @@ EOF; return strtr($standardRules[0], $parameters); } - $message = sprintf('Unable to choose a translation for "%s" with locale "%s" for value "%d". Double check that this translation has the correct plural options (e.g. "There is one apple|There are %%count%% apples").', $id, $locale, $number); + $message = \sprintf('Unable to choose a translation for "%s" with locale "%s" for value "%d". Double check that this translation has the correct plural options (e.g. "There is one apple|There are %%count%% apples").', $id, $locale, $number); if (class_exists(InvalidArgumentException::class)) { throw new InvalidArgumentException($message); diff --git a/vendor/symfony/translation-contracts/composer.json b/vendor/symfony/translation-contracts/composer.json index 3454800a..07b0d870 100644 --- a/vendor/symfony/translation-contracts/composer.json +++ b/vendor/symfony/translation-contracts/composer.json @@ -18,9 +18,6 @@ "require": { "php": ">=8.1" }, - "suggest": { - "symfony/translation-implementation": "" - }, "autoload": { "psr-4": { "Symfony\\Contracts\\Translation\\": "" }, "exclude-from-classmap": [ @@ -30,7 +27,7 @@ "minimum-stability": "dev", "extra": { "branch-alias": { - "dev-main": "3.3-dev" + "dev-main": "3.7-dev" }, "thanks": { "name": "symfony/contracts", diff --git a/vendor/theseer/tokenizer/.php_cs.dist b/vendor/theseer/tokenizer/.php_cs.dist deleted file mode 100644 index 8ac26d09..00000000 --- a/vendor/theseer/tokenizer/.php_cs.dist +++ /dev/null @@ -1,213 +0,0 @@ -registerCustomFixers([ - new \PharIo\CSFixer\PhpdocSingleLineVarFixer() - ]) - ->setRiskyAllowed(true) - ->setRules( - [ - 'PharIo/phpdoc_single_line_var_fixer' => true, - - 'align_multiline_comment' => true, - 'array_indentation' => true, - 'array_syntax' => ['syntax' => 'short'], - 'binary_operator_spaces' => [ - 'operators' => [ - '=' => 'align_single_space_minimal', - '=>' => 'align', - ], - ], - 'blank_line_after_namespace' => true, - 'blank_line_after_opening_tag' => false, - 'blank_line_before_statement' => [ - 'statements' => [ - 'break', - 'continue', - 'declare', - 'do', - 'for', - 'foreach', - 'if', - 'include', - 'include_once', - 'require', - 'require_once', - 'return', - 'switch', - 'throw', - 'try', - 'while', - 'yield', - ], - ], - 'braces' => [ - 'allow_single_line_closure' => false, - 'position_after_anonymous_constructs' => 'same', - 'position_after_control_structures' => 'same', - 'position_after_functions_and_oop_constructs' => 'same' - ], - 'cast_spaces' => ['space' => 'none'], - - // This fixer removes the blank line at class start, no way to disable that, so we disable the fixer :( - //'class_attributes_separation' => ['elements' => ['const', 'method', 'property']], - - 'combine_consecutive_issets' => true, - 'combine_consecutive_unsets' => true, - 'compact_nullable_typehint' => true, - 'concat_space' => ['spacing' => 'one'], - 'date_time_immutable' => true, - 'declare_equal_normalize' => ['space' => 'single'], - 'declare_strict_types' => true, - 'dir_constant' => true, - 'elseif' => true, - 'encoding' => true, - 'full_opening_tag' => true, - 'fully_qualified_strict_types' => true, - 'function_declaration' => [ - 'closure_function_spacing' => 'one' - ], - 'header_comment' => false, - 'indentation_type' => true, - 'is_null' => true, - 'line_ending' => true, - 'list_syntax' => ['syntax' => 'short'], - 'logical_operators' => true, - 'lowercase_cast' => true, - 'lowercase_constants' => true, - 'lowercase_keywords' => true, - 'lowercase_static_reference' => true, - 'magic_constant_casing' => true, - 'method_argument_space' => ['ensure_fully_multiline' => true], - 'modernize_types_casting' => true, - 'multiline_comment_opening_closing' => true, - 'multiline_whitespace_before_semicolons' => true, - 'native_constant_invocation' => true, - 'native_function_casing' => true, - 'native_function_invocation' => true, - 'new_with_braces' => false, - 'no_alias_functions' => true, - 'no_alternative_syntax' => true, - 'no_blank_lines_after_class_opening' => false, - 'no_blank_lines_after_phpdoc' => true, - 'no_blank_lines_before_namespace' => true, - 'no_closing_tag' => true, - 'no_empty_comment' => true, - 'no_empty_phpdoc' => true, - 'no_empty_statement' => true, - 'no_extra_blank_lines' => true, - 'no_homoglyph_names' => true, - 'no_leading_import_slash' => true, - 'no_leading_namespace_whitespace' => true, - 'no_mixed_echo_print' => ['use' => 'print'], - 'no_multiline_whitespace_around_double_arrow' => true, - 'no_null_property_initialization' => true, - 'no_php4_constructor' => true, - 'no_short_bool_cast' => true, - 'no_short_echo_tag' => true, - 'no_singleline_whitespace_before_semicolons' => true, - 'no_spaces_after_function_name' => true, - 'no_spaces_inside_parenthesis' => true, - 'no_superfluous_elseif' => true, - 'no_superfluous_phpdoc_tags' => true, - 'no_trailing_comma_in_list_call' => true, - 'no_trailing_comma_in_singleline_array' => true, - 'no_trailing_whitespace' => true, - 'no_trailing_whitespace_in_comment' => true, - 'no_unneeded_control_parentheses' => false, - 'no_unneeded_curly_braces' => false, - 'no_unneeded_final_method' => true, - 'no_unreachable_default_argument_value' => true, - 'no_unset_on_property' => true, - 'no_unused_imports' => true, - 'no_useless_else' => true, - 'no_useless_return' => true, - 'no_whitespace_before_comma_in_array' => true, - 'no_whitespace_in_blank_line' => true, - 'non_printable_character' => true, - 'normalize_index_brace' => true, - 'object_operator_without_whitespace' => true, - 'ordered_class_elements' => [ - 'order' => [ - 'use_trait', - 'constant_public', - 'constant_protected', - 'constant_private', - 'property_public_static', - 'property_protected_static', - 'property_private_static', - 'property_public', - 'property_protected', - 'property_private', - 'method_public_static', - 'construct', - 'destruct', - 'magic', - 'phpunit', - 'method_public', - 'method_protected', - 'method_private', - 'method_protected_static', - 'method_private_static', - ], - ], - 'ordered_imports' => true, - 'phpdoc_add_missing_param_annotation' => true, - 'phpdoc_align' => true, - 'phpdoc_annotation_without_dot' => true, - 'phpdoc_indent' => true, - 'phpdoc_no_access' => true, - 'phpdoc_no_empty_return' => true, - 'phpdoc_no_package' => true, - 'phpdoc_order' => true, - 'phpdoc_return_self_reference' => true, - 'phpdoc_scalar' => true, - 'phpdoc_separation' => true, - 'phpdoc_single_line_var_spacing' => true, - 'phpdoc_to_comment' => false, - 'phpdoc_trim' => true, - 'phpdoc_trim_consecutive_blank_line_separation' => true, - 'phpdoc_types' => ['groups' => ['simple', 'meta']], - 'phpdoc_types_order' => true, - 'phpdoc_to_return_type' => true, - 'phpdoc_var_without_name' => true, - 'pow_to_exponentiation' => true, - 'protected_to_private' => true, - 'return_assignment' => true, - 'return_type_declaration' => ['space_before' => 'none'], - 'self_accessor' => false, - 'semicolon_after_instruction' => true, - 'set_type_to_cast' => true, - 'short_scalar_cast' => true, - 'simplified_null_return' => true, - 'single_blank_line_at_eof' => true, - 'single_import_per_statement' => true, - 'single_line_after_imports' => true, - 'single_quote' => true, - 'standardize_not_equals' => true, - 'ternary_to_null_coalescing' => true, - 'trailing_comma_in_multiline_array' => false, - 'trim_array_spaces' => true, - 'unary_operator_spaces' => true, - 'visibility_required' => [ - 'elements' => [ - 'const', - 'method', - 'property', - ], - ], - 'void_return' => true, - 'whitespace_after_comma_in_array' => true, - 'yoda_style' => false - ] - ) - ->setFinder( - PhpCsFixer\Finder::create() - ->files() - ->in(__DIR__ . '/src') - ->in(__DIR__ . '/tests') - ->notName('*.phpt') - ->notName('autoload.php') - ); diff --git a/vendor/theseer/tokenizer/CHANGELOG.md b/vendor/theseer/tokenizer/CHANGELOG.md index 1eff3830..d867649f 100644 --- a/vendor/theseer/tokenizer/CHANGELOG.md +++ b/vendor/theseer/tokenizer/CHANGELOG.md @@ -2,6 +2,18 @@ All notable changes to Tokenizer are documented in this file using the [Keep a CHANGELOG](http://keepachangelog.com/) principles. +## [1.2.3] - 2024-03-03 + +### Changed + +* Do not use implicitly nullable parameters + +## [1.2.2] - 2023-11-20 + +### Fixed + +* [#18](https://github.com/theseer/tokenizer/issues/18): Tokenizer fails on protobuf metadata files + ## [1.2.1] - 2021-07-28 @@ -64,6 +76,10 @@ This release is now PHP 8.0 compliant. Initial Release +[1.2.3]: https://github.com/theseer/tokenizer/compare/1.2.2...1.2.3 +[1.2.2]: https://github.com/theseer/tokenizer/compare/1.2.1...1.2.2 +[1.2.1]: https://github.com/theseer/tokenizer/compare/1.2.0...1.2.1 +[1.2.0]: https://github.com/theseer/tokenizer/compare/1.1.3...1.2.0 [1.1.3]: https://github.com/theseer/tokenizer/compare/1.1.2...1.1.3 [1.1.2]: https://github.com/theseer/tokenizer/compare/1.1.1...1.1.2 [1.1.1]: https://github.com/theseer/tokenizer/compare/1.1.0...1.1.1 diff --git a/vendor/theseer/tokenizer/README.md b/vendor/theseer/tokenizer/README.md index e91ed891..a5f891b4 100644 --- a/vendor/theseer/tokenizer/README.md +++ b/vendor/theseer/tokenizer/README.md @@ -3,9 +3,6 @@ A small library for converting tokenized PHP source code into XML. [![Test](https://github.com/theseer/tokenizer/actions/workflows/ci.yml/badge.svg)](https://github.com/theseer/tokenizer/actions/workflows/ci.yml) -[![Scrutinizer Code Quality](https://scrutinizer-ci.com/g/theseer/tokenizer/badges/quality-score.png?b=master)](https://scrutinizer-ci.com/g/theseer/tokenizer/?branch=master) -[![Code Coverage](https://scrutinizer-ci.com/g/theseer/tokenizer/badges/coverage.png?b=master)](https://scrutinizer-ci.com/g/theseer/tokenizer/?branch=master) -[![Build Status](https://scrutinizer-ci.com/g/theseer/tokenizer/badges/build.png?b=master)](https://scrutinizer-ci.com/g/theseer/tokenizer/build-status/master) ## Installation diff --git a/vendor/theseer/tokenizer/src/TokenCollection.php b/vendor/theseer/tokenizer/src/TokenCollection.php index e5e6e401..2bfc8574 100644 --- a/vendor/theseer/tokenizer/src/TokenCollection.php +++ b/vendor/theseer/tokenizer/src/TokenCollection.php @@ -1,38 +1,27 @@ + */ +class TokenCollection implements IteratorAggregate, ArrayAccess, Countable { /** @var Token[] */ private $tokens = []; - /** @var int */ - private $pos; - public function addToken(Token $token): void { $this->tokens[] = $token; } - public function current(): Token { - return \current($this->tokens); - } - - public function key(): int { - return \key($this->tokens); - } - - public function next(): void { - \next($this->tokens); - $this->pos++; - } - - public function valid(): bool { - return $this->count() > $this->pos; - } - - public function rewind(): void { - \reset($this->tokens); - $this->pos = 0; + public function getIterator(): Iterator + { + return new ArrayIterator($this->tokens); } public function count(): int { diff --git a/vendor/theseer/tokenizer/src/Tokenizer.php b/vendor/theseer/tokenizer/src/Tokenizer.php index f582d958..f0f5f6ff 100644 --- a/vendor/theseer/tokenizer/src/Tokenizer.php +++ b/vendor/theseer/tokenizer/src/Tokenizer.php @@ -8,7 +8,7 @@ class Tokenizer { * * @var array */ - private $map = [ + private const MAP = [ '(' => 'T_OPEN_BRACKET', ')' => 'T_CLOSE_BRACKET', '[' => 'T_OPEN_SQUARE', @@ -58,7 +58,7 @@ class Tokenizer { if (\is_string($tok)) { $token = new Token( $lastToken->getLine(), - $this->map[$tok], + self::MAP[$tok], $tok ); $result->addToken($token); @@ -70,6 +70,18 @@ class Tokenizer { $line = $tok[2]; $values = \preg_split('/\R+/Uu', $tok[1]); + if (!$values) { + $result->addToken( + new Token( + $line, + \token_name($tok[0]), + '{binary data}' + ) + ); + + continue; + } + foreach ($values as $v) { $token = new Token( $line, @@ -98,45 +110,40 @@ class Tokenizer { ); $final = new TokenCollection(); + $prevLine = $prev->getLine(); foreach ($tokens as $token) { - if ($prev === null) { - $final->addToken($token); - $prev = $token; - - continue; - } - - $gap = $token->getLine() - $prev->getLine(); + $line = $token->getLine(); + $gap = $line - $prevLine; while ($gap > 1) { $linebreak = new Token( - $prev->getLine() + 1, + $prevLine + 1, 'T_WHITESPACE', '' ); $final->addToken($linebreak); - $prev = $linebreak; + $prevLine = $linebreak->getLine(); $gap--; } $final->addToken($token); - $prev = $token; + $prevLine = $line; } - $gap = $maxLine - $prev->getLine(); + $gap = $maxLine - $prevLine; while ($gap > 0) { $linebreak = new Token( - $prev->getLine() + 1, + $prevLine + 1, 'T_WHITESPACE', '' ); $final->addToken($linebreak); - $prev = $linebreak; + $prevLine = $linebreak->getLine(); $gap--; } return $final; } -} +} \ No newline at end of file diff --git a/vendor/theseer/tokenizer/src/XMLSerializer.php b/vendor/theseer/tokenizer/src/XMLSerializer.php index e67a7fe8..3f477b59 100644 --- a/vendor/theseer/tokenizer/src/XMLSerializer.php +++ b/vendor/theseer/tokenizer/src/XMLSerializer.php @@ -5,12 +5,6 @@ use DOMDocument; class XMLSerializer { - /** @var \XMLWriter */ - private $writer; - - /** @var Token */ - private $previousToken; - /** @var NamespaceUri */ private $xmlns; @@ -19,7 +13,7 @@ class XMLSerializer { * * @param NamespaceUri $xmlns */ - public function __construct(NamespaceUri $xmlns = null) { + public function __construct(?NamespaceUri $xmlns = null) { if ($xmlns === null) { $xmlns = new NamespaceUri('https://github.com/theseer/tokenizer'); } @@ -35,45 +29,46 @@ class XMLSerializer { } public function toXML(TokenCollection $tokens): string { - $this->writer = new \XMLWriter(); - $this->writer->openMemory(); - $this->writer->setIndent(true); - $this->writer->startDocument(); - $this->writer->startElement('source'); - $this->writer->writeAttribute('xmlns', $this->xmlns->asString()); + $writer = new \XMLWriter(); + $writer->openMemory(); + $writer->setIndent(true); + $writer->startDocument(); + $writer->startElement('source'); + $writer->writeAttribute('xmlns', $this->xmlns->asString()); if (\count($tokens) > 0) { - $this->writer->startElement('line'); - $this->writer->writeAttribute('no', '1'); + $writer->startElement('line'); + $writer->writeAttribute('no', '1'); - $this->previousToken = $tokens[0]; + $iterator = $tokens->getIterator(); + $previousToken = $iterator->current(); + $previousLine = $previousToken->getLine(); - foreach ($tokens as $token) { - $this->addToken($token); + foreach ($iterator as $token) { + $line = $token->getLine(); + if ($previousLine < $line) { + $writer->endElement(); + + $writer->startElement('line'); + $writer->writeAttribute('no', (string)$line); + $previousLine = $line; + } + + $value = $token->getValue(); + if ($value !== '') { + $writer->startElement('token'); + $writer->writeAttribute('name', $token->getName()); + $writer->writeRaw(\htmlspecialchars($value, \ENT_NOQUOTES | \ENT_DISALLOWED | \ENT_XML1)); + $writer->endElement(); + } } + + $writer->endElement(); } - $this->writer->endElement(); - $this->writer->endElement(); - $this->writer->endDocument(); + $writer->endElement(); + $writer->endDocument(); - return $this->writer->outputMemory(); - } - - private function addToken(Token $token): void { - if ($this->previousToken->getLine() < $token->getLine()) { - $this->writer->endElement(); - - $this->writer->startElement('line'); - $this->writer->writeAttribute('no', (string)$token->getLine()); - $this->previousToken = $token; - } - - if ($token->getValue() !== '') { - $this->writer->startElement('token'); - $this->writer->writeAttribute('name', $token->getName()); - $this->writer->writeRaw(\htmlspecialchars($token->getValue(), \ENT_NOQUOTES | \ENT_DISALLOWED | \ENT_XML1)); - $this->writer->endElement(); - } + return $writer->outputMemory(); } }