diff --git a/.github/workflows/integrate.yaml b/.github/workflows/integrate.yaml index 76bf4e7e..daed6554 100644 --- a/.github/workflows/integrate.yaml +++ b/.github/workflows/integrate.yaml @@ -5,7 +5,7 @@ name: "Integrate" on: # yamllint disable-line rule:truthy push: branches: - - "5.x" + - "6.x" pull_request: null # Allow manually triggering the workflow. workflow_dispatch: null @@ -15,19 +15,19 @@ jobs: name: "Code Coverage" uses: "phpDocumentor/.github/.github/workflows/code-coverage.yml@v0.9" with: - composer-root-version: "5.x-dev" + composer-root-version: "6.x-dev" coding-standards: name: "Coding Standards" uses: "phpDocumentor/.github/.github/workflows/coding-standards.yml@v0.9" with: - composer-root-version: "5.x-dev" + composer-root-version: "6.x-dev" dependency-analysis: name: "Dependency analysis" uses: "phpDocumentor/.github/.github/workflows/dependency-analysis.yml@v0.9" with: - composer-root-version: "5.x-dev" + composer-root-version: "6.x-dev" lint-root: name: "Lint root" @@ -40,19 +40,19 @@ jobs: uses: "phpDocumentor/.github/.github/workflows/static-analysis.yml@v0.9" with: php-extensions: "none, ctype, dom, json, mbstring, phar, simplexml, tokenizer, xml, xmlwriter, fileinfo, pcntl, posix" - composer-root-version: "5.x-dev" + composer-root-version: "6.x-dev" unit-tests: name: "Unit test" uses: "phpDocumentor/.github/.github/workflows/continuous-integration.yml@v0.9" with: - composer-root-version: "5.x-dev" + composer-root-version: "6.x-dev" upcoming-releases: true integration-tests: name: "Integration test" uses: "phpDocumentor/.github/.github/workflows/continuous-integration.yml@v0.9" with: - composer-root-version: "5.x-dev" + composer-root-version: "6.x-dev" upcoming-releases: true test-suite: "integration" diff --git a/composer.json b/composer.json index 5e4f0392..a0ae92f0 100644 --- a/composer.json +++ b/composer.json @@ -15,11 +15,11 @@ ], "require": { "php": "^7.4 || ^8.0", - "phpdocumentor/type-resolver": "^1.7", + "phpdocumentor/type-resolver": "^2.x-dev", "webmozart/assert": "^1.9.1 || ^2", "phpdocumentor/reflection-common": "^2.2", "ext-filter": "*", - "phpstan/phpdoc-parser": "^1.7|^2.0", + "phpstan/phpdoc-parser": "^2.0", "doctrine/deprecations": "^1.1" }, "require-dev": { diff --git a/composer.lock b/composer.lock index ec7560f3..8ee5b3e7 100644 --- a/composer.lock +++ b/composer.lock @@ -4,30 +4,33 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "908848a25f77bebc23c8ac1fe2f9ffb2", + "content-hash": "69aa0af5bad8d21df103f96a6e42e6dc", "packages": [ { "name": "doctrine/deprecations", - "version": "1.1.4", + "version": "1.1.5", "source": { "type": "git", "url": "https://github.com/doctrine/deprecations.git", - "reference": "31610dbb31faa98e6b5447b62340826f54fbc4e9" + "reference": "459c2f5dd3d6a4633d3b5f46ee2b1c40f57d3f38" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/doctrine/deprecations/zipball/31610dbb31faa98e6b5447b62340826f54fbc4e9", - "reference": "31610dbb31faa98e6b5447b62340826f54fbc4e9", + "url": "https://api.github.com/repos/doctrine/deprecations/zipball/459c2f5dd3d6a4633d3b5f46ee2b1c40f57d3f38", + "reference": "459c2f5dd3d6a4633d3b5f46ee2b1c40f57d3f38", "shasum": "" }, "require": { "php": "^7.1 || ^8.0" }, + "conflict": { + "phpunit/phpunit": "<=7.5 || >=13" + }, "require-dev": { - "doctrine/coding-standard": "^9 || ^12", - "phpstan/phpstan": "1.4.10 || 2.0.3", + "doctrine/coding-standard": "^9 || ^12 || ^13", + "phpstan/phpstan": "1.4.10 || 2.1.11", "phpstan/phpstan-phpunit": "^1.0 || ^2", - "phpunit/phpunit": "^7.5 || ^8.5 || ^9.5", + "phpunit/phpunit": "^7.5 || ^8.5 || ^9.6 || ^10.5 || ^11.5 || ^12", "psr/log": "^1 || ^2 || ^3" }, "suggest": { @@ -47,9 +50,9 @@ "homepage": "https://www.doctrine-project.org/", "support": { "issues": "https://github.com/doctrine/deprecations/issues", - "source": "https://github.com/doctrine/deprecations/tree/1.1.4" + "source": "https://github.com/doctrine/deprecations/tree/1.1.5" }, - "time": "2024-12-07T21:18:45+00:00" + "time": "2025-04-07T20:06:18+00:00" }, { "name": "phpdocumentor/reflection-common", @@ -106,38 +109,39 @@ }, { "name": "phpdocumentor/type-resolver", - "version": "1.10.0", + "version": "2.x-dev", "source": { "type": "git", "url": "https://github.com/phpDocumentor/TypeResolver.git", - "reference": "679e3ce485b99e84c775d28e2e96fade9a7fb50a" + "reference": "04298b7787b2c341bae25783c78c167f1901d5b9" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phpDocumentor/TypeResolver/zipball/679e3ce485b99e84c775d28e2e96fade9a7fb50a", - "reference": "679e3ce485b99e84c775d28e2e96fade9a7fb50a", + "url": "https://api.github.com/repos/phpDocumentor/TypeResolver/zipball/04298b7787b2c341bae25783c78c167f1901d5b9", + "reference": "04298b7787b2c341bae25783c78c167f1901d5b9", "shasum": "" }, "require": { "doctrine/deprecations": "^1.0", - "php": "^7.3 || ^8.0", + "php": "^7.4 || ^8.0", "phpdocumentor/reflection-common": "^2.0", - "phpstan/phpdoc-parser": "^1.18|^2.0" + "phpstan/phpdoc-parser": "^2.0" }, "require-dev": { "ext-tokenizer": "*", "phpbench/phpbench": "^1.2", - "phpstan/extension-installer": "^1.1", - "phpstan/phpstan": "^1.8", - "phpstan/phpstan-phpunit": "^1.1", + "phpstan/extension-installer": "^1.4", + "phpstan/phpstan": "^2.1", + "phpstan/phpstan-phpunit": "^2.0", "phpunit/phpunit": "^9.5", - "rector/rector": "^0.13.9", - "vimeo/psalm": "^4.25" + "psalm/phar": "^4" }, + "default-branch": true, "type": "library", "extra": { "branch-alias": { - "dev-1.x": "1.x-dev" + "dev-1.x": "1.x-dev", + "dev-2.x": "2.x-dev" } }, "autoload": { @@ -158,36 +162,36 @@ "description": "A PSR-5 based resolver of Class names, Types and Structural Element Names", "support": { "issues": "https://github.com/phpDocumentor/TypeResolver/issues", - "source": "https://github.com/phpDocumentor/TypeResolver/tree/1.10.0" + "source": "https://github.com/phpDocumentor/TypeResolver/tree/2.x" }, - "time": "2024-11-09T15:12:26+00:00" + "time": "2025-12-22T19:57:29+00:00" }, { "name": "phpstan/phpdoc-parser", - "version": "1.33.0", + "version": "2.3.0", "source": { "type": "git", "url": "https://github.com/phpstan/phpdoc-parser.git", - "reference": "82a311fd3690fb2bf7b64d5c98f912b3dd746140" + "reference": "1e0cd5370df5dd2e556a36b9c62f62e555870495" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phpstan/phpdoc-parser/zipball/82a311fd3690fb2bf7b64d5c98f912b3dd746140", - "reference": "82a311fd3690fb2bf7b64d5c98f912b3dd746140", + "url": "https://api.github.com/repos/phpstan/phpdoc-parser/zipball/1e0cd5370df5dd2e556a36b9c62f62e555870495", + "reference": "1e0cd5370df5dd2e556a36b9c62f62e555870495", "shasum": "" }, "require": { - "php": "^7.2 || ^8.0" + "php": "^7.4 || ^8.0" }, "require-dev": { "doctrine/annotations": "^2.0", - "nikic/php-parser": "^4.15", + "nikic/php-parser": "^5.3.0", "php-parallel-lint/php-parallel-lint": "^1.2", "phpstan/extension-installer": "^1.0", - "phpstan/phpstan": "^1.5", - "phpstan/phpstan-phpunit": "^1.1", - "phpstan/phpstan-strict-rules": "^1.0", - "phpunit/phpunit": "^9.5", + "phpstan/phpstan": "^2.0", + "phpstan/phpstan-phpunit": "^2.0", + "phpstan/phpstan-strict-rules": "^2.0", + "phpunit/phpunit": "^9.6", "symfony/process": "^5.2" }, "type": "library", @@ -205,34 +209,34 @@ "description": "PHPDoc parser with support for nullable, intersection and generic types", "support": { "issues": "https://github.com/phpstan/phpdoc-parser/issues", - "source": "https://github.com/phpstan/phpdoc-parser/tree/1.33.0" + "source": "https://github.com/phpstan/phpdoc-parser/tree/2.3.0" }, - "time": "2024-10-13T11:25:22+00:00" + "time": "2025-08-30T15:50:23+00:00" }, { "name": "webmozart/assert", - "version": "1.11.0", + "version": "1.12.1", "source": { "type": "git", "url": "https://github.com/webmozarts/assert.git", - "reference": "11cb2199493b2f8a3b53e7f19068fc6aac760991" + "reference": "9be6926d8b485f55b9229203f962b51ed377ba68" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/webmozarts/assert/zipball/11cb2199493b2f8a3b53e7f19068fc6aac760991", - "reference": "11cb2199493b2f8a3b53e7f19068fc6aac760991", + "url": "https://api.github.com/repos/webmozarts/assert/zipball/9be6926d8b485f55b9229203f962b51ed377ba68", + "reference": "9be6926d8b485f55b9229203f962b51ed377ba68", "shasum": "" }, "require": { "ext-ctype": "*", + "ext-date": "*", + "ext-filter": "*", "php": "^7.2 || ^8.0" }, - "conflict": { - "phpstan/phpstan": "<0.12.20", - "vimeo/psalm": "<4.6.1 || 4.6.2" - }, - "require-dev": { - "phpunit/phpunit": "^8.5.13" + "suggest": { + "ext-intl": "", + "ext-simplexml": "", + "ext-spl": "" }, "type": "library", "extra": { @@ -263,38 +267,38 @@ ], "support": { "issues": "https://github.com/webmozarts/assert/issues", - "source": "https://github.com/webmozarts/assert/tree/1.11.0" + "source": "https://github.com/webmozarts/assert/tree/1.12.1" }, - "time": "2022-06-03T18:03:27+00:00" + "time": "2025-10-29T15:56:20+00:00" } ], "packages-dev": [ { "name": "doctrine/instantiator", - "version": "1.4.1", + "version": "1.5.0", "source": { "type": "git", "url": "https://github.com/doctrine/instantiator.git", - "reference": "10dcfce151b967d20fde1b34ae6640712c3891bc" + "reference": "0a0fa9780f5d4e507415a065172d26a98d02047b" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/doctrine/instantiator/zipball/10dcfce151b967d20fde1b34ae6640712c3891bc", - "reference": "10dcfce151b967d20fde1b34ae6640712c3891bc", + "url": "https://api.github.com/repos/doctrine/instantiator/zipball/0a0fa9780f5d4e507415a065172d26a98d02047b", + "reference": "0a0fa9780f5d4e507415a065172d26a98d02047b", "shasum": "" }, "require": { "php": "^7.1 || ^8.0" }, "require-dev": { - "doctrine/coding-standard": "^9", + "doctrine/coding-standard": "^9 || ^11", "ext-pdo": "*", "ext-phar": "*", "phpbench/phpbench": "^0.16 || ^1", "phpstan/phpstan": "^1.4", "phpstan/phpstan-phpunit": "^1", "phpunit/phpunit": "^7.5 || ^8.5 || ^9.5", - "vimeo/psalm": "^4.22" + "vimeo/psalm": "^4.30 || ^5.4" }, "type": "library", "autoload": { @@ -321,7 +325,7 @@ ], "support": { "issues": "https://github.com/doctrine/instantiator/issues", - "source": "https://github.com/doctrine/instantiator/tree/1.4.1" + "source": "https://github.com/doctrine/instantiator/tree/1.5.0" }, "funding": [ { @@ -337,24 +341,24 @@ "type": "tidelift" } ], - "time": "2022-03-03T08:28:38+00:00" + "time": "2022-12-30T00:15:36+00:00" }, { "name": "hamcrest/hamcrest-php", - "version": "v2.0.1", + "version": "v2.1.1", "source": { "type": "git", "url": "https://github.com/hamcrest/hamcrest-php.git", - "reference": "8c3d0a3f6af734494ad8f6fbbee0ba92422859f3" + "reference": "f8b1c0173b22fa6ec77a81fe63e5b01eba7e6487" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/hamcrest/hamcrest-php/zipball/8c3d0a3f6af734494ad8f6fbbee0ba92422859f3", - "reference": "8c3d0a3f6af734494ad8f6fbbee0ba92422859f3", + "url": "https://api.github.com/repos/hamcrest/hamcrest-php/zipball/f8b1c0173b22fa6ec77a81fe63e5b01eba7e6487", + "reference": "f8b1c0173b22fa6ec77a81fe63e5b01eba7e6487", "shasum": "" }, "require": { - "php": "^5.3|^7.0|^8.0" + "php": "^7.4|^8.0" }, "replace": { "cordoval/hamcrest-php": "*", @@ -362,8 +366,8 @@ "kodova/hamcrest-php": "*" }, "require-dev": { - "phpunit/php-file-iterator": "^1.4 || ^2.0", - "phpunit/phpunit": "^4.8.36 || ^5.7 || ^6.5 || ^7.0" + "phpunit/php-file-iterator": "^1.4 || ^2.0 || ^3.0", + "phpunit/phpunit": "^4.8.36 || ^5.7 || ^6.5 || ^7.0 || ^8.0 || ^9.0" }, "type": "library", "extra": { @@ -386,9 +390,9 @@ ], "support": { "issues": "https://github.com/hamcrest/hamcrest-php/issues", - "source": "https://github.com/hamcrest/hamcrest-php/tree/v2.0.1" + "source": "https://github.com/hamcrest/hamcrest-php/tree/v2.1.1" }, - "time": "2020-07-09T08:09:16+00:00" + "time": "2025-04-30T06:54:44+00:00" }, { "name": "mockery/mockery", @@ -475,16 +479,16 @@ }, { "name": "myclabs/deep-copy", - "version": "1.11.0", + "version": "1.13.4", "source": { "type": "git", "url": "https://github.com/myclabs/DeepCopy.git", - "reference": "14daed4296fae74d9e3201d2c4925d1acb7aa614" + "reference": "07d290f0c47959fd5eed98c95ee5602db07e0b6a" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/myclabs/DeepCopy/zipball/14daed4296fae74d9e3201d2c4925d1acb7aa614", - "reference": "14daed4296fae74d9e3201d2c4925d1acb7aa614", + "url": "https://api.github.com/repos/myclabs/DeepCopy/zipball/07d290f0c47959fd5eed98c95ee5602db07e0b6a", + "reference": "07d290f0c47959fd5eed98c95ee5602db07e0b6a", "shasum": "" }, "require": { @@ -492,11 +496,12 @@ }, "conflict": { "doctrine/collections": "<1.6.8", - "doctrine/common": "<2.13.3 || >=3,<3.2.2" + "doctrine/common": "<2.13.3 || >=3 <3.2.2" }, "require-dev": { "doctrine/collections": "^1.6.8", "doctrine/common": "^2.13.3 || ^3.2.2", + "phpspec/prophecy": "^1.10", "phpunit/phpunit": "^7.5.20 || ^8.5.23 || ^9.5.13" }, "type": "library", @@ -522,7 +527,7 @@ ], "support": { "issues": "https://github.com/myclabs/DeepCopy/issues", - "source": "https://github.com/myclabs/DeepCopy/tree/1.11.0" + "source": "https://github.com/myclabs/DeepCopy/tree/1.13.4" }, "funding": [ { @@ -530,29 +535,31 @@ "type": "tidelift" } ], - "time": "2022-03-03T13:19:32+00:00" + "time": "2025-08-01T08:46:24+00:00" }, { "name": "nikic/php-parser", - "version": "v4.14.0", + "version": "v5.6.2", "source": { "type": "git", "url": "https://github.com/nikic/PHP-Parser.git", - "reference": "34bea19b6e03d8153165d8f30bba4c3be86184c1" + "reference": "3a454ca033b9e06b63282ce19562e892747449bb" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/nikic/PHP-Parser/zipball/34bea19b6e03d8153165d8f30bba4c3be86184c1", - "reference": "34bea19b6e03d8153165d8f30bba4c3be86184c1", + "url": "https://api.github.com/repos/nikic/PHP-Parser/zipball/3a454ca033b9e06b63282ce19562e892747449bb", + "reference": "3a454ca033b9e06b63282ce19562e892747449bb", "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": "^9.0" }, "bin": [ "bin/php-parse" @@ -560,7 +567,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "4.9-dev" + "dev-master": "5.x-dev" } }, "autoload": { @@ -584,26 +591,27 @@ ], "support": { "issues": "https://github.com/nikic/PHP-Parser/issues", - "source": "https://github.com/nikic/PHP-Parser/tree/v4.14.0" + "source": "https://github.com/nikic/PHP-Parser/tree/v5.6.2" }, - "time": "2022-05-31T20:59:12+00:00" + "time": "2025-10-21T19:32:17+00:00" }, { "name": "phar-io/manifest", - "version": "2.0.3", + "version": "2.0.4", "source": { "type": "git", "url": "https://github.com/phar-io/manifest.git", - "reference": "97803eca37d319dfa7826cc2437fc020857acb53" + "reference": "54750ef60c58e43759730615a392c31c80e23176" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phar-io/manifest/zipball/97803eca37d319dfa7826cc2437fc020857acb53", - "reference": "97803eca37d319dfa7826cc2437fc020857acb53", + "url": "https://api.github.com/repos/phar-io/manifest/zipball/54750ef60c58e43759730615a392c31c80e23176", + "reference": "54750ef60c58e43759730615a392c31c80e23176", "shasum": "" }, "require": { "ext-dom": "*", + "ext-libxml": "*", "ext-phar": "*", "ext-xmlwriter": "*", "phar-io/version": "^3.0.1", @@ -644,9 +652,15 @@ "description": "Component for reading phar.io manifest information from a PHP Archive (PHAR)", "support": { "issues": "https://github.com/phar-io/manifest/issues", - "source": "https://github.com/phar-io/manifest/tree/2.0.3" + "source": "https://github.com/phar-io/manifest/tree/2.0.4" }, - "time": "2021-07-20T11:28:43+00:00" + "funding": [ + { + "url": "https://github.com/theseer", + "type": "github" + } + ], + "time": "2024-03-03T12:33:53+00:00" }, { "name": "phar-io/version", @@ -749,16 +763,11 @@ }, { "name": "phpstan/phpstan", - "version": "1.12.8", - "source": { - "type": "git", - "url": "https://github.com/phpstan/phpstan.git", - "reference": "f6a60a4d66142b8156c9da923f1972657bc4748c" - }, + "version": "1.12.32", "dist": { "type": "zip", - "url": "https://api.github.com/repos/phpstan/phpstan/zipball/f6a60a4d66142b8156c9da923f1972657bc4748c", - "reference": "f6a60a4d66142b8156c9da923f1972657bc4748c", + "url": "https://api.github.com/repos/phpstan/phpstan/zipball/2770dcdf5078d0b0d53f94317e06affe88419aa8", + "reference": "2770dcdf5078d0b0d53f94317e06affe88419aa8", "shasum": "" }, "require": { @@ -803,7 +812,7 @@ "type": "github" } ], - "time": "2024-11-06T19:06:49+00:00" + "time": "2025-09-30T10:16:31+00:00" }, { "name": "phpstan/phpstan-mockery", @@ -908,44 +917,44 @@ }, { "name": "phpunit/php-code-coverage", - "version": "9.2.16", + "version": "9.2.32", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/php-code-coverage.git", - "reference": "2593003befdcc10db5e213f9f28814f5aa8ac073" + "reference": "85402a822d1ecf1db1096959413d35e1c37cf1a5" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/2593003befdcc10db5e213f9f28814f5aa8ac073", - "reference": "2593003befdcc10db5e213f9f28814f5aa8ac073", + "url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/85402a822d1ecf1db1096959413d35e1c37cf1a5", + "reference": "85402a822d1ecf1db1096959413d35e1c37cf1a5", "shasum": "" }, "require": { "ext-dom": "*", "ext-libxml": "*", "ext-xmlwriter": "*", - "nikic/php-parser": "^4.14", + "nikic/php-parser": "^4.19.1 || ^5.1.0", "php": ">=7.3", - "phpunit/php-file-iterator": "^3.0.3", - "phpunit/php-text-template": "^2.0.2", - "sebastian/code-unit-reverse-lookup": "^2.0.2", - "sebastian/complexity": "^2.0", - "sebastian/environment": "^5.1.2", - "sebastian/lines-of-code": "^1.0.3", - "sebastian/version": "^3.0.1", - "theseer/tokenizer": "^1.2.0" + "phpunit/php-file-iterator": "^3.0.6", + "phpunit/php-text-template": "^2.0.4", + "sebastian/code-unit-reverse-lookup": "^2.0.3", + "sebastian/complexity": "^2.0.3", + "sebastian/environment": "^5.1.5", + "sebastian/lines-of-code": "^1.0.4", + "sebastian/version": "^3.0.2", + "theseer/tokenizer": "^1.2.3" }, "require-dev": { - "phpunit/phpunit": "^9.3" + "phpunit/phpunit": "^9.6" }, "suggest": { - "ext-pcov": "*", - "ext-xdebug": "*" + "ext-pcov": "PHP extension that provides line coverage", + "ext-xdebug": "PHP extension that provides line coverage as well as branch and path coverage" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "9.2-dev" + "dev-main": "9.2.x-dev" } }, "autoload": { @@ -973,7 +982,8 @@ ], "support": { "issues": "https://github.com/sebastianbergmann/php-code-coverage/issues", - "source": "https://github.com/sebastianbergmann/php-code-coverage/tree/9.2.16" + "security": "https://github.com/sebastianbergmann/php-code-coverage/security/policy", + "source": "https://github.com/sebastianbergmann/php-code-coverage/tree/9.2.32" }, "funding": [ { @@ -981,7 +991,7 @@ "type": "github" } ], - "time": "2022-08-20T05:26:47+00:00" + "time": "2024-08-22T04:23:01+00:00" }, { "name": "phpunit/php-file-iterator", @@ -1226,50 +1236,50 @@ }, { "name": "phpunit/phpunit", - "version": "9.5.23", + "version": "9.6.29", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/phpunit.git", - "reference": "888556852e7e9bbeeedb9656afe46118765ade34" + "reference": "9ecfec57835a5581bc888ea7e13b51eb55ab9dd3" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/888556852e7e9bbeeedb9656afe46118765ade34", - "reference": "888556852e7e9bbeeedb9656afe46118765ade34", + "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/9ecfec57835a5581bc888ea7e13b51eb55ab9dd3", + "reference": "9ecfec57835a5581bc888ea7e13b51eb55ab9dd3", "shasum": "" }, "require": { - "doctrine/instantiator": "^1.3.1", + "doctrine/instantiator": "^1.5.0 || ^2", "ext-dom": "*", "ext-json": "*", "ext-libxml": "*", "ext-mbstring": "*", "ext-xml": "*", "ext-xmlwriter": "*", - "myclabs/deep-copy": "^1.10.1", - "phar-io/manifest": "^2.0.3", - "phar-io/version": "^3.0.2", + "myclabs/deep-copy": "^1.13.4", + "phar-io/manifest": "^2.0.4", + "phar-io/version": "^3.2.1", "php": ">=7.3", - "phpunit/php-code-coverage": "^9.2.13", - "phpunit/php-file-iterator": "^3.0.5", + "phpunit/php-code-coverage": "^9.2.32", + "phpunit/php-file-iterator": "^3.0.6", "phpunit/php-invoker": "^3.1.1", - "phpunit/php-text-template": "^2.0.3", - "phpunit/php-timer": "^5.0.2", - "sebastian/cli-parser": "^1.0.1", - "sebastian/code-unit": "^1.0.6", - "sebastian/comparator": "^4.0.5", - "sebastian/diff": "^4.0.3", - "sebastian/environment": "^5.1.3", - "sebastian/exporter": "^4.0.3", - "sebastian/global-state": "^5.0.1", - "sebastian/object-enumerator": "^4.0.3", - "sebastian/resource-operations": "^3.0.3", - "sebastian/type": "^3.0", + "phpunit/php-text-template": "^2.0.4", + "phpunit/php-timer": "^5.0.3", + "sebastian/cli-parser": "^1.0.2", + "sebastian/code-unit": "^1.0.8", + "sebastian/comparator": "^4.0.9", + "sebastian/diff": "^4.0.6", + "sebastian/environment": "^5.1.5", + "sebastian/exporter": "^4.0.8", + "sebastian/global-state": "^5.0.8", + "sebastian/object-enumerator": "^4.0.4", + "sebastian/resource-operations": "^3.0.4", + "sebastian/type": "^3.2.1", "sebastian/version": "^3.0.2" }, "suggest": { - "ext-soap": "*", - "ext-xdebug": "*" + "ext-soap": "To be able to generate mocks based on WSDL files", + "ext-xdebug": "PHP extension that provides line coverage as well as branch and path coverage" }, "bin": [ "phpunit" @@ -1277,7 +1287,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "9.5-dev" + "dev-master": "9.6-dev" } }, "autoload": { @@ -1308,7 +1318,8 @@ ], "support": { "issues": "https://github.com/sebastianbergmann/phpunit/issues", - "source": "https://github.com/sebastianbergmann/phpunit/tree/9.5.23" + "security": "https://github.com/sebastianbergmann/phpunit/security/policy", + "source": "https://github.com/sebastianbergmann/phpunit/tree/9.6.29" }, "funding": [ { @@ -1318,9 +1329,21 @@ { "url": "https://github.com/sebastianbergmann", "type": "github" + }, + { + "url": "https://liberapay.com/sebastianbergmann", + "type": "liberapay" + }, + { + "url": "https://thanks.dev/u/gh/sebastianbergmann", + "type": "thanks_dev" + }, + { + "url": "https://tidelift.com/funding/github/packagist/phpunit/phpunit", + "type": "tidelift" } ], - "time": "2022-08-22T14:01:36+00:00" + "time": "2025-09-24T06:29:11+00:00" }, { "name": "psalm/phar", @@ -1359,16 +1382,16 @@ }, { "name": "sebastian/cli-parser", - "version": "1.0.1", + "version": "1.0.2", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/cli-parser.git", - "reference": "442e7c7e687e42adc03470c7b668bc4b2402c0b2" + "reference": "2b56bea83a09de3ac06bb18b92f068e60cc6f50b" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/cli-parser/zipball/442e7c7e687e42adc03470c7b668bc4b2402c0b2", - "reference": "442e7c7e687e42adc03470c7b668bc4b2402c0b2", + "url": "https://api.github.com/repos/sebastianbergmann/cli-parser/zipball/2b56bea83a09de3ac06bb18b92f068e60cc6f50b", + "reference": "2b56bea83a09de3ac06bb18b92f068e60cc6f50b", "shasum": "" }, "require": { @@ -1403,7 +1426,7 @@ "homepage": "https://github.com/sebastianbergmann/cli-parser", "support": { "issues": "https://github.com/sebastianbergmann/cli-parser/issues", - "source": "https://github.com/sebastianbergmann/cli-parser/tree/1.0.1" + "source": "https://github.com/sebastianbergmann/cli-parser/tree/1.0.2" }, "funding": [ { @@ -1411,7 +1434,7 @@ "type": "github" } ], - "time": "2020-09-28T06:08:49+00:00" + "time": "2024-03-02T06:27:43+00:00" }, { "name": "sebastian/code-unit", @@ -1526,16 +1549,16 @@ }, { "name": "sebastian/comparator", - "version": "4.0.6", + "version": "4.0.9", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/comparator.git", - "reference": "55f4261989e546dc112258c7a75935a81a7ce382" + "reference": "67a2df3a62639eab2cc5906065e9805d4fd5dfc5" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/comparator/zipball/55f4261989e546dc112258c7a75935a81a7ce382", - "reference": "55f4261989e546dc112258c7a75935a81a7ce382", + "url": "https://api.github.com/repos/sebastianbergmann/comparator/zipball/67a2df3a62639eab2cc5906065e9805d4fd5dfc5", + "reference": "67a2df3a62639eab2cc5906065e9805d4fd5dfc5", "shasum": "" }, "require": { @@ -1588,32 +1611,44 @@ ], "support": { "issues": "https://github.com/sebastianbergmann/comparator/issues", - "source": "https://github.com/sebastianbergmann/comparator/tree/4.0.6" + "source": "https://github.com/sebastianbergmann/comparator/tree/4.0.9" }, "funding": [ { "url": "https://github.com/sebastianbergmann", "type": "github" + }, + { + "url": "https://liberapay.com/sebastianbergmann", + "type": "liberapay" + }, + { + "url": "https://thanks.dev/u/gh/sebastianbergmann", + "type": "thanks_dev" + }, + { + "url": "https://tidelift.com/funding/github/packagist/sebastian/comparator", + "type": "tidelift" } ], - "time": "2020-10-26T15:49:45+00:00" + "time": "2025-08-10T06:51:50+00:00" }, { "name": "sebastian/complexity", - "version": "2.0.2", + "version": "2.0.3", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/complexity.git", - "reference": "739b35e53379900cc9ac327b2147867b8b6efd88" + "reference": "25f207c40d62b8b7aa32f5ab026c53561964053a" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/complexity/zipball/739b35e53379900cc9ac327b2147867b8b6efd88", - "reference": "739b35e53379900cc9ac327b2147867b8b6efd88", + "url": "https://api.github.com/repos/sebastianbergmann/complexity/zipball/25f207c40d62b8b7aa32f5ab026c53561964053a", + "reference": "25f207c40d62b8b7aa32f5ab026c53561964053a", "shasum": "" }, "require": { - "nikic/php-parser": "^4.7", + "nikic/php-parser": "^4.18 || ^5.0", "php": ">=7.3" }, "require-dev": { @@ -1645,7 +1680,7 @@ "homepage": "https://github.com/sebastianbergmann/complexity", "support": { "issues": "https://github.com/sebastianbergmann/complexity/issues", - "source": "https://github.com/sebastianbergmann/complexity/tree/2.0.2" + "source": "https://github.com/sebastianbergmann/complexity/tree/2.0.3" }, "funding": [ { @@ -1653,20 +1688,20 @@ "type": "github" } ], - "time": "2020-10-26T15:52:27+00:00" + "time": "2023-12-22T06:19:30+00:00" }, { "name": "sebastian/diff", - "version": "4.0.4", + "version": "4.0.6", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/diff.git", - "reference": "3461e3fccc7cfdfc2720be910d3bd73c69be590d" + "reference": "ba01945089c3a293b01ba9badc29ad55b106b0bc" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/diff/zipball/3461e3fccc7cfdfc2720be910d3bd73c69be590d", - "reference": "3461e3fccc7cfdfc2720be910d3bd73c69be590d", + "url": "https://api.github.com/repos/sebastianbergmann/diff/zipball/ba01945089c3a293b01ba9badc29ad55b106b0bc", + "reference": "ba01945089c3a293b01ba9badc29ad55b106b0bc", "shasum": "" }, "require": { @@ -1711,7 +1746,7 @@ ], "support": { "issues": "https://github.com/sebastianbergmann/diff/issues", - "source": "https://github.com/sebastianbergmann/diff/tree/4.0.4" + "source": "https://github.com/sebastianbergmann/diff/tree/4.0.6" }, "funding": [ { @@ -1719,20 +1754,20 @@ "type": "github" } ], - "time": "2020-10-26T13:10:38+00:00" + "time": "2024-03-02T06:30:58+00:00" }, { "name": "sebastian/environment", - "version": "5.1.4", + "version": "5.1.5", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/environment.git", - "reference": "1b5dff7bb151a4db11d49d90e5408e4e938270f7" + "reference": "830c43a844f1f8d5b7a1f6d6076b784454d8b7ed" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/environment/zipball/1b5dff7bb151a4db11d49d90e5408e4e938270f7", - "reference": "1b5dff7bb151a4db11d49d90e5408e4e938270f7", + "url": "https://api.github.com/repos/sebastianbergmann/environment/zipball/830c43a844f1f8d5b7a1f6d6076b784454d8b7ed", + "reference": "830c43a844f1f8d5b7a1f6d6076b784454d8b7ed", "shasum": "" }, "require": { @@ -1774,7 +1809,7 @@ ], "support": { "issues": "https://github.com/sebastianbergmann/environment/issues", - "source": "https://github.com/sebastianbergmann/environment/tree/5.1.4" + "source": "https://github.com/sebastianbergmann/environment/tree/5.1.5" }, "funding": [ { @@ -1782,20 +1817,20 @@ "type": "github" } ], - "time": "2022-04-03T09:37:03+00:00" + "time": "2023-02-03T06:03:51+00:00" }, { "name": "sebastian/exporter", - "version": "4.0.4", + "version": "4.0.8", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/exporter.git", - "reference": "65e8b7db476c5dd267e65eea9cab77584d3cfff9" + "reference": "14c6ba52f95a36c3d27c835d65efc7123c446e8c" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/exporter/zipball/65e8b7db476c5dd267e65eea9cab77584d3cfff9", - "reference": "65e8b7db476c5dd267e65eea9cab77584d3cfff9", + "url": "https://api.github.com/repos/sebastianbergmann/exporter/zipball/14c6ba52f95a36c3d27c835d65efc7123c446e8c", + "reference": "14c6ba52f95a36c3d27c835d65efc7123c446e8c", "shasum": "" }, "require": { @@ -1851,28 +1886,40 @@ ], "support": { "issues": "https://github.com/sebastianbergmann/exporter/issues", - "source": "https://github.com/sebastianbergmann/exporter/tree/4.0.4" + "source": "https://github.com/sebastianbergmann/exporter/tree/4.0.8" }, "funding": [ { "url": "https://github.com/sebastianbergmann", "type": "github" + }, + { + "url": "https://liberapay.com/sebastianbergmann", + "type": "liberapay" + }, + { + "url": "https://thanks.dev/u/gh/sebastianbergmann", + "type": "thanks_dev" + }, + { + "url": "https://tidelift.com/funding/github/packagist/sebastian/exporter", + "type": "tidelift" } ], - "time": "2021-11-11T14:18:36+00:00" + "time": "2025-09-24T06:03:27+00:00" }, { "name": "sebastian/global-state", - "version": "5.0.5", + "version": "5.0.8", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/global-state.git", - "reference": "0ca8db5a5fc9c8646244e629625ac486fa286bf2" + "reference": "b6781316bdcd28260904e7cc18ec983d0d2ef4f6" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/global-state/zipball/0ca8db5a5fc9c8646244e629625ac486fa286bf2", - "reference": "0ca8db5a5fc9c8646244e629625ac486fa286bf2", + "url": "https://api.github.com/repos/sebastianbergmann/global-state/zipball/b6781316bdcd28260904e7cc18ec983d0d2ef4f6", + "reference": "b6781316bdcd28260904e7cc18ec983d0d2ef4f6", "shasum": "" }, "require": { @@ -1915,32 +1962,44 @@ ], "support": { "issues": "https://github.com/sebastianbergmann/global-state/issues", - "source": "https://github.com/sebastianbergmann/global-state/tree/5.0.5" + "source": "https://github.com/sebastianbergmann/global-state/tree/5.0.8" }, "funding": [ { "url": "https://github.com/sebastianbergmann", "type": "github" + }, + { + "url": "https://liberapay.com/sebastianbergmann", + "type": "liberapay" + }, + { + "url": "https://thanks.dev/u/gh/sebastianbergmann", + "type": "thanks_dev" + }, + { + "url": "https://tidelift.com/funding/github/packagist/sebastian/global-state", + "type": "tidelift" } ], - "time": "2022-02-14T08:28:10+00:00" + "time": "2025-08-10T07:10:35+00:00" }, { "name": "sebastian/lines-of-code", - "version": "1.0.3", + "version": "1.0.4", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/lines-of-code.git", - "reference": "c1c2e997aa3146983ed888ad08b15470a2e22ecc" + "reference": "e1e4a170560925c26d424b6a03aed157e7dcc5c5" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/lines-of-code/zipball/c1c2e997aa3146983ed888ad08b15470a2e22ecc", - "reference": "c1c2e997aa3146983ed888ad08b15470a2e22ecc", + "url": "https://api.github.com/repos/sebastianbergmann/lines-of-code/zipball/e1e4a170560925c26d424b6a03aed157e7dcc5c5", + "reference": "e1e4a170560925c26d424b6a03aed157e7dcc5c5", "shasum": "" }, "require": { - "nikic/php-parser": "^4.6", + "nikic/php-parser": "^4.18 || ^5.0", "php": ">=7.3" }, "require-dev": { @@ -1972,7 +2031,7 @@ "homepage": "https://github.com/sebastianbergmann/lines-of-code", "support": { "issues": "https://github.com/sebastianbergmann/lines-of-code/issues", - "source": "https://github.com/sebastianbergmann/lines-of-code/tree/1.0.3" + "source": "https://github.com/sebastianbergmann/lines-of-code/tree/1.0.4" }, "funding": [ { @@ -1980,7 +2039,7 @@ "type": "github" } ], - "time": "2020-11-28T06:42:11+00:00" + "time": "2023-12-22T06:20:34+00:00" }, { "name": "sebastian/object-enumerator", @@ -2096,16 +2155,16 @@ }, { "name": "sebastian/recursion-context", - "version": "4.0.4", + "version": "4.0.6", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/recursion-context.git", - "reference": "cd9d8cf3c5804de4341c283ed787f099f5506172" + "reference": "539c6691e0623af6dc6f9c20384c120f963465a0" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/recursion-context/zipball/cd9d8cf3c5804de4341c283ed787f099f5506172", - "reference": "cd9d8cf3c5804de4341c283ed787f099f5506172", + "url": "https://api.github.com/repos/sebastianbergmann/recursion-context/zipball/539c6691e0623af6dc6f9c20384c120f963465a0", + "reference": "539c6691e0623af6dc6f9c20384c120f963465a0", "shasum": "" }, "require": { @@ -2144,31 +2203,43 @@ } ], "description": "Provides functionality to recursively process PHP variables", - "homepage": "http://www.github.com/sebastianbergmann/recursion-context", + "homepage": "https://github.com/sebastianbergmann/recursion-context", "support": { "issues": "https://github.com/sebastianbergmann/recursion-context/issues", - "source": "https://github.com/sebastianbergmann/recursion-context/tree/4.0.4" + "source": "https://github.com/sebastianbergmann/recursion-context/tree/4.0.6" }, "funding": [ { "url": "https://github.com/sebastianbergmann", "type": "github" + }, + { + "url": "https://liberapay.com/sebastianbergmann", + "type": "liberapay" + }, + { + "url": "https://thanks.dev/u/gh/sebastianbergmann", + "type": "thanks_dev" + }, + { + "url": "https://tidelift.com/funding/github/packagist/sebastian/recursion-context", + "type": "tidelift" } ], - "time": "2020-10-26T13:17:30+00:00" + "time": "2025-08-10T06:57:39+00:00" }, { "name": "sebastian/resource-operations", - "version": "3.0.3", + "version": "3.0.4", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/resource-operations.git", - "reference": "0f4443cb3a1d92ce809899753bc0d5d5a8dd19a8" + "reference": "05d5692a7993ecccd56a03e40cd7e5b09b1d404e" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/resource-operations/zipball/0f4443cb3a1d92ce809899753bc0d5d5a8dd19a8", - "reference": "0f4443cb3a1d92ce809899753bc0d5d5a8dd19a8", + "url": "https://api.github.com/repos/sebastianbergmann/resource-operations/zipball/05d5692a7993ecccd56a03e40cd7e5b09b1d404e", + "reference": "05d5692a7993ecccd56a03e40cd7e5b09b1d404e", "shasum": "" }, "require": { @@ -2180,7 +2251,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "3.0-dev" + "dev-main": "3.0-dev" } }, "autoload": { @@ -2201,8 +2272,7 @@ "description": "Provides a list of PHP built-in functions that operate on resources", "homepage": "https://www.github.com/sebastianbergmann/resource-operations", "support": { - "issues": "https://github.com/sebastianbergmann/resource-operations/issues", - "source": "https://github.com/sebastianbergmann/resource-operations/tree/3.0.3" + "source": "https://github.com/sebastianbergmann/resource-operations/tree/3.0.4" }, "funding": [ { @@ -2210,20 +2280,20 @@ "type": "github" } ], - "time": "2020-09-28T06:45:17+00:00" + "time": "2024-03-14T16:00:52+00:00" }, { "name": "sebastian/type", - "version": "3.0.0", + "version": "3.2.1", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/type.git", - "reference": "b233b84bc4465aff7b57cf1c4bc75c86d00d6dad" + "reference": "75e2c2a32f5e0b3aef905b9ed0b179b953b3d7c7" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/type/zipball/b233b84bc4465aff7b57cf1c4bc75c86d00d6dad", - "reference": "b233b84bc4465aff7b57cf1c4bc75c86d00d6dad", + "url": "https://api.github.com/repos/sebastianbergmann/type/zipball/75e2c2a32f5e0b3aef905b9ed0b179b953b3d7c7", + "reference": "75e2c2a32f5e0b3aef905b9ed0b179b953b3d7c7", "shasum": "" }, "require": { @@ -2235,7 +2305,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "3.0-dev" + "dev-master": "3.2-dev" } }, "autoload": { @@ -2258,7 +2328,7 @@ "homepage": "https://github.com/sebastianbergmann/type", "support": { "issues": "https://github.com/sebastianbergmann/type/issues", - "source": "https://github.com/sebastianbergmann/type/tree/3.0.0" + "source": "https://github.com/sebastianbergmann/type/tree/3.2.1" }, "funding": [ { @@ -2266,7 +2336,7 @@ "type": "github" } ], - "time": "2022-03-15T09:54:48+00:00" + "time": "2023-02-03T06:13:03+00:00" }, { "name": "sebastian/version", @@ -2323,16 +2393,16 @@ }, { "name": "theseer/tokenizer", - "version": "1.2.1", + "version": "1.3.1", "source": { "type": "git", "url": "https://github.com/theseer/tokenizer.git", - "reference": "34a41e998c2183e22995f158c581e7b5e755ab9e" + "reference": "b7489ce515e168639d17feec34b8847c326b0b3c" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/theseer/tokenizer/zipball/34a41e998c2183e22995f158c581e7b5e755ab9e", - "reference": "34a41e998c2183e22995f158c581e7b5e755ab9e", + "url": "https://api.github.com/repos/theseer/tokenizer/zipball/b7489ce515e168639d17feec34b8847c326b0b3c", + "reference": "b7489ce515e168639d17feec34b8847c326b0b3c", "shasum": "" }, "require": { @@ -2361,7 +2431,7 @@ "description": "A small library for converting tokenized PHP source code into XML and potentially other formats", "support": { "issues": "https://github.com/theseer/tokenizer/issues", - "source": "https://github.com/theseer/tokenizer/tree/1.2.1" + "source": "https://github.com/theseer/tokenizer/tree/1.3.1" }, "funding": [ { @@ -2369,12 +2439,14 @@ "type": "github" } ], - "time": "2021-07-28T10:34:58+00:00" + "time": "2025-11-17T20:03:58+00:00" } ], "aliases": [], "minimum-stability": "stable", - "stability-flags": {}, + "stability-flags": { + "phpdocumentor/type-resolver": 20 + }, "prefer-stable": false, "prefer-lowest": false, "platform": { diff --git a/phpstan.neon b/phpstan.neon index 9ca87a24..c2365775 100644 --- a/phpstan.neon +++ b/phpstan.neon @@ -3,33 +3,5 @@ parameters: ignoreErrors: - '#Method phpDocumentor\\Reflection\\DocBlock\\StandardTagFactory::createTag\(\) should return phpDocumentor\\Reflection\\DocBlock\\Tag but returns mixed#' - '#Offset 2 on array\{string, 28, int\} on left side of \?\? always exists and is not nullable\.#' - - - message: "#^Parameter \\#1 \\$constExprParser of class PHPStan\\\\PhpDocParser\\\\Parser\\\\TypeParser constructor expects PHPStan\\\\PhpDocParser\\\\Parser\\\\ConstExprParser\\|null, PHPStan\\\\PhpDocParser\\\\ParserConfig given\\.$#" - count: 1 - path: src/DocBlock/Tags/Factory/AbstractPHPStanFactory.php - - - message: "#^Parameter \\#1 \\$parseDoctrineAnnotations of class PHPStan\\\\PhpDocParser\\\\Lexer\\\\Lexer constructor expects bool, PHPStan\\\\PhpDocParser\\\\ParserConfig given\\.$#" - count: 1 - path: src/DocBlock/Tags/Factory/AbstractPHPStanFactory.php - - - message: "#^Parameter \\#1 \\$typeParser of class PHPStan\\\\PhpDocParser\\\\Parser\\\\PhpDocParser constructor expects PHPStan\\\\PhpDocParser\\\\Parser\\\\TypeParser, PHPStan\\\\PhpDocParser\\\\ParserConfig given\\.$#" - count: 1 - path: src/DocBlock/Tags/Factory/AbstractPHPStanFactory.php - - - message: "#^Parameter \\#1 \\$unescapeStrings of class PHPStan\\\\PhpDocParser\\\\Parser\\\\ConstExprParser constructor expects bool, PHPStan\\\\PhpDocParser\\\\ParserConfig given\\.$#" - count: 1 - path: src/DocBlock/Tags/Factory/AbstractPHPStanFactory.php - - - message: "#^Parameter \\#2 \\$constantExprParser of class PHPStan\\\\PhpDocParser\\\\Parser\\\\PhpDocParser constructor expects PHPStan\\\\PhpDocParser\\\\Parser\\\\ConstExprParser, PHPStan\\\\PhpDocParser\\\\Parser\\\\TypeParser given\\.$#" - count: 1 - path: src/DocBlock/Tags/Factory/AbstractPHPStanFactory.php - - - message: "#^Parameter \\#2 \\$quoteAwareConstExprString of class PHPStan\\\\PhpDocParser\\\\Parser\\\\TypeParser constructor expects bool, PHPStan\\\\PhpDocParser\\\\Parser\\\\ConstExprParser given\\.$#" - count: 1 - path: src/DocBlock/Tags/Factory/AbstractPHPStanFactory.php - - - message: "#^Parameter \\#3 \\$requireWhitespaceBeforeDescription of class PHPStan\\\\PhpDocParser\\\\Parser\\\\PhpDocParser constructor expects bool, PHPStan\\\\PhpDocParser\\\\Parser\\\\ConstExprParser given\\.$#" - count: 1 - path: src/DocBlock/Tags/Factory/AbstractPHPStanFactory.php paths: - src diff --git a/src/DocBlock/Tags/Author.php b/src/DocBlock/Tags/Author.php index 290e5a95..e604ac8b 100644 --- a/src/DocBlock/Tags/Author.php +++ b/src/DocBlock/Tags/Author.php @@ -24,7 +24,7 @@ /** * Reflection class for an {@}author tag in a Docblock. */ -final class Author extends BaseTag implements Factory\StaticMethod +final class Author extends BaseTag { /** @var string register that this is the author tag. */ protected string $name = 'author'; diff --git a/src/DocBlock/Tags/Covers.php b/src/DocBlock/Tags/Covers.php index 022594e2..ba2384f8 100644 --- a/src/DocBlock/Tags/Covers.php +++ b/src/DocBlock/Tags/Covers.php @@ -27,7 +27,7 @@ /** * Reflection class for a @covers tag in a Docblock. */ -final class Covers extends BaseTag implements Factory\StaticMethod +final class Covers extends BaseTag { protected string $name = 'covers'; diff --git a/src/DocBlock/Tags/Deprecated.php b/src/DocBlock/Tags/Deprecated.php index fff591f9..8ae8322b 100644 --- a/src/DocBlock/Tags/Deprecated.php +++ b/src/DocBlock/Tags/Deprecated.php @@ -23,7 +23,7 @@ /** * Reflection class for a {@}deprecated tag in a Docblock. */ -final class Deprecated extends BaseTag implements Factory\StaticMethod +final class Deprecated extends BaseTag { protected string $name = 'deprecated'; diff --git a/src/DocBlock/Tags/Example.php b/src/DocBlock/Tags/Example.php index 3ddbb686..06ecf8c1 100644 --- a/src/DocBlock/Tags/Example.php +++ b/src/DocBlock/Tags/Example.php @@ -26,7 +26,7 @@ /** * Reflection class for a {@}example tag in a Docblock. */ -final class Example implements Tag, Factory\StaticMethod +final class Example implements Tag { /** @var string Path to a file to use as an example. May also be an absolute URI. */ private string $filePath; diff --git a/src/DocBlock/Tags/Extends_.php b/src/DocBlock/Tags/Extends_.php index 831af03d..583d791d 100644 --- a/src/DocBlock/Tags/Extends_.php +++ b/src/DocBlock/Tags/Extends_.php @@ -13,9 +13,7 @@ namespace phpDocumentor\Reflection\DocBlock\Tags; -use Doctrine\Deprecations\Deprecation; use phpDocumentor\Reflection\DocBlock\Description; -use phpDocumentor\Reflection\DocBlock\Tag; use phpDocumentor\Reflection\Type; /** @@ -29,20 +27,4 @@ public function __construct(Type $type, ?Description $description = null) $this->type = $type; $this->description = $description; } - - /** - * @deprecated Create using static factory is deprecated, - * this method should not be called directly by library consumers - */ - public static function create(string $body): ?Tag - { - Deprecation::trigger( - 'phpdocumentor/reflection-docblock', - 'https://github.com/phpDocumentor/ReflectionDocBlock/issues/361', - 'Create using static factory is deprecated, this method should not be called directly - by library consumers', - ); - - return null; - } } diff --git a/src/DocBlock/Tags/Factory/AbstractPHPStanFactory.php b/src/DocBlock/Tags/Factory/AbstractPHPStanFactory.php index f8bababf..71cd61d9 100644 --- a/src/DocBlock/Tags/Factory/AbstractPHPStanFactory.php +++ b/src/DocBlock/Tags/Factory/AbstractPHPStanFactory.php @@ -24,7 +24,6 @@ use PHPStan\PhpDocParser\ParserConfig; use RuntimeException; -use function class_exists; use function ltrim; use function property_exists; use function rtrim; @@ -46,27 +45,14 @@ class AbstractPHPStanFactory implements Factory public function __construct(PHPStanFactory ...$factories) { - if (class_exists(ParserConfig::class)) { - $config = new ParserConfig(['indexes' => true, 'lines' => true]); - $this->lexer = new Lexer($config); - $constParser = new ConstExprParser($config); - $this->parser = new PhpDocParser( - $config, - new TypeParser($config, $constParser), - $constParser - ); - } else { - $this->lexer = new Lexer(true); - $constParser = new ConstExprParser(true, true, ['lines' => true, 'indexes' => true]); - $this->parser = new PhpDocParser( - new TypeParser($constParser, true, ['lines' => true, 'indexes' => true]), - $constParser, - true, - true, - ['lines' => true, 'indexes' => true], - true - ); - } + $config = new ParserConfig(['indexes' => true, 'lines' => true]); + $this->lexer = new Lexer($config); + $constParser = new ConstExprParser($config); + $this->parser = new PhpDocParser( + $config, + new TypeParser($config, $constParser), + $constParser + ); $this->factories = $factories; } diff --git a/src/DocBlock/Tags/Factory/ParamFactory.php b/src/DocBlock/Tags/Factory/ParamFactory.php index 7d680d9c..a0970d98 100644 --- a/src/DocBlock/Tags/Factory/ParamFactory.php +++ b/src/DocBlock/Tags/Factory/ParamFactory.php @@ -4,7 +4,6 @@ namespace phpDocumentor\Reflection\DocBlock\Tags\Factory; -use Doctrine\Deprecations\Deprecation; use phpDocumentor\Reflection\DocBlock\DescriptionFactory; use phpDocumentor\Reflection\DocBlock\Tag; use phpDocumentor\Reflection\DocBlock\Tags\InvalidTag; @@ -20,7 +19,6 @@ use Webmozart\Assert\Assert; use function is_string; -use function sprintf; use function trim; /** @@ -42,16 +40,7 @@ public function create(PhpDocTagNode $node, Context $context): Tag $tagValue = $node->value; if ($tagValue instanceof InvalidTagValueNode) { - Deprecation::trigger( - 'phpdocumentor/reflection-docblock', - 'https://github.com/phpDocumentor/ReflectionDocBlock/issues/362', - sprintf( - 'Param tag value "%s" is invalid, falling back to legacy parsing. Please update your docblocks.', - $tagValue->value - ) - ); - - return Param::create($tagValue->value, $this->typeResolver, $this->descriptionFactory, $context); + return InvalidTag::create($tagValue->value, 'param')->withError($tagValue->exception); } Assert::isInstanceOfAny( diff --git a/src/DocBlock/Tags/Factory/StaticMethod.php b/src/DocBlock/Tags/Factory/StaticMethod.php deleted file mode 100644 index f6f0bb5a..00000000 --- a/src/DocBlock/Tags/Factory/StaticMethod.php +++ /dev/null @@ -1,25 +0,0 @@ -type = $type; $this->description = $description; } - - /** - * @deprecated Create using static factory is deprecated, - * this method should not be called directly by library consumers - */ - public static function create(string $body): ?Tag - { - Deprecation::trigger( - 'phpdocumentor/reflection-docblock', - 'https://github.com/phpDocumentor/ReflectionDocBlock/issues/361', - 'Create using static factory is deprecated, this method should not be called directly - by library consumers', - ); - - return null; - } } diff --git a/src/DocBlock/Tags/Link.php b/src/DocBlock/Tags/Link.php index fcb6ec19..8ce615d9 100644 --- a/src/DocBlock/Tags/Link.php +++ b/src/DocBlock/Tags/Link.php @@ -22,7 +22,7 @@ /** * Reflection class for a {@}link tag in a Docblock. */ -final class Link extends BaseTag implements Factory\StaticMethod +final class Link extends BaseTag { protected string $name = 'link'; diff --git a/src/DocBlock/Tags/Method.php b/src/DocBlock/Tags/Method.php index 41e0eed1..d2c0c82c 100644 --- a/src/DocBlock/Tags/Method.php +++ b/src/DocBlock/Tags/Method.php @@ -41,7 +41,7 @@ /** * Reflection class for an {@}method in a Docblock. */ -final class Method extends BaseTag implements Factory\StaticMethod +final class Method extends BaseTag { protected string $name = 'method'; diff --git a/src/DocBlock/Tags/Mixin.php b/src/DocBlock/Tags/Mixin.php index c15d30c1..4dd8a47a 100644 --- a/src/DocBlock/Tags/Mixin.php +++ b/src/DocBlock/Tags/Mixin.php @@ -23,7 +23,7 @@ /** * Reflection class for a {@}mixin tag in a Docblock. */ -final class Mixin extends TagWithType implements Factory\StaticMethod +final class Mixin extends TagWithType { public function __construct(Type $type, ?Description $description = null) { diff --git a/src/DocBlock/Tags/Param.php b/src/DocBlock/Tags/Param.php index 6d46686d..bb513ca0 100644 --- a/src/DocBlock/Tags/Param.php +++ b/src/DocBlock/Tags/Param.php @@ -13,27 +13,15 @@ namespace phpDocumentor\Reflection\DocBlock\Tags; -use Doctrine\Deprecations\Deprecation; use phpDocumentor\Reflection\DocBlock\Description; -use phpDocumentor\Reflection\DocBlock\DescriptionFactory; use phpDocumentor\Reflection\Type; -use phpDocumentor\Reflection\TypeResolver; -use phpDocumentor\Reflection\Types\Context as TypeContext; -use phpDocumentor\Reflection\Utils; -use Webmozart\Assert\Assert; - -use function array_shift; -use function array_unshift; -use function implode; -use function strpos; -use function substr; -use const PREG_SPLIT_DELIM_CAPTURE; +use function strpos; /** * Reflection class for the {@}param tag in a Docblock. */ -final class Param extends TagWithType implements Factory\StaticMethod +final class Param extends TagWithType { private ?string $variableName = null; @@ -58,72 +46,6 @@ public function __construct( $this->isReference = $isReference; } - /** - * @deprecated Create using static factory is deprecated, - * this method should not be called directly by library consumers - */ - public static function create( - string $body, - ?TypeResolver $typeResolver = null, - ?DescriptionFactory $descriptionFactory = null, - ?TypeContext $context = null - ): self { - Deprecation::triggerIfCalledFromOutside( - 'phpdocumentor/reflection-docblock', - 'https://github.com/phpDocumentor/ReflectionDocBlock/issues/361', - 'Create using static factory is deprecated, this method should not be called directly - by library consumers', - ); - - Assert::stringNotEmpty($body); - Assert::notNull($typeResolver); - Assert::notNull($descriptionFactory); - - [$firstPart, $body] = self::extractTypeFromBody($body); - - $type = null; - $parts = Utils::pregSplit('/(\s+)/Su', $body, 2, PREG_SPLIT_DELIM_CAPTURE); - $variableName = ''; - $isVariadic = false; - $isReference = false; - - // if the first item that is encountered is not a variable; it is a type - if ($firstPart && !self::strStartsWithVariable($firstPart)) { - $type = $typeResolver->resolve($firstPart, $context); - } else { - // first part is not a type; we should prepend it to the parts array for further processing - array_unshift($parts, $firstPart); - } - - // if the next item starts with a $ or ...$ or &$ or &...$ it must be the variable name - if (isset($parts[0]) && self::strStartsWithVariable($parts[0])) { - $variableName = array_shift($parts); - if ($type) { - array_shift($parts); - } - - Assert::notNull($variableName); - - if (strpos($variableName, '$') === 0) { - $variableName = substr($variableName, 1); - } elseif (strpos($variableName, '&$') === 0) { - $isReference = true; - $variableName = substr($variableName, 2); - } elseif (strpos($variableName, '...$') === 0) { - $isVariadic = true; - $variableName = substr($variableName, 4); - } elseif (strpos($variableName, '&...$') === 0) { - $isVariadic = true; - $isReference = true; - $variableName = substr($variableName, 5); - } - } - - $description = $descriptionFactory->create(implode('', $parts), $context); - - return new static($variableName, $type, $isVariadic, $description, $isReference); - } - /** * Returns the variable's name. */ @@ -171,15 +93,4 @@ public function __toString(): string . ($variableName !== '' ? ($type !== '' ? ' ' : '') . $variableName : '') . ($description !== '' ? ($type !== '' || $variableName !== '' ? ' ' : '') . $description : ''); } - - private static function strStartsWithVariable(string $str): bool - { - return strpos($str, '$') === 0 - || - strpos($str, '...$') === 0 - || - strpos($str, '&$') === 0 - || - strpos($str, '&...$') === 0; - } } diff --git a/src/DocBlock/Tags/Property.php b/src/DocBlock/Tags/Property.php index 3328b080..b7bd9589 100644 --- a/src/DocBlock/Tags/Property.php +++ b/src/DocBlock/Tags/Property.php @@ -13,27 +13,14 @@ namespace phpDocumentor\Reflection\DocBlock\Tags; -use Doctrine\Deprecations\Deprecation; use phpDocumentor\Reflection\DocBlock\Description; -use phpDocumentor\Reflection\DocBlock\DescriptionFactory; use phpDocumentor\Reflection\Type; -use phpDocumentor\Reflection\TypeResolver; -use phpDocumentor\Reflection\Types\Context as TypeContext; -use phpDocumentor\Reflection\Utils; use Webmozart\Assert\Assert; -use function array_shift; -use function array_unshift; -use function implode; -use function strpos; -use function substr; - -use const PREG_SPLIT_DELIM_CAPTURE; - /** * Reflection class for a {@}property tag in a Docblock. */ -final class Property extends TagWithType implements Factory\StaticMethod +final class Property extends TagWithType { protected ?string $variableName = null; @@ -47,57 +34,6 @@ public function __construct(?string $variableName, ?Type $type = null, ?Descript $this->description = $description; } - /** - * @deprecated Create using static factory is deprecated, - * this method should not be called directly by library consumers - */ - public static function create( - string $body, - ?TypeResolver $typeResolver = null, - ?DescriptionFactory $descriptionFactory = null, - ?TypeContext $context = null - ): self { - Deprecation::triggerIfCalledFromOutside( - 'phpdocumentor/reflection-docblock', - 'https://github.com/phpDocumentor/ReflectionDocBlock/issues/361', - 'Create using static factory is deprecated, this method should not be called directly - by library consumers', - ); - - Assert::stringNotEmpty($body); - Assert::notNull($typeResolver); - Assert::notNull($descriptionFactory); - - [$firstPart, $body] = self::extractTypeFromBody($body); - $type = null; - $parts = Utils::pregSplit('/(\s+)/Su', $body, 2, PREG_SPLIT_DELIM_CAPTURE); - $variableName = ''; - - // if the first item that is encountered is not a variable; it is a type - if ($firstPart && $firstPart[0] !== '$') { - $type = $typeResolver->resolve($firstPart, $context); - } else { - // first part is not a type; we should prepend it to the parts array for further processing - array_unshift($parts, $firstPart); - } - - // if the next item starts with a $ it must be the variable name - if (isset($parts[0]) && strpos($parts[0], '$') === 0) { - $variableName = array_shift($parts); - if ($type) { - array_shift($parts); - } - - Assert::notNull($variableName); - - $variableName = substr($variableName, 1); - } - - $description = $descriptionFactory->create(implode('', $parts), $context); - - return new static($variableName, $type, $description); - } - /** * Returns the variable's name. */ diff --git a/src/DocBlock/Tags/PropertyRead.php b/src/DocBlock/Tags/PropertyRead.php index 8ac1eb02..bcb0e0d8 100644 --- a/src/DocBlock/Tags/PropertyRead.php +++ b/src/DocBlock/Tags/PropertyRead.php @@ -13,27 +13,14 @@ namespace phpDocumentor\Reflection\DocBlock\Tags; -use Doctrine\Deprecations\Deprecation; use phpDocumentor\Reflection\DocBlock\Description; -use phpDocumentor\Reflection\DocBlock\DescriptionFactory; use phpDocumentor\Reflection\Type; -use phpDocumentor\Reflection\TypeResolver; -use phpDocumentor\Reflection\Types\Context as TypeContext; -use phpDocumentor\Reflection\Utils; use Webmozart\Assert\Assert; -use function array_shift; -use function array_unshift; -use function implode; -use function strpos; -use function substr; - -use const PREG_SPLIT_DELIM_CAPTURE; - /** * Reflection class for a {@}property-read tag in a Docblock. */ -final class PropertyRead extends TagWithType implements Factory\StaticMethod +final class PropertyRead extends TagWithType { protected ?string $variableName = null; @@ -47,57 +34,6 @@ public function __construct(?string $variableName, ?Type $type = null, ?Descript $this->description = $description; } - /** - * @deprecated Create using static factory is deprecated, - * this method should not be called directly by library consumers - */ - public static function create( - string $body, - ?TypeResolver $typeResolver = null, - ?DescriptionFactory $descriptionFactory = null, - ?TypeContext $context = null - ): self { - Deprecation::triggerIfCalledFromOutside( - 'phpdocumentor/reflection-docblock', - 'https://github.com/phpDocumentor/ReflectionDocBlock/issues/361', - 'Create using static factory is deprecated, this method should not be called directly - by library consumers', - ); - - Assert::stringNotEmpty($body); - Assert::notNull($typeResolver); - Assert::notNull($descriptionFactory); - - [$firstPart, $body] = self::extractTypeFromBody($body); - $type = null; - $parts = Utils::pregSplit('/(\s+)/Su', $body, 2, PREG_SPLIT_DELIM_CAPTURE); - $variableName = ''; - - // if the first item that is encountered is not a variable; it is a type - if ($firstPart && $firstPart[0] !== '$') { - $type = $typeResolver->resolve($firstPart, $context); - } else { - // first part is not a type; we should prepend it to the parts array for further processing - array_unshift($parts, $firstPart); - } - - // if the next item starts with a $ it must be the variable name - if (isset($parts[0]) && strpos($parts[0], '$') === 0) { - $variableName = array_shift($parts); - if ($type) { - array_shift($parts); - } - - Assert::notNull($variableName); - - $variableName = substr($variableName, 1); - } - - $description = $descriptionFactory->create(implode('', $parts), $context); - - return new static($variableName, $type, $description); - } - /** * Returns the variable's name. */ diff --git a/src/DocBlock/Tags/PropertyWrite.php b/src/DocBlock/Tags/PropertyWrite.php index 57e7eb10..a5ee9e9e 100644 --- a/src/DocBlock/Tags/PropertyWrite.php +++ b/src/DocBlock/Tags/PropertyWrite.php @@ -13,27 +13,14 @@ namespace phpDocumentor\Reflection\DocBlock\Tags; -use Doctrine\Deprecations\Deprecation; use phpDocumentor\Reflection\DocBlock\Description; -use phpDocumentor\Reflection\DocBlock\DescriptionFactory; use phpDocumentor\Reflection\Type; -use phpDocumentor\Reflection\TypeResolver; -use phpDocumentor\Reflection\Types\Context as TypeContext; -use phpDocumentor\Reflection\Utils; use Webmozart\Assert\Assert; -use function array_shift; -use function array_unshift; -use function implode; -use function strpos; -use function substr; - -use const PREG_SPLIT_DELIM_CAPTURE; - /** * Reflection class for a {@}property-write tag in a Docblock. */ -final class PropertyWrite extends TagWithType implements Factory\StaticMethod +final class PropertyWrite extends TagWithType { protected string $variableName; @@ -47,57 +34,6 @@ public function __construct(?string $variableName, ?Type $type = null, ?Descript $this->description = $description; } - /** - * @deprecated Create using static factory is deprecated, - * this method should not be called directly by library consumers - */ - public static function create( - string $body, - ?TypeResolver $typeResolver = null, - ?DescriptionFactory $descriptionFactory = null, - ?TypeContext $context = null - ): self { - Deprecation::triggerIfCalledFromOutside( - 'phpdocumentor/reflection-docblock', - 'https://github.com/phpDocumentor/ReflectionDocBlock/issues/361', - 'Create using static factory is deprecated, this method should not be called directly - by library consumers', - ); - - Assert::stringNotEmpty($body); - Assert::notNull($typeResolver); - Assert::notNull($descriptionFactory); - - [$firstPart, $body] = self::extractTypeFromBody($body); - $type = null; - $parts = Utils::pregSplit('/(\s+)/Su', $body, 2, PREG_SPLIT_DELIM_CAPTURE); - $variableName = ''; - - // if the first item that is encountered is not a variable; it is a type - if ($firstPart && $firstPart[0] !== '$') { - $type = $typeResolver->resolve($firstPart, $context); - } else { - // first part is not a type; we should prepend it to the parts array for further processing - array_unshift($parts, $firstPart); - } - - // if the next item starts with a $ it must be the variable name - if (isset($parts[0]) && strpos($parts[0], '$') === 0) { - $variableName = array_shift($parts); - if ($type) { - array_shift($parts); - } - - Assert::notNull($variableName); - - $variableName = substr($variableName, 1); - } - - $description = $descriptionFactory->create(implode('', $parts), $context); - - return new static($variableName, $type, $description); - } - /** * Returns the variable's name. */ diff --git a/src/DocBlock/Tags/Return_.php b/src/DocBlock/Tags/Return_.php index 7e9b0c7a..bc93a793 100644 --- a/src/DocBlock/Tags/Return_.php +++ b/src/DocBlock/Tags/Return_.php @@ -13,18 +13,13 @@ namespace phpDocumentor\Reflection\DocBlock\Tags; -use Doctrine\Deprecations\Deprecation; use phpDocumentor\Reflection\DocBlock\Description; -use phpDocumentor\Reflection\DocBlock\DescriptionFactory; use phpDocumentor\Reflection\Type; -use phpDocumentor\Reflection\TypeResolver; -use phpDocumentor\Reflection\Types\Context as TypeContext; -use Webmozart\Assert\Assert; /** * Reflection class for a {@}return tag in a Docblock. */ -final class Return_ extends TagWithType implements Factory\StaticMethod +final class Return_ extends TagWithType { public function __construct(Type $type, ?Description $description = null) { @@ -32,32 +27,4 @@ public function __construct(Type $type, ?Description $description = null) $this->type = $type; $this->description = $description; } - - /** - * @deprecated Create using static factory is deprecated, - * this method should not be called directly by library consumers - */ - public static function create( - string $body, - ?TypeResolver $typeResolver = null, - ?DescriptionFactory $descriptionFactory = null, - ?TypeContext $context = null - ): self { - Deprecation::triggerIfCalledFromOutside( - 'phpdocumentor/reflection-docblock', - 'https://github.com/phpDocumentor/ReflectionDocBlock/issues/361', - 'Create using static factory is deprecated, this method should not be called directly - by library consumers', - ); - - Assert::notNull($typeResolver); - Assert::notNull($descriptionFactory); - - [$type, $description] = self::extractTypeFromBody($body); - - $type = $typeResolver->resolve($type, $context); - $description = $descriptionFactory->create($description, $context); - - return new static($type, $description); - } } diff --git a/src/DocBlock/Tags/See.php b/src/DocBlock/Tags/See.php index e7330e88..f8242d47 100644 --- a/src/DocBlock/Tags/See.php +++ b/src/DocBlock/Tags/See.php @@ -31,7 +31,7 @@ /** * Reflection class for an {@}see tag in a Docblock. */ -final class See extends BaseTag implements Factory\StaticMethod +final class See extends BaseTag { protected string $name = 'see'; diff --git a/src/DocBlock/Tags/Since.php b/src/DocBlock/Tags/Since.php index 8ec59e91..abfc7502 100644 --- a/src/DocBlock/Tags/Since.php +++ b/src/DocBlock/Tags/Since.php @@ -23,7 +23,7 @@ /** * Reflection class for a {@}since tag in a Docblock. */ -final class Since extends BaseTag implements Factory\StaticMethod +final class Since extends BaseTag { protected string $name = 'since'; diff --git a/src/DocBlock/Tags/Source.php b/src/DocBlock/Tags/Source.php index f6b4f57f..71eefcda 100644 --- a/src/DocBlock/Tags/Source.php +++ b/src/DocBlock/Tags/Source.php @@ -23,7 +23,7 @@ /** * Reflection class for a {@}source tag in a Docblock. */ -final class Source extends BaseTag implements Factory\StaticMethod +final class Source extends BaseTag { protected string $name = 'source'; diff --git a/src/DocBlock/Tags/TagWithType.php b/src/DocBlock/Tags/TagWithType.php index 89e29e5e..2923cf2c 100644 --- a/src/DocBlock/Tags/TagWithType.php +++ b/src/DocBlock/Tags/TagWithType.php @@ -14,6 +14,8 @@ namespace phpDocumentor\Reflection\DocBlock\Tags; use InvalidArgumentException; +use phpDocumentor\Reflection\DocBlock\Tag; +use phpDocumentor\Reflection\Exception\CannotCreateTag; use phpDocumentor\Reflection\Type; use function in_array; @@ -35,6 +37,11 @@ public function getType(): ?Type return $this->type; } + public static function create(string $body): Tag + { + throw new CannotCreateTag('Typed tag cannot be created'); + } + /** * @return string[] */ diff --git a/src/DocBlock/Tags/TemplateCovariant.php b/src/DocBlock/Tags/TemplateCovariant.php index d5d50987..9a0bfc3f 100644 --- a/src/DocBlock/Tags/TemplateCovariant.php +++ b/src/DocBlock/Tags/TemplateCovariant.php @@ -23,7 +23,7 @@ /** * Reflection class for a {@}template-covariant tag in a Docblock. */ -final class TemplateCovariant extends TagWithType implements Factory\StaticMethod +final class TemplateCovariant extends TagWithType { public function __construct(Type $type, ?Description $description = null) { diff --git a/src/DocBlock/Tags/Throws.php b/src/DocBlock/Tags/Throws.php index e0818468..6ce75deb 100644 --- a/src/DocBlock/Tags/Throws.php +++ b/src/DocBlock/Tags/Throws.php @@ -23,7 +23,7 @@ /** * Reflection class for a {@}throws tag in a Docblock. */ -final class Throws extends TagWithType implements Factory\StaticMethod +final class Throws extends TagWithType { public function __construct(Type $type, ?Description $description = null) { diff --git a/src/DocBlock/Tags/Uses.php b/src/DocBlock/Tags/Uses.php index d9aa3608..8a9849a0 100644 --- a/src/DocBlock/Tags/Uses.php +++ b/src/DocBlock/Tags/Uses.php @@ -27,7 +27,7 @@ /** * Reflection class for a {@}uses tag in a Docblock. */ -final class Uses extends BaseTag implements Factory\StaticMethod +final class Uses extends BaseTag { protected string $name = 'uses'; diff --git a/src/DocBlock/Tags/Var_.php b/src/DocBlock/Tags/Var_.php index b0bd8c21..495d16f2 100644 --- a/src/DocBlock/Tags/Var_.php +++ b/src/DocBlock/Tags/Var_.php @@ -13,27 +13,14 @@ namespace phpDocumentor\Reflection\DocBlock\Tags; -use Doctrine\Deprecations\Deprecation; use phpDocumentor\Reflection\DocBlock\Description; -use phpDocumentor\Reflection\DocBlock\DescriptionFactory; use phpDocumentor\Reflection\Type; -use phpDocumentor\Reflection\TypeResolver; -use phpDocumentor\Reflection\Types\Context as TypeContext; -use phpDocumentor\Reflection\Utils; use Webmozart\Assert\Assert; -use function array_shift; -use function array_unshift; -use function implode; -use function strpos; -use function substr; - -use const PREG_SPLIT_DELIM_CAPTURE; - /** * Reflection class for a {@}var tag in a Docblock. */ -final class Var_ extends TagWithType implements Factory\StaticMethod +final class Var_ extends TagWithType { protected ?string $variableName = ''; @@ -47,57 +34,6 @@ public function __construct(?string $variableName, ?Type $type = null, ?Descript $this->description = $description; } - /** - * @deprecated Create using static factory is deprecated, - * this method should not be called directly by library consumers - */ - public static function create( - string $body, - ?TypeResolver $typeResolver = null, - ?DescriptionFactory $descriptionFactory = null, - ?TypeContext $context = null - ): self { - Deprecation::triggerIfCalledFromOutside( - 'phpdocumentor/reflection-docblock', - 'https://github.com/phpDocumentor/ReflectionDocBlock/issues/361', - 'Create using static factory is deprecated, this method should not be called directly - by library consumers', - ); - Assert::stringNotEmpty($body); - Assert::notNull($typeResolver); - Assert::notNull($descriptionFactory); - - [$firstPart, $body] = self::extractTypeFromBody($body); - - $parts = Utils::pregSplit('/(\s+)/Su', $body, 2, PREG_SPLIT_DELIM_CAPTURE); - $type = null; - $variableName = ''; - - // if the first item that is encountered is not a variable; it is a type - if ($firstPart && $firstPart[0] !== '$') { - $type = $typeResolver->resolve($firstPart, $context); - } else { - // first part is not a type; we should prepend it to the parts array for further processing - array_unshift($parts, $firstPart); - } - - // if the next item starts with a $ it must be the variable name - if (isset($parts[0]) && strpos($parts[0], '$') === 0) { - $variableName = array_shift($parts); - if ($type) { - array_shift($parts); - } - - Assert::notNull($variableName); - - $variableName = substr($variableName, 1); - } - - $description = $descriptionFactory->create(implode('', $parts), $context); - - return new static($variableName, $type, $description); - } - /** * Returns the variable's name. */ diff --git a/src/DocBlock/Tags/Version.php b/src/DocBlock/Tags/Version.php index 8ea96ed3..951c8e53 100644 --- a/src/DocBlock/Tags/Version.php +++ b/src/DocBlock/Tags/Version.php @@ -23,7 +23,7 @@ /** * Reflection class for a {@}version tag in a Docblock. */ -final class Version extends BaseTag implements Factory\StaticMethod +final class Version extends BaseTag { protected string $name = 'version'; diff --git a/src/Exception/CannotCreateTag.php b/src/Exception/CannotCreateTag.php new file mode 100644 index 00000000..a66884a5 --- /dev/null +++ b/src/Exception/CannotCreateTag.php @@ -0,0 +1,11 @@ +', - new Collection(new Fqsen('\\Collection'), new String_(), new Integer()), + new Generic(new Fqsen('\\Collection'), [new Integer(), new String_()]), ], [ 'Collection', - new Collection(new Fqsen('\\Collection'), new Object_(new Fqsen('\\Tvalue')), new Object_(new Fqsen('\\TKey'))), + new Generic(new Fqsen('\\Collection'), [new Object_(new Fqsen('\\TKey')), new Object_(new Fqsen('\\Tvalue'))]), ], [ 'Collection', - new Collection(new Fqsen('\\Collection'), new Object_(new Fqsen('\\Tvalue'))), + new Generic(new Fqsen('\\Collection'), [new Object_(new Fqsen('\\Tvalue'))]), ], [ 'callable(int $foo, string $bar): void', - new Callable_([new CallableParameter(new Integer(), 'foo'), new CallableParameter(new String_(), 'bar')], new Void_()), + new Callable_('callable', [new CallableParameter(new Integer(), 'foo'), new CallableParameter(new String_(), 'bar')], new Void_()), ], ]; } diff --git a/tests/unit/Assets/CustomParam.php b/tests/unit/Assets/CustomParam.php index 36abb802..57f6f7f7 100644 --- a/tests/unit/Assets/CustomParam.php +++ b/tests/unit/Assets/CustomParam.php @@ -7,9 +7,8 @@ use phpDocumentor\Reflection\DocBlock\Tag; use phpDocumentor\Reflection\DocBlock\Tags\Formatter; use phpDocumentor\Reflection\FqsenResolver; -use phpDocumentor\Reflection\DocBlock\Tags\Factory\StaticMethod; -final class CustomParam implements Tag, StaticMethod +final class CustomParam implements Tag { public $myParam; public $fqsenResolver; diff --git a/tests/unit/Assets/CustomServiceClass.php b/tests/unit/Assets/CustomServiceClass.php index c68c2ebc..a5d0e785 100644 --- a/tests/unit/Assets/CustomServiceClass.php +++ b/tests/unit/Assets/CustomServiceClass.php @@ -10,7 +10,7 @@ use phpDocumentor\Reflection\FqsenResolver; use phpDocumentor\Reflection\DocBlock\Tags\Factory\StaticMethod; -final class CustomServiceClass implements Tag, StaticMethod +final class CustomServiceClass implements Tag { public $formatter; diff --git a/tests/unit/Assets/CustomServiceInterface.php b/tests/unit/Assets/CustomServiceInterface.php index 14b96b36..ac8f612c 100644 --- a/tests/unit/Assets/CustomServiceInterface.php +++ b/tests/unit/Assets/CustomServiceInterface.php @@ -9,7 +9,7 @@ use phpDocumentor\Reflection\FqsenResolver; use phpDocumentor\Reflection\DocBlock\Tags\Factory\StaticMethod; -final class CustomServiceInterface implements Tag, StaticMethod +final class CustomServiceInterface implements Tag { public $formatter; diff --git a/tests/unit/DocBlock/Tags/Factory/ParamFactoryTest.php b/tests/unit/DocBlock/Tags/Factory/ParamFactoryTest.php index 5c50181c..aa8c14e1 100644 --- a/tests/unit/DocBlock/Tags/Factory/ParamFactoryTest.php +++ b/tests/unit/DocBlock/Tags/Factory/ParamFactoryTest.php @@ -22,7 +22,6 @@ use phpDocumentor\Reflection\PseudoTypes\StringValue; use phpDocumentor\Reflection\Types\Compound; use phpDocumentor\Reflection\Types\Context; -use phpDocumentor\Reflection\Types\Integer; use phpDocumentor\Reflection\Types\Mixed_; use phpDocumentor\Reflection\Types\Object_; use phpDocumentor\Reflection\Types\String_; @@ -84,16 +83,6 @@ public function paramInputProvider(): array false ), ], - [ - '@param int My Description', - new Param( - null, - new Integer(), - false, - new Description('My Description'), - false - ), - ], [ '@param \'GET\'|SomeClass $arg My Description', new Param( diff --git a/tests/unit/DocBlock/Tags/ParamTest.php b/tests/unit/DocBlock/Tags/ParamTest.php index e677140e..1a628f73 100644 --- a/tests/unit/DocBlock/Tags/ParamTest.php +++ b/tests/unit/DocBlock/Tags/ParamTest.php @@ -15,12 +15,6 @@ use Mockery as m; use phpDocumentor\Reflection\DocBlock\Description; -use phpDocumentor\Reflection\DocBlock\DescriptionFactory; -use phpDocumentor\Reflection\DocBlock\StandardTagFactory; -use phpDocumentor\Reflection\FqsenResolver; -use phpDocumentor\Reflection\TypeResolver; -use phpDocumentor\Reflection\Types\Context; -use phpDocumentor\Reflection\Types\Integer; use phpDocumentor\Reflection\Types\String_; use PHPUnit\Framework\TestCase; @@ -159,273 +153,4 @@ public function testStringRepresentationIsReturned(): void $this->assertSame('string ...$myParameter Description', (string) $fixture); } - - /** - * @uses \phpDocumentor\Reflection\DocBlock\Tags\Param:: - * @uses \phpDocumentor\Reflection\DocBlock\DescriptionFactory - * @uses \phpDocumentor\Reflection\DocBlock\Description - * @uses \phpDocumentor\Reflection\Types\Context - * - * @covers ::create - */ - public function testFactoryMethod(): void - { - $typeResolver = new TypeResolver(); - $descriptionFactory = m::mock(DescriptionFactory::class); - $context = new Context(''); - - $description = new Description('My Description'); - $descriptionFactory->shouldReceive('create')->with('My Description', $context)->andReturn($description); - - $fixture = Param::create('string $myParameter My Description', $typeResolver, $descriptionFactory, $context); - - $this->assertSame('string $myParameter My Description', (string) $fixture); - $this->assertSame('myParameter', $fixture->getVariableName()); - $this->assertInstanceOf(String_::class, $fixture->getType()); - $this->assertFalse($fixture->isVariadic()); - $this->assertFalse($fixture->isReference()); - $this->assertSame($description, $fixture->getDescription()); - } - - /** - * @uses \phpDocumentor\Reflection\DocBlock\Tags\Param:: - * @uses \phpDocumentor\Reflection\DocBlock\DescriptionFactory - * @uses \phpDocumentor\Reflection\DocBlock\Description - * @uses \phpDocumentor\Reflection\Types\Context - * - * @covers ::create - */ - public function testFactoryMethodWithVariadic(): void - { - $typeResolver = new TypeResolver(); - $descriptionFactory = m::mock(DescriptionFactory::class); - $context = new Context(''); - - $description = new Description('My Description'); - $descriptionFactory->shouldReceive('create')->with('My Description', $context)->andReturn($description); - - $fixture = Param::create('string ...$myParameter My Description', $typeResolver, $descriptionFactory, $context); - - $this->assertSame('string ...$myParameter My Description', (string) $fixture); - $this->assertSame('myParameter', $fixture->getVariableName()); - $this->assertInstanceOf(String_::class, $fixture->getType()); - $this->assertTrue($fixture->isVariadic()); - $this->assertFalse($fixture->isReference()); - $this->assertSame($description, $fixture->getDescription()); - } - - /** - * @uses \phpDocumentor\Reflection\DocBlock\Tags\Param:: - * @uses \phpDocumentor\Reflection\DocBlock\DescriptionFactory - * @uses \phpDocumentor\Reflection\DocBlock\Description - * @uses \phpDocumentor\Reflection\Types\Context - * - * @covers ::create - */ - public function testFactoryMethodWithReference(): void - { - $typeResolver = new TypeResolver(); - $descriptionFactory = m::mock(DescriptionFactory::class); - $context = new Context(''); - - $description = new Description('My Description'); - $descriptionFactory->shouldReceive('create')->with('My Description', $context)->andReturn($description); - - $fixture = Param::create('string &$myParameter My Description', $typeResolver, $descriptionFactory, $context); - - $this->assertSame('string &$myParameter My Description', (string) $fixture); - $this->assertSame('myParameter', $fixture->getVariableName()); - $this->assertInstanceOf(String_::class, $fixture->getType()); - $this->assertFalse($fixture->isVariadic()); - $this->assertTrue($fixture->isReference()); - $this->assertSame($description, $fixture->getDescription()); - } - - /** - * @uses \phpDocumentor\Reflection\DocBlock\Tags\Param:: - * @uses \phpDocumentor\Reflection\DocBlock\DescriptionFactory - * @uses \phpDocumentor\Reflection\DocBlock\Description - * @uses \phpDocumentor\Reflection\Types\Context - * - * @covers ::create - */ - public function testFactoryMethodWithVariadicReference(): void - { - $typeResolver = new TypeResolver(); - $descriptionFactory = m::mock(DescriptionFactory::class); - $context = new Context(''); - - $description = new Description('My Description'); - $descriptionFactory->shouldReceive('create')->with('My Description', $context)->andReturn($description); - - $fixture = Param::create( - 'string &...$myParameter My Description', - $typeResolver, - $descriptionFactory, - $context - ); - - $this->assertSame('string &...$myParameter My Description', (string) $fixture); - $this->assertSame('myParameter', $fixture->getVariableName()); - $this->assertInstanceOf(String_::class, $fixture->getType()); - $this->assertTrue($fixture->isVariadic()); - $this->assertTrue($fixture->isReference()); - $this->assertSame($description, $fixture->getDescription()); - } - - /** - * @uses \phpDocumentor\Reflection\DocBlock\Tags\Param:: - * @uses \phpDocumentor\Reflection\DocBlock\DescriptionFactory - * @uses \phpDocumentor\Reflection\DocBlock\Description - * @uses \phpDocumentor\Reflection\Types\Context - * - * @covers ::create - */ - public function testFactoryMethodWithReferenceWithoutType(): void - { - $typeResolver = new TypeResolver(); - $fqsenResolver = new FqsenResolver(); - $tagFactory = new StandardTagFactory($fqsenResolver); - $descriptionFactory = new DescriptionFactory($tagFactory); - $context = new Context(''); - - $fixture = Param::create( - '&$myParameter My Description', - $typeResolver, - $descriptionFactory, - $context - ); - - $this->assertSame('&$myParameter My Description', (string) $fixture); - $this->assertSame('myParameter', $fixture->getVariableName()); - $this->assertNull($fixture->getType()); - $this->assertFalse($fixture->isVariadic()); - $this->assertTrue($fixture->isReference()); - $this->assertSame('My Description', $fixture->getDescription() . ''); - } - - /** - * @uses \phpDocumentor\Reflection\DocBlock\Tags\Param:: - * @uses \phpDocumentor\Reflection\DocBlock\DescriptionFactory - * @uses \phpDocumentor\Reflection\DocBlock\Description - * @uses \phpDocumentor\Reflection\Types\Context - * - * @covers ::create - */ - public function testFactoryMethodWithVariadicReferenceWithoutType(): void - { - $typeResolver = new TypeResolver(); - $fqsenResolver = new FqsenResolver(); - $tagFactory = new StandardTagFactory($fqsenResolver); - $descriptionFactory = new DescriptionFactory($tagFactory); - $context = new Context(''); - - $fixture = Param::create( - '&...$myParameter My Description', - $typeResolver, - $descriptionFactory, - $context - ); - - $this->assertSame('&...$myParameter My Description', (string) $fixture); - $this->assertSame('myParameter', $fixture->getVariableName()); - $this->assertNull($fixture->getType()); - $this->assertTrue($fixture->isVariadic()); - $this->assertTrue($fixture->isReference()); - $this->assertSame('My Description', $fixture->getDescription() . ''); - } - - /** - * @uses \phpDocumentor\Reflection\DocBlock\Tags\Param:: - * @uses \phpDocumentor\Reflection\DocBlock\DescriptionFactory - * @uses \phpDocumentor\Reflection\DocBlock\Description - * @uses \phpDocumentor\Reflection\Types\Context - * - * @covers ::create - */ - public function testFactoryMethodWithoutType(): void - { - $typeResolver = new TypeResolver(); - $fqsenResolver = new FqsenResolver(); - $tagFactory = new StandardTagFactory($fqsenResolver); - $descriptionFactory = new DescriptionFactory($tagFactory); - $context = new Context(''); - - $fixture = Param::create( - '$myParameter My Description', - $typeResolver, - $descriptionFactory, - $context - ); - - $this->assertSame('$myParameter My Description', (string) $fixture); - $this->assertSame('myParameter', $fixture->getVariableName()); - $this->assertNull($fixture->getType()); - $this->assertFalse($fixture->isVariadic()); - $this->assertFalse($fixture->isReference()); - $this->assertSame('My Description', $fixture->getDescription() . ''); - } - - /** - * @uses \phpDocumentor\Reflection\DocBlock\Tags\Param:: - * @uses \phpDocumentor\Reflection\DocBlock\DescriptionFactory - * @uses \phpDocumentor\Reflection\DocBlock\Description - * @uses \phpDocumentor\Reflection\Types\Context - * - * @covers ::create - */ - public function testFactoryMethodWithType(): void - { - $typeResolver = new TypeResolver(); - $fqsenResolver = new FqsenResolver(); - $tagFactory = new StandardTagFactory($fqsenResolver); - $descriptionFactory = new DescriptionFactory($tagFactory); - $context = new Context(''); - - $fixture = Param::create( - 'int My Description', - $typeResolver, - $descriptionFactory, - $context - ); - - $this->assertSame('int My Description', (string) $fixture); - $this->assertSame('', $fixture->getVariableName()); - $this->assertInstanceOf(Integer::class, $fixture->getType()); - $this->assertSame('My Description', $fixture->getDescription() . ''); - } - - /** - * @uses \phpDocumentor\Reflection\DocBlock\Tags\Param:: - * @uses \phpDocumentor\Reflection\TypeResolver - * @uses \phpDocumentor\Reflection\DocBlock\DescriptionFactory - * - * @covers ::create - */ - public function testFactoryMethodFailsIfEmptyBodyIsGiven(): void - { - $this->expectException('InvalidArgumentException'); - $descriptionFactory = m::mock(DescriptionFactory::class); - Param::create('', new TypeResolver(), $descriptionFactory); - } - - /** - * @covers ::create - */ - public function testFactoryMethodFailsIfResolverIsNull(): void - { - $this->expectException('InvalidArgumentException'); - Param::create('body'); - } - - /** - * @uses \phpDocumentor\Reflection\TypeResolver - * - * @covers ::create - */ - public function testFactoryMethodFailsIfDescriptionFactoryIsNull(): void - { - $this->expectException('InvalidArgumentException'); - Param::create('body', new TypeResolver()); - } } diff --git a/tests/unit/DocBlock/Tags/PropertyReadTest.php b/tests/unit/DocBlock/Tags/PropertyReadTest.php index fba5cea8..cb1d20c6 100644 --- a/tests/unit/DocBlock/Tags/PropertyReadTest.php +++ b/tests/unit/DocBlock/Tags/PropertyReadTest.php @@ -15,12 +15,6 @@ use Mockery as m; use phpDocumentor\Reflection\DocBlock\Description; -use phpDocumentor\Reflection\DocBlock\DescriptionFactory; -use phpDocumentor\Reflection\DocBlock\StandardTagFactory; -use phpDocumentor\Reflection\FqsenResolver; -use phpDocumentor\Reflection\TypeResolver; -use phpDocumentor\Reflection\Types\Context; -use phpDocumentor\Reflection\Types\Integer; use phpDocumentor\Reflection\Types\String_; use PHPUnit\Framework\TestCase; @@ -141,126 +135,4 @@ public function testStringRepresentationIsReturned(): void $this->assertSame('string $myProperty Description', (string) $fixture); } - - /** - * @uses \phpDocumentor\Reflection\DocBlock\Tags\PropertyRead:: - * @uses \phpDocumentor\Reflection\DocBlock\DescriptionFactory - * @uses \phpDocumentor\Reflection\DocBlock\Description - * @uses \phpDocumentor\Reflection\Types\Context - * - * @covers ::create - */ - public function testFactoryMethod(): void - { - $typeResolver = new TypeResolver(); - $descriptionFactory = m::mock(DescriptionFactory::class); - $context = new Context(''); - - $description = new Description('My Description'); - $descriptionFactory->shouldReceive('create')->with('My Description', $context)->andReturn($description); - - $fixture = PropertyRead::create( - 'string $myProperty My Description', - $typeResolver, - $descriptionFactory, - $context - ); - - $this->assertSame('string $myProperty My Description', (string) $fixture); - $this->assertSame('myProperty', $fixture->getVariableName()); - $this->assertInstanceOf(String_::class, $fixture->getType()); - $this->assertSame($description, $fixture->getDescription()); - } - - /** - * @uses \phpDocumentor\Reflection\DocBlock\Tags\Param:: - * @uses \phpDocumentor\Reflection\DocBlock\DescriptionFactory - * @uses \phpDocumentor\Reflection\DocBlock\Description - * @uses \phpDocumentor\Reflection\Types\Context - * - * @covers ::create - */ - public function testFactoryMethodWithoutType(): void - { - $typeResolver = new TypeResolver(); - $fqsenResolver = new FqsenResolver(); - $tagFactory = new StandardTagFactory($fqsenResolver); - $descriptionFactory = new DescriptionFactory($tagFactory); - $context = new Context(''); - - $fixture = PropertyRead::create( - '$myParameter My Description', - $typeResolver, - $descriptionFactory, - $context - ); - - $this->assertSame('$myParameter My Description', (string) $fixture); - $this->assertSame('myParameter', $fixture->getVariableName()); - $this->assertNull($fixture->getType()); - $this->assertSame('My Description', $fixture->getDescription() . ''); - } - - /** - * @uses \phpDocumentor\Reflection\DocBlock\Tags\Param:: - * @uses \phpDocumentor\Reflection\DocBlock\DescriptionFactory - * @uses \phpDocumentor\Reflection\DocBlock\Description - * @uses \phpDocumentor\Reflection\Types\Context - * - * @covers ::create - */ - public function testFactoryMethodWithType(): void - { - $typeResolver = new TypeResolver(); - $fqsenResolver = new FqsenResolver(); - $tagFactory = new StandardTagFactory($fqsenResolver); - $descriptionFactory = new DescriptionFactory($tagFactory); - $context = new Context(''); - - $fixture = PropertyRead::create( - 'int My Description', - $typeResolver, - $descriptionFactory, - $context - ); - - $this->assertSame('int My Description', (string) $fixture); - $this->assertSame('', $fixture->getVariableName()); - $this->assertInstanceOf(Integer::class, $fixture->getType()); - $this->assertSame('My Description', $fixture->getDescription() . ''); - } - - /** - * @uses \phpDocumentor\Reflection\DocBlock\Tags\PropertyRead:: - * @uses \phpDocumentor\Reflection\TypeResolver - * @uses \phpDocumentor\Reflection\DocBlock\DescriptionFactory - * - * @covers ::create - */ - public function testFactoryMethodFailsIfEmptyBodyIsGiven(): void - { - $this->expectException('InvalidArgumentException'); - $descriptionFactory = m::mock(DescriptionFactory::class); - PropertyRead::create('', new TypeResolver(), $descriptionFactory); - } - - /** - * @covers ::create - */ - public function testFactoryMethodFailsIfResolverIsNull(): void - { - $this->expectException('InvalidArgumentException'); - PropertyRead::create('body'); - } - - /** - * @uses \phpDocumentor\Reflection\TypeResolver - * - * @covers ::create - */ - public function testFactoryMethodFailsIfDescriptionFactoryIsNull(): void - { - $this->expectException('InvalidArgumentException'); - PropertyRead::create('body', new TypeResolver()); - } } diff --git a/tests/unit/DocBlock/Tags/PropertyTest.php b/tests/unit/DocBlock/Tags/PropertyTest.php index ea0180c8..99ee7302 100644 --- a/tests/unit/DocBlock/Tags/PropertyTest.php +++ b/tests/unit/DocBlock/Tags/PropertyTest.php @@ -15,12 +15,6 @@ use Mockery as m; use phpDocumentor\Reflection\DocBlock\Description; -use phpDocumentor\Reflection\DocBlock\DescriptionFactory; -use phpDocumentor\Reflection\DocBlock\StandardTagFactory; -use phpDocumentor\Reflection\FqsenResolver; -use phpDocumentor\Reflection\TypeResolver; -use phpDocumentor\Reflection\Types\Context; -use phpDocumentor\Reflection\Types\Integer; use phpDocumentor\Reflection\Types\String_; use PHPUnit\Framework\TestCase; @@ -141,121 +135,4 @@ public function testStringRepresentationIsReturned(): void $this->assertSame('string $myProperty Description', (string) $fixture); } - - /** - * @uses \phpDocumentor\Reflection\DocBlock\Tags\Property:: - * @uses \phpDocumentor\Reflection\DocBlock\DescriptionFactory - * @uses \phpDocumentor\Reflection\DocBlock\Description - * @uses \phpDocumentor\Reflection\Types\Context - * - * @covers ::create - */ - public function testFactoryMethod(): void - { - $typeResolver = new TypeResolver(); - $descriptionFactory = m::mock(DescriptionFactory::class); - $context = new Context(''); - - $description = new Description('My Description'); - $descriptionFactory->shouldReceive('create')->with('My Description', $context)->andReturn($description); - - $fixture = Property::create('string $myProperty My Description', $typeResolver, $descriptionFactory, $context); - - $this->assertSame('string $myProperty My Description', (string) $fixture); - $this->assertSame('myProperty', $fixture->getVariableName()); - $this->assertInstanceOf(String_::class, $fixture->getType()); - $this->assertSame($description, $fixture->getDescription()); - } - - /** - * @uses \phpDocumentor\Reflection\DocBlock\Tags\Param:: - * @uses \phpDocumentor\Reflection\DocBlock\DescriptionFactory - * @uses \phpDocumentor\Reflection\DocBlock\Description - * @uses \phpDocumentor\Reflection\Types\Context - * - * @covers ::create - */ - public function testFactoryMethodWithoutType(): void - { - $typeResolver = new TypeResolver(); - $fqsenResolver = new FqsenResolver(); - $tagFactory = new StandardTagFactory($fqsenResolver); - $descriptionFactory = new DescriptionFactory($tagFactory); - $context = new Context(''); - - $fixture = Property::create( - '$myParameter My Description', - $typeResolver, - $descriptionFactory, - $context - ); - - $this->assertSame('$myParameter My Description', (string) $fixture); - $this->assertSame('myParameter', $fixture->getVariableName()); - $this->assertNull($fixture->getType()); - $this->assertSame('My Description', $fixture->getDescription() . ''); - } - - /** - * @uses \phpDocumentor\Reflection\DocBlock\Tags\Param:: - * @uses \phpDocumentor\Reflection\DocBlock\DescriptionFactory - * @uses \phpDocumentor\Reflection\DocBlock\Description - * @uses \phpDocumentor\Reflection\Types\Context - * - * @covers ::create - */ - public function testFactoryMethodWithType(): void - { - $typeResolver = new TypeResolver(); - $fqsenResolver = new FqsenResolver(); - $tagFactory = new StandardTagFactory($fqsenResolver); - $descriptionFactory = new DescriptionFactory($tagFactory); - $context = new Context(''); - - $fixture = Property::create( - 'int My Description', - $typeResolver, - $descriptionFactory, - $context - ); - - $this->assertSame('int My Description', (string) $fixture); - $this->assertSame('', $fixture->getVariableName()); - $this->assertInstanceOf(Integer::class, $fixture->getType()); - $this->assertSame('My Description', $fixture->getDescription() . ''); - } - - /** - * @uses \phpDocumentor\Reflection\DocBlock\Tags\Property:: - * @uses \phpDocumentor\Reflection\TypeResolver - * @uses \phpDocumentor\Reflection\DocBlock\DescriptionFactory - * - * @covers ::create - */ - public function testFactoryMethodFailsIfEmptyBodyIsGiven(): void - { - $this->expectException('InvalidArgumentException'); - $descriptionFactory = m::mock(DescriptionFactory::class); - Property::create('', new TypeResolver(), $descriptionFactory); - } - - /** - * @covers ::create - */ - public function testFactoryMethodFailsIfResolverIsNull(): void - { - $this->expectException('InvalidArgumentException'); - Property::create('body'); - } - - /** - * @uses \phpDocumentor\Reflection\TypeResolver - * - * @covers ::create - */ - public function testFactoryMethodFailsIfDescriptionFactoryIsNull(): void - { - $this->expectException('InvalidArgumentException'); - Property::create('body', new TypeResolver()); - } } diff --git a/tests/unit/DocBlock/Tags/PropertyWriteTest.php b/tests/unit/DocBlock/Tags/PropertyWriteTest.php index 47d9bdd7..c627d988 100644 --- a/tests/unit/DocBlock/Tags/PropertyWriteTest.php +++ b/tests/unit/DocBlock/Tags/PropertyWriteTest.php @@ -15,12 +15,6 @@ use Mockery as m; use phpDocumentor\Reflection\DocBlock\Description; -use phpDocumentor\Reflection\DocBlock\DescriptionFactory; -use phpDocumentor\Reflection\DocBlock\StandardTagFactory; -use phpDocumentor\Reflection\FqsenResolver; -use phpDocumentor\Reflection\TypeResolver; -use phpDocumentor\Reflection\Types\Context; -use phpDocumentor\Reflection\Types\Integer; use phpDocumentor\Reflection\Types\String_; use PHPUnit\Framework\TestCase; @@ -141,126 +135,4 @@ public function testStringRepresentationIsReturned(): void $this->assertSame('string $myProperty Description', (string) $fixture); } - - /** - * @uses \phpDocumentor\Reflection\DocBlock\Tags\PropertyWrite:: - * @uses \phpDocumentor\Reflection\DocBlock\DescriptionFactory - * @uses \phpDocumentor\Reflection\DocBlock\Description - * @uses \phpDocumentor\Reflection\Types\Context - * - * @covers ::create - */ - public function testFactoryMethod(): void - { - $typeResolver = new TypeResolver(); - $descriptionFactory = m::mock(DescriptionFactory::class); - $context = new Context(''); - - $description = new Description('My Description'); - $descriptionFactory->shouldReceive('create')->with('My Description', $context)->andReturn($description); - - $fixture = PropertyWrite::create( - 'string $myProperty My Description', - $typeResolver, - $descriptionFactory, - $context - ); - - $this->assertSame('string $myProperty My Description', (string) $fixture); - $this->assertSame('myProperty', $fixture->getVariableName()); - $this->assertInstanceOf(String_::class, $fixture->getType()); - $this->assertSame($description, $fixture->getDescription()); - } - - /** - * @uses \phpDocumentor\Reflection\DocBlock\Tags\Param:: - * @uses \phpDocumentor\Reflection\DocBlock\DescriptionFactory - * @uses \phpDocumentor\Reflection\DocBlock\Description - * @uses \phpDocumentor\Reflection\Types\Context - * - * @covers ::create - */ - public function testFactoryMethodWithoutType(): void - { - $typeResolver = new TypeResolver(); - $fqsenResolver = new FqsenResolver(); - $tagFactory = new StandardTagFactory($fqsenResolver); - $descriptionFactory = new DescriptionFactory($tagFactory); - $context = new Context(''); - - $fixture = PropertyWrite::create( - '$myParameter My Description', - $typeResolver, - $descriptionFactory, - $context - ); - - $this->assertSame('$myParameter My Description', (string) $fixture); - $this->assertSame('myParameter', $fixture->getVariableName()); - $this->assertNull($fixture->getType()); - $this->assertSame('My Description', $fixture->getDescription() . ''); - } - - /** - * @uses \phpDocumentor\Reflection\DocBlock\Tags\Param:: - * @uses \phpDocumentor\Reflection\DocBlock\DescriptionFactory - * @uses \phpDocumentor\Reflection\DocBlock\Description - * @uses \phpDocumentor\Reflection\Types\Context - * - * @covers ::create - */ - public function testFactoryMethodWithType(): void - { - $typeResolver = new TypeResolver(); - $fqsenResolver = new FqsenResolver(); - $tagFactory = new StandardTagFactory($fqsenResolver); - $descriptionFactory = new DescriptionFactory($tagFactory); - $context = new Context(''); - - $fixture = PropertyWrite::create( - 'int My Description', - $typeResolver, - $descriptionFactory, - $context - ); - - $this->assertSame('int My Description', (string) $fixture); - $this->assertSame('', $fixture->getVariableName()); - $this->assertInstanceOf(Integer::class, $fixture->getType()); - $this->assertSame('My Description', $fixture->getDescription() . ''); - } - - /** - * @uses \phpDocumentor\Reflection\DocBlock\Tags\PropertyWrite:: - * @uses \phpDocumentor\Reflection\TypeResolver - * @uses \phpDocumentor\Reflection\DocBlock\DescriptionFactory - * - * @covers ::create - */ - public function testFactoryMethodFailsIfEmptyBodyIsGiven(): void - { - $this->expectException('InvalidArgumentException'); - $descriptionFactory = m::mock(DescriptionFactory::class); - PropertyWrite::create('', new TypeResolver(), $descriptionFactory); - } - - /** - * @covers ::create - */ - public function testFactoryMethodFailsIfResolverIsNull(): void - { - $this->expectException('InvalidArgumentException'); - PropertyWrite::create('body'); - } - - /** - * @uses \phpDocumentor\Reflection\TypeResolver - * - * @covers ::create - */ - public function testFactoryMethodFailsIfDescriptionFactoryIsNull(): void - { - $this->expectException('InvalidArgumentException'); - PropertyWrite::create('body', new TypeResolver()); - } } diff --git a/tests/unit/DocBlock/Tags/ReturnTest.php b/tests/unit/DocBlock/Tags/ReturnTest.php index 0b2169b0..4da41398 100644 --- a/tests/unit/DocBlock/Tags/ReturnTest.php +++ b/tests/unit/DocBlock/Tags/ReturnTest.php @@ -13,12 +13,8 @@ namespace phpDocumentor\Reflection\DocBlock\Tags; -use InvalidArgumentException; use Mockery as m; use phpDocumentor\Reflection\DocBlock\Description; -use phpDocumentor\Reflection\DocBlock\DescriptionFactory; -use phpDocumentor\Reflection\TypeResolver; -use phpDocumentor\Reflection\Types\Context; use phpDocumentor\Reflection\Types\String_; use PHPUnit\Framework\TestCase; @@ -140,152 +136,4 @@ public function testStringRepresentationIsReturnedWithoutDescription(): void $this->assertSame('string', (string) $fixture); } - - /** - * @uses \phpDocumentor\Reflection\DocBlock\Tags\Return_:: - * @uses \phpDocumentor\Reflection\DocBlock\DescriptionFactory - * @uses \phpDocumentor\Reflection\TypeResolver - * @uses \phpDocumentor\Reflection\DocBlock\Description - * @uses \phpDocumentor\Reflection\Types\String_ - * @uses \phpDocumentor\Reflection\Types\Context - * - * @covers ::create - */ - public function testFactoryMethod(): void - { - $descriptionFactory = m::mock(DescriptionFactory::class); - $resolver = new TypeResolver(); - $context = new Context(''); - - $type = new String_(); - $description = new Description('My Description'); - $descriptionFactory->shouldReceive('create')->with('My Description', $context)->andReturn($description); - - $fixture = Return_::create('string My Description', $resolver, $descriptionFactory, $context); - - $this->assertSame('string My Description', (string) $fixture); - $this->assertEquals($type, $fixture->getType()); - $this->assertSame($description, $fixture->getDescription()); - } - - /** - * This test checks whether a braces in a Type are allowed. - * - * The advent of generics poses a few issues, one of them is that spaces can now be part of a type. In the past we - * could purely rely on spaces to split the individual parts of the body of a tag; but when there is a type in play - * we now need to check for braces. - * - * This test tests whether an error occurs demonstrating that the braces were taken into account; this test is still - * expected to produce an exception because the TypeResolver does not support generics. - * - * @uses \phpDocumentor\Reflection\DocBlock\Tags\Return_:: - * @uses \phpDocumentor\Reflection\DocBlock\DescriptionFactory - * @uses \phpDocumentor\Reflection\TypeResolver - * @uses \phpDocumentor\Reflection\DocBlock\Description - * @uses \phpDocumentor\Reflection\Types\String_ - * @uses \phpDocumentor\Reflection\Types\Context - * - * @covers ::create - */ - public function testFactoryMethodWithGenericWithSpace(): void - { - $descriptionFactory = m::mock(DescriptionFactory::class); - $resolver = new TypeResolver(); - $context = new Context(''); - - $description = new Description('My Description'); - $descriptionFactory->shouldReceive('create') - ->with('My Description', $context) - ->andReturn($description); - - $fixture = Return_::create('array My Description', $resolver, $descriptionFactory, $context); - - $this->assertSame('array My Description', (string) $fixture); - $this->assertEquals('array', $fixture->getType()); - $this->assertSame($description, $fixture->getDescription()); - } - - /** - * @see self::testFactoryMethodWithGenericWithSpace() - * @uses \phpDocumentor\Reflection\DocBlock\Tags\Return_:: - * @uses \phpDocumentor\Reflection\DocBlock\DescriptionFactory - * @uses \phpDocumentor\Reflection\TypeResolver - * @uses \phpDocumentor\Reflection\DocBlock\Description - * @uses \phpDocumentor\Reflection\Types\String_ - * @uses \phpDocumentor\Reflection\Types\Context - * - * @covers ::create - */ - public function testFactoryMethodWithGenericWithSpaceAndAddedEmojisToVerifyMultiByteBehaviour(): void - { - $this->markTestSkipped('A bug in the TypeResolver breaks this test'); - $this->expectException(InvalidArgumentException::class); - $this->expectExceptionMessage('"\array😁" is not a valid Fqsen.'); - - $descriptionFactory = m::mock(DescriptionFactory::class); - $resolver = new TypeResolver(); - $context = new Context(''); - - $description = new Description('My Description'); - $descriptionFactory->shouldReceive('create') - ->with('My Description', $context) - ->andReturn($description); - - Return_::create('array😁 My Description', $resolver, $descriptionFactory, $context); - } - - /** - * @uses \phpDocumentor\Reflection\DocBlock\Tags\Return_:: - * @uses \phpDocumentor\Reflection\DocBlock\DescriptionFactory - * @uses \phpDocumentor\Reflection\TypeResolver - * @uses \phpDocumentor\Reflection\DocBlock\Description - * @uses \phpDocumentor\Reflection\Types\String_ - * @uses \phpDocumentor\Reflection\Types\Context - * - * @covers ::create - */ - public function testFactoryMethodWithEmojisToVerifyMultiByteBehaviour(): void - { - $descriptionFactory = m::mock(DescriptionFactory::class); - $resolver = new TypeResolver(); - $context = new Context(''); - - $description = new Description('My Description'); - $descriptionFactory->shouldReceive('create') - ->with('My Description', $context) - ->andReturn($description); - - $fixture = Return_::create('\My😁Class My Description', $resolver, $descriptionFactory, $context); - - $this->assertSame('\My😁Class My Description', (string) $fixture); - $this->assertEquals('\My😁Class', $fixture->getType()); - $this->assertSame($description, $fixture->getDescription()); - } - - /** - * @covers ::create - */ - public function testFactoryMethodFailsIfBodyIsNotEmpty(): void - { - $this->expectException('InvalidArgumentException'); - $this->assertNull(Return_::create('')); - } - - /** - * @covers ::create - */ - public function testFactoryMethodFailsIfResolverIsNull(): void - { - $this->expectException('InvalidArgumentException'); - Return_::create('body'); - } - - /** - * @covers ::create - */ - public function testFactoryMethodFailsIfDescriptionFactoryIsNull(): void - { - $this->expectException('InvalidArgumentException'); - Return_::create('body', new TypeResolver()); - } } diff --git a/tests/unit/DocBlock/Tags/ThrowsTest.php b/tests/unit/DocBlock/Tags/ThrowsTest.php index 048f34bd..54182de7 100644 --- a/tests/unit/DocBlock/Tags/ThrowsTest.php +++ b/tests/unit/DocBlock/Tags/ThrowsTest.php @@ -206,8 +206,8 @@ public function testFactoryMethodWithGenericWithSpace(): void $fixture = Throws::create('array My Description', $resolver, $descriptionFactory, $context); - $this->assertSame('array My Description', (string) $fixture); - $this->assertEquals('array', $fixture->getType()); + $this->assertSame('array My Description', (string) $fixture); + $this->assertEquals('array', $fixture->getType()); $this->assertSame($description, $fixture->getDescription()); } diff --git a/tests/unit/DocBlock/Tags/VarTest.php b/tests/unit/DocBlock/Tags/VarTest.php index 00af8ae6..bb191058 100644 --- a/tests/unit/DocBlock/Tags/VarTest.php +++ b/tests/unit/DocBlock/Tags/VarTest.php @@ -15,12 +15,6 @@ use Mockery as m; use phpDocumentor\Reflection\DocBlock\Description; -use phpDocumentor\Reflection\DocBlock\DescriptionFactory; -use phpDocumentor\Reflection\DocBlock\StandardTagFactory; -use phpDocumentor\Reflection\FqsenResolver; -use phpDocumentor\Reflection\TypeResolver; -use phpDocumentor\Reflection\Types\Context; -use phpDocumentor\Reflection\Types\Integer; use phpDocumentor\Reflection\Types\String_; use PHPUnit\Framework\TestCase; @@ -179,150 +173,4 @@ public function testStringRepresentationIsReturnedWithoutDescription(): void $this->assertSame('string $myVariable', (string) $fixture); } - - /** - * @uses \phpDocumentor\Reflection\DocBlock\Tags\Var_:: - * @uses \phpDocumentor\Reflection\DocBlock\DescriptionFactory - * @uses \phpDocumentor\Reflection\DocBlock\Description - * @uses \phpDocumentor\Reflection\Types\Context - * - * @covers ::create - */ - public function testFactoryMethod(): void - { - $typeResolver = new TypeResolver(); - $descriptionFactory = m::mock(DescriptionFactory::class); - $context = new Context(''); - - $description = new Description('My Description'); - $descriptionFactory->shouldReceive('create')->with('My Description', $context)->andReturn($description); - - $fixture = Var_::create('string $myVariable My Description', $typeResolver, $descriptionFactory, $context); - - $this->assertSame('string $myVariable My Description', (string) $fixture); - $this->assertSame('myVariable', $fixture->getVariableName()); - $this->assertInstanceOf(String_::class, $fixture->getType()); - $this->assertSame($description, $fixture->getDescription()); - } - - /** - * @uses \phpDocumentor\Reflection\DocBlock\Tags\Param:: - * @uses \phpDocumentor\Reflection\DocBlock\DescriptionFactory - * @uses \phpDocumentor\Reflection\DocBlock\Description - * @uses \phpDocumentor\Reflection\Types\Context - * - * @covers ::create - */ - public function testFactoryMethodWithoutType(): void - { - $typeResolver = new TypeResolver(); - $fqsenResolver = new FqsenResolver(); - $tagFactory = new StandardTagFactory($fqsenResolver); - $descriptionFactory = new DescriptionFactory($tagFactory); - $context = new Context(''); - - $fixture = Var_::create( - '$myParameter My Description', - $typeResolver, - $descriptionFactory, - $context - ); - - $this->assertSame('$myParameter My Description', (string) $fixture); - $this->assertSame('myParameter', $fixture->getVariableName()); - $this->assertNull($fixture->getType()); - $this->assertSame('My Description', $fixture->getDescription() . ''); - } - - /** - * @uses \phpDocumentor\Reflection\DocBlock\Tags\Param:: - * @uses \phpDocumentor\Reflection\DocBlock\DescriptionFactory - * @uses \phpDocumentor\Reflection\DocBlock\Description - * @uses \phpDocumentor\Reflection\Types\Context - * - * @covers ::create - */ - public function testFactoryMethodWithType(): void - { - $typeResolver = new TypeResolver(); - $fqsenResolver = new FqsenResolver(); - $tagFactory = new StandardTagFactory($fqsenResolver); - $descriptionFactory = new DescriptionFactory($tagFactory); - $context = new Context(''); - - $fixture = Var_::create( - 'int My Description', - $typeResolver, - $descriptionFactory, - $context - ); - - $this->assertSame('int My Description', (string) $fixture); - $this->assertSame('', $fixture->getVariableName()); - $this->assertInstanceOf(Integer::class, $fixture->getType()); - $this->assertSame('My Description', $fixture->getDescription() . ''); - } - - /** - * @uses \phpDocumentor\Reflection\DocBlock\Tags\Param:: - * @uses \phpDocumentor\Reflection\DocBlock\DescriptionFactory - * @uses \phpDocumentor\Reflection\DocBlock\Description - * @uses \phpDocumentor\Reflection\Types\Context - * - * @covers ::create - */ - public function testFactoryMethodWithTypeWithoutComment(): void - { - $typeResolver = new TypeResolver(); - $fqsenResolver = new FqsenResolver(); - $tagFactory = new StandardTagFactory($fqsenResolver); - $descriptionFactory = new DescriptionFactory($tagFactory); - $context = new Context(''); - - $fixture = Var_::create( - 'int', - $typeResolver, - $descriptionFactory, - $context - ); - - $this->assertSame('int', (string) $fixture); - $this->assertSame('', $fixture->getVariableName()); - $this->assertInstanceOf(Integer::class, $fixture->getType()); - $this->assertSame('', $fixture->getDescription() . ''); - } - - /** - * @uses \phpDocumentor\Reflection\DocBlock\Tags\Var_:: - * @uses \phpDocumentor\Reflection\TypeResolver - * @uses \phpDocumentor\Reflection\DocBlock\DescriptionFactory - * - * @covers ::create - */ - public function testFactoryMethodFailsIfEmptyBodyIsGiven(): void - { - $this->expectException('InvalidArgumentException'); - $descriptionFactory = m::mock(DescriptionFactory::class); - Var_::create('', new TypeResolver(), $descriptionFactory); - } - - /** - * @covers ::create - */ - public function testFactoryMethodFailsIfResolverIsNull(): void - { - $this->expectException('InvalidArgumentException'); - Var_::create('body'); - } - - /** - * @uses \phpDocumentor\Reflection\TypeResolver - * - * @covers ::create - */ - public function testFactoryMethodFailsIfDescriptionFactoryIsNull(): void - { - $this->expectException('InvalidArgumentException'); - Var_::create('body', new TypeResolver()); - } }