diff --git a/modules/openapi-generator/src/main/resources/php-flight/model_generic.mustache b/modules/openapi-generator/src/main/resources/php-flight/model_generic.mustache index 9748119501d..78b27f04d05 100644 --- a/modules/openapi-generator/src/main/resources/php-flight/model_generic.mustache +++ b/modules/openapi-generator/src/main/resources/php-flight/model_generic.mustache @@ -21,31 +21,31 @@ class {{classname}} {{#parentSchema}}extends {{{parent}}} {{/parentSchema}} impl return new self( {{#vars}} {{#isDateTime}} - isset($data['{{baseName}}']) ? new \DateTime($data['{{baseName}}']) : null{{^last}}, {{/last}} + isset($data['{{baseName}}']) ? new \DateTime($data['{{baseName}}']) : null{{^last}},{{/last}} {{/isDateTime}} {{#isEnum}} - isset($data['{{baseName}}']) ? {{enumName}}::tryFrom($data['{{baseName}}']) : null{{^last}}, {{/last}} + isset($data['{{baseName}}']) ? {{enumName}}::tryFrom($data['{{baseName}}']) : null{{^last}},{{/last}} {{/isEnum}} {{#isEnumRef}} - isset($data['{{baseName}}']) ? {{complexType}}::tryFrom($data['{{baseName}}']) : null{{^last}}, {{/last}} + isset($data['{{baseName}}']) ? {{complexType}}::tryFrom($data['{{baseName}}']) : null{{^last}},{{/last}} {{/isEnumRef}} {{#isModel}} - isset($data['{{baseName}}']) ? {{complexType}}::fromArray($data['{{baseName}}']) : null{{^last}}, {{/last}} + isset($data['{{baseName}}']) ? {{complexType}}::fromArray($data['{{baseName}}']) : null{{^last}},{{/last}} {{/isModel}} {{#isArray}} {{#items.isEnumRef}} - isset($data['{{baseName}}']) ? array_map(fn($item) => {{items.complexType}}::tryFrom($item), $data['{{baseName}}']) : null{{^last}}, {{/last}} + isset($data['{{baseName}}']) ? array_map(fn($item) => {{items.complexType}}::tryFrom($item), $data['{{baseName}}']) : null{{^last}},{{/last}} {{/items.isEnumRef}} {{#items.isModel}} - isset($data['{{baseName}}']) ? array_map(fn($item) => {{items.complexType}}::fromArray($item), $data['{{baseName}}']) : null{{^last}}, {{/last}} + isset($data['{{baseName}}']) ? array_map(fn($item) => {{items.complexType}}::fromArray($item), $data['{{baseName}}']) : null{{^last}},{{/last}} {{/items.isModel}} {{#items.isDateTime}} - isset($data['{{baseName}}']) ? array_map(fn($item) => new \DateTime($item), $data['{{baseName}}']) : null{{^last}}, {{/last}} + isset($data['{{baseName}}']) ? array_map(fn($item) => new \DateTime($item), $data['{{baseName}}']) : null{{^last}},{{/last}} {{/items.isDateTime}} {{^items.isEnumRef}} {{^items.isModel}} {{^items.isDateTime}} - $data['{{baseName}}'] ?? null{{^last}}, {{/last}} + $data['{{baseName}}'] ?? null{{^last}},{{/last}} {{/items.isDateTime}} {{/items.isModel}} {{/items.isEnumRef}} @@ -55,7 +55,7 @@ class {{classname}} {{#parentSchema}}extends {{{parent}}} {{/parentSchema}} impl {{^isModel}} {{^isArray}} {{^isDateTime}} - $data['{{baseName}}'] ?? null{{^last}}, {{/last}} + $data['{{baseName}}'] ?? null{{^last}},{{/last}} {{/isDateTime}} {{/isArray}} {{/isModel}} @@ -69,19 +69,19 @@ class {{classname}} {{#parentSchema}}extends {{{parent}}} {{/parentSchema}} impl return [ {{#vars}} {{#isDateTime}} - '{{baseName}}' => $this->{{name}}?->format('c'){{^last}}, {{/last}} + '{{baseName}}' => $this->{{name}}?->format('c'){{^last}},{{/last}} {{/isDateTime}} {{#isArray}} {{#items.isDateTime}} - '{{baseName}}' => $this->{{name}} ? array_map(fn($item) => $item->format('c'), $this->{{name}}) : null{{^last}}, {{/last}} + '{{baseName}}' => $this->{{name}} ? array_map(fn($item) => $item->format('c'), $this->{{name}}) : null{{^last}},{{/last}} {{/items.isDateTime}} {{^items.isDateTime}} - '{{baseName}}' => $this->{{name}}{{^last}}, {{/last}} + '{{baseName}}' => $this->{{name}}{{^last}},{{/last}} {{/items.isDateTime}} {{/isArray}} {{^isDateTime}} {{^isArray}} - '{{baseName}}' => $this->{{name}}{{^last}}, {{/last}} + '{{baseName}}' => $this->{{name}}{{^last}},{{/last}} {{/isArray}} {{/isDateTime}} {{/vars}} diff --git a/modules/openapi-generator/src/main/resources/php-flight/partial_header.mustache b/modules/openapi-generator/src/main/resources/php-flight/partial_header.mustache index 01bb4a845c9..37422da395f 100644 --- a/modules/openapi-generator/src/main/resources/php-flight/partial_header.mustache +++ b/modules/openapi-generator/src/main/resources/php-flight/partial_header.mustache @@ -7,8 +7,8 @@ * {{{.}}} * {{/appDescription}} - * {{#version}}The version of the OpenAPI document: {{{.}}}{{/version}} - * {{#infoEmail}}Contact: {{{.}}}{{/infoEmail}} + *{{#version}} The version of the OpenAPI document: {{{.}}}{{/version}} + *{{#infoEmail}} Contact: {{{.}}}{{/infoEmail}} * Generated by: https://github.com/openapitools/openapi-generator.git * */ diff --git a/modules/openapi-generator/src/main/resources/php-flight/register_routes.mustache b/modules/openapi-generator/src/main/resources/php-flight/register_routes.mustache index 1056f6be4c8..75cb1de7bd5 100644 --- a/modules/openapi-generator/src/main/resources/php-flight/register_routes.mustache +++ b/modules/openapi-generator/src/main/resources/php-flight/register_routes.mustache @@ -22,7 +22,7 @@ class RegisterRoutes { $r = \Flight::request(); {{^vendorExtensions.x-return-type-is-void}}$result = {{/vendorExtensions.x-return-type-is-void}}$handler->{{operationId}}( {{#vendorExtensions.x-nonFormParams}} - parseParam({{#isBodyParam}}json_decode($r->getBody(), true){{/isBodyParam}}{{#isQueryParam}}$r->query['{{baseName}}'] ?? null{{/isQueryParam}}{{#isPathParam}}${{paramName}}{{/isPathParam}}{{#isHeaderParam}}$r->getHeader('{{baseName}}'){{/isHeaderParam}}, '{{vendorExtensions.x-comment-type-escaped}}'){{^-last}}, {{/-last}} + parseParam({{#isBodyParam}}json_decode($r->getBody(), true){{/isBodyParam}}{{#isQueryParam}}$r->query['{{baseName}}'] ?? null{{/isQueryParam}}{{#isPathParam}}${{paramName}}{{/isPathParam}}{{#isHeaderParam}}$r->getHeader('{{baseName}}'){{/isHeaderParam}}, '{{vendorExtensions.x-comment-type-escaped}}'){{^-last}},{{/-last}} {{/vendorExtensions.x-nonFormParams}} ); {{^vendorExtensions.x-return-type-is-void}} @@ -42,7 +42,7 @@ class RegisterRoutes { $r = \Flight::request(); $handler->{{operationId}}Stream( {{#vendorExtensions.x-nonFormParams}} - parseParam({{#isBodyParam}}json_decode($r->getBody(), true){{/isBodyParam}}{{#isQueryParam}}$r->query['{{baseName}}'] ?? null{{/isQueryParam}}{{#isPathParam}}${{paramName}}{{/isPathParam}}{{#isHeaderParam}}$r->getHeader('{{baseName}}'){{/isHeaderParam}}, '{{vendorExtensions.x-comment-type-escaped}}'){{^-last}}, {{/-last}} + parseParam({{#isBodyParam}}json_decode($r->getBody(), true){{/isBodyParam}}{{#isQueryParam}}$r->query['{{baseName}}'] ?? null{{/isQueryParam}}{{#isPathParam}}${{paramName}}{{/isPathParam}}{{#isHeaderParam}}$r->getHeader('{{baseName}}'){{/isHeaderParam}}, '{{vendorExtensions.x-comment-type-escaped}}'){{^-last}},{{/-last}} {{/vendorExtensions.x-nonFormParams}} ); // ignore return value: streaming expected diff --git a/samples/server/petstore/php-flight/Model/ApiResponse.php b/samples/server/petstore/php-flight/Model/ApiResponse.php index 74549fc2cbd..e99564d9a10 100644 --- a/samples/server/petstore/php-flight/Model/ApiResponse.php +++ b/samples/server/petstore/php-flight/Model/ApiResponse.php @@ -16,7 +16,7 @@ * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. * * The version of the OpenAPI document: 1.0.0 - * + * * Generated by: https://github.com/openapitools/openapi-generator.git * */ @@ -76,17 +76,17 @@ class ApiResponse implements \JsonSerializable public static function fromArray(array $data): self { return new self( - $data['code'] ?? null, - $data['type'] ?? null, - $data['message'] ?? null, + $data['code'] ?? null, + $data['type'] ?? null, + $data['message'] ?? null, ); } public function jsonSerialize(): mixed { return [ - 'code' => $this->code, - 'type' => $this->type, - 'message' => $this->message, + 'code' => $this->code, + 'type' => $this->type, + 'message' => $this->message, ]; } } diff --git a/samples/server/petstore/php-flight/Model/Category.php b/samples/server/petstore/php-flight/Model/Category.php index 4f3f6e9d81b..fa4cbbc8332 100644 --- a/samples/server/petstore/php-flight/Model/Category.php +++ b/samples/server/petstore/php-flight/Model/Category.php @@ -16,7 +16,7 @@ * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. * * The version of the OpenAPI document: 1.0.0 - * + * * Generated by: https://github.com/openapitools/openapi-generator.git * */ @@ -67,15 +67,15 @@ class Category implements \JsonSerializable public static function fromArray(array $data): self { return new self( - $data['id'] ?? null, - $data['name'] ?? null, + $data['id'] ?? null, + $data['name'] ?? null, ); } public function jsonSerialize(): mixed { return [ - 'id' => $this->id, - 'name' => $this->name, + 'id' => $this->id, + 'name' => $this->name, ]; } } diff --git a/samples/server/petstore/php-flight/Model/FindPetsByStatusStatusParameterInner.php b/samples/server/petstore/php-flight/Model/FindPetsByStatusStatusParameterInner.php index 752121f877d..5f9a3ac96ff 100644 --- a/samples/server/petstore/php-flight/Model/FindPetsByStatusStatusParameterInner.php +++ b/samples/server/petstore/php-flight/Model/FindPetsByStatusStatusParameterInner.php @@ -16,7 +16,7 @@ * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. * * The version of the OpenAPI document: 1.0.0 - * + * * Generated by: https://github.com/openapitools/openapi-generator.git * */ diff --git a/samples/server/petstore/php-flight/Model/Order.php b/samples/server/petstore/php-flight/Model/Order.php index 54fb77b7acc..ae421c1791e 100644 --- a/samples/server/petstore/php-flight/Model/Order.php +++ b/samples/server/petstore/php-flight/Model/Order.php @@ -16,7 +16,7 @@ * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. * * The version of the OpenAPI document: 1.0.0 - * + * * Generated by: https://github.com/openapitools/openapi-generator.git * */ @@ -106,23 +106,23 @@ class Order implements \JsonSerializable public static function fromArray(array $data): self { return new self( - $data['id'] ?? null, - $data['petId'] ?? null, - $data['quantity'] ?? null, - isset($data['shipDate']) ? new \DateTime($data['shipDate']) : null, - isset($data['status']) ? OrderStatus::tryFrom($data['status']) : null, - $data['complete'] ?? null, + $data['id'] ?? null, + $data['petId'] ?? null, + $data['quantity'] ?? null, + isset($data['shipDate']) ? new \DateTime($data['shipDate']) : null, + isset($data['status']) ? OrderStatus::tryFrom($data['status']) : null, + $data['complete'] ?? null, ); } public function jsonSerialize(): mixed { return [ - 'id' => $this->id, - 'petId' => $this->petId, - 'quantity' => $this->quantity, - 'shipDate' => $this->shipDate?->format('c'), - 'status' => $this->status, - 'complete' => $this->complete, + 'id' => $this->id, + 'petId' => $this->petId, + 'quantity' => $this->quantity, + 'shipDate' => $this->shipDate?->format('c'), + 'status' => $this->status, + 'complete' => $this->complete, ]; } } diff --git a/samples/server/petstore/php-flight/Model/OrderStatus.php b/samples/server/petstore/php-flight/Model/OrderStatus.php index 92a8d69c54b..0750b85f58a 100644 --- a/samples/server/petstore/php-flight/Model/OrderStatus.php +++ b/samples/server/petstore/php-flight/Model/OrderStatus.php @@ -16,7 +16,7 @@ * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. * * The version of the OpenAPI document: 1.0.0 - * + * * Generated by: https://github.com/openapitools/openapi-generator.git * */ diff --git a/samples/server/petstore/php-flight/Model/Pet.php b/samples/server/petstore/php-flight/Model/Pet.php index 21e4686ab59..f27d3e24d02 100644 --- a/samples/server/petstore/php-flight/Model/Pet.php +++ b/samples/server/petstore/php-flight/Model/Pet.php @@ -16,7 +16,7 @@ * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. * * The version of the OpenAPI document: 1.0.0 - * + * * Generated by: https://github.com/openapitools/openapi-generator.git * */ @@ -112,23 +112,23 @@ class Pet implements \JsonSerializable public static function fromArray(array $data): self { return new self( - $data['id'] ?? null, - isset($data['category']) ? Category::fromArray($data['category']) : null, - $data['name'] ?? null, - $data['photoUrls'] ?? null, - isset($data['tags']) ? array_map(fn($item) => Tag::fromArray($item), $data['tags']) : null, - isset($data['status']) ? PetStatus::tryFrom($data['status']) : null, + $data['id'] ?? null, + isset($data['category']) ? Category::fromArray($data['category']) : null, + $data['name'] ?? null, + $data['photoUrls'] ?? null, + isset($data['tags']) ? array_map(fn($item) => Tag::fromArray($item), $data['tags']) : null, + isset($data['status']) ? PetStatus::tryFrom($data['status']) : null, ); } public function jsonSerialize(): mixed { return [ - 'id' => $this->id, - 'category' => $this->category, - 'name' => $this->name, - 'photoUrls' => $this->photoUrls, - 'tags' => $this->tags, - 'status' => $this->status, + 'id' => $this->id, + 'category' => $this->category, + 'name' => $this->name, + 'photoUrls' => $this->photoUrls, + 'tags' => $this->tags, + 'status' => $this->status, ]; } } diff --git a/samples/server/petstore/php-flight/Model/PetStatus.php b/samples/server/petstore/php-flight/Model/PetStatus.php index b0c5fedb730..58887f650c7 100644 --- a/samples/server/petstore/php-flight/Model/PetStatus.php +++ b/samples/server/petstore/php-flight/Model/PetStatus.php @@ -16,7 +16,7 @@ * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. * * The version of the OpenAPI document: 1.0.0 - * + * * Generated by: https://github.com/openapitools/openapi-generator.git * */ diff --git a/samples/server/petstore/php-flight/Model/Tag.php b/samples/server/petstore/php-flight/Model/Tag.php index 667a80f948a..04fb4d08af2 100644 --- a/samples/server/petstore/php-flight/Model/Tag.php +++ b/samples/server/petstore/php-flight/Model/Tag.php @@ -16,7 +16,7 @@ * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. * * The version of the OpenAPI document: 1.0.0 - * + * * Generated by: https://github.com/openapitools/openapi-generator.git * */ @@ -66,15 +66,15 @@ class Tag implements \JsonSerializable public static function fromArray(array $data): self { return new self( - $data['id'] ?? null, - $data['name'] ?? null, + $data['id'] ?? null, + $data['name'] ?? null, ); } public function jsonSerialize(): mixed { return [ - 'id' => $this->id, - 'name' => $this->name, + 'id' => $this->id, + 'name' => $this->name, ]; } } diff --git a/samples/server/petstore/php-flight/Model/User.php b/samples/server/petstore/php-flight/Model/User.php index d5d4fbd5871..fefb8f8961a 100644 --- a/samples/server/petstore/php-flight/Model/User.php +++ b/samples/server/petstore/php-flight/Model/User.php @@ -16,7 +16,7 @@ * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. * * The version of the OpenAPI document: 1.0.0 - * + * * Generated by: https://github.com/openapitools/openapi-generator.git * */ @@ -128,27 +128,27 @@ class User implements \JsonSerializable public static function fromArray(array $data): self { return new self( - $data['id'] ?? null, - $data['username'] ?? null, - $data['firstName'] ?? null, - $data['lastName'] ?? null, - $data['email'] ?? null, - $data['password'] ?? null, - $data['phone'] ?? null, - $data['userStatus'] ?? null, + $data['id'] ?? null, + $data['username'] ?? null, + $data['firstName'] ?? null, + $data['lastName'] ?? null, + $data['email'] ?? null, + $data['password'] ?? null, + $data['phone'] ?? null, + $data['userStatus'] ?? null, ); } public function jsonSerialize(): mixed { return [ - 'id' => $this->id, - 'username' => $this->username, - 'firstName' => $this->firstName, - 'lastName' => $this->lastName, - 'email' => $this->email, - 'password' => $this->password, - 'phone' => $this->phone, - 'userStatus' => $this->userStatus, + 'id' => $this->id, + 'username' => $this->username, + 'firstName' => $this->firstName, + 'lastName' => $this->lastName, + 'email' => $this->email, + 'password' => $this->password, + 'phone' => $this->phone, + 'userStatus' => $this->userStatus, ]; } } diff --git a/samples/server/petstore/php-flight/RegisterRoutes.php b/samples/server/petstore/php-flight/RegisterRoutes.php index abae0ec3bd8..85e996575ab 100644 --- a/samples/server/petstore/php-flight/RegisterRoutes.php +++ b/samples/server/petstore/php-flight/RegisterRoutes.php @@ -56,7 +56,7 @@ class RegisterRoutes { \Flight::route('DELETE /pet/@petId', function (string $petId) use ($handler) { $r = \Flight::request(); $handler->deletePet( - parseParam($petId, 'int'), + parseParam($petId, 'int'), parseParam($r->getHeader('api_key'), '?string') ); \Flight::halt(400); @@ -66,7 +66,7 @@ class RegisterRoutes { \Flight::route('DELETE /pet/@petId', function (string $petId) use ($handler) { $r = \Flight::request(); $handler->deletePetStream( - parseParam($petId, 'int'), + parseParam($petId, 'int'), parseParam($r->getHeader('api_key'), '?string') ); // ignore return value: streaming expected @@ -440,7 +440,7 @@ class RegisterRoutes { \Flight::route('GET /user/login', function () use ($handler) { $r = \Flight::request(); $result = $handler->loginUser( - parseParam($r->query['username'] ?? null, 'string'), + parseParam($r->query['username'] ?? null, 'string'), parseParam($r->query['password'] ?? null, 'string') ); if ($result === null) { @@ -454,7 +454,7 @@ class RegisterRoutes { \Flight::route('GET /user/login', function () use ($handler) { $r = \Flight::request(); $handler->loginUserStream( - parseParam($r->query['username'] ?? null, 'string'), + parseParam($r->query['username'] ?? null, 'string'), parseParam($r->query['password'] ?? null, 'string') ); // ignore return value: streaming expected @@ -488,7 +488,7 @@ class RegisterRoutes { \Flight::route('PUT /user/@username', function (string $username) use ($handler) { $r = \Flight::request(); $handler->updateUser( - parseParam($username, 'string'), + parseParam($username, 'string'), parseParam(json_decode($r->getBody(), true), '\\OpenAPIServer\\Model\\User') ); \Flight::halt(400); @@ -498,7 +498,7 @@ class RegisterRoutes { \Flight::route('PUT /user/@username', function (string $username) use ($handler) { $r = \Flight::request(); $handler->updateUserStream( - parseParam($username, 'string'), + parseParam($username, 'string'), parseParam(json_decode($r->getBody(), true), '\\OpenAPIServer\\Model\\User') ); // ignore return value: streaming expected