Total Complexity | 6 |
Total Lines | 37 |
Duplicated Lines | 0 % |
Coverage | 92.31% |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
12 | trait PostsBaseliner |
||
13 | { |
||
14 | |||
15 | |||
16 | public function __construct( |
||
17 | 24 | private PostsFindingRepositoryInterface $findingRepository, |
|
18 | private ApplicationEventPublisherInterface $eventPublisher |
||
19 | ) |
||
20 | { |
||
21 | } |
||
22 | 24 | ||
23 | public function baseline(BaselinePostsCommand $command): void |
||
27 | 1 | ||
28 | } |
||
29 | 1 | ||
30 | /** |
||
31 | * @param BaselinePostsCommand $command |
||
32 | */ |
||
33 | protected function baselineDeletedPosts(BaselinePostsCommand $command): void |
||
34 | 1 | { |
|
35 | $deletedPostIds = $this->findingRepository->findDeletedPostIdsForBaseline($command->getFrom()); |
||
36 | 1 | foreach ($deletedPostIds as $postId) { |
|
37 | $this->eventPublisher->publish(new PostDeletedOEvent(new DeleteExistingPostDto($postId))); |
||
38 | 1 | } |
|
39 | } |
||
40 | |||
41 | 1 | /** |
|
42 | * @param BaselinePostsCommand $command |
||
43 | */ |
||
44 | protected function baselineExistentPosts(BaselinePostsCommand $command): void |
||
49 | 1 | } |
|
50 | } |
||
51 | } |