Environment   A
last analyzed

Complexity

Total Complexity 7

Size/Duplication

Total Lines 52
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 12
c 1
b 0
f 0
dl 0
loc 52
rs 10
wmc 7

7 Methods

Rating   Name   Duplication   Size   Complexity  
A getApplication() 0 3 1
A getRoles() 0 3 1
A setName() 0 5 1
A getName() 0 3 1
A getPassword() 0 3 1
A setApplication() 0 5 1
A getUsername() 0 3 1
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