Code Coverage |
||||||||||
Lines |
Functions and Methods |
Classes and Traits |
||||||||
| Total | |
100.00% |
2 / 2 |
|
100.00% |
2 / 2 |
CRAP | |
100.00% |
1 / 1 |
| AbstractApieUserDecorator | |
100.00% |
2 / 2 |
|
100.00% |
2 / 2 |
2 | |
100.00% |
1 / 1 |
| __construct | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
1 | |||
| getEntity | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
1 | |||
| 1 | <?php |
| 2 | namespace Apie\Common\Wrappers; |
| 3 | |
| 4 | use Apie\Common\Interfaces\UserDecorator; |
| 5 | use Apie\Common\ValueObjects\DecryptedAuthenticatedUser; |
| 6 | use Apie\Core\Entities\EntityInterface; |
| 7 | |
| 8 | /** |
| 9 | * @template T of EntityInterface |
| 10 | * @implements UserDecorator<T> |
| 11 | */ |
| 12 | abstract class AbstractApieUserDecorator implements UserDecorator |
| 13 | { |
| 14 | /** |
| 15 | * @param DecryptedAuthenticatedUser<T> $id |
| 16 | * @param T $entity |
| 17 | */ |
| 18 | public function __construct( |
| 19 | protected readonly DecryptedAuthenticatedUser $id, |
| 20 | protected readonly EntityInterface $entity |
| 21 | ) { |
| 22 | } |
| 23 | |
| 24 | /** |
| 25 | * @return T |
| 26 | */ |
| 27 | public function getEntity(): EntityInterface |
| 28 | { |
| 29 | return $this->entity; |
| 30 | } |
| 31 | } |