Passed
Push — 6.x ( 33c2a9...4f5423 )
by Torben
03:14
created

ModifyUserMessageAttachmentsEvent   A

Complexity

Total Complexity 8

Size/Duplication

Total Lines 58
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 20
c 1
b 0
f 0
dl 0
loc 58
rs 10
wmc 8

8 Methods

Rating   Name   Duplication   Size   Complexity  
A getAttachments() 0 3 1
A getCustomNotification() 0 3 1
A getRegistration() 0 3 1
A __construct() 0 14 1
A getNotificationService() 0 3 1
A getType() 0 3 1
A getSettings() 0 3 1
A setAttachments() 0 3 1
1
<?php
2
3
declare(strict_types=1);
4
5
/*
6
 * This file is part of the Extension "sf_event_mgt" for TYPO3 CMS.
7
 *
8
 * For the full copyright and license information, please read the
9
 * LICENSE.txt file that was distributed with this source code.
10
 */
11
12
namespace DERHANSEN\SfEventMgt\Event;
13
14
use DERHANSEN\SfEventMgt\Domain\Model\Dto\CustomNotification;
15
use DERHANSEN\SfEventMgt\Domain\Model\Registration;
16
use DERHANSEN\SfEventMgt\Service\NotificationService;
17
18
/**
19
 * This event should be used to modify the attachments of a user message. Use the $type variable to distinguish
20
 * between the different types of messages
21
 */
22
final class ModifyUserMessageAttachmentsEvent
23
{
24
    private array $attachments;
25
    private Registration $registration;
26
    private int $type;
27
    private array $settings;
28
    private NotificationService $notificationService;
29
    private ?CustomNotification $customNotification;
30
31
    public function __construct(
32
        array $attachments,
33
        Registration $registration,
34
        int $type,
35
        array $settings,
36
        ?CustomNotification $customNotification,
37
        NotificationService $notificationService
38
    ) {
39
        $this->attachments = $attachments;
40
        $this->registration = $registration;
41
        $this->type = $type;
42
        $this->settings = $settings;
43
        $this->customNotification = $customNotification;
44
        $this->notificationService = $notificationService;
45
    }
46
47
    public function getAttachments(): array
48
    {
49
        return $this->attachments;
50
    }
51
52
    public function getRegistration(): Registration
53
    {
54
        return $this->registration;
55
    }
56
57
    public function getType(): int
58
    {
59
        return $this->type;
60
    }
61
62
    public function getSettings(): array
63
    {
64
        return $this->settings;
65
    }
66
67
    public function getCustomNotification(): ?CustomNotification
68
    {
69
        return $this->customNotification;
70
    }
71
72
    public function getNotificationService(): NotificationService
73
    {
74
        return $this->notificationService;
75
    }
76
77
    public function setAttachments(array $attachments): void
78
    {
79
        $this->attachments = $attachments;
80
    }
81
}
82