setProcessRedirect()   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\Controller\EventController;
15
use DERHANSEN\SfEventMgt\Domain\Model\Registration;
16
use Psr\Http\Message\ServerRequestInterface;
17
18
/**
19
 * This event is triggered before the user is redirected to the payment process after confirming the registration.
20
 * Use this event to decide, if the payment redirect should be processed (e.g. if waitlist registrations also must
21
 * be paid).
22
 */
23
final class ProcessRedirectToPaymentEvent
24
{
25
    private bool $processRedirect = true;
26
27
    public function __construct(
28
        private readonly Registration $registration,
29
        private readonly EventController $eventController,
30
        private readonly ServerRequestInterface $request
31
    ) {
32
    }
33
34
    public function getProcessRedirect(): bool
35
    {
36
        return $this->processRedirect;
37
    }
38
39
    public function setProcessRedirect(bool $processRedirect): void
40
    {
41
        $this->processRedirect = $processRedirect;
42
    }
43
44
    public function getRegistration(): Registration
45
    {
46
        return $this->registration;
47
    }
48
49
    public function getEventController(): EventController
50
    {
51
        return $this->eventController;
52
    }
53
54
    public function getRequest(): ServerRequestInterface
55
    {
56
        return $this->request;
57
    }
58
}
59