mirror of
https://github.com/OpenAPITools/openapi-generator.git
synced 2025-05-12 12:40:53 +00:00
[PHP-SYMFONY] Debug Symfony version 7, enums ref, array of enums $ref and date assert (#19008)
* [PHP-SYMFONY] Debug for Symfony 7 support & debug enum ref & debug array enum ref & debug date assert * [PHP-SYMFONY] Debug for Symfony 7 support & debug enum ref & debug array enum ref & debug date assert * [PHP-SYMFONY] Debug for Symfony 7 support & debug enum ref & debug array enum ref & debug date assert
This commit is contained in:
parent
fa2b5750ce
commit
fb17e5699d
@ -28,6 +28,7 @@
|
|||||||
"ext-curl": "*",
|
"ext-curl": "*",
|
||||||
"ext-json": "*",
|
"ext-json": "*",
|
||||||
"ext-mbstring": "*",
|
"ext-mbstring": "*",
|
||||||
|
"doctrine/annotations": "^2.0",
|
||||||
"symfony/validator": "^6.4|^7.0",
|
"symfony/validator": "^6.4|^7.0",
|
||||||
"jms/serializer-bundle": "^5.4",
|
"jms/serializer-bundle": "^5.4",
|
||||||
"symfony/framework-bundle": "^6.4|^7.0"
|
"symfony/framework-bundle": "^6.4|^7.0"
|
||||||
|
@ -30,6 +30,20 @@ class {{classname}} {{#parentSchema}}extends {{{parent}}} {{/parentSchema}}
|
|||||||
return $this->{{name}};
|
return $this->{{name}};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Sets {{name}}.
|
||||||
|
*
|
||||||
|
* @param {{{vendorExtensions.x-comment-type}}} ${{name}}{{#description}} {{{.}}}{{/description}}
|
||||||
|
*
|
||||||
|
* @return $this
|
||||||
|
*/
|
||||||
|
public function {{setter}}({{#vendorExtensions.x-parameter-type}}{{vendorExtensions.x-parameter-type}} {{/vendorExtensions.x-parameter-type}}${{name}}{{^required}} = null{{/required}}): self
|
||||||
|
{
|
||||||
|
$this->{{name}} = ${{name}};
|
||||||
|
|
||||||
|
return $this;
|
||||||
|
}
|
||||||
|
|
||||||
{{#isEnumRef}}
|
{{#isEnumRef}}
|
||||||
/**
|
/**
|
||||||
* Gets {{name}} for serialization.
|
* Gets {{name}} for serialization.
|
||||||
@ -40,6 +54,24 @@ class {{classname}} {{#parentSchema}}extends {{{parent}}} {{/parentSchema}}
|
|||||||
{
|
{
|
||||||
return $this->{{name}}?->value ? (string) $this->{{name}}->value : null;
|
return $this->{{name}}?->value ? (string) $this->{{name}}->value : null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Sets {{name}}.
|
||||||
|
*
|
||||||
|
* @param string|{{{vendorExtensions.x-comment-type}}} ${{name}}{{#description}} {{{.}}}{{/description}}
|
||||||
|
*
|
||||||
|
* @return $this
|
||||||
|
*/
|
||||||
|
public function setDeserialized{{nameInPascalCase}}(string|{{#vendorExtensions.x-comment-type}}{{vendorExtensions.x-comment-type}} {{/vendorExtensions.x-comment-type}}${{name}}{{^required}} = null{{/required}}): self
|
||||||
|
{
|
||||||
|
if (is_string(${{name}})) {
|
||||||
|
${{name}} = {{baseType}}::tryFrom(${{name}});
|
||||||
|
}
|
||||||
|
|
||||||
|
$this->{{name}} = ${{name}};
|
||||||
|
|
||||||
|
return $this;
|
||||||
|
}
|
||||||
{{/isEnumRef}}
|
{{/isEnumRef}}
|
||||||
|
|
||||||
{{#isContainer}}
|
{{#isContainer}}
|
||||||
@ -53,26 +85,36 @@ class {{classname}} {{#parentSchema}}extends {{{parent}}} {{/parentSchema}}
|
|||||||
public function getSerialized{{nameInPascalCase}}(): array
|
public function getSerialized{{nameInPascalCase}}(): array
|
||||||
{
|
{
|
||||||
return array_map(
|
return array_map(
|
||||||
static fn ($value) => (string) $value->value,
|
static fn ($value) => $value?->value ? (string) $value->value : null,
|
||||||
$this->test ?? []
|
$this->{{name}} ?? []
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Sets {{name}}.
|
||||||
|
*
|
||||||
|
* @param {{^required}}?{{/required}}array ${{name}}{{#description}} {{{.}}}{{/description}}
|
||||||
|
*
|
||||||
|
* @return $this
|
||||||
|
*/
|
||||||
|
public function setDeserialized{{nameInPascalCase}}({{^required}}?{{/required}}array ${{name}}{{^required}} = []{{/required}}): self
|
||||||
|
{
|
||||||
|
$this->{{name}} = array_map(
|
||||||
|
static function ($value) {
|
||||||
|
if (is_string($value)) {
|
||||||
|
$value = {{baseType}}::tryFrom($value);
|
||||||
|
}
|
||||||
|
|
||||||
|
return $value;
|
||||||
|
},
|
||||||
|
${{name}} ?? []
|
||||||
|
);
|
||||||
|
|
||||||
|
return $this;
|
||||||
|
}
|
||||||
{{/isEnumRef}}
|
{{/isEnumRef}}
|
||||||
{{/items}}
|
{{/items}}
|
||||||
{{/isContainer}}
|
{{/isContainer}}
|
||||||
|
|
||||||
/**
|
|
||||||
* Sets {{name}}.
|
|
||||||
*
|
|
||||||
* @param {{{vendorExtensions.x-comment-type}}} ${{name}}{{#description}} {{{.}}}{{/description}}
|
|
||||||
*
|
|
||||||
* @return $this
|
|
||||||
*/
|
|
||||||
public function {{setter}}({{#vendorExtensions.x-parameter-type}}{{vendorExtensions.x-parameter-type}} {{/vendorExtensions.x-parameter-type}}${{name}}{{^required}} = null{{/required}}): self
|
|
||||||
{
|
|
||||||
$this->{{name}} = ${{name}};
|
|
||||||
|
|
||||||
return $this;
|
|
||||||
}
|
|
||||||
{{/vars}}
|
{{/vars}}
|
||||||
}
|
}
|
||||||
|
@ -5,30 +5,7 @@
|
|||||||
{{/description}}
|
{{/description}}
|
||||||
* @var {{{vendorExtensions.x-comment-type}}}
|
* @var {{{vendorExtensions.x-comment-type}}}
|
||||||
* @SerializedName("{{baseName}}")
|
* @SerializedName("{{baseName}}")
|
||||||
{{#required}}
|
|
||||||
* @Assert\NotNull()
|
|
||||||
{{^isPrimitiveType}}
|
|
||||||
* @Assert\Valid()
|
|
||||||
{{/isPrimitiveType}}
|
|
||||||
{{/required}}
|
|
||||||
{{#isEnum}}
|
|
||||||
{{#isContainer}}
|
|
||||||
* @Assert\All({
|
|
||||||
{{#items}}
|
|
||||||
* @Assert\Choice({ {{#allowableValues}}{{#enumVars}}{{{value}}}{{^-last}}, {{/-last}}{{/enumVars}}{{/allowableValues}} })
|
|
||||||
{{/items}}
|
|
||||||
* })
|
|
||||||
{{/isContainer}}
|
|
||||||
{{^isContainer}}
|
|
||||||
* @Assert\Choice({ {{#allowableValues}}{{#enumVars}}{{{value}}}{{^-last}}, {{/-last}}{{/enumVars}}{{/allowableValues}} })
|
|
||||||
{{/isContainer}}
|
|
||||||
{{/isEnum}}
|
|
||||||
{{#isContainer}}
|
{{#isContainer}}
|
||||||
* @Assert\All({
|
|
||||||
{{#items}}
|
|
||||||
* @Assert\Type("{{dataType}}")
|
|
||||||
{{/items}}
|
|
||||||
* })
|
|
||||||
{{#isMap}}
|
{{#isMap}}
|
||||||
{{#items}}
|
{{#items}}
|
||||||
* @Type("array<string, {{dataType}}>")
|
* @Type("array<string, {{dataType}}>")
|
||||||
@ -37,7 +14,7 @@
|
|||||||
{{^isMap}}
|
{{^isMap}}
|
||||||
{{#items}}
|
{{#items}}
|
||||||
{{#isEnumRef}}
|
{{#isEnumRef}}
|
||||||
* @Accessor(getter="getSerialized{{nameInPascalCase}}")
|
* @Accessor(getter="getSerialized{{nameInPascalCase}}", setter="setDeserialized{{nameInPascalCase}}")
|
||||||
* @Type("array<string>")
|
* @Type("array<string>")
|
||||||
{{/isEnumRef}}
|
{{/isEnumRef}}
|
||||||
{{^isEnumRef}}
|
{{^isEnumRef}}
|
||||||
@ -48,66 +25,95 @@
|
|||||||
{{/isContainer}}
|
{{/isContainer}}
|
||||||
{{^isContainer}}
|
{{^isContainer}}
|
||||||
{{#isDate}}
|
{{#isDate}}
|
||||||
* @Assert\Type("\Date")
|
|
||||||
* @Type("DateTime<'Y-m-d'>")
|
* @Type("DateTime<'Y-m-d'>")
|
||||||
{{/isDate}}
|
{{/isDate}}
|
||||||
{{#isDateTime}}
|
{{#isDateTime}}
|
||||||
* @Assert\Type("\DateTime"))
|
|
||||||
* @Type("DateTime")
|
* @Type("DateTime")
|
||||||
{{/isDateTime}}
|
{{/isDateTime}}
|
||||||
{{#isEnumRef}}
|
{{#isEnumRef}}
|
||||||
* @Accessor(getter="getSerialized{{nameInPascalCase}}")
|
* @Accessor(getter="getSerialized{{nameInPascalCase}}", setter="setDeserialized{{nameInPascalCase}}")
|
||||||
* @Type("string")
|
* @Type("string")
|
||||||
{{/isEnumRef}}
|
{{/isEnumRef}}
|
||||||
{{^isDate}}
|
{{^isDate}}
|
||||||
{{^isDateTime}}
|
{{^isDateTime}}
|
||||||
{{^isEnumRef}}
|
{{^isEnumRef}}
|
||||||
* @Assert\Type("{{dataType}}")
|
|
||||||
* @Type("{{dataType}}")
|
* @Type("{{dataType}}")
|
||||||
{{/isEnumRef}}
|
{{/isEnumRef}}
|
||||||
{{/isDateTime}}
|
{{/isDateTime}}
|
||||||
{{/isDate}}
|
{{/isDate}}
|
||||||
|
{{/isContainer}}
|
||||||
|
*/
|
||||||
|
{{#required}}
|
||||||
|
#[Assert\NotNull]
|
||||||
|
{{^isPrimitiveType}}
|
||||||
|
#[Assert\Valid]
|
||||||
|
{{/isPrimitiveType}}
|
||||||
|
{{/required}}
|
||||||
|
{{#isEnum}}
|
||||||
|
{{#isContainer}}
|
||||||
|
#[Assert\All([
|
||||||
|
{{#items}}
|
||||||
|
new Assert\Choice([{{#allowableValues}}{{#enumVars}}{{{value}}}{{^-last}}, {{/-last}}{{/enumVars}}{{/allowableValues}}]),
|
||||||
|
{{/items}}
|
||||||
|
])]
|
||||||
|
{{/isContainer}}
|
||||||
|
{{^isContainer}}
|
||||||
|
#[Assert\Choice([{{#allowableValues}}{{#enumVars}}{{{value}}}{{^-last}}, {{/-last}}{{/enumVars}}{{/allowableValues}}])]
|
||||||
|
{{/isContainer}}
|
||||||
|
{{/isEnum}}
|
||||||
|
{{#isContainer}}
|
||||||
|
#[Assert\All([
|
||||||
|
{{#items}}
|
||||||
|
new Assert\Type("{{dataType}}"),
|
||||||
|
{{/items}}
|
||||||
|
])]
|
||||||
|
{{/isContainer}}
|
||||||
|
{{^isContainer}}
|
||||||
|
{{#isDate}}
|
||||||
|
#[Assert\Type("\DateTime")]
|
||||||
|
{{/isDate}}
|
||||||
|
{{#isDateTime}}
|
||||||
|
#[Assert\Type("\DateTime")]
|
||||||
|
{{/isDateTime}}
|
||||||
|
{{^isDate}}
|
||||||
|
{{^isDateTime}}
|
||||||
|
{{^isEnumRef}}
|
||||||
|
#[Assert\Type("{{dataType}}")]
|
||||||
|
{{/isEnumRef}}
|
||||||
|
{{/isDateTime}}
|
||||||
|
{{/isDate}}
|
||||||
{{/isContainer}}
|
{{/isContainer}}
|
||||||
{{#hasValidation}}
|
{{#hasValidation}}
|
||||||
{{#maxLength}}
|
{{#maxLength}}
|
||||||
* @Assert\Length(
|
#[Assert\Length(max: {{.}})]
|
||||||
* max = {{.}}
|
|
||||||
* )
|
|
||||||
{{/maxLength}}
|
{{/maxLength}}
|
||||||
{{#minLength}}
|
{{#minLength}}
|
||||||
* @Assert\Length(
|
#[Assert\Length(min: {{.}})]
|
||||||
* min = {{.}}
|
|
||||||
* )
|
|
||||||
{{/minLength}}
|
{{/minLength}}
|
||||||
{{#minimum}}
|
{{#minimum}}
|
||||||
{{#exclusiveMinimum}}
|
{{#exclusiveMinimum}}
|
||||||
* @Assert\GreaterThan({{minimum}})
|
#[Assert\GreaterThan({{minimum}})]
|
||||||
{{/exclusiveMinimum}}
|
{{/exclusiveMinimum}}
|
||||||
{{^exclusiveMinimum}}
|
{{^exclusiveMinimum}}
|
||||||
* @Assert\GreaterThanOrEqual({{minimum}})
|
#[Assert\GreaterThanOrEqual({{minimum}})]
|
||||||
{{/exclusiveMinimum}}
|
{{/exclusiveMinimum}}
|
||||||
{{/minimum}}
|
{{/minimum}}
|
||||||
{{#maximum}}
|
{{#maximum}}
|
||||||
{{#exclusiveMaximum}}
|
{{#exclusiveMaximum}}
|
||||||
* @Assert\LessThan({{maximum}})
|
#[Assert\LessThan({{maximum}})]
|
||||||
{{/exclusiveMaximum}}
|
{{/exclusiveMaximum}}
|
||||||
{{^exclusiveMaximum}}
|
{{^exclusiveMaximum}}
|
||||||
* @Assert\LessThanOrEqual({{maximum}})
|
#[Assert\LessThanOrEqual({{maximum}})]
|
||||||
{{/exclusiveMaximum}}
|
{{/exclusiveMaximum}}
|
||||||
{{/maximum}}
|
{{/maximum}}
|
||||||
{{#pattern}}
|
{{#pattern}}
|
||||||
* @Assert\Regex("/{{.}}/")
|
#[Assert\Regex("/{{.}}/")]
|
||||||
{{/pattern}}
|
{{/pattern}}
|
||||||
{{#maxItems}}
|
{{#maxItems}}
|
||||||
* @Assert\Count(
|
#[Assert\Count(max: {{.}})]
|
||||||
* max = {{.}}
|
|
||||||
* )
|
|
||||||
{{/maxItems}}
|
{{/maxItems}}
|
||||||
{{#minItems}}
|
{{#minItems}}
|
||||||
* @Assert\Count(
|
#[Assert\Count(min: {{.}})]
|
||||||
* min = {{.}}
|
|
||||||
* )
|
|
||||||
{{/minItems}}
|
{{/minItems}}
|
||||||
{{/hasValidation}}
|
{{/hasValidation}}
|
||||||
*/
|
|
||||||
protected {{{vendorExtensions.x-parameter-type}}} ${{name}} = {{#defaultValue}}{{{defaultValue}}}{{/defaultValue}}{{^defaultValue}}null{{/defaultValue}};
|
protected {{{vendorExtensions.x-parameter-type}}} ${{name}} = {{#defaultValue}}{{{defaultValue}}}{{/defaultValue}}{{^defaultValue}}null{{/defaultValue}};
|
||||||
|
@ -101,12 +101,16 @@ class JmsSerializer implements SerializerInterface
|
|||||||
case '\DateTime':
|
case '\DateTime':
|
||||||
return is_null($data) ? null :new DateTime($data);
|
return is_null($data) ? null :new DateTime($data);
|
||||||
default:
|
default:
|
||||||
|
if (is_null($data)) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
if (!class_exists($type)) {
|
if (!class_exists($type)) {
|
||||||
throw new RuntimeException(sprintf("Type %s is unsupported", $type));
|
throw new RuntimeException(sprintf("Type %s is unsupported", $type));
|
||||||
}
|
}
|
||||||
|
|
||||||
$reflectionClass = new \ReflectionClass($type);
|
$reflectionClass = new \ReflectionClass($type);
|
||||||
if (!$reflectionClass->implementsInterface('\BackedENum')) {
|
if (!$reflectionClass->implementsInterface('\BackedEnum')) {
|
||||||
throw new RuntimeException(sprintf("Type %s is unsupported", $type));
|
throw new RuntimeException(sprintf("Type %s is unsupported", $type));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -48,25 +48,25 @@ class ApiResponse
|
|||||||
/**
|
/**
|
||||||
* @var int|null
|
* @var int|null
|
||||||
* @SerializedName("code")
|
* @SerializedName("code")
|
||||||
* @Assert\Type("int")
|
|
||||||
* @Type("int")
|
* @Type("int")
|
||||||
*/
|
*/
|
||||||
|
#[Assert\Type("int")]
|
||||||
protected ?int $code = null;
|
protected ?int $code = null;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @var string|null
|
* @var string|null
|
||||||
* @SerializedName("type")
|
* @SerializedName("type")
|
||||||
* @Assert\Type("string")
|
|
||||||
* @Type("string")
|
* @Type("string")
|
||||||
*/
|
*/
|
||||||
|
#[Assert\Type("string")]
|
||||||
protected ?string $type = null;
|
protected ?string $type = null;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @var string|null
|
* @var string|null
|
||||||
* @SerializedName("message")
|
* @SerializedName("message")
|
||||||
* @Assert\Type("string")
|
|
||||||
* @Type("string")
|
* @Type("string")
|
||||||
*/
|
*/
|
||||||
|
#[Assert\Type("string")]
|
||||||
protected ?string $message = null;
|
protected ?string $message = null;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -92,15 +92,13 @@ class ApiResponse
|
|||||||
return $this->code;
|
return $this->code;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Sets code.
|
* Sets code.
|
||||||
*
|
*
|
||||||
* @param int|null $code
|
* @param int|null $code
|
||||||
*
|
*
|
||||||
* @return $this
|
* @return $this
|
||||||
*/
|
*/
|
||||||
public function setCode(?int $code = null): self
|
public function setCode(?int $code = null): self
|
||||||
{
|
{
|
||||||
$this->code = $code;
|
$this->code = $code;
|
||||||
@ -108,6 +106,9 @@ class ApiResponse
|
|||||||
return $this;
|
return $this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Gets type.
|
* Gets type.
|
||||||
*
|
*
|
||||||
@ -118,15 +119,13 @@ class ApiResponse
|
|||||||
return $this->type;
|
return $this->type;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Sets type.
|
* Sets type.
|
||||||
*
|
*
|
||||||
* @param string|null $type
|
* @param string|null $type
|
||||||
*
|
*
|
||||||
* @return $this
|
* @return $this
|
||||||
*/
|
*/
|
||||||
public function setType(?string $type = null): self
|
public function setType(?string $type = null): self
|
||||||
{
|
{
|
||||||
$this->type = $type;
|
$this->type = $type;
|
||||||
@ -134,6 +133,9 @@ class ApiResponse
|
|||||||
return $this;
|
return $this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Gets message.
|
* Gets message.
|
||||||
*
|
*
|
||||||
@ -144,21 +146,22 @@ class ApiResponse
|
|||||||
return $this->message;
|
return $this->message;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Sets message.
|
* Sets message.
|
||||||
*
|
*
|
||||||
* @param string|null $message
|
* @param string|null $message
|
||||||
*
|
*
|
||||||
* @return $this
|
* @return $this
|
||||||
*/
|
*/
|
||||||
public function setMessage(?string $message = null): self
|
public function setMessage(?string $message = null): self
|
||||||
{
|
{
|
||||||
$this->message = $message;
|
$this->message = $message;
|
||||||
|
|
||||||
return $this;
|
return $this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -48,18 +48,18 @@ class Category
|
|||||||
/**
|
/**
|
||||||
* @var int|null
|
* @var int|null
|
||||||
* @SerializedName("id")
|
* @SerializedName("id")
|
||||||
* @Assert\Type("int")
|
|
||||||
* @Type("int")
|
* @Type("int")
|
||||||
*/
|
*/
|
||||||
|
#[Assert\Type("int")]
|
||||||
protected ?int $id = null;
|
protected ?int $id = null;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @var string|null
|
* @var string|null
|
||||||
* @SerializedName("name")
|
* @SerializedName("name")
|
||||||
* @Assert\Type("string")
|
|
||||||
* @Type("string")
|
* @Type("string")
|
||||||
* @Assert\Regex("/^[a-zA-Z0-9]+[a-zA-Z0-9\\.\\-_]*[a-zA-Z0-9]+$/")
|
*/
|
||||||
*/
|
#[Assert\Type("string")]
|
||||||
|
#[Assert\Regex("/^[a-zA-Z0-9]+[a-zA-Z0-9\\.\\-_]*[a-zA-Z0-9]+$/")]
|
||||||
protected ?string $name = null;
|
protected ?string $name = null;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -84,15 +84,13 @@ class Category
|
|||||||
return $this->id;
|
return $this->id;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Sets id.
|
* Sets id.
|
||||||
*
|
*
|
||||||
* @param int|null $id
|
* @param int|null $id
|
||||||
*
|
*
|
||||||
* @return $this
|
* @return $this
|
||||||
*/
|
*/
|
||||||
public function setId(?int $id = null): self
|
public function setId(?int $id = null): self
|
||||||
{
|
{
|
||||||
$this->id = $id;
|
$this->id = $id;
|
||||||
@ -100,6 +98,9 @@ class Category
|
|||||||
return $this;
|
return $this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Gets name.
|
* Gets name.
|
||||||
*
|
*
|
||||||
@ -110,21 +111,22 @@ class Category
|
|||||||
return $this->name;
|
return $this->name;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Sets name.
|
* Sets name.
|
||||||
*
|
*
|
||||||
* @param string|null $name
|
* @param string|null $name
|
||||||
*
|
*
|
||||||
* @return $this
|
* @return $this
|
||||||
*/
|
*/
|
||||||
public function setName(?string $name = null): self
|
public function setName(?string $name = null): self
|
||||||
{
|
{
|
||||||
$this->name = $name;
|
$this->name = $name;
|
||||||
|
|
||||||
return $this;
|
return $this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -48,33 +48,33 @@ class Order
|
|||||||
/**
|
/**
|
||||||
* @var int|null
|
* @var int|null
|
||||||
* @SerializedName("id")
|
* @SerializedName("id")
|
||||||
* @Assert\Type("int")
|
|
||||||
* @Type("int")
|
* @Type("int")
|
||||||
*/
|
*/
|
||||||
|
#[Assert\Type("int")]
|
||||||
protected ?int $id = null;
|
protected ?int $id = null;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @var int|null
|
* @var int|null
|
||||||
* @SerializedName("petId")
|
* @SerializedName("petId")
|
||||||
* @Assert\Type("int")
|
|
||||||
* @Type("int")
|
* @Type("int")
|
||||||
*/
|
*/
|
||||||
|
#[Assert\Type("int")]
|
||||||
protected ?int $petId = null;
|
protected ?int $petId = null;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @var int|null
|
* @var int|null
|
||||||
* @SerializedName("quantity")
|
* @SerializedName("quantity")
|
||||||
* @Assert\Type("int")
|
|
||||||
* @Type("int")
|
* @Type("int")
|
||||||
*/
|
*/
|
||||||
|
#[Assert\Type("int")]
|
||||||
protected ?int $quantity = null;
|
protected ?int $quantity = null;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @var \DateTime|null
|
* @var \DateTime|null
|
||||||
* @SerializedName("shipDate")
|
* @SerializedName("shipDate")
|
||||||
* @Assert\Type("\DateTime"))
|
|
||||||
* @Type("DateTime")
|
* @Type("DateTime")
|
||||||
*/
|
*/
|
||||||
|
#[Assert\Type("\DateTime")]
|
||||||
protected ?\DateTime $shipDate = null;
|
protected ?\DateTime $shipDate = null;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -82,18 +82,18 @@ class Order
|
|||||||
*
|
*
|
||||||
* @var string|null
|
* @var string|null
|
||||||
* @SerializedName("status")
|
* @SerializedName("status")
|
||||||
* @Assert\Choice({ "placed", "approved", "delivered" })
|
|
||||||
* @Assert\Type("string")
|
|
||||||
* @Type("string")
|
* @Type("string")
|
||||||
*/
|
*/
|
||||||
|
#[Assert\Choice(["placed", "approved", "delivered"])]
|
||||||
|
#[Assert\Type("string")]
|
||||||
protected ?string $status = null;
|
protected ?string $status = null;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @var bool|null
|
* @var bool|null
|
||||||
* @SerializedName("complete")
|
* @SerializedName("complete")
|
||||||
* @Assert\Type("bool")
|
|
||||||
* @Type("bool")
|
* @Type("bool")
|
||||||
*/
|
*/
|
||||||
|
#[Assert\Type("bool")]
|
||||||
protected ?bool $complete = false;
|
protected ?bool $complete = false;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -122,15 +122,13 @@ class Order
|
|||||||
return $this->id;
|
return $this->id;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Sets id.
|
* Sets id.
|
||||||
*
|
*
|
||||||
* @param int|null $id
|
* @param int|null $id
|
||||||
*
|
*
|
||||||
* @return $this
|
* @return $this
|
||||||
*/
|
*/
|
||||||
public function setId(?int $id = null): self
|
public function setId(?int $id = null): self
|
||||||
{
|
{
|
||||||
$this->id = $id;
|
$this->id = $id;
|
||||||
@ -138,6 +136,9 @@ class Order
|
|||||||
return $this;
|
return $this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Gets petId.
|
* Gets petId.
|
||||||
*
|
*
|
||||||
@ -148,15 +149,13 @@ class Order
|
|||||||
return $this->petId;
|
return $this->petId;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Sets petId.
|
* Sets petId.
|
||||||
*
|
*
|
||||||
* @param int|null $petId
|
* @param int|null $petId
|
||||||
*
|
*
|
||||||
* @return $this
|
* @return $this
|
||||||
*/
|
*/
|
||||||
public function setPetId(?int $petId = null): self
|
public function setPetId(?int $petId = null): self
|
||||||
{
|
{
|
||||||
$this->petId = $petId;
|
$this->petId = $petId;
|
||||||
@ -164,6 +163,9 @@ class Order
|
|||||||
return $this;
|
return $this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Gets quantity.
|
* Gets quantity.
|
||||||
*
|
*
|
||||||
@ -174,15 +176,13 @@ class Order
|
|||||||
return $this->quantity;
|
return $this->quantity;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Sets quantity.
|
* Sets quantity.
|
||||||
*
|
*
|
||||||
* @param int|null $quantity
|
* @param int|null $quantity
|
||||||
*
|
*
|
||||||
* @return $this
|
* @return $this
|
||||||
*/
|
*/
|
||||||
public function setQuantity(?int $quantity = null): self
|
public function setQuantity(?int $quantity = null): self
|
||||||
{
|
{
|
||||||
$this->quantity = $quantity;
|
$this->quantity = $quantity;
|
||||||
@ -190,6 +190,9 @@ class Order
|
|||||||
return $this;
|
return $this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Gets shipDate.
|
* Gets shipDate.
|
||||||
*
|
*
|
||||||
@ -200,15 +203,13 @@ class Order
|
|||||||
return $this->shipDate;
|
return $this->shipDate;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Sets shipDate.
|
* Sets shipDate.
|
||||||
*
|
*
|
||||||
* @param \DateTime|null $shipDate
|
* @param \DateTime|null $shipDate
|
||||||
*
|
*
|
||||||
* @return $this
|
* @return $this
|
||||||
*/
|
*/
|
||||||
public function setShipDate(?\DateTime $shipDate = null): self
|
public function setShipDate(?\DateTime $shipDate = null): self
|
||||||
{
|
{
|
||||||
$this->shipDate = $shipDate;
|
$this->shipDate = $shipDate;
|
||||||
@ -216,6 +217,9 @@ class Order
|
|||||||
return $this;
|
return $this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Gets status.
|
* Gets status.
|
||||||
*
|
*
|
||||||
@ -226,15 +230,13 @@ class Order
|
|||||||
return $this->status;
|
return $this->status;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Sets status.
|
* Sets status.
|
||||||
*
|
*
|
||||||
* @param string|null $status Order Status
|
* @param string|null $status Order Status
|
||||||
*
|
*
|
||||||
* @return $this
|
* @return $this
|
||||||
*/
|
*/
|
||||||
public function setStatus(?string $status = null): self
|
public function setStatus(?string $status = null): self
|
||||||
{
|
{
|
||||||
$this->status = $status;
|
$this->status = $status;
|
||||||
@ -242,6 +244,9 @@ class Order
|
|||||||
return $this;
|
return $this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Gets complete.
|
* Gets complete.
|
||||||
*
|
*
|
||||||
@ -252,21 +257,22 @@ class Order
|
|||||||
return $this->complete;
|
return $this->complete;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Sets complete.
|
* Sets complete.
|
||||||
*
|
*
|
||||||
* @param bool|null $complete
|
* @param bool|null $complete
|
||||||
*
|
*
|
||||||
* @return $this
|
* @return $this
|
||||||
*/
|
*/
|
||||||
public function setComplete(?bool $complete = null): self
|
public function setComplete(?bool $complete = null): self
|
||||||
{
|
{
|
||||||
$this->complete = $complete;
|
$this->complete = $complete;
|
||||||
|
|
||||||
return $this;
|
return $this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -48,47 +48,47 @@ class Pet
|
|||||||
/**
|
/**
|
||||||
* @var int|null
|
* @var int|null
|
||||||
* @SerializedName("id")
|
* @SerializedName("id")
|
||||||
* @Assert\Type("int")
|
|
||||||
* @Type("int")
|
* @Type("int")
|
||||||
*/
|
*/
|
||||||
|
#[Assert\Type("int")]
|
||||||
protected ?int $id = null;
|
protected ?int $id = null;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @var Category|null
|
* @var Category|null
|
||||||
* @SerializedName("category")
|
* @SerializedName("category")
|
||||||
* @Assert\Type("OpenAPI\Server\Model\Category")
|
|
||||||
* @Type("OpenAPI\Server\Model\Category")
|
* @Type("OpenAPI\Server\Model\Category")
|
||||||
*/
|
*/
|
||||||
|
#[Assert\Type("OpenAPI\Server\Model\Category")]
|
||||||
protected ?Category $category = null;
|
protected ?Category $category = null;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @var string|null
|
* @var string|null
|
||||||
* @SerializedName("name")
|
* @SerializedName("name")
|
||||||
* @Assert\NotNull()
|
|
||||||
* @Assert\Type("string")
|
|
||||||
* @Type("string")
|
* @Type("string")
|
||||||
*/
|
*/
|
||||||
|
#[Assert\NotNull]
|
||||||
|
#[Assert\Type("string")]
|
||||||
protected ?string $name = null;
|
protected ?string $name = null;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @var string[]|null
|
* @var string[]|null
|
||||||
* @SerializedName("photoUrls")
|
* @SerializedName("photoUrls")
|
||||||
* @Assert\NotNull()
|
|
||||||
* @Assert\All({
|
|
||||||
* @Assert\Type("string")
|
|
||||||
* })
|
|
||||||
* @Type("array<string>")
|
* @Type("array<string>")
|
||||||
*/
|
*/
|
||||||
|
#[Assert\NotNull]
|
||||||
|
#[Assert\All([
|
||||||
|
new Assert\Type("string"),
|
||||||
|
])]
|
||||||
protected ?array $photoUrls = null;
|
protected ?array $photoUrls = null;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @var Tag[]|null
|
* @var Tag[]|null
|
||||||
* @SerializedName("tags")
|
* @SerializedName("tags")
|
||||||
* @Assert\All({
|
|
||||||
* @Assert\Type("OpenAPI\Server\Model\Tag")
|
|
||||||
* })
|
|
||||||
* @Type("array<OpenAPI\Server\Model\Tag>")
|
* @Type("array<OpenAPI\Server\Model\Tag>")
|
||||||
*/
|
*/
|
||||||
|
#[Assert\All([
|
||||||
|
new Assert\Type("OpenAPI\Server\Model\Tag"),
|
||||||
|
])]
|
||||||
protected ?array $tags = null;
|
protected ?array $tags = null;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -96,10 +96,10 @@ class Pet
|
|||||||
*
|
*
|
||||||
* @var string|null
|
* @var string|null
|
||||||
* @SerializedName("status")
|
* @SerializedName("status")
|
||||||
* @Assert\Choice({ "available", "pending", "sold" })
|
|
||||||
* @Assert\Type("string")
|
|
||||||
* @Type("string")
|
* @Type("string")
|
||||||
*/
|
*/
|
||||||
|
#[Assert\Choice(["available", "pending", "sold"])]
|
||||||
|
#[Assert\Type("string")]
|
||||||
protected ?string $status = null;
|
protected ?string $status = null;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -128,15 +128,13 @@ class Pet
|
|||||||
return $this->id;
|
return $this->id;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Sets id.
|
* Sets id.
|
||||||
*
|
*
|
||||||
* @param int|null $id
|
* @param int|null $id
|
||||||
*
|
*
|
||||||
* @return $this
|
* @return $this
|
||||||
*/
|
*/
|
||||||
public function setId(?int $id = null): self
|
public function setId(?int $id = null): self
|
||||||
{
|
{
|
||||||
$this->id = $id;
|
$this->id = $id;
|
||||||
@ -144,6 +142,9 @@ class Pet
|
|||||||
return $this;
|
return $this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Gets category.
|
* Gets category.
|
||||||
*
|
*
|
||||||
@ -154,15 +155,13 @@ class Pet
|
|||||||
return $this->category;
|
return $this->category;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Sets category.
|
* Sets category.
|
||||||
*
|
*
|
||||||
* @param Category|null $category
|
* @param Category|null $category
|
||||||
*
|
*
|
||||||
* @return $this
|
* @return $this
|
||||||
*/
|
*/
|
||||||
public function setCategory(?Category $category = null): self
|
public function setCategory(?Category $category = null): self
|
||||||
{
|
{
|
||||||
$this->category = $category;
|
$this->category = $category;
|
||||||
@ -170,6 +169,9 @@ class Pet
|
|||||||
return $this;
|
return $this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Gets name.
|
* Gets name.
|
||||||
*
|
*
|
||||||
@ -180,15 +182,13 @@ class Pet
|
|||||||
return $this->name;
|
return $this->name;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Sets name.
|
* Sets name.
|
||||||
*
|
*
|
||||||
* @param string|null $name
|
* @param string|null $name
|
||||||
*
|
*
|
||||||
* @return $this
|
* @return $this
|
||||||
*/
|
*/
|
||||||
public function setName(?string $name): self
|
public function setName(?string $name): self
|
||||||
{
|
{
|
||||||
$this->name = $name;
|
$this->name = $name;
|
||||||
@ -196,6 +196,9 @@ class Pet
|
|||||||
return $this;
|
return $this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Gets photoUrls.
|
* Gets photoUrls.
|
||||||
*
|
*
|
||||||
@ -206,15 +209,13 @@ class Pet
|
|||||||
return $this->photoUrls;
|
return $this->photoUrls;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Sets photoUrls.
|
* Sets photoUrls.
|
||||||
*
|
*
|
||||||
* @param string[]|null $photoUrls
|
* @param string[]|null $photoUrls
|
||||||
*
|
*
|
||||||
* @return $this
|
* @return $this
|
||||||
*/
|
*/
|
||||||
public function setPhotoUrls(?array $photoUrls): self
|
public function setPhotoUrls(?array $photoUrls): self
|
||||||
{
|
{
|
||||||
$this->photoUrls = $photoUrls;
|
$this->photoUrls = $photoUrls;
|
||||||
@ -222,6 +223,9 @@ class Pet
|
|||||||
return $this;
|
return $this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Gets tags.
|
* Gets tags.
|
||||||
*
|
*
|
||||||
@ -232,15 +236,13 @@ class Pet
|
|||||||
return $this->tags;
|
return $this->tags;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Sets tags.
|
* Sets tags.
|
||||||
*
|
*
|
||||||
* @param Tag[]|null $tags
|
* @param Tag[]|null $tags
|
||||||
*
|
*
|
||||||
* @return $this
|
* @return $this
|
||||||
*/
|
*/
|
||||||
public function setTags(?array $tags = null): self
|
public function setTags(?array $tags = null): self
|
||||||
{
|
{
|
||||||
$this->tags = $tags;
|
$this->tags = $tags;
|
||||||
@ -248,6 +250,9 @@ class Pet
|
|||||||
return $this;
|
return $this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Gets status.
|
* Gets status.
|
||||||
*
|
*
|
||||||
@ -258,21 +263,22 @@ class Pet
|
|||||||
return $this->status;
|
return $this->status;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Sets status.
|
* Sets status.
|
||||||
*
|
*
|
||||||
* @param string|null $status pet status in the store
|
* @param string|null $status pet status in the store
|
||||||
*
|
*
|
||||||
* @return $this
|
* @return $this
|
||||||
*/
|
*/
|
||||||
public function setStatus(?string $status = null): self
|
public function setStatus(?string $status = null): self
|
||||||
{
|
{
|
||||||
$this->status = $status;
|
$this->status = $status;
|
||||||
|
|
||||||
return $this;
|
return $this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -48,17 +48,17 @@ class Tag
|
|||||||
/**
|
/**
|
||||||
* @var int|null
|
* @var int|null
|
||||||
* @SerializedName("id")
|
* @SerializedName("id")
|
||||||
* @Assert\Type("int")
|
|
||||||
* @Type("int")
|
* @Type("int")
|
||||||
*/
|
*/
|
||||||
|
#[Assert\Type("int")]
|
||||||
protected ?int $id = null;
|
protected ?int $id = null;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @var string|null
|
* @var string|null
|
||||||
* @SerializedName("name")
|
* @SerializedName("name")
|
||||||
* @Assert\Type("string")
|
|
||||||
* @Type("string")
|
* @Type("string")
|
||||||
*/
|
*/
|
||||||
|
#[Assert\Type("string")]
|
||||||
protected ?string $name = null;
|
protected ?string $name = null;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -83,15 +83,13 @@ class Tag
|
|||||||
return $this->id;
|
return $this->id;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Sets id.
|
* Sets id.
|
||||||
*
|
*
|
||||||
* @param int|null $id
|
* @param int|null $id
|
||||||
*
|
*
|
||||||
* @return $this
|
* @return $this
|
||||||
*/
|
*/
|
||||||
public function setId(?int $id = null): self
|
public function setId(?int $id = null): self
|
||||||
{
|
{
|
||||||
$this->id = $id;
|
$this->id = $id;
|
||||||
@ -99,6 +97,9 @@ class Tag
|
|||||||
return $this;
|
return $this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Gets name.
|
* Gets name.
|
||||||
*
|
*
|
||||||
@ -109,21 +110,22 @@ class Tag
|
|||||||
return $this->name;
|
return $this->name;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Sets name.
|
* Sets name.
|
||||||
*
|
*
|
||||||
* @param string|null $name
|
* @param string|null $name
|
||||||
*
|
*
|
||||||
* @return $this
|
* @return $this
|
||||||
*/
|
*/
|
||||||
public function setName(?string $name = null): self
|
public function setName(?string $name = null): self
|
||||||
{
|
{
|
||||||
$this->name = $name;
|
$this->name = $name;
|
||||||
|
|
||||||
return $this;
|
return $this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -48,57 +48,57 @@ class User
|
|||||||
/**
|
/**
|
||||||
* @var int|null
|
* @var int|null
|
||||||
* @SerializedName("id")
|
* @SerializedName("id")
|
||||||
* @Assert\Type("int")
|
|
||||||
* @Type("int")
|
* @Type("int")
|
||||||
*/
|
*/
|
||||||
|
#[Assert\Type("int")]
|
||||||
protected ?int $id = null;
|
protected ?int $id = null;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @var string|null
|
* @var string|null
|
||||||
* @SerializedName("username")
|
* @SerializedName("username")
|
||||||
* @Assert\Type("string")
|
|
||||||
* @Type("string")
|
* @Type("string")
|
||||||
*/
|
*/
|
||||||
|
#[Assert\Type("string")]
|
||||||
protected ?string $username = null;
|
protected ?string $username = null;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @var string|null
|
* @var string|null
|
||||||
* @SerializedName("firstName")
|
* @SerializedName("firstName")
|
||||||
* @Assert\Type("string")
|
|
||||||
* @Type("string")
|
* @Type("string")
|
||||||
*/
|
*/
|
||||||
|
#[Assert\Type("string")]
|
||||||
protected ?string $firstName = null;
|
protected ?string $firstName = null;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @var string|null
|
* @var string|null
|
||||||
* @SerializedName("lastName")
|
* @SerializedName("lastName")
|
||||||
* @Assert\Type("string")
|
|
||||||
* @Type("string")
|
* @Type("string")
|
||||||
*/
|
*/
|
||||||
|
#[Assert\Type("string")]
|
||||||
protected ?string $lastName = null;
|
protected ?string $lastName = null;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @var string|null
|
* @var string|null
|
||||||
* @SerializedName("email")
|
* @SerializedName("email")
|
||||||
* @Assert\Type("string")
|
|
||||||
* @Type("string")
|
* @Type("string")
|
||||||
*/
|
*/
|
||||||
|
#[Assert\Type("string")]
|
||||||
protected ?string $email = null;
|
protected ?string $email = null;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @var string|null
|
* @var string|null
|
||||||
* @SerializedName("password")
|
* @SerializedName("password")
|
||||||
* @Assert\Type("string")
|
|
||||||
* @Type("string")
|
* @Type("string")
|
||||||
*/
|
*/
|
||||||
|
#[Assert\Type("string")]
|
||||||
protected ?string $password = null;
|
protected ?string $password = null;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @var string|null
|
* @var string|null
|
||||||
* @SerializedName("phone")
|
* @SerializedName("phone")
|
||||||
* @Assert\Type("string")
|
|
||||||
* @Type("string")
|
* @Type("string")
|
||||||
*/
|
*/
|
||||||
|
#[Assert\Type("string")]
|
||||||
protected ?string $phone = null;
|
protected ?string $phone = null;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -106,9 +106,9 @@ class User
|
|||||||
*
|
*
|
||||||
* @var int|null
|
* @var int|null
|
||||||
* @SerializedName("userStatus")
|
* @SerializedName("userStatus")
|
||||||
* @Assert\Type("int")
|
|
||||||
* @Type("int")
|
* @Type("int")
|
||||||
*/
|
*/
|
||||||
|
#[Assert\Type("int")]
|
||||||
protected ?int $userStatus = null;
|
protected ?int $userStatus = null;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -139,15 +139,13 @@ class User
|
|||||||
return $this->id;
|
return $this->id;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Sets id.
|
* Sets id.
|
||||||
*
|
*
|
||||||
* @param int|null $id
|
* @param int|null $id
|
||||||
*
|
*
|
||||||
* @return $this
|
* @return $this
|
||||||
*/
|
*/
|
||||||
public function setId(?int $id = null): self
|
public function setId(?int $id = null): self
|
||||||
{
|
{
|
||||||
$this->id = $id;
|
$this->id = $id;
|
||||||
@ -155,6 +153,9 @@ class User
|
|||||||
return $this;
|
return $this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Gets username.
|
* Gets username.
|
||||||
*
|
*
|
||||||
@ -165,15 +166,13 @@ class User
|
|||||||
return $this->username;
|
return $this->username;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Sets username.
|
* Sets username.
|
||||||
*
|
*
|
||||||
* @param string|null $username
|
* @param string|null $username
|
||||||
*
|
*
|
||||||
* @return $this
|
* @return $this
|
||||||
*/
|
*/
|
||||||
public function setUsername(?string $username = null): self
|
public function setUsername(?string $username = null): self
|
||||||
{
|
{
|
||||||
$this->username = $username;
|
$this->username = $username;
|
||||||
@ -181,6 +180,9 @@ class User
|
|||||||
return $this;
|
return $this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Gets firstName.
|
* Gets firstName.
|
||||||
*
|
*
|
||||||
@ -191,15 +193,13 @@ class User
|
|||||||
return $this->firstName;
|
return $this->firstName;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Sets firstName.
|
* Sets firstName.
|
||||||
*
|
*
|
||||||
* @param string|null $firstName
|
* @param string|null $firstName
|
||||||
*
|
*
|
||||||
* @return $this
|
* @return $this
|
||||||
*/
|
*/
|
||||||
public function setFirstName(?string $firstName = null): self
|
public function setFirstName(?string $firstName = null): self
|
||||||
{
|
{
|
||||||
$this->firstName = $firstName;
|
$this->firstName = $firstName;
|
||||||
@ -207,6 +207,9 @@ class User
|
|||||||
return $this;
|
return $this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Gets lastName.
|
* Gets lastName.
|
||||||
*
|
*
|
||||||
@ -217,15 +220,13 @@ class User
|
|||||||
return $this->lastName;
|
return $this->lastName;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Sets lastName.
|
* Sets lastName.
|
||||||
*
|
*
|
||||||
* @param string|null $lastName
|
* @param string|null $lastName
|
||||||
*
|
*
|
||||||
* @return $this
|
* @return $this
|
||||||
*/
|
*/
|
||||||
public function setLastName(?string $lastName = null): self
|
public function setLastName(?string $lastName = null): self
|
||||||
{
|
{
|
||||||
$this->lastName = $lastName;
|
$this->lastName = $lastName;
|
||||||
@ -233,6 +234,9 @@ class User
|
|||||||
return $this;
|
return $this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Gets email.
|
* Gets email.
|
||||||
*
|
*
|
||||||
@ -243,15 +247,13 @@ class User
|
|||||||
return $this->email;
|
return $this->email;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Sets email.
|
* Sets email.
|
||||||
*
|
*
|
||||||
* @param string|null $email
|
* @param string|null $email
|
||||||
*
|
*
|
||||||
* @return $this
|
* @return $this
|
||||||
*/
|
*/
|
||||||
public function setEmail(?string $email = null): self
|
public function setEmail(?string $email = null): self
|
||||||
{
|
{
|
||||||
$this->email = $email;
|
$this->email = $email;
|
||||||
@ -259,6 +261,9 @@ class User
|
|||||||
return $this;
|
return $this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Gets password.
|
* Gets password.
|
||||||
*
|
*
|
||||||
@ -269,15 +274,13 @@ class User
|
|||||||
return $this->password;
|
return $this->password;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Sets password.
|
* Sets password.
|
||||||
*
|
*
|
||||||
* @param string|null $password
|
* @param string|null $password
|
||||||
*
|
*
|
||||||
* @return $this
|
* @return $this
|
||||||
*/
|
*/
|
||||||
public function setPassword(?string $password = null): self
|
public function setPassword(?string $password = null): self
|
||||||
{
|
{
|
||||||
$this->password = $password;
|
$this->password = $password;
|
||||||
@ -285,6 +288,9 @@ class User
|
|||||||
return $this;
|
return $this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Gets phone.
|
* Gets phone.
|
||||||
*
|
*
|
||||||
@ -295,15 +301,13 @@ class User
|
|||||||
return $this->phone;
|
return $this->phone;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Sets phone.
|
* Sets phone.
|
||||||
*
|
*
|
||||||
* @param string|null $phone
|
* @param string|null $phone
|
||||||
*
|
*
|
||||||
* @return $this
|
* @return $this
|
||||||
*/
|
*/
|
||||||
public function setPhone(?string $phone = null): self
|
public function setPhone(?string $phone = null): self
|
||||||
{
|
{
|
||||||
$this->phone = $phone;
|
$this->phone = $phone;
|
||||||
@ -311,6 +315,9 @@ class User
|
|||||||
return $this;
|
return $this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Gets userStatus.
|
* Gets userStatus.
|
||||||
*
|
*
|
||||||
@ -321,21 +328,22 @@ class User
|
|||||||
return $this->userStatus;
|
return $this->userStatus;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Sets userStatus.
|
* Sets userStatus.
|
||||||
*
|
*
|
||||||
* @param int|null $userStatus User Status
|
* @param int|null $userStatus User Status
|
||||||
*
|
*
|
||||||
* @return $this
|
* @return $this
|
||||||
*/
|
*/
|
||||||
public function setUserStatus(?int $userStatus = null): self
|
public function setUserStatus(?int $userStatus = null): self
|
||||||
{
|
{
|
||||||
$this->userStatus = $userStatus;
|
$this->userStatus = $userStatus;
|
||||||
|
|
||||||
return $this;
|
return $this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -101,12 +101,16 @@ class JmsSerializer implements SerializerInterface
|
|||||||
case '\DateTime':
|
case '\DateTime':
|
||||||
return is_null($data) ? null :new DateTime($data);
|
return is_null($data) ? null :new DateTime($data);
|
||||||
default:
|
default:
|
||||||
|
if (is_null($data)) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
if (!class_exists($type)) {
|
if (!class_exists($type)) {
|
||||||
throw new RuntimeException(sprintf("Type %s is unsupported", $type));
|
throw new RuntimeException(sprintf("Type %s is unsupported", $type));
|
||||||
}
|
}
|
||||||
|
|
||||||
$reflectionClass = new \ReflectionClass($type);
|
$reflectionClass = new \ReflectionClass($type);
|
||||||
if (!$reflectionClass->implementsInterface('\BackedENum')) {
|
if (!$reflectionClass->implementsInterface('\BackedEnum')) {
|
||||||
throw new RuntimeException(sprintf("Type %s is unsupported", $type));
|
throw new RuntimeException(sprintf("Type %s is unsupported", $type));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -20,6 +20,7 @@
|
|||||||
"ext-curl": "*",
|
"ext-curl": "*",
|
||||||
"ext-json": "*",
|
"ext-json": "*",
|
||||||
"ext-mbstring": "*",
|
"ext-mbstring": "*",
|
||||||
|
"doctrine/annotations": "^2.0",
|
||||||
"symfony/validator": "^6.4|^7.0",
|
"symfony/validator": "^6.4|^7.0",
|
||||||
"jms/serializer-bundle": "^5.4",
|
"jms/serializer-bundle": "^5.4",
|
||||||
"symfony/framework-bundle": "^6.4|^7.0"
|
"symfony/framework-bundle": "^6.4|^7.0"
|
||||||
|
Loading…
x
Reference in New Issue
Block a user