Code Coverage |
||||||||||||||||
Lines |
Branches |
Paths |
Functions and Methods |
Classes and Traits |
||||||||||||
| Total | |
91.30% |
21 / 23 |
|
87.50% |
14 / 16 |
|
87.50% |
14 / 16 |
|
87.50% |
14 / 16 |
CRAP | |
0.00% |
0 / 1 |
| Word | |
91.30% |
21 / 23 |
|
87.50% |
14 / 16 |
|
87.50% |
14 / 16 |
|
87.50% |
14 / 16 |
16.50 | |
0.00% |
0 / 1 |
| __construct | |
100.00% |
8 / 8 |
|
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
1 | |||
| getId | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
1 | |||
| getSlug | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
1 | |||
| setSlug | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
1 | |||
| getLabel | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
1 | |||
| setLabel | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
1 | |||
| getGender | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
1 | |||
| setGender | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
1 | |||
| getLang | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
1 | |||
| setLang | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
1 | |||
| getOffenseLevel | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
1 | |||
| setOffenseLevel | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
1 | |||
| getStatus | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
1 | |||
| setStatus | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
1 | |||
| getCreatedAt | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
| setCreatedAt | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
| 1 | <?php |
| 2 | |
| 3 | namespace App\Entity; |
| 4 | |
| 5 | use App\Enum\Lang; |
| 6 | use App\Enum\OffenseLevel; |
| 7 | use App\Enum\WordGender; |
| 8 | use App\Enum\WordStatus; |
| 9 | use Doctrine\ORM\Mapping as ORM; |
| 10 | |
| 11 | /** |
| 12 | * @author Wilhelm Zwertvaegher |
| 13 | */ |
| 14 | #[ORM\Entity] |
| 15 | #[ORM\Table(name: 'word')] |
| 16 | #[ORM\UniqueConstraint(name: 'uq_word_slug_lang', columns: ['slug', 'lang'])] |
| 17 | class Word |
| 18 | { |
| 19 | #[ORM\Id] |
| 20 | #[ORM\GeneratedValue] |
| 21 | #[ORM\Column(type: 'integer')] |
| 22 | private ?int $id = null; |
| 23 | |
| 24 | #[ORM\Column(type: 'string', length: 50)] |
| 25 | private string $slug; |
| 26 | |
| 27 | #[ORM\Column(type: 'string', length: 50)] |
| 28 | private string $label; |
| 29 | |
| 30 | #[ORM\Column(type: 'string', length: 10, enumType: WordGender::class)] |
| 31 | private WordGender $gender; |
| 32 | |
| 33 | #[ORM\Column(type: 'string', length: 10, enumType: Lang::class)] |
| 34 | private Lang $lang; |
| 35 | |
| 36 | #[ORM\Column(type: 'integer', length: 3, enumType: OffenseLevel::class)] |
| 37 | private OffenseLevel $offenseLevel; |
| 38 | |
| 39 | #[ORM\Column(type: 'string', length: 10, enumType: WordStatus::class)] |
| 40 | private WordStatus $status; |
| 41 | |
| 42 | #[ORM\Column(type: 'datetime_immutable')] |
| 43 | private \DateTimeImmutable $createdAt; |
| 44 | |
| 45 | #[ORM\Column(type: 'datetime_immutable')] |
| 46 | private \DateTimeImmutable $updatedAt; |
| 47 | |
| 48 | public function __construct( |
| 49 | string $slug, |
| 50 | string $label, |
| 51 | WordGender $gender, |
| 52 | Lang $lang, |
| 53 | OffenseLevel $offenseLevel, |
| 54 | WordStatus $status, |
| 55 | \DateTimeImmutable $createdAt, |
| 56 | \DateTimeImmutable $updatedAt, |
| 57 | ) { |
| 58 | $this->slug = $slug; |
| 59 | $this->label = $label; |
| 60 | $this->gender = $gender; |
| 61 | $this->lang = $lang; |
| 62 | $this->offenseLevel = $offenseLevel; |
| 63 | $this->status = $status; |
| 64 | $this->createdAt = $createdAt; |
| 65 | $this->updatedAt = $updatedAt; |
| 66 | } |
| 67 | |
| 68 | public function getId(): ?int |
| 69 | { |
| 70 | return $this->id; |
| 71 | } |
| 72 | |
| 73 | public function getSlug(): string |
| 74 | { |
| 75 | return $this->slug; |
| 76 | } |
| 77 | |
| 78 | public function setSlug(string $slug): void |
| 79 | { |
| 80 | $this->slug = $slug; |
| 81 | } |
| 82 | |
| 83 | public function getLabel(): string |
| 84 | { |
| 85 | return $this->label; |
| 86 | } |
| 87 | |
| 88 | public function setLabel(string $label): void |
| 89 | { |
| 90 | $this->label = $label; |
| 91 | } |
| 92 | |
| 93 | public function getGender(): WordGender |
| 94 | { |
| 95 | return $this->gender; |
| 96 | } |
| 97 | |
| 98 | public function setGender(WordGender $gender): void |
| 99 | { |
| 100 | $this->gender = $gender; |
| 101 | } |
| 102 | |
| 103 | public function getLang(): Lang |
| 104 | { |
| 105 | return $this->lang; |
| 106 | } |
| 107 | |
| 108 | public function setLang(Lang $lang): void |
| 109 | { |
| 110 | $this->lang = $lang; |
| 111 | } |
| 112 | |
| 113 | public function getOffenseLevel(): OffenseLevel |
| 114 | { |
| 115 | return $this->offenseLevel; |
| 116 | } |
| 117 | |
| 118 | public function setOffenseLevel(OffenseLevel $offenseLevel): void |
| 119 | { |
| 120 | $this->offenseLevel = $offenseLevel; |
| 121 | } |
| 122 | |
| 123 | public function getStatus(): WordStatus |
| 124 | { |
| 125 | return $this->status; |
| 126 | } |
| 127 | |
| 128 | public function setStatus(WordStatus $status): void |
| 129 | { |
| 130 | $this->status = $status; |
| 131 | } |
| 132 | |
| 133 | public function getCreatedAt(): \DateTimeImmutable |
| 134 | { |
| 135 | return $this->createdAt; |
| 136 | } |
| 137 | |
| 138 | public function setCreatedAt(\DateTimeImmutable $createdAt): void |
| 139 | { |
| 140 | $this->createdAt = $createdAt; |
| 141 | } |
| 142 | } |