From 606a590b1013536d4854f14bb4b2139c1b877027 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C5=A0t=C4=9Bp=C3=A1n=20Zrn=C3=ADk?= Date: Fri, 19 Apr 2024 19:13:44 +0200 Subject: [PATCH] swagger-php 4.9 --- composer.lock | 61 +++++++++++++++--------------- src/PHPUnit/OpenApiSchemaCheck.php | 5 +++ src/ZweistOpenApiGenerator.php | 1 + 3 files changed, 36 insertions(+), 31 deletions(-) diff --git a/composer.lock b/composer.lock index d9df234..1ae6c96 100644 --- a/composer.lock +++ b/composer.lock @@ -1007,16 +1007,16 @@ }, { "name": "zircote/swagger-php", - "version": "4.8.7", + "version": "4.9.0", "source": { "type": "git", "url": "https://github.com/zircote/swagger-php.git", - "reference": "2357fafbb084be0f9eda7b5c1a659704fed65b28" + "reference": "b46a36d006f4db4d761995a5add1e7ab0386ed1d" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/zircote/swagger-php/zipball/2357fafbb084be0f9eda7b5c1a659704fed65b28", - "reference": "2357fafbb084be0f9eda7b5c1a659704fed65b28", + "url": "https://api.github.com/repos/zircote/swagger-php/zipball/b46a36d006f4db4d761995a5add1e7ab0386ed1d", + "reference": "b46a36d006f4db4d761995a5add1e7ab0386ed1d", "shasum": "" }, "require": { @@ -1082,9 +1082,9 @@ ], "support": { "issues": "https://github.com/zircote/swagger-php/issues", - "source": "https://github.com/zircote/swagger-php/tree/4.8.7" + "source": "https://github.com/zircote/swagger-php/tree/4.9.0" }, - "time": "2024-03-23T06:35:46+00:00" + "time": "2024-04-18T22:32:11+00:00" }, { "name": "zrnik/php-attribute-reflection", @@ -1559,16 +1559,16 @@ }, { "name": "phpstan/phpstan", - "version": "1.10.66", + "version": "1.10.67", "source": { "type": "git", "url": "https://github.com/phpstan/phpstan.git", - "reference": "94779c987e4ebd620025d9e5fdd23323903950bd" + "reference": "16ddbe776f10da6a95ebd25de7c1dbed397dc493" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phpstan/phpstan/zipball/94779c987e4ebd620025d9e5fdd23323903950bd", - "reference": "94779c987e4ebd620025d9e5fdd23323903950bd", + "url": "https://api.github.com/repos/phpstan/phpstan/zipball/16ddbe776f10da6a95ebd25de7c1dbed397dc493", + "reference": "16ddbe776f10da6a95ebd25de7c1dbed397dc493", "shasum": "" }, "require": { @@ -1611,13 +1611,9 @@ { "url": "https://github.com/phpstan", "type": "github" - }, - { - "url": "https://tidelift.com/funding/github/packagist/phpstan/phpstan", - "type": "tidelift" } ], - "time": "2024-03-28T16:17:31+00:00" + "time": "2024-04-16T07:22:02+00:00" }, { "name": "phpunit/php-code-coverage", @@ -1942,16 +1938,16 @@ }, { "name": "phpunit/phpunit", - "version": "10.5.17", + "version": "10.5.19", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/phpunit.git", - "reference": "c1f736a473d21957ead7e94fcc029f571895abf5" + "reference": "c726f0de022368f6ed103e452a765d3304a996a4" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/c1f736a473d21957ead7e94fcc029f571895abf5", - "reference": "c1f736a473d21957ead7e94fcc029f571895abf5", + "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/c726f0de022368f6ed103e452a765d3304a996a4", + "reference": "c726f0de022368f6ed103e452a765d3304a996a4", "shasum": "" }, "require": { @@ -2023,7 +2019,7 @@ "support": { "issues": "https://github.com/sebastianbergmann/phpunit/issues", "security": "https://github.com/sebastianbergmann/phpunit/security/policy", - "source": "https://github.com/sebastianbergmann/phpunit/tree/10.5.17" + "source": "https://github.com/sebastianbergmann/phpunit/tree/10.5.19" }, "funding": [ { @@ -2039,7 +2035,7 @@ "type": "tidelift" } ], - "time": "2024-04-05T04:39:01+00:00" + "time": "2024-04-17T14:06:18+00:00" }, { "name": "roave/security-advisories", @@ -2047,12 +2043,12 @@ "source": { "type": "git", "url": "https://github.com/Roave/SecurityAdvisories.git", - "reference": "31f373849a62ccfe23cba594e91b488e3ec2270b" + "reference": "16afe68c1b79917b4e8d8222a39ca4db31b63377" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/Roave/SecurityAdvisories/zipball/31f373849a62ccfe23cba594e91b488e3ec2270b", - "reference": "31f373849a62ccfe23cba594e91b488e3ec2270b", + "url": "https://api.github.com/repos/Roave/SecurityAdvisories/zipball/16afe68c1b79917b4e8d8222a39ca4db31b63377", + "reference": "16afe68c1b79917b4e8d8222a39ca4db31b63377", "shasum": "" }, "conflict": { @@ -2206,7 +2202,7 @@ "ezsystems/ezplatform-solr-search-engine": ">=1.7,<1.7.12|>=2,<2.0.2|>=3.3,<3.3.15", "ezsystems/ezplatform-user": ">=1,<1.0.1", "ezsystems/ezpublish-kernel": "<6.13.8.2-dev|>=7,<7.5.31", - "ezsystems/ezpublish-legacy": "<=2017.12.7.3|>=2018.6,<=2019.03.5.1", + "ezsystems/ezpublish-legacy": "<=2017.12.7.3|>=2018.06,<=2019.03.5.1", "ezsystems/platform-ui-assets-bundle": ">=4.2,<4.2.3", "ezsystems/repository-forms": ">=2.3,<2.3.2.1-dev|>=2.5,<2.5.15", "ezyang/htmlpurifier": "<4.1.1", @@ -2237,7 +2233,8 @@ "friendsofsymfony/oauth2-php": "<1.3", "friendsofsymfony/rest-bundle": ">=1.2,<1.2.2", "friendsofsymfony/user-bundle": ">=1.2,<1.3.5", - "friendsofsymfony1/symfony1": ">=1.1,<1.5.19", + "friendsofsymfony1/swiftmailer": ">=4,<5.4.13|>=6,<6.2.5", + "friendsofsymfony1/symfony1": ">=1.1,<1.15.19", "friendsoftypo3/mediace": ">=7.6.2,<7.6.5", "friendsoftypo3/openid": ">=4.5,<4.5.31|>=4.7,<4.7.16|>=6,<6.0.11|>=6.1,<6.1.6", "froala/wysiwyg-editor": "<3.2.7|>=4.0.1,<=4.1.3", @@ -2358,7 +2355,7 @@ "mantisbt/mantisbt": "<2.26.1", "marcwillmann/turn": "<0.3.3", "matyhtf/framework": "<3.0.6", - "mautic/core": "<4.3", + "mautic/core": "<4.4.12|>=5.0.0.0-alpha,<5.0.4", "mediawiki/core": "<1.36.2", "mediawiki/matomo": "<2.4.3", "mediawiki/semantic-media-wiki": "<4.0.2", @@ -2502,7 +2499,7 @@ "really-simple-plugins/complianz-gdpr": "<6.4.2", "redaxo/source": "<=5.15.1", "remdex/livehelperchat": "<4.29", - "reportico-web/reportico": "<=7.1.21", + "reportico-web/reportico": "<=8.1", "rhukster/dom-sanitizer": "<1.0.7", "rmccue/requests": ">=1.6,<1.8", "robrichards/xmlseclibs": ">=1,<3.0.4", @@ -2573,7 +2570,7 @@ "sumocoders/framework-user-bundle": "<1.4", "superbig/craft-audit": "<3.0.2", "swag/paypal": "<5.4.4", - "swiftmailer/swiftmailer": ">=4,<5.4.5", + "swiftmailer/swiftmailer": ">=4,<6.2.5", "swiftyedit/swiftyedit": "<1.2", "sylius/admin-bundle": ">=1,<1.0.17|>=1.1,<1.1.9|>=1.2,<1.2.2", "sylius/grid": ">=1,<1.1.19|>=1.2,<1.2.18|>=1.3,<1.3.13|>=1.4,<1.4.5|>=1.5,<1.5.1", @@ -2623,7 +2620,7 @@ "t3s/content-consent": "<1.0.3|>=2,<2.0.2", "tastyigniter/tastyigniter": "<3.3", "tcg/voyager": "<=1.4", - "tecnickcom/tcpdf": "<6.2.22", + "tecnickcom/tcpdf": "<6.7.4", "terminal42/contao-tablelookupwizard": "<3.3.5", "thelia/backoffice-default-template": ">=2.1,<2.1.2", "thelia/thelia": ">=2.1,<2.1.3", @@ -2631,6 +2628,7 @@ "thinkcmf/thinkcmf": "<=5.1.7", "thorsten/phpmyfaq": "<3.2.2", "tikiwiki/tiki-manager": "<=17.1", + "timber/timber": ">=0.16.6,<1.23.1|>=1.24,<1.24.1|>=2,<2.1", "tinymce/tinymce": "<7", "tinymighty/wiki-seo": "<1.2.2", "titon/framework": "<9.9.99", @@ -2684,6 +2682,7 @@ "wikimedia/parsoid": "<0.12.2", "willdurand/js-translation-bundle": "<2.1.1", "winter/wn-backend-module": "<1.2.4", + "winter/wn-dusk-plugin": "<2.1", "winter/wn-system-module": "<1.2.4", "wintercms/winter": "<=1.2.3", "woocommerce/woocommerce": "<6.6", @@ -2785,7 +2784,7 @@ "type": "tidelift" } ], - "time": "2024-04-09T19:04:27+00:00" + "time": "2024-04-18T17:04:22+00:00" }, { "name": "sebastian/cli-parser", diff --git a/src/PHPUnit/OpenApiSchemaCheck.php b/src/PHPUnit/OpenApiSchemaCheck.php index 6bb82b8..5ebf95e 100644 --- a/src/PHPUnit/OpenApiSchemaCheck.php +++ b/src/PHPUnit/OpenApiSchemaCheck.php @@ -8,6 +8,7 @@ use JsonSerializable; use OpenApi\Attributes\Property; use OpenApi\Attributes\Schema; +use OpenApi\Context; use OpenApi\Generator; use PHPUnit\Framework\ExpectationFailedException; use ReflectionClass; @@ -167,6 +168,7 @@ private function assertIsNotSchemaObject(object $noSchemaObject, ?string $messag public function assertIsSchemaObject(object $schemaObject, ?string $message = null): void { + Generator::$context ??= new Context(); $schemaAttributes = AttributeReflection::getClassAttributes(Schema::class, $schemaObject); $this->addToAssertionCount(1); @@ -186,6 +188,7 @@ public function assertIsSchemaObject(object $schemaObject, ?string $message = nu public function getPropertyAttribute(object $schemaObject, ReflectionProperty $reflectionProperty): Property { + Generator::$context ??= new Context(); $propertyAttributes = AttributeReflection::getPropertyAttributes( Property::class, $schemaObject, @@ -201,6 +204,7 @@ public function getPropertyAttribute(object $schemaObject, ReflectionProperty $r private function isSchemaProperty(object $schemaObject, ReflectionProperty $reflectionProperty): bool { + Generator::$context ??= new Context(); $propertyAttributes = AttributeReflection::getPropertyAttributes( Property::class, $schemaObject, @@ -212,6 +216,7 @@ private function isSchemaProperty(object $schemaObject, ReflectionProperty $refl private function isSchemaClass(object $schemaObject): bool { + Generator::$context ??= new Context(); $classAttributes = AttributeReflection::getClassAttributes( Schema::class, $schemaObject, diff --git a/src/ZweistOpenApiGenerator.php b/src/ZweistOpenApiGenerator.php index 379f70a..f10e1f9 100644 --- a/src/ZweistOpenApiGenerator.php +++ b/src/ZweistOpenApiGenerator.php @@ -25,6 +25,7 @@ public function __construct( parent::__construct($logger); $this->setVersion(OpenApi::VERSION_3_0_0); $this->addProcessor($this); + Generator::$context ??= new Context(); } // @phpstan-ignore-next-line