Environment::getUsername()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 1
c 1
b 0
f 0
nc 1
nop 0
dl 0
loc 3
rs 10
1
<?php
2
3
namespace App\Document;
4
5
use Doctrine\ODM\MongoDB\Mapping\Annotations as MongoDB;
6
use Symfony\Component\Serializer\Annotation\Groups;
7
use Symfony\Component\Validator\Constraints as Assert;
8
9
/**
10
 * @MongoDB\Document
11
 */
12
class Environment extends AbstractUser
13
{
14
    /**
15
     * @MongoDB\Field(type="string")
16
     *
17
     * @Groups({"environment_default", "environment_write", "environment_full"})
18
     * @Assert\NotBlank
19
     */
20
    protected $name;
21
22
    /**
23
     * @MongoDB\ReferenceOne(targetDocument="Application", inversedBy="environments")
24
     */
25
    protected $application;
26
27
    public function getRoles(): array
28
    {
29
        return [static::ROLE_USER];
30
    }
31
32
    public function getUsername(): string
33
    {
34
        return $this->id;
35
    }
36
37
    public function getPassword()
38
    {
39
        return null;
40
    }
41
42
    public function getName(): string
43
    {
44
        return $this->name;
45
    }
46
47
    public function setName(string $name): self
48
    {
49
        $this->name = $name;
50
51
        return $this;
52
    }
53
54
    public function getApplication(): Application
55
    {
56
        return $this->application;
57
    }
58
59
    public function setApplication(Application $application): self
60
    {
61
        $this->application = $application;
62
63
        return $this;
64
    }
65
}
66