Completed
Push — master ( 167b67...6ae77b )
by Artem
01:30
created

AnonymousUser   A

Complexity

Total Complexity 5

Size/Duplication

Total Lines 43
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Importance

Changes 0
Metric Value
wmc 5
lcom 0
cbo 0
dl 0
loc 43
rs 10
c 0
b 0
f 0

5 Methods

Rating   Name   Duplication   Size   Complexity  
A getRoles() 0 4 1
A getPassword() 0 4 1
A getSalt() 0 4 1
A getUsername() 0 4 1
A eraseCredentials() 0 3 1
1
<?php
2
/*
3
 * This file is part of the StfalconApiBundle.
4
 *
5
 * (c) Stfalcon LLC <stfalcon.com>
6
 *
7
 * For the full copyright and license information, please view the LICENSE
8
 * file that was distributed with this source code.
9
 */
10
11
declare(strict_types=1);
12
13
namespace StfalconStudio\ApiBundle\Security;
14
15
use Symfony\Component\Security\Core\User\UserInterface;
16
17
/**
18
 * AnonymousUser.
19
 */
20
class AnonymousUser implements UserInterface
21
{
22
    public const USERNAME = 'anonymous';
23
24
    /**
25
     * {@inheritdoc}
26
     */
27
    public function getRoles(): array
28
    {
29
        return [];
30
    }
31
32
    /**
33
     * {@inheritdoc}
34
     */
35
    public function getPassword(): ?string
36
    {
37
        return null;
38
    }
39
40
    /**
41
     * {@inheritdoc}
42
     */
43
    public function getSalt(): ?string
44
    {
45
        return null;
46
    }
47
48
    /**
49
     * {@inheritdoc}
50
     */
51
    public function getUsername(): string
52
    {
53
        return self::USERNAME;
54
    }
55
56
    /**
57
     * {@inheritdoc}
58
     */
59
    public function eraseCredentials(): void
60
    {
61
    }
62
}
63