ModifyCreateDependingRegistrationsEvent   A
last analyzed

Complexity

Total Complexity 6

Size/Duplication

Total Lines 33
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
eloc 6
dl 0
loc 33
rs 10
c 0
b 0
f 0
wmc 6

6 Methods

Rating   Name   Duplication   Size   Complexity  
A getRegistration() 0 3 1
A getRequest() 0 3 1
A setCreateDependingRegistrations() 0 3 1
A getCreateDependingRegistrations() 0 3 1
A __construct() 0 6 1
A getEventController() 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\Controller\EventController;
15
use DERHANSEN\SfEventMgt\Domain\Model\Registration;
16
use Psr\Http\Message\ServerRequestInterface;
17
18
/**
19
 * This event is triggered before depending registrations are created. Use setCreateDependingRegistrations to
20
 * override the original bahavior
21
 */
22
final class ModifyCreateDependingRegistrationsEvent
23
{
24
    public function __construct(
25
        private readonly Registration $registration,
26
        private bool $createDependingRegistrations,
27
        private readonly EventController $eventController,
28
        private readonly ServerRequestInterface $request
29
    ) {
30
    }
31
32
    public function getRegistration(): Registration
33
    {
34
        return $this->registration;
35
    }
36
37
    public function getEventController(): EventController
38
    {
39
        return $this->eventController;
40
    }
41
42
    public function getCreateDependingRegistrations(): bool
43
    {
44
        return $this->createDependingRegistrations;
45
    }
46
47
    public function setCreateDependingRegistrations(bool $createDependingRegistrations): void
48
    {
49
        $this->createDependingRegistrations = $createDependingRegistrations;
50
    }
51
52
    public function getRequest(): ServerRequestInterface
53
    {
54
        return $this->request;
55
    }
56
}
57