Passed
Push — main ( dc275a...8e4fcf )
by Slawomir
04:22
created

PostBaselinedOEvent::__construct()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 16
Code Lines 11

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 11
c 1
b 0
f 0
nc 1
nop 1
dl 0
loc 16
rs 9.9
1
<?php
2
3
namespace App\Modules\Posts\Domain\Event\Outbound;
4
5
use App\Infrastructure\Events\ApplicationOutboundEvent;
6
use App\Modules\Posts\Domain\Dto\PostForBaselineDto;
7
use Symfony\Component\Uid\Ulid;
8
9
class PostBaselinedOEvent extends ApplicationOutboundEvent
10
{
11
    const EVENT_NAME = "POST_BASELINED";
12
13
    /**
14
     * @param PostForBaselineDto $baselinedPost
15
     */
16
    public function __construct(
17
        PostForBaselineDto $baselinedPost
18
    )
19
    {
20
        parent::__construct(self::EVENT_NAME,
21
            [
22
                'id' => $baselinedPost->getId(),
23
                'title' => $baselinedPost->getTitle(),
24
                'summary' => $baselinedPost->getSummary(),
25
                'body' => $baselinedPost->getBody(),
26
                'tags' => $baselinedPost->getTags(),
27
                'createdById' => $baselinedPost->getCreatedById(),
28
                'createdByName' => $baselinedPost->getCreatedByName(),
29
                'createdAt' => $baselinedPost->getCreatedAt(),
30
                'updatedAt' => $baselinedPost->getUpdatedAt(),
31
                'version' => $baselinedPost->getVersion()
32
            ]
33
        );
34
    }
35
36
37
}