Completed
Push — master ( 39aa91...270cc6 )
by Mahmoud
03:23
created
Containers/Authorization/UI/API/Tests/Functional/AssignUserToRoleTest.php 1 patch
Unused Use Statements   -1 removed lines patch added patch discarded remove patch
@@ -4,7 +4,6 @@
 block discarded – undo
4 4
 
5 5
 use App\Containers\User\Models\User;
6 6
 use App\Port\Tests\PHPUnit\Abstracts\TestCase;
7
-use Vinkla\Hashids\Facades\Hashids;
8 7
 
9 8
 /**
10 9
  * Class AssignUserToRoleTest.
Please login to merge, or discard this patch.
Authorization/UI/API/Tests/Functional/AttachPermissionsToRoleTest.php 1 patch
Unused Use Statements   -1 removed lines patch added patch discarded remove patch
@@ -4,7 +4,6 @@
 block discarded – undo
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
 /**
Please login to merge, or discard this patch.
Authorization/UI/API/Tests/Functional/FindPermissionByNameTest.php 1 patch
Unused Use Statements   -3 removed lines patch added patch discarded remove patch
@@ -3,10 +3,7 @@
 block discarded – undo
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.
Please login to merge, or discard this patch.
Containers/Authorization/UI/API/Tests/Functional/ListPermissionsTest.php 1 patch
Unused Use Statements   -1 removed lines patch added patch discarded remove patch
@@ -2,7 +2,6 @@
 block discarded – undo
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
 /**
Please login to merge, or discard this patch.
app/Containers/Authorization/Tasks/AttachPermissionsToRoleTask.php 2 patches
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -42,13 +42,13 @@
 block discarded – undo
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
 
Please login to merge, or discard this patch.
Braces   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -43,7 +43,7 @@
 block discarded – undo
43 43
                 $this->attachRole($user, $role);
44 44
             }
45 45
 
46
-        }else{
46
+        } else{
47 47
             $this->attachRole($user, $roles);
48 48
         }
49 49
 
Please login to merge, or discard this patch.
app/Containers/Authentication/Actions/WebAdminLoginAction.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -47,7 +47,7 @@
 block discarded – undo
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
 
Please login to merge, or discard this patch.
app/Containers/Application/Middlewares/ApplicationAuthentication.php 2 patches
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -93,7 +93,7 @@  discard block
 block discarded – undo
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
 block discarded – undo
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
Please login to merge, or discard this patch.
Braces   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -43,7 +43,7 @@
 block discarded – undo
43 43
                 $this->attachRole($user, $role);
44 44
             }
45 45
 
46
-        }else{
46
+        } else{
47 47
             $this->attachRole($user, $roles);
48 48
         }
49 49
 
Please login to merge, or discard this patch.