Completed
Push — typo3-10-compatibility ( b4f2e1...42d8ec )
by Torben
03:17
created

ProcessPaymentInitializeEvent   A

Complexity

Total Complexity 8

Size/Duplication

Total Lines 97
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Importance

Changes 0
Metric Value
wmc 8
lcom 0
cbo 0
dl 0
loc 97
rs 10
c 0
b 0
f 0

8 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 13 1
A getVariables() 0 4 1
A getPaymentMethod() 0 4 1
A getUpdateRegistration() 0 4 1
A getRegistration() 0 4 1
A getPaymentController() 0 4 1
A setVariables() 0 4 1
A setUpdateRegistration() 0 4 1
1
<?php
2
declare(strict_types = 1);
3
namespace DERHANSEN\SfEventMgt\Event;
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
use DERHANSEN\SfEventMgt\Controller\PaymentController;
13
use DERHANSEN\SfEventMgt\Domain\Model\Registration;
14
15
/**
16
 * This event is triggered before the payment redirect view is rendered. This event must be used to process initialize
17
 * the payment process with the payment provider.
18
 */
19
final class ProcessPaymentInitializeEvent
20
{
21
    /**
22
     * @var array
23
     */
24
    private $variables;
25
26
    /**
27
     * @var string
28
     */
29
    private $paymentMethod;
30
31
    /**
32
     * @var bool
33
     */
34
    private $updateRegistration;
35
36
    /**
37
     * @var Registration
38
     */
39
    private $registration;
40
41
    /**
42
     * @var PaymentController
43
     */
44
    private $paymentController;
45
46
    public function __construct(
47
        array $variables,
48
        string $paymentMethod,
49
        bool $updateRegistration,
50
        Registration $registration,
51
        PaymentController $paymentController
52
    ) {
53
        $this->variables = $variables;
54
        $this->paymentMethod = $paymentMethod;
55
        $this->updateRegistration = $updateRegistration;
56
        $this->registration = $registration;
57
        $this->paymentController = $paymentController;
58
    }
59
60
    /**
61
     * @return array
62
     */
63
    public function getVariables(): array
64
    {
65
        return $this->variables;
66
    }
67
68
    /**
69
     * @return string
70
     */
71
    public function getPaymentMethod(): string
72
    {
73
        return $this->paymentMethod;
74
    }
75
76
    /**
77
     * @return bool
78
     */
79
    public function getUpdateRegistration(): bool
80
    {
81
        return $this->updateRegistration;
82
    }
83
84
    /**
85
     * @return Registration
86
     */
87
    public function getRegistration(): Registration
88
    {
89
        return $this->registration;
90
    }
91
92
    /**
93
     * @return PaymentController
94
     */
95
    public function getPaymentController(): PaymentController
96
    {
97
        return $this->paymentController;
98
    }
99
100
    /**
101
     * @param array $variables
102
     */
103
    public function setVariables(array $variables): void
104
    {
105
        $this->variables = $variables;
106
    }
107
108
    /**
109
     * @param bool $updateRegistration
110
     */
111
    public function setUpdateRegistration(bool $updateRegistration): void
112
    {
113
        $this->updateRegistration = $updateRegistration;
114
    }
115
}
116