Passed
Push — master ( f51c1b...16736d )
by Arthur
05:36
created
Database/Migrations/2018_10_27_121133_create_authorization_tables.php 1 patch
Spacing   +21 added lines, -21 removed lines patch added patch discarded remove patch
@@ -16,67 +16,67 @@  discard block
 block discarded – undo
16 16
         $tableNames = config('permission.table_names');
17 17
         $columnNames = config('permission.column_names');
18 18
 
19
-        Schema::create($tableNames['permissions'], function (Blueprint $table) {
19
+        Schema::create($tableNames[ 'permissions' ], function(Blueprint $table) {
20 20
             $table->increments('id');
21 21
             $table->string('name');
22 22
             $table->string('guard_name');
23 23
             $table->timestamps();
24 24
         });
25 25
 
26
-        Schema::create($tableNames['roles'], function (Blueprint $table) {
26
+        Schema::create($tableNames[ 'roles' ], function(Blueprint $table) {
27 27
             $table->increments('id');
28 28
             $table->string('name');
29 29
             $table->string('guard_name');
30 30
             $table->timestamps();
31 31
         });
32 32
 
33
-        Schema::create($tableNames['model_has_permissions'], function (Blueprint $table) use ($tableNames, $columnNames) {
33
+        Schema::create($tableNames[ 'model_has_permissions' ], function(Blueprint $table) use ($tableNames, $columnNames) {
34 34
             $table->unsignedInteger('permission_id');
35 35
 
36 36
             $table->string('model_type');
37
-            $table->unsignedBigInteger($columnNames['model_morph_key']);
38
-            $table->index([$columnNames['model_morph_key'], 'model_type', ]);
37
+            $table->unsignedBigInteger($columnNames[ 'model_morph_key' ]);
38
+            $table->index([ $columnNames[ 'model_morph_key' ], 'model_type', ]);
39 39
 
40 40
             $table->foreign('permission_id')
41 41
                 ->references('id')
42
-                ->on($tableNames['permissions'])
42
+                ->on($tableNames[ 'permissions' ])
43 43
                 ->onDelete('cascade');
44 44
 
45
-            $table->primary(['permission_id', $columnNames['model_morph_key'], 'model_type'],
45
+            $table->primary([ 'permission_id', $columnNames[ 'model_morph_key' ], 'model_type' ],
46 46
                     'model_has_permissions_permission_model_type_primary');
47 47
         });
48 48
 
49
-        Schema::create($tableNames['model_has_roles'], function (Blueprint $table) use ($tableNames, $columnNames) {
49
+        Schema::create($tableNames[ 'model_has_roles' ], function(Blueprint $table) use ($tableNames, $columnNames) {
50 50
             $table->unsignedInteger('role_id');
51 51
 
52 52
             $table->string('model_type');
53
-            $table->unsignedBigInteger($columnNames['model_morph_key']);
54
-            $table->index([$columnNames['model_morph_key'], 'model_type', ]);
53
+            $table->unsignedBigInteger($columnNames[ 'model_morph_key' ]);
54
+            $table->index([ $columnNames[ 'model_morph_key' ], 'model_type', ]);
55 55
 
56 56
             $table->foreign('role_id')
57 57
                 ->references('id')
58
-                ->on($tableNames['roles'])
58
+                ->on($tableNames[ 'roles' ])
59 59
                 ->onDelete('cascade');
60 60
 
61
-            $table->primary(['role_id', $columnNames['model_morph_key'], 'model_type'],
61
+            $table->primary([ 'role_id', $columnNames[ 'model_morph_key' ], 'model_type' ],
62 62
                     'model_has_roles_role_model_type_primary');
63 63
         });
64 64
 
65
-        Schema::create($tableNames['role_has_permissions'], function (Blueprint $table) use ($tableNames) {
65
+        Schema::create($tableNames[ 'role_has_permissions' ], function(Blueprint $table) use ($tableNames) {
66 66
             $table->unsignedInteger('permission_id');
67 67
             $table->unsignedInteger('role_id');
68 68
 
69 69
             $table->foreign('permission_id')
70 70
                 ->references('id')
71
-                ->on($tableNames['permissions'])
71
+                ->on($tableNames[ 'permissions' ])
72 72
                 ->onDelete('cascade');
73 73
 
74 74
             $table->foreign('role_id')
75 75
                 ->references('id')
76
-                ->on($tableNames['roles'])
76
+                ->on($tableNames[ 'roles' ])
77 77
                 ->onDelete('cascade');
78 78
 
79
-            $table->primary(['permission_id', 'role_id']);
79
+            $table->primary([ 'permission_id', 'role_id' ]);
80 80
 
81 81
             app('cache')->forget('spatie.permission.cache');
82 82
         });
@@ -91,10 +91,10 @@  discard block
 block discarded – undo
91 91
     {
92 92
         $tableNames = config('permission.table_names');
93 93
 
94
-        Schema::drop($tableNames['role_has_permissions']);
95
-        Schema::drop($tableNames['model_has_roles']);
96
-        Schema::drop($tableNames['model_has_permissions']);
97
-        Schema::drop($tableNames['roles']);
98
-        Schema::drop($tableNames['permissions']);
94
+        Schema::drop($tableNames[ 'role_has_permissions' ]);
95
+        Schema::drop($tableNames[ 'model_has_roles' ]);
96
+        Schema::drop($tableNames[ 'model_has_permissions' ]);
97
+        Schema::drop($tableNames[ 'roles' ]);
98
+        Schema::drop($tableNames[ 'permissions' ]);
99 99
     }
100 100
 }
Please login to merge, or discard this patch.
src/Modules/Authorization/Services/AuthorizationService.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -36,6 +36,6 @@
 block discarded – undo
36 36
     }
37 37
 
38 38
     public function clearPermissionCache() :void{
39
-        app()['cache']->forget('spatie.permission.cache');
39
+        app()[ 'cache' ]->forget('spatie.permission.cache');
40 40
     }
41 41
 }
Please login to merge, or discard this patch.
src/Modules/Notification/Providers/NotificationServiceProvider.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -25,7 +25,7 @@
 block discarded – undo
25 25
      */
26 26
     public function register()
27 27
     {
28
-        $this->app->bind(NotificationServiceContract::class, function () {
28
+        $this->app->bind(NotificationServiceContract::class, function() {
29 29
             return new NotificationService(new UserService());
30 30
         });
31 31
     }
Please login to merge, or discard this patch.
Database/Migrations/2018_10_27_122953_create_notifications_table.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -13,7 +13,7 @@
 block discarded – undo
13 13
      */
14 14
     public function up()
15 15
     {
16
-        Schema::create('notifications', function (Blueprint $table) {
16
+        Schema::create('notifications', function(Blueprint $table) {
17 17
             $table->uuid('id')->primary();
18 18
             $table->string('type');
19 19
             $table->morphs('notifiable');
Please login to merge, or discard this patch.
src/Modules/Notification/Services/NotificationService.php 2 patches
Braces   +6 added lines, -4 removed lines patch added patch discarded remove patch
@@ -30,13 +30,15 @@
 block discarded – undo
30 30
 
31 31
     public function find($id): ?Notification
32 32
     {
33
-        if ($id instanceof Notification)
34
-            return $id;
33
+        if ($id instanceof Notification) {
34
+                    return $id;
35
+        }
35 36
 
36 37
         $notification = Notification::find($id);
37 38
 
38
-        if ($notification === null)
39
-            throw new NotFoundHttpException();
39
+        if ($notification === null) {
40
+                    throw new NotFoundHttpException();
41
+        }
40 42
 
41 43
         return $notification;
42 44
     }
Please login to merge, or discard this patch.
Indentation   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -43,7 +43,7 @@
 block discarded – undo
43 43
 
44 44
     public function allNotificationsByUser($user)
45 45
     {
46
-       return $this->user->find($user)->notifications;
46
+        return $this->user->find($user)->notifications;
47 47
     }
48 48
 
49 49
     public function unreadNotifcationsByUser($user)
Please login to merge, or discard this patch.
Modules/User/Database/Migrations/2018_10_04_134544_CreateUserMigration.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -12,7 +12,7 @@
 block discarded – undo
12 12
      */
13 13
     public function up()
14 14
     {
15
-        Schema::create('users', function (Blueprint $table) {
15
+        Schema::create('users', function(Blueprint $table) {
16 16
             $table->increments('id');
17 17
             $table->string('identity_id')->unique();
18 18
             $table->string('email');
Please login to merge, or discard this patch.
bootstrap/app.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -45,7 +45,7 @@
 block discarded – undo
45 45
     Illuminate\Contracts\Debug\ExceptionHandler::class,
46 46
     \Foundation\Kernels\ExceptionKernel::class
47 47
 );
48
-$app->bind(\Auth0\Login\Contract\Auth0UserRepository::class, function () {
48
+$app->bind(\Auth0\Login\Contract\Auth0UserRepository::class, function() {
49 49
     return new Auth0Service(new UserService());
50 50
 });
51 51
 /*
Please login to merge, or discard this patch.
src/Modules/Auth0/Providers/Auth0ServiceProvider.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -31,11 +31,11 @@
 block discarded – undo
31 31
      */
32 32
     public function boot()
33 33
     {
34
-        $this->app->bind(\Auth0\Login\Contract\Auth0UserRepository::class, function () {
34
+        $this->app->bind(\Auth0\Login\Contract\Auth0UserRepository::class, function() {
35 35
             return new Auth0Service(new UserService());
36 36
         });
37 37
 
38
-        $this->app->bind(Auth0ServiceContract::class, function () {
38
+        $this->app->bind(Auth0ServiceContract::class, function() {
39 39
             return new Auth0Service(new UserService());
40 40
         });
41 41
     }
Please login to merge, or discard this patch.
src/Modules/Auth0/Services/Auth0Service.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -49,7 +49,7 @@  discard block
 block discarded – undo
49 49
 
50 50
     public function getUserByUserInfo($userInfo)
51 51
     {
52
-        return $this->upsertUser($userInfo['profile']);
52
+        return $this->upsertUser($userInfo[ 'profile' ]);
53 53
     }
54 54
 
55 55
     protected function upsertUser($profile)
@@ -58,8 +58,8 @@  discard block
 block discarded – undo
58 58
             throw new BadRequestHttpException('Missing token information: Auth0 user id is not set');
59 59
         }
60 60
         $identifier = explode('|', $profile->user_id);
61
-        $identityProvider = $identifier[0];
62
-        $id = $identifier[1];
61
+        $identityProvider = $identifier[ 0 ];
62
+        $id = $identifier[ 1 ];
63 63
 
64 64
         $user = $this->service->findByIdentityId($id);
65 65
         if ($user === null) {
@@ -95,7 +95,7 @@  discard block
 block discarded – undo
95 95
 
96 96
     public function getTestUserToken()
97 97
     {
98
-        return Cache::remember('testing:http_access_token', 60, function () {
98
+        return Cache::remember('testing:http_access_token', 60, function() {
99 99
             try {
100 100
                 $httpClient = new Client();
101 101
                 $response = $httpClient->post(env('AUTH0_DOMAIN').'oauth/token', [
Please login to merge, or discard this patch.