Total Complexity | 4 |
Total Lines | 41 |
Duplicated Lines | 0 % |
Coverage | 100% |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
8 | class CommentCreatedPostsIEvent extends ApplicationInboundEvent |
||
9 | { |
||
10 | const EVENT_NAME = "COMMENT_CREATED"; |
||
11 | |||
12 | private Ulid $postId; |
||
13 | |||
14 | private array $comments; |
||
15 | |||
16 | /** |
||
17 | * @param array $data |
||
18 | */ |
||
19 | public function __construct(array $data) |
||
20 | 3 | { |
|
21 | parent::__construct( $data); |
||
22 | 3 | $this->postId = $this->ulid('postId'); |
|
23 | 3 | $this->comments = [$this->array('comment')]; |
|
24 | 3 | } |
|
25 | 3 | ||
26 | |||
27 | /** |
||
28 | * @return Ulid|null |
||
29 | */ |
||
30 | public function getPostId(): ?Ulid |
||
31 | 2 | { |
|
32 | return $this->postId; |
||
33 | 2 | } |
|
34 | |||
35 | /** |
||
36 | * @return array |
||
37 | */ |
||
38 | public function getComments(): array |
||
39 | 2 | { |
|
40 | return $this->comments; |
||
41 | 2 | } |
|
42 | |||
43 | /** |
||
44 | 1 | * @return string |
|
45 | */ |
||
46 | public static function getName(): string |
||
49 | } |
||
50 | |||
51 | } |