@@ -4,7 +4,6 @@ |
||
4 | 4 | |
5 | 5 | use App\Containers\Authorization\Models\Permission; |
6 | 6 | use App\Containers\Authorization\Models\Role; |
7 | -use App\Containers\User\Models\User; |
|
8 | 7 | use App\Port\Tests\PHPUnit\Abstracts\TestCase; |
9 | 8 | |
10 | 9 | /** |
@@ -3,10 +3,7 @@ |
||
3 | 3 | namespace App\Containers\Order\UI\API\Tests\Functional; |
4 | 4 | |
5 | 5 | use App\Containers\Order\Models\Order; |
6 | -use App\Containers\Invoice\Models\Invoice; |
|
7 | -use App\Containers\User\Models\User; |
|
8 | 6 | use App\Port\Tests\PHPUnit\Abstracts\TestCase; |
9 | -use Vinkla\Hashids\Facades\Hashids; |
|
10 | 7 | |
11 | 8 | /** |
12 | 9 | * Class FindRoleByNameTest. |
@@ -2,7 +2,6 @@ |
||
2 | 2 | |
3 | 3 | namespace App\Containers\Authorization\UI\API\Tests\Functional; |
4 | 4 | |
5 | -use App\Containers\Authorization\Models\User; |
|
6 | 5 | use App\Port\Tests\PHPUnit\Abstracts\TestCase; |
7 | 6 | |
8 | 7 | /** |
@@ -42,13 +42,13 @@ |
||
42 | 42 | { |
43 | 43 | $role = $this->getRoleAction->run($roleName); |
44 | 44 | |
45 | - if(is_array($permissionNames)){ |
|
45 | + if (is_array($permissionNames)) { |
|
46 | 46 | |
47 | - foreach ($permissionNames as $permissionName){ |
|
47 | + foreach ($permissionNames as $permissionName) { |
|
48 | 48 | $role->givePermissionTo($permissionName); |
49 | 49 | } |
50 | 50 | |
51 | - }else{ |
|
51 | + } else { |
|
52 | 52 | $role->givePermissionTo($permissionNames); |
53 | 53 | } |
54 | 54 |
@@ -43,7 +43,7 @@ |
||
43 | 43 | $this->attachRole($user, $role); |
44 | 44 | } |
45 | 45 | |
46 | - }else{ |
|
46 | + } else{ |
|
47 | 47 | $this->attachRole($user, $roles); |
48 | 48 | } |
49 | 49 |
@@ -47,7 +47,7 @@ |
||
47 | 47 | { |
48 | 48 | $user = $this->webLoginTask->run($email, $password, $remember); |
49 | 49 | |
50 | - if($user){ |
|
50 | + if ($user) { |
|
51 | 51 | $this->isUserAdminTask->run($user); |
52 | 52 | } |
53 | 53 |
@@ -93,7 +93,7 @@ discard block |
||
93 | 93 | |
94 | 94 | $token = str_replace('Bearer ', '', $request->header('authorization')); |
95 | 95 | |
96 | - if(!$token){ |
|
96 | + if (!$token) { |
|
97 | 97 | throw new AuthenticationFailedException('Empty Token!'); |
98 | 98 | } |
99 | 99 | |
@@ -113,7 +113,7 @@ discard block |
||
113 | 113 | throw new UserNotPermittedException(); |
114 | 114 | } |
115 | 115 | |
116 | - }else{ |
|
116 | + } else { |
|
117 | 117 | return (App::make(\Dingo\Api\Http\Middleware\Auth::class))->handle($request, $next); |
118 | 118 | // another way to do handle this is by calling `$user = $this->jwtAuthAdapter->toUser($token);` |
119 | 119 | // and continuing the execution of this code till the last return, but to maintain consistency |
@@ -43,7 +43,7 @@ |
||
43 | 43 | $this->attachRole($user, $role); |
44 | 44 | } |
45 | 45 | |
46 | - }else{ |
|
46 | + } else{ |
|
47 | 47 | $this->attachRole($user, $roles); |
48 | 48 | } |
49 | 49 |