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

AnonymousUser::getRoles()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 4
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 0
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