Code Coverage |
||||||||||
Lines |
Functions and Methods |
Classes and Traits |
||||||||
Total | |
0.00% |
0 / 4 |
|
0.00% |
0 / 2 |
CRAP | |
0.00% |
0 / 1 |
LaravelUserWithPermissionDecorator | |
0.00% |
0 / 4 |
|
0.00% |
0 / 2 |
6 | |
0.00% |
0 / 1 |
__construct | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
getPermissionIdentifiers | |
0.00% |
0 / 3 |
|
0.00% |
0 / 1 |
2 |
1 | <?php |
2 | |
3 | namespace Apie\LaravelApie\Wrappers\Security; |
4 | |
5 | use Apie\Core\Lists\PermissionList; |
6 | use Apie\Core\Permissions\PermissionInterface; |
7 | use Illuminate\Contracts\Auth\Authenticatable; |
8 | |
9 | class LaravelUserWithPermissionDecorator extends LaravelUserDecorator implements PermissionInterface |
10 | { |
11 | public function __construct(Authenticatable&PermissionInterface $user) |
12 | { |
13 | parent::__construct($user); |
14 | } |
15 | |
16 | public function getPermissionIdentifiers(): PermissionList |
17 | { |
18 | $user = $this->getUser(); |
19 | assert($user instanceof PermissionInterface); |
20 | return $user->getPermissionIdentifiers(); |
21 | } |
22 | } |