[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:
loicconan
2024-06-30 04:11:26 +02:00
committed by GitHub
parent fa2b5750ce
commit fb17e5699d
12 changed files with 428 additions and 343 deletions

View File

@@ -48,25 +48,25 @@ class ApiResponse
/**
* @var int|null
* @SerializedName("code")
* @Assert\Type("int")
* @Type("int")
*/
*/
#[Assert\Type("int")]
protected ?int $code = null;
/**
* @var string|null
* @SerializedName("type")
* @Assert\Type("string")
* @Type("string")
*/
*/
#[Assert\Type("string")]
protected ?string $type = null;
/**
* @var string|null
* @SerializedName("message")
* @Assert\Type("string")
* @Type("string")
*/
*/
#[Assert\Type("string")]
protected ?string $message = null;
/**
@@ -92,15 +92,13 @@ class ApiResponse
return $this->code;
}
/**
* Sets code.
*
* @param int|null $code
*
* @return $this
*/
* Sets code.
*
* @param int|null $code
*
* @return $this
*/
public function setCode(?int $code = null): self
{
$this->code = $code;
@@ -108,6 +106,9 @@ class ApiResponse
return $this;
}
/**
* Gets type.
*
@@ -118,15 +119,13 @@ class ApiResponse
return $this->type;
}
/**
* Sets type.
*
* @param string|null $type
*
* @return $this
*/
* Sets type.
*
* @param string|null $type
*
* @return $this
*/
public function setType(?string $type = null): self
{
$this->type = $type;
@@ -134,6 +133,9 @@ class ApiResponse
return $this;
}
/**
* Gets message.
*
@@ -144,21 +146,22 @@ class ApiResponse
return $this->message;
}
/**
* Sets message.
*
* @param string|null $message
*
* @return $this
*/
* Sets message.
*
* @param string|null $message
*
* @return $this
*/
public function setMessage(?string $message = null): self
{
$this->message = $message;
return $this;
}
}

View File

@@ -48,18 +48,18 @@ class Category
/**
* @var int|null
* @SerializedName("id")
* @Assert\Type("int")
* @Type("int")
*/
*/
#[Assert\Type("int")]
protected ?int $id = null;
/**
* @var string|null
* @SerializedName("name")
* @Assert\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;
/**
@@ -84,15 +84,13 @@ class Category
return $this->id;
}
/**
* Sets id.
*
* @param int|null $id
*
* @return $this
*/
* Sets id.
*
* @param int|null $id
*
* @return $this
*/
public function setId(?int $id = null): self
{
$this->id = $id;
@@ -100,6 +98,9 @@ class Category
return $this;
}
/**
* Gets name.
*
@@ -110,21 +111,22 @@ class Category
return $this->name;
}
/**
* Sets name.
*
* @param string|null $name
*
* @return $this
*/
* Sets name.
*
* @param string|null $name
*
* @return $this
*/
public function setName(?string $name = null): self
{
$this->name = $name;
return $this;
}
}

View File

@@ -48,33 +48,33 @@ class Order
/**
* @var int|null
* @SerializedName("id")
* @Assert\Type("int")
* @Type("int")
*/
*/
#[Assert\Type("int")]
protected ?int $id = null;
/**
* @var int|null
* @SerializedName("petId")
* @Assert\Type("int")
* @Type("int")
*/
*/
#[Assert\Type("int")]
protected ?int $petId = null;
/**
* @var int|null
* @SerializedName("quantity")
* @Assert\Type("int")
* @Type("int")
*/
*/
#[Assert\Type("int")]
protected ?int $quantity = null;
/**
* @var \DateTime|null
* @SerializedName("shipDate")
* @Assert\Type("\DateTime"))
* @Type("DateTime")
*/
*/
#[Assert\Type("\DateTime")]
protected ?\DateTime $shipDate = null;
/**
@@ -82,18 +82,18 @@ class Order
*
* @var string|null
* @SerializedName("status")
* @Assert\Choice({ "placed", "approved", "delivered" })
* @Assert\Type("string")
* @Type("string")
*/
*/
#[Assert\Choice(["placed", "approved", "delivered"])]
#[Assert\Type("string")]
protected ?string $status = null;
/**
* @var bool|null
* @SerializedName("complete")
* @Assert\Type("bool")
* @Type("bool")
*/
*/
#[Assert\Type("bool")]
protected ?bool $complete = false;
/**
@@ -122,15 +122,13 @@ class Order
return $this->id;
}
/**
* Sets id.
*
* @param int|null $id
*
* @return $this
*/
* Sets id.
*
* @param int|null $id
*
* @return $this
*/
public function setId(?int $id = null): self
{
$this->id = $id;
@@ -138,6 +136,9 @@ class Order
return $this;
}
/**
* Gets petId.
*
@@ -148,15 +149,13 @@ class Order
return $this->petId;
}
/**
* Sets petId.
*
* @param int|null $petId
*
* @return $this
*/
* Sets petId.
*
* @param int|null $petId
*
* @return $this
*/
public function setPetId(?int $petId = null): self
{
$this->petId = $petId;
@@ -164,6 +163,9 @@ class Order
return $this;
}
/**
* Gets quantity.
*
@@ -174,15 +176,13 @@ class Order
return $this->quantity;
}
/**
* Sets quantity.
*
* @param int|null $quantity
*
* @return $this
*/
* Sets quantity.
*
* @param int|null $quantity
*
* @return $this
*/
public function setQuantity(?int $quantity = null): self
{
$this->quantity = $quantity;
@@ -190,6 +190,9 @@ class Order
return $this;
}
/**
* Gets shipDate.
*
@@ -200,15 +203,13 @@ class Order
return $this->shipDate;
}
/**
* Sets shipDate.
*
* @param \DateTime|null $shipDate
*
* @return $this
*/
* Sets shipDate.
*
* @param \DateTime|null $shipDate
*
* @return $this
*/
public function setShipDate(?\DateTime $shipDate = null): self
{
$this->shipDate = $shipDate;
@@ -216,6 +217,9 @@ class Order
return $this;
}
/**
* Gets status.
*
@@ -226,15 +230,13 @@ class Order
return $this->status;
}
/**
* Sets status.
*
* @param string|null $status Order Status
*
* @return $this
*/
* Sets status.
*
* @param string|null $status Order Status
*
* @return $this
*/
public function setStatus(?string $status = null): self
{
$this->status = $status;
@@ -242,6 +244,9 @@ class Order
return $this;
}
/**
* Gets complete.
*
@@ -252,21 +257,22 @@ class Order
return $this->complete;
}
/**
* Sets complete.
*
* @param bool|null $complete
*
* @return $this
*/
* Sets complete.
*
* @param bool|null $complete
*
* @return $this
*/
public function setComplete(?bool $complete = null): self
{
$this->complete = $complete;
return $this;
}
}

View File

@@ -48,47 +48,47 @@ class Pet
/**
* @var int|null
* @SerializedName("id")
* @Assert\Type("int")
* @Type("int")
*/
*/
#[Assert\Type("int")]
protected ?int $id = null;
/**
* @var Category|null
* @SerializedName("category")
* @Assert\Type("OpenAPI\Server\Model\Category")
* @Type("OpenAPI\Server\Model\Category")
*/
*/
#[Assert\Type("OpenAPI\Server\Model\Category")]
protected ?Category $category = null;
/**
* @var string|null
* @SerializedName("name")
* @Assert\NotNull()
* @Assert\Type("string")
* @Type("string")
*/
*/
#[Assert\NotNull]
#[Assert\Type("string")]
protected ?string $name = null;
/**
* @var string[]|null
* @SerializedName("photoUrls")
* @Assert\NotNull()
* @Assert\All({
* @Assert\Type("string")
* })
* @Type("array<string>")
*/
*/
#[Assert\NotNull]
#[Assert\All([
new Assert\Type("string"),
])]
protected ?array $photoUrls = null;
/**
* @var Tag[]|null
* @SerializedName("tags")
* @Assert\All({
* @Assert\Type("OpenAPI\Server\Model\Tag")
* })
* @Type("array<OpenAPI\Server\Model\Tag>")
*/
*/
#[Assert\All([
new Assert\Type("OpenAPI\Server\Model\Tag"),
])]
protected ?array $tags = null;
/**
@@ -96,10 +96,10 @@ class Pet
*
* @var string|null
* @SerializedName("status")
* @Assert\Choice({ "available", "pending", "sold" })
* @Assert\Type("string")
* @Type("string")
*/
*/
#[Assert\Choice(["available", "pending", "sold"])]
#[Assert\Type("string")]
protected ?string $status = null;
/**
@@ -128,15 +128,13 @@ class Pet
return $this->id;
}
/**
* Sets id.
*
* @param int|null $id
*
* @return $this
*/
* Sets id.
*
* @param int|null $id
*
* @return $this
*/
public function setId(?int $id = null): self
{
$this->id = $id;
@@ -144,6 +142,9 @@ class Pet
return $this;
}
/**
* Gets category.
*
@@ -154,15 +155,13 @@ class Pet
return $this->category;
}
/**
* Sets category.
*
* @param Category|null $category
*
* @return $this
*/
* Sets category.
*
* @param Category|null $category
*
* @return $this
*/
public function setCategory(?Category $category = null): self
{
$this->category = $category;
@@ -170,6 +169,9 @@ class Pet
return $this;
}
/**
* Gets name.
*
@@ -180,15 +182,13 @@ class Pet
return $this->name;
}
/**
* Sets name.
*
* @param string|null $name
*
* @return $this
*/
* Sets name.
*
* @param string|null $name
*
* @return $this
*/
public function setName(?string $name): self
{
$this->name = $name;
@@ -196,6 +196,9 @@ class Pet
return $this;
}
/**
* Gets photoUrls.
*
@@ -206,15 +209,13 @@ class Pet
return $this->photoUrls;
}
/**
* Sets photoUrls.
*
* @param string[]|null $photoUrls
*
* @return $this
*/
* Sets photoUrls.
*
* @param string[]|null $photoUrls
*
* @return $this
*/
public function setPhotoUrls(?array $photoUrls): self
{
$this->photoUrls = $photoUrls;
@@ -222,6 +223,9 @@ class Pet
return $this;
}
/**
* Gets tags.
*
@@ -232,15 +236,13 @@ class Pet
return $this->tags;
}
/**
* Sets tags.
*
* @param Tag[]|null $tags
*
* @return $this
*/
* Sets tags.
*
* @param Tag[]|null $tags
*
* @return $this
*/
public function setTags(?array $tags = null): self
{
$this->tags = $tags;
@@ -248,6 +250,9 @@ class Pet
return $this;
}
/**
* Gets status.
*
@@ -258,21 +263,22 @@ class Pet
return $this->status;
}
/**
* Sets status.
*
* @param string|null $status pet status in the store
*
* @return $this
*/
* Sets status.
*
* @param string|null $status pet status in the store
*
* @return $this
*/
public function setStatus(?string $status = null): self
{
$this->status = $status;
return $this;
}
}

View File

@@ -48,17 +48,17 @@ class Tag
/**
* @var int|null
* @SerializedName("id")
* @Assert\Type("int")
* @Type("int")
*/
*/
#[Assert\Type("int")]
protected ?int $id = null;
/**
* @var string|null
* @SerializedName("name")
* @Assert\Type("string")
* @Type("string")
*/
*/
#[Assert\Type("string")]
protected ?string $name = null;
/**
@@ -83,15 +83,13 @@ class Tag
return $this->id;
}
/**
* Sets id.
*
* @param int|null $id
*
* @return $this
*/
* Sets id.
*
* @param int|null $id
*
* @return $this
*/
public function setId(?int $id = null): self
{
$this->id = $id;
@@ -99,6 +97,9 @@ class Tag
return $this;
}
/**
* Gets name.
*
@@ -109,21 +110,22 @@ class Tag
return $this->name;
}
/**
* Sets name.
*
* @param string|null $name
*
* @return $this
*/
* Sets name.
*
* @param string|null $name
*
* @return $this
*/
public function setName(?string $name = null): self
{
$this->name = $name;
return $this;
}
}

View File

@@ -48,57 +48,57 @@ class User
/**
* @var int|null
* @SerializedName("id")
* @Assert\Type("int")
* @Type("int")
*/
*/
#[Assert\Type("int")]
protected ?int $id = null;
/**
* @var string|null
* @SerializedName("username")
* @Assert\Type("string")
* @Type("string")
*/
*/
#[Assert\Type("string")]
protected ?string $username = null;
/**
* @var string|null
* @SerializedName("firstName")
* @Assert\Type("string")
* @Type("string")
*/
*/
#[Assert\Type("string")]
protected ?string $firstName = null;
/**
* @var string|null
* @SerializedName("lastName")
* @Assert\Type("string")
* @Type("string")
*/
*/
#[Assert\Type("string")]
protected ?string $lastName = null;
/**
* @var string|null
* @SerializedName("email")
* @Assert\Type("string")
* @Type("string")
*/
*/
#[Assert\Type("string")]
protected ?string $email = null;
/**
* @var string|null
* @SerializedName("password")
* @Assert\Type("string")
* @Type("string")
*/
*/
#[Assert\Type("string")]
protected ?string $password = null;
/**
* @var string|null
* @SerializedName("phone")
* @Assert\Type("string")
* @Type("string")
*/
*/
#[Assert\Type("string")]
protected ?string $phone = null;
/**
@@ -106,9 +106,9 @@ class User
*
* @var int|null
* @SerializedName("userStatus")
* @Assert\Type("int")
* @Type("int")
*/
*/
#[Assert\Type("int")]
protected ?int $userStatus = null;
/**
@@ -139,15 +139,13 @@ class User
return $this->id;
}
/**
* Sets id.
*
* @param int|null $id
*
* @return $this
*/
* Sets id.
*
* @param int|null $id
*
* @return $this
*/
public function setId(?int $id = null): self
{
$this->id = $id;
@@ -155,6 +153,9 @@ class User
return $this;
}
/**
* Gets username.
*
@@ -165,15 +166,13 @@ class User
return $this->username;
}
/**
* Sets username.
*
* @param string|null $username
*
* @return $this
*/
* Sets username.
*
* @param string|null $username
*
* @return $this
*/
public function setUsername(?string $username = null): self
{
$this->username = $username;
@@ -181,6 +180,9 @@ class User
return $this;
}
/**
* Gets firstName.
*
@@ -191,15 +193,13 @@ class User
return $this->firstName;
}
/**
* Sets firstName.
*
* @param string|null $firstName
*
* @return $this
*/
* Sets firstName.
*
* @param string|null $firstName
*
* @return $this
*/
public function setFirstName(?string $firstName = null): self
{
$this->firstName = $firstName;
@@ -207,6 +207,9 @@ class User
return $this;
}
/**
* Gets lastName.
*
@@ -217,15 +220,13 @@ class User
return $this->lastName;
}
/**
* Sets lastName.
*
* @param string|null $lastName
*
* @return $this
*/
* Sets lastName.
*
* @param string|null $lastName
*
* @return $this
*/
public function setLastName(?string $lastName = null): self
{
$this->lastName = $lastName;
@@ -233,6 +234,9 @@ class User
return $this;
}
/**
* Gets email.
*
@@ -243,15 +247,13 @@ class User
return $this->email;
}
/**
* Sets email.
*
* @param string|null $email
*
* @return $this
*/
* Sets email.
*
* @param string|null $email
*
* @return $this
*/
public function setEmail(?string $email = null): self
{
$this->email = $email;
@@ -259,6 +261,9 @@ class User
return $this;
}
/**
* Gets password.
*
@@ -269,15 +274,13 @@ class User
return $this->password;
}
/**
* Sets password.
*
* @param string|null $password
*
* @return $this
*/
* Sets password.
*
* @param string|null $password
*
* @return $this
*/
public function setPassword(?string $password = null): self
{
$this->password = $password;
@@ -285,6 +288,9 @@ class User
return $this;
}
/**
* Gets phone.
*
@@ -295,15 +301,13 @@ class User
return $this->phone;
}
/**
* Sets phone.
*
* @param string|null $phone
*
* @return $this
*/
* Sets phone.
*
* @param string|null $phone
*
* @return $this
*/
public function setPhone(?string $phone = null): self
{
$this->phone = $phone;
@@ -311,6 +315,9 @@ class User
return $this;
}
/**
* Gets userStatus.
*
@@ -321,21 +328,22 @@ class User
return $this->userStatus;
}
/**
* Sets userStatus.
*
* @param int|null $userStatus User Status
*
* @return $this
*/
* Sets userStatus.
*
* @param int|null $userStatus User Status
*
* @return $this
*/
public function setUserStatus(?int $userStatus = null): self
{
$this->userStatus = $userStatus;
return $this;
}
}