Completed
Push — master ( 3dc3ed...ffaea0 )
by michael
03:11
created

U2fKey::getUser()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 0
Metric Value
eloc 1
dl 0
loc 3
ccs 0
cts 2
cp 0
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 0
crap 2
1
<?php
2
3
/*
4
 * This file is part of the U2F Security bundle.
5
 *
6
 * (c) Michael Barbey <[email protected]>
7
 *
8
 * For the full copyright and license information, please view the LICENSE
9
 * file that was distributed with this source code.
10
 */
11
12
namespace Mbarbey\U2fSecurityBundle\Model\Key;
13
14
use Doctrine\ORM\Mapping as ORM;
0 ignored issues
show
Bug introduced by
The type Doctrine\ORM\Mapping 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...
15
use Mbarbey\U2fSecurityBundle\Model\User\U2fUserInterface;
16
17
/**
18
 * U2F key entity base
19
 *
20
 * When you create your entity for the security keys, you can either extends this class or implement the U2fKeyInterface.
21
 *
22
 * @author Michael Barbey <[email protected]>
23
 */
24
abstract class U2fKey implements U2fKeyInterface
25
{
26
    /**
27
     * @ORM\Column(type="string", length=255)
28
     */
29
    public $keyHandle;
30
31
    /**
32
     * @ORM\Column(type="string", length=255)
33
     */
34
    public $publicKey;
35
36
    /**
37
     * @ORM\Column(type="text")
38
     */
39
    public $certificate;
40
41
    /**
42
     * @ORM\Column(type="integer")
43
     */
44
    public $counter;
45
46
    /**
47
     * Override the definition of this variable to create the relationship
48
     * @var U2fUserInterface
49
     */
50
    protected $user;
51
52
    /**
53
     * @return string|NULL
54
     */
55 1
    public function getKeyHandle(): ?string
56
    {
57 1
        return $this->keyHandle;
58
    }
59
60
    /**
61
     * @param string $keyHandle
62
     * @return self
63
     */
64 1
    public function setKeyHandle(string $keyHandle): self
65
    {
66 1
        $this->keyHandle = $keyHandle;
67
68 1
        return $this;
69
    }
70
71
    /**
72
     * @return string|NULL
73
     */
74 1
    public function getPublicKey(): ?string
75
    {
76 1
        return $this->publicKey;
77
    }
78
79
    /**
80
     * @param string $publicKey
81
     * @return self
82
     */
83 1
    public function setPublicKey(string $publicKey): self
84
    {
85 1
        $this->publicKey = $publicKey;
86
87 1
        return $this;
88
    }
89
90
    /**
91
     * @return string|NULL
92
     */
93 1
    public function getCertificate(): ?string
94
    {
95 1
        return $this->certificate;
96
    }
97
98
    /**
99
     * @param string $certificate
100
     * @return self
101
     */
102 1
    public function setCertificate(string $certificate): self
103
    {
104 1
        $this->certificate = $certificate;
105
106 1
        return $this;
107
    }
108
109
    /**
110
     * @return int|NULL
111
     */
112 1
    public function getCounter(): ?int
113
    {
114 1
        return $this->counter;
115
    }
116
117
    /**
118
     * @param int $counter
119
     * @return self
120
     */
121 1
    public function setCounter(int $counter): self
122
    {
123 1
        $this->counter = $counter;
124
125 1
        return $this;
126
    }
127
128
    /**
129
     * @return string|NULL
130
     */
131
    public function getName(): ?string
132
    {
133
        return $this->name;
134
    }
135
136
    /**
137
     * @param string $name
138
     * @return self
139
     */
140
    public function setName(string $name): self
141
    {
142
        $this->name = $name;
0 ignored issues
show
Bug Best Practice introduced by
The property name does not exist. Although not strictly required by PHP, it is generally a best practice to declare properties explicitly.
Loading history...
143
144
        return $this;
145
    }
146
147
    /**
148
     * @return U2fUserInterface|NULL
149
     */
150
    public function getUser()
151
    {
152
        return $this->user;
153
    }
154
155
    /**
156
     * @param U2fUserInterface $user
157
     * @return self
158
     */
159
    public function setUser(?U2fUserInterface $user): self
160
    {
161
        $this->user = $user;
162
163
        return $this;
164
    }
165
}
166