Skip to content

Commit

Permalink
Manually change Annotation to Attribute to test Symfony 7
Browse files Browse the repository at this point in the history
  • Loading branch information
dmetzner committed Jun 7, 2024
1 parent fa3bd6b commit 6167b1a
Show file tree
Hide file tree
Showing 34 changed files with 1,298 additions and 1,248 deletions.
49 changes: 12 additions & 37 deletions Model/BaseUser.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@
namespace OpenAPI\Server\Model;

use JMS\Serializer\Annotation\SerializedName;
use JMS\Serializer\Annotation\Type;
use Symfony\Component\Validator\Constraints as Assert;

/**
Expand All @@ -42,68 +41,44 @@ class BaseUser
{
/**
* Email of the user.
*
* @SerializedName("email")
*
* @Assert\Type("string")
*
* @Type("string")
*/
#[Assert\Type('string')]
#[SerializedName('email')]
protected ?string $email = null;

/**
* Name of the user | minLength: 3 | maxLength: 180.
*
* @SerializedName("username")
*
* @Assert\Type("string")
*
* @Type("string")
*/
#[Assert\Type('string')]
#[SerializedName('username')]
protected ?string $username = null;

/**
* A secure password | minLength: 6 | maxLength: 4096.
*
* @SerializedName("password")
*
* @Assert\Type("string")
*
* @Type("string")
*/
#[Assert\Type('string')]
#[SerializedName('password')]
protected ?string $password = null;

/**
* The profile picture of the user in data URI scheme.
*
* @SerializedName("picture")
*
* @Assert\Type("string")
*
* @Type("string")
*/
#[Assert\Type('string')]
#[SerializedName('picture')]
protected ?string $picture = null;

/**
* An introduction of the user.
*
* @SerializedName("about")
*
* @Assert\Type("string")
*
* @Type("string")
*/
#[Assert\Type('string')]
#[SerializedName('about')]
protected ?string $about = null;

/**
* A short description about the project the user is currently working on.
*
* @SerializedName("currentlyWorkingOn")
*
* @Assert\Type("string")
*
* @Type("string")
*/
#[Assert\Type('string')]
#[SerializedName('currentlyWorkingOn')]
protected ?string $currently_working_on = null;

/**
Expand Down
73 changes: 18 additions & 55 deletions Model/BasicUserDataResponse.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@
namespace OpenAPI\Server\Model;

use JMS\Serializer\Annotation\SerializedName;
use JMS\Serializer\Annotation\Type;
use Symfony\Component\Validator\Constraints as Assert;

/**
Expand All @@ -42,101 +41,65 @@ class BasicUserDataResponse
{
/**
* Unique ID of the user.
*
* @SerializedName("id")
*
* @Assert\Type("string")
*
* @Type("string")
*/
#[Assert\Type('string')]
#[SerializedName('id')]
protected ?string $id = null;

/**
* Nickname of the user.
*
* @SerializedName("username")
*
* @Assert\Type("string")
*
* @Type("string")
*/
#[Assert\Type('string')]
#[SerializedName('username')]
protected ?string $username = null;

/**
* The profile picture of the user in data URI scheme.
*
* @SerializedName("picture")
*
* @Assert\Type("string")
*
* @Type("string")
*/
#[Assert\Type('string')]
#[SerializedName('picture')]
protected ?string $picture = null;

/**
* An introduction of the user.
*
* @SerializedName("about")
*
* @Assert\Type("string")
*
* @Type("string")
*/
#[Assert\Type('string')]
#[SerializedName('about')]
protected ?string $about = null;

/**
* A short description about the project the user is currently working on.
*
* @SerializedName("currentlyWorkingOn")
*
* @Assert\Type("string")
*
* @Type("string")
*/
#[Assert\Type('string')]
#[SerializedName('currentlyWorkingOn')]
protected ?string $currently_working_on = null;

/**
* Amount of projects of the user.
*
* @SerializedName("projects")
*
* @Assert\Type("int")
*
* @Type("int")
*/
#[Assert\Type('int')]
#[SerializedName('projects')]
protected ?int $projects = null;

/**
* Amount of users that follow this user.
*
* @SerializedName("followers")
*
* @Assert\Type("int")
*
* @Type("int")
*/
#[Assert\Type('int')]
#[SerializedName('followers')]
protected ?int $followers = null;

/**
* Amount of users followed by this user.
*
* @SerializedName("following")
*
* @Assert\Type("int")
*
* @Type("int")
*/
#[Assert\Type('int')]
#[SerializedName('following')]
protected ?int $following = null;

/**
* Ranking score of this user.
*
* @SerializedName("ranking_score")
*
* @Assert\Type("int")
*
* @Type("int")
*/
#[Assert\Type('int')]
#[SerializedName('ranking_score')]
protected ?int $ranking_score = null;

/**
Expand Down
9 changes: 2 additions & 7 deletions Model/DryRun.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@
namespace OpenAPI\Server\Model;

use JMS\Serializer\Annotation\SerializedName;
use JMS\Serializer\Annotation\Type;
use Symfony\Component\Validator\Constraints as Assert;

/**
Expand All @@ -42,13 +41,9 @@ class DryRun
{
/**
* Indicates wether a request should only be verified or executed.
*
* @SerializedName("dry-run")
*
* @Assert\Type("bool")
*
* @Type("bool")
*/
#[Assert\Type('bool')]
#[SerializedName('dry-run')]
protected ?bool $dry_run = false;

/**
Expand Down
81 changes: 20 additions & 61 deletions Model/ExtendedUserDataResponse.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@
namespace OpenAPI\Server\Model;

use JMS\Serializer\Annotation\SerializedName;
use JMS\Serializer\Annotation\Type;
use Symfony\Component\Validator\Constraints as Assert;

/**
Expand All @@ -42,112 +41,72 @@ class ExtendedUserDataResponse
{
/**
* Unique ID of the user.
*
* @SerializedName("id")
*
* @Assert\Type("string")
*
* @Type("string")
*/
#[Assert\Type('string')]
#[SerializedName('id')]
protected ?string $id = null;

/**
* Nickname of the user.
*
* @SerializedName("username")
*
* @Assert\Type("string")
*
* @Type("string")
*/
#[Assert\Type('string')]
#[SerializedName('username')]
protected ?string $username = null;

/**
* The profile picture of the user in data URI scheme.
*
* @SerializedName("picture")
*
* @Assert\Type("string")
*
* @Type("string")
*/
#[Assert\Type('string')]
#[SerializedName('picture')]
protected ?string $picture = null;

/**
* An introduction of the user.
*
* @SerializedName("about")
*
* @Assert\Type("string")
*
* @Type("string")
*/
#[Assert\Type('string')]
#[SerializedName('about')]
protected ?string $about = null;

/**
* A short description about the project the user is currently working on.
*
* @SerializedName("currentlyWorkingOn")
*
* @Assert\Type("string")
*
* @Type("string")
*/
#[Assert\Type('string')]
#[SerializedName('currentlyWorkingOn')]
protected ?string $currently_working_on = null;

/**
* Amount of projects of the user.
*
* @SerializedName("projects")
*
* @Assert\Type("int")
*
* @Type("int")
*/
#[Assert\Type('int')]
#[SerializedName('projects')]
protected ?int $projects = null;

/**
* Amount of users that follow this user.
*
* @SerializedName("followers")
*
* @Assert\Type("int")
*
* @Type("int")
*/
#[Assert\Type('int')]
#[SerializedName('followers')]
protected ?int $followers = null;

/**
* Amount of users followed by this user.
*
* @SerializedName("following")
*
* @Assert\Type("int")
*
* @Type("int")
*/
#[Assert\Type('int')]
#[SerializedName('following')]
protected ?int $following = null;

/**
* Ranking score of this user.
*
* @SerializedName("ranking_score")
*
* @Assert\Type("int")
*
* @Type("int")
*/
#[Assert\Type('int')]
#[SerializedName('ranking_score')]
protected ?int $ranking_score = null;

/**
* EMail of the user.
*
* @SerializedName("email")
*
* @Assert\Type("string")
*
* @Type("string")
*/
#[Assert\Type('string')]
#[SerializedName('email')]
protected ?string $email = null;

/**
Expand Down
Loading

0 comments on commit 6167b1a

Please sign in to comment.