Code Coverage |
||||||||||
Lines |
Functions and Methods |
Classes and Traits |
||||||||
| Total | |
0.00% |
0 / 2 |
|
0.00% |
0 / 2 |
CRAP | |
0.00% |
0 / 1 |
| Identity | |
0.00% |
0 / 2 |
|
0.00% |
0 / 2 |
6 | |
0.00% |
0 / 1 |
| __construct | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
| getId | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
| 1 | <?php |
| 2 | |
| 3 | declare(strict_types=1); |
| 4 | |
| 5 | namespace App\Modules\User\Presentation\Web; |
| 6 | |
| 7 | use Yiisoft\Auth\IdentityInterface; |
| 8 | |
| 9 | /** |
| 10 | * User Identity implementation for Yii3 CurrentUser container. |
| 11 | * |
| 12 | * @package App\Modules\User\Presentation\Web |
| 13 | */ |
| 14 | final readonly class Identity implements IdentityInterface |
| 15 | { |
| 16 | /** |
| 17 | * Identity constructor. |
| 18 | * |
| 19 | * @param int|string $id User identifier. |
| 20 | */ |
| 21 | public function __construct( |
| 22 | private int|string $id |
| 23 | ) { |
| 24 | } |
| 25 | |
| 26 | /** |
| 27 | * {@inheritdoc} |
| 28 | */ |
| 29 | public function getId(): string |
| 30 | { |
| 31 | return (string)$this->id; |
| 32 | } |
| 33 | } |