From bfbc8c0631f135e87bd275b3a6fe455faafac49c Mon Sep 17 00:00:00 2001 From: MaximHarder <19776684+MaximHarder@users.noreply.github.com> Date: Wed, 26 Aug 2026 11:43:44 +0000 Subject: [PATCH] chore(deps): composer update --- upload/api/composer.lock | 104 ++++++++++-------- upload/api/vendor/composer/installed.json | 26 ++--- upload/api/vendor/composer/installed.php | 16 +-- .../src/Serializers/Signed.php | 9 +- .../vendor/zircote/swagger-php/bin/openapi | 4 +- .../vendor/zircote/swagger-php/composer.json | 2 +- .../zircote/swagger-php/src/Assembler.php | 1 + .../Assembler/AbstractAttributeTranslator.php | 2 +- .../Assembler/DefaultAttributeTranslator.php | 2 +- .../OptionalPropertyAttributeTranslator.php | 11 +- .../swagger-php/src/Augmenter/Cleanup.php | 2 +- .../swagger-php/src/Augmenter/Docblocks.php | 2 +- .../src/Augmenter/Inheritance/Schemas.php | 2 +- .../swagger-php/src/Augmenter/MediaTypes.php | 48 +++++++- .../swagger-php/src/Augmenter/Refs.php | 3 +- .../swagger-php/src/Augmenter/Shortcuts.php | 2 +- .../zircote/swagger-php/src/Builder.php | 1 + .../swagger-php/src/Builder/Result.php | 10 +- .../src/Compiler/OpenApi30Compiler.php | 4 +- .../src/Compiler/OpenApi31Compiler.php | 6 +- .../src/Console/GenerateCommand.php | 17 ++- .../swagger-php/src/Console/GenerateInput.php | 2 +- .../{ => Contracts}/AttributeInterface.php | 2 +- .../AttributeTranslatorInterface.php | 2 +- .../src/{ => Contracts}/CompilerInterface.php | 4 +- .../src/Spec/AbstractAttribute.php | 2 +- .../zircote/swagger-php/src/Spec/Encoding.php | 7 +- .../swagger-php/src/Spec/Property/Encoded.php | 54 +++++++++ .../swagger-php/src/Spec/Schema/Items.php | 5 +- .../zircote/swagger-php/src/Specification.php | 2 + .../{ => Specification}/ComponentIndex.php | 7 +- .../src/Utils/AttributeFactory.php | 4 +- .../swagger-php/src/Utils/Pipeline.php | 89 +++++++++++++-- .../src/Utils/SpecificationWalker.php | 2 +- 34 files changed, 340 insertions(+), 116 deletions(-) rename upload/api/vendor/zircote/swagger-php/src/{ => Contracts}/AttributeInterface.php (99%) rename upload/api/vendor/zircote/swagger-php/src/{ => Contracts}/AttributeTranslatorInterface.php (98%) rename upload/api/vendor/zircote/swagger-php/src/{ => Contracts}/CompilerInterface.php (93%) create mode 100644 upload/api/vendor/zircote/swagger-php/src/Spec/Property/Encoded.php rename upload/api/vendor/zircote/swagger-php/src/{ => Specification}/ComponentIndex.php (97%) diff --git a/upload/api/composer.lock b/upload/api/composer.lock index 11390f3e..be65662a 100644 --- a/upload/api/composer.lock +++ b/upload/api/composer.lock @@ -131,16 +131,16 @@ }, { "name": "laravel/serializable-closure", - "version": "v2.0.15", + "version": "v2.0.16", "source": { "type": "git", "url": "https://github.com/laravel/serializable-closure.git", - "reference": "dccd8bcb851bb03fcc005df650b708b57cc52661" + "reference": "7cfc24e4fa2cca045fb8dd2a797a2b2b13b655ed" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/laravel/serializable-closure/zipball/dccd8bcb851bb03fcc005df650b708b57cc52661", - "reference": "dccd8bcb851bb03fcc005df650b708b57cc52661", + "url": "https://api.github.com/repos/laravel/serializable-closure/zipball/7cfc24e4fa2cca045fb8dd2a797a2b2b13b655ed", + "reference": "7cfc24e4fa2cca045fb8dd2a797a2b2b13b655ed", "shasum": "" }, "require": { @@ -188,7 +188,7 @@ "issues": "https://github.com/laravel/serializable-closure/issues", "source": "https://github.com/laravel/serializable-closure" }, - "time": "2026-07-21T16:49:22+00:00" + "time": "2026-08-18T20:28:54+00:00" }, { "name": "lcobucci/jwt", @@ -2670,16 +2670,16 @@ }, { "name": "zircote/swagger-php", - "version": "6.6.0", + "version": "6.7.0", "source": { "type": "git", "url": "https://github.com/zircote/swagger-php.git", - "reference": "cc81abcfffec8b2f993db64013ea3b49679341c9" + "reference": "af0a8de6c4b6780e8e07d06ee0c7da538b5f1e46" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/zircote/swagger-php/zipball/cc81abcfffec8b2f993db64013ea3b49679341c9", - "reference": "cc81abcfffec8b2f993db64013ea3b49679341c9", + "url": "https://api.github.com/repos/zircote/swagger-php/zipball/af0a8de6c4b6780e8e07d06ee0c7da538b5f1e46", + "reference": "af0a8de6c4b6780e8e07d06ee0c7da538b5f1e46", "shasum": "" }, "require": { @@ -2747,7 +2747,7 @@ ], "support": { "issues": "https://github.com/zircote/swagger-php/issues", - "source": "https://github.com/zircote/swagger-php/tree/6.6.0" + "source": "https://github.com/zircote/swagger-php/tree/6.7.0" }, "funding": [ { @@ -2755,28 +2755,28 @@ "type": "github" } ], - "time": "2026-08-18T03:19:28+00:00" + "time": "2026-08-24T21:55:54+00:00" } ], "packages-dev": [ { "name": "guzzlehttp/guzzle", - "version": "8.0.2", + "version": "8.1.0", "source": { "type": "git", "url": "https://github.com/guzzle/guzzle.git", - "reference": "d1cbca76970939a9c2ced55b1e25ea26f34fc773" + "reference": "2cdae51a4a02c3fe2c38d42e25a7bb952e27b768" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/guzzle/guzzle/zipball/d1cbca76970939a9c2ced55b1e25ea26f34fc773", - "reference": "d1cbca76970939a9c2ced55b1e25ea26f34fc773", + "url": "https://api.github.com/repos/guzzle/guzzle/zipball/2cdae51a4a02c3fe2c38d42e25a7bb952e27b768", + "reference": "2cdae51a4a02c3fe2c38d42e25a7bb952e27b768", "shasum": "" }, "require": { "ext-json": "*", - "guzzlehttp/promises": "^3.0.1", - "guzzlehttp/psr7": "^3.0", + "guzzlehttp/promises": "^3.0.2", + "guzzlehttp/psr7": "^3.1", "php": "^7.4 || ^8.0", "psr/http-client": "^1.0", "psr/http-factory": "^1.0", @@ -2867,7 +2867,7 @@ ], "support": { "issues": "https://github.com/guzzle/guzzle/issues", - "source": "https://github.com/guzzle/guzzle/tree/8.0.2" + "source": "https://github.com/guzzle/guzzle/tree/8.1.0" }, "funding": [ { @@ -2883,20 +2883,20 @@ "type": "tidelift" } ], - "time": "2026-08-05T19:50:26+00:00" + "time": "2026-08-24T11:07:02+00:00" }, { "name": "guzzlehttp/promises", - "version": "3.0.1", + "version": "3.0.2", "source": { "type": "git", "url": "https://github.com/guzzle/promises.git", - "reference": "64f38b87fa7d371853804161bfc701c9bc2cc00a" + "reference": "42118e66a53c492effaf92bc357e931985d5c6f9" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/guzzle/promises/zipball/64f38b87fa7d371853804161bfc701c9bc2cc00a", - "reference": "64f38b87fa7d371853804161bfc701c9bc2cc00a", + "url": "https://api.github.com/repos/guzzle/promises/zipball/42118e66a53c492effaf92bc357e931985d5c6f9", + "reference": "42118e66a53c492effaf92bc357e931985d5c6f9", "shasum": "" }, "require": { @@ -2950,7 +2950,7 @@ ], "support": { "issues": "https://github.com/guzzle/promises/issues", - "source": "https://github.com/guzzle/promises/tree/3.0.1" + "source": "https://github.com/guzzle/promises/tree/3.0.2" }, "funding": [ { @@ -2966,20 +2966,20 @@ "type": "tidelift" } ], - "time": "2026-08-05T19:35:04+00:00" + "time": "2026-08-24T10:00:26+00:00" }, { "name": "guzzlehttp/psr7", - "version": "3.0.0", + "version": "3.1.0", "source": { "type": "git", "url": "https://github.com/guzzle/psr7.git", - "reference": "b094ded77ee97a6027ad6cf0e8c7b9f88381814c" + "reference": "a3059ba1a84c9139c4ae03cf0f45bea276c97c74" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/guzzle/psr7/zipball/b094ded77ee97a6027ad6cf0e8c7b9f88381814c", - "reference": "b094ded77ee97a6027ad6cf0e8c7b9f88381814c", + "url": "https://api.github.com/repos/guzzle/psr7/zipball/a3059ba1a84c9139c4ae03cf0f45bea276c97c74", + "reference": "a3059ba1a84c9139c4ae03cf0f45bea276c97c74", "shasum": "" }, "require": { @@ -3069,7 +3069,7 @@ ], "support": { "issues": "https://github.com/guzzle/psr7/issues", - "source": "https://github.com/guzzle/psr7/tree/3.0.0" + "source": "https://github.com/guzzle/psr7/tree/3.1.0" }, "funding": [ { @@ -3085,7 +3085,7 @@ "type": "tidelift" } ], - "time": "2026-07-20T13:48:31+00:00" + "time": "2026-08-24T11:02:13+00:00" }, { "name": "myclabs/deep-copy", @@ -3355,23 +3355,23 @@ }, { "name": "phpunit/php-file-iterator", - "version": "6.0.1", + "version": "6.0.2", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/php-file-iterator.git", - "reference": "3d1cd096ef6bea4bf2762ba586e35dbd317cbfd5" + "reference": "a248d1640ab059b075f53a2ef0f9856e864e06b5" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-file-iterator/zipball/3d1cd096ef6bea4bf2762ba586e35dbd317cbfd5", - "reference": "3d1cd096ef6bea4bf2762ba586e35dbd317cbfd5", + "url": "https://api.github.com/repos/sebastianbergmann/php-file-iterator/zipball/a248d1640ab059b075f53a2ef0f9856e864e06b5", + "reference": "a248d1640ab059b075f53a2ef0f9856e864e06b5", "shasum": "" }, "require": { "php": ">=8.3" }, "require-dev": { - "phpunit/phpunit": "^12.0" + "phpunit/phpunit": "^12.5.33" }, "type": "library", "extra": { @@ -3404,7 +3404,7 @@ "support": { "issues": "https://github.com/sebastianbergmann/php-file-iterator/issues", "security": "https://github.com/sebastianbergmann/php-file-iterator/security/policy", - "source": "https://github.com/sebastianbergmann/php-file-iterator/tree/6.0.1" + "source": "https://github.com/sebastianbergmann/php-file-iterator/tree/6.0.2" }, "funding": [ { @@ -3424,7 +3424,7 @@ "type": "tidelift" } ], - "time": "2026-02-02T14:04:18+00:00" + "time": "2026-08-25T14:40:53+00:00" }, { "name": "phpunit/php-invoker", @@ -3973,24 +3973,24 @@ }, { "name": "sebastian/diff", - "version": "7.0.0", + "version": "7.0.1", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/diff.git", - "reference": "7ab1ea946c012266ca32390913653d844ecd085f" + "reference": "cd4cabe39f8a4e8ee6818ba99f10a05561ea4ad6" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/diff/zipball/7ab1ea946c012266ca32390913653d844ecd085f", - "reference": "7ab1ea946c012266ca32390913653d844ecd085f", + "url": "https://api.github.com/repos/sebastianbergmann/diff/zipball/cd4cabe39f8a4e8ee6818ba99f10a05561ea4ad6", + "reference": "cd4cabe39f8a4e8ee6818ba99f10a05561ea4ad6", "shasum": "" }, "require": { "php": ">=8.3" }, "require-dev": { - "phpunit/phpunit": "^12.0", - "symfony/process": "^7.2" + "phpunit/phpunit": "^12.5.33", + "symfony/process": "^7.4.17" }, "type": "library", "extra": { @@ -4028,15 +4028,27 @@ "support": { "issues": "https://github.com/sebastianbergmann/diff/issues", "security": "https://github.com/sebastianbergmann/diff/security/policy", - "source": "https://github.com/sebastianbergmann/diff/tree/7.0.0" + "source": "https://github.com/sebastianbergmann/diff/tree/7.0.1" }, "funding": [ { "url": "https://github.com/sebastianbergmann", "type": "github" + }, + { + "url": "https://liberapay.com/sebastianbergmann", + "type": "liberapay" + }, + { + "url": "https://thanks.dev/u/gh/sebastianbergmann", + "type": "thanks_dev" + }, + { + "url": "https://tidelift.com/funding/github/packagist/sebastian/diff", + "type": "tidelift" } ], - "time": "2025-02-07T04:55:46+00:00" + "time": "2026-08-25T15:35:54+00:00" }, { "name": "sebastian/environment", diff --git a/upload/api/vendor/composer/installed.json b/upload/api/vendor/composer/installed.json index 76c5031a..8ce6afa0 100644 --- a/upload/api/vendor/composer/installed.json +++ b/upload/api/vendor/composer/installed.json @@ -131,17 +131,17 @@ }, { "name": "laravel/serializable-closure", - "version": "v2.0.15", - "version_normalized": "2.0.15.0", + "version": "v2.0.16", + "version_normalized": "2.0.16.0", "source": { "type": "git", "url": "https://github.com/laravel/serializable-closure.git", - "reference": "dccd8bcb851bb03fcc005df650b708b57cc52661" + "reference": "7cfc24e4fa2cca045fb8dd2a797a2b2b13b655ed" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/laravel/serializable-closure/zipball/dccd8bcb851bb03fcc005df650b708b57cc52661", - "reference": "dccd8bcb851bb03fcc005df650b708b57cc52661", + "url": "https://api.github.com/repos/laravel/serializable-closure/zipball/7cfc24e4fa2cca045fb8dd2a797a2b2b13b655ed", + "reference": "7cfc24e4fa2cca045fb8dd2a797a2b2b13b655ed", "shasum": "" }, "require": { @@ -154,7 +154,7 @@ "phpstan/phpstan": "^2.0", "symfony/var-dumper": "^6.2.0|^7.0.0|^8.0.0" }, - "time": "2026-07-21T16:49:22+00:00", + "time": "2026-08-18T20:28:54+00:00", "type": "library", "extra": { "branch-alias": { @@ -2778,17 +2778,17 @@ }, { "name": "zircote/swagger-php", - "version": "6.6.0", - "version_normalized": "6.6.0.0", + "version": "6.7.0", + "version_normalized": "6.7.0.0", "source": { "type": "git", "url": "https://github.com/zircote/swagger-php.git", - "reference": "cc81abcfffec8b2f993db64013ea3b49679341c9" + "reference": "af0a8de6c4b6780e8e07d06ee0c7da538b5f1e46" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/zircote/swagger-php/zipball/cc81abcfffec8b2f993db64013ea3b49679341c9", - "reference": "cc81abcfffec8b2f993db64013ea3b49679341c9", + "url": "https://api.github.com/repos/zircote/swagger-php/zipball/af0a8de6c4b6780e8e07d06ee0c7da538b5f1e46", + "reference": "af0a8de6c4b6780e8e07d06ee0c7da538b5f1e46", "shasum": "" }, "require": { @@ -2812,7 +2812,7 @@ "phpunit/phpunit": "^11.5 || >=12.5.22", "rector/rector": "^2.3" }, - "time": "2026-08-18T03:19:28+00:00", + "time": "2026-08-24T21:55:54+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.6.0" + "source": "https://github.com/zircote/swagger-php/tree/6.7.0" }, "funding": [ { diff --git a/upload/api/vendor/composer/installed.php b/upload/api/vendor/composer/installed.php index 8b1701a9..2c12ce99 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' => 'cc9a2299dc5b02aa1251034830e4aafc7dcc6cd7', + 'reference' => '0e0679287be9bcf1be4741fd8a7e48e12e8a3723', 'type' => 'library', 'install_path' => __DIR__ . '/../../', 'aliases' => array(), @@ -22,7 +22,7 @@ 'devcraftclub/dle-api' => array( 'pretty_version' => 'dev-master', 'version' => 'dev-master', - 'reference' => 'cc9a2299dc5b02aa1251034830e4aafc7dcc6cd7', + 'reference' => '0e0679287be9bcf1be4741fd8a7e48e12e8a3723', 'type' => 'library', 'install_path' => __DIR__ . '/../../', 'aliases' => array(), @@ -38,9 +38,9 @@ 'dev_requirement' => false, ), 'laravel/serializable-closure' => array( - 'pretty_version' => 'v2.0.15', - 'version' => '2.0.15.0', - 'reference' => 'dccd8bcb851bb03fcc005df650b708b57cc52661', + 'pretty_version' => 'v2.0.16', + 'version' => '2.0.16.0', + 'reference' => '7cfc24e4fa2cca045fb8dd2a797a2b2b13b655ed', 'type' => 'library', 'install_path' => __DIR__ . '/../laravel/serializable-closure', 'aliases' => array(), @@ -405,9 +405,9 @@ 'dev_requirement' => false, ), 'zircote/swagger-php' => array( - 'pretty_version' => '6.6.0', - 'version' => '6.6.0.0', - 'reference' => 'cc81abcfffec8b2f993db64013ea3b49679341c9', + 'pretty_version' => '6.7.0', + 'version' => '6.7.0.0', + 'reference' => 'af0a8de6c4b6780e8e07d06ee0c7da538b5f1e46', 'type' => 'library', 'install_path' => __DIR__ . '/../zircote/swagger-php', 'aliases' => array(), diff --git a/upload/api/vendor/laravel/serializable-closure/src/Serializers/Signed.php b/upload/api/vendor/laravel/serializable-closure/src/Serializers/Signed.php index 16f9593f..8cda65f3 100644 --- a/upload/api/vendor/laravel/serializable-closure/src/Serializers/Signed.php +++ b/upload/api/vendor/laravel/serializable-closure/src/Serializers/Signed.php @@ -57,6 +57,8 @@ public function getClosure() * Get the serializable representation of the closure. * * @return array + * + * @throws \Laravel\SerializableClosure\Exceptions\MissingSecretKeyException */ public function __serialize() { @@ -76,10 +78,15 @@ public function __serialize() * @return void * * @throws \Laravel\SerializableClosure\Exceptions\InvalidSignatureException + * @throws \Laravel\SerializableClosure\Exceptions\MissingSecretKeyException */ public function __unserialize($signature) { - if (static::$signer && ! static::$signer->verify($signature)) { + if (! static::$signer) { + throw new MissingSecretKeyException(); + } + + if (! static::$signer->verify($signature)) { throw new InvalidSignatureException(); } diff --git a/upload/api/vendor/zircote/swagger-php/bin/openapi b/upload/api/vendor/zircote/swagger-php/bin/openapi index d769a30e..26a5a43f 100755 --- a/upload/api/vendor/zircote/swagger-php/bin/openapi +++ b/upload/api/vendor/zircote/swagger-php/bin/openapi @@ -2,13 +2,13 @@ getDeclaringFunction()->getName() === '__construct') + || ($reflector instanceof \ReflectionParameter && $reflector->getDeclaringFunction()->getName() === '__construct') ) { $hasProperty = $hasInstance($translated, OA\Property::class); - if ($hasSchema && !$hasProperty) { + if ($hasEncoding && !$hasProperty) { + $translated = [new OA\Property\Encoded(), ...$translated]; + } elseif ($hasSchema && !$hasProperty) { $translated = [new OA\Property(), ...$translated]; } } diff --git a/upload/api/vendor/zircote/swagger-php/src/Augmenter/Cleanup.php b/upload/api/vendor/zircote/swagger-php/src/Augmenter/Cleanup.php index e6854e2d..91f52e89 100644 --- a/upload/api/vendor/zircote/swagger-php/src/Augmenter/Cleanup.php +++ b/upload/api/vendor/zircote/swagger-php/src/Augmenter/Cleanup.php @@ -6,7 +6,7 @@ namespace OpenApi\Augmenter; -use OpenApi\AttributeInterface; +use OpenApi\Contracts\AttributeInterface; use OpenApi\Spec as OA; use OpenApi\Specification; use OpenApi\Utils\PipeInterface; diff --git a/upload/api/vendor/zircote/swagger-php/src/Augmenter/Docblocks.php b/upload/api/vendor/zircote/swagger-php/src/Augmenter/Docblocks.php index 1784b0d5..1a77bcad 100644 --- a/upload/api/vendor/zircote/swagger-php/src/Augmenter/Docblocks.php +++ b/upload/api/vendor/zircote/swagger-php/src/Augmenter/Docblocks.php @@ -6,7 +6,7 @@ namespace OpenApi\Augmenter; -use OpenApi\AttributeInterface; +use OpenApi\Contracts\AttributeInterface; use OpenApi\Spec as OA; use OpenApi\Specification; use OpenApi\Undefined; diff --git a/upload/api/vendor/zircote/swagger-php/src/Augmenter/Inheritance/Schemas.php b/upload/api/vendor/zircote/swagger-php/src/Augmenter/Inheritance/Schemas.php index 352363e9..a256a38a 100644 --- a/upload/api/vendor/zircote/swagger-php/src/Augmenter/Inheritance/Schemas.php +++ b/upload/api/vendor/zircote/swagger-php/src/Augmenter/Inheritance/Schemas.php @@ -6,9 +6,9 @@ namespace OpenApi\Augmenter\Inheritance; -use OpenApi\ComponentIndex; use OpenApi\Spec as OA; use OpenApi\Specification; +use OpenApi\Specification\ComponentIndex; use OpenApi\Utils\AttributeFactory; /** diff --git a/upload/api/vendor/zircote/swagger-php/src/Augmenter/MediaTypes.php b/upload/api/vendor/zircote/swagger-php/src/Augmenter/MediaTypes.php index 5ce2b7b2..fb26945a 100644 --- a/upload/api/vendor/zircote/swagger-php/src/Augmenter/MediaTypes.php +++ b/upload/api/vendor/zircote/swagger-php/src/Augmenter/MediaTypes.php @@ -8,14 +8,15 @@ use OpenApi\Spec as OA; use OpenApi\Specification; +use OpenApi\Specification\ComponentIndex; use OpenApi\Utils\PipeInterface; /** - * Re-keys MediaType encoding lists by property name. + * Promotes property encodings and re-keys MediaType encoding lists by property name. * - * The assembler collects Encoding objects as a flat list via contained(). - * The compiler expects them as an associative array keyed by the property name - * the encoding applies to. + * Promotes `OA\Encoding` definitions from `OA\Property\Encoded` properties to their + * parent MediaType, then re-keys the encoding list as an associative array keyed by + * property name (the format the compiler expects). * * @implements PipeInterface */ @@ -23,7 +24,9 @@ class MediaTypes implements PipeInterface { public function __invoke(mixed $payload): mixed { - $this->processMediaTypes($payload); + $index = $payload->buildComponentIndex(); + $this->mergePropertyEncodings($payload, $index); + $this->rekeyMediaTypeEncodings($payload); return null; } @@ -33,7 +36,40 @@ public function group(): string|\BackedEnum return Group::Augment; } - protected function processMediaTypes(Specification $specification): void + protected function mergePropertyEncodings(Specification $specification, ComponentIndex $index): void + { + $specification->getWalker()->visit(OA\MediaType::class, function (OA\MediaType $mediaType) use ($index): void { + if (!$mediaType->schema instanceof OA\Schema) { + return; + } + + if ($mediaType->schema->ref !== null) { + $refSchema = $index->findSchema($mediaType->schema->ref); + if ($refSchema instanceof OA\Schema && $refSchema->properties !== null) { + $this->mergeEncoded($mediaType, $refSchema->properties); + } + } elseif ($mediaType->schema->properties !== null) { + $this->mergeEncoded($mediaType, $mediaType->schema->properties); + } + }); + } + + /** + * @param list $properties + */ + protected function mergeEncoded(OA\MediaType $mediaType, array $properties): void + { + foreach ($properties as $property) { + if ($property instanceof OA\Property\Encoded) { + $encoding = $property->encoding; + $encoding->encoding ??= $property->property; + $mediaType->encoding ??= []; + $mediaType->encoding[$encoding->encoding] = $encoding; + } + } + } + + protected function rekeyMediaTypeEncodings(Specification $specification): void { foreach ($specification->operations as $operation) { if ($operation->requestBody instanceof OA\RequestBody) { diff --git a/upload/api/vendor/zircote/swagger-php/src/Augmenter/Refs.php b/upload/api/vendor/zircote/swagger-php/src/Augmenter/Refs.php index 0b962958..cf20a596 100644 --- a/upload/api/vendor/zircote/swagger-php/src/Augmenter/Refs.php +++ b/upload/api/vendor/zircote/swagger-php/src/Augmenter/Refs.php @@ -6,7 +6,7 @@ namespace OpenApi\Augmenter; -use OpenApi\AttributeInterface; +use OpenApi\Contracts\AttributeInterface; use OpenApi\Spec as OA; use OpenApi\Specification; use OpenApi\Utils\PipeInterface; @@ -73,6 +73,7 @@ protected function resolveFQCNRefs(Specification $specification, array $refMap): if (!property_exists($attribute, 'ref') || $attribute->ref === null || str_starts_with($attribute->ref, '#/')) { return; } + if (isset($refMap[$attribute->ref])) { $attribute->ref = $refMap[$attribute->ref]; } else { diff --git a/upload/api/vendor/zircote/swagger-php/src/Augmenter/Shortcuts.php b/upload/api/vendor/zircote/swagger-php/src/Augmenter/Shortcuts.php index e552626e..70ed5648 100644 --- a/upload/api/vendor/zircote/swagger-php/src/Augmenter/Shortcuts.php +++ b/upload/api/vendor/zircote/swagger-php/src/Augmenter/Shortcuts.php @@ -6,7 +6,7 @@ namespace OpenApi\Augmenter; -use OpenApi\AttributeInterface; +use OpenApi\Contracts\AttributeInterface; use OpenApi\Spec as OA; use OpenApi\Specification; use OpenApi\Undefined; diff --git a/upload/api/vendor/zircote/swagger-php/src/Builder.php b/upload/api/vendor/zircote/swagger-php/src/Builder.php index e8ec95cc..2fa19f33 100644 --- a/upload/api/vendor/zircote/swagger-php/src/Builder.php +++ b/upload/api/vendor/zircote/swagger-php/src/Builder.php @@ -8,6 +8,7 @@ use OpenApi\Builder\Mode; use OpenApi\Builder\Result; +use OpenApi\Contracts\CompilerInterface; use OpenApi\Utils\AttributeFactory; use OpenApi\Utils\CollectingLogger; use OpenApi\Utils\PipeInterface; diff --git a/upload/api/vendor/zircote/swagger-php/src/Builder/Result.php b/upload/api/vendor/zircote/swagger-php/src/Builder/Result.php index 39b287b1..99214cbd 100644 --- a/upload/api/vendor/zircote/swagger-php/src/Builder/Result.php +++ b/upload/api/vendor/zircote/swagger-php/src/Builder/Result.php @@ -71,9 +71,17 @@ public function specification(): ?Specification return $this->specification; } + /** + * Whether a document was produced and no errors were reported. + * + * Mirrors the exit code of the console command: warnings do not make a + * result invalid, errors do. + */ public function isValid(): bool { - return $this->openApi instanceof OpenApi || $this->specOutput !== null; + $generated = $this->openApi instanceof OpenApi || $this->specOutput !== null; + + return $generated && $this->errors() === []; } /** 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 df838966..07b3cad7 100644 --- a/upload/api/vendor/zircote/swagger-php/src/Compiler/OpenApi30Compiler.php +++ b/upload/api/vendor/zircote/swagger-php/src/Compiler/OpenApi30Compiler.php @@ -96,7 +96,7 @@ protected function compileLicense(OA\License $license): array * Compile schema using OAS 3.0 / JSON Schema draft-04 semantics. */ #[\Override] - protected function compileSchema(OA\Schema|string $schema): array + protected function compileSchema(OA\Schema|string $schema): array|\stdClass { if (is_string($schema)) { return ['$ref' => $schema]; @@ -214,7 +214,7 @@ protected function compileSchema(OA\Schema|string $schema): array $result['enum'] = [$schema->const]; } - return $result; + return $result ?: new \stdClass(); } #[\Override] 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 da093834..5ff8b5a7 100644 --- a/upload/api/vendor/zircote/swagger-php/src/Compiler/OpenApi31Compiler.php +++ b/upload/api/vendor/zircote/swagger-php/src/Compiler/OpenApi31Compiler.php @@ -6,7 +6,7 @@ namespace OpenApi\Compiler; -use OpenApi\CompilerInterface; +use OpenApi\Contracts\CompilerInterface; use OpenApi\Spec as OA; use OpenApi\Specification; use OpenApi\Undefined; @@ -406,7 +406,7 @@ protected function compileLink(OA\Link $link): array ], $link); } - protected function compileSchema(OA\Schema|string $schema): array + protected function compileSchema(OA\Schema|string $schema): array|\stdClass { if (is_string($schema)) { return ['$ref' => $schema]; @@ -521,7 +521,7 @@ protected function compileSchema(OA\Schema|string $schema): array $result['example'] = $schema->example; } - return $result; + return $result ?: new \stdClass(); } /** diff --git a/upload/api/vendor/zircote/swagger-php/src/Console/GenerateCommand.php b/upload/api/vendor/zircote/swagger-php/src/Console/GenerateCommand.php index 0d67efb0..f3fc958b 100644 --- a/upload/api/vendor/zircote/swagger-php/src/Console/GenerateCommand.php +++ b/upload/api/vendor/zircote/swagger-php/src/Console/GenerateCommand.php @@ -42,7 +42,7 @@ public function __invoke(#[MapInput] GenerateInput $input, SymfonyStyle $io): in if ($input->defaults) { $io->title('Default config'); - $io->writeln(json_encode((new Generator())->getDefaultConfig(), JSON_PRETTY_PRINT)); + $io->writeln(json_encode($this->getDefaultConfig($input), JSON_PRETTY_PRINT)); return 0; } @@ -67,6 +67,21 @@ public function __invoke(#[MapInput] GenerateInput $input, SymfonyStyle $io): in return $this->logger->hasErrored() ? 1 : 0; } + /** + * The config keys `--config` accepts; these differ per mode. + * + * Mirrors the routing in {@see self::generate()}: spec mode configures the + * augmenter pipeline, classic and hybrid configure the Generator. + * + * @return array + */ + protected function getDefaultConfig(GenerateInput $input): array + { + return $input->mode->isSpec() + ? (new Builder())->getAugmenters()->getConfig() + : (new Generator())->getDefaultConfig(); + } + protected function generate(GenerateInput $input): Result { $builder = (new Builder()) diff --git a/upload/api/vendor/zircote/swagger-php/src/Console/GenerateInput.php b/upload/api/vendor/zircote/swagger-php/src/Console/GenerateInput.php index 24adbf64..0df0be4c 100644 --- a/upload/api/vendor/zircote/swagger-php/src/Console/GenerateInput.php +++ b/upload/api/vendor/zircote/swagger-php/src/Console/GenerateInput.php @@ -16,7 +16,7 @@ class GenerateInput #[Argument('Source path(s) to scan')] public array $paths; - #[Option('Generator/Augmenter config (e.g. -c operationId.hash=false)', shortcut: 'c')] + #[Option('Generator/Augmenter config; keys differ per mode, see -D (e.g. -c operationId.hash=false)', shortcut: 'c')] public array $config = []; #[Option('Show default config', shortcut: 'D')] diff --git a/upload/api/vendor/zircote/swagger-php/src/AttributeInterface.php b/upload/api/vendor/zircote/swagger-php/src/Contracts/AttributeInterface.php similarity index 99% rename from upload/api/vendor/zircote/swagger-php/src/AttributeInterface.php rename to upload/api/vendor/zircote/swagger-php/src/Contracts/AttributeInterface.php index d152dbee..3695b1f0 100644 --- a/upload/api/vendor/zircote/swagger-php/src/AttributeInterface.php +++ b/upload/api/vendor/zircote/swagger-php/src/Contracts/AttributeInterface.php @@ -4,7 +4,7 @@ * @license Apache 2.0 */ -namespace OpenApi; +namespace OpenApi\Contracts; use OpenApi\Utils\SourceLocation; diff --git a/upload/api/vendor/zircote/swagger-php/src/AttributeTranslatorInterface.php b/upload/api/vendor/zircote/swagger-php/src/Contracts/AttributeTranslatorInterface.php similarity index 98% rename from upload/api/vendor/zircote/swagger-php/src/AttributeTranslatorInterface.php rename to upload/api/vendor/zircote/swagger-php/src/Contracts/AttributeTranslatorInterface.php index d1637e1e..9c3dbc5b 100644 --- a/upload/api/vendor/zircote/swagger-php/src/AttributeTranslatorInterface.php +++ b/upload/api/vendor/zircote/swagger-php/src/Contracts/AttributeTranslatorInterface.php @@ -4,7 +4,7 @@ * @license Apache 2.0 */ -namespace OpenApi; +namespace OpenApi\Contracts; /** * Contract for creating raw attributes and translating them into `AttributeInterface` instances. diff --git a/upload/api/vendor/zircote/swagger-php/src/CompilerInterface.php b/upload/api/vendor/zircote/swagger-php/src/Contracts/CompilerInterface.php similarity index 93% rename from upload/api/vendor/zircote/swagger-php/src/CompilerInterface.php rename to upload/api/vendor/zircote/swagger-php/src/Contracts/CompilerInterface.php index 548f38c1..6cb7ec3f 100644 --- a/upload/api/vendor/zircote/swagger-php/src/CompilerInterface.php +++ b/upload/api/vendor/zircote/swagger-php/src/Contracts/CompilerInterface.php @@ -4,7 +4,9 @@ * @license Apache 2.0 */ -namespace OpenApi; +namespace OpenApi\Contracts; + +use OpenApi\Specification; /** * Compiles a Specification into a versioned OpenAPI document. diff --git a/upload/api/vendor/zircote/swagger-php/src/Spec/AbstractAttribute.php b/upload/api/vendor/zircote/swagger-php/src/Spec/AbstractAttribute.php index 0bb853b9..0205d4af 100644 --- a/upload/api/vendor/zircote/swagger-php/src/Spec/AbstractAttribute.php +++ b/upload/api/vendor/zircote/swagger-php/src/Spec/AbstractAttribute.php @@ -6,7 +6,7 @@ namespace OpenApi\Spec; -use OpenApi\AttributeInterface; +use OpenApi\Contracts\AttributeInterface; use OpenApi\Utils\SourceLocation; abstract class AbstractAttribute implements AttributeInterface diff --git a/upload/api/vendor/zircote/swagger-php/src/Spec/Encoding.php b/upload/api/vendor/zircote/swagger-php/src/Spec/Encoding.php index 03c68421..79378ad2 100644 --- a/upload/api/vendor/zircote/swagger-php/src/Spec/Encoding.php +++ b/upload/api/vendor/zircote/swagger-php/src/Spec/Encoding.php @@ -11,7 +11,7 @@ * * @see [Encoding Object](https://spec.openapis.org/oas/v3.1.1.html#encoding-object) */ -#[\Attribute(\Attribute::IS_REPEATABLE)] +#[\Attribute(\Attribute::TARGET_PROPERTY | \Attribute::IS_REPEATABLE)] class Encoding extends AbstractAttribute { public ?string $style = null; @@ -42,7 +42,10 @@ public function __construct( public function merge(): array { - return [MediaType::class => 'encoding[]']; + return [ + MediaType::class => 'encoding[]', + Property\Encoded::class => 'encoding', + ]; } public function contained(): array diff --git a/upload/api/vendor/zircote/swagger-php/src/Spec/Property/Encoded.php b/upload/api/vendor/zircote/swagger-php/src/Spec/Property/Encoded.php new file mode 100644 index 00000000..2c8580ae --- /dev/null +++ b/upload/api/vendor/zircote/swagger-php/src/Spec/Property/Encoded.php @@ -0,0 +1,54 @@ +|null $x Vendor extensions (x-* properties) + * @param list|null $attachables Reusable custom attachable attributes + */ + public function __construct( + ?string $property = null, + ?OA\Schema $schema = null, + ?OA\Encoding $encoding = null, + ?array $x = null, + ?array $attachables = null, + ) { + parent::__construct(property: $property, schema: $schema, x: $x, attachables: $attachables); + + $this->encoding = $encoding; + } + + public function merge(): array + { + return []; + } + + public function contained(): array + { + return [ + OA\Schema::class => 'properties[]', + ]; + } +} diff --git a/upload/api/vendor/zircote/swagger-php/src/Spec/Schema/Items.php b/upload/api/vendor/zircote/swagger-php/src/Spec/Schema/Items.php index 53ebd92a..3b663333 100644 --- a/upload/api/vendor/zircote/swagger-php/src/Spec/Schema/Items.php +++ b/upload/api/vendor/zircote/swagger-php/src/Spec/Schema/Items.php @@ -24,12 +24,13 @@ * * #[OA\Schema] * class Pet { - * #[OA\Property] * #[OA\Schema\Items(ref: MyModel::class)] * public array $names; * } * - * The `Shortcuts` augmenter wraps this into `OA\Schema(type: 'array', items: ...)` automatically. + * Since Items extends Schema, the implicit `OA\Property` shortcut applies — no explicit + * `#[OA\Property]` is needed. The `Shortcuts` augmenter wraps this into + * `OA\Schema(type: 'array', items: ...)` automatically. * * @see [Schema Object](https://spec.openapis.org/oas/v3.1.1.html#schema-object) */ diff --git a/upload/api/vendor/zircote/swagger-php/src/Specification.php b/upload/api/vendor/zircote/swagger-php/src/Specification.php index ac9192f8..19eb1f7d 100644 --- a/upload/api/vendor/zircote/swagger-php/src/Specification.php +++ b/upload/api/vendor/zircote/swagger-php/src/Specification.php @@ -6,7 +6,9 @@ namespace OpenApi; +use OpenApi\Contracts\AttributeInterface; use OpenApi\Spec as OA; +use OpenApi\Specification\ComponentIndex; use OpenApi\Utils\SpecificationWalker; /** diff --git a/upload/api/vendor/zircote/swagger-php/src/ComponentIndex.php b/upload/api/vendor/zircote/swagger-php/src/Specification/ComponentIndex.php similarity index 97% rename from upload/api/vendor/zircote/swagger-php/src/ComponentIndex.php rename to upload/api/vendor/zircote/swagger-php/src/Specification/ComponentIndex.php index 8c0ef61c..523e53f7 100644 --- a/upload/api/vendor/zircote/swagger-php/src/ComponentIndex.php +++ b/upload/api/vendor/zircote/swagger-php/src/Specification/ComponentIndex.php @@ -4,9 +4,11 @@ * @license Apache 2.0 */ -namespace OpenApi; +namespace OpenApi\Specification; +use OpenApi\Contracts\AttributeInterface; use OpenApi\Spec as OA; +use OpenApi\Specification; /** * Resolves `$ref` values to their corresponding component objects. @@ -31,8 +33,7 @@ class ComponentIndex 'examples' => 'examples', ]; - /** @var array|null> */ - protected array $indexes = []; + /** @var array|null> */ protected array $indexes = []; public function __construct( protected Specification $specification, 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 032e2261..053996c8 100644 --- a/upload/api/vendor/zircote/swagger-php/src/Utils/AttributeFactory.php +++ b/upload/api/vendor/zircote/swagger-php/src/Utils/AttributeFactory.php @@ -8,8 +8,8 @@ use OpenApi\Assembler\DefaultAttributeTranslator; use OpenApi\Assembler\OptionalPropertyAttributeTranslator; -use OpenApi\AttributeInterface; -use OpenApi\AttributeTranslatorInterface; +use OpenApi\Contracts\AttributeInterface; +use OpenApi\Contracts\AttributeTranslatorInterface; use OpenApi\OpenApiException; /** diff --git a/upload/api/vendor/zircote/swagger-php/src/Utils/Pipeline.php b/upload/api/vendor/zircote/swagger-php/src/Utils/Pipeline.php index a8f891c5..2658499e 100644 --- a/upload/api/vendor/zircote/swagger-php/src/Utils/Pipeline.php +++ b/upload/api/vendor/zircote/swagger-php/src/Utils/Pipeline.php @@ -80,26 +80,101 @@ public function process(mixed $payload) return $payload; } + /** + * Collect the configurable settings of all pipes, keyed by pipe name. + * + * A setting is considered configurable when a pipe exposes a `setX()` method + * for a property `x`; the reported value is that property's current value. + * Object valued properties (factories, resolvers) are treated as collaborators + * rather than config and are omitted. + * + * The result uses the same keys accepted by {@see self::configure()}. + * + * @return array> + */ + public function getConfig(): array + { + $config = []; + + $walker = function (callable $pipe) use (&$config): void { + $rc = new \ReflectionClass($pipe); + $settings = []; + + foreach ($rc->getMethods(\ReflectionMethod::IS_PUBLIC) as $method) { + if (!str_starts_with($method->getName(), 'set') || $method->getNumberOfParameters() !== 1) { + continue; + } + + // LoggerAwareInterface is plumbing, not config + if ($method->getName() === 'setLogger') { + continue; + } + + $name = lcfirst(substr($method->getName(), 3)); + if (!$rc->hasProperty($name)) { + continue; + } + + $property = $rc->getProperty($name); + $value = $property->isInitialized($pipe) ? $property->getValue($pipe) : null; + + if (is_object($value)) { + continue; + } + + $settings[$name] = $value; + } + + if ($settings !== []) { + $config[lcfirst($rc->getShortName())] = $settings; + } + }; + + $this->walk($walker); + + return $config; + } + + /** + * Apply config to the pipes in this pipeline. + * + * Keys that match no pipe, and options with no matching setter, are reported + * as warnings; they would otherwise be silently ignored. See {@see self::getConfig()} + * for the keys a pipeline accepts. + */ public function configure(array $config): void { $config = $this->normaliseConfig($config); + $applied = []; - $walker = function (callable $pipe) use ($config): void { + $walker = function (callable $pipe) use ($config, &$applied): void { $rc = new \ReflectionClass($pipe); // apply config $pipeKey = lcfirst($rc->getShortName()); - if (array_key_exists($pipeKey, $config)) { - foreach ($config[$pipeKey] as $name => $value) { - $setter = 'set' . ucfirst($name); - if (method_exists($pipe, $setter)) { - $pipe->{$setter}($value); - } + if (!array_key_exists($pipeKey, $config) || !is_array($config[$pipeKey])) { + return; + } + + $applied[$pipeKey] = true; + + foreach ($config[$pipeKey] as $name => $value) { + $setter = 'set' . ucfirst($name); + if (method_exists($pipe, $setter)) { + $pipe->{$setter}($value); + } else { + $this->logger->warning("Unknown config option '{$pipeKey}.{$name}'"); } } }; $this->walk($walker); + + foreach (array_keys($config) as $pipeKey) { + if (!isset($applied[$pipeKey])) { + $this->logger->warning("Unknown config key '{$pipeKey}'; no matching pipe in this pipeline"); + } + } } /** diff --git a/upload/api/vendor/zircote/swagger-php/src/Utils/SpecificationWalker.php b/upload/api/vendor/zircote/swagger-php/src/Utils/SpecificationWalker.php index b4877e10..e90e2507 100644 --- a/upload/api/vendor/zircote/swagger-php/src/Utils/SpecificationWalker.php +++ b/upload/api/vendor/zircote/swagger-php/src/Utils/SpecificationWalker.php @@ -6,7 +6,7 @@ namespace OpenApi\Utils; -use OpenApi\AttributeInterface; +use OpenApi\Contracts\AttributeInterface; use OpenApi\Spec as OA; use OpenApi\Specification;