ConfirmRegistrationInputType::__construct()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 30
Code Lines 18

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 28
CRAP Score 1

Importance

Changes 0
Metric Value
eloc 18
dl 0
loc 30
ccs 28
cts 28
cp 1
rs 9.6666
c 0
b 0
f 0
cc 1
nc 1
nop 0
crap 1
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Application\Api\Input;
6
7
use Application\Model\Country;
8
use Ecodev\Felix\Api\Scalar\PasswordType;
9
use GraphQL\Type\Definition\InputObjectType;
10
11
class ConfirmRegistrationInputType extends InputObjectType
12
{
13 2
    public function __construct()
14
    {
15 1
        $config = [
16 1
            'description' => 'Mandatory fields to complete a user registration',
17 1
            'fields' => fn (): array => [
18 2
                'password' => [
19 2
                    'type' => self::nonNull(_types()->get(PasswordType::class)),
20 2
                ],
21 2
                'firstName' => [
22 2
                    'type' => self::nonNull(self::string()),
23 2
                ],
24 2
                'lastName' => [
25 2
                    'type' => self::nonNull(self::string()),
26 2
                ],
27 2
                'street' => [
28 2
                    'type' => self::nonNull(self::string()),
29 2
                ],
30 2
                'postcode' => [
31 2
                    'type' => self::nonNull(self::string()),
32 2
                ],
33 2
                'locality' => [
34 2
                    'type' => self::nonNull(self::string()),
35 2
                ],
36 2
                'country' => [
37 2
                    'type' => self::nonNull(_types()->getId(Country::class)),
38 2
                ],
39 2
            ],
40 1
        ];
41
42 1
        parent::__construct($config);
43
    }
44
}
45