diff --git a/.github/workflows/continuous-integration.yml b/.github/workflows/continuous-integration.yml index 159b6a35b..f0b5df9d4 100644 --- a/.github/workflows/continuous-integration.yml +++ b/.github/workflows/continuous-integration.yml @@ -298,7 +298,7 @@ jobs: custom-cache-suffix: "ci" - name: "PhpBench" - run: "tools/vendor/bin/phpbench run --progress=dots --iterations=1" + run: "vendor/bin/phpbench run --progress=dots --iterations=1" coding-standards: name: "Check Coding Standards" diff --git a/composer.json b/composer.json index 659df6069..a37b9684c 100644 --- a/composer.json +++ b/composer.json @@ -6,7 +6,7 @@ "php": "~8.2.0 || ~8.3.2", "ext-json": "*", "jetbrains/phpstorm-stubs": "2023.3", - "nikic/php-parser": "^4.18.0", + "nikic/php-parser": "^5.0.2", "roave/signature": "^1.8.0" }, "authors": [ @@ -33,7 +33,8 @@ ], "require-dev": { - "phpunit/phpunit": "^10.5.12" + "phpbench/phpbench": "^1.2.15", + "phpunit/phpunit": "^11.0.5" }, "autoload": { "psr-4": { @@ -42,7 +43,8 @@ }, "autoload-dev": { "psr-4": { - "Roave\\BetterReflectionTest\\": "test/unit" + "Roave\\BetterReflectionTest\\": "test/unit", + "Roave\\BetterReflectionBenchmark\\": "test/benchmark" } }, "conflict": { diff --git a/composer.lock b/composer.lock index 8d9de8d69..fc17c462c 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": "93558e6e01d112899203711e8aff43d6", + "content-hash": "b1ee1a3643a67b5b8fed8e06bc88dcaf", "packages": [ { "name": "jetbrains/phpstorm-stubs", @@ -56,25 +56,27 @@ }, { "name": "nikic/php-parser", - "version": "v4.18.0", + "version": "v5.0.2", "source": { "type": "git", "url": "https://github.com/nikic/PHP-Parser.git", - "reference": "1bcbb2179f97633e98bbbc87044ee2611c7d7999" + "reference": "139676794dc1e9231bf7bcd123cfc0c99182cb13" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/nikic/PHP-Parser/zipball/1bcbb2179f97633e98bbbc87044ee2611c7d7999", - "reference": "1bcbb2179f97633e98bbbc87044ee2611c7d7999", + "url": "https://api.github.com/repos/nikic/PHP-Parser/zipball/139676794dc1e9231bf7bcd123cfc0c99182cb13", + "reference": "139676794dc1e9231bf7bcd123cfc0c99182cb13", "shasum": "" }, "require": { + "ext-ctype": "*", + "ext-json": "*", "ext-tokenizer": "*", - "php": ">=7.0" + "php": ">=7.4" }, "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" @@ -82,7 +84,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "4.9-dev" + "dev-master": "5.0-dev" } }, "autoload": { @@ -106,9 +108,9 @@ ], "support": { "issues": "https://github.com/nikic/PHP-Parser/issues", - "source": "https://github.com/nikic/PHP-Parser/tree/v4.18.0" + "source": "https://github.com/nikic/PHP-Parser/tree/v5.0.2" }, - "time": "2023-12-10T21:03:43+00:00" + "time": "2024-03-05T20:51:40+00:00" }, { "name": "roave/signature", @@ -152,6 +154,159 @@ } ], "packages-dev": [ + { + "name": "doctrine/annotations", + "version": "2.0.1", + "source": { + "type": "git", + "url": "https://github.com/doctrine/annotations.git", + "reference": "e157ef3f3124bbf6fe7ce0ffd109e8a8ef284e7f" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/doctrine/annotations/zipball/e157ef3f3124bbf6fe7ce0ffd109e8a8ef284e7f", + "reference": "e157ef3f3124bbf6fe7ce0ffd109e8a8ef284e7f", + "shasum": "" + }, + "require": { + "doctrine/lexer": "^2 || ^3", + "ext-tokenizer": "*", + "php": "^7.2 || ^8.0", + "psr/cache": "^1 || ^2 || ^3" + }, + "require-dev": { + "doctrine/cache": "^2.0", + "doctrine/coding-standard": "^10", + "phpstan/phpstan": "^1.8.0", + "phpunit/phpunit": "^7.5 || ^8.5 || ^9.5", + "symfony/cache": "^5.4 || ^6", + "vimeo/psalm": "^4.10" + }, + "suggest": { + "php": "PHP 8.0 or higher comes with attributes, a native replacement for annotations" + }, + "type": "library", + "autoload": { + "psr-4": { + "Doctrine\\Common\\Annotations\\": "lib/Doctrine/Common/Annotations" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Guilherme Blanco", + "email": "guilhermeblanco@gmail.com" + }, + { + "name": "Roman Borschel", + "email": "roman@code-factory.org" + }, + { + "name": "Benjamin Eberlei", + "email": "kontakt@beberlei.de" + }, + { + "name": "Jonathan Wage", + "email": "jonwage@gmail.com" + }, + { + "name": "Johannes Schmitt", + "email": "schmittjoh@gmail.com" + } + ], + "description": "Docblock Annotations Parser", + "homepage": "https://www.doctrine-project.org/projects/annotations.html", + "keywords": [ + "annotations", + "docblock", + "parser" + ], + "support": { + "issues": "https://github.com/doctrine/annotations/issues", + "source": "https://github.com/doctrine/annotations/tree/2.0.1" + }, + "time": "2023-02-02T22:02:53+00:00" + }, + { + "name": "doctrine/lexer", + "version": "3.0.1", + "source": { + "type": "git", + "url": "https://github.com/doctrine/lexer.git", + "reference": "31ad66abc0fc9e1a1f2d9bc6a42668d2fbbcd6dd" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/doctrine/lexer/zipball/31ad66abc0fc9e1a1f2d9bc6a42668d2fbbcd6dd", + "reference": "31ad66abc0fc9e1a1f2d9bc6a42668d2fbbcd6dd", + "shasum": "" + }, + "require": { + "php": "^8.1" + }, + "require-dev": { + "doctrine/coding-standard": "^12", + "phpstan/phpstan": "^1.10", + "phpunit/phpunit": "^10.5", + "psalm/plugin-phpunit": "^0.18.3", + "vimeo/psalm": "^5.21" + }, + "type": "library", + "autoload": { + "psr-4": { + "Doctrine\\Common\\Lexer\\": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Guilherme Blanco", + "email": "guilhermeblanco@gmail.com" + }, + { + "name": "Roman Borschel", + "email": "roman@code-factory.org" + }, + { + "name": "Johannes Schmitt", + "email": "schmittjoh@gmail.com" + } + ], + "description": "PHP Doctrine Lexer parser library that can be used in Top-Down, Recursive Descent Parsers.", + "homepage": "https://www.doctrine-project.org/projects/lexer.html", + "keywords": [ + "annotations", + "docblock", + "lexer", + "parser", + "php" + ], + "support": { + "issues": "https://github.com/doctrine/lexer/issues", + "source": "https://github.com/doctrine/lexer/tree/3.0.1" + }, + "funding": [ + { + "url": "https://www.doctrine-project.org/sponsorship.html", + "type": "custom" + }, + { + "url": "https://www.patreon.com/phpdoctrine", + "type": "patreon" + }, + { + "url": "https://tidelift.com/funding/github/packagist/doctrine%2Flexer", + "type": "tidelift" + } + ], + "time": "2024-02-05T11:56:58+00:00" + }, { "name": "myclabs/deep-copy", "version": "1.11.1", @@ -329,37 +484,237 @@ }, "time": "2022-02-21T01:04:05+00:00" }, + { + "name": "phpbench/container", + "version": "2.2.2", + "source": { + "type": "git", + "url": "https://github.com/phpbench/container.git", + "reference": "a59b929e00b87b532ca6d0edd8eca0967655af33" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/phpbench/container/zipball/a59b929e00b87b532ca6d0edd8eca0967655af33", + "reference": "a59b929e00b87b532ca6d0edd8eca0967655af33", + "shasum": "" + }, + "require": { + "psr/container": "^1.0|^2.0", + "symfony/options-resolver": "^4.2 || ^5.0 || ^6.0 || ^7.0" + }, + "require-dev": { + "friendsofphp/php-cs-fixer": "^2.16", + "phpstan/phpstan": "^0.12.52", + "phpunit/phpunit": "^8" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.x-dev" + } + }, + "autoload": { + "psr-4": { + "PhpBench\\DependencyInjection\\": "lib/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Daniel Leech", + "email": "daniel@dantleech.com" + } + ], + "description": "Simple, configurable, service container.", + "support": { + "issues": "https://github.com/phpbench/container/issues", + "source": "https://github.com/phpbench/container/tree/2.2.2" + }, + "time": "2023-10-30T13:38:26+00:00" + }, + { + "name": "phpbench/dom", + "version": "0.3.3", + "source": { + "type": "git", + "url": "https://github.com/phpbench/dom.git", + "reference": "786a96db538d0def931f5b19225233ec42ec7a72" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/phpbench/dom/zipball/786a96db538d0def931f5b19225233ec42ec7a72", + "reference": "786a96db538d0def931f5b19225233ec42ec7a72", + "shasum": "" + }, + "require": { + "ext-dom": "*", + "php": "^7.3||^8.0" + }, + "require-dev": { + "friendsofphp/php-cs-fixer": "^3.14", + "phpstan/phpstan": "^1.10", + "phpunit/phpunit": "^8.0||^9.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.0-dev" + } + }, + "autoload": { + "psr-4": { + "PhpBench\\Dom\\": "lib/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Daniel Leech", + "email": "daniel@dantleech.com" + } + ], + "description": "DOM wrapper to simplify working with the PHP DOM implementation", + "support": { + "issues": "https://github.com/phpbench/dom/issues", + "source": "https://github.com/phpbench/dom/tree/0.3.3" + }, + "time": "2023-03-06T23:46:57+00:00" + }, + { + "name": "phpbench/phpbench", + "version": "1.2.15", + "source": { + "type": "git", + "url": "https://github.com/phpbench/phpbench.git", + "reference": "f7000319695cfad04a57fc64bf7ef7abdf4c437c" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/phpbench/phpbench/zipball/f7000319695cfad04a57fc64bf7ef7abdf4c437c", + "reference": "f7000319695cfad04a57fc64bf7ef7abdf4c437c", + "shasum": "" + }, + "require": { + "doctrine/annotations": "^2.0", + "ext-dom": "*", + "ext-json": "*", + "ext-pcre": "*", + "ext-reflection": "*", + "ext-spl": "*", + "ext-tokenizer": "*", + "php": "^8.1", + "phpbench/container": "^2.1", + "phpbench/dom": "~0.3.3", + "psr/log": "^1.1 || ^2.0 || ^3.0", + "seld/jsonlint": "^1.1", + "symfony/console": "^4.2 || ^5.0 || ^6.0 || ^7.0", + "symfony/filesystem": "^4.2 || ^5.0 || ^6.0 || ^7.0", + "symfony/finder": "^4.2 || ^5.0 || ^6.0 || ^7.0", + "symfony/options-resolver": "^4.2 || ^5.0 || ^6.0 || ^7.0", + "symfony/process": "^4.2 || ^5.0 || ^6.0 || ^7.0", + "webmozart/glob": "^4.6" + }, + "require-dev": { + "dantleech/invoke": "^2.0", + "friendsofphp/php-cs-fixer": "^3.0", + "jangregor/phpstan-prophecy": "^1.0", + "phpspec/prophecy": "dev-master", + "phpstan/extension-installer": "^1.1", + "phpstan/phpstan": "^1.0", + "phpstan/phpstan-phpunit": "^1.0", + "phpunit/phpunit": "^10.0", + "rector/rector": "^0.18.10", + "symfony/error-handler": "^5.2 || ^6.0 || ^7.0", + "symfony/var-dumper": "^4.0 || ^5.0 || ^6.0 || ^7.0" + }, + "suggest": { + "ext-xdebug": "For Xdebug profiling extension." + }, + "bin": [ + "bin/phpbench" + ], + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.2-dev" + } + }, + "autoload": { + "files": [ + "lib/Report/Func/functions.php" + ], + "psr-4": { + "PhpBench\\": "lib/", + "PhpBench\\Extensions\\XDebug\\": "extensions/xdebug/lib/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Daniel Leech", + "email": "daniel@dantleech.com" + } + ], + "description": "PHP Benchmarking Framework", + "keywords": [ + "benchmarking", + "optimization", + "performance", + "profiling", + "testing" + ], + "support": { + "issues": "https://github.com/phpbench/phpbench/issues", + "source": "https://github.com/phpbench/phpbench/tree/1.2.15" + }, + "funding": [ + { + "url": "https://github.com/dantleech", + "type": "github" + } + ], + "time": "2023-11-29T12:21:11+00:00" + }, { "name": "phpunit/php-code-coverage", - "version": "10.1.13", + "version": "11.0.2", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/php-code-coverage.git", - "reference": "d51c3aec14896d5e80b354fad58e998d1980f8f8" + "reference": "9e0a298b4dc6438a1e70ac8e1b3ea4980ae5a09b" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/d51c3aec14896d5e80b354fad58e998d1980f8f8", - "reference": "d51c3aec14896d5e80b354fad58e998d1980f8f8", + "url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/9e0a298b4dc6438a1e70ac8e1b3ea4980ae5a09b", + "reference": "9e0a298b4dc6438a1e70ac8e1b3ea4980ae5a09b", "shasum": "" }, "require": { "ext-dom": "*", "ext-libxml": "*", "ext-xmlwriter": "*", - "nikic/php-parser": "^4.18 || ^5.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", + "nikic/php-parser": "^5.0", + "php": ">=8.2", + "phpunit/php-file-iterator": "^5.0", + "phpunit/php-text-template": "^4.0", + "sebastian/code-unit-reverse-lookup": "^4.0", + "sebastian/complexity": "^4.0", + "sebastian/environment": "^7.0", + "sebastian/lines-of-code": "^3.0", + "sebastian/version": "^5.0", "theseer/tokenizer": "^1.2.0" }, "require-dev": { - "phpunit/phpunit": "^10.1" + "phpunit/phpunit": "^11.0" }, "suggest": { "ext-pcov": "PHP extension that provides line coverage", @@ -368,7 +723,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-main": "10.1-dev" + "dev-main": "11.0-dev" } }, "autoload": { @@ -397,7 +752,7 @@ "support": { "issues": "https://github.com/sebastianbergmann/php-code-coverage/issues", "security": "https://github.com/sebastianbergmann/php-code-coverage/security/policy", - "source": "https://github.com/sebastianbergmann/php-code-coverage/tree/10.1.13" + "source": "https://github.com/sebastianbergmann/php-code-coverage/tree/11.0.2" }, "funding": [ { @@ -405,32 +760,32 @@ "type": "github" } ], - "time": "2024-03-09T16:54:15+00:00" + "time": "2024-03-09T16:56:49+00:00" }, { "name": "phpunit/php-file-iterator", - "version": "4.1.0", + "version": "5.0.0", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/php-file-iterator.git", - "reference": "a95037b6d9e608ba092da1b23931e537cadc3c3c" + "reference": "99e95c94ad9500daca992354fa09d7b99abe2210" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-file-iterator/zipball/a95037b6d9e608ba092da1b23931e537cadc3c3c", - "reference": "a95037b6d9e608ba092da1b23931e537cadc3c3c", + "url": "https://api.github.com/repos/sebastianbergmann/php-file-iterator/zipball/99e95c94ad9500daca992354fa09d7b99abe2210", + "reference": "99e95c94ad9500daca992354fa09d7b99abe2210", "shasum": "" }, "require": { - "php": ">=8.1" + "php": ">=8.2" }, "require-dev": { - "phpunit/phpunit": "^10.0" + "phpunit/phpunit": "^11.0" }, "type": "library", "extra": { "branch-alias": { - "dev-main": "4.0-dev" + "dev-main": "5.0-dev" } }, "autoload": { @@ -458,7 +813,7 @@ "support": { "issues": "https://github.com/sebastianbergmann/php-file-iterator/issues", "security": "https://github.com/sebastianbergmann/php-file-iterator/security/policy", - "source": "https://github.com/sebastianbergmann/php-file-iterator/tree/4.1.0" + "source": "https://github.com/sebastianbergmann/php-file-iterator/tree/5.0.0" }, "funding": [ { @@ -466,28 +821,28 @@ "type": "github" } ], - "time": "2023-08-31T06:24:48+00:00" + "time": "2024-02-02T06:05:04+00:00" }, { "name": "phpunit/php-invoker", - "version": "4.0.0", + "version": "5.0.0", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/php-invoker.git", - "reference": "f5e568ba02fa5ba0ddd0f618391d5a9ea50b06d7" + "reference": "5d8d9355a16d8cc5a1305b0a85342cfa420612be" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-invoker/zipball/f5e568ba02fa5ba0ddd0f618391d5a9ea50b06d7", - "reference": "f5e568ba02fa5ba0ddd0f618391d5a9ea50b06d7", + "url": "https://api.github.com/repos/sebastianbergmann/php-invoker/zipball/5d8d9355a16d8cc5a1305b0a85342cfa420612be", + "reference": "5d8d9355a16d8cc5a1305b0a85342cfa420612be", "shasum": "" }, "require": { - "php": ">=8.1" + "php": ">=8.2" }, "require-dev": { "ext-pcntl": "*", - "phpunit/phpunit": "^10.0" + "phpunit/phpunit": "^11.0" }, "suggest": { "ext-pcntl": "*" @@ -495,7 +850,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-main": "4.0-dev" + "dev-main": "5.0-dev" } }, "autoload": { @@ -521,7 +876,8 @@ ], "support": { "issues": "https://github.com/sebastianbergmann/php-invoker/issues", - "source": "https://github.com/sebastianbergmann/php-invoker/tree/4.0.0" + "security": "https://github.com/sebastianbergmann/php-invoker/security/policy", + "source": "https://github.com/sebastianbergmann/php-invoker/tree/5.0.0" }, "funding": [ { @@ -529,32 +885,32 @@ "type": "github" } ], - "time": "2023-02-03T06:56:09+00:00" + "time": "2024-02-02T06:05:50+00:00" }, { "name": "phpunit/php-text-template", - "version": "3.0.1", + "version": "4.0.0", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/php-text-template.git", - "reference": "0c7b06ff49e3d5072f057eb1fa59258bf287a748" + "reference": "d38f6cbff1cdb6f40b03c9811421561668cc133e" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-text-template/zipball/0c7b06ff49e3d5072f057eb1fa59258bf287a748", - "reference": "0c7b06ff49e3d5072f057eb1fa59258bf287a748", + "url": "https://api.github.com/repos/sebastianbergmann/php-text-template/zipball/d38f6cbff1cdb6f40b03c9811421561668cc133e", + "reference": "d38f6cbff1cdb6f40b03c9811421561668cc133e", "shasum": "" }, "require": { - "php": ">=8.1" + "php": ">=8.2" }, "require-dev": { - "phpunit/phpunit": "^10.0" + "phpunit/phpunit": "^11.0" }, "type": "library", "extra": { "branch-alias": { - "dev-main": "3.0-dev" + "dev-main": "4.0-dev" } }, "autoload": { @@ -581,7 +937,7 @@ "support": { "issues": "https://github.com/sebastianbergmann/php-text-template/issues", "security": "https://github.com/sebastianbergmann/php-text-template/security/policy", - "source": "https://github.com/sebastianbergmann/php-text-template/tree/3.0.1" + "source": "https://github.com/sebastianbergmann/php-text-template/tree/4.0.0" }, "funding": [ { @@ -589,32 +945,32 @@ "type": "github" } ], - "time": "2023-08-31T14:07:24+00:00" + "time": "2024-02-02T06:06:56+00:00" }, { "name": "phpunit/php-timer", - "version": "6.0.0", + "version": "7.0.0", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/php-timer.git", - "reference": "e2a2d67966e740530f4a3343fe2e030ffdc1161d" + "reference": "8a59d9e25720482ee7fcdf296595e08795b84dc5" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-timer/zipball/e2a2d67966e740530f4a3343fe2e030ffdc1161d", - "reference": "e2a2d67966e740530f4a3343fe2e030ffdc1161d", + "url": "https://api.github.com/repos/sebastianbergmann/php-timer/zipball/8a59d9e25720482ee7fcdf296595e08795b84dc5", + "reference": "8a59d9e25720482ee7fcdf296595e08795b84dc5", "shasum": "" }, "require": { - "php": ">=8.1" + "php": ">=8.2" }, "require-dev": { - "phpunit/phpunit": "^10.0" + "phpunit/phpunit": "^11.0" }, "type": "library", "extra": { "branch-alias": { - "dev-main": "6.0-dev" + "dev-main": "7.0-dev" } }, "autoload": { @@ -640,7 +996,8 @@ ], "support": { "issues": "https://github.com/sebastianbergmann/php-timer/issues", - "source": "https://github.com/sebastianbergmann/php-timer/tree/6.0.0" + "security": "https://github.com/sebastianbergmann/php-timer/security/policy", + "source": "https://github.com/sebastianbergmann/php-timer/tree/7.0.0" }, "funding": [ { @@ -648,20 +1005,20 @@ "type": "github" } ], - "time": "2023-02-03T06:57:52+00:00" + "time": "2024-02-02T06:08:01+00:00" }, { "name": "phpunit/phpunit", - "version": "10.5.12", + "version": "11.0.5", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/phpunit.git", - "reference": "41a9886b85ac7bf3929853baf96b95361cd69d2b" + "reference": "da2de3900beab025398ba37705b0f5ecafb3e1ab" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/41a9886b85ac7bf3929853baf96b95361cd69d2b", - "reference": "41a9886b85ac7bf3929853baf96b95361cd69d2b", + "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/da2de3900beab025398ba37705b0f5ecafb3e1ab", + "reference": "da2de3900beab025398ba37705b0f5ecafb3e1ab", "shasum": "" }, "require": { @@ -674,23 +1031,22 @@ "myclabs/deep-copy": "^1.10.1", "phar-io/manifest": "^2.0.3", "phar-io/version": "^3.0.2", - "php": ">=8.1", - "phpunit/php-code-coverage": "^10.1.5", - "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.1", - "sebastian/global-state": "^6.0.1", - "sebastian/object-enumerator": "^5.0", - "sebastian/recursion-context": "^5.0", - "sebastian/type": "^4.0", - "sebastian/version": "^4.0" + "php": ">=8.2", + "phpunit/php-code-coverage": "^11.0", + "phpunit/php-file-iterator": "^5.0", + "phpunit/php-invoker": "^5.0", + "phpunit/php-text-template": "^4.0", + "phpunit/php-timer": "^7.0", + "sebastian/cli-parser": "^3.0", + "sebastian/code-unit": "^3.0", + "sebastian/comparator": "^6.0", + "sebastian/diff": "^6.0", + "sebastian/environment": "^7.0", + "sebastian/exporter": "^6.0", + "sebastian/global-state": "^7.0", + "sebastian/object-enumerator": "^6.0", + "sebastian/type": "^5.0", + "sebastian/version": "^5.0" }, "suggest": { "ext-soap": "To be able to generate mocks based on WSDL files" @@ -701,7 +1057,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-main": "10.5-dev" + "dev-main": "11.0-dev" } }, "autoload": { @@ -733,7 +1089,7 @@ "support": { "issues": "https://github.com/sebastianbergmann/phpunit/issues", "security": "https://github.com/sebastianbergmann/phpunit/security/policy", - "source": "https://github.com/sebastianbergmann/phpunit/tree/10.5.12" + "source": "https://github.com/sebastianbergmann/phpunit/tree/11.0.5" }, "funding": [ { @@ -749,89 +1105,241 @@ "type": "tidelift" } ], - "time": "2024-03-09T12:04:07+00:00" + "time": "2024-03-09T12:12:14+00:00" }, { - "name": "sebastian/cli-parser", - "version": "2.0.1", + "name": "psr/cache", + "version": "3.0.0", "source": { "type": "git", - "url": "https://github.com/sebastianbergmann/cli-parser.git", - "reference": "c34583b87e7b7a8055bf6c450c2c77ce32a24084" + "url": "https://github.com/php-fig/cache.git", + "reference": "aa5030cfa5405eccfdcb1083ce040c2cb8d253bf" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/cli-parser/zipball/c34583b87e7b7a8055bf6c450c2c77ce32a24084", - "reference": "c34583b87e7b7a8055bf6c450c2c77ce32a24084", + "url": "https://api.github.com/repos/php-fig/cache/zipball/aa5030cfa5405eccfdcb1083ce040c2cb8d253bf", + "reference": "aa5030cfa5405eccfdcb1083ce040c2cb8d253bf", "shasum": "" }, "require": { - "php": ">=8.1" - }, - "require-dev": { - "phpunit/phpunit": "^10.0" + "php": ">=8.0.0" }, "type": "library", "extra": { "branch-alias": { - "dev-main": "2.0-dev" + "dev-master": "1.0.x-dev" } }, "autoload": { - "classmap": [ - "src/" - ] + "psr-4": { + "Psr\\Cache\\": "src/" + } }, "notification-url": "https://packagist.org/downloads/", "license": [ - "BSD-3-Clause" + "MIT" ], "authors": [ { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de", - "role": "lead" + "name": "PHP-FIG", + "homepage": "https://www.php-fig.org/" } ], - "description": "Library for parsing CLI options", - "homepage": "https://github.com/sebastianbergmann/cli-parser", + "description": "Common interface for caching libraries", + "keywords": [ + "cache", + "psr", + "psr-6" + ], "support": { - "issues": "https://github.com/sebastianbergmann/cli-parser/issues", - "security": "https://github.com/sebastianbergmann/cli-parser/security/policy", - "source": "https://github.com/sebastianbergmann/cli-parser/tree/2.0.1" + "source": "https://github.com/php-fig/cache/tree/3.0.0" }, - "funding": [ - { - "url": "https://github.com/sebastianbergmann", - "type": "github" - } - ], - "time": "2024-03-02T07:12:49+00:00" + "time": "2021-02-03T23:26:27+00:00" }, { - "name": "sebastian/code-unit", - "version": "2.0.0", + "name": "psr/container", + "version": "2.0.2", "source": { "type": "git", - "url": "https://github.com/sebastianbergmann/code-unit.git", - "reference": "a81fee9eef0b7a76af11d121767abc44c104e503" + "url": "https://github.com/php-fig/container.git", + "reference": "c71ecc56dfe541dbd90c5360474fbc405f8d5963" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/code-unit/zipball/a81fee9eef0b7a76af11d121767abc44c104e503", - "reference": "a81fee9eef0b7a76af11d121767abc44c104e503", + "url": "https://api.github.com/repos/php-fig/container/zipball/c71ecc56dfe541dbd90c5360474fbc405f8d5963", + "reference": "c71ecc56dfe541dbd90c5360474fbc405f8d5963", "shasum": "" }, "require": { - "php": ">=8.1" + "php": ">=7.4.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.0.x-dev" + } + }, + "autoload": { + "psr-4": { + "Psr\\Container\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "PHP-FIG", + "homepage": "https://www.php-fig.org/" + } + ], + "description": "Common Container Interface (PHP FIG PSR-11)", + "homepage": "https://github.com/php-fig/container", + "keywords": [ + "PSR-11", + "container", + "container-interface", + "container-interop", + "psr" + ], + "support": { + "issues": "https://github.com/php-fig/container/issues", + "source": "https://github.com/php-fig/container/tree/2.0.2" + }, + "time": "2021-11-05T16:47:00+00:00" + }, + { + "name": "psr/log", + "version": "3.0.0", + "source": { + "type": "git", + "url": "https://github.com/php-fig/log.git", + "reference": "fe5ea303b0887d5caefd3d431c3e61ad47037001" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/php-fig/log/zipball/fe5ea303b0887d5caefd3d431c3e61ad47037001", + "reference": "fe5ea303b0887d5caefd3d431c3e61ad47037001", + "shasum": "" + }, + "require": { + "php": ">=8.0.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "3.x-dev" + } + }, + "autoload": { + "psr-4": { + "Psr\\Log\\": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "PHP-FIG", + "homepage": "https://www.php-fig.org/" + } + ], + "description": "Common interface for logging libraries", + "homepage": "https://github.com/php-fig/log", + "keywords": [ + "log", + "psr", + "psr-3" + ], + "support": { + "source": "https://github.com/php-fig/log/tree/3.0.0" + }, + "time": "2021-07-14T16:46:02+00:00" + }, + { + "name": "sebastian/cli-parser", + "version": "3.0.1", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/cli-parser.git", + "reference": "00a74d5568694711f0222e54fb281e1d15fdf04a" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/cli-parser/zipball/00a74d5568694711f0222e54fb281e1d15fdf04a", + "reference": "00a74d5568694711f0222e54fb281e1d15fdf04a", + "shasum": "" + }, + "require": { + "php": ">=8.2" + }, + "require-dev": { + "phpunit/phpunit": "^11.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-main": "3.0-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de", + "role": "lead" + } + ], + "description": "Library for parsing CLI options", + "homepage": "https://github.com/sebastianbergmann/cli-parser", + "support": { + "issues": "https://github.com/sebastianbergmann/cli-parser/issues", + "security": "https://github.com/sebastianbergmann/cli-parser/security/policy", + "source": "https://github.com/sebastianbergmann/cli-parser/tree/3.0.1" + }, + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2024-03-02T07:26:58+00:00" + }, + { + "name": "sebastian/code-unit", + "version": "3.0.0", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/code-unit.git", + "reference": "6634549cb8d702282a04a774e36a7477d2bd9015" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/code-unit/zipball/6634549cb8d702282a04a774e36a7477d2bd9015", + "reference": "6634549cb8d702282a04a774e36a7477d2bd9015", + "shasum": "" + }, + "require": { + "php": ">=8.2" }, "require-dev": { - "phpunit/phpunit": "^10.0" + "phpunit/phpunit": "^11.0" }, "type": "library", "extra": { "branch-alias": { - "dev-main": "2.0-dev" + "dev-main": "3.0-dev" } }, "autoload": { @@ -854,7 +1362,8 @@ "homepage": "https://github.com/sebastianbergmann/code-unit", "support": { "issues": "https://github.com/sebastianbergmann/code-unit/issues", - "source": "https://github.com/sebastianbergmann/code-unit/tree/2.0.0" + "security": "https://github.com/sebastianbergmann/code-unit/security/policy", + "source": "https://github.com/sebastianbergmann/code-unit/tree/3.0.0" }, "funding": [ { @@ -862,32 +1371,32 @@ "type": "github" } ], - "time": "2023-02-03T06:58:43+00:00" + "time": "2024-02-02T05:50:41+00:00" }, { "name": "sebastian/code-unit-reverse-lookup", - "version": "3.0.0", + "version": "4.0.0", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/code-unit-reverse-lookup.git", - "reference": "5e3a687f7d8ae33fb362c5c0743794bbb2420a1d" + "reference": "df80c875d3e459b45c6039e4d9b71d4fbccae25d" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/code-unit-reverse-lookup/zipball/5e3a687f7d8ae33fb362c5c0743794bbb2420a1d", - "reference": "5e3a687f7d8ae33fb362c5c0743794bbb2420a1d", + "url": "https://api.github.com/repos/sebastianbergmann/code-unit-reverse-lookup/zipball/df80c875d3e459b45c6039e4d9b71d4fbccae25d", + "reference": "df80c875d3e459b45c6039e4d9b71d4fbccae25d", "shasum": "" }, "require": { - "php": ">=8.1" + "php": ">=8.2" }, "require-dev": { - "phpunit/phpunit": "^10.0" + "phpunit/phpunit": "^11.0" }, "type": "library", "extra": { "branch-alias": { - "dev-main": "3.0-dev" + "dev-main": "4.0-dev" } }, "autoload": { @@ -909,7 +1418,8 @@ "homepage": "https://github.com/sebastianbergmann/code-unit-reverse-lookup/", "support": { "issues": "https://github.com/sebastianbergmann/code-unit-reverse-lookup/issues", - "source": "https://github.com/sebastianbergmann/code-unit-reverse-lookup/tree/3.0.0" + "security": "https://github.com/sebastianbergmann/code-unit-reverse-lookup/security/policy", + "source": "https://github.com/sebastianbergmann/code-unit-reverse-lookup/tree/4.0.0" }, "funding": [ { @@ -917,36 +1427,36 @@ "type": "github" } ], - "time": "2023-02-03T06:59:15+00:00" + "time": "2024-02-02T05:52:17+00:00" }, { "name": "sebastian/comparator", - "version": "5.0.1", + "version": "6.0.0", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/comparator.git", - "reference": "2db5010a484d53ebf536087a70b4a5423c102372" + "reference": "bd0f2fa5b9257c69903537b266ccb80fcf940db8" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/comparator/zipball/2db5010a484d53ebf536087a70b4a5423c102372", - "reference": "2db5010a484d53ebf536087a70b4a5423c102372", + "url": "https://api.github.com/repos/sebastianbergmann/comparator/zipball/bd0f2fa5b9257c69903537b266ccb80fcf940db8", + "reference": "bd0f2fa5b9257c69903537b266ccb80fcf940db8", "shasum": "" }, "require": { "ext-dom": "*", "ext-mbstring": "*", - "php": ">=8.1", - "sebastian/diff": "^5.0", - "sebastian/exporter": "^5.0" + "php": ">=8.2", + "sebastian/diff": "^6.0", + "sebastian/exporter": "^6.0" }, "require-dev": { - "phpunit/phpunit": "^10.3" + "phpunit/phpunit": "^11.0" }, "type": "library", "extra": { "branch-alias": { - "dev-main": "5.0-dev" + "dev-main": "6.0-dev" } }, "autoload": { @@ -986,7 +1496,7 @@ "support": { "issues": "https://github.com/sebastianbergmann/comparator/issues", "security": "https://github.com/sebastianbergmann/comparator/security/policy", - "source": "https://github.com/sebastianbergmann/comparator/tree/5.0.1" + "source": "https://github.com/sebastianbergmann/comparator/tree/6.0.0" }, "funding": [ { @@ -994,33 +1504,33 @@ "type": "github" } ], - "time": "2023-08-14T13:18:12+00:00" + "time": "2024-02-02T05:53:45+00:00" }, { "name": "sebastian/complexity", - "version": "3.2.0", + "version": "4.0.0", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/complexity.git", - "reference": "68ff824baeae169ec9f2137158ee529584553799" + "reference": "88a434ad86150e11a606ac4866b09130712671f0" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/complexity/zipball/68ff824baeae169ec9f2137158ee529584553799", - "reference": "68ff824baeae169ec9f2137158ee529584553799", + "url": "https://api.github.com/repos/sebastianbergmann/complexity/zipball/88a434ad86150e11a606ac4866b09130712671f0", + "reference": "88a434ad86150e11a606ac4866b09130712671f0", "shasum": "" }, "require": { - "nikic/php-parser": "^4.18 || ^5.0", - "php": ">=8.1" + "nikic/php-parser": "^5.0", + "php": ">=8.2" }, "require-dev": { - "phpunit/phpunit": "^10.0" + "phpunit/phpunit": "^11.0" }, "type": "library", "extra": { "branch-alias": { - "dev-main": "3.2-dev" + "dev-main": "4.0-dev" } }, "autoload": { @@ -1044,7 +1554,7 @@ "support": { "issues": "https://github.com/sebastianbergmann/complexity/issues", "security": "https://github.com/sebastianbergmann/complexity/security/policy", - "source": "https://github.com/sebastianbergmann/complexity/tree/3.2.0" + "source": "https://github.com/sebastianbergmann/complexity/tree/4.0.0" }, "funding": [ { @@ -1052,33 +1562,33 @@ "type": "github" } ], - "time": "2023-12-21T08:37:17+00:00" + "time": "2024-02-02T05:55:19+00:00" }, { "name": "sebastian/diff", - "version": "5.1.1", + "version": "6.0.1", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/diff.git", - "reference": "c41e007b4b62af48218231d6c2275e4c9b975b2e" + "reference": "ab83243ecc233de5655b76f577711de9f842e712" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/diff/zipball/c41e007b4b62af48218231d6c2275e4c9b975b2e", - "reference": "c41e007b4b62af48218231d6c2275e4c9b975b2e", + "url": "https://api.github.com/repos/sebastianbergmann/diff/zipball/ab83243ecc233de5655b76f577711de9f842e712", + "reference": "ab83243ecc233de5655b76f577711de9f842e712", "shasum": "" }, "require": { - "php": ">=8.1" + "php": ">=8.2" }, "require-dev": { - "phpunit/phpunit": "^10.0", - "symfony/process": "^6.4" + "phpunit/phpunit": "^11.0", + "symfony/process": "^4.2 || ^5" }, "type": "library", "extra": { "branch-alias": { - "dev-main": "5.1-dev" + "dev-main": "6.0-dev" } }, "autoload": { @@ -1111,7 +1621,7 @@ "support": { "issues": "https://github.com/sebastianbergmann/diff/issues", "security": "https://github.com/sebastianbergmann/diff/security/policy", - "source": "https://github.com/sebastianbergmann/diff/tree/5.1.1" + "source": "https://github.com/sebastianbergmann/diff/tree/6.0.1" }, "funding": [ { @@ -1119,27 +1629,27 @@ "type": "github" } ], - "time": "2024-03-02T07:15:17+00:00" + "time": "2024-03-02T07:30:33+00:00" }, { "name": "sebastian/environment", - "version": "6.0.1", + "version": "7.0.0", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/environment.git", - "reference": "43c751b41d74f96cbbd4e07b7aec9675651e2951" + "reference": "100d8b855d7180f79f9a9a5c483f2d960581c3ea" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/environment/zipball/43c751b41d74f96cbbd4e07b7aec9675651e2951", - "reference": "43c751b41d74f96cbbd4e07b7aec9675651e2951", + "url": "https://api.github.com/repos/sebastianbergmann/environment/zipball/100d8b855d7180f79f9a9a5c483f2d960581c3ea", + "reference": "100d8b855d7180f79f9a9a5c483f2d960581c3ea", "shasum": "" }, "require": { - "php": ">=8.1" + "php": ">=8.2" }, "require-dev": { - "phpunit/phpunit": "^10.0" + "phpunit/phpunit": "^11.0" }, "suggest": { "ext-posix": "*" @@ -1147,7 +1657,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-main": "6.0-dev" + "dev-main": "7.0-dev" } }, "autoload": { @@ -1175,7 +1685,7 @@ "support": { "issues": "https://github.com/sebastianbergmann/environment/issues", "security": "https://github.com/sebastianbergmann/environment/security/policy", - "source": "https://github.com/sebastianbergmann/environment/tree/6.0.1" + "source": "https://github.com/sebastianbergmann/environment/tree/7.0.0" }, "funding": [ { @@ -1183,34 +1693,34 @@ "type": "github" } ], - "time": "2023-04-11T05:39:26+00:00" + "time": "2024-02-02T05:57:54+00:00" }, { "name": "sebastian/exporter", - "version": "5.1.2", + "version": "6.0.1", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/exporter.git", - "reference": "955288482d97c19a372d3f31006ab3f37da47adf" + "reference": "f291e5a317c321c0381fa9ecc796fa2d21b186da" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/exporter/zipball/955288482d97c19a372d3f31006ab3f37da47adf", - "reference": "955288482d97c19a372d3f31006ab3f37da47adf", + "url": "https://api.github.com/repos/sebastianbergmann/exporter/zipball/f291e5a317c321c0381fa9ecc796fa2d21b186da", + "reference": "f291e5a317c321c0381fa9ecc796fa2d21b186da", "shasum": "" }, "require": { "ext-mbstring": "*", - "php": ">=8.1", - "sebastian/recursion-context": "^5.0" + "php": ">=8.2", + "sebastian/recursion-context": "^6.0" }, "require-dev": { - "phpunit/phpunit": "^10.0" + "phpunit/phpunit": "^11.0" }, "type": "library", "extra": { "branch-alias": { - "dev-main": "5.1-dev" + "dev-main": "6.0-dev" } }, "autoload": { @@ -1253,7 +1763,7 @@ "support": { "issues": "https://github.com/sebastianbergmann/exporter/issues", "security": "https://github.com/sebastianbergmann/exporter/security/policy", - "source": "https://github.com/sebastianbergmann/exporter/tree/5.1.2" + "source": "https://github.com/sebastianbergmann/exporter/tree/6.0.1" }, "funding": [ { @@ -1261,35 +1771,35 @@ "type": "github" } ], - "time": "2024-03-02T07:17:12+00:00" + "time": "2024-03-02T07:28:20+00:00" }, { "name": "sebastian/global-state", - "version": "6.0.2", + "version": "7.0.1", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/global-state.git", - "reference": "987bafff24ecc4c9ac418cab1145b96dd6e9cbd9" + "reference": "c3a307e832f2e69c7ef869e31fc644fde0e7cb3e" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/global-state/zipball/987bafff24ecc4c9ac418cab1145b96dd6e9cbd9", - "reference": "987bafff24ecc4c9ac418cab1145b96dd6e9cbd9", + "url": "https://api.github.com/repos/sebastianbergmann/global-state/zipball/c3a307e832f2e69c7ef869e31fc644fde0e7cb3e", + "reference": "c3a307e832f2e69c7ef869e31fc644fde0e7cb3e", "shasum": "" }, "require": { - "php": ">=8.1", - "sebastian/object-reflector": "^3.0", - "sebastian/recursion-context": "^5.0" + "php": ">=8.2", + "sebastian/object-reflector": "^4.0", + "sebastian/recursion-context": "^6.0" }, "require-dev": { "ext-dom": "*", - "phpunit/phpunit": "^10.0" + "phpunit/phpunit": "^11.0" }, "type": "library", "extra": { "branch-alias": { - "dev-main": "6.0-dev" + "dev-main": "7.0-dev" } }, "autoload": { @@ -1315,7 +1825,7 @@ "support": { "issues": "https://github.com/sebastianbergmann/global-state/issues", "security": "https://github.com/sebastianbergmann/global-state/security/policy", - "source": "https://github.com/sebastianbergmann/global-state/tree/6.0.2" + "source": "https://github.com/sebastianbergmann/global-state/tree/7.0.1" }, "funding": [ { @@ -1323,33 +1833,33 @@ "type": "github" } ], - "time": "2024-03-02T07:19:19+00:00" + "time": "2024-03-02T07:32:10+00:00" }, { "name": "sebastian/lines-of-code", - "version": "2.0.2", + "version": "3.0.0", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/lines-of-code.git", - "reference": "856e7f6a75a84e339195d48c556f23be2ebf75d0" + "reference": "376c5b3f6b43c78fdc049740bca76a7c846706c0" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/lines-of-code/zipball/856e7f6a75a84e339195d48c556f23be2ebf75d0", - "reference": "856e7f6a75a84e339195d48c556f23be2ebf75d0", + "url": "https://api.github.com/repos/sebastianbergmann/lines-of-code/zipball/376c5b3f6b43c78fdc049740bca76a7c846706c0", + "reference": "376c5b3f6b43c78fdc049740bca76a7c846706c0", "shasum": "" }, "require": { - "nikic/php-parser": "^4.18 || ^5.0", - "php": ">=8.1" + "nikic/php-parser": "^5.0", + "php": ">=8.2" }, "require-dev": { - "phpunit/phpunit": "^10.0" + "phpunit/phpunit": "^11.0" }, "type": "library", "extra": { "branch-alias": { - "dev-main": "2.0-dev" + "dev-main": "3.0-dev" } }, "autoload": { @@ -1373,7 +1883,7 @@ "support": { "issues": "https://github.com/sebastianbergmann/lines-of-code/issues", "security": "https://github.com/sebastianbergmann/lines-of-code/security/policy", - "source": "https://github.com/sebastianbergmann/lines-of-code/tree/2.0.2" + "source": "https://github.com/sebastianbergmann/lines-of-code/tree/3.0.0" }, "funding": [ { @@ -1381,34 +1891,34 @@ "type": "github" } ], - "time": "2023-12-21T08:38:20+00:00" + "time": "2024-02-02T06:00:36+00:00" }, { "name": "sebastian/object-enumerator", - "version": "5.0.0", + "version": "6.0.0", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/object-enumerator.git", - "reference": "202d0e344a580d7f7d04b3fafce6933e59dae906" + "reference": "f75f6c460da0bbd9668f43a3dde0ec0ba7faa678" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/object-enumerator/zipball/202d0e344a580d7f7d04b3fafce6933e59dae906", - "reference": "202d0e344a580d7f7d04b3fafce6933e59dae906", + "url": "https://api.github.com/repos/sebastianbergmann/object-enumerator/zipball/f75f6c460da0bbd9668f43a3dde0ec0ba7faa678", + "reference": "f75f6c460da0bbd9668f43a3dde0ec0ba7faa678", "shasum": "" }, "require": { - "php": ">=8.1", - "sebastian/object-reflector": "^3.0", - "sebastian/recursion-context": "^5.0" + "php": ">=8.2", + "sebastian/object-reflector": "^4.0", + "sebastian/recursion-context": "^6.0" }, "require-dev": { - "phpunit/phpunit": "^10.0" + "phpunit/phpunit": "^11.0" }, "type": "library", "extra": { "branch-alias": { - "dev-main": "5.0-dev" + "dev-main": "6.0-dev" } }, "autoload": { @@ -1430,7 +1940,8 @@ "homepage": "https://github.com/sebastianbergmann/object-enumerator/", "support": { "issues": "https://github.com/sebastianbergmann/object-enumerator/issues", - "source": "https://github.com/sebastianbergmann/object-enumerator/tree/5.0.0" + "security": "https://github.com/sebastianbergmann/object-enumerator/security/policy", + "source": "https://github.com/sebastianbergmann/object-enumerator/tree/6.0.0" }, "funding": [ { @@ -1438,32 +1949,32 @@ "type": "github" } ], - "time": "2023-02-03T07:08:32+00:00" + "time": "2024-02-02T06:01:29+00:00" }, { "name": "sebastian/object-reflector", - "version": "3.0.0", + "version": "4.0.0", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/object-reflector.git", - "reference": "24ed13d98130f0e7122df55d06c5c4942a577957" + "reference": "bb2a6255d30853425fd38f032eb64ced9f7f132d" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/object-reflector/zipball/24ed13d98130f0e7122df55d06c5c4942a577957", - "reference": "24ed13d98130f0e7122df55d06c5c4942a577957", + "url": "https://api.github.com/repos/sebastianbergmann/object-reflector/zipball/bb2a6255d30853425fd38f032eb64ced9f7f132d", + "reference": "bb2a6255d30853425fd38f032eb64ced9f7f132d", "shasum": "" }, "require": { - "php": ">=8.1" + "php": ">=8.2" }, "require-dev": { - "phpunit/phpunit": "^10.0" + "phpunit/phpunit": "^11.0" }, "type": "library", "extra": { "branch-alias": { - "dev-main": "3.0-dev" + "dev-main": "4.0-dev" } }, "autoload": { @@ -1485,7 +1996,8 @@ "homepage": "https://github.com/sebastianbergmann/object-reflector/", "support": { "issues": "https://github.com/sebastianbergmann/object-reflector/issues", - "source": "https://github.com/sebastianbergmann/object-reflector/tree/3.0.0" + "security": "https://github.com/sebastianbergmann/object-reflector/security/policy", + "source": "https://github.com/sebastianbergmann/object-reflector/tree/4.0.0" }, "funding": [ { @@ -1493,32 +2005,32 @@ "type": "github" } ], - "time": "2023-02-03T07:06:18+00:00" + "time": "2024-02-02T06:02:18+00:00" }, { "name": "sebastian/recursion-context", - "version": "5.0.0", + "version": "6.0.0", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/recursion-context.git", - "reference": "05909fb5bc7df4c52992396d0116aed689f93712" + "reference": "b75224967b5a466925c6d54e68edd0edf8dd4ed4" }, "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/b75224967b5a466925c6d54e68edd0edf8dd4ed4", + "reference": "b75224967b5a466925c6d54e68edd0edf8dd4ed4", "shasum": "" }, "require": { - "php": ">=8.1" + "php": ">=8.2" }, "require-dev": { - "phpunit/phpunit": "^10.0" + "phpunit/phpunit": "^11.0" }, "type": "library", "extra": { "branch-alias": { - "dev-main": "5.0-dev" + "dev-main": "6.0-dev" } }, "autoload": { @@ -1548,7 +2060,8 @@ "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/6.0.0" }, "funding": [ { @@ -1556,32 +2069,32 @@ "type": "github" } ], - "time": "2023-02-03T07:05:40+00:00" + "time": "2024-02-02T06:08:48+00:00" }, { "name": "sebastian/type", - "version": "4.0.0", + "version": "5.0.0", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/type.git", - "reference": "462699a16464c3944eefc02ebdd77882bd3925bf" + "reference": "b8502785eb3523ca0dd4afe9ca62235590020f3f" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/type/zipball/462699a16464c3944eefc02ebdd77882bd3925bf", - "reference": "462699a16464c3944eefc02ebdd77882bd3925bf", + "url": "https://api.github.com/repos/sebastianbergmann/type/zipball/b8502785eb3523ca0dd4afe9ca62235590020f3f", + "reference": "b8502785eb3523ca0dd4afe9ca62235590020f3f", "shasum": "" }, "require": { - "php": ">=8.1" + "php": ">=8.2" }, "require-dev": { - "phpunit/phpunit": "^10.0" + "phpunit/phpunit": "^11.0" }, "type": "library", "extra": { "branch-alias": { - "dev-main": "4.0-dev" + "dev-main": "5.0-dev" } }, "autoload": { @@ -1604,7 +2117,8 @@ "homepage": "https://github.com/sebastianbergmann/type", "support": { "issues": "https://github.com/sebastianbergmann/type/issues", - "source": "https://github.com/sebastianbergmann/type/tree/4.0.0" + "security": "https://github.com/sebastianbergmann/type/security/policy", + "source": "https://github.com/sebastianbergmann/type/tree/5.0.0" }, "funding": [ { @@ -1612,29 +2126,29 @@ "type": "github" } ], - "time": "2023-02-03T07:10:45+00:00" + "time": "2024-02-02T06:09:34+00:00" }, { "name": "sebastian/version", - "version": "4.0.1", + "version": "5.0.0", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/version.git", - "reference": "c51fa83a5d8f43f1402e3f32a005e6262244ef17" + "reference": "13999475d2cb1ab33cb73403ba356a814fdbb001" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/version/zipball/c51fa83a5d8f43f1402e3f32a005e6262244ef17", - "reference": "c51fa83a5d8f43f1402e3f32a005e6262244ef17", + "url": "https://api.github.com/repos/sebastianbergmann/version/zipball/13999475d2cb1ab33cb73403ba356a814fdbb001", + "reference": "13999475d2cb1ab33cb73403ba356a814fdbb001", "shasum": "" }, "require": { - "php": ">=8.1" + "php": ">=8.2" }, "type": "library", "extra": { "branch-alias": { - "dev-main": "4.0-dev" + "dev-main": "5.0-dev" } }, "autoload": { @@ -1657,7 +2171,8 @@ "homepage": "https://github.com/sebastianbergmann/version", "support": { "issues": "https://github.com/sebastianbergmann/version/issues", - "source": "https://github.com/sebastianbergmann/version/tree/4.0.1" + "security": "https://github.com/sebastianbergmann/version/security/policy", + "source": "https://github.com/sebastianbergmann/version/tree/5.0.0" }, "funding": [ { @@ -1665,57 +2180,1071 @@ "type": "github" } ], - "time": "2023-02-07T11:34:05+00:00" + "time": "2024-02-02T06:10:47+00:00" }, { - "name": "theseer/tokenizer", - "version": "1.2.3", + "name": "seld/jsonlint", + "version": "1.10.2", "source": { "type": "git", - "url": "https://github.com/theseer/tokenizer.git", - "reference": "737eda637ed5e28c3413cb1ebe8bb52cbf1ca7a2" + "url": "https://github.com/Seldaek/jsonlint.git", + "reference": "9bb7db07b5d66d90f6ebf542f09fc67d800e5259" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/theseer/tokenizer/zipball/737eda637ed5e28c3413cb1ebe8bb52cbf1ca7a2", - "reference": "737eda637ed5e28c3413cb1ebe8bb52cbf1ca7a2", + "url": "https://api.github.com/repos/Seldaek/jsonlint/zipball/9bb7db07b5d66d90f6ebf542f09fc67d800e5259", + "reference": "9bb7db07b5d66d90f6ebf542f09fc67d800e5259", "shasum": "" }, "require": { - "ext-dom": "*", - "ext-tokenizer": "*", - "ext-xmlwriter": "*", - "php": "^7.2 || ^8.0" + "php": "^5.3 || ^7.0 || ^8.0" + }, + "require-dev": { + "phpstan/phpstan": "^1.5", + "phpunit/phpunit": "^4.8.35 || ^5.7 || ^6.0 || ^8.5.13" }, + "bin": [ + "bin/jsonlint" + ], "type": "library", "autoload": { - "classmap": [ - "src/" + "psr-4": { + "Seld\\JsonLint\\": "src/Seld/JsonLint/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Jordi Boggiano", + "email": "j.boggiano@seld.be", + "homepage": "https://seld.be" + } + ], + "description": "JSON Linter", + "keywords": [ + "json", + "linter", + "parser", + "validator" + ], + "support": { + "issues": "https://github.com/Seldaek/jsonlint/issues", + "source": "https://github.com/Seldaek/jsonlint/tree/1.10.2" + }, + "funding": [ + { + "url": "https://github.com/Seldaek", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/seld/jsonlint", + "type": "tidelift" + } + ], + "time": "2024-02-07T12:57:50+00:00" + }, + { + "name": "symfony/console", + "version": "v7.0.4", + "source": { + "type": "git", + "url": "https://github.com/symfony/console.git", + "reference": "6b099f3306f7c9c2d2786ed736d0026b2903205f" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/console/zipball/6b099f3306f7c9c2d2786ed736d0026b2903205f", + "reference": "6b099f3306f7c9c2d2786ed736d0026b2903205f", + "shasum": "" + }, + "require": { + "php": ">=8.2", + "symfony/polyfill-mbstring": "~1.0", + "symfony/service-contracts": "^2.5|^3", + "symfony/string": "^6.4|^7.0" + }, + "conflict": { + "symfony/dependency-injection": "<6.4", + "symfony/dotenv": "<6.4", + "symfony/event-dispatcher": "<6.4", + "symfony/lock": "<6.4", + "symfony/process": "<6.4" + }, + "provide": { + "psr/log-implementation": "1.0|2.0|3.0" + }, + "require-dev": { + "psr/log": "^1|^2|^3", + "symfony/config": "^6.4|^7.0", + "symfony/dependency-injection": "^6.4|^7.0", + "symfony/event-dispatcher": "^6.4|^7.0", + "symfony/http-foundation": "^6.4|^7.0", + "symfony/http-kernel": "^6.4|^7.0", + "symfony/lock": "^6.4|^7.0", + "symfony/messenger": "^6.4|^7.0", + "symfony/process": "^6.4|^7.0", + "symfony/stopwatch": "^6.4|^7.0", + "symfony/var-dumper": "^6.4|^7.0" + }, + "type": "library", + "autoload": { + "psr-4": { + "Symfony\\Component\\Console\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" ] }, "notification-url": "https://packagist.org/downloads/", "license": [ - "BSD-3-Clause" + "MIT" ], "authors": [ { - "name": "Arne Blankerts", - "email": "arne@blankerts.de", - "role": "Developer" + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" } ], - "description": "A small library for converting tokenized PHP source code into XML and potentially other formats", + "description": "Eases the creation of beautiful and testable command line interfaces", + "homepage": "https://symfony.com", + "keywords": [ + "cli", + "command-line", + "console", + "terminal" + ], "support": { - "issues": "https://github.com/theseer/tokenizer/issues", - "source": "https://github.com/theseer/tokenizer/tree/1.2.3" + "source": "https://github.com/symfony/console/tree/v7.0.4" }, "funding": [ { - "url": "https://github.com/theseer", + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" } ], - "time": "2024-03-03T12:36:25+00:00" + "time": "2024-02-22T20:27:20+00:00" + }, + { + "name": "symfony/deprecation-contracts", + "version": "v3.4.0", + "source": { + "type": "git", + "url": "https://github.com/symfony/deprecation-contracts.git", + "reference": "7c3aff79d10325257a001fcf92d991f24fc967cf" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/deprecation-contracts/zipball/7c3aff79d10325257a001fcf92d991f24fc967cf", + "reference": "7c3aff79d10325257a001fcf92d991f24fc967cf", + "shasum": "" + }, + "require": { + "php": ">=8.1" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-main": "3.4-dev" + }, + "thanks": { + "name": "symfony/contracts", + "url": "https://github.com/symfony/contracts" + } + }, + "autoload": { + "files": [ + "function.php" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Nicolas Grekas", + "email": "p@tchwork.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "A generic function and convention to trigger deprecation notices", + "homepage": "https://symfony.com", + "support": { + "source": "https://github.com/symfony/deprecation-contracts/tree/v3.4.0" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2023-05-23T14:45:45+00:00" + }, + { + "name": "symfony/filesystem", + "version": "v7.0.3", + "source": { + "type": "git", + "url": "https://github.com/symfony/filesystem.git", + "reference": "2890e3a825bc0c0558526c04499c13f83e1b6b12" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/filesystem/zipball/2890e3a825bc0c0558526c04499c13f83e1b6b12", + "reference": "2890e3a825bc0c0558526c04499c13f83e1b6b12", + "shasum": "" + }, + "require": { + "php": ">=8.2", + "symfony/polyfill-ctype": "~1.8", + "symfony/polyfill-mbstring": "~1.8" + }, + "type": "library", + "autoload": { + "psr-4": { + "Symfony\\Component\\Filesystem\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Provides basic utilities for the filesystem", + "homepage": "https://symfony.com", + "support": { + "source": "https://github.com/symfony/filesystem/tree/v7.0.3" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2024-01-23T15:02:46+00:00" + }, + { + "name": "symfony/finder", + "version": "v7.0.0", + "source": { + "type": "git", + "url": "https://github.com/symfony/finder.git", + "reference": "6e5688d69f7cfc4ed4a511e96007e06c2d34ce56" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/finder/zipball/6e5688d69f7cfc4ed4a511e96007e06c2d34ce56", + "reference": "6e5688d69f7cfc4ed4a511e96007e06c2d34ce56", + "shasum": "" + }, + "require": { + "php": ">=8.2" + }, + "require-dev": { + "symfony/filesystem": "^6.4|^7.0" + }, + "type": "library", + "autoload": { + "psr-4": { + "Symfony\\Component\\Finder\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Finds files and directories via an intuitive fluent interface", + "homepage": "https://symfony.com", + "support": { + "source": "https://github.com/symfony/finder/tree/v7.0.0" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2023-10-31T17:59:56+00:00" + }, + { + "name": "symfony/options-resolver", + "version": "v7.0.0", + "source": { + "type": "git", + "url": "https://github.com/symfony/options-resolver.git", + "reference": "700ff4096e346f54cb628ea650767c8130f1001f" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/options-resolver/zipball/700ff4096e346f54cb628ea650767c8130f1001f", + "reference": "700ff4096e346f54cb628ea650767c8130f1001f", + "shasum": "" + }, + "require": { + "php": ">=8.2", + "symfony/deprecation-contracts": "^2.5|^3" + }, + "type": "library", + "autoload": { + "psr-4": { + "Symfony\\Component\\OptionsResolver\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Provides an improved replacement for the array_replace PHP function", + "homepage": "https://symfony.com", + "keywords": [ + "config", + "configuration", + "options" + ], + "support": { + "source": "https://github.com/symfony/options-resolver/tree/v7.0.0" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2023-08-08T10:20:21+00:00" + }, + { + "name": "symfony/polyfill-ctype", + "version": "v1.29.0", + "source": { + "type": "git", + "url": "https://github.com/symfony/polyfill-ctype.git", + "reference": "ef4d7e442ca910c4764bce785146269b30cb5fc4" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/polyfill-ctype/zipball/ef4d7e442ca910c4764bce785146269b30cb5fc4", + "reference": "ef4d7e442ca910c4764bce785146269b30cb5fc4", + "shasum": "" + }, + "require": { + "php": ">=7.1" + }, + "provide": { + "ext-ctype": "*" + }, + "suggest": { + "ext-ctype": "For best performance" + }, + "type": "library", + "extra": { + "thanks": { + "name": "symfony/polyfill", + "url": "https://github.com/symfony/polyfill" + } + }, + "autoload": { + "files": [ + "bootstrap.php" + ], + "psr-4": { + "Symfony\\Polyfill\\Ctype\\": "" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Gert de Pagter", + "email": "BackEndTea@gmail.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony polyfill for ctype functions", + "homepage": "https://symfony.com", + "keywords": [ + "compatibility", + "ctype", + "polyfill", + "portable" + ], + "support": { + "source": "https://github.com/symfony/polyfill-ctype/tree/v1.29.0" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2024-01-29T20:11:03+00:00" + }, + { + "name": "symfony/polyfill-intl-grapheme", + "version": "v1.29.0", + "source": { + "type": "git", + "url": "https://github.com/symfony/polyfill-intl-grapheme.git", + "reference": "32a9da87d7b3245e09ac426c83d334ae9f06f80f" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/polyfill-intl-grapheme/zipball/32a9da87d7b3245e09ac426c83d334ae9f06f80f", + "reference": "32a9da87d7b3245e09ac426c83d334ae9f06f80f", + "shasum": "" + }, + "require": { + "php": ">=7.1" + }, + "suggest": { + "ext-intl": "For best performance" + }, + "type": "library", + "extra": { + "thanks": { + "name": "symfony/polyfill", + "url": "https://github.com/symfony/polyfill" + } + }, + "autoload": { + "files": [ + "bootstrap.php" + ], + "psr-4": { + "Symfony\\Polyfill\\Intl\\Grapheme\\": "" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Nicolas Grekas", + "email": "p@tchwork.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony polyfill for intl's grapheme_* functions", + "homepage": "https://symfony.com", + "keywords": [ + "compatibility", + "grapheme", + "intl", + "polyfill", + "portable", + "shim" + ], + "support": { + "source": "https://github.com/symfony/polyfill-intl-grapheme/tree/v1.29.0" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2024-01-29T20:11:03+00:00" + }, + { + "name": "symfony/polyfill-intl-normalizer", + "version": "v1.29.0", + "source": { + "type": "git", + "url": "https://github.com/symfony/polyfill-intl-normalizer.git", + "reference": "bc45c394692b948b4d383a08d7753968bed9a83d" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/polyfill-intl-normalizer/zipball/bc45c394692b948b4d383a08d7753968bed9a83d", + "reference": "bc45c394692b948b4d383a08d7753968bed9a83d", + "shasum": "" + }, + "require": { + "php": ">=7.1" + }, + "suggest": { + "ext-intl": "For best performance" + }, + "type": "library", + "extra": { + "thanks": { + "name": "symfony/polyfill", + "url": "https://github.com/symfony/polyfill" + } + }, + "autoload": { + "files": [ + "bootstrap.php" + ], + "psr-4": { + "Symfony\\Polyfill\\Intl\\Normalizer\\": "" + }, + "classmap": [ + "Resources/stubs" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Nicolas Grekas", + "email": "p@tchwork.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony polyfill for intl's Normalizer class and related functions", + "homepage": "https://symfony.com", + "keywords": [ + "compatibility", + "intl", + "normalizer", + "polyfill", + "portable", + "shim" + ], + "support": { + "source": "https://github.com/symfony/polyfill-intl-normalizer/tree/v1.29.0" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2024-01-29T20:11:03+00:00" + }, + { + "name": "symfony/polyfill-mbstring", + "version": "v1.29.0", + "source": { + "type": "git", + "url": "https://github.com/symfony/polyfill-mbstring.git", + "reference": "9773676c8a1bb1f8d4340a62efe641cf76eda7ec" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/9773676c8a1bb1f8d4340a62efe641cf76eda7ec", + "reference": "9773676c8a1bb1f8d4340a62efe641cf76eda7ec", + "shasum": "" + }, + "require": { + "php": ">=7.1" + }, + "provide": { + "ext-mbstring": "*" + }, + "suggest": { + "ext-mbstring": "For best performance" + }, + "type": "library", + "extra": { + "thanks": { + "name": "symfony/polyfill", + "url": "https://github.com/symfony/polyfill" + } + }, + "autoload": { + "files": [ + "bootstrap.php" + ], + "psr-4": { + "Symfony\\Polyfill\\Mbstring\\": "" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Nicolas Grekas", + "email": "p@tchwork.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony polyfill for the Mbstring extension", + "homepage": "https://symfony.com", + "keywords": [ + "compatibility", + "mbstring", + "polyfill", + "portable", + "shim" + ], + "support": { + "source": "https://github.com/symfony/polyfill-mbstring/tree/v1.29.0" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2024-01-29T20:11:03+00:00" + }, + { + "name": "symfony/process", + "version": "v7.0.4", + "source": { + "type": "git", + "url": "https://github.com/symfony/process.git", + "reference": "0e7727191c3b71ebec6d529fa0e50a01ca5679e9" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/process/zipball/0e7727191c3b71ebec6d529fa0e50a01ca5679e9", + "reference": "0e7727191c3b71ebec6d529fa0e50a01ca5679e9", + "shasum": "" + }, + "require": { + "php": ">=8.2" + }, + "type": "library", + "autoload": { + "psr-4": { + "Symfony\\Component\\Process\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Executes commands in sub-processes", + "homepage": "https://symfony.com", + "support": { + "source": "https://github.com/symfony/process/tree/v7.0.4" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2024-02-22T20:27:20+00:00" + }, + { + "name": "symfony/service-contracts", + "version": "v3.4.1", + "source": { + "type": "git", + "url": "https://github.com/symfony/service-contracts.git", + "reference": "fe07cbc8d837f60caf7018068e350cc5163681a0" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/service-contracts/zipball/fe07cbc8d837f60caf7018068e350cc5163681a0", + "reference": "fe07cbc8d837f60caf7018068e350cc5163681a0", + "shasum": "" + }, + "require": { + "php": ">=8.1", + "psr/container": "^1.1|^2.0" + }, + "conflict": { + "ext-psr": "<1.1|>=2" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-main": "3.4-dev" + }, + "thanks": { + "name": "symfony/contracts", + "url": "https://github.com/symfony/contracts" + } + }, + "autoload": { + "psr-4": { + "Symfony\\Contracts\\Service\\": "" + }, + "exclude-from-classmap": [ + "/Test/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Nicolas Grekas", + "email": "p@tchwork.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Generic abstractions related to writing services", + "homepage": "https://symfony.com", + "keywords": [ + "abstractions", + "contracts", + "decoupling", + "interfaces", + "interoperability", + "standards" + ], + "support": { + "source": "https://github.com/symfony/service-contracts/tree/v3.4.1" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2023-12-26T14:02:43+00:00" + }, + { + "name": "symfony/string", + "version": "v7.0.4", + "source": { + "type": "git", + "url": "https://github.com/symfony/string.git", + "reference": "f5832521b998b0bec40bee688ad5de98d4cf111b" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/string/zipball/f5832521b998b0bec40bee688ad5de98d4cf111b", + "reference": "f5832521b998b0bec40bee688ad5de98d4cf111b", + "shasum": "" + }, + "require": { + "php": ">=8.2", + "symfony/polyfill-ctype": "~1.8", + "symfony/polyfill-intl-grapheme": "~1.0", + "symfony/polyfill-intl-normalizer": "~1.0", + "symfony/polyfill-mbstring": "~1.0" + }, + "conflict": { + "symfony/translation-contracts": "<2.5" + }, + "require-dev": { + "symfony/error-handler": "^6.4|^7.0", + "symfony/http-client": "^6.4|^7.0", + "symfony/intl": "^6.4|^7.0", + "symfony/translation-contracts": "^2.5|^3.0", + "symfony/var-exporter": "^6.4|^7.0" + }, + "type": "library", + "autoload": { + "files": [ + "Resources/functions.php" + ], + "psr-4": { + "Symfony\\Component\\String\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Nicolas Grekas", + "email": "p@tchwork.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Provides an object-oriented API to strings and deals with bytes, UTF-8 code points and grapheme clusters in a unified way", + "homepage": "https://symfony.com", + "keywords": [ + "grapheme", + "i18n", + "string", + "unicode", + "utf-8", + "utf8" + ], + "support": { + "source": "https://github.com/symfony/string/tree/v7.0.4" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2024-02-01T13:17:36+00:00" + }, + { + "name": "theseer/tokenizer", + "version": "1.2.3", + "source": { + "type": "git", + "url": "https://github.com/theseer/tokenizer.git", + "reference": "737eda637ed5e28c3413cb1ebe8bb52cbf1ca7a2" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/theseer/tokenizer/zipball/737eda637ed5e28c3413cb1ebe8bb52cbf1ca7a2", + "reference": "737eda637ed5e28c3413cb1ebe8bb52cbf1ca7a2", + "shasum": "" + }, + "require": { + "ext-dom": "*", + "ext-tokenizer": "*", + "ext-xmlwriter": "*", + "php": "^7.2 || ^8.0" + }, + "type": "library", + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Arne Blankerts", + "email": "arne@blankerts.de", + "role": "Developer" + } + ], + "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.3" + }, + "funding": [ + { + "url": "https://github.com/theseer", + "type": "github" + } + ], + "time": "2024-03-03T12:36:25+00:00" + }, + { + "name": "webmozart/glob", + "version": "4.7.0", + "source": { + "type": "git", + "url": "https://github.com/webmozarts/glob.git", + "reference": "8a2842112d6916e61e0e15e316465b611f3abc17" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/webmozarts/glob/zipball/8a2842112d6916e61e0e15e316465b611f3abc17", + "reference": "8a2842112d6916e61e0e15e316465b611f3abc17", + "shasum": "" + }, + "require": { + "php": "^7.3 || ^8.0.0" + }, + "require-dev": { + "phpunit/phpunit": "^9.5", + "symfony/filesystem": "^5.3" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "4.1-dev" + } + }, + "autoload": { + "psr-4": { + "Webmozart\\Glob\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Bernhard Schussek", + "email": "bschussek@gmail.com" + } + ], + "description": "A PHP implementation of Ant's glob.", + "support": { + "issues": "https://github.com/webmozarts/glob/issues", + "source": "https://github.com/webmozarts/glob/tree/4.7.0" + }, + "time": "2024-03-07T20:33:40+00:00" } ], "aliases": [], diff --git a/phpbench.json b/phpbench.json index 28cbb8e35..1076d8014 100644 --- a/phpbench.json +++ b/phpbench.json @@ -1,5 +1,5 @@ { - "runner.bootstrap": "tools/vendor/autoload.php", + "runner.bootstrap": "vendor/autoload.php", "runner.path": "test/benchmark" } diff --git a/phpunit.xml.dist b/phpunit.xml.dist index 6e1100232..8f078f095 100644 --- a/phpunit.xml.dist +++ b/phpunit.xml.dist @@ -1,7 +1,7 @@ - + - toLowerString - toLowerString + + - $attributeNode->name - $attributeNode->name - $attributesGroupNode->attrs - $attributesGroupNode->attrs + name]]> + name]]> + attrs]]> + attrs]]> - array_map + - reflectClass - toString + - $createMethod( + - $createMethod( + )]]> + - $createMethod($aliasMethodName) - $createMethod($method->getAliasName()) - $createMethod('cases', [], new Node\Identifier('array')) - $createProperty('name', 'string') - $createProperty('name', 'string') - $createProperty('value', $node->scalarType) - $createProperty('value', new Node\UnionType([ + )]]> + + getAliasName())]]> + + + + scalarType)]]> + - array_map - array_map - array_map - array_map - array_map + ]))]]> + + + + - createEmpty - createEmpty - createEmpty - createEmpty - createEmpty - createFromNode - createFromNode - createFromNode - createFromNode - getConstants - getConstants - getConstants - getConstants - getEndLine - getEndLine - getEndLine - getEndLine - getMethods - getMethods - getMethods - getMethods - getMethods - getMethods - getMethods - getMethods - getProperties - getProperties - getProperties - getProperties - getStartLine - getStartLine - getStartLine - getStartLine - getTraitUses - getTraitUses - getTraitUses - getTraitUses - getTraitUses - getTraitUses - getTraitUses - getTraitUses - isAbstract - isFinal - isReadonly - push - push - push - push - reflectClass - reflectClass - reflectClass - reflectClass - toLowerString - toString - toString - toString - toString + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - __invoke - getEndLine - getStartLine - isFinal - isPrivate - isProtected - isPublic + + + + + + + - __invoke - getEndLine - getEndLine - getStartLine - getStartLine - toString + + + + + - array_map - array_map + + - __invoke - getEndLine - getStartLine + + + - addVisitor - createFromNode - getEndLine - getEndLine - getEndLine - getEndLine - getStartLine - getStartLine - getStartLine - getStartLine - getStmts - getSubNodeNames - hasAttribute - hasAttribute - hasAttribute - hasAttribute - hasAttribute - hasAttribute - hasAttribute - hasAttribute - traverse + + + + + + + + + + + + + + + + + + + + - $closure->__invoke($implementingClassName, $this->getName(), $args) - $closure->__invoke($object, $this->getName(), $args) + __invoke($implementingClassName, $this->getName(), $args)]]> + __invoke($object, $this->getName(), $args)]]> - classExists - isAbstract - isFinal - isPrivate - isProtected - isPublic - isStatic - traitExists + + + + + + + + - reflectClass - toString + - createFromNode - getNode - getValue - makePublic - setDefault + + + + + - __invoke - getEndLine - getStartLine - hasAttribute - hasAttribute - toLowerString + + + + + + - $closure->__invoke($implementingClassName, $this->getName()) - $closure->__invoke($implementingClassName, $this->getName(), func_num_args() === 2 ? $value : $object) - $closure->__invoke($instance, $this->getName()) - $closure->__invoke($instance, $this->getName(), $value) + __invoke($implementingClassName, $this->getName())]]> + __invoke($implementingClassName, $this->getName(), func_num_args() === 2 ? $value : $object)]]> + __invoke($instance, $this->getName())]]> + __invoke($instance, $this->getName(), $value)]]> - __invoke - classExists - getEndLine - getStartLine - hasAttribute - hasAttribute - isPrivate - isProtected - isPublic - isReadonly - isStatic - traitExists + + + + + + + + + + + + - new Identifier('null') - new Identifier('null') - new UnionType($types) - new UnionType([$type, new Identifier('null')]) - toLowerString - toLowerString - toLowerString - toLowerString - toLowerString - toLowerString + + + + + + + + + + - $type->type - $type->types - $type->types + type]]> + types]]> + types]]> - getEndFilePos - getStartFilePos - hasAttribute - hasAttribute + + + + diff --git a/src/BetterReflection.php b/src/BetterReflection.php index a26904db1..d17cb55c0 100644 --- a/src/BetterReflection.php +++ b/src/BetterReflection.php @@ -4,7 +4,6 @@ namespace Roave\BetterReflection; -use PhpParser\Lexer\Emulative; use PhpParser\Parser; use PhpParser\ParserFactory; use Roave\BetterReflection\Reflector\DefaultReflector; @@ -58,9 +57,7 @@ public function reflector(): Reflector public function phpParser(): Parser { return $this->phpParser - ?? $this->phpParser = (new ParserFactory())->create(ParserFactory::ONLY_PHP7, new Emulative([ - 'usedAttributes' => ['comments', 'startLine', 'endLine', 'startFilePos', 'endFilePos'], - ])); + ?? $this->phpParser = (new ParserFactory())->createForNewestSupportedVersion(); } public function astLocator(): AstLocator diff --git a/src/NodeCompiler/CompileNodeToValue.php b/src/NodeCompiler/CompileNodeToValue.php index 76afaad9a..a05cb3823 100644 --- a/src/NodeCompiler/CompileNodeToValue.php +++ b/src/NodeCompiler/CompileNodeToValue.php @@ -75,7 +75,7 @@ public function __invoke(Node $node, CompilerContext $context): CompiledValue } if ($node instanceof Node\Scalar\MagicConst\Line) { - return $node->getLine(); + return $node->getStartLine(); } if ($node instanceof Node\Scalar\MagicConst\Namespace_) { diff --git a/src/NodeCompiler/Exception/UnableToCompileNode.php b/src/NodeCompiler/Exception/UnableToCompileNode.php index 779ebdf3e..48d3e17ba 100644 --- a/src/NodeCompiler/Exception/UnableToCompileNode.php +++ b/src/NodeCompiler/Exception/UnableToCompileNode.php @@ -30,7 +30,7 @@ public static function forUnRecognizedExpressionInContext(Node\Expr $expression, self::compilerContextToContextDescription($context), $expression::class, self::getFileName($context), - $expression->getLine(), + $expression->getStartLine(), )); } @@ -47,7 +47,7 @@ public static function becauseOfNotFoundClassConstantReference( $constantFetch->name->name, self::compilerContextToContextDescription($fetchContext), self::getFileName($fetchContext), - $constantFetch->getLine(), + $constantFetch->getStartLine(), )); } @@ -61,7 +61,7 @@ public static function becauseOfNotFoundConstantReference( $constantName, self::compilerContextToContextDescription($fetchContext), self::getFileName($fetchContext), - $constantFetch->getLine(), + $constantFetch->getStartLine(), )); $exception->constantName = $constantName; @@ -85,7 +85,7 @@ public static function becauseOfInvalidEnumCasePropertyFetch( $propertyFetch->name->toString(), self::compilerContextToContextDescription($fetchContext), self::getFileName($fetchContext), - $propertyFetch->getLine(), + $propertyFetch->getStartLine(), )); } @@ -96,7 +96,7 @@ public static function becauseOfMissingFileName( return new self(sprintf( 'No file name for %s (line %d)', self::compilerContextToContextDescription($context), - $node->getLine(), + $node->getStartLine(), )); } @@ -108,7 +108,7 @@ public static function becauseOfInitializer( 'Unable to compile initializer in %s in file %s (line %d)', self::compilerContextToContextDescription($context), self::getFileName($context), - $newNode->getLine(), + $newNode->getStartLine(), )); } @@ -125,7 +125,7 @@ public static function becauseOfValueIsEnum( $constantFetch->name->name, self::compilerContextToContextDescription($fetchContext), self::getFileName($fetchContext), - $constantFetch->getLine(), + $constantFetch->getStartLine(), )); } diff --git a/src/Reflection/ReflectionClass.php b/src/Reflection/ReflectionClass.php index 2cd39aed7..8ba9ba37a 100644 --- a/src/Reflection/ReflectionClass.php +++ b/src/Reflection/ReflectionClass.php @@ -5,6 +5,7 @@ namespace Roave\BetterReflection\Reflection; use BackedEnum; +use PhpParser\Modifiers; use PhpParser\Node; use PhpParser\Node\Stmt\Class_ as ClassNode; use PhpParser\Node\Stmt\ClassMethod; @@ -357,12 +358,12 @@ private function createMethodsFromTrait(ReflectionMethod $method): array if (array_key_exists($methodHash, $this->traitsData['modifiers'])) { // PhpParser modifiers are compatible with PHP reflection modifiers - if ($this->traitsData['modifiers'][$methodHash] & Node\Stmt\Class_::VISIBILITY_MODIFIER_MASK) { - $methodModifiers = ($methodModifiers & ~ Node\Stmt\Class_::VISIBILITY_MODIFIER_MASK) | $this->traitsData['modifiers'][$methodHash]; + if ($this->traitsData['modifiers'][$methodHash] & Modifiers::VISIBILITY_MASK) { + $methodModifiers = ($methodModifiers & ~ Modifiers::VISIBILITY_MASK) | $this->traitsData['modifiers'][$methodHash]; } - if ($this->traitsData['modifiers'][$methodHash] & Node\Stmt\Class_::MODIFIER_FINAL) { - $methodModifiers |= Node\Stmt\Class_::MODIFIER_FINAL; + if ($this->traitsData['modifiers'][$methodHash] & Modifiers::FINAL) { + $methodModifiers |= Modifiers::FINAL; } } @@ -574,22 +575,27 @@ private function createImmediateMethods(ClassNode|InterfaceNode|TraitNode|EnumNo private function addEnumMethods(EnumNode $node, array $methods): array { $internalLocatedSource = new InternalLocatedSource('', $this->getName(), 'Core'); - $createMethod = fn (string $name, array $params, Node\Identifier|Node\NullableType $returnType): ReflectionMethod => ReflectionMethod::createFromNode( - $this->reflector, - new ClassMethod( - new Node\Identifier($name), - [ - 'flags' => ClassNode::MODIFIER_PUBLIC | ClassNode::MODIFIER_STATIC, - 'params' => $params, - 'returnType' => $returnType, - ], - ), - $internalLocatedSource, - $this->getNamespaceName(), - $this, - $this, - $this, - ); + $createMethod = function (string $name, array $params, Node\Identifier|Node\NullableType $returnType) use ($internalLocatedSource): ReflectionMethod { + /** @var array{flags: int, params: Node\Param[], returnType: Node\Identifier|Node\NullableType} $classMethodSubnodes */ + $classMethodSubnodes = [ + 'flags' => Modifiers::PUBLIC | Modifiers::STATIC, + 'params' => $params, + 'returnType' => $returnType, + ]; + + return ReflectionMethod::createFromNode( + $this->reflector, + new ClassMethod( + new Node\Identifier($name), + $classMethodSubnodes, + ), + $internalLocatedSource, + $this->getNamespaceName(), + $this, + $this, + $this, + ); + }; $methods['cases'] = $createMethod('cases', [], new Node\Identifier('array')); @@ -844,7 +850,7 @@ private function createImmediateProperties(ClassNode|InterfaceNode|TraitNode|Enu $propertyNode = new Node\Stmt\Property( $parameterNode->flags, - [new Node\Stmt\PropertyProperty($parameterNameNode->name)], + [new Node\PropertyItem($parameterNameNode->name)], $parameterNode->getAttributes(), $parameterNode->type, $parameterNode->attrGroups, @@ -875,10 +881,10 @@ private function createImmediateProperties(ClassNode|InterfaceNode|TraitNode|Enu */ private function addEnumProperties(array $properties, EnumNode|InterfaceNode $node, Reflector $reflector): array { - $createProperty = function (string $name, string|Node\Identifier|Node\UnionType $type) use ($reflector): ReflectionProperty { + $createProperty = function (string $name, Node\Name|Node\Identifier|Node\UnionType $type) use ($reflector): ReflectionProperty { $propertyNode = new Node\Stmt\Property( - ClassNode::MODIFIER_PUBLIC | ClassNode::MODIFIER_READONLY, - [new Node\Stmt\PropertyProperty($name)], + Modifiers::PUBLIC | Modifiers::READONLY, + [new Node\PropertyItem($name)], [], $type, ); @@ -895,7 +901,7 @@ private function addEnumProperties(array $properties, EnumNode|InterfaceNode $no if ($node instanceof InterfaceNode) { $interfaceName = $this->getName(); if ($interfaceName === 'UnitEnum') { - $properties['name'] = $createProperty('name', 'string'); + $properties['name'] = $createProperty('name', new Node\Identifier('string')); } if ($interfaceName === 'BackedEnum') { @@ -905,7 +911,7 @@ private function addEnumProperties(array $properties, EnumNode|InterfaceNode $no ])); } } else { - $properties['name'] = $createProperty('name', 'string'); + $properties['name'] = $createProperty('name', new Node\Identifier('string')); if ($node->scalarType !== null) { $properties['value'] = $createProperty('value', $node->scalarType); diff --git a/src/Reflection/ReflectionFunctionAbstract.php b/src/Reflection/ReflectionFunctionAbstract.php index 6a3347952..3cecc7427 100644 --- a/src/Reflection/ReflectionFunctionAbstract.php +++ b/src/Reflection/ReflectionFunctionAbstract.php @@ -5,10 +5,10 @@ namespace Roave\BetterReflection\Reflection; use PhpParser\Node; +use PhpParser\Node\Expr\Throw_ as NodeThrow; use PhpParser\Node\Expr\Yield_ as YieldNode; use PhpParser\Node\Expr\YieldFrom as YieldFromNode; use PhpParser\Node\Stmt\ClassMethod as MethodNode; -use PhpParser\Node\Stmt\Throw_ as NodeThrow; use PhpParser\NodeTraverser; use PhpParser\NodeVisitor\FindingVisitor; use Roave\BetterReflection\Reflection\Annotation\AnnotationHelper; @@ -333,8 +333,7 @@ private function computeCouldThrow(MethodNode|Node\Stmt\Function_|Node\Expr\Clos } $visitor = new FindingVisitor(static fn (Node $node): bool => $node instanceof NodeThrow); - $traverser = new NodeTraverser(); - $traverser->addVisitor($visitor); + $traverser = new NodeTraverser($visitor); $traverser->traverse($statements); return $visitor->getFoundNodes() !== []; diff --git a/src/Reflection/ReflectionProperty.php b/src/Reflection/ReflectionProperty.php index 16da64f07..47dc8f561 100644 --- a/src/Reflection/ReflectionProperty.php +++ b/src/Reflection/ReflectionProperty.php @@ -74,7 +74,7 @@ class ReflectionProperty private function __construct( private Reflector $reflector, PropertyNode $node, - Node\Stmt\PropertyProperty $propertyNode, + Node\PropertyItem $propertyNode, private ReflectionClass $declaringClass, private ReflectionClass $implementingClass, private bool $isPromoted, @@ -187,7 +187,7 @@ public function __toString(): string public static function createFromNode( Reflector $reflector, PropertyNode $node, - Node\Stmt\PropertyProperty $propertyProperty, + Node\PropertyItem $propertyProperty, ReflectionClass $declaringClass, ReflectionClass $implementingClass, bool $isPromoted = false, diff --git a/src/SourceLocator/Ast/FindReflectionsInTree.php b/src/SourceLocator/Ast/FindReflectionsInTree.php index 75a441dff..145d0279d 100644 --- a/src/SourceLocator/Ast/FindReflectionsInTree.php +++ b/src/SourceLocator/Ast/FindReflectionsInTree.php @@ -101,15 +101,17 @@ public function leaveNode(Node $node) return null; } - if ($node instanceof Node\Expr\FuncCall) { + if ($node instanceof Node\Stmt\Expression && $node->expr instanceof Node\Expr\FuncCall) { + $functionCall = $node->expr; + try { - ConstantNodeChecker::assertValidDefineFunctionCall($node); + ConstantNodeChecker::assertValidDefineFunctionCall($functionCall); } catch (InvalidConstantNode) { return null; } - if ($node->name->hasAttribute('namespacedName')) { - $namespacedName = $node->name->getAttribute('namespacedName'); + if ($functionCall->name->hasAttribute('namespacedName')) { + $namespacedName = $functionCall->name->getAttribute('namespacedName'); assert($namespacedName instanceof Name); try { @@ -121,7 +123,12 @@ public function leaveNode(Node $node) } } - $this->reflections[] = $this->astConversionStrategy->__invoke($this->reflector, $node, $this->locatedSource, $this->currentNamespace); + $nodeDocComment = $node->getDocComment(); + if ($nodeDocComment !== null) { + $functionCall->setDocComment($nodeDocComment); + } + + $this->reflections[] = $this->astConversionStrategy->__invoke($this->reflector, $functionCall, $this->locatedSource, $this->currentNamespace); return null; } @@ -145,9 +152,7 @@ public function getReflections(): array } }; - $nodeTraverser = new NodeTraverser(); - $nodeTraverser->addVisitor(new NameResolver()); - $nodeTraverser->addVisitor($nodeVisitor); + $nodeTraverser = new NodeTraverser(new NameResolver(), $nodeVisitor); $nodeTraverser->traverse($ast); return $nodeVisitor->getReflections(); diff --git a/src/SourceLocator/Ast/Parser/MemoizingParser.php b/src/SourceLocator/Ast/Parser/MemoizingParser.php index d0e28fcbb..1c75056d8 100644 --- a/src/SourceLocator/Ast/Parser/MemoizingParser.php +++ b/src/SourceLocator/Ast/Parser/MemoizingParser.php @@ -7,6 +7,7 @@ use PhpParser\ErrorHandler; use PhpParser\Node; use PhpParser\Parser; +use PhpParser\Token; use function array_key_exists; use function hash; @@ -18,9 +19,12 @@ /** @internal */ final class MemoizingParser implements Parser { - /** @var array indexed by source hash */ + /** @var array indexed by source hash */ private array $sourceHashToAst = []; + /** @var Token[] */ + private array $lastTokens = []; + public function __construct(private Parser $wrappedParser) { } @@ -34,15 +38,25 @@ public function parse(string $code, ErrorHandler|null $errorHandler = null): arr $hash = sprintf('%s:%d', hash('sha256', $code), strlen($code)); if (array_key_exists($hash, $this->sourceHashToAst)) { + [$serializedAst, $tokens] = $this->sourceHashToAst[$hash]; /** @var Node\Stmt[]|null $ast */ - $ast = unserialize($this->sourceHashToAst[$hash]); + $ast = unserialize($serializedAst); + $this->lastTokens = $tokens; return $ast; } $ast = $this->wrappedParser->parse($code, $errorHandler); - $this->sourceHashToAst[$hash] = serialize($ast); + $tokens = $this->wrappedParser->getTokens(); + $this->sourceHashToAst[$hash] = [serialize($ast), $tokens]; + $this->lastTokens = $tokens; return $ast; } + + /** @return Token[] */ + public function getTokens(): array + { + return $this->lastTokens; + } } diff --git a/src/SourceLocator/Ast/Strategy/NodeToReflection.php b/src/SourceLocator/Ast/Strategy/NodeToReflection.php index 6b7b66ca5..48bea5f3b 100644 --- a/src/SourceLocator/Ast/Strategy/NodeToReflection.php +++ b/src/SourceLocator/Ast/Strategy/NodeToReflection.php @@ -12,8 +12,6 @@ use Roave\BetterReflection\Reflector\Reflector; use Roave\BetterReflection\SourceLocator\Located\LocatedSource; -use function implode; - /** @internal */ class NodeToReflection implements AstConversionStrategy { @@ -28,8 +26,7 @@ public function __invoke( Node\Stmt\Namespace_|null $namespace, int|null $positionInNode = null, ): ReflectionClass|ReflectionConstant|ReflectionFunction { - /** @psalm-suppress PossiblyNullPropertyFetch, PossiblyNullReference */ - $namespaceName = $namespace?->name !== null ? implode('\\', $namespace->name->getParts()) : null; + $namespaceName = $namespace?->name?->name; if ($node instanceof Node\Stmt\Enum_) { return ReflectionEnum::createFromNode( diff --git a/src/SourceLocator/SourceStubber/PhpStormStubs/CachingVisitor.php b/src/SourceLocator/SourceStubber/PhpStormStubs/CachingVisitor.php index 546b1939a..4cbe3b094 100644 --- a/src/SourceLocator/SourceStubber/PhpStormStubs/CachingVisitor.php +++ b/src/SourceLocator/SourceStubber/PhpStormStubs/CachingVisitor.php @@ -6,7 +6,7 @@ use PhpParser\BuilderFactory; use PhpParser\Node; -use PhpParser\NodeTraverser; +use PhpParser\NodeVisitor; use PhpParser\NodeVisitorAbstract; use Roave\BetterReflection\Reflection\Exception\InvalidConstantNode; use Roave\BetterReflection\Util\ConstantNodeChecker; @@ -67,7 +67,7 @@ public function enterNode(Node $node): int|null } if ($node instanceof Node\Stmt\ClassMethod) { - return NodeTraverser::DONT_TRAVERSE_CURRENT_AND_CHILDREN; + return NodeVisitor::DONT_TRAVERSE_CURRENT_AND_CHILDREN; } if ($node instanceof Node\Stmt\Function_) { @@ -76,7 +76,7 @@ public function enterNode(Node $node): int|null $functionName = $functionNamespacedName->toString(); $this->functionNodes[$functionName][] = [$node, $this->currentNamespace]; - return NodeTraverser::DONT_TRAVERSE_CHILDREN; + return NodeVisitor::DONT_TRAVERSE_CHILDREN; } if ($node instanceof Node\Stmt\Const_) { @@ -90,11 +90,13 @@ public function enterNode(Node $node): int|null $this->constantNodes[$constNodeName] = [$node, $this->currentNamespace]; } - return NodeTraverser::DONT_TRAVERSE_CHILDREN; + return NodeVisitor::DONT_TRAVERSE_CHILDREN; } - if ($node instanceof Node\Expr\FuncCall) { - $argumentNameNode = $node->args[0]; + if ($node instanceof Node\Stmt\Expression && $node->expr instanceof Node\Expr\FuncCall) { + $functionCall = $node->expr; + + $argumentNameNode = $functionCall->args[0]; assert($argumentNameNode instanceof Node\Arg); $nameNode = $argumentNameNode->value; assert($nameNode instanceof Node\Scalar\String_); @@ -105,17 +107,17 @@ public function enterNode(Node $node): int|null // The later definition can pass validation in `ConstantNodeChecker` and has support in `CompileNodeToValue` if ( in_array($constantName, ['STDIN', 'STDOUT', 'STDERR'], true) - && array_key_exists(1, $node->args) - && $node->args[1] instanceof Node\Arg + && array_key_exists(1, $functionCall->args) + && $functionCall->args[1] instanceof Node\Arg ) { - $node->args[1]->value = $this->builderFactory->funcCall('constant', [$constantName]); + $functionCall->args[1]->value = $this->builderFactory->funcCall('constant', [$constantName]); } // @codeCoverageIgnoreStart // @infection-ignore-all // No invalid definition in PhpStorm stubs try { - ConstantNodeChecker::assertValidDefineFunctionCall($node); + ConstantNodeChecker::assertValidDefineFunctionCall($node->expr); } catch (InvalidConstantNode) { return null; } @@ -127,20 +129,25 @@ public function enterNode(Node $node): int|null $nameNode->value = $constantName; } - $this->updateConstantValue($node, $constantName); + $this->updateConstantValue($functionCall, $constantName); + + $nodeDocComment = $node->getDocComment(); + if ($nodeDocComment !== null) { + $functionCall->setDocComment($nodeDocComment); + } - $this->constantNodes[$constantName] = [$node, $this->currentNamespace]; + $this->constantNodes[$constantName] = [$functionCall, $this->currentNamespace]; if ( - array_key_exists(2, $node->args) - && $node->args[2] instanceof Node\Arg - && $node->args[2]->value instanceof Node\Expr\ConstFetch - && $node->args[2]->value->name->toLowerString() === 'true' + array_key_exists(2, $functionCall->args) + && $functionCall->args[2] instanceof Node\Arg + && $functionCall->args[2]->value instanceof Node\Expr\ConstFetch + && $functionCall->args[2]->value->name->toLowerString() === 'true' ) { - $this->constantNodes[strtolower($constantName)] = [$node, $this->currentNamespace]; + $this->constantNodes[strtolower($constantName)] = [$functionCall, $this->currentNamespace]; } - return NodeTraverser::DONT_TRAVERSE_CHILDREN; + return NodeVisitor::DONT_TRAVERSE_CHILDREN; } return null; diff --git a/src/SourceLocator/SourceStubber/PhpStormStubsSourceStubber.php b/src/SourceLocator/SourceStubber/PhpStormStubsSourceStubber.php index 99b884a9d..0708e4c95 100644 --- a/src/SourceLocator/SourceStubber/PhpStormStubsSourceStubber.php +++ b/src/SourceLocator/SourceStubber/PhpStormStubsSourceStubber.php @@ -185,9 +185,7 @@ public function __construct(private Parser $phpParser, private int $phpVersion = $this->cachingVisitor = new CachingVisitor($this->builderFactory); - $this->nodeTraverser = new NodeTraverser(); - $this->nodeTraverser->addVisitor(new NameResolver()); - $this->nodeTraverser->addVisitor($this->cachingVisitor); + $this->nodeTraverser = new NodeTraverser(new NameResolver(), $this->cachingVisitor); if (self::$mapsInitialized) { return; diff --git a/src/SourceLocator/Type/AnonymousClassObjectSourceLocator.php b/src/SourceLocator/Type/AnonymousClassObjectSourceLocator.php index d26bd4ff8..37b074d2b 100644 --- a/src/SourceLocator/Type/AnonymousClassObjectSourceLocator.php +++ b/src/SourceLocator/Type/AnonymousClassObjectSourceLocator.php @@ -97,7 +97,7 @@ public function __construct(private string $fileName, private int $startLine) */ public function enterNode(Node $node) { - if (! ($node instanceof Node\Stmt\Class_) || $node->name !== null || $node->getLine() !== $this->startLine) { + if (! ($node instanceof Node\Stmt\Class_) || $node->name !== null || $node->getStartLine() !== $this->startLine) { return null; } @@ -124,9 +124,7 @@ public function getAnonymousClassNode(): Class_ /** @var list $ast */ $ast = $this->parser->parse($fileContents); - $nodeTraverser = new NodeTraverser(); - $nodeTraverser->addVisitor(new NameResolver()); - $nodeTraverser->addVisitor($nodeVisitor); + $nodeTraverser = new NodeTraverser(new NameResolver(), $nodeVisitor); $nodeTraverser->traverse($ast); $reflectionClass = (new NodeToReflection())->__invoke( diff --git a/src/SourceLocator/Type/AutoloadSourceLocator.php b/src/SourceLocator/Type/AutoloadSourceLocator.php index 76085fd22..009994da7 100644 --- a/src/SourceLocator/Type/AutoloadSourceLocator.php +++ b/src/SourceLocator/Type/AutoloadSourceLocator.php @@ -7,6 +7,7 @@ use InvalidArgumentException; use PhpParser\Node; use PhpParser\NodeTraverser; +use PhpParser\NodeVisitor; use PhpParser\NodeVisitor\NameResolver; use PhpParser\NodeVisitorAbstract; use PhpParser\Parser; @@ -64,9 +65,7 @@ public function __construct(AstLocator|null $astLocator = null, Parser|null $php $this->phpParser = $phpParser ?? $betterReflection->phpParser(); $this->constantVisitor = $this->createConstantVisitor(); - $this->nodeTraverser = new NodeTraverser(); - $this->nodeTraverser->addVisitor(new NameResolver()); - $this->nodeTraverser->addVisitor($this->constantVisitor); + $this->nodeTraverser = new NodeTraverser(new NameResolver(), $this->constantVisitor); } /** @@ -298,29 +297,31 @@ public function enterNode(Node $node): int|null if ($constNode->namespacedName?->toString() === $this->constantName) { $this->node = $node; - return NodeTraverser::STOP_TRAVERSAL; + return NodeVisitor::STOP_TRAVERSAL; } } - return NodeTraverser::DONT_TRAVERSE_CHILDREN; + return NodeVisitor::DONT_TRAVERSE_CHILDREN; } - if ($node instanceof Node\Expr\FuncCall) { + if ($node instanceof Node\Stmt\Expression && $node->expr instanceof Node\Expr\FuncCall) { + $functionCall = $node->expr; + try { - ConstantNodeChecker::assertValidDefineFunctionCall($node); + ConstantNodeChecker::assertValidDefineFunctionCall($functionCall); } catch (InvalidConstantNode) { return null; } - $argumentNameNode = $node->args[0]; + $argumentNameNode = $functionCall->args[0]; assert($argumentNameNode instanceof Node\Arg); $nameNode = $argumentNameNode->value; assert($nameNode instanceof Node\Scalar\String_); if ($nameNode->value === $this->constantName) { - $this->node = $node; + $this->node = $functionCall; - return NodeTraverser::STOP_TRAVERSAL; + return NodeVisitor::STOP_TRAVERSAL; } } diff --git a/src/SourceLocator/Type/ClosureSourceLocator.php b/src/SourceLocator/Type/ClosureSourceLocator.php index ec7a26070..869896c50 100644 --- a/src/SourceLocator/Type/ClosureSourceLocator.php +++ b/src/SourceLocator/Type/ClosureSourceLocator.php @@ -148,9 +148,7 @@ public function getClosureNodes(): array /** @var list $ast */ $ast = $this->parser->parse($fileContents); - $nodeTraverser = new NodeTraverser(); - $nodeTraverser->addVisitor(new NameResolver()); - $nodeTraverser->addVisitor($nodeVisitor); + $nodeTraverser = new NodeTraverser(new NameResolver(), $nodeVisitor); $nodeTraverser->traverse($ast); $closureNodes = $nodeVisitor->getClosureNodes(); diff --git a/src/Util/GetLastDocComment.php b/src/Util/GetLastDocComment.php index eb9a1a0fa..bb7cc8b33 100644 --- a/src/Util/GetLastDocComment.php +++ b/src/Util/GetLastDocComment.php @@ -7,7 +7,6 @@ use PhpParser\NodeAbstract; use function assert; -use function is_string; /** @internal */ final class GetLastDocComment @@ -28,7 +27,7 @@ public static function forNode(NodeAbstract $node): string|null /** @psalm-suppress ImpureMethodCall */ $comment = $docComment->getReformattedText(); - assert(is_string($comment) && $comment !== ''); + assert($comment !== ''); return $comment; } diff --git a/test/unit/Fixture/ClassForSourceStubberExpected.php b/test/unit/Fixture/ClassForSourceStubberExpected.php index 9d4aaa460..83cf382f0 100644 --- a/test/unit/Fixture/ClassForSourceStubberExpected.php +++ b/test/unit/Fixture/ClassForSourceStubberExpected.php @@ -33,50 +33,50 @@ abstract class ClassForSourceStubber extends \Roave\BetterReflectionTest\Fixture public $publicProperty = 'string'; public static $publicStaticProperty = null; public int $propertyWithTypeHint; - public function methodWithoutVisibility() : ?\stdClass + public function methodWithoutVisibility(): ?\stdClass { } /** * Method comment */ - public function publicMethod() : bool + public function publicMethod(): bool { } - public function protectedMethod() : int + public function protectedMethod(): int { } - public function privateMethod() : ?string + public function privateMethod(): ?string { } - public static function publicStaticMethod() : void + public static function publicStaticMethod(): void { } - public abstract function publicAbstractMethod(); - public final function publicFinalMethod() : float + abstract public function publicAbstractMethod(); + final public function publicFinalMethod(): float { } - public function methodWithParameters($string, $int, $float, $bool, $iterable, $callable) : void + public function methodWithParameters($string, $int, $float, $bool, $iterable, $callable): void { } - public function methodWithParametersWithTypes(string $string, int $int, float $float, bool $bool, iterable $iterable, callable $callable) : void + public function methodWithParametersWithTypes(string $string, int $int, float $float, bool $bool, iterable $iterable, callable $callable): void { } - public function methodWithParametersWithNullableTypes(?string $string, ?int $int, ?float $float, ?bool $bool, ?iterable $iterable, ?callable $callable) : void + public function methodWithParametersWithNullableTypes(?string $string, ?int $int, ?float $float, ?bool $bool, ?iterable $iterable, ?callable $callable): void { } - public function methodWithOptionalParameters(string $string = 'string', int $int = 123, float $float = 0.0, bool $bool = true, iterable $iterable = [], ?callable $callable = null) : void + public function methodWithOptionalParameters(string $string = 'string', int $int = 123, float $float = 0.0, bool $bool = true, iterable $iterable = [], ?callable $callable = null): void { } - public function methodWithSelfAndParentParameters(self $self, parent $parent) : void + public function methodWithSelfAndParentParameters(self $self, parent $parent): void { } - public function methodWithVariadicParameter(string ...$variadic) : void + public function methodWithVariadicParameter(string ...$variadic): void { } - public function methodWithParameterPassedByReference(bool &$bool) : void + public function methodWithParameterPassedByReference(bool &$bool): void { } - public function &methodReturnsReference() : array + public function &methodReturnsReference(): array { } } diff --git a/test/unit/Fixture/PHP81ClassForSourceStubberExpected.php b/test/unit/Fixture/PHP81ClassForSourceStubberExpected.php index 092c17e1f..1f29aa3c3 100644 --- a/test/unit/Fixture/PHP81ClassForSourceStubberExpected.php +++ b/test/unit/Fixture/PHP81ClassForSourceStubberExpected.php @@ -4,9 +4,9 @@ class PHP81ClassForSourceStubber { - public final const FINAL_CONST = 'finalConst'; + final public const FINAL_CONST = 'finalConst'; public readonly int $readOnly; - public function getIntersectionType() : \ArrayIterator&\stdClass + public function getIntersectionType(): \ArrayIterator&\stdClass { } } diff --git a/test/unit/Fixture/PHP83ClassForSourceStubberExpected.php b/test/unit/Fixture/PHP83ClassForSourceStubberExpected.php index e614542b9..08d768afe 100644 --- a/test/unit/Fixture/PHP83ClassForSourceStubberExpected.php +++ b/test/unit/Fixture/PHP83ClassForSourceStubberExpected.php @@ -4,6 +4,6 @@ class PHP83ClassForSourceStubber { - public final const string STRING_CONST = 'string'; - public final const int INTEGER_CONST = 0; + final public const string STRING_CONST = 'string'; + final public const int INTEGER_CONST = 0; } diff --git a/test/unit/Fixture/PHP8ClassForSourceStubberExpected.php b/test/unit/Fixture/PHP8ClassForSourceStubberExpected.php index 65edf3b52..067f617c0 100644 --- a/test/unit/Fixture/PHP8ClassForSourceStubberExpected.php +++ b/test/unit/Fixture/PHP8ClassForSourceStubberExpected.php @@ -4,10 +4,10 @@ abstract class PHP8ClassForSourceStubber { - public function methodWithStaticReturnValue() : static + public function methodWithStaticReturnValue(): static { } - public function methodWithMixedReturnValue() : mixed + public function methodWithMixedReturnValue(): mixed { } } diff --git a/test/unit/Reflection/Adapter/ReflectionAttributeTest.php b/test/unit/Reflection/Adapter/ReflectionAttributeTest.php index ca14e1d2c..ea2e537e7 100644 --- a/test/unit/Reflection/Adapter/ReflectionAttributeTest.php +++ b/test/unit/Reflection/Adapter/ReflectionAttributeTest.php @@ -60,7 +60,7 @@ public function testAdapterMethods(string $methodName, string|null $expectedExce $reflectionStub->expects($this->once()) ->method($methodName) ->with(...$args) - ->will($this->returnValue($returnValue)); + ->willReturn($returnValue); } if ($expectedException !== null) { diff --git a/test/unit/Reflection/Adapter/ReflectionClassConstantTest.php b/test/unit/Reflection/Adapter/ReflectionClassConstantTest.php index 7a81c9724..6fbc34b66 100644 --- a/test/unit/Reflection/Adapter/ReflectionClassConstantTest.php +++ b/test/unit/Reflection/Adapter/ReflectionClassConstantTest.php @@ -74,7 +74,7 @@ public function testAdapterMethods(string $methodName, string|null $expectedExce $reflectionStub->expects($this->once()) ->method($methodName) ->with(...$args) - ->will($this->returnValue($returnValue)); + ->willReturn($returnValue); } if ($expectedException !== null) { diff --git a/test/unit/Reflection/Adapter/ReflectionClassTest.php b/test/unit/Reflection/Adapter/ReflectionClassTest.php index 67b53e82a..5078fcb1a 100644 --- a/test/unit/Reflection/Adapter/ReflectionClassTest.php +++ b/test/unit/Reflection/Adapter/ReflectionClassTest.php @@ -7,6 +7,7 @@ use OutOfBoundsException; use PHPUnit\Framework\Attributes\CoversClass; use PHPUnit\Framework\Attributes\DataProvider; +use PHPUnit\Framework\Attributes\RunInSeparateProcess; use PHPUnit\Framework\TestCase; use ReflectionClass as CoreReflectionClass; use ReflectionClassConstant as CoreReflectionClassConstant; @@ -1161,7 +1162,7 @@ public function testHasConstantWithEnumCase(): void self::assertTrue($reflectionClassAdapter->hasConstant('ENUM_CASE')); } - /** @runInSeparateProcess */ + #[RunInSeparateProcess] public function testGetConstantWithEnumCase(): void { $betterReflectionEnumCase = $this->createMock(BetterReflectionEnumCase::class); diff --git a/test/unit/Reflection/Adapter/ReflectionEnumBackedCaseTest.php b/test/unit/Reflection/Adapter/ReflectionEnumBackedCaseTest.php index a46a17449..2588ec0f9 100644 --- a/test/unit/Reflection/Adapter/ReflectionEnumBackedCaseTest.php +++ b/test/unit/Reflection/Adapter/ReflectionEnumBackedCaseTest.php @@ -67,7 +67,7 @@ public function testAdapterMethods(string $methodName, string|null $expectedExce $reflectionStub->expects($this->once()) ->method($methodName) ->with(...$args) - ->will($this->returnValue($returnValue)); + ->willReturn($returnValue); } if ($expectedException !== null) { diff --git a/test/unit/Reflection/Adapter/ReflectionEnumTest.php b/test/unit/Reflection/Adapter/ReflectionEnumTest.php index 33dc5b542..dd29887e3 100644 --- a/test/unit/Reflection/Adapter/ReflectionEnumTest.php +++ b/test/unit/Reflection/Adapter/ReflectionEnumTest.php @@ -7,6 +7,7 @@ use OutOfBoundsException; use PHPUnit\Framework\Attributes\CoversClass; use PHPUnit\Framework\Attributes\DataProvider; +use PHPUnit\Framework\Attributes\RunInSeparateProcess; use PHPUnit\Framework\TestCase; use ReflectionClass as CoreReflectionClass; use ReflectionClassConstant as CoreReflectionClassConstant; @@ -856,7 +857,7 @@ public function testGetConstantReturnsFalseWhenConstantDoesNotExist(): void self::assertFalse($reflectionClassAdapter->getConstant('FOO')); } - /** @runInSeparateProcess */ + #[RunInSeparateProcess] public function testGetConstantWithEnumCase(): void { $betterReflectionEnumCase = $this->createMock(BetterReflectionEnumCase::class); diff --git a/test/unit/Reflection/Adapter/ReflectionEnumUnitCaseTest.php b/test/unit/Reflection/Adapter/ReflectionEnumUnitCaseTest.php index 7d719b365..d92f93fe8 100644 --- a/test/unit/Reflection/Adapter/ReflectionEnumUnitCaseTest.php +++ b/test/unit/Reflection/Adapter/ReflectionEnumUnitCaseTest.php @@ -67,7 +67,7 @@ public function testAdapterMethods(string $methodName, string|null $expectedExce $reflectionStub->expects($this->once()) ->method($methodName) ->with(...$args) - ->will($this->returnValue($returnValue)); + ->willReturn($returnValue); } if ($expectedException !== null) { diff --git a/test/unit/Reflection/Adapter/ReflectionIntersectionTypeTest.php b/test/unit/Reflection/Adapter/ReflectionIntersectionTypeTest.php index a7e06f074..40d8d0e92 100644 --- a/test/unit/Reflection/Adapter/ReflectionIntersectionTypeTest.php +++ b/test/unit/Reflection/Adapter/ReflectionIntersectionTypeTest.php @@ -58,7 +58,7 @@ public function testAdapterMethods(string $methodName, string|null $expectedExce $reflectionStub->expects($this->once()) ->method($methodName) ->with(...$args) - ->will($this->returnValue($returnValue)); + ->willReturn($returnValue); } if ($expectedException !== null) { diff --git a/test/unit/Reflection/Adapter/ReflectionNamedTypeTest.php b/test/unit/Reflection/Adapter/ReflectionNamedTypeTest.php index e888ada27..f779d2633 100644 --- a/test/unit/Reflection/Adapter/ReflectionNamedTypeTest.php +++ b/test/unit/Reflection/Adapter/ReflectionNamedTypeTest.php @@ -99,7 +99,7 @@ public function testAdapterMethods(string $methodName, string|null $expectedExce $reflectionStub->expects($this->once()) ->method($methodName) ->with(...$args) - ->will($this->returnValue($returnValue)); + ->willReturn($returnValue); } if ($expectedException !== null) { diff --git a/test/unit/Reflection/Adapter/ReflectionUnionTypeTest.php b/test/unit/Reflection/Adapter/ReflectionUnionTypeTest.php index af2b9fb23..528151604 100644 --- a/test/unit/Reflection/Adapter/ReflectionUnionTypeTest.php +++ b/test/unit/Reflection/Adapter/ReflectionUnionTypeTest.php @@ -59,7 +59,7 @@ public function testAdapterMethods(string $methodName, string|null $expectedExce $reflectionStub->expects($this->once()) ->method($methodName) ->with(...$args) - ->will($this->returnValue($returnValue)); + ->willReturn($returnValue); } if ($expectedException !== null) { diff --git a/test/unit/Reflection/ReflectionClassTest.php b/test/unit/Reflection/ReflectionClassTest.php index 0db4e8d76..f9dd053b7 100644 --- a/test/unit/Reflection/ReflectionClassTest.php +++ b/test/unit/Reflection/ReflectionClassTest.php @@ -16,6 +16,7 @@ use PHPUnit\Framework\Attributes\CoversNothing; use PHPUnit\Framework\Attributes\DataProvider; use PHPUnit\Framework\Attributes\RequiresPhp; +use PHPUnit\Framework\Attributes\RunInSeparateProcess; use PHPUnit\Framework\TestCase; use Qux; use ReflectionClass as CoreReflectionClass; @@ -2255,7 +2256,7 @@ public function testGetStaticPropertyValueThrowsExceptionWhenPropertyDoesNotExis $classInfo->getStaticPropertyValue('foo'); } - /** @runInSeparateProcess */ + #[RunInSeparateProcess] public function testSetStaticPropertyValue(): void { $staticPropertyGetSetFixtureFile = __DIR__ . '/../Fixture/StaticPropertyGetSet.php'; diff --git a/test/unit/Reflection/ReflectionParameterTest.php b/test/unit/Reflection/ReflectionParameterTest.php index c7b89e476..dfdd32cad 100644 --- a/test/unit/Reflection/ReflectionParameterTest.php +++ b/test/unit/Reflection/ReflectionParameterTest.php @@ -10,6 +10,7 @@ use PhpParser\Node; use PHPUnit\Framework\Attributes\CoversClass; use PHPUnit\Framework\Attributes\DataProvider; +use PHPUnit\Framework\Attributes\Group; use PHPUnit\Framework\TestCase; use Roave\BetterReflection\Reflection\Exception\CodeLocationMissing; use Roave\BetterReflection\Reflection\ReflectionFunction; @@ -412,7 +413,7 @@ public function testParameterWithDefaultValueBeforeVariadicParameterShouldBeOpti self::assertTrue($secondParam->isVariadic()); } - /** @group 109 */ + #[Group('109')] public function testVariadicParametersAreAlsoImplicitlyOptional(): void { $classInfo = $this->reflector->reflectClass(Methods::class); diff --git a/test/unit/Reflection/ReflectionPropertyTest.php b/test/unit/Reflection/ReflectionPropertyTest.php index 21b1e7d06..18ef701d0 100644 --- a/test/unit/Reflection/ReflectionPropertyTest.php +++ b/test/unit/Reflection/ReflectionPropertyTest.php @@ -8,12 +8,13 @@ use Error; use ExtendedClassWithPropertiesAndTraitProperties; use OutOfBoundsException; +use PhpParser\Modifiers; use PhpParser\Node; -use PhpParser\Node\Stmt\Class_; +use PhpParser\Node\PropertyItem; use PhpParser\Node\Stmt\Property; -use PhpParser\Node\Stmt\PropertyProperty; use PHPUnit\Framework\Attributes\CoversClass; use PHPUnit\Framework\Attributes\DataProvider; +use PHPUnit\Framework\Attributes\RunInSeparateProcess; use PHPUnit\Framework\TestCase; use ReflectionProperty as CoreReflectionProperty; use Roave\BetterReflection\Reflection\Adapter\ReflectionProperty as ReflectionPropertyAdapter; @@ -94,10 +95,10 @@ public function testCreateFromInstanceThrowsExceptionWhenPropertyDoesNotExist(): public function testCreateFromNodeWithNotPromotedProperty(): void { $classInfo = $this->reflector->reflectClass(ExampleClass::class); - $propertyPropertyNode = new PropertyProperty('foo'); + $propertyPropertyNode = new PropertyItem('foo'); $property = ReflectionProperty::createFromNode( $this->reflector, - new Property(Class_::MODIFIER_PUBLIC, [$propertyPropertyNode]), + new Property(Modifiers::PUBLIC, [$propertyPropertyNode]), $propertyPropertyNode, $classInfo, $classInfo, @@ -109,10 +110,10 @@ public function testCreateFromNodeWithNotPromotedProperty(): void public function testCreateFromNodeWithPromotedProperty(): void { $classInfo = $this->reflector->reflectClass(ExampleClass::class); - $propertyPropertyNode = new PropertyProperty('foo'); + $propertyPropertyNode = new PropertyItem('foo'); $property = ReflectionProperty::createFromNode( $this->reflector, - new Property(Class_::MODIFIER_PUBLIC, [$propertyPropertyNode]), + new Property(Modifiers::PUBLIC, [$propertyPropertyNode]), $propertyPropertyNode, $classInfo, $classInfo, @@ -272,10 +273,10 @@ public function testIsDefault(): void public function testIsDefaultWithRuntimeDeclaredProperty(): void { $classInfo = $this->reflector->reflectClass(ExampleClass::class); - $propertyPropertyNode = new PropertyProperty('foo'); + $propertyPropertyNode = new PropertyItem('foo'); $propertyNode = ReflectionProperty::createFromNode( $this->reflector, - new Property(Class_::MODIFIER_PUBLIC, [$propertyPropertyNode]), + new Property(Modifiers::PUBLIC, [$propertyPropertyNode]), $propertyPropertyNode, $classInfo, $classInfo, @@ -456,7 +457,7 @@ public function testGetDeclaringAndImplementingClassWithPropertyFromParentClass( self::assertSame($propertyReflection->getDeclaringClass(), $propertyReflection->getImplementingClass()); } - /** @runInSeparateProcess */ + #[RunInSeparateProcess] public function testSetAndGetValueOfStaticProperty(): void { $staticPropertyGetSetFixture = __DIR__ . '/../Fixture/StaticPropertyGetSet.php'; @@ -485,7 +486,7 @@ public function testSetAndGetValueOfStaticPropertyOnClassUsingTrait(): void self::assertSame('value', $propertyReflection->getValue()); } - /** @runInSeparateProcess */ + #[RunInSeparateProcess] public function testSetValueOfStaticPropertyWithValueAsSecondParameter(): void { $staticPropertyGetSetFixture = __DIR__ . '/../Fixture/StaticPropertyGetSet.php'; diff --git a/test/unit/SourceLocator/Ast/FindReflectionsInTreeTest.php b/test/unit/SourceLocator/Ast/FindReflectionsInTreeTest.php index 999710681..e938694c9 100644 --- a/test/unit/SourceLocator/Ast/FindReflectionsInTreeTest.php +++ b/test/unit/SourceLocator/Ast/FindReflectionsInTreeTest.php @@ -93,7 +93,7 @@ public function testInvokeCallsReflectNodesForClassTypeWithoutNamespace(string $ $strategy->expects($this->once()) ->method('__invoke') - ->will($this->returnValue($mockReflection)); + ->willReturn($mockReflection); $reflector = $this->createMock(Reflector::class); $locatedSource = new LocatedSource(sprintf('expects($this->once()) ->method('__invoke') - ->will($this->returnValue($mockReflection)); + ->willReturn($mockReflection); $reflector = $this->createMock(Reflector::class); $locatedSource = new LocatedSource(sprintf('expects($this->once()) ->method('__invoke') - ->will($this->returnValue($mockReflection)); + ->willReturn($mockReflection); $reflector = $this->createMock(Reflector::class); $locatedSource = new LocatedSource('expects($this->once()) ->method('__invoke') - ->will($this->returnValue($mockReflection)); + ->willReturn($mockReflection); $reflector = $this->createMock(Reflector::class); $locatedSource = new LocatedSource('expects($this->once()) ->method('__invoke') - ->will($this->returnValue($mockReflection)); + ->willReturn($mockReflection); $reflector = $this->createMock(Reflector::class); $reflector @@ -247,7 +247,7 @@ public function testInvokeCallsReflectNodesForConstantByDefineInNamespace(): voi $strategy->expects($this->once()) ->method('__invoke') - ->will($this->returnValue($mockReflection)); + ->willReturn($mockReflection); $reflector = $this->createMock(Reflector::class); $reflector @@ -281,7 +281,7 @@ public function testInvokeCallsReflectNodesForConstantByFullyQualifiedDefine(): $strategy->expects($this->once()) ->method('__invoke') - ->will($this->returnValue($mockReflection)); + ->willReturn($mockReflection); $reflector = $this->createMock(Reflector::class); $reflector @@ -375,7 +375,7 @@ public function testNoInvokeCallsReflectNodesForClassConstant(): void $strategy->expects($this->never()) ->method('__invoke') - ->will($this->returnValue($mockReflectionClass)); + ->willReturn($mockReflectionClass); $reflector = $this->createMock(Reflector::class); $locatedSource = new LocatedSource('createMock(Parser::class); @@ -37,6 +38,10 @@ public function testParse(): void ->expects(self::exactly($randomCodeStringsCount)) ->method('parse') ->willReturnCallback(static fn (): array => [new Name('bool')]); + $wrappedParser + ->expects(self::exactly($randomCodeStringsCount)) + ->method('getTokens') + ->willReturn([new Token(1, 'bool', 1, 1)]); $parser = new MemoizingParser($wrappedParser); @@ -56,12 +61,13 @@ public function testParse(): void self::assertCount(count($nodeIdentifiers), array_unique($nodeIdentifiers), 'No duplicate nodes allowed'); self::assertEquals($producedNodes, array_map([$parser, 'parse'], $randomCodeStrings)); + self::assertCount(1, $parser->getTokens()); } public function testParsedCodeIsDifferentAtEachParserLookup(): void { $code = 'create(ParserFactory::ONLY_PHP7); + $wrappedParser = (new ParserFactory())->createForNewestSupportedVersion(); $parser = new MemoizingParser($wrappedParser); diff --git a/test/unit/SourceLocator/Ast/Strategy/NodeToReflectionTest.php b/test/unit/SourceLocator/Ast/Strategy/NodeToReflectionTest.php index 6e220bd35..2ee132f73 100644 --- a/test/unit/SourceLocator/Ast/Strategy/NodeToReflectionTest.php +++ b/test/unit/SourceLocator/Ast/Strategy/NodeToReflectionTest.php @@ -34,8 +34,7 @@ protected function setUp(): void $this->phpParser = BetterReflectionSingleton::instance()->phpParser(); - $this->nodeTraverser = new NodeTraverser(); - $this->nodeTraverser->addVisitor(new NameResolver()); + $this->nodeTraverser = new NodeTraverser(new NameResolver()); } private function getFirstAstNodeInString(string $php): Node diff --git a/test/unit/SourceLocator/SourceStubber/PhpStormStubsSourceStubberTest.php b/test/unit/SourceLocator/SourceStubber/PhpStormStubsSourceStubberTest.php index 23ee53c75..84c34b9f7 100644 --- a/test/unit/SourceLocator/SourceStubber/PhpStormStubsSourceStubberTest.php +++ b/test/unit/SourceLocator/SourceStubber/PhpStormStubsSourceStubberTest.php @@ -18,6 +18,7 @@ use PhpParser\Parser; use PHPUnit\Framework\Attributes\CoversClass; use PHPUnit\Framework\Attributes\DataProvider; +use PHPUnit\Framework\Attributes\RunInSeparateProcess; use PHPUnit\Framework\TestCase; use ReflectionClass as CoreReflectionClass; use ReflectionFunction as CoreReflectionFunction; @@ -636,7 +637,7 @@ public function testCaseSensitiveConstantSearchOptimization(): void self::assertNull($this->sourceStubber->generateConstantStub('date_atom')); } - /** @runInSeparateProcess */ + #[RunInSeparateProcess] public function testUpdateConstantValue(): void { require __DIR__ . '/../../Fixture/FakeConstants.php'; diff --git a/test/unit/SourceLocator/Type/AbstractSourceLocatorTest.php b/test/unit/SourceLocator/Type/AbstractSourceLocatorTest.php index b1ca67df0..a7a913ae0 100644 --- a/test/unit/SourceLocator/Type/AbstractSourceLocatorTest.php +++ b/test/unit/SourceLocator/Type/AbstractSourceLocatorTest.php @@ -33,7 +33,7 @@ public function testLocateIdentifierCallsFindReflection(): void $astLocator->expects($this->once()) ->method('findReflection') ->with($mockReflector, $locatedSource, $identifier) - ->will($this->returnValue($mockReflection)); + ->willReturn($mockReflection); $sourceLocator = $this->getMockBuilder(AbstractSourceLocator::class) ->setConstructorArgs([$astLocator]) @@ -43,7 +43,7 @@ public function testLocateIdentifierCallsFindReflection(): void $sourceLocator->expects($this->once()) ->method('createLocatedSource') ->with($identifier) - ->will($this->returnValue($locatedSource)); + ->willReturn($locatedSource); self::assertSame($mockReflection, $sourceLocator->locateIdentifier($mockReflector, $identifier)); } @@ -67,7 +67,7 @@ public function testLocateIdentifierReturnsNullWithoutTryingToFindReflectionWhen $sourceLocator->expects($this->once()) ->method('createLocatedSource') ->with($identifier) - ->will($this->returnValue(null)); + ->willReturn(null); self::assertNull($sourceLocator->locateIdentifier($mockReflector, $identifier)); } @@ -95,7 +95,7 @@ public function testLocateIdentifierReturnsNullWhenFindLocatorThrowsException(): $sourceLocator->expects($this->once()) ->method('createLocatedSource') ->with($identifier) - ->will($this->returnValue($locatedSource)); + ->willReturn($locatedSource); self::assertNull($sourceLocator->locateIdentifier($mockReflector, $identifier)); } @@ -115,7 +115,7 @@ public function testLocateIdentifiersByTypeCallsFindReflectionsOfType(): void $astLocator->expects($this->once()) ->method('findReflectionsOfType') ->with($mockReflector, $locatedSource, $identifierType) - ->will($this->returnValue([$mockReflection])); + ->willReturn([$mockReflection]); $sourceLocator = $this->getMockBuilder(AbstractSourceLocator::class) ->setConstructorArgs([$astLocator]) @@ -124,7 +124,7 @@ public function testLocateIdentifiersByTypeCallsFindReflectionsOfType(): void $sourceLocator->expects($this->once()) ->method('createLocatedSource') - ->will($this->returnValue($locatedSource)); + ->willReturn($locatedSource); self::assertSame([$mockReflection], $sourceLocator->locateIdentifiersByType($mockReflector, $identifierType)); } @@ -147,7 +147,7 @@ public function testLocateIdentifiersByTypeReturnsEmptyArrayWithoutTryingToFindR $sourceLocator->expects($this->once()) ->method('createLocatedSource') - ->will($this->returnValue(null)); + ->willReturn(null); self::assertSame([], $sourceLocator->locateIdentifiersByType($mockReflector, $identifierType)); } diff --git a/test/unit/SourceLocator/Type/AutoloadSourceLocatorTest.php b/test/unit/SourceLocator/Type/AutoloadSourceLocatorTest.php index 1f4b7f184..a1ce9f1c9 100644 --- a/test/unit/SourceLocator/Type/AutoloadSourceLocatorTest.php +++ b/test/unit/SourceLocator/Type/AutoloadSourceLocatorTest.php @@ -6,6 +6,8 @@ use Foo\Bar\AutoloadableClassWithTwoDirectories; use PHPUnit\Framework\Attributes\CoversClass; +use PHPUnit\Framework\Attributes\PreserveGlobalState; +use PHPUnit\Framework\Attributes\RunInSeparateProcess; use PHPUnit\Framework\MockObject\MockObject; use PHPUnit\Framework\TestCase; use ReflectionClass; @@ -107,7 +109,7 @@ public function testClassLoadsWithLowercasedName(): void self::assertNotInstanceOf(AliasLocatedSource::class, $classInfo->getLocatedSource()); } - /** @runInSeparateProcess */ + #[RunInSeparateProcess] public function testCanLocateAutoloadableInterface(): void { self::assertFalse(interface_exists(AutoloadableInterface::class, false)); @@ -124,7 +126,7 @@ public function testCanLocateAutoloadableInterface(): void self::assertFalse(interface_exists(AutoloadableInterface::class, false)); } - /** @runInSeparateProcess */ + #[RunInSeparateProcess] public function testCanLocateAutoloadedInterface(): void { self::assertTrue(interface_exists(AutoloadableInterface::class)); @@ -139,7 +141,7 @@ public function testCanLocateAutoloadedInterface(): void self::assertInstanceOf(LocatedSource::class, $reflectionClass->getLocatedSource()); } - /** @runInSeparateProcess */ + #[RunInSeparateProcess] public function testCanLocateAutoloadableTrait(): void { self::assertFalse(trait_exists(AutoloadableTrait::class, false)); @@ -154,7 +156,7 @@ public function testCanLocateAutoloadableTrait(): void self::assertInstanceOf(LocatedSource::class, $reflectionClass->getLocatedSource()); } - /** @runInSeparateProcess */ + #[RunInSeparateProcess] public function testCanLocateAutoloadedTrait(): void { self::assertTrue(trait_exists(AutoloadableTrait::class)); @@ -169,7 +171,7 @@ public function testCanLocateAutoloadedTrait(): void self::assertInstanceOf(LocatedSource::class, $reflectionClass->getLocatedSource()); } - /** @runInSeparateProcess */ + #[RunInSeparateProcess] public function testCanLocateAutoloadableEnum(): void { self::assertFalse(enum_exists(AutoloadableEnum::class, false)); @@ -184,7 +186,7 @@ public function testCanLocateAutoloadableEnum(): void self::assertInstanceOf(LocatedSource::class, $reflectionClass->getLocatedSource()); } - /** @runInSeparateProcess */ + #[RunInSeparateProcess] public function testCanLocateAutoloadedEnum(): void { self::assertTrue(enum_exists(AutoloadableEnum::class)); @@ -199,7 +201,7 @@ public function testCanLocateAutoloadedEnum(): void self::assertInstanceOf(LocatedSource::class, $reflectionClass->getLocatedSource()); } - /** @runInSeparateProcess */ + #[RunInSeparateProcess] public function testCanLocateAutoloadedClassByAlias(): void { require __DIR__ . '/../../Fixture/AutoloadableByAlias.php'; @@ -247,10 +249,9 @@ public function testConstantLoadsByConst(): void /** * Running in a separate process to reduce the amount of existing files to scan in case of a constant lookup failure - * - * @runInSeparateProcess - * @preserveGlobalState disabled */ + #[RunInSeparateProcess] + #[PreserveGlobalState(false)] public function testAutoloadSourceLocatorWillNotFindConstantDeclarationFileIfDeclarationFileIsRemoved(): void { $constantName = str_replace('.', '', uniqid('constant_name', true)); @@ -418,7 +419,7 @@ public function testCanAutoloadPsr4ClassesInPotentiallyMultipleDirectories(): vo self::assertFalse(class_exists(AutoloadableClassWithTwoDirectories::class, false)); } - /** @runInSeparateProcess */ + #[RunInSeparateProcess] public function testWillLocateSourcesInPharPath(): void { require_once 'phar://' . __DIR__ . '/../../Fixture/autoload.phar/vendor/autoload.php'; diff --git a/test/unit/SourceLocator/Type/AutoloadSourceLocatorWithoutLoadedParserDependenciesTest.php b/test/unit/SourceLocator/Type/AutoloadSourceLocatorWithoutLoadedParserDependenciesTest.php index 0b7aa6201..fce029a60 100644 --- a/test/unit/SourceLocator/Type/AutoloadSourceLocatorWithoutLoadedParserDependenciesTest.php +++ b/test/unit/SourceLocator/Type/AutoloadSourceLocatorWithoutLoadedParserDependenciesTest.php @@ -4,9 +4,10 @@ namespace Roave\BetterReflectionTest\SourceLocator\Type; -use PhpParser\Lexer\Emulative; use PhpParser\ParserFactory; use PHPUnit\Framework\Attributes\CoversClass; +use PHPUnit\Framework\Attributes\PreserveGlobalState; +use PHPUnit\Framework\Attributes\RunInSeparateProcess; use PHPUnit\Framework\TestCase; use Roave\BetterReflection\Reflector\DefaultReflector; use Roave\BetterReflection\SourceLocator\Ast\Locator; @@ -19,10 +20,8 @@ #[CoversClass(AutoloadSourceLocator::class)] class AutoloadSourceLocatorWithoutLoadedParserDependenciesTest extends TestCase { - /** - * @runInSeparateProcess - * @preserveGlobalState disabled - */ + #[RunInSeparateProcess] + #[PreserveGlobalState(false)] public function testCanFindClassEvenWhenParserIsNotLoadedInMemory(): void { self::assertFalse( @@ -30,9 +29,7 @@ class_exists(MemoizingParser::class, false), MemoizingParser::class . ' was not loaded into memory', ); - $parser = (new ParserFactory())->create(ParserFactory::ONLY_PHP7, new Emulative([ - 'usedAttributes' => ['comments', 'startLine', 'endLine', 'startFilePos', 'endFilePos'], - ])); + $parser = (new ParserFactory())->createForNewestSupportedVersion(); $sourceLocator = new AutoloadSourceLocator( new Locator($parser), $parser, diff --git a/test/unit/SourceLocator/Type/ComposerSourceLocatorTest.php b/test/unit/SourceLocator/Type/ComposerSourceLocatorTest.php index 976eb19f5..9bbc37a15 100644 --- a/test/unit/SourceLocator/Type/ComposerSourceLocatorTest.php +++ b/test/unit/SourceLocator/Type/ComposerSourceLocatorTest.php @@ -44,7 +44,7 @@ public function testInvokableLoadsSource(): void ->expects($this->once()) ->method('findFile') ->with($className) - ->will($this->returnValue($fileName)); + ->willReturn($fileName); $locator = new ComposerSourceLocator($loader, $this->astLocator); diff --git a/tools/composer.json b/tools/composer.json index 7a0952700..ac3719b1a 100644 --- a/tools/composer.json +++ b/tools/composer.json @@ -1,7 +1,6 @@ { "require": { "doctrine/coding-standard": "^12.0.0", - "phpbench/phpbench": "^1.2.15", "phpstan/phpstan": "^1.10.60", "phpstan/phpstan-phpunit": "^1.3.16", "vimeo/psalm": "^5.23.1", @@ -19,8 +18,7 @@ }, "autoload": { "psr-4": { - "Roave\\BetterReflection\\": "../src", - "Roave\\BetterReflectionBenchmark\\": "../test/benchmark" + "Roave\\BetterReflection\\": "../src" } } } diff --git a/tools/composer.lock b/tools/composer.lock index 7e9f9f628..63661a8f2 100644 --- a/tools/composer.lock +++ b/tools/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": "1827e26a926bf16409a9c2abab2b9224", + "content-hash": "f2d235aedd5135f464a62c06ef023bc6", "packages": [ { "name": "amphp/amp", @@ -1149,82 +1149,6 @@ }, "time": "2019-12-04T15:06:13+00:00" }, - { - "name": "doctrine/annotations", - "version": "2.0.1", - "source": { - "type": "git", - "url": "https://github.com/doctrine/annotations.git", - "reference": "e157ef3f3124bbf6fe7ce0ffd109e8a8ef284e7f" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/doctrine/annotations/zipball/e157ef3f3124bbf6fe7ce0ffd109e8a8ef284e7f", - "reference": "e157ef3f3124bbf6fe7ce0ffd109e8a8ef284e7f", - "shasum": "" - }, - "require": { - "doctrine/lexer": "^2 || ^3", - "ext-tokenizer": "*", - "php": "^7.2 || ^8.0", - "psr/cache": "^1 || ^2 || ^3" - }, - "require-dev": { - "doctrine/cache": "^2.0", - "doctrine/coding-standard": "^10", - "phpstan/phpstan": "^1.8.0", - "phpunit/phpunit": "^7.5 || ^8.5 || ^9.5", - "symfony/cache": "^5.4 || ^6", - "vimeo/psalm": "^4.10" - }, - "suggest": { - "php": "PHP 8.0 or higher comes with attributes, a native replacement for annotations" - }, - "type": "library", - "autoload": { - "psr-4": { - "Doctrine\\Common\\Annotations\\": "lib/Doctrine/Common/Annotations" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Guilherme Blanco", - "email": "guilhermeblanco@gmail.com" - }, - { - "name": "Roman Borschel", - "email": "roman@code-factory.org" - }, - { - "name": "Benjamin Eberlei", - "email": "kontakt@beberlei.de" - }, - { - "name": "Jonathan Wage", - "email": "jonwage@gmail.com" - }, - { - "name": "Johannes Schmitt", - "email": "schmittjoh@gmail.com" - } - ], - "description": "Docblock Annotations Parser", - "homepage": "https://www.doctrine-project.org/projects/annotations.html", - "keywords": [ - "annotations", - "docblock", - "parser" - ], - "support": { - "issues": "https://github.com/doctrine/annotations/issues", - "source": "https://github.com/doctrine/annotations/tree/2.0.1" - }, - "time": "2023-02-02T22:02:53+00:00" - }, { "name": "doctrine/coding-standard", "version": "12.0.0", @@ -1328,83 +1252,6 @@ }, "time": "2024-01-30T19:34:25+00:00" }, - { - "name": "doctrine/lexer", - "version": "3.0.1", - "source": { - "type": "git", - "url": "https://github.com/doctrine/lexer.git", - "reference": "31ad66abc0fc9e1a1f2d9bc6a42668d2fbbcd6dd" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/doctrine/lexer/zipball/31ad66abc0fc9e1a1f2d9bc6a42668d2fbbcd6dd", - "reference": "31ad66abc0fc9e1a1f2d9bc6a42668d2fbbcd6dd", - "shasum": "" - }, - "require": { - "php": "^8.1" - }, - "require-dev": { - "doctrine/coding-standard": "^12", - "phpstan/phpstan": "^1.10", - "phpunit/phpunit": "^10.5", - "psalm/plugin-phpunit": "^0.18.3", - "vimeo/psalm": "^5.21" - }, - "type": "library", - "autoload": { - "psr-4": { - "Doctrine\\Common\\Lexer\\": "src" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Guilherme Blanco", - "email": "guilhermeblanco@gmail.com" - }, - { - "name": "Roman Borschel", - "email": "roman@code-factory.org" - }, - { - "name": "Johannes Schmitt", - "email": "schmittjoh@gmail.com" - } - ], - "description": "PHP Doctrine Lexer parser library that can be used in Top-Down, Recursive Descent Parsers.", - "homepage": "https://www.doctrine-project.org/projects/lexer.html", - "keywords": [ - "annotations", - "docblock", - "lexer", - "parser", - "php" - ], - "support": { - "issues": "https://github.com/doctrine/lexer/issues", - "source": "https://github.com/doctrine/lexer/tree/3.0.1" - }, - "funding": [ - { - "url": "https://www.doctrine-project.org/sponsorship.html", - "type": "custom" - }, - { - "url": "https://www.patreon.com/phpdoctrine", - "type": "patreon" - }, - { - "url": "https://tidelift.com/funding/github/packagist/doctrine%2Flexer", - "type": "tidelift" - } - ], - "time": "2024-02-05T11:56:58+00:00" - }, { "name": "felixfbecker/advanced-json-rpc", "version": "v3.2.1", @@ -2302,206 +2149,6 @@ }, "time": "2021-04-14T09:16:52+00:00" }, - { - "name": "phpbench/container", - "version": "2.2.2", - "source": { - "type": "git", - "url": "https://github.com/phpbench/container.git", - "reference": "a59b929e00b87b532ca6d0edd8eca0967655af33" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/phpbench/container/zipball/a59b929e00b87b532ca6d0edd8eca0967655af33", - "reference": "a59b929e00b87b532ca6d0edd8eca0967655af33", - "shasum": "" - }, - "require": { - "psr/container": "^1.0|^2.0", - "symfony/options-resolver": "^4.2 || ^5.0 || ^6.0 || ^7.0" - }, - "require-dev": { - "friendsofphp/php-cs-fixer": "^2.16", - "phpstan/phpstan": "^0.12.52", - "phpunit/phpunit": "^8" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "2.x-dev" - } - }, - "autoload": { - "psr-4": { - "PhpBench\\DependencyInjection\\": "lib/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Daniel Leech", - "email": "daniel@dantleech.com" - } - ], - "description": "Simple, configurable, service container.", - "support": { - "issues": "https://github.com/phpbench/container/issues", - "source": "https://github.com/phpbench/container/tree/2.2.2" - }, - "time": "2023-10-30T13:38:26+00:00" - }, - { - "name": "phpbench/dom", - "version": "0.3.3", - "source": { - "type": "git", - "url": "https://github.com/phpbench/dom.git", - "reference": "786a96db538d0def931f5b19225233ec42ec7a72" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/phpbench/dom/zipball/786a96db538d0def931f5b19225233ec42ec7a72", - "reference": "786a96db538d0def931f5b19225233ec42ec7a72", - "shasum": "" - }, - "require": { - "ext-dom": "*", - "php": "^7.3||^8.0" - }, - "require-dev": { - "friendsofphp/php-cs-fixer": "^3.14", - "phpstan/phpstan": "^1.10", - "phpunit/phpunit": "^8.0||^9.0" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.0-dev" - } - }, - "autoload": { - "psr-4": { - "PhpBench\\Dom\\": "lib/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Daniel Leech", - "email": "daniel@dantleech.com" - } - ], - "description": "DOM wrapper to simplify working with the PHP DOM implementation", - "support": { - "issues": "https://github.com/phpbench/dom/issues", - "source": "https://github.com/phpbench/dom/tree/0.3.3" - }, - "time": "2023-03-06T23:46:57+00:00" - }, - { - "name": "phpbench/phpbench", - "version": "1.2.15", - "source": { - "type": "git", - "url": "https://github.com/phpbench/phpbench.git", - "reference": "f7000319695cfad04a57fc64bf7ef7abdf4c437c" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/phpbench/phpbench/zipball/f7000319695cfad04a57fc64bf7ef7abdf4c437c", - "reference": "f7000319695cfad04a57fc64bf7ef7abdf4c437c", - "shasum": "" - }, - "require": { - "doctrine/annotations": "^2.0", - "ext-dom": "*", - "ext-json": "*", - "ext-pcre": "*", - "ext-reflection": "*", - "ext-spl": "*", - "ext-tokenizer": "*", - "php": "^8.1", - "phpbench/container": "^2.1", - "phpbench/dom": "~0.3.3", - "psr/log": "^1.1 || ^2.0 || ^3.0", - "seld/jsonlint": "^1.1", - "symfony/console": "^4.2 || ^5.0 || ^6.0 || ^7.0", - "symfony/filesystem": "^4.2 || ^5.0 || ^6.0 || ^7.0", - "symfony/finder": "^4.2 || ^5.0 || ^6.0 || ^7.0", - "symfony/options-resolver": "^4.2 || ^5.0 || ^6.0 || ^7.0", - "symfony/process": "^4.2 || ^5.0 || ^6.0 || ^7.0", - "webmozart/glob": "^4.6" - }, - "require-dev": { - "dantleech/invoke": "^2.0", - "friendsofphp/php-cs-fixer": "^3.0", - "jangregor/phpstan-prophecy": "^1.0", - "phpspec/prophecy": "dev-master", - "phpstan/extension-installer": "^1.1", - "phpstan/phpstan": "^1.0", - "phpstan/phpstan-phpunit": "^1.0", - "phpunit/phpunit": "^10.0", - "rector/rector": "^0.18.10", - "symfony/error-handler": "^5.2 || ^6.0 || ^7.0", - "symfony/var-dumper": "^4.0 || ^5.0 || ^6.0 || ^7.0" - }, - "suggest": { - "ext-xdebug": "For Xdebug profiling extension." - }, - "bin": [ - "bin/phpbench" - ], - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.2-dev" - } - }, - "autoload": { - "files": [ - "lib/Report/Func/functions.php" - ], - "psr-4": { - "PhpBench\\": "lib/", - "PhpBench\\Extensions\\XDebug\\": "extensions/xdebug/lib/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Daniel Leech", - "email": "daniel@dantleech.com" - } - ], - "description": "PHP Benchmarking Framework", - "keywords": [ - "benchmarking", - "optimization", - "performance", - "profiling", - "testing" - ], - "support": { - "issues": "https://github.com/phpbench/phpbench/issues", - "source": "https://github.com/phpbench/phpbench/tree/1.2.15" - }, - "funding": [ - { - "url": "https://github.com/dantleech", - "type": "github" - } - ], - "time": "2023-11-29T12:21:11+00:00" - }, { "name": "phpdocumentor/reflection-common", "version": "2.2.0", @@ -2831,55 +2478,6 @@ }, "time": "2024-02-23T09:51:20+00:00" }, - { - "name": "psr/cache", - "version": "3.0.0", - "source": { - "type": "git", - "url": "https://github.com/php-fig/cache.git", - "reference": "aa5030cfa5405eccfdcb1083ce040c2cb8d253bf" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/php-fig/cache/zipball/aa5030cfa5405eccfdcb1083ce040c2cb8d253bf", - "reference": "aa5030cfa5405eccfdcb1083ce040c2cb8d253bf", - "shasum": "" - }, - "require": { - "php": ">=8.0.0" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.0.x-dev" - } - }, - "autoload": { - "psr-4": { - "Psr\\Cache\\": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "PHP-FIG", - "homepage": "https://www.php-fig.org/" - } - ], - "description": "Common interface for caching libraries", - "keywords": [ - "cache", - "psr", - "psr-6" - ], - "support": { - "source": "https://github.com/php-fig/cache/tree/3.0.0" - }, - "time": "2021-02-03T23:26:27+00:00" - }, { "name": "psr/container", "version": "2.0.2", @@ -4218,73 +3816,6 @@ ], "time": "2023-10-31T17:59:56+00:00" }, - { - "name": "symfony/options-resolver", - "version": "v7.0.0", - "source": { - "type": "git", - "url": "https://github.com/symfony/options-resolver.git", - "reference": "700ff4096e346f54cb628ea650767c8130f1001f" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/options-resolver/zipball/700ff4096e346f54cb628ea650767c8130f1001f", - "reference": "700ff4096e346f54cb628ea650767c8130f1001f", - "shasum": "" - }, - "require": { - "php": ">=8.2", - "symfony/deprecation-contracts": "^2.5|^3" - }, - "type": "library", - "autoload": { - "psr-4": { - "Symfony\\Component\\OptionsResolver\\": "" - }, - "exclude-from-classmap": [ - "/Tests/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Fabien Potencier", - "email": "fabien@symfony.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" - } - ], - "description": "Provides an improved replacement for the array_replace PHP function", - "homepage": "https://symfony.com", - "keywords": [ - "config", - "configuration", - "options" - ], - "support": { - "source": "https://github.com/symfony/options-resolver/tree/v7.0.0" - }, - "funding": [ - { - "url": "https://symfony.com/sponsor", - "type": "custom" - }, - { - "url": "https://github.com/fabpot", - "type": "github" - }, - { - "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", - "type": "tidelift" - } - ], - "time": "2023-08-08T10:20:21+00:00" - }, { "name": "symfony/polyfill-ctype", "version": "v1.29.0", @@ -5370,55 +4901,6 @@ "source": "https://github.com/webmozarts/assert/tree/1.11.0" }, "time": "2022-06-03T18:03:27+00:00" - }, - { - "name": "webmozart/glob", - "version": "4.7.0", - "source": { - "type": "git", - "url": "https://github.com/webmozarts/glob.git", - "reference": "8a2842112d6916e61e0e15e316465b611f3abc17" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/webmozarts/glob/zipball/8a2842112d6916e61e0e15e316465b611f3abc17", - "reference": "8a2842112d6916e61e0e15e316465b611f3abc17", - "shasum": "" - }, - "require": { - "php": "^7.3 || ^8.0.0" - }, - "require-dev": { - "phpunit/phpunit": "^9.5", - "symfony/filesystem": "^5.3" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "4.1-dev" - } - }, - "autoload": { - "psr-4": { - "Webmozart\\Glob\\": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Bernhard Schussek", - "email": "bschussek@gmail.com" - } - ], - "description": "A PHP implementation of Ant's glob.", - "support": { - "issues": "https://github.com/webmozarts/glob/issues", - "source": "https://github.com/webmozarts/glob/tree/4.7.0" - }, - "time": "2024-03-07T20:33:40+00:00" } ], "packages-dev": [],