From b23d0eacb09722212c5dfa0488e7496b6be5520e Mon Sep 17 00:00:00 2001 From: Gokujo <19776684+Gokujo@users.noreply.github.com> Date: Tue, 1 Sep 2026 08:59:27 +0000 Subject: [PATCH] chore(deps): composer update --- upload/api/composer.lock | 78 +++---- upload/api/vendor/composer/installed.json | 70 +++--- upload/api/vendor/composer/installed.php | 34 +-- .../vendor/phpstan/phpdoc-parser/README.md | 26 +++ ...ureUnlessParameterIsPassedTagValueNode.php | 14 ++ .../src/Ast/Type/ConditionalTypeNode.php | 7 +- .../src/Ast/Type/NullableTypeNode.php | 6 + .../phpstan/phpdoc-parser/src/Lexer/Lexer.php | 27 ++- .../phpdoc-parser/src/Parser/TypeParser.php | 5 + .../phpdoc-parser/src/Printer/Printer.php | 39 +++- .../symfony/console/Debug/CliRequest.php | 8 +- .../service-contracts/Attribute/Required.php | 7 + upload/api/vendor/symfony/yaml/Inline.php | 1 + upload/api/vendor/symfony/yaml/Parser.php | 12 + .../api/vendor/zircote/swagger-php/AGENTS.md | 46 ++++ .../api/vendor/zircote/swagger-php/CLAUDE.md | 15 +- .../api/vendor/zircote/swagger-php/CONTEXT.md | 51 +++- .../zircote/swagger-php/CONTRIBUTING.md | 39 ++-- .../api/vendor/zircote/swagger-php/README.md | 21 +- .../vendor/zircote/swagger-php/composer.json | 7 +- .../zircote/swagger-php/phpstan.neon.dist | 30 +++ .../api/vendor/zircote/swagger-php/rector.php | 6 + .../src/Annotations/AbstractAnnotation.php | 8 +- .../Assembler/AbstractAttributeTranslator.php | 4 +- .../Assembler/DefaultAttributeTranslator.php | 2 +- .../OptionalPropertyAttributeTranslator.php | 2 +- .../swagger-php/src/Augmenter/Docblocks.php | 2 +- .../src/Augmenter/EnumDescriptions.php | 2 +- .../swagger-php/src/Augmenter/Types.php | 16 +- .../zircote/swagger-php/src/Builder.php | 30 ++- .../src/Compiler/OpenApi30Compiler.php | 18 ++ .../src/Compiler/OpenApi31Compiler.php | 11 +- .../src/Contracts/AttributeInterface.php | 4 +- .../src/Contracts/ResolverInterface.php | 23 ++ .../src/Processors/DocBlockDescriptions.php | 4 +- .../zircote/swagger-php/src/Resolver.php | 219 ++++++++++++++++++ .../swagger-php/src/Resolver/Reflection.php | 34 +++ .../src/Spec/Security/Requirement.php | 2 +- .../src/Utils/AttributeFactory.php | 4 +- 39 files changed, 746 insertions(+), 188 deletions(-) create mode 100644 upload/api/vendor/zircote/swagger-php/AGENTS.md create mode 100644 upload/api/vendor/zircote/swagger-php/phpstan.neon.dist create mode 100644 upload/api/vendor/zircote/swagger-php/src/Contracts/ResolverInterface.php create mode 100644 upload/api/vendor/zircote/swagger-php/src/Resolver.php create mode 100644 upload/api/vendor/zircote/swagger-php/src/Resolver/Reflection.php diff --git a/upload/api/composer.lock b/upload/api/composer.lock index be65662a..b3b2fcc2 100644 --- a/upload/api/composer.lock +++ b/upload/api/composer.lock @@ -991,16 +991,16 @@ }, { "name": "phpstan/phpdoc-parser", - "version": "2.3.3", + "version": "2.3.5", "source": { "type": "git", "url": "https://github.com/phpstan/phpdoc-parser.git", - "reference": "fb19eedd2bb67ff8cf7a5502ad329e701d6398a3" + "reference": "148cefffaf0233e4c08cc13db8a195a56dd6dfe9" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phpstan/phpdoc-parser/zipball/fb19eedd2bb67ff8cf7a5502ad329e701d6398a3", - "reference": "fb19eedd2bb67ff8cf7a5502ad329e701d6398a3", + "url": "https://api.github.com/repos/phpstan/phpdoc-parser/zipball/148cefffaf0233e4c08cc13db8a195a56dd6dfe9", + "reference": "148cefffaf0233e4c08cc13db8a195a56dd6dfe9", "shasum": "" }, "require": { @@ -1032,9 +1032,9 @@ "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/2.3.3" + "source": "https://github.com/phpstan/phpdoc-parser/tree/2.3.5" }, - "time": "2026-07-08T07:01:06+00:00" + "time": "2026-08-31T16:05:28+00:00" }, { "name": "psr/clock", @@ -1761,16 +1761,16 @@ }, { "name": "symfony/console", - "version": "v7.4.17", + "version": "v7.4.18", "source": { "type": "git", "url": "https://github.com/symfony/console.git", - "reference": "962e18f09ebe68a49039b4c82fc0ea4871824fca" + "reference": "23d6f88a29f6d0eac45bd77d70307adf83ba7ab0" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/console/zipball/962e18f09ebe68a49039b4c82fc0ea4871824fca", - "reference": "962e18f09ebe68a49039b4c82fc0ea4871824fca", + "url": "https://api.github.com/repos/symfony/console/zipball/23d6f88a29f6d0eac45bd77d70307adf83ba7ab0", + "reference": "23d6f88a29f6d0eac45bd77d70307adf83ba7ab0", "shasum": "" }, "require": { @@ -1835,7 +1835,7 @@ "terminal" ], "support": { - "source": "https://github.com/symfony/console/tree/v7.4.17" + "source": "https://github.com/symfony/console/tree/v7.4.18" }, "funding": [ { @@ -1855,7 +1855,7 @@ "type": "tidelift" } ], - "time": "2026-08-21T12:09:28+00:00" + "time": "2026-08-25T14:18:37+00:00" }, { "name": "symfony/deprecation-contracts", @@ -2333,16 +2333,16 @@ }, { "name": "symfony/service-contracts", - "version": "v3.7.1", + "version": "v3.7.3", "source": { "type": "git", "url": "https://github.com/symfony/service-contracts.git", - "reference": "c0a284bab1ed8aa0417e3d69250ab437739563a0" + "reference": "15e6a07ec2a2c75ceb1b21dd98105ee8456d2257" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/service-contracts/zipball/c0a284bab1ed8aa0417e3d69250ab437739563a0", - "reference": "c0a284bab1ed8aa0417e3d69250ab437739563a0", + "url": "https://api.github.com/repos/symfony/service-contracts/zipball/15e6a07ec2a2c75ceb1b21dd98105ee8456d2257", + "reference": "15e6a07ec2a2c75ceb1b21dd98105ee8456d2257", "shasum": "" }, "require": { @@ -2396,7 +2396,7 @@ "standards" ], "support": { - "source": "https://github.com/symfony/service-contracts/tree/v3.7.1" + "source": "https://github.com/symfony/service-contracts/tree/v3.7.3" }, "funding": [ { @@ -2416,7 +2416,7 @@ "type": "tidelift" } ], - "time": "2026-06-16T09:55:08+00:00" + "time": "2026-07-27T15:39:01+00:00" }, { "name": "symfony/string", @@ -2594,16 +2594,16 @@ }, { "name": "symfony/yaml", - "version": "v7.4.17", + "version": "v7.4.18", "source": { "type": "git", "url": "https://github.com/symfony/yaml.git", - "reference": "0b040d7b66ceb10b7bb24c8e6656257932693a12" + "reference": "4cef939e55b8a21c5780418de0d98ab00d0736e1" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/yaml/zipball/0b040d7b66ceb10b7bb24c8e6656257932693a12", - "reference": "0b040d7b66ceb10b7bb24c8e6656257932693a12", + "url": "https://api.github.com/repos/symfony/yaml/zipball/4cef939e55b8a21c5780418de0d98ab00d0736e1", + "reference": "4cef939e55b8a21c5780418de0d98ab00d0736e1", "shasum": "" }, "require": { @@ -2646,7 +2646,7 @@ "description": "Loads and dumps YAML files", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/yaml/tree/v7.4.17" + "source": "https://github.com/symfony/yaml/tree/v7.4.18" }, "funding": [ { @@ -2666,20 +2666,20 @@ "type": "tidelift" } ], - "time": "2026-08-21T12:09:28+00:00" + "time": "2026-08-30T00:47:26+00:00" }, { "name": "zircote/swagger-php", - "version": "6.7.0", + "version": "6.7.1", "source": { "type": "git", "url": "https://github.com/zircote/swagger-php.git", - "reference": "af0a8de6c4b6780e8e07d06ee0c7da538b5f1e46" + "reference": "fc4c4288623406cd1b4679409cd6aefdbd774827" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/zircote/swagger-php/zipball/af0a8de6c4b6780e8e07d06ee0c7da538b5f1e46", - "reference": "af0a8de6c4b6780e8e07d06ee0c7da538b5f1e46", + "url": "https://api.github.com/repos/zircote/swagger-php/zipball/fc4c4288623406cd1b4679409cd6aefdbd774827", + "reference": "fc4c4288623406cd1b4679409cd6aefdbd774827", "shasum": "" }, "require": { @@ -2747,7 +2747,7 @@ ], "support": { "issues": "https://github.com/zircote/swagger-php/issues", - "source": "https://github.com/zircote/swagger-php/tree/6.7.0" + "source": "https://github.com/zircote/swagger-php/tree/6.7.1" }, "funding": [ { @@ -2755,7 +2755,7 @@ "type": "github" } ], - "time": "2026-08-24T21:55:54+00:00" + "time": "2026-08-30T07:08:23+00:00" } ], "packages-dev": [ @@ -3612,16 +3612,16 @@ }, { "name": "phpunit/phpunit", - "version": "12.5.33", + "version": "12.5.34", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/phpunit.git", - "reference": "b98e028a26c5c5ba7e4a54be96ccf35f2914d184" + "reference": "6cbff63d670de92cb1cb3d2ff9f40327e9da9c7f" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/b98e028a26c5c5ba7e4a54be96ccf35f2914d184", - "reference": "b98e028a26c5c5ba7e4a54be96ccf35f2914d184", + "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/6cbff63d670de92cb1cb3d2ff9f40327e9da9c7f", + "reference": "6cbff63d670de92cb1cb3d2ff9f40327e9da9c7f", "shasum": "" }, "require": { @@ -3631,18 +3631,18 @@ "ext-libxml": "*", "ext-mbstring": "*", "ext-xmlwriter": "*", - "myclabs/deep-copy": "^1.13.4", + "myclabs/deep-copy": "^1.14.0", "phar-io/manifest": "^2.0.4", "phar-io/version": "^3.2.1", "php": ">=8.3", "phpunit/php-code-coverage": "^12.5.7", - "phpunit/php-file-iterator": "^6.0.1", + "phpunit/php-file-iterator": "^6.0.2", "phpunit/php-invoker": "^6.0.0", "phpunit/php-text-template": "^5.0.0", "phpunit/php-timer": "^8.0.0", "sebastian/cli-parser": "^4.2.1", "sebastian/comparator": "^7.1.8", - "sebastian/diff": "^7.0.0", + "sebastian/diff": "^7.0.1", "sebastian/environment": "^8.1.2", "sebastian/exporter": "^7.0.3", "sebastian/global-state": "^8.0.3", @@ -3690,7 +3690,7 @@ "support": { "issues": "https://github.com/sebastianbergmann/phpunit/issues", "security": "https://github.com/sebastianbergmann/phpunit/security/policy", - "source": "https://github.com/sebastianbergmann/phpunit/tree/12.5.33" + "source": "https://github.com/sebastianbergmann/phpunit/tree/12.5.34" }, "funding": [ { @@ -3698,7 +3698,7 @@ "type": "other" } ], - "time": "2026-07-28T13:58:09+00:00" + "time": "2026-08-27T08:38:28+00:00" }, { "name": "psr/http-client", diff --git a/upload/api/vendor/composer/installed.json b/upload/api/vendor/composer/installed.json index 8ce6afa0..50c1bec5 100644 --- a/upload/api/vendor/composer/installed.json +++ b/upload/api/vendor/composer/installed.json @@ -1027,17 +1027,17 @@ }, { "name": "phpstan/phpdoc-parser", - "version": "2.3.3", - "version_normalized": "2.3.3.0", + "version": "2.3.5", + "version_normalized": "2.3.5.0", "source": { "type": "git", "url": "https://github.com/phpstan/phpdoc-parser.git", - "reference": "fb19eedd2bb67ff8cf7a5502ad329e701d6398a3" + "reference": "148cefffaf0233e4c08cc13db8a195a56dd6dfe9" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phpstan/phpdoc-parser/zipball/fb19eedd2bb67ff8cf7a5502ad329e701d6398a3", - "reference": "fb19eedd2bb67ff8cf7a5502ad329e701d6398a3", + "url": "https://api.github.com/repos/phpstan/phpdoc-parser/zipball/148cefffaf0233e4c08cc13db8a195a56dd6dfe9", + "reference": "148cefffaf0233e4c08cc13db8a195a56dd6dfe9", "shasum": "" }, "require": { @@ -1054,7 +1054,7 @@ "phpunit/phpunit": "^9.6", "symfony/process": "^5.2" }, - "time": "2026-07-08T07:01:06+00:00", + "time": "2026-08-31T16:05:28+00:00", "type": "library", "installation-source": "dist", "autoload": { @@ -1071,7 +1071,7 @@ "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/2.3.3" + "source": "https://github.com/phpstan/phpdoc-parser/tree/2.3.5" }, "install-path": "../phpstan/phpdoc-parser" }, @@ -1836,17 +1836,17 @@ }, { "name": "symfony/console", - "version": "v7.4.17", - "version_normalized": "7.4.17.0", + "version": "v7.4.18", + "version_normalized": "7.4.18.0", "source": { "type": "git", "url": "https://github.com/symfony/console.git", - "reference": "962e18f09ebe68a49039b4c82fc0ea4871824fca" + "reference": "23d6f88a29f6d0eac45bd77d70307adf83ba7ab0" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/console/zipball/962e18f09ebe68a49039b4c82fc0ea4871824fca", - "reference": "962e18f09ebe68a49039b4c82fc0ea4871824fca", + "url": "https://api.github.com/repos/symfony/console/zipball/23d6f88a29f6d0eac45bd77d70307adf83ba7ab0", + "reference": "23d6f88a29f6d0eac45bd77d70307adf83ba7ab0", "shasum": "" }, "require": { @@ -1879,7 +1879,7 @@ "symfony/stopwatch": "^6.4|^7.0|^8.0", "symfony/var-dumper": "^6.4|^7.0|^8.0" }, - "time": "2026-08-21T12:09:28+00:00", + "time": "2026-08-25T14:18:37+00:00", "type": "library", "installation-source": "dist", "autoload": { @@ -1913,7 +1913,7 @@ "terminal" ], "support": { - "source": "https://github.com/symfony/console/tree/v7.4.17" + "source": "https://github.com/symfony/console/tree/v7.4.18" }, "funding": [ { @@ -2429,17 +2429,17 @@ }, { "name": "symfony/service-contracts", - "version": "v3.7.1", - "version_normalized": "3.7.1.0", + "version": "v3.7.3", + "version_normalized": "3.7.3.0", "source": { "type": "git", "url": "https://github.com/symfony/service-contracts.git", - "reference": "c0a284bab1ed8aa0417e3d69250ab437739563a0" + "reference": "15e6a07ec2a2c75ceb1b21dd98105ee8456d2257" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/service-contracts/zipball/c0a284bab1ed8aa0417e3d69250ab437739563a0", - "reference": "c0a284bab1ed8aa0417e3d69250ab437739563a0", + "url": "https://api.github.com/repos/symfony/service-contracts/zipball/15e6a07ec2a2c75ceb1b21dd98105ee8456d2257", + "reference": "15e6a07ec2a2c75ceb1b21dd98105ee8456d2257", "shasum": "" }, "require": { @@ -2450,7 +2450,7 @@ "conflict": { "ext-psr": "<1.1|>=2" }, - "time": "2026-06-16T09:55:08+00:00", + "time": "2026-07-27T15:39:01+00:00", "type": "library", "extra": { "thanks": { @@ -2495,7 +2495,7 @@ "standards" ], "support": { - "source": "https://github.com/symfony/service-contracts/tree/v3.7.1" + "source": "https://github.com/symfony/service-contracts/tree/v3.7.3" }, "funding": [ { @@ -2699,17 +2699,17 @@ }, { "name": "symfony/yaml", - "version": "v7.4.17", - "version_normalized": "7.4.17.0", + "version": "v7.4.18", + "version_normalized": "7.4.18.0", "source": { "type": "git", "url": "https://github.com/symfony/yaml.git", - "reference": "0b040d7b66ceb10b7bb24c8e6656257932693a12" + "reference": "4cef939e55b8a21c5780418de0d98ab00d0736e1" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/yaml/zipball/0b040d7b66ceb10b7bb24c8e6656257932693a12", - "reference": "0b040d7b66ceb10b7bb24c8e6656257932693a12", + "url": "https://api.github.com/repos/symfony/yaml/zipball/4cef939e55b8a21c5780418de0d98ab00d0736e1", + "reference": "4cef939e55b8a21c5780418de0d98ab00d0736e1", "shasum": "" }, "require": { @@ -2723,7 +2723,7 @@ "require-dev": { "symfony/console": "^6.4|^7.0|^8.0" }, - "time": "2026-08-21T12:09:28+00:00", + "time": "2026-08-30T00:47:26+00:00", "bin": [ "Resources/bin/yaml-lint" ], @@ -2754,7 +2754,7 @@ "description": "Loads and dumps YAML files", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/yaml/tree/v7.4.17" + "source": "https://github.com/symfony/yaml/tree/v7.4.18" }, "funding": [ { @@ -2778,17 +2778,17 @@ }, { "name": "zircote/swagger-php", - "version": "6.7.0", - "version_normalized": "6.7.0.0", + "version": "6.7.1", + "version_normalized": "6.7.1.0", "source": { "type": "git", "url": "https://github.com/zircote/swagger-php.git", - "reference": "af0a8de6c4b6780e8e07d06ee0c7da538b5f1e46" + "reference": "fc4c4288623406cd1b4679409cd6aefdbd774827" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/zircote/swagger-php/zipball/af0a8de6c4b6780e8e07d06ee0c7da538b5f1e46", - "reference": "af0a8de6c4b6780e8e07d06ee0c7da538b5f1e46", + "url": "https://api.github.com/repos/zircote/swagger-php/zipball/fc4c4288623406cd1b4679409cd6aefdbd774827", + "reference": "fc4c4288623406cd1b4679409cd6aefdbd774827", "shasum": "" }, "require": { @@ -2812,7 +2812,7 @@ "phpunit/phpunit": "^11.5 || >=12.5.22", "rector/rector": "^2.3" }, - "time": "2026-08-24T21:55:54+00:00", + "time": "2026-08-30T07:08:23+00:00", "bin": [ "bin/openapi" ], @@ -2858,7 +2858,7 @@ ], "support": { "issues": "https://github.com/zircote/swagger-php/issues", - "source": "https://github.com/zircote/swagger-php/tree/6.7.0" + "source": "https://github.com/zircote/swagger-php/tree/6.7.1" }, "funding": [ { diff --git a/upload/api/vendor/composer/installed.php b/upload/api/vendor/composer/installed.php index 7449f7c2..83f9ccb6 100644 --- a/upload/api/vendor/composer/installed.php +++ b/upload/api/vendor/composer/installed.php @@ -3,7 +3,7 @@ 'name' => 'devcraftclub/dle-api', 'pretty_version' => 'dev-master', 'version' => 'dev-master', - 'reference' => 'f7eabb7b0bd02241e7ce5741655c1b5160f71fb7', + 'reference' => 'd6649794200c759d9be5ffff817fadbdfe4e5639', 'type' => 'library', 'install_path' => __DIR__ . '/../../', 'aliases' => array(), @@ -22,7 +22,7 @@ 'devcraftclub/dle-api' => array( 'pretty_version' => 'dev-master', 'version' => 'dev-master', - 'reference' => 'f7eabb7b0bd02241e7ce5741655c1b5160f71fb7', + 'reference' => 'd6649794200c759d9be5ffff817fadbdfe4e5639', 'type' => 'library', 'install_path' => __DIR__ . '/../../', 'aliases' => array(), @@ -158,9 +158,9 @@ 'dev_requirement' => false, ), 'phpstan/phpdoc-parser' => array( - 'pretty_version' => '2.3.3', - 'version' => '2.3.3.0', - 'reference' => 'fb19eedd2bb67ff8cf7a5502ad329e701d6398a3', + 'pretty_version' => '2.3.5', + 'version' => '2.3.5.0', + 'reference' => '148cefffaf0233e4c08cc13db8a195a56dd6dfe9', 'type' => 'library', 'install_path' => __DIR__ . '/../phpstan/phpdoc-parser', 'aliases' => array(), @@ -306,9 +306,9 @@ 'dev_requirement' => false, ), 'symfony/console' => array( - 'pretty_version' => 'v7.4.17', - 'version' => '7.4.17.0', - 'reference' => '962e18f09ebe68a49039b4c82fc0ea4871824fca', + 'pretty_version' => 'v7.4.18', + 'version' => '7.4.18.0', + 'reference' => '23d6f88a29f6d0eac45bd77d70307adf83ba7ab0', 'type' => 'library', 'install_path' => __DIR__ . '/../symfony/console', 'aliases' => array(), @@ -369,9 +369,9 @@ 'dev_requirement' => false, ), 'symfony/service-contracts' => array( - 'pretty_version' => 'v3.7.1', - 'version' => '3.7.1.0', - 'reference' => 'c0a284bab1ed8aa0417e3d69250ab437739563a0', + 'pretty_version' => 'v3.7.3', + 'version' => '3.7.3.0', + 'reference' => '15e6a07ec2a2c75ceb1b21dd98105ee8456d2257', 'type' => 'library', 'install_path' => __DIR__ . '/../symfony/service-contracts', 'aliases' => array(), @@ -396,18 +396,18 @@ 'dev_requirement' => false, ), 'symfony/yaml' => array( - 'pretty_version' => 'v7.4.17', - 'version' => '7.4.17.0', - 'reference' => '0b040d7b66ceb10b7bb24c8e6656257932693a12', + 'pretty_version' => 'v7.4.18', + 'version' => '7.4.18.0', + 'reference' => '4cef939e55b8a21c5780418de0d98ab00d0736e1', 'type' => 'library', 'install_path' => __DIR__ . '/../symfony/yaml', 'aliases' => array(), 'dev_requirement' => false, ), 'zircote/swagger-php' => array( - 'pretty_version' => '6.7.0', - 'version' => '6.7.0.0', - 'reference' => 'af0a8de6c4b6780e8e07d06ee0c7da538b5f1e46', + 'pretty_version' => '6.7.1', + 'version' => '6.7.1.0', + 'reference' => 'fc4c4288623406cd1b4679409cd6aefdbd774827', 'type' => 'library', 'install_path' => __DIR__ . '/../zircote/swagger-php', 'aliases' => array(), diff --git a/upload/api/vendor/phpstan/phpdoc-parser/README.md b/upload/api/vendor/phpstan/phpdoc-parser/README.md index 08e244b6..ac370349 100644 --- a/upload/api/vendor/phpstan/phpdoc-parser/README.md +++ b/upload/api/vendor/phpstan/phpdoc-parser/README.md @@ -166,6 +166,22 @@ $newPhpDoc = $printer->printFormatPreserving($newPhpDocNode, $phpDocNode, $token echo $newPhpDoc; // '/** @param Ipsum $a */' ``` +## The grammars + +The language this library reads is written down as a grammar in +[`doc/grammars`](doc/grammars), in the format the [phplrt](https://phplrt.org) +compiler reads. A grammar says what a PHPDoc may be written as, so it can be +walked the other way round and asked for PHPDocs instead of being asked about +one: that is where `FuzzyTest` gets its corpus, and it covers a great deal more +of the language than a hand-written one does. `GrammarSyncTest` walks them the +other way, asking each grammar about the inputs of every other test in this +project, so that what the grammars describe and what the parser reads cannot +drift apart. + +Nothing in `src/` reads those files, and the library needs neither the toolchain +writing the corpus nor the PHP 8.4 it asks for. See +[`doc/grammars/README.md`](doc/grammars/README.md). + ## Code of Conduct This project adheres to a [Contributor Code of Conduct](CODE_OF_CONDUCT.md). By participating in this project and its community, you are expected to uphold this code. @@ -181,3 +197,13 @@ Afterwards you can either run the whole build including linting and coding stand or run only tests using make tests + +The grammars have a toolchain of their own, because the compiler reading them +asks for PHP 8.4. Without it the fuzzy tests skip themselves: + + make grammars-install # install it + +`FuzzyTest` then writes its own corpus out of `doc/grammars/*.pp3` every time it +runs, and leaves it in `temp/fuzzy` to be looked at afterwards. `GrammarSyncTest` +asks the same grammars about the inputs of every other test, so that a feature +added to the parser is one they have to describe as well. diff --git a/upload/api/vendor/phpstan/phpdoc-parser/src/Ast/PhpDoc/PureUnlessParameterIsPassedTagValueNode.php b/upload/api/vendor/phpstan/phpdoc-parser/src/Ast/PhpDoc/PureUnlessParameterIsPassedTagValueNode.php index a49f5fd0..d59b320a 100644 --- a/upload/api/vendor/phpstan/phpdoc-parser/src/Ast/PhpDoc/PureUnlessParameterIsPassedTagValueNode.php +++ b/upload/api/vendor/phpstan/phpdoc-parser/src/Ast/PhpDoc/PureUnlessParameterIsPassedTagValueNode.php @@ -26,4 +26,18 @@ public function __toString(): string return trim("{$this->parameterName} {$this->description}"); } + /** + * @param array $properties + */ + public static function __set_state(array $properties): self + { + $instance = new self($properties['parameterName'], $properties['description']); + if (isset($properties['attributes'])) { + foreach ($properties['attributes'] as $key => $value) { + $instance->setAttribute($key, $value); + } + } + return $instance; + } + } diff --git a/upload/api/vendor/phpstan/phpdoc-parser/src/Ast/Type/ConditionalTypeNode.php b/upload/api/vendor/phpstan/phpdoc-parser/src/Ast/Type/ConditionalTypeNode.php index 7970a701..6ee3ec65 100644 --- a/upload/api/vendor/phpstan/phpdoc-parser/src/Ast/Type/ConditionalTypeNode.php +++ b/upload/api/vendor/phpstan/phpdoc-parser/src/Ast/Type/ConditionalTypeNode.php @@ -33,7 +33,12 @@ public function __toString(): string { return sprintf( '(%s %s %s ? %s : %s)', - $this->subjectType, + // "?Foo is Bar ? ... : ..." reads as a nullable type followed by + // something else, so the subject keeps the parentheses it was read + // with + $this->subjectType instanceof NullableTypeNode + ? '(' . $this->subjectType . ')' + : $this->subjectType, $this->negated ? 'is not' : 'is', $this->targetType, $this->if, diff --git a/upload/api/vendor/phpstan/phpdoc-parser/src/Ast/Type/NullableTypeNode.php b/upload/api/vendor/phpstan/phpdoc-parser/src/Ast/Type/NullableTypeNode.php index f79bad0f..7b70d608 100644 --- a/upload/api/vendor/phpstan/phpdoc-parser/src/Ast/Type/NullableTypeNode.php +++ b/upload/api/vendor/phpstan/phpdoc-parser/src/Ast/Type/NullableTypeNode.php @@ -18,6 +18,12 @@ public function __construct(TypeNode $type) public function __toString(): string { + if ($this->type instanceof self) { + // "??Foo" is no type at all, so the one written inside keeps the + // parentheses it was read with + return '?(' . $this->type . ')'; + } + return '?' . $this->type; } diff --git a/upload/api/vendor/phpstan/phpdoc-parser/src/Lexer/Lexer.php b/upload/api/vendor/phpstan/phpdoc-parser/src/Lexer/Lexer.php index e2e0e576..c470100c 100644 --- a/upload/api/vendor/phpstan/phpdoc-parser/src/Lexer/Lexer.php +++ b/upload/api/vendor/phpstan/phpdoc-parser/src/Lexer/Lexer.php @@ -5,7 +5,6 @@ use PHPStan\PhpDocParser\ParserConfig; use function implode; use function preg_match_all; -use const PREG_SET_ORDER; /** * Implementation based on Nette Tokenizer (New BSD License; https://github.com/nette/tokenizer) @@ -116,13 +115,24 @@ public function tokenize(string $s): array $this->regexp = $this->generateRegexp(); } - preg_match_all($this->regexp, $s, $matches, PREG_SET_ORDER); + // PREG_PATTERN_ORDER, not PREG_SET_ORDER: it collects the whole PHPDoc + // into two arrays instead of allocating one array per token. This only + // pays off while the token patterns have no capturing groups, because + // every group would get an array of its own, one entry per token. + preg_match_all($this->regexp, $s, $matches); + + $values = $matches[0]; + if ($values === []) { + return [['', self::TOKEN_END, 1]]; + } + + $marks = $matches['MARK']; $tokens = []; $line = 1; - foreach ($matches as $match) { - $type = (int) $match['MARK']; - $tokens[] = [$match[0], $type, $line]; + foreach ($values as $i => $value) { + $type = (int) $marks[$i]; + $tokens[] = [$value, $type, $line]; if ($type !== self::TOKEN_PHPDOC_EOL) { continue; } @@ -137,6 +147,7 @@ public function tokenize(string $s): array private function generateRegexp(): string { + // every group in here must be non-capturing, see tokenize() $patterns = [ self::TOKEN_HORIZONTAL_WS => '[\\x09\\x20]++', @@ -145,7 +156,7 @@ private function generateRegexp(): string self::TOKEN_VARIABLE => '\\$[a-z_\\x80-\\xFF][0-9a-z_\\x80-\\xFF]*+', // '&' followed by TOKEN_VARIADIC, TOKEN_VARIABLE, TOKEN_EQUAL, TOKEN_EQUAL or TOKEN_CLOSE_PARENTHESES - self::TOKEN_REFERENCE => '&(?=\\s*+(?:[.,=)]|(?:\\$(?!this(?![0-9a-z_\\x80-\\xFF])))))', + self::TOKEN_REFERENCE => '&(?=\\s*+(?:[,=)]|\\.\\.\\.|(?:\\$(?!this(?![0-9a-z_\\x80-\\xFF])))))', self::TOKEN_UNION => '\\|', self::TOKEN_INTERSECTION => '&', self::TOKEN_NULLABLE => '\\?', @@ -175,8 +186,8 @@ private function generateRegexp(): string self::TOKEN_DOCTRINE_TAG => '@[a-z_\\\\][a-z0-9_\:\\\\]*[a-z_][a-z0-9_]*', self::TOKEN_PHPDOC_EOL => '\\r?+\\n[\\x09\\x20]*+(?:\\*(?!/)\\x20?+)?', - self::TOKEN_FLOAT => '[+\-]?(?:(?:[0-9]++(_[0-9]++)*\\.[0-9]*+(_[0-9]++)*(?:e[+\-]?[0-9]++(_[0-9]++)*)?)|(?:[0-9]*+(_[0-9]++)*\\.[0-9]++(_[0-9]++)*(?:e[+\-]?[0-9]++(_[0-9]++)*)?)|(?:[0-9]++(_[0-9]++)*e[+\-]?[0-9]++(_[0-9]++)*))', - self::TOKEN_INTEGER => '[+\-]?(?:(?:0b[0-1]++(_[0-1]++)*)|(?:0o[0-7]++(_[0-7]++)*)|(?:0x[0-9a-f]++(_[0-9a-f]++)*)|(?:[0-9]++(_[0-9]++)*))', + self::TOKEN_FLOAT => '[+\-]?(?:(?:[0-9]++(?:_[0-9]++)*\\.[0-9]*+(?:_[0-9]++)*(?:e[+\-]?[0-9]++(?:_[0-9]++)*)?)|(?:[0-9]*+(?:_[0-9]++)*\\.[0-9]++(?:_[0-9]++)*(?:e[+\-]?[0-9]++(?:_[0-9]++)*)?)|(?:[0-9]++(?:_[0-9]++)*e[+\-]?[0-9]++(?:_[0-9]++)*))', + self::TOKEN_INTEGER => '[+\-]?(?:(?:0b[0-1]++(?:_[0-1]++)*)|(?:0o[0-7]++(?:_[0-7]++)*)|(?:0x[0-9a-f]++(?:_[0-9a-f]++)*)|(?:[0-9]++(?:_[0-9]++)*))', self::TOKEN_SINGLE_QUOTED_STRING => '\'(?:\\\\[^\\r\\n]|[^\'\\r\\n\\\\])*+\'', self::TOKEN_DOUBLE_QUOTED_STRING => '"(?:\\\\[^\\r\\n]|[^"\\r\\n\\\\])*+"', self::TOKEN_DOCTRINE_ANNOTATION_STRING => '"(?:""|[^"])*+"', diff --git a/upload/api/vendor/phpstan/phpdoc-parser/src/Parser/TypeParser.php b/upload/api/vendor/phpstan/phpdoc-parser/src/Parser/TypeParser.php index 077dd6b0..a2db4fce 100644 --- a/upload/api/vendor/phpstan/phpdoc-parser/src/Parser/TypeParser.php +++ b/upload/api/vendor/phpstan/phpdoc-parser/src/Parser/TypeParser.php @@ -470,6 +470,11 @@ public function parseGeneric(TokenIterator $tokens, Ast\Type\IdentifierTypeNode $type = new Ast\Type\GenericTypeNode($baseType, $genericTypes, $variances); if ($startLine !== null && $startIndex !== null) { $type = $this->enrichWithAttributes($tokens, $type, $startLine, $startIndex); + } else { + // The comments read between the arguments have to be given away + // even where the node is not placed, or they would still be waiting + // for a node once the whole PHPDoc has been read + $tokens->flushComments(); } $tokens->consumeTokenType(Lexer::TOKEN_CLOSE_ANGLE_BRACKET); diff --git a/upload/api/vendor/phpstan/phpdoc-parser/src/Printer/Printer.php b/upload/api/vendor/phpstan/phpdoc-parser/src/Printer/Printer.php index 623cb95b..db7d3db7 100644 --- a/upload/api/vendor/phpstan/phpdoc-parser/src/Printer/Printer.php +++ b/upload/api/vendor/phpstan/phpdoc-parser/src/Printer/Printer.php @@ -150,6 +150,16 @@ final class Printer IntersectionTypeNode::class, NullableTypeNode::class, ], + NullableTypeNode::class . '->type' => [ + UnionTypeNode::class, + IntersectionTypeNode::class, + NullableTypeNode::class, + ], + ConditionalTypeNode::class . '->subjectType' => [ + UnionTypeNode::class, + IntersectionTypeNode::class, + NullableTypeNode::class, + ], ]; /** @var array>> */ @@ -441,7 +451,7 @@ private function printType(TypeNode $node): string if ($node instanceof ConditionalTypeNode) { return sprintf( '(%s %s %s ? %s : %s)', - $this->printType($node->subjectType), + $this->printConditionalSubjectType($node->subjectType), $node->negated ? 'is not' : 'is', $this->printType($node->targetType), $this->printType($node->if), @@ -491,7 +501,11 @@ private function printType(TypeNode $node): string return (string) $node; } if ($node instanceof NullableTypeNode) { - if ($node->type instanceof IntersectionTypeNode || $node->type instanceof UnionTypeNode) { + if ( + $node->type instanceof IntersectionTypeNode + || $node->type instanceof UnionTypeNode + || $node->type instanceof NullableTypeNode + ) { return '?(' . $this->printType($node->type) . ')'; } @@ -517,6 +531,27 @@ private function wrapInParentheses(TypeNode $node): string return '(' . $this->printType($node) . ')'; } + /** + * What a conditional type asks about, written so that it is read back as + * the very same type. + * + * "?Foo is Bar ? ... : ..." and "Foo|Bar is Baz ? ... : ..." both read as a + * type followed by something the type says nothing about, so a subject of + * either kind keeps its parentheses. + */ + private function printConditionalSubjectType(TypeNode $type): string + { + if ( + $type instanceof UnionTypeNode + || $type instanceof IntersectionTypeNode + || $type instanceof NullableTypeNode + ) { + return $this->wrapInParentheses($type); + } + + return $this->printType($type); + } + private function printOffsetAccessType(TypeNode $type): string { if ( diff --git a/upload/api/vendor/symfony/console/Debug/CliRequest.php b/upload/api/vendor/symfony/console/Debug/CliRequest.php index 6e2c1012..412e9078 100644 --- a/upload/api/vendor/symfony/console/Debug/CliRequest.php +++ b/upload/api/vendor/symfony/console/Debug/CliRequest.php @@ -49,14 +49,12 @@ public function getMethod(): string public function getResponse(): Response { return new class($this->command->exitCode) extends Response { - public function __construct(private readonly int $exitCode) + public function __construct(int $exitCode) { parent::__construct(); - } - public function getStatusCode(): int - { - return $this->exitCode; + // getStatusCode() is final and setStatusCode() rejects an exit code + $this->statusCode = $exitCode; } }; } diff --git a/upload/api/vendor/symfony/service-contracts/Attribute/Required.php b/upload/api/vendor/symfony/service-contracts/Attribute/Required.php index 9df85118..1f742255 100644 --- a/upload/api/vendor/symfony/service-contracts/Attribute/Required.php +++ b/upload/api/vendor/symfony/service-contracts/Attribute/Required.php @@ -22,4 +22,11 @@ #[\Attribute(\Attribute::TARGET_METHOD | \Attribute::TARGET_PROPERTY)] final class Required { + /** + * @param int $priority The priority of the method call when the class declares several required methods; the higher the sooner it's called + */ + public function __construct( + public int $priority = 0, + ) { + } } diff --git a/upload/api/vendor/symfony/yaml/Inline.php b/upload/api/vendor/symfony/yaml/Inline.php index 00ec5635..0c1d454e 100644 --- a/upload/api/vendor/symfony/yaml/Inline.php +++ b/upload/api/vendor/symfony/yaml/Inline.php @@ -189,6 +189,7 @@ public static function dump(mixed $value, int $flags = 0, bool $rootLevel = fals return \strlen($doubleQuoted) < \strlen($singleQuoted) ? $doubleQuoted : $singleQuoted; case Parser::preg_match('{^[0-9]+[_0-9]*$}', $value): + case Parser::preg_match('{^[+-]?0o[0-7_]++$}', $value): case Parser::preg_match(self::getHexRegex(), $value): case Parser::preg_match(self::getTimestampRegex(), $value): return Escaper::escapeWithSingleQuotes($value); diff --git a/upload/api/vendor/symfony/yaml/Parser.php b/upload/api/vendor/symfony/yaml/Parser.php index 9d6bd9f8..948fd743 100644 --- a/upload/api/vendor/symfony/yaml/Parser.php +++ b/upload/api/vendor/symfony/yaml/Parser.php @@ -1262,6 +1262,18 @@ private function lexInlineSequence(int &$cursor = 0, bool $consumeUntilEol = tru } private function lexInlineStructure(int &$cursor, string $closingTag, bool $consumeUntilEol = true): string + { + $state = $this->getState(); + $state->enterNestingLevel($this->getRealCurrentLineNb() + 1, $this->currentLine, $this->filename); + + try { + return $this->doLexInlineStructure($cursor, $closingTag, $consumeUntilEol); + } finally { + $state->leaveNestingLevel(); + } + } + + private function doLexInlineStructure(int &$cursor, string $closingTag, bool $consumeUntilEol = true): string { $value = $this->currentLine[$cursor]; ++$cursor; diff --git a/upload/api/vendor/zircote/swagger-php/AGENTS.md b/upload/api/vendor/zircote/swagger-php/AGENTS.md new file mode 100644 index 00000000..a0c48169 --- /dev/null +++ b/upload/api/vendor/zircote/swagger-php/AGENTS.md @@ -0,0 +1,46 @@ +# swagger-php + +Generates OpenAPI documents from PHP source. Two pipelines: `classic` (docblock annotations +and `OpenApi\Attributes`) and `spec` (`OpenApi\Spec`), with a `hybrid` bridge between them. +[ROADMAP.md](ROADMAP.md) covers where they are heading. + +Terminology is defined in [CONTEXT.md](CONTEXT.md). Classic and spec deliberately use +different words for similar things — check there before naming anything. + +## Commands + +All tooling runs through composer: + +- `composer lint` — code style check (cs-fixer + rector, dry run) +- `composer cs` / `composer rector` — apply style fixes +- `composer analyse` — static analysis (phpstan) +- `composer test` — unit tests (add `-- --filter ClassName` for a single class) +- `composer docs:gen` — regenerate the reference docs +- `composer redocly` — validate generated specs against the OpenAPI schema +- `composer docs:dev` — local docs preview; **long-running, never returns** + +## Detail, by area + +Read the relevant page before working in that part of the tree: + +| Page | Covers | +|---|---| +| [docs/dev/pipeline.md](docs/dev/pipeline.md) | spec pipeline internals — slot maps, mutability, augmenter ordering, where new code goes | +| [docs/dev/testing.md](docs/dev/testing.md) | data providers, the `tests/Concerns` helpers, how documentation is test-verified | +| [docs/dev/docs-toolchain.md](docs/dev/docs-toolchain.md) | which documentation is generated, and the CLI's rough edges | +| [docs/dev/writing-docs.md](docs/dev/writing-docs.md) | conventions for hand-written documentation, and a checklist for reviewing doc changes | + +## Conventions + +- `protected` over `private` for methods and properties, so downstream can subclass +- British spelling in `src/`, US in `docs/` — follow whichever is local to the file +- New pipeline work goes in `src/Spec/`, `src/Augmenter/`, `src/Compiler/`; + `src/Annotations/` and `src/Attributes/` are classic and closed to new features — + [ROADMAP.md](ROADMAP.md) has the v7/v8 plan +- Branches are `type/short-description`; commits are `type(Scope): subject` + (`feat`, `fix`, `docs`, `chore`, `refactor`) + +## Before opening a pull request + +See [CONTRIBUTING.md](CONTRIBUTING.md) for the full checklist. The short version: +`composer test`, `composer analyse`, and `composer docs:gen` leaving no diff. diff --git a/upload/api/vendor/zircote/swagger-php/CLAUDE.md b/upload/api/vendor/zircote/swagger-php/CLAUDE.md index ea7c3c18..39f19d69 100644 --- a/upload/api/vendor/zircote/swagger-php/CLAUDE.md +++ b/upload/api/vendor/zircote/swagger-php/CLAUDE.md @@ -1,14 +1,5 @@ -# Tools +# swagger-php -All tools are run via composer: +Project instructions live in [AGENTS.md](AGENTS.md), shared with other coding agents. -- `composer lint` — check all code style issues (cs-fixer + rector) -- `composer cs` / `composer rector` — fix code style issues -- `composer analyse` — static analysis (phpstan) -- `composer test` — lint + unit tests; use `./bin/phpunit` directly to run only tests (e.g. `./bin/phpunit --filter ClassName`) -- `composer redocly` — validate spec fixtures (currently failing, fixtures not yet valid) - -# Tests - -- Prefer compact tests and data providers over repetition -- Use shared traits from `tests/Concerns/` for common helpers (e.g. `AssemblesSpecification`) +@AGENTS.md diff --git a/upload/api/vendor/zircote/swagger-php/CONTEXT.md b/upload/api/vendor/zircote/swagger-php/CONTEXT.md index 6c727694..6d447314 100644 --- a/upload/api/vendor/zircote/swagger-php/CONTEXT.md +++ b/upload/api/vendor/zircote/swagger-php/CONTEXT.md @@ -21,8 +21,8 @@ Nested metadata describing where an annotation was found in the source hierarchy _Avoid_: Location, position **Generator**: -The orchestrator that coordinates scanning, processing, and output — it generates an OpenAPI spec from annotations, not code from a spec. -_Avoid_: Builder, compiler +The **classic** orchestrator that coordinates scanning, processing, and output — it generates an OpenAPI spec from annotations, not code from a spec. +_Avoid_: using "builder" or "compiler" as loose synonyms — both now name distinct classes in the spec pipeline (see below) **Processor**: A single transformation step in an ordered pipeline that converts raw Analysis into a valid, complete OpenAPI specification. @@ -68,7 +68,44 @@ _Avoid_: Scanner (too narrow — TokenScanner is a sub-component), parser **AnnotationFactory**: Creates annotation objects from discovered PHP attributes or docblock comments during analysis. -_Avoid_: Builder, constructor +_Avoid_: constructor; and do not shorten it to "builder", which now names a class + +### Spec Pipeline + +The `spec` pipeline (`OpenApi\Spec`, `--mode spec`) has its own vocabulary. Terms here are +deliberately distinct from the classic ones above; do not use them interchangeably. + +**Builder**: +The unified entry point. Selects a processing mode and orchestrates the run, returning a `Result`. +_Avoid_: Generator (that name is reserved for the classic orchestrator) + +**Assembler**: +Collects spec attributes from PHP reflectors and resolves their nesting into a Specification. +_Avoid_: Analyser (classic), parser, scanner + +**Specification**: +A flat, typed container holding the collected spec attributes, one bucket per root attribute type. +_Avoid_: Analysis (classic), tree, document + +**Augmenter**: +A single pipe that enriches a Specification — the spec pipeline's counterpart to a classic Processor. +_Avoid_: Processor (reserved for the classic pipeline), middleware, handler + +**Compiler**: +Transforms a Specification into a versioned OpenAPI document array. One per supported OpenAPI version. +_Avoid_: Serializer (classic output step), renderer + +**Slot map**: +The `merge()` / `contained()` declarations by which an attribute names where it can nest. The slot names a property on the **target**, not on the declaring attribute. +_Avoid_: nesting map (that is the classic `$_nested`) + +**Root attribute**: +An attribute that can live in the Specification without a parent container, and therefore has its own bucket. +_Avoid_: top-level (ambiguous with source-code position) + +**Mode**: +Which pipeline a run uses: `classic`, `hybrid` or `spec`. +_Avoid_: driver, backend ## Relationships @@ -78,6 +115,13 @@ _Avoid_: Builder, constructor - **Nesting** defines where an **Annotation** can be merged within the OpenAPI tree - A **Component** is an **Annotation** that has been merged into `#/components/` and is reachable by **Ref** +In the spec pipeline: + +- A **Builder** runs an **Assembler** to produce a **Specification** +- The **Assembler** resolves **slot maps** to decide what nests where; what survives are **root attributes** +- **Augmenters** run over the **Specification** in phases (resolve → reduce → augment) +- A **Compiler** turns the finished **Specification** into the output document + ## Example dialogue > **Dev:** "I added a `@OA\Schema` on a class but it's not appearing in the output." @@ -90,4 +134,5 @@ _Avoid_: Builder, constructor - "generate" — resolved: reserve for the full end-to-end pipeline (`Generator::generate()`). Use **analyse** for the discovery phase and **serialize** for producing JSON/YAML output. - "merge" — resolved: reserve for tree-placement (moving an annotation into its correct position in the OpenAPI object). Combining multiple annotations' fields into one (e.g. Properties into a Schema) is part of **augment**. +- "augment" — **unresolved**. Classic uses it for filling in missing annotation fields (above). The spec pipeline also uses it as the name of the third augmenter phase (`Group::Augment`), which is narrower — `Types` and `Refs` do classic-style "augmenting" but run in the *resolve* phase. Say "the augment phase" when you mean the phase. - "nested" — resolved: use **nesting map** when referring to the `$_nested` declaration. Use **enclosing** when talking about the physical source code structure (file, class, method) that Context tracks. \ No newline at end of file diff --git a/upload/api/vendor/zircote/swagger-php/CONTRIBUTING.md b/upload/api/vendor/zircote/swagger-php/CONTRIBUTING.md index 6a46e732..22827e0c 100644 --- a/upload/api/vendor/zircote/swagger-php/CONTRIBUTING.md +++ b/upload/api/vendor/zircote/swagger-php/CONTRIBUTING.md @@ -16,15 +16,27 @@ The documentation site has [some details](https://zircote.github.io/swagger-php/ * [Checkout](https://git-scm.com/docs/git-checkout) the branch you want to make changes on. * Typically, this will be `master`. Note that most of the time, `master` represents the next release of swagger-php, so Pull Requests that break backwards compatibility might be postponed. * Install dependencies: `composer install`. -* Create a new branch, e.g. `feature-foo` or `bugfix-bar`. +* Create a new branch named `type/short-description`, e.g. `feat/encoding-shortcut` or + `fix/empty-schema-serialization`. * Make changes. * If you are adding functionality or fixing a bug - add a test! Prefer adding new test cases over modifying existing ones. -* Update documentation: `composer docs:gen`. -* Run static analysis using PHPStan/Psalm: `composer analyse`. -* Check if tests pass: `composer test`. -* Fix code style issues: `composer cs`. + +### Before opening a pull request + +- [ ] Tests pass — `composer test` +- [ ] Static analysis is clean — `composer analyse` +- [ ] Code style is clean — `composer lint` to check, `composer cs` and + `composer rector` to fix +- [ ] Reference docs regenerated — `composer docs:gen` leaves **no** diff +- [ ] Hand-written docs updated for any behaviour or API change + +`composer docs:gen` only rebuilds the generated pages; everything else under `docs/` is +hand-written and will not update itself. See [docs/dev/](docs/dev/) for which is which, and +for the conventions those pages follow. + +Pull request titles follow `type(Scope): subject`, e.g. `feat(Spec): add encoding shortcut`. ## Documentation @@ -39,9 +51,10 @@ The actual published content is managed in the [gh-pages](https://github.com/zir ## Useful commands -### To run both unit tests and linting execute +### Running the unit tests ```shell composer test +composer test -- --filter CompilerTest # a single test class ``` ### To run static-analysis execute @@ -49,24 +62,22 @@ composer test composer analyse ``` -### Running unit tests only -```shell -./bin/phpunit -``` - ### Regenerate reference markup docs ```shell composer docs:gen ``` -### Running linting only +### Checking code style ```shell composer lint ``` -### To make `php-cs-fixer` fix linting errors +### Fixing code style issues +`composer lint` runs both php-cs-fixer and rector in dry-run mode, so a failure can come +from either. Apply the fixes with: ```shell -composer cs +composer cs # php-cs-fixer +composer rector # rector ``` ### Validate generated specs with Redocly diff --git a/upload/api/vendor/zircote/swagger-php/README.md b/upload/api/vendor/zircote/swagger-php/README.md index f8b98bb2..7e94e062 100644 --- a/upload/api/vendor/zircote/swagger-php/README.md +++ b/upload/api/vendor/zircote/swagger-php/README.md @@ -19,18 +19,16 @@ attributes and annotations. - Compatible with the OpenAPI **3.0**, **3.1** and **3.2** specification. - Extracts information from code and existing phpdoc comments. - Can be used programmatically or via command-line tool. -- [Documentation site](https://zircote.github.io/swagger-php/) with a getting started guide. - Error reporting (with hints, context). -- All metadata is configured via PHP attributes. - 🧪 **Spec attributes pipeline (beta)** — a new processing mode with typed DTOs, grouped augmenters, and version-aware compilers. ## OpenAPI version support -`swagger-php` allows to generate specs either for **OpenAPI 3.0.0**, **OpenAPI 3.1.0** and **OpenAPI 3.2.0**. -By default, the spec will be in version `3.0.0`. The command line option `--version` may be used to change to -any other supported version. +`swagger-php` can generate specs for **OpenAPI 3.0.0**, **OpenAPI 3.1.0** and **OpenAPI 3.2.0**. +Classic mode defaults to `3.0.0`, spec and hybrid mode to `3.1.0`. -Programmatically, the method `Generator::setVersion()` can be used to change the version. +The command line option `--version` selects a different version; programmatically, use +`Builder::setVersion()`. ## Requirements @@ -42,8 +40,9 @@ Programmatically, the method `Generator::setVersion()` can be used to change the composer require zircote/swagger-php ``` -For cli usage from anywhere, install swagger-php globally and make sure to place the `~/.composer/vendor/bin` directory -in your PATH so the `openapi` executable can be located by your system. +For cli usage from anywhere, install swagger-php globally and add Composer's global binary directory +(`composer global config bin-dir --absolute`) to your PATH, so the `openapi` executable can be located by +your system. ```shell composer global require zircote/swagger-php @@ -111,7 +110,7 @@ $result = (new \OpenApi\Builder()) ``` **Hybrid mode** works with your existing `OpenApi\Attributes` code — no changes needed. It runs the classic scanner -but uses the new augmenter pipeline and version-aware compilers, which is faster and easier to extend. +but uses the new augmenter pipeline and version-aware compilers, which are easier to extend. If you'd like to help test the new pipeline, switching to hybrid is the easiest way: ```php @@ -154,9 +153,9 @@ The `openapi` command line interface can be used to generate the documentation t ## Automatic type resolution As of version 6, resolving of types is done using the `TypeInfoTypeResolver` class. It uses the `symfony/type-info` -library under the hood which allows handling of complext types. +library under the hood which allows handling of complex types. -With this change, `swagger-php` supports all available native type-hints and also complext generic type-hints via phpdoc +With this change, `swagger-php` supports all available native type-hints and also complex generic type-hints via phpdoc blocks. This simplifies the definition of schemas. diff --git a/upload/api/vendor/zircote/swagger-php/composer.json b/upload/api/vendor/zircote/swagger-php/composer.json index 47aa1925..da50e313 100644 --- a/upload/api/vendor/zircote/swagger-php/composer.json +++ b/upload/api/vendor/zircote/swagger-php/composer.json @@ -84,7 +84,7 @@ "cs": "Fix all codestyle issues", "rector": "Automatic refactoring", "lint": "Test codestyle", - "test": "Run all PHP, codestyle and rector tests", + "test": "Run the unit tests", "performance": "Run performance regression tests", "analyse": "Run static analysis (phpstan)", "redocly": "Validate generated specs with Redocly", @@ -99,10 +99,7 @@ "@cs --dry-run", "@rector --dry-run" ], - "test": [ - "export XDEBUG_MODE=off && phpunit --display-all-issues @additional_args", - "@lint @no_additional_args" - ], + "test": "export XDEBUG_MODE=off && phpunit --display-all-issues @additional_args", "performance": "export XDEBUG_MODE=off && phpunit --group performance", "analyse": [ "export XDEBUG_MODE=off && phpstan clear-result-cache -q && phpstan analyse --memory-limit=3G" diff --git a/upload/api/vendor/zircote/swagger-php/phpstan.neon.dist b/upload/api/vendor/zircote/swagger-php/phpstan.neon.dist new file mode 100644 index 00000000..71924884 --- /dev/null +++ b/upload/api/vendor/zircote/swagger-php/phpstan.neon.dist @@ -0,0 +1,30 @@ +includes: + - phpstan-baseline.neon + +parameters: + phpVersion: 80200 + level: 5 + paths: + - src + - tests + - tools + - docs/examples + parallel: + processTimeout: 300.0 + excludePaths: + - 'tests/Fixtures/*' + treatPhpDocTypesAsCertain: false + ignoreErrors: + - + # ignore Generator::UNDEFINED default value + message: '#OpenApi\\Annotations#' + identifier: property.defaultValue + - + # ignore unused example fixtures + message: '#OpenApi\\Examples#' + identifier: property.unused + - + # ignore assigning Generator::UNDEFINED as property value + message: '#Property OpenApi\\Annotations.*::\$.* does not accept string.#' + identifier: assign.propertyType + diff --git a/upload/api/vendor/zircote/swagger-php/rector.php b/upload/api/vendor/zircote/swagger-php/rector.php index 7701e056..fe4641d1 100644 --- a/upload/api/vendor/zircote/swagger-php/rector.php +++ b/upload/api/vendor/zircote/swagger-php/rector.php @@ -11,6 +11,7 @@ use Rector\DeadCode\Rector\If_\RemoveAlwaysTrueIfConditionRector; use Rector\DeadCode\Rector\If_\RemoveDeadInstanceOfRector; use Rector\Php55\Rector\String_\StringClassNameToClassConstantRector; +use Rector\Php74\Rector\If_\IfToNullCoalescingAssignRector; use Rector\Php80\Rector\Class_\ClassPropertyAssignToConstructorPromotionRector; use Rector\Php81\Rector\Array_\ArrayToFirstClassCallableRector; use Rector\Php81\Rector\Property\ReadOnlyPropertyRector; @@ -49,6 +50,11 @@ ArrayToFirstClassCallableRector::class => [ __DIR__ . '/tests/Analysers/ComposerAutoloaderScannerTest.php', ], + // `Operation::$operationId` is documented `@var string`, so phpstan rejects `??=` + // on it; the null check here is deliberate defensive handling + IfToNullCoalescingAssignRector::class => [ + __DIR__ . '/src/Processors/OperationId.php', + ], ]) ->withPreparedSets( deadCode: true, diff --git a/upload/api/vendor/zircote/swagger-php/src/Annotations/AbstractAnnotation.php b/upload/api/vendor/zircote/swagger-php/src/Annotations/AbstractAnnotation.php index f15442c9..3b7d112e 100644 --- a/upload/api/vendor/zircote/swagger-php/src/Annotations/AbstractAnnotation.php +++ b/upload/api/vendor/zircote/swagger-php/src/Annotations/AbstractAnnotation.php @@ -243,9 +243,7 @@ public function mergeProperties($object): void */ public function toYaml(?int $flags = null): string { - if ($flags === null) { - $flags = Yaml::DUMP_OBJECT_AS_MAP ^ Yaml::DUMP_EMPTY_ARRAY_AS_SEQUENCE; - } + $flags ??= Yaml::DUMP_OBJECT_AS_MAP ^ Yaml::DUMP_EMPTY_ARRAY_AS_SEQUENCE; return Yaml::dump(json_decode($this->toJson(JSON_INVALID_UTF8_IGNORE)), 10, 2, $flags); } @@ -255,9 +253,7 @@ public function toYaml(?int $flags = null): string */ public function toJson(?int $flags = null): string { - if ($flags === null) { - $flags = JSON_PRETTY_PRINT | JSON_UNESCAPED_SLASHES | JSON_UNESCAPED_UNICODE | JSON_INVALID_UTF8_IGNORE; - } + $flags ??= JSON_PRETTY_PRINT | JSON_UNESCAPED_SLASHES | JSON_UNESCAPED_UNICODE | JSON_INVALID_UTF8_IGNORE; return json_encode($this, $flags); } diff --git a/upload/api/vendor/zircote/swagger-php/src/Assembler/AbstractAttributeTranslator.php b/upload/api/vendor/zircote/swagger-php/src/Assembler/AbstractAttributeTranslator.php index 3b5d504d..7eaae27f 100644 --- a/upload/api/vendor/zircote/swagger-php/src/Assembler/AbstractAttributeTranslator.php +++ b/upload/api/vendor/zircote/swagger-php/src/Assembler/AbstractAttributeTranslator.php @@ -1,6 +1,6 @@ properties ?? []; - // Also walk properties inside allOf entries (placed there by ExpandHierarchy) + // Also walk properties inside allOf entries (placed there by Augmenter\Inheritance) foreach ($schema->allOf ?? [] as $entry) { if ($entry->properties) { array_push($properties, ...$entry->properties); diff --git a/upload/api/vendor/zircote/swagger-php/src/Augmenter/EnumDescriptions.php b/upload/api/vendor/zircote/swagger-php/src/Augmenter/EnumDescriptions.php index b1f8c7de..05b7d2c0 100644 --- a/upload/api/vendor/zircote/swagger-php/src/Augmenter/EnumDescriptions.php +++ b/upload/api/vendor/zircote/swagger-php/src/Augmenter/EnumDescriptions.php @@ -1,6 +1,6 @@ applySchemaType($schema, $schemaType); } - if ($schema->nullable === null) { - $schema->nullable = $schemaType->nullable; - } + $schema->nullable ??= $schemaType->nullable; } protected function applySchemaType(OA\Schema $schema, SchemaType $schemaType): void @@ -325,17 +323,11 @@ protected function applySchemaType(OA\Schema $schema, SchemaType $schemaType): v } } - if ($schema->format === null) { - $schema->format = $schemaType->format; - } + $schema->format ??= $schemaType->format; - if ($schema->minimum === null) { - $schema->minimum = $schemaType->minimum; - } + $schema->minimum ??= $schemaType->minimum; - if ($schema->maximum === null) { - $schema->maximum = $schemaType->maximum; - } + $schema->maximum ??= $schemaType->maximum; if ($schemaType->not !== null && !$schema->not instanceof OA\Schema) { $schema->not = new OA\Schema(const: $schemaType->not['const']); diff --git a/upload/api/vendor/zircote/swagger-php/src/Builder.php b/upload/api/vendor/zircote/swagger-php/src/Builder.php index 2fa19f33..e3018ec5 100644 --- a/upload/api/vendor/zircote/swagger-php/src/Builder.php +++ b/upload/api/vendor/zircote/swagger-php/src/Builder.php @@ -50,6 +50,8 @@ class Builder protected ?CompilerInterface $compiler = null; + protected ?Resolver $resolver = null; + /** * @var Utils\Pipeline|null */ @@ -110,6 +112,25 @@ public function setCompiler(CompilerInterface $compiler): static return $this; } + public function getResolver(): Resolver + { + $this->resolver ??= new Resolver(); + + return $this->resolver; + } + + /** + * Configure the resolver via callable. + * + * @param callable(Resolver): (Resolver|void) $hook + */ + public function withResolver(callable $hook): static + { + $hook($this->getResolver()); + + return $this; + } + /** * @return Utils\Pipeline */ @@ -231,6 +252,8 @@ protected function doBuildSpec(bool $hybrid = false): Result $specification = $assembler->getSpecification(); + $this->getResolver()->resolve($assembler); + if ($hybrid) { $this->doHybridAssemble($specification); } @@ -281,10 +304,11 @@ protected function doHybridAssemble(Specification $specification): void protected function resolveCompiler(string $version): CompilerInterface { + $logger = $this->getLogger(); $compilers = [ - new Compiler\OpenApi30Compiler(), - new Compiler\OpenApi31Compiler(), - new Compiler\OpenApi32Compiler(), + new Compiler\OpenApi30Compiler($logger), + new Compiler\OpenApi31Compiler($logger), + new Compiler\OpenApi32Compiler($logger), ]; foreach ($compilers as $compiler) { diff --git a/upload/api/vendor/zircote/swagger-php/src/Compiler/OpenApi30Compiler.php b/upload/api/vendor/zircote/swagger-php/src/Compiler/OpenApi30Compiler.php index 07b3cad7..901ecd19 100644 --- a/upload/api/vendor/zircote/swagger-php/src/Compiler/OpenApi30Compiler.php +++ b/upload/api/vendor/zircote/swagger-php/src/Compiler/OpenApi30Compiler.php @@ -19,6 +19,7 @@ * - exclusiveMinimum/Maximum are booleans (used alongside minimum/maximum) * - No $ref siblings (summary/description stripped from $ref objects) * - No webhooks + * - No mutualTLS security scheme (added in 3.1) * - No const, no examples array on Schema (only singular example) * - No prefixItems, unevaluatedItems, unevaluatedProperties * - No if/then/else @@ -52,6 +53,14 @@ public function validate(Specification $specification): array $this->logger->warning('webhooks are not supported in OpenAPI 3.0 and will be omitted'); } + $hasMutualTls = (bool) array_filter( + $specification->securitySchemes, + fn (OA\Security\Scheme $scheme): bool => $scheme->type === OA\SchemeType::MutualTLS->value + ); + if ($hasMutualTls) { + $this->logger->warning('mutualTLS security schemes are not supported in OpenAPI 3.0 and will be omitted'); + } + if ($specification->info?->license instanceof OA\License) { $license = $specification->info->license; if ($license->identifier !== null) { @@ -70,6 +79,15 @@ protected function compileWebhooks(array $operations): array return []; } + #[\Override] + protected function compileSecuritySchemes(array $schemes): array + { + return parent::compileSecuritySchemes(array_values(array_filter( + $schemes, + fn (OA\Security\Scheme $scheme): bool => $scheme->type !== OA\SchemeType::MutualTLS->value + ))); + } + #[\Override] protected function compileInfo(OA\Info $info): array { diff --git a/upload/api/vendor/zircote/swagger-php/src/Compiler/OpenApi31Compiler.php b/upload/api/vendor/zircote/swagger-php/src/Compiler/OpenApi31Compiler.php index 5ff8b5a7..f11fa97b 100644 --- a/upload/api/vendor/zircote/swagger-php/src/Compiler/OpenApi31Compiler.php +++ b/upload/api/vendor/zircote/swagger-php/src/Compiler/OpenApi31Compiler.php @@ -568,7 +568,7 @@ protected function compileComponents(Specification $specification): array 'parameters' => $this->compileNamedMap($specification->parameters, fn (OA\Parameter $parameter): string => $parameter->parameter ?? $parameter->name ?? 'param', $this->compileParameter(...)), 'requestBodies' => $this->compileNamedMap($specification->requestBodies, fn (OA\RequestBody $body, int $index): string => $body->request ?? 'body' . $index, $this->compileRequestBody(...)), 'headers' => $this->compileNamedMap($specification->headers, 'header', $this->compileHeader(...)), - 'securitySchemes' => $this->compileNamedMap($specification->securitySchemes, 'securityScheme', $this->compileSecurityScheme(...)), + 'securitySchemes' => $this->compileSecuritySchemes($specification->securitySchemes), 'links' => $this->compileNamedMap($specification->links, fn (OA\Link $link): string => $link->link ?? $link->operationId ?? 'link', $this->compileLink(...)), 'examples' => $this->compileNamedMap($specification->examples, 'example', $this->compileExample(...)), ]); @@ -590,6 +590,15 @@ protected function compileSecurity(array $security): array }, $security); } + /** + * @param list $schemes + * @return array + */ + protected function compileSecuritySchemes(array $schemes): array + { + return $this->compileNamedMap($schemes, 'securityScheme', $this->compileSecurityScheme(...)); + } + protected function compileSecurityScheme(OA\Security\Scheme $scheme): array { return $this->filter([ diff --git a/upload/api/vendor/zircote/swagger-php/src/Contracts/AttributeInterface.php b/upload/api/vendor/zircote/swagger-php/src/Contracts/AttributeInterface.php index 3695b1f0..7535c179 100644 --- a/upload/api/vendor/zircote/swagger-php/src/Contracts/AttributeInterface.php +++ b/upload/api/vendor/zircote/swagger-php/src/Contracts/AttributeInterface.php @@ -54,8 +54,8 @@ public function merge(): array; * * During hierarchical resolution (class absorbs members, method absorbs parameters), * the assembler uses contained() to determine which outer-level attributes can contain - * this container. Keys are the parent class, values are the property name on this - * attribute where the child will be placed. + * this container. Keys are the parent class, values are the property name on that + * parent where this attribute will be placed. * * Use '[]' suffix for collection slots (append): 'properties[]' * Omit suffix for scalar slots (set): 'requestBody' diff --git a/upload/api/vendor/zircote/swagger-php/src/Contracts/ResolverInterface.php b/upload/api/vendor/zircote/swagger-php/src/Contracts/ResolverInterface.php new file mode 100644 index 00000000..e083d05a --- /dev/null +++ b/upload/api/vendor/zircote/swagger-php/src/Contracts/ResolverInterface.php @@ -0,0 +1,23 @@ +getSpecification()` directly. + * + * @return bool true if the FQCN was handled; stops the resolver chain for this FQCN + */ + public function resolve(string $fqcn, Assembler $assembler): bool; +} diff --git a/upload/api/vendor/zircote/swagger-php/src/Processors/DocBlockDescriptions.php b/upload/api/vendor/zircote/swagger-php/src/Processors/DocBlockDescriptions.php index 86416b2f..51f56501 100644 --- a/upload/api/vendor/zircote/swagger-php/src/Processors/DocBlockDescriptions.php +++ b/upload/api/vendor/zircote/swagger-php/src/Processors/DocBlockDescriptions.php @@ -60,9 +60,7 @@ public function __invoke(Analysis $analysis): void protected function description(OA\AbstractAnnotation $annotation): void { if (!Undefined::isDefault($annotation->description)) { - if ($annotation->description === null) { - $annotation->description = Undefined::UNDEFINED; - } + $annotation->description ??= Undefined::UNDEFINED; return; } diff --git a/upload/api/vendor/zircote/swagger-php/src/Resolver.php b/upload/api/vendor/zircote/swagger-php/src/Resolver.php new file mode 100644 index 00000000..7096d6f1 --- /dev/null +++ b/upload/api/vendor/zircote/swagger-php/src/Resolver.php @@ -0,0 +1,219 @@ +|null $resolvers defaults to the built-in resolvers + */ + public function __construct(protected TypedList|null $resolvers = null) + { + $this->resolvers ??= new TypedList($this->getDefaultResolvers()); + } + + /** + * @param TypedList $resolvers + */ + public function setResolvers(TypedList $resolvers): static + { + $this->resolvers = $resolvers; + + return $this; + } + + /** + * Configure the resolvers via callable. + * + * @param callable(TypedList): (TypedList|void) $hook + */ + public function withResolvers(callable $hook): static + { + $hook($this->resolvers); + + return $this; + } + + /** + * Resolve all found unresolved FQCN in the specification assembled so far. + * + * The first resolver to claim success will resolve the FQCN. + */ + public function resolve(Assembler $assembler): void + { + if ($this->resolvers->count() === 0) { + return; + } + + $specification = $assembler->getSpecification(); + + // FQCN no resolver was able to handle; not worth another attempt in this run + $attempted = []; + + $iterations = 0; + do { + if (++$iterations > static::MAX_ITERATIONS) { + throw new OpenApiException(sprintf('Resolver loop did not converge after %d iterations; check for resolvers that return true without resolving', static::MAX_ITERATIONS)); + } + + $unresolved = $this->findUnresolved($specification); + $resolved = false; + foreach ($unresolved as $fqcn) { + if (isset($attempted[$fqcn])) { + continue; + } + + foreach ($this->resolvers as $resolver) { + if ($resolver->resolve($fqcn, $assembler)) { + $resolved = true; + continue 2; + } + } + + $attempted[$fqcn] = true; + } + } while ($resolved); + } + + /** + * @return list + */ + protected function getDefaultResolvers(): array + { + return [new Reflection()]; + } + + /** + * @return list FQCNs that are referenced but have no schema in the specification + */ + protected function findUnresolved(Specification $specification): array + { + $index = $specification->buildComponentIndex(); + $unresolved = []; + + $this->collectFromRefs($specification, $index, $unresolved); + $this->collectFromReflectors($specification, $index, $unresolved); + + return array_values(array_unique($unresolved)); + } + + protected function collectFromRefs(Specification $specification, ComponentIndex $index, array &$unresolved): void + { + $specification->getWalker()->eachRef(function (AttributeInterface $attribute) use ($index, &$unresolved): void { + if (!property_exists($attribute, 'ref') || $attribute->ref === null) { + return; + } + + $ref = $attribute->ref instanceof OA\Schema\Ref + ? $attribute->ref->ref + : $attribute->ref; + + if (str_starts_with($ref, '#/')) { + return; + } + + if (!class_exists($ref)) { + return; + } + + if (!$index->find($ref) instanceof AttributeInterface) { + $unresolved[] = $ref; + } + }); + } + + protected function collectFromReflectors(Specification $specification, ComponentIndex $index, array &$unresolved): void + { + foreach ($specification->schemas as $schema) { + $reflector = $schema->getClassReflector(); + if ($reflector === null) { + continue; + } + + foreach ($this->getTypedReflectors($reflector) as $type) { + if ($type->isBuiltin()) { + continue; + } + + $fqcn = $type->getName(); + if (!class_exists($fqcn) && !interface_exists($fqcn) && !enum_exists($fqcn)) { + continue; + } + + if (!$index->find($fqcn) instanceof AttributeInterface) { + $unresolved[] = $fqcn; + } + } + } + } + + /** + * @return list<\ReflectionNamedType> + */ + protected function getTypedReflectors(\ReflectionClass $reflector): array + { + $types = []; + + foreach ($reflector->getProperties(\ReflectionProperty::IS_PUBLIC) as $prop) { + if ($prop->getDeclaringClass()->getName() !== $reflector->getName()) { + continue; + } + foreach ($this->extractNamedTypes($prop->getType()) as $type) { + $types[] = $type; + } + } + + if ($constructor = $reflector->getConstructor()) { + foreach ($constructor->getParameters() as $param) { + foreach ($this->extractNamedTypes($param->getType()) as $type) { + $types[] = $type; + } + } + } + + return $types; + } + + /** + * @return list<\ReflectionNamedType> + */ + protected function extractNamedTypes(?\ReflectionType $type): array + { + if ($type instanceof \ReflectionNamedType) { + return [$type]; + } + + if ($type instanceof \ReflectionUnionType || $type instanceof \ReflectionIntersectionType) { + $named = []; + foreach ($type->getTypes() as $inner) { + if ($inner instanceof \ReflectionNamedType) { + $named[] = $inner; + } + } + + return $named; + } + + return []; + } +} diff --git a/upload/api/vendor/zircote/swagger-php/src/Resolver/Reflection.php b/upload/api/vendor/zircote/swagger-php/src/Resolver/Reflection.php new file mode 100644 index 00000000..781ff93e --- /dev/null +++ b/upload/api/vendor/zircote/swagger-php/src/Resolver/Reflection.php @@ -0,0 +1,34 @@ +collect(new \ReflectionClass($fqcn)); + + return $assembler->getSpecification()->buildComponentIndex()->find($fqcn) instanceof AttributeInterface; + } +} diff --git a/upload/api/vendor/zircote/swagger-php/src/Spec/Security/Requirement.php b/upload/api/vendor/zircote/swagger-php/src/Spec/Security/Requirement.php index 0461764a..c69a92a6 100644 --- a/upload/api/vendor/zircote/swagger-php/src/Spec/Security/Requirement.php +++ b/upload/api/vendor/zircote/swagger-php/src/Spec/Security/Requirement.php @@ -47,7 +47,7 @@ public function contained(): array } /** - * Resolve to the normalized map format: ['schemeName' => [...scopes]]. + * Resolve to the normalised map format: ['schemeName' => [...scopes]]. * * @return array> */ diff --git a/upload/api/vendor/zircote/swagger-php/src/Utils/AttributeFactory.php b/upload/api/vendor/zircote/swagger-php/src/Utils/AttributeFactory.php index 053996c8..aa33608c 100644 --- a/upload/api/vendor/zircote/swagger-php/src/Utils/AttributeFactory.php +++ b/upload/api/vendor/zircote/swagger-php/src/Utils/AttributeFactory.php @@ -16,9 +16,9 @@ * Creates spec attribute instances from PHP reflectors. * * Encapsulates: reading PHP attributes, stack-resolving siblings (merge), - * and hierarchical absorb (contains). Shared between the Assembler (initial + * and hierarchical absorb (contained). Shared between the Assembler (initial * collection) and augmenter pipes that need to manufacture spec objects - * from reflection (e.g. ExpandHierarchy for non-schema ancestor members). + * from reflection (e.g. Augmenter\Inheritance for non-schema ancestor members). */ class AttributeFactory {