Passed
Push — 7.x ( 46400b...fb51d4 )
by Torben
03:19
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

4 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 5 1
A getResult() 0 3 1
A getSettings() 0 3 1
A getRegistration() 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\Domain\Model\Registration;
15
use TYPO3\CMS\Extbase\Error\Result;
0 ignored issues
show
Bug introduced by
The type TYPO3\CMS\Extbase\Error\Result was not found. Maybe you did not declare it correctly or list all dependencies?

The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g. excluded_paths: ["lib/*"], you can move it to the dependency path list as follows:

filter:
    dependency_paths: ["lib/*"]

For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths

Loading history...
16
17
/**
18
 * This event should be used to modify the result of the RegistrationValidator. As an example, additional validation
19
 * tasks on registration object can be performed and potential validation failures can be added to the result.
20
 *
21
 * Example usage: $event->getResult()->forProperty('zip')->addError(new Error('Error for ZIP field', 1726287471));
22
 */
23
final class ModifyRegistrationValidatorResultEvent
24
{
25
    public function __construct(
26
        private Registration $registration,
27
        private array $settings,
28
        private Result $result
29
    ) {
30
    }
31
32
    public function getRegistration(): Registration
33
    {
34
        return $this->registration;
35
    }
36
37
    public function getSettings(): array
38
    {
39
        return $this->settings;
40
    }
41
42
    public function getResult(): Result
43
    {
44
        return $this->result;
45
    }
46
}
47