Failed Conditions
Pull Request — master (#13)
by Adrien
05:33 queued 02:11
created

User::getName()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

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