UnverifiedSecondFactor::jsonSerialize()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 6
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 4
nc 1
nop 0
dl 0
loc 6
rs 10
c 0
b 0
f 0
1
<?php
2
3
/**
4
 * Copyright 2014 SURFnet bv
5
 *
6
 * Licensed under the Apache License, Version 2.0 (the "License");
7
 * you may not use this file except in compliance with the License.
8
 * You may obtain a copy of the License at
9
 *
10
 *     http://www.apache.org/licenses/LICENSE-2.0
11
 *
12
 * Unless required by applicable law or agreed to in writing, software
13
 * distributed under the License is distributed on an "AS IS" BASIS,
14
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15
 * See the License for the specific language governing permissions and
16
 * limitations under the License.
17
 */
0 ignored issues
show
Coding Style introduced by
Missing @link tag in file comment
Loading history...
18
19
namespace Surfnet\StepupMiddleware\ApiBundle\Identity\Entity;
20
21
use Doctrine\ORM\Mapping as ORM;
22
use JsonSerializable;
23
use Surfnet\StepupMiddleware\ApiBundle\Identity\Repository\UnverifiedSecondFactorRepository;
24
25
#[ORM\Entity(repositoryClass: UnverifiedSecondFactorRepository::class)]
26
class UnverifiedSecondFactor implements JsonSerializable
0 ignored issues
show
Coding Style introduced by
Missing doc comment for class UnverifiedSecondFactor
Loading history...
27
{
28
    /**
29
     *
30
     * @var string
31
     */
32
    #[ORM\Id]
33
    #[ORM\Column(length: 36)]
34
    public string $id;
35
36
    /**
37
     * @var string
38
     */
39
    #[ORM\Column(length: 36)]
40
    public string $identityId;
41
42
    /**
43
     * @var string
44
     */
45
    #[ORM\Column(length: 16)]
46
    public string $type;
47
48
    /**
49
     * The second factor identifier, ie. telephone number, Yubikey public ID, Tiqr ID
50
     * @var string
0 ignored issues
show
Coding Style introduced by
There must be exactly one blank line before the tags in a doc comment
Loading history...
51
     */
52
    #[ORM\Column(length: 255)]
53
    public string $secondFactorIdentifier;
54
55
    /**
56
     * @var string
57
     */
58
    #[ORM\Column(length: 32)]
59
    public string $verificationNonce;
60
61
    public function jsonSerialize(): array
62
    {
63
        return [
64
            'id' => $this->id,
65
            'type' => $this->type,
66
            'second_factor_identifier' => $this->secondFactorIdentifier,
67
        ];
68
    }
69
}
70