setProcessCancellation()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 1
c 1
b 0
f 0
nc 1
nop 1
dl 0
loc 3
rs 10
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