ProcessCancelDependingRegistrationsEvent   A
last analyzed

Complexity

Total Complexity 5

Size/Duplication

Total Lines 27
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 5
dl 0
loc 27
rs 10
c 1
b 0
f 0
wmc 5

5 Methods

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