Completed
Push — master ( 857394...4794c5 )
by Mahmoud
03:25
created
app/Containers/Application/Data/Factories/ApplicationFactory.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -4,7 +4,7 @@
 block discarded – undo
4 4
 use App\Containers\Application\Models\Application;
5 5
 use App\Containers\User\Models\User;
6 6
 
7
-$factory->define(Application::class, function (Faker\Generator $faker) {
7
+$factory->define(Application::class, function(Faker\Generator $faker) {
8 8
 
9 9
     return [
10 10
         'name'    => $faker->name,
Please login to merge, or discard this patch.
app/Containers/Socialauth/Tasks/UpdateUserSocialProfileTask.php 1 patch
Doc Comments   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -33,12 +33,12 @@
 block discarded – undo
33 33
     /**
34 34
      * @param      $userId
35 35
      * @param null $token
36
-     * @param null $expiresIn
37
-     * @param null $refreshToken
38
-     * @param null $tokenSecret
36
+     * @param boolean|null $expiresIn
37
+     * @param boolean|null $refreshToken
38
+     * @param boolean|null $tokenSecret
39 39
      * @param null $provider
40 40
      * @param null $avatar
41
-     * @param null $avatar_original
41
+     * @param boolean|null $avatar_original
42 42
      * @param null $socialId
43 43
      * @param null $nickname
44 44
      * @param null $name
Please login to merge, or discard this patch.
Data/Migrations/2016_12_29_201047_create_permission_tables.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -14,7 +14,7 @@  discard block
 block discarded – undo
14 14
     {
15 15
         $config = config('laravel-permission.table_names');
16 16
 
17
-        Schema::create($config['roles'], function (Blueprint $table) {
17
+        Schema::create($config['roles'], function(Blueprint $table) {
18 18
             $table->increments('id');
19 19
             $table->string('name')->unique();
20 20
             $table->string('display_name')->nullable();
@@ -22,7 +22,7 @@  discard block
 block discarded – undo
22 22
             $table->timestamps();
23 23
         });
24 24
 
25
-        Schema::create($config['permissions'], function (Blueprint $table) {
25
+        Schema::create($config['permissions'], function(Blueprint $table) {
26 26
             $table->increments('id');
27 27
             $table->string('name')->unique();
28 28
             $table->string('display_name')->nullable();
@@ -30,7 +30,7 @@  discard block
 block discarded – undo
30 30
             $table->timestamps();
31 31
         });
32 32
 
33
-        Schema::create($config['user_has_permissions'], function (Blueprint $table) use ($config) {
33
+        Schema::create($config['user_has_permissions'], function(Blueprint $table) use ($config) {
34 34
             $table->integer('user_id')->unsigned();
35 35
             $table->integer('permission_id')->unsigned();
36 36
 
@@ -47,7 +47,7 @@  discard block
 block discarded – undo
47 47
             $table->primary(['user_id', 'permission_id']);
48 48
         });
49 49
 
50
-        Schema::create($config['user_has_roles'], function (Blueprint $table) use ($config) {
50
+        Schema::create($config['user_has_roles'], function(Blueprint $table) use ($config) {
51 51
             $table->integer('role_id')->unsigned();
52 52
             $table->integer('user_id')->unsigned();
53 53
 
@@ -64,7 +64,7 @@  discard block
 block discarded – undo
64 64
             $table->primary(['role_id', 'user_id']);
65 65
         });
66 66
 
67
-        Schema::create($config['role_has_permissions'], function (Blueprint $table) use ($config) {
67
+        Schema::create($config['role_has_permissions'], function(Blueprint $table) use ($config) {
68 68
             $table->integer('permission_id')->unsigned();
69 69
             $table->integer('role_id')->unsigned();
70 70
 
Please login to merge, or discard this patch.
app/Containers/User/Actions/CreateUserAction.php 1 patch
Indentation   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -67,7 +67,7 @@
 block discarded – undo
67 67
         // be default give all users the client role (normal user)
68 68
         $this->assignRoleTask->run($user, ['client']);
69 69
 
70
-       //  add Client as role for normal users
70
+        //  add Client as role for normal users
71 71
         $this->fireUserCreatedEventTask->run($user);
72 72
 
73 73
         return $user;
Please login to merge, or discard this patch.
app/Containers/Authorization/Actions/AssignRoleAction.php 1 patch
Doc Comments   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -21,7 +21,7 @@
 block discarded – undo
21 21
     /**
22 22
      * GetAdminRoleAction constructor.
23 23
      *
24
-     * @param \App\Containers\Authorization\Data\Repositories\AssignRoleTask $assignRoleTask
24
+     * @param AssignRoleTask $assignRoleTask
25 25
      */
26 26
     public function __construct(AssignRoleTask $assignRoleTask)
27 27
     {
Please login to merge, or discard this patch.
app/Containers/Authorization/Tasks/AssignRoleTask.php 2 patches
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -45,7 +45,7 @@  discard block
 block discarded – undo
45 45
      */
46 46
     public function run($user, $roles)
47 47
     {
48
-        if(!$user instanceof User){
48
+        if (!$user instanceof User) {
49 49
             $user = $this->findUserByIdTask->run($user);
50 50
         }
51 51
 
@@ -54,7 +54,7 @@  discard block
 block discarded – undo
54 54
                 $this->assignRole($user, $role);
55 55
             }
56 56
 
57
-        }else{
57
+        } else {
58 58
             $this->assignRole($user, $roles);
59 59
         }
60 60
 
Please login to merge, or discard this patch.
Braces   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -54,7 +54,7 @@
 block discarded – undo
54 54
                 $this->assignRole($user, $role);
55 55
             }
56 56
 
57
-        }else{
57
+        } else{
58 58
             $this->assignRole($user, $roles);
59 59
         }
60 60
 
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
@@ -48,7 +48,7 @@
 block discarded – undo
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.
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
@@ -118,7 +118,7 @@
 block discarded – undo
118 118
                 throw new UserNotPermittedException();
119 119
             }
120 120
 
121
-        }else{
121
+        } else{
122 122
             return (App::make(\Dingo\Api\Http\Middleware\Auth::class))->handle($request, $next);
123 123
             // another way to do handle this is by calling `$user = $this->jwtAuthAdapter->toUser($token);`
124 124
             // and continuing the execution of this code till the last return, but to maintain consistency
Please login to merge, or discard this patch.