Failed Conditions
Push — master ( cdc595...f2bb18 )
by Adrien
02:12
created

User   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 50
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 8
c 1
b 0
f 0
dl 0
loc 50
rs 10
wmc 3

3 Methods

Rating   Name   Duplication   Size   Complexity  
A setName() 0 3 1
A getName() 0 3 1
A getRole() 0 3 1
1
<?php
2
3
declare(strict_types=1);
4
5
namespace EcodevTests\Felix\Blog\Model;
6
7
use Doctrine\ORM\Mapping as ORM;
8
use GraphQL\Doctrine\Annotation as API;
9
10
/**
11
 * A blog author
12
 *
13
 * @ORM\Entity
14
 */
15
final class User extends AbstractModel implements \Ecodev\Felix\Model\User
16
{
17
    /**
18
     * @var string
19
     *
20
     * @ORM\Column(name="custom_column_name", type="string", length=50, options={"default" = ""})
21
     */
22
    private $name = '';
23
24
    /**
25
     * @var null|string
26
     *
27
     * @ORM\Column(type="string", length=50, nullable=true)
28
     */
29
    private $email;
0 ignored issues
show
introduced by
The private property $email is not used, and could be removed.
Loading history...
30
31
    /**
32
     * @var string
33
     *
34
     * @ORM\Column(name="password", type="string", length=255)
35
     * @Api\Exclude
36
     */
37
    private $password;
0 ignored issues
show
introduced by
The private property $password is not used, and could be removed.
Loading history...
38
39
    /**
40
     * @var \Doctrine\Common\Collections\Collection
41
     *
42
     * @ORM\OneToMany(targetEntity="EcodevTests\Felix\Blog\Model\Post", mappedBy="user")
43
     */
44
    private $posts;
0 ignored issues
show
introduced by
The private property $posts is not used, and could be removed.
Loading history...
45
46
    /**
47
     * @return string
48
     */
49
    public function getName(): string
50
    {
51
        return $this->name;
52
    }
53
54
    /**
55
     * @param string $name
56
     */
57
    public function setName(string $name): void
58
    {
59
        $this->name = $name;
60
    }
61
62
    public function getRole(): string
63
    {
64
        return 'member';
65
    }
66
}
67