ProcessPaymentInitializeEvent   A
last analyzed

Complexity

Total Complexity 9

Size/Duplication

Total Lines 50
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
eloc 9
dl 0
loc 50
rs 10
c 0
b 0
f 0
wmc 9

9 Methods

Rating   Name   Duplication   Size   Complexity  
A setUpdateRegistration() 0 3 1
A getUpdateRegistration() 0 3 1
A getVariables() 0 3 1
A setVariables() 0 3 1
A getPaymentController() 0 3 1
A getRegistration() 0 3 1
A getPaymentMethod() 0 3 1
A __construct() 0 8 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\Controller\PaymentController;
15
use DERHANSEN\SfEventMgt\Domain\Model\Registration;
16
use Psr\Http\Message\ServerRequestInterface;
17
18
/**
19
 * This event is triggered before the payment redirect view is rendered. This event must be used to process initialize
20
 * the payment process with the payment provider.
21
 */
22
final class ProcessPaymentInitializeEvent
23
{
24
    public function __construct(
25
        private array $variables,
26
        private readonly string $paymentMethod,
27
        private bool $updateRegistration,
28
        private readonly Registration $registration,
29
        private readonly PaymentController $paymentController,
30
        private readonly ServerRequestInterface $request
31
    ) {
32
    }
33
34
    public function getVariables(): array
35
    {
36
        return $this->variables;
37
    }
38
39
    public function getPaymentMethod(): string
40
    {
41
        return $this->paymentMethod;
42
    }
43
44
    public function getUpdateRegistration(): bool
45
    {
46
        return $this->updateRegistration;
47
    }
48
49
    public function getRegistration(): Registration
50
    {
51
        return $this->registration;
52
    }
53
54
    public function getPaymentController(): PaymentController
55
    {
56
        return $this->paymentController;
57
    }
58
59
    public function setVariables(array $variables): void
60
    {
61
        $this->variables = $variables;
62
    }
63
64
    public function setUpdateRegistration(bool $updateRegistration): void
65
    {
66
        $this->updateRegistration = $updateRegistration;
67
    }
68
69
    public function getRequest(): ServerRequestInterface
70
    {
71
        return $this->request;
72
    }
73
}
74