Skip to content

Commit

Permalink
#469 enum p2
Browse files Browse the repository at this point in the history
  • Loading branch information
eventhorizonpl committed Jan 27, 2022
1 parent d382a8e commit 2fb3cde
Show file tree
Hide file tree
Showing 16 changed files with 57 additions and 57 deletions.
6 changes: 3 additions & 3 deletions src/Entity/AccountOperation.php
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ class AccountOperation
#[Assert\NotBlank(groups: ['system'])]
#[Assert\Type('string', groups: ['system'])]
#[ORM\Column(length: 8, type: Types::STRING)]
private string $type;
private AccountOperationTypeEnum $type;

public function __construct()
{
Expand Down Expand Up @@ -129,7 +129,7 @@ public function setSmsNotifications(int $smsNotifications): self
return $this;
}

public function getType(): ?string
public function getType(): ?AccountOperationTypeEnum
{
return $this->type;
}
Expand All @@ -147,7 +147,7 @@ public static function getTypeValidationChoices(): array
return array_keys(self::getTypeFormChoices());
}

public function setType(string $type): self
public function setType(AccountOperationTypeEnum $type): self
{
if (!(\in_array($type, self::getTypeValidationChoices(), true))) {
throw new InvalidArgumentException('Invalid type');
Expand Down
6 changes: 3 additions & 3 deletions src/Entity/Achievement.php
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ class Achievement
#[Assert\NotBlank(groups: ['form', 'system'])]
#[Assert\Type('string', groups: ['form', 'system'])]
#[ORM\Column(length: 24, type: Types::STRING)]
private ?string $type;
private ?AchievementTypeEnum $type;

public function __construct()
{
Expand Down Expand Up @@ -120,7 +120,7 @@ public function setRequirement(?int $requirement): self
return $this;
}

public function getType(): ?string
public function getType(): ?AchievementTypeEnum
{
return $this->type;
}
Expand All @@ -140,7 +140,7 @@ public static function getTypeValidationChoices(): array
return array_keys(self::getTypeFormChoices());
}

public function setType(?string $type): self
public function setType(?AchievementTypeEnum $type): self
{
if (!(\in_array($type, self::getTypeValidationChoices(), true))) {
throw new InvalidArgumentException('Invalid type');
Expand Down
6 changes: 3 additions & 3 deletions src/Entity/Answer.php
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ class Answer
#[Assert\NotBlank(groups: ['form', 'system'])]
#[Assert\Type('string', groups: ['form', 'system'])]
#[ORM\Column(length: 24, type: Types::STRING)]
private string $type;
private AnswerTypeEnum $type;

public function __construct()
{
Expand Down Expand Up @@ -81,7 +81,7 @@ public function setQuestion(Question $question): self
return $this;
}

public function getType(): ?string
public function getType(): ?AnswerTypeEnum
{
return $this->type;
}
Expand All @@ -99,7 +99,7 @@ public static function getTypeValidationChoices(): array
return array_keys(self::getTypeFormChoices());
}

public function setType(string $type): self
public function setType(AnswerTypeEnum $type): self
{
if (!(\in_array($type, self::getTypeValidationChoices(), true))) {
throw new InvalidArgumentException('Invalid type');
Expand Down
12 changes: 6 additions & 6 deletions src/Entity/Contact.php
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ class Contact
#[Assert\NotBlank(groups: ['system'])]
#[Assert\Type('string', groups: ['system'])]
#[ORM\Column(length: 8, type: Types::STRING)]
private string $status;
private ContactStatusEnum $status;

#[Assert\Length(groups: ['form', 'system'], max: 255)]
#[Assert\NotBlank(groups: ['form', 'system'])]
Expand All @@ -59,7 +59,7 @@ class Contact
#[Assert\Type('string', groups: ['form', 'system'])]
#[Groups(['gdpr'])]
#[ORM\Column(length: 16, type: Types::STRING)]
private string $type;
private ContactTypeEnum $type;

public function __construct()
{
Expand Down Expand Up @@ -99,7 +99,7 @@ public function setContent(?string $content): self
return $this;
}

public function getStatus(): ?string
public function getStatus(): ?ContactStatusEnum
{
return $this->status;
}
Expand All @@ -121,7 +121,7 @@ public static function getStatusValidationChoices(): array
return array_keys(self::getStatusFormChoices());
}

public function setStatus(string $status): self
public function setStatus(ContactStatusEnum $status): self
{
if (!(\in_array($status, self::getStatusValidationChoices(), true))) {
throw new InvalidArgumentException('Invalid status');
Expand All @@ -144,7 +144,7 @@ public function setTitle(?string $title): self
return $this;
}

public function getType(): ?string
public function getType(): ?ContactTypeEnum
{
return $this->type;
}
Expand All @@ -162,7 +162,7 @@ public static function getTypeValidationChoices(): array
return array_keys(self::getTypeFormChoices());
}

public function setType(string $type): self
public function setType(ContactTypeEnum $type): self
{
if (!(\in_array($type, self::getTypeValidationChoices(), true))) {
throw new InvalidArgumentException('Invalid type');
Expand Down
6 changes: 3 additions & 3 deletions src/Entity/Profile.php
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ class Profile
#[Assert\Type('string')]
#[Groups(['gdpr'])]
#[ORM\Column(length: 8, nullable: true, type: Types::STRING)]
private ?string $theme;
private ?ProfileThemeEnum $theme;

#[Assert\Length(max: 36)]
#[Assert\Timezone]
Expand Down Expand Up @@ -291,7 +291,7 @@ public function setShowMotivationalMessages(bool $showMotivationalMessages): sel
return $this;
}

public function getTheme(): ?string
public function getTheme(): ?ProfileThemeEnum
{
return $this->theme;
}
Expand All @@ -309,7 +309,7 @@ public static function getThemeValidationChoices(): array
return array_keys(self::getThemeFormChoices());
}

public function setTheme(?string $theme): self
public function setTheme(?ProfileThemeEnum $theme): self
{
if (!(\in_array($theme, self::getThemeValidationChoices(), true))) {
throw new InvalidArgumentException('Invalid theme');
Expand Down
6 changes: 3 additions & 3 deletions src/Entity/Promotion.php
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ class Promotion
#[Assert\NotBlank(groups: ['form', 'system'])]
#[Assert\Type('string', groups: ['form', 'system'])]
#[ORM\Column(length: 24, type: Types::STRING)]
private string $type;
private PromotionTypeEnum $type;

public function __construct()
{
Expand Down Expand Up @@ -159,7 +159,7 @@ public function setSmsNotifications(int $smsNotifications): self
return $this;
}

public function getType(): ?string
public function getType(): ?PromotionTypeEnum
{
return $this->type;
}
Expand All @@ -178,7 +178,7 @@ public static function getTypeValidationChoices(): array
return array_keys(self::getTypeFormChoices());
}

public function setType(string $type): self
public function setType(PromotionTypeEnum $type): self
{
if (!(\in_array($type, self::getTypeValidationChoices(), true))) {
throw new InvalidArgumentException('Invalid type');
Expand Down
6 changes: 3 additions & 3 deletions src/Entity/Question.php
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ class Question
#[Assert\NotBlank(groups: ['form', 'system'])]
#[Assert\Type('string', groups: ['form', 'system'])]
#[ORM\Column(length: 24, type: Types::STRING)]
private string $type;
private QuestionTypeEnum $type;

public function __construct()
{
Expand Down Expand Up @@ -111,7 +111,7 @@ public function setTitle(?string $title): self
return $this;
}

public function getType(): ?string
public function getType(): ?QuestionTypeEnum
{
return $this->type;
}
Expand All @@ -129,7 +129,7 @@ public static function getTypeValidationChoices(): array
return array_keys(self::getTypeFormChoices());
}

public function setType(string $type): self
public function setType(QuestionTypeEnum $type): self
{
if (!(\in_array($type, self::getTypeValidationChoices(), true))) {
throw new InvalidArgumentException('Invalid type');
Expand Down
6 changes: 3 additions & 3 deletions src/Entity/Reminder.php
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ class Reminder
#[Assert\Type('string', groups: ['form', 'system'])]
#[Groups(['gdpr'])]
#[ORM\Column(length: 10, type: Types::STRING)]
private string $type;
private ReminderTypeEnum $type;

public function __construct()
{
Expand Down Expand Up @@ -344,7 +344,7 @@ public function removeSentReminder(SentReminder $sentReminder): self
return $this;
}

public function getType(): ?string
public function getType(): ?ReminderTypeEnum
{
return $this->type;
}
Expand All @@ -368,7 +368,7 @@ public static function getTypeValidationChoices(): array
return array_keys(self::getTypeFormChoices());
}

public function setType(string $type): self
public function setType(ReminderTypeEnum $type): self
{
if (!(\in_array($type, self::getTypeValidationChoices(), true))) {
throw new InvalidArgumentException('Invalid type');
Expand Down
12 changes: 6 additions & 6 deletions src/Entity/ReminderMessage.php
Original file line number Diff line number Diff line change
Expand Up @@ -58,14 +58,14 @@ class ReminderMessage
#[Assert\Length(groups: ['system'], max: 10)]
#[Assert\Type('string', groups: ['system'])]
#[ORM\Column(length: 10, nullable: true, type: Types::STRING)]
private ?string $thirdPartySystemType;
private ?ReminderMessageThirdPartySystemTypeEnum $thirdPartySystemType;

#[Assert\Choice(callback: 'getTypeValidationChoices', groups: ['system'])]
#[Assert\Length(groups: ['system'], max: 10)]
#[Assert\NotBlank(groups: ['system'])]
#[Assert\Type('string', groups: ['system'])]
#[ORM\Column(length: 10, type: Types::STRING)]
private string $type;
private ReminderMessageTypeEnum $type;

public function __construct()
{
Expand Down Expand Up @@ -165,7 +165,7 @@ public function setThirdPartySystemResponse(?string $thirdPartySystemResponse):
return $this;
}

public function getThirdPartySystemType(): ?string
public function getThirdPartySystemType(): ?ReminderMessageThirdPartySystemTypeEnum
{
return $this->thirdPartySystemType;
}
Expand All @@ -183,7 +183,7 @@ public static function getThirdPartySystemTypeValidationChoices(): array
return array_keys(self::getThirdPartySystemTypeFormChoices());
}

public function setThirdPartySystemType(?string $thirdPartySystemType): self
public function setThirdPartySystemType(?ReminderMessageThirdPartySystemTypeEnum $thirdPartySystemType): self
{
if (!(\in_array($thirdPartySystemType, self::getThirdPartySystemTypeValidationChoices(), true))) {
throw new InvalidArgumentException('Invalid third party system type');
Expand All @@ -194,7 +194,7 @@ public function setThirdPartySystemType(?string $thirdPartySystemType): self
return $this;
}

public function getType(): ?string
public function getType(): ?ReminderMessageTypeEnum
{
return $this->type;
}
Expand All @@ -213,7 +213,7 @@ public static function getTypeValidationChoices(): array
return array_keys(self::getTypeFormChoices());
}

public function setType(string $type): self
public function setType(ReminderMessageTypeEnum $type): self
{
if (!(\in_array($type, self::getTypeValidationChoices(), true))) {
throw new InvalidArgumentException('Invalid type');
Expand Down
12 changes: 6 additions & 6 deletions src/Entity/Report.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,14 +29,14 @@ class Report
#[Assert\NotBlank(groups: ['system'])]
#[Assert\Type('string', groups: ['system'])]
#[ORM\Column(length: 12, type: Types::STRING)]
private string $status;
private ReportStatusEnum $status;

#[Assert\Choice(callback: 'getTypeValidationChoices', groups: ['system'])]
#[Assert\Length(groups: ['system'], max: 24)]
#[Assert\NotBlank(groups: ['system'])]
#[Assert\Type('string', groups: ['system'])]
#[ORM\Column(length: 24, type: Types::STRING)]
private string $type;
private ReportTypeEnum $type;

public function __construct()
{
Expand Down Expand Up @@ -68,7 +68,7 @@ public function setData(array $data): self
return $this;
}

public function getStatus(): ?string
public function getStatus(): ?ReportStatusEnum
{
return $this->status;
}
Expand All @@ -87,7 +87,7 @@ public static function getStatusValidationChoices(): array
return array_keys(self::getStatusFormChoices());
}

public function setStatus(string $status): self
public function setStatus(ReportStatusEnum $status): self
{
if (!(\in_array($status, self::getStatusValidationChoices(), true))) {
throw new InvalidArgumentException('Invalid status');
Expand All @@ -98,7 +98,7 @@ public function setStatus(string $status): self
return $this;
}

public function getType(): ?string
public function getType(): ?ReportTypeEnum
{
return $this->type;
}
Expand All @@ -115,7 +115,7 @@ public static function getTypeValidationChoices(): array
return array_keys(self::getTypeFormChoices());
}

public function setType(string $type): self
public function setType(ReportTypeEnum $type): self
{
if (!(\in_array($type, self::getTypeValidationChoices(), true))) {
throw new InvalidArgumentException('Invalid type');
Expand Down
6 changes: 3 additions & 3 deletions src/Entity/Reward.php
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ class Reward
#[Assert\Type('string', groups: ['form', 'system'])]
#[Groups(['gdpr'])]
#[ORM\Column(length: 24, type: Types::STRING)]
private string $type;
private RewardTypeEnum $type;

public function __construct()
{
Expand Down Expand Up @@ -193,7 +193,7 @@ public function setRoutine(Routine $routine): self
return $this;
}

public function getType(): ?string
public function getType(): ?RewardTypeEnum
{
return $this->type;
}
Expand All @@ -212,7 +212,7 @@ public static function getTypeValidationChoices(): array
return array_keys(self::getTypeFormChoices());
}

public function setType(string $type): self
public function setType(RewardTypeEnum $type): self
{
if (!(\in_array($type, self::getTypeValidationChoices(), true))) {
throw new InvalidArgumentException('Invalid type');
Expand Down
Loading

0 comments on commit 2fb3cde

Please sign in to comment.