Code Coverage |
||||||||||
Lines |
Functions and Methods |
Classes and Traits |
||||||||
| Total | |
0.00% |
0 / 3 |
|
0.00% |
0 / 3 |
CRAP | |
0.00% |
0 / 1 |
| LaravelUserDecorator | |
0.00% |
0 / 3 |
|
0.00% |
0 / 3 |
12 | |
0.00% |
0 / 1 |
| __construct | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
| getUser | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
| getId | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
| 1 | <?php |
| 2 | |
| 3 | namespace Apie\LaravelApie\Wrappers\Security; |
| 4 | |
| 5 | use Apie\Core\Entities\EntityInterface; |
| 6 | use Illuminate\Contracts\Auth\Authenticatable; |
| 7 | |
| 8 | class LaravelUserDecorator implements EntityInterface |
| 9 | { |
| 10 | private LaravelUserDecoratorIdentifier $id; |
| 11 | public function __construct(private readonly Authenticatable $user) |
| 12 | { |
| 13 | $this->id = LaravelUserDecoratorIdentifier::createFrom($user); |
| 14 | } |
| 15 | |
| 16 | public function getUser(): Authenticatable |
| 17 | { |
| 18 | return $this->user; |
| 19 | } |
| 20 | |
| 21 | |
| 22 | public function getId(): LaravelUserDecoratorIdentifier |
| 23 | { |
| 24 | return $this->id; |
| 25 | } |
| 26 | } |