Skip to content

Commit 95a1f2f

Browse files
authored
[php-*] Fix indention of PHP documentation (#23305)
* [php]: Correct documentation indention * [php]: Regenerate sample with fixed documentation indention * [php]: Fix missing start in doc * [php]: Renegerate sampels --------- Co-authored-by: coffeemakr <coffeemakr@users.noreply.github.com>
1 parent ffd3c01 commit 95a1f2f

182 files changed

Lines changed: 5011 additions & 5011 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

modules/openapi-generator/src/main/resources/php-nextgen/Configuration.mustache

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -492,13 +492,13 @@ class Configuration
492492
}
493493

494494
/**
495-
* Returns URL based on host settings, index and variables
496-
*
497-
* @param array $hostSettings array of host settings, generated from getHostSettings() or equivalent from the API clients
498-
* @param int $hostIndex index of the host settings
499-
* @param array|null $variables hash of variable and the corresponding value (optional)
500-
* @return string URL based on host settings
501-
*/
495+
* Returns URL based on host settings, index and variables
496+
*
497+
* @param array $hostSettings array of host settings, generated from getHostSettings() or equivalent from the API clients
498+
* @param int $hostIndex index of the host settings
499+
* @param array|null $variables hash of variable and the corresponding value (optional)
500+
* @return string URL based on host settings
501+
*/
502502
public static function getHostString(array $hostSettings, int $hostIndex, ?array $variables = null): string
503503
{
504504
if (null === $variables) {

modules/openapi-generator/src/main/resources/php-nextgen/HeaderSelector.mustache

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -86,13 +86,13 @@ class HeaderSelector
8686
}
8787

8888
/**
89-
* Create an Accept header string from the given "Accept" headers array, recalculating all weights
90-
*
91-
* @param string[] $accept Array of Accept Headers
92-
* @param string[] $headersWithJson Array of Accept Headers of type "json"
93-
*
94-
* @return string "Accept" Header (e.g. "application/json, text/html; q=0.9")
95-
*/
89+
* Create an Accept header string from the given "Accept" headers array, recalculating all weights
90+
*
91+
* @param string[] $accept Array of Accept Headers
92+
* @param string[] $headersWithJson Array of Accept Headers of type "json"
93+
*
94+
* @return string "Accept" Header (e.g. "application/json, text/html; q=0.9")
95+
*/
9696
private function getAcceptHeaderWithAdjustedWeight(array $accept, array $headersWithJson): string
9797
{
9898
$processedHeaders = [

modules/openapi-generator/src/main/resources/php-nextgen/api.mustache

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -569,15 +569,15 @@ use {{invokerPackage}}\ObjectSerializer;
569569
{{/exts.x-group-parameters}}
570570
{{#servers}}
571571
{{#-first}}
572-
* This operation contains host(s) defined in the OpenAPI spec. Use 'hostIndex' to select the host.
573-
* if needed, use the 'variables' parameter to pass variables to the host.
572+
* This operation contains host(s) defined in the OpenAPI spec. Use 'hostIndex' to select the host.
573+
* if needed, use the 'variables' parameter to pass variables to the host.
574574
{{/-first}}
575575
* URL: {{{url}}}
576576
{{#variables}}
577577
{{#-first}}
578578
* Variables:
579579
{{/-first}}
580-
* - {{{name}}}: {{{description}}}{{^description}} No description provided{{/description}}{{#enumValues}}
580+
* - {{{name}}}: {{{description}}}{{^description}} No description provided{{/description}}{{#enumValues}}
581581
{{#-first}}
582582
* Allowed values:
583583
{{/-first}}

modules/openapi-generator/src/main/resources/php-nextgen/model_enum.mustache

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@ enum {{classname}}: {{exts.x-php-enum-type}}
44
{{#enumVars}}
55
{{#enumDescription}}
66
/**
7-
* {{enumDescription}}
8-
*/
7+
* {{enumDescription}}
8+
*/
99
{{/enumDescription}}
1010
case {{{name}}} = {{{value}}};
1111
{{^-last}}

modules/openapi-generator/src/main/resources/php-nextgen/model_generic.mustache

Lines changed: 28 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -3,47 +3,47 @@ class {{classname}} {{#parentSchema}}extends {{{parent}}}{{/parentSchema}}{{^par
33
public const DISCRIMINATOR = {{#discriminator}}'{{discriminatorName}}'{{/discriminator}}{{^discriminator}}null{{/discriminator}};
44

55
/**
6-
* The original name of the model.
7-
*
8-
* @var string
9-
*/
6+
* The original name of the model.
7+
*
8+
* @var string
9+
*/
1010
protected static string $openAPIModelName = '{{name}}';
1111

1212
/**
13-
* Array of property to type mappings. Used for (de)serialization
14-
*
15-
* @var array<string, string>
16-
*/
13+
* Array of property to type mappings. Used for (de)serialization
14+
*
15+
* @var array<string, string>
16+
*/
1717
protected static array $openAPITypes = [
1818
{{#vars}}'{{name}}' => '{{{dataType}}}'{{^-last}},
1919
{{/-last}}{{/vars}}
2020
];
2121

2222
/**
23-
* Array of property to format mappings. Used for (de)serialization
24-
*
25-
* @var array<string, string|null>
26-
*/
23+
* Array of property to format mappings. Used for (de)serialization
24+
*
25+
* @var array<string, string|null>
26+
*/
2727
protected static array $openAPIFormats = [
2828
{{#vars}}'{{name}}' => {{#dataFormat}}'{{{.}}}'{{/dataFormat}}{{^dataFormat}}null{{/dataFormat}}{{^-last}},
2929
{{/-last}}{{/vars}}
3030
];
3131

3232
/**
33-
* Array of nullable properties. Used for (de)serialization
34-
*
35-
* @var array<string, bool>
36-
*/
33+
* Array of nullable properties. Used for (de)serialization
34+
*
35+
* @var array<string, bool>
36+
*/
3737
protected static array $openAPINullables = [
3838
{{#vars}}'{{name}}' => {{#isNullable}}true{{/isNullable}}{{^isNullable}}false{{/isNullable}}{{^-last}},
3939
{{/-last}}{{/vars}}
4040
];
4141

4242
/**
43-
* If a nullable field gets set to null, insert it here
44-
*
45-
* @var array<string, bool>
46-
*/
43+
* If a nullable field gets set to null, insert it here
44+
*
45+
* @var array<string, bool>
46+
*/
4747
protected array $openAPINullablesSetToNull = [];
4848

4949
/**
@@ -262,14 +262,14 @@ class {{classname}} {{#parentSchema}}extends {{{parent}}}{{/parentSchema}}{{^par
262262
}
263263

264264
/**
265-
* Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName
266-
* is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the
267-
* $this->openAPINullablesSetToNull array
268-
*
269-
* @param string $variableName
270-
* @param array $fields
271-
* @param mixed $defaultValue
272-
*/
265+
* Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName
266+
* is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the
267+
* $this->openAPINullablesSetToNull array
268+
*
269+
* @param string $variableName
270+
* @param array $fields
271+
* @param mixed $defaultValue
272+
*/
273273
private function setIfExists(string $variableName, array $fields, mixed $defaultValue): void
274274
{
275275
if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) {

modules/openapi-generator/src/main/resources/php-symfony/model_generic.mustache

Lines changed: 26 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -31,12 +31,12 @@ class {{classname}} {{#parentSchema}}extends {{{parent}}} {{/parentSchema}}
3131
}
3232

3333
/**
34-
* Sets {{name}}.
35-
*
36-
* @param {{{vendorExtensions.x-comment-type}}} ${{name}}{{#description}} {{{.}}}{{/description}}
37-
*
38-
* @return $this
39-
*/
34+
* Sets {{name}}.
35+
*
36+
* @param {{{vendorExtensions.x-comment-type}}} ${{name}}{{#description}} {{{.}}}{{/description}}
37+
*
38+
* @return $this
39+
*/
4040
public function {{setter}}({{#vendorExtensions.x-parameter-type}}{{vendorExtensions.x-parameter-type}} {{/vendorExtensions.x-parameter-type}}${{name}}{{^required}} = null{{/required}}): self
4141
{
4242
$this->{{name}} = ${{name}};
@@ -46,22 +46,22 @@ class {{classname}} {{#parentSchema}}extends {{{parent}}} {{/parentSchema}}
4646

4747
{{#isEnumRef}}
4848
/**
49-
* Gets {{name}} for serialization.
50-
*
51-
* @return string|null
52-
*/
49+
* Gets {{name}} for serialization.
50+
*
51+
* @return string|null
52+
*/
5353
public function getSerialized{{nameInPascalCase}}(): string|null
5454
{
5555
return !is_null($this->{{name}}?->value) ? (string) $this->{{name}}->value : null;
5656
}
5757

5858
/**
59-
* Sets {{name}}.
60-
*
61-
* @param string|{{{vendorExtensions.x-comment-type}}} ${{name}}{{#description}} {{{.}}}{{/description}}
62-
*
63-
* @return $this
64-
*/
59+
* Sets {{name}}.
60+
*
61+
* @param string|{{{vendorExtensions.x-comment-type}}} ${{name}}{{#description}} {{{.}}}{{/description}}
62+
*
63+
* @return $this
64+
*/
6565
public function setDeserialized{{nameInPascalCase}}(string|{{#vendorExtensions.x-comment-type}}{{vendorExtensions.x-comment-type}} {{/vendorExtensions.x-comment-type}}${{name}}{{^required}} = null{{/required}}): self
6666
{
6767
if (is_string(${{name}})) {
@@ -78,10 +78,10 @@ class {{classname}} {{#parentSchema}}extends {{{parent}}} {{/parentSchema}}
7878
{{#items}}
7979
{{#isEnumRef}}
8080
/**
81-
* Gets {{name}} for serialization.
82-
*
83-
* @return array
84-
*/
81+
* Gets {{name}} for serialization.
82+
*
83+
* @return array
84+
*/
8585
public function getSerialized{{nameInPascalCase}}(): array
8686
{
8787
return array_map(
@@ -91,12 +91,12 @@ class {{classname}} {{#parentSchema}}extends {{{parent}}} {{/parentSchema}}
9191
}
9292

9393
/**
94-
* Sets {{name}}.
95-
*
96-
* @param {{^required}}?{{/required}}array ${{name}}{{#description}} {{{.}}}{{/description}}
97-
*
98-
* @return $this
99-
*/
94+
* Sets {{name}}.
95+
*
96+
* @param {{^required}}?{{/required}}array ${{name}}{{#description}} {{{.}}}{{/description}}
97+
*
98+
* @return $this
99+
*/
100100
public function setDeserialized{{nameInPascalCase}}({{^required}}?{{/required}}array ${{name}}{{^required}} = []{{/required}}): self
101101
{
102102
$this->{{name}} = array_map(

modules/openapi-generator/src/main/resources/php-symfony/model_variables.mustache

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,8 @@
3131
* @Type("DateTime")
3232
{{/isDateTime}}
3333
{{#isEnumRef}}
34-
* @Accessor(getter="getSerialized{{nameInPascalCase}}", setter="setDeserialized{{nameInPascalCase}}")
35-
* @Type("string")
34+
* @Accessor(getter="getSerialized{{nameInPascalCase}}", setter="setDeserialized{{nameInPascalCase}}")
35+
* @Type("string")
3636
{{/isEnumRef}}
3737
{{^isDate}}
3838
{{^isDateTime}}
@@ -42,7 +42,7 @@
4242
{{/isDateTime}}
4343
{{/isDate}}
4444
{{/isContainer}}
45-
*/
45+
*/
4646
{{#required}}
4747
#[Assert\NotNull]
4848
{{^isPrimitiveType}}

modules/openapi-generator/src/main/resources/php/model_generic.mustache

Lines changed: 30 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -3,49 +3,49 @@ class {{classname}} {{#parentSchema}}extends {{{parent}}}{{/parentSchema}}{{^par
33
public const DISCRIMINATOR = {{#discriminator}}'{{discriminatorName}}'{{/discriminator}}{{^discriminator}}null{{/discriminator}};
44

55
/**
6-
* The original name of the model.
7-
*
8-
* @var string
9-
*/
6+
* The original name of the model.
7+
*
8+
* @var string
9+
*/
1010
protected static $openAPIModelName = '{{name}}';
1111

1212
/**
13-
* Array of property to type mappings. Used for (de)serialization
14-
*
15-
* @var string[]
16-
*/
13+
* Array of property to type mappings. Used for (de)serialization
14+
*
15+
* @var string[]
16+
*/
1717
protected static $openAPITypes = [
1818
{{#vars}}'{{name}}' => '{{{dataType}}}'{{^-last}},
1919
{{/-last}}{{/vars}}
2020
];
2121

2222
/**
23-
* Array of property to format mappings. Used for (de)serialization
24-
*
25-
* @var string[]
26-
* @phpstan-var array<string, string|null>
27-
* @psalm-var array<string, string|null>
28-
*/
23+
* Array of property to format mappings. Used for (de)serialization
24+
*
25+
* @var string[]
26+
* @phpstan-var array<string, string|null>
27+
* @psalm-var array<string, string|null>
28+
*/
2929
protected static $openAPIFormats = [
3030
{{#vars}}'{{name}}' => {{#dataFormat}}'{{{.}}}'{{/dataFormat}}{{^dataFormat}}null{{/dataFormat}}{{^-last}},
3131
{{/-last}}{{/vars}}
3232
];
3333

3434
/**
35-
* Array of nullable properties. Used for (de)serialization
36-
*
37-
* @var boolean[]
38-
*/
35+
* Array of nullable properties. Used for (de)serialization
36+
*
37+
* @var boolean[]
38+
*/
3939
protected static array $openAPINullables = [
4040
{{#vars}}'{{name}}' => {{#isNullable}}true{{/isNullable}}{{^isNullable}}false{{/isNullable}}{{^-last}},
4141
{{/-last}}{{/vars}}
4242
];
4343

4444
/**
45-
* If a nullable field gets set to null, insert it here
46-
*
47-
* @var boolean[]
48-
*/
45+
* If a nullable field gets set to null, insert it here
46+
*
47+
* @var boolean[]
48+
*/
4949
protected array $openAPINullablesSetToNull = [];
5050

5151
/**
@@ -251,14 +251,14 @@ class {{classname}} {{#parentSchema}}extends {{{parent}}}{{/parentSchema}}{{^par
251251
}
252252

253253
/**
254-
* Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName
255-
* is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the
256-
* $this->openAPINullablesSetToNull array
257-
*
258-
* @param string $variableName
259-
* @param array $fields
260-
* @param mixed $defaultValue
261-
*/
254+
* Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName
255+
* is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the
256+
* $this->openAPINullablesSetToNull array
257+
*
258+
* @param string $variableName
259+
* @param array $fields
260+
* @param mixed $defaultValue
261+
*/
262262
private function setIfExists(string $variableName, array $fields, $defaultValue): void
263263
{
264264
if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) {

samples/client/echo_api/php-nextgen-streaming/src/Configuration.php

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -475,13 +475,13 @@ public function getHostSettings(): array
475475
}
476476

477477
/**
478-
* Returns URL based on host settings, index and variables
479-
*
480-
* @param array $hostSettings array of host settings, generated from getHostSettings() or equivalent from the API clients
481-
* @param int $hostIndex index of the host settings
482-
* @param array|null $variables hash of variable and the corresponding value (optional)
483-
* @return string URL based on host settings
484-
*/
478+
* Returns URL based on host settings, index and variables
479+
*
480+
* @param array $hostSettings array of host settings, generated from getHostSettings() or equivalent from the API clients
481+
* @param int $hostIndex index of the host settings
482+
* @param array|null $variables hash of variable and the corresponding value (optional)
483+
* @return string URL based on host settings
484+
*/
485485
public static function getHostString(array $hostSettings, int $hostIndex, ?array $variables = null): string
486486
{
487487
if (null === $variables) {

0 commit comments

Comments
 (0)