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

systemsdk / docker-symfony-api / #75

pending completion
#75

push

DKravtsov
Fixed issue with REDIS volumes, updated dependencies, refactoring

39 of 39 new or added lines in 12 files covered. (100.0%)

1470 of 2656 relevant lines covered (55.35%)

23.64 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_merge;
13
use function array_unique;
14

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

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

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

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

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

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

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

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

75
    /**
76
     * {@inheritdoc}
77
     *
78
     * @codeCoverageIgnore
79
     */
80
    public function eraseCredentials(): void
81
    {
82
    }
83
}
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