ActiveDirectoryUser::setUserPrincipalName()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 0
Metric Value
cc 1
eloc 2
c 0
b 0
f 0
nc 1
nop 1
dl 0
loc 3
ccs 0
cts 0
cp 0
crap 2
rs 10
1
<?php
2
3
namespace App\Entity;
4
5
use Doctrine\ORM\Mapping as ORM;
6
use JMS\Serializer\Annotation as Serializer;
7
use Ramsey\Uuid\UuidInterface;
8
9
#[ORM\Entity]
10
class ActiveDirectoryUser extends User {
11
12
    #[Serializer\Exclude]
13
    #[ORM\Column(type: 'string')]
14
    private ?string $userPrincipalName = null;
15
16
    #[Serializer\Exclude]
17
    #[ORM\Column(type: 'uuid', unique: true)]
18
    private ?UuidInterface $objectGuid = null;
19
20
    #[Serializer\Exclude]
21
    #[ORM\Column(type: 'string')]
22
    private ?string $ou = null;
23
24
    /**
25
     * @var string[]
26
     */
27
    #[Serializer\Exclude]
28
    #[ORM\Column(type: 'json')]
29
    private array $groups = [ ];
30
31
    public function getUserPrincipalName(): string {
32
        return $this->userPrincipalName;
0 ignored issues
show
Bug Best Practice introduced by
The expression return $this->userPrincipalName could return the type null which is incompatible with the type-hinted return string. Consider adding an additional type-check to rule them out.
Loading history...
33
    }
34
35
    /**
36
     * @return ActiveDirectoryUser
37
     */
38
    public function setUserPrincipalName(string $userPrincipalName) {
39
        $this->userPrincipalName = $userPrincipalName;
40
        return $this;
41
    }
42
43
    public function getObjectGuid(): UuidInterface {
44
        return $this->objectGuid;
0 ignored issues
show
Bug Best Practice introduced by
The expression return $this->objectGuid could return the type null which is incompatible with the type-hinted return Ramsey\Uuid\UuidInterface. Consider adding an additional type-check to rule them out.
Loading history...
45
    }
46
47
    public function setObjectGuid(UuidInterface $objectGuid): ActiveDirectoryUser {
48
        $this->objectGuid = $objectGuid;
49
        return $this;
50
    }
51
52
    public function getOu(): string {
53
        return $this->ou;
0 ignored issues
show
Bug Best Practice introduced by
The expression return $this->ou could return the type null which is incompatible with the type-hinted return string. Consider adding an additional type-check to rule them out.
Loading history...
54
    }
55
56
    public function setOu(string $ou): ActiveDirectoryUser {
57
        $this->ou = $ou;
58
        return $this;
59
    }
60
61
    /**
62
     * @return string[]
63
     */
64
    public function getGroups(): array {
65
        return $this->groups;
66
    }
67
68
    /**
69
     * @param string[] $groups
70
     */
71
    public function setGroups(array $groups): ActiveDirectoryUser {
72
        $this->groups = $groups;
73
        return $this;
74
    }
75
}