Code Coverage |
||||||||||||||||
Lines |
Branches |
Paths |
Functions and Methods |
Classes and Traits |
||||||||||||
| Total | |
100.00% |
4 / 4 |
|
100.00% |
4 / 4 |
|
100.00% |
4 / 4 |
|
100.00% |
4 / 4 |
CRAP | |
100.00% |
1 / 1 |
| ApiUser | |
100.00% |
4 / 4 |
|
100.00% |
4 / 4 |
|
100.00% |
4 / 4 |
|
100.00% |
4 / 4 |
4 | |
100.00% |
1 / 1 |
| __construct | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
1 | |||
| getRoles | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
1 | |||
| eraseCredentials | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
1 | |||
| getUserIdentifier | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
1 | |||
| 1 | <?php |
| 2 | |
| 3 | namespace App\Security; |
| 4 | |
| 5 | use Symfony\Component\Security\Core\User\UserInterface; |
| 6 | |
| 7 | /** |
| 8 | * @phpstan-type UserRole 'ROLE_FRONTEND'|'ROLE_CLIENT'|'ROLE_ADMIN'|'ROLE_INTERNAL' |
| 9 | * |
| 10 | * @author Wilhelm Zwertvaegher |
| 11 | */ |
| 12 | readonly class ApiUser implements UserInterface |
| 13 | { |
| 14 | /** |
| 15 | * @param array<UserRole> $roles |
| 16 | */ |
| 17 | public function __construct( |
| 18 | private string $identifier, |
| 19 | private array $roles, |
| 20 | ) { |
| 21 | } |
| 22 | |
| 23 | public function getRoles(): array |
| 24 | { |
| 25 | return $this->roles; |
| 26 | } |
| 27 | |
| 28 | public function eraseCredentials(): void |
| 29 | { |
| 30 | } |
| 31 | |
| 32 | public function getUserIdentifier(): string |
| 33 | { |
| 34 | return $this->identifier; |
| 35 | } |
| 36 | } |
Below are the source code lines that represent each code branch as identified by Xdebug. Please note a branch is not
necessarily coterminous with a line, a line may contain multiple branches and therefore show up more than once.
Please also be aware that some branches may be implicit rather than explicit, e.g. an if statement
always has an else as part of its logical flow even if you didn't write one.
| 17 | public function __construct( |
| 18 | private string $identifier, |
| 19 | private array $roles, |
| 20 | ) { |
| 21 | } |
| 30 | } |
| 25 | return $this->roles; |
| 26 | } |
| 34 | return $this->identifier; |
| 35 | } |
| 3 | namespace App\Security; |
| 4 | |
| 5 | use Symfony\Component\Security\Core\User\UserInterface; |
| 6 | |
| 7 | /** |
| 8 | * @phpstan-type UserRole 'ROLE_FRONTEND'|'ROLE_CLIENT'|'ROLE_ADMIN'|'ROLE_INTERNAL' |
| 9 | * |
| 10 | * @author Wilhelm Zwertvaegher |
| 11 | */ |
| 12 | readonly class ApiUser implements UserInterface |
| 13 | { |
| 14 | /** |
| 15 | * @param array<UserRole> $roles |
| 16 | */ |
| 17 | public function __construct( |
| 18 | private string $identifier, |
| 19 | private array $roles, |
| 20 | ) { |
| 21 | } |
| 22 | |
| 23 | public function getRoles(): array |
| 24 | { |
| 25 | return $this->roles; |
| 26 | } |
| 27 | |
| 28 | public function eraseCredentials(): void |
| 29 | { |
| 30 | } |
| 31 | |
| 32 | public function getUserIdentifier(): string |
| 33 | { |
| 34 | return $this->identifier; |
| 35 | } |