Total Complexity | 5 |
Total Lines | 51 |
Duplicated Lines | 0 % |
Coverage | 100% |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
8 | class PostCreatedCommentsIEvent extends ApplicationInboundEvent |
||
9 | { |
||
10 | const EVENT_NAME = "POST_CREATED"; |
||
11 | |||
12 | private Ulid $id; |
||
13 | |||
14 | private string $title; |
||
15 | |||
16 | private array $tags; |
||
17 | |||
18 | /** |
||
19 | * @param array $data |
||
20 | */ |
||
21 | public function __construct(array $data) |
||
22 | { |
||
23 | parent::__construct($data); |
||
24 | $this->id = $this->ulid('id'); |
||
25 | $this->title = $this->string('title'); |
||
26 | $this->tags = $this->array('tags'); |
||
27 | } |
||
28 | |||
29 | 12 | /** |
|
30 | * @return Ulid |
||
31 | 12 | */ |
|
32 | 12 | public function getId(): Ulid |
|
33 | 12 | { |
|
34 | 12 | return $this->id; |
|
35 | 12 | } |
|
36 | 12 | ||
37 | 12 | /** |
|
38 | 12 | * @return string |
|
39 | 12 | */ |
|
40 | public function getTitle(): string |
||
43 | } |
||
44 | |||
45 | 11 | /** |
|
46 | * @return array |
||
47 | 11 | */ |
|
48 | public function getTags(): array |
||
51 | } |
||
52 | |||
53 | 11 | /** |
|
54 | * @return string |
||
55 | 11 | */ |
|
56 | public static function getName(): string |
||
61 | } |