SheetProcessResponse::__construct()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 18
Code Lines 16

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 16
c 1
b 0
f 0
nc 1
nop 1
dl 0
loc 18
ccs 0
cts 0
cp 0
crap 2
rs 9.7333
1
<?php declare(strict_types=1);
2
/*
3
 * This file is part of FlexPHP.
4
 *
5
 * (c) Freddie Gar <[email protected]>
6
 *
7
 * For the full copyright and license information, please view the LICENSE
8
 * file that was distributed with this source code.
9
 */
10
namespace FlexPHP\Generator\Domain\Messages\Responses;
11
12
final class SheetProcessResponse
13
{
14
    public ?string $controller = null;
15
16
    public ?string $entity = null;
17
18
    public ?string $gateway = null;
19
20
    public ?string $concreteGateway = null;
21
22
    public ?string $factory = null;
23
24 3
    public ?string $repository = null;
25
26 3
    public ?string $constraint = null;
27 3
28 3
    public ?string $translate = null;
29 3
30
    public ?string $formType = null;
31
32
    /**
33
     * @var array<int, string>
34
     */
35
    public array $requests = [];
36
37
    /**
38
     * @var array<int, string>
39
     */
40
    public array $responses = [];
41
42
    /**
43
     * @var array<int, string>
44
     */
45
    public array $useCases = [];
46
47
    /**
48
     * @var array<int, string>
49
     */
50
    public array $commands = [];
51
52
    /**
53
     * @var array<int, string>
54
     */
55
    public array $templates = [];
56
57
    public ?string $javascript = null;
58
59
    public ?string $filterForm = null;
60
61
    public function __construct(array $response)
62
    {
63
        $this->controller = $response['controller'] ?? null;
64
        $this->entity = $response['entity'] ?? null;
65
        $this->gateway = $response['gateway'] ?? null;
66
        $this->concreteGateway = $response['concreteGateway'] ?? null;
67
        $this->factory = $response['factory'] ?? null;
68
        $this->repository = $response['repository'] ?? null;
69
        $this->constraint = $response['constraint'] ?? null;
70
        $this->translate = $response['translate'] ?? null;
71
        $this->formType = $response['formType'] ?? null;
72
        $this->filterForm = $response['filterForm'] ?? null;
73
        $this->requests = $response['requests'] ?? [];
74
        $this->responses = $response['responses'] ?? [];
75
        $this->useCases = $response['useCases'] ?? [];
76
        $this->commands = $response['commands'] ?? [];
77
        $this->templates = $response['templates'] ?? [];
78
        $this->javascript = $response['javascript'] ?? null;
79
    }
80
}
81