Passed
Push — develop ( fb51d4...04b959 )
by Torben
02:42 queued 14s
created

ModifyRegistrationValidatorResultEvent   A

Complexity

Total Complexity 4

Size/Duplication

Total Lines 22
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 4
c 1
b 0
f 0
dl 0
loc 22
rs 10
wmc 4
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
use TYPO3\CMS\Extbase\Error\Result;
17
18
/**
19
 * This event should be used to modify the result of the RegistrationValidator. As an example, additional validation
20
 * tasks on registration object can be performed and potential validation failures can be added to the result.
21
 *
22
 * Example usage: $event->getResult()->forProperty('zip')->addError(new Error('Error for ZIP field', 1726287471));
23
 */
24
final readonly class ModifyRegistrationValidatorResultEvent
0 ignored issues
show
Bug introduced by
A parse error occurred: Syntax error, unexpected T_READONLY, expecting T_CLASS on line 24 at column 6
Loading history...
25
{
26
    public function __construct(
27
        private Registration $registration,
28
        private array $settings,
29
        private Result $result,
30
        private ServerRequestInterface $request
31
    ) {
32
    }
33
34
    public function getRegistration(): Registration
35
    {
36
        return $this->registration;
37
    }
38
39
    public function getSettings(): array
40
    {
41
        return $this->settings;
42
    }
43
44
    public function getResult(): Result
45
    {
46
        return $this->result;
47
    }
48
49
    public function getRequest(): ServerRequestInterface
50
    {
51
        return $this->request;
52
    }
53
}
54