Passed
Push — 6.x ( d56ffd...261295 )
by Torben
03:05
created

ProcessCancelDependingRegistrationsEvent   A

Complexity

Total Complexity 4

Size/Duplication

Total Lines 24
Duplicated Lines 0 %

Importance

Changes 2
Bugs 0 Features 0
Metric Value
eloc 8
c 2
b 0
f 0
dl 0
loc 24
rs 10
wmc 4

4 Methods

Rating   Name   Duplication   Size   Complexity  
A setProcessCancellation() 0 3 1
A __construct() 0 4 1
A getProcessCancellation() 0 3 1
A getRegistration() 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\Registration;
15
16
/**
17
 * This event is triggered before the depending registrations are cancelled. Event listeners can use this
18
 * event to stop cancellation of depending registrations by setting `$processCancellation` to false
19
 */
20
final class ProcessCancelDependingRegistrationsEvent
21
{
22
    private Registration $registration;
23
    private bool $processCancellation;
24
25
    public function __construct(Registration $registration, bool $processCancellation)
26
    {
27
        $this->registration = $registration;
28
        $this->processCancellation = $processCancellation;
29
    }
30
31
    public function getRegistration(): Registration
32
    {
33
        return $this->registration;
34
    }
35
36
    public function getProcessCancellation(): bool
37
    {
38
        return $this->processCancellation;
39
    }
40
41
    public function setProcessCancellation(bool $processCancellation): void
42
    {
43
        $this->processCancellation = $processCancellation;
44
    }
45
}
46