| Total Complexity | 14 |
| Total Lines | 90 |
| Duplicated Lines | 0 % |
| Coverage | 100% |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 7 | final class Task |
||
| 8 | { |
||
| 9 | private int $id; |
||
| 10 | private string $name; |
||
| 11 | private ?string $description; |
||
| 12 | private int $status; |
||
| 13 | private int $userId; |
||
| 14 | private $createdAt; |
||
| 15 | private $updatedAt; |
||
| 16 | |||
| 17 | 2 | public function getId(): int |
|
| 18 | { |
||
| 19 | 2 | return $this->id; |
|
| 20 | } |
||
| 21 | |||
| 22 | 2 | public function getName(): string |
|
| 23 | { |
||
| 24 | 2 | return $this->name; |
|
| 25 | } |
||
| 26 | |||
| 27 | 3 | public function updateName(string $name): self |
|
| 28 | { |
||
| 29 | 3 | $this->name = $name; |
|
| 30 | |||
| 31 | 3 | return $this; |
|
| 32 | } |
||
| 33 | |||
| 34 | 2 | public function getDescription(): ?string |
|
| 35 | { |
||
| 36 | 2 | return $this->description; |
|
| 37 | } |
||
| 38 | |||
| 39 | 3 | public function updateDescription(?string $description): self |
|
| 40 | { |
||
| 41 | 3 | $this->description = $description; |
|
| 42 | |||
| 43 | 3 | return $this; |
|
| 44 | } |
||
| 45 | |||
| 46 | 2 | public function getStatus(): ?int |
|
| 47 | { |
||
| 48 | 2 | return $this->status; |
|
| 49 | } |
||
| 50 | |||
| 51 | 2 | public function updateStatus(?int $status): self |
|
| 52 | { |
||
| 53 | 2 | $this->status = $status; |
|
| 54 | |||
| 55 | 2 | return $this; |
|
| 56 | } |
||
| 57 | |||
| 58 | 2 | public function getUserId(): ?int |
|
| 59 | { |
||
| 60 | 2 | return $this->userId; |
|
| 61 | } |
||
| 62 | |||
| 63 | 2 | public function updateUserId(?int $userId): self |
|
| 64 | { |
||
| 65 | 2 | $this->userId = $userId; |
|
| 66 | |||
| 67 | 2 | return $this; |
|
| 68 | } |
||
| 69 | |||
| 70 | 1 | public function getCreatedAt(): ?string |
|
| 71 | { |
||
| 72 | 1 | return $this->createdAt; |
|
| 73 | } |
||
| 74 | |||
| 75 | 1 | public function updateCreatedAt(?string $createdAt): self |
|
| 76 | { |
||
| 77 | 1 | $this->createdAt = $createdAt; |
|
| 78 | |||
| 79 | 1 | return $this; |
|
| 80 | } |
||
| 81 | |||
| 82 | 1 | public function getUpdatedAt(): ?string |
|
| 85 | } |
||
| 86 | |||
| 87 | 1 | public function updateUpdatedAt(?string $updatedAt): self |
|
| 88 | { |
||
| 92 | } |
||
| 93 | |||
| 94 | 2 | public function toJson(): object |
|
| 95 | { |
||
| 96 | 2 | return json_decode((string) json_encode(get_object_vars($this)), false); |
|
| 97 | } |
||
| 98 | } |
||
| 99 |