Completed
Pull Request — master (#130)
by Gorka
02:47
created

TaskCreated::priority()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 4
rs 10
c 0
b 0
f 0
cc 1
eloc 2
nc 1
nop 0
1
<?php
2
3
/*
4
 * This file is part of the Kreta package.
5
 *
6
 * (c) Beñat Espiña <[email protected]>
7
 * (c) Gorka Laucirica <[email protected]>
8
 *
9
 * For the full copyright and license information, please view the LICENSE
10
 * file that was distributed with this source code.
11
 */
12
13
declare(strict_types=1);
14
15
namespace Kreta\TaskManager\Domain\Model\Project\Task;
16
17
use Kreta\SharedKernel\Domain\Model\DomainEvent;
18
use Kreta\TaskManager\Domain\Model\Organization\Participant;
19
20
class TaskCreated implements DomainEvent
21
{
22
    private $id;
23
    private $title;
24
    private $description;
25
    private $creator;
26
    private $assignee;
27
    private $priority;
28
    private $parentId;
29
    private $occurredOn;
30
31
    public function __construct(
32
        TaskId $id,
33
        TaskTitle $title,
34
        string $description,
35
        Participant $creator,
36
        Participant $assignee,
37
        TaskPriority $priority,
38
        TaskId $parentId = null
39
    ) {
40
        $this->id = $id;
41
        $this->title = $title;
42
        $this->description = $description;
43
        $this->creator = $creator;
44
        $this->assignee = $assignee;
45
        $this->priority = $priority;
46
        $this->parentId = $parentId;
47
        $this->occurredOn = new \DateTimeImmutable();
48
    }
49
50
    public function id() : TaskId
51
    {
52
        return $this->id;
53
    }
54
55
    public function title() : TaskTitle
56
    {
57
        return $this->title;
58
    }
59
60
    public function description() : string
61
    {
62
        return $this->description;
63
    }
64
65
    public function creator() : Participant
66
    {
67
        return $this->creator;
68
    }
69
70
    public function assignee() : Participant
71
    {
72
        return $this->assignee;
73
    }
74
75
    public function priority() : TaskPriority
76
    {
77
        return $this->priority;
78
    }
79
80
    public function parentId()
81
    {
82
        return $this->parentId;
83
    }
84
85
    public function occurredOn() : \DateTimeInterface
86
    {
87
        return $this->occurredOn;
88
    }
89
}
90