• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

systemsdk / docker-symfony-api / #85

pending completion
#85

push

DKravtsov
Updated dependencies, refactoring.

21 of 21 new or added lines in 14 files covered. (100.0%)

1440 of 2683 relevant lines covered (53.67%)

21.58 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

0.0
/src/ApiKey/Application/Security/ApiKeyUser.php
1
<?php
2

3
declare(strict_types=1);
4

5
namespace App\ApiKey\Application\Security;
6

7
use App\ApiKey\Application\Security\Interfaces\ApiKeyUserInterface;
8
use App\ApiKey\Domain\Entity\ApiKey;
9
use App\Role\Domain\Enum\Role;
10
use Symfony\Component\Security\Core\User\UserInterface;
11

12
use function array_unique;
13

14
/**
15
 * Class ApiKeyUser
16
 *
17
 * @package App\ApiKey
18
 */
19
class ApiKeyUser implements ApiKeyUserInterface, UserInterface
20
{
21
    private readonly string $identifier;
22
    private readonly string $apiKeyIdentifier;
23

24
    /**
25
     * @var array<int, string>
26
     */
27
    private readonly array $roles;
28

29
    /**
30
     * {@inheritdoc}
31
     */
32
    public function __construct(ApiKey $apiKey, array $roles)
33
    {
34
        $this->identifier = $apiKey->getToken();
×
35
        $this->apiKeyIdentifier = $apiKey->getId();
×
36
        $this->roles = array_unique([...$roles, Role::API->value]);
×
37
    }
38

39
    public function getUserIdentifier(): string
40
    {
41
        return $this->identifier;
×
42
    }
43

44
    public function getApiKeyIdentifier(): string
45
    {
46
        return $this->apiKeyIdentifier;
×
47
    }
48

49
    public function getRoles(): array
50
    {
51
        return $this->roles;
×
52
    }
53

54
    /**
55
     * {@inheritdoc}
56
     *
57
     * @codeCoverageIgnore
58
     */
59
    public function getPassword(): ?string
60
    {
61
        return null;
62
    }
63

64
    /**
65
     * {@inheritdoc}
66
     *
67
     * @codeCoverageIgnore
68
     */
69
    public function getSalt(): ?string
70
    {
71
        return null;
72
    }
73

74
    /**
75
     * {@inheritdoc}
76
     *
77
     * @codeCoverageIgnore
78
     */
79
    public function eraseCredentials(): void
80
    {
81
    }
82
}
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2025 Coveralls, Inc