| Total Complexity | 8 |
| Total Lines | 65 |
| Duplicated Lines | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 7 | class TaskDto |
||
| 8 | { |
||
| 9 | private $assigneeId; |
||
| 10 | private $estimate; |
||
| 11 | private $id; |
||
| 12 | private $name; |
||
| 13 | private $projectId; |
||
| 14 | private $status; |
||
| 15 | |||
| 16 | public static function fromArray(array $data): self |
||
| 17 | { |
||
| 18 | return new self( |
||
| 19 | $data['assigneeId'], |
||
| 20 | $data['estimate'], |
||
| 21 | $data['id'], |
||
| 22 | $data['name'], |
||
| 23 | $data['projectId'], |
||
| 24 | new TaskStatus($data['status']), |
||
| 25 | ); |
||
| 26 | } |
||
| 27 | |||
| 28 | public function __construct( |
||
| 29 | string $assigneeId, |
||
| 30 | string $estimate, |
||
| 31 | string $id, |
||
| 32 | string $name, |
||
| 33 | string $projectId, |
||
| 34 | TaskStatus $status |
||
| 35 | ) { |
||
| 36 | $this->assigneeId = $assigneeId; |
||
| 37 | $this->estimate = $estimate; |
||
| 38 | $this->id = $id; |
||
| 39 | $this->name = $name; |
||
| 40 | $this->projectId = $projectId; |
||
| 41 | $this->status = $status; |
||
| 42 | } |
||
| 43 | |||
| 44 | public function assigneeId(): string |
||
| 45 | { |
||
| 46 | return $this->assigneeId; |
||
| 47 | } |
||
| 48 | |||
| 49 | public function estimate(): string |
||
| 50 | { |
||
| 51 | return $this->estimate; |
||
| 52 | } |
||
| 53 | |||
| 54 | public function id(): string |
||
| 55 | { |
||
| 56 | return $this->id; |
||
| 57 | } |
||
| 58 | |||
| 59 | public function name(): string |
||
| 60 | { |
||
| 61 | return $this->name; |
||
| 62 | } |
||
| 63 | |||
| 64 | public function projectId(): string |
||
| 67 | } |
||
| 68 | |||
| 69 | public function status(): TaskStatus |
||
| 70 | { |
||
| 71 | return $this->status; |
||
| 72 | } |
||
| 73 | } |
||
| 74 |