Passed
Push — master ( 71dfd6...ad5aca )
by Andrey
14:26
created
src/Traits/Searchable.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -51,7 +51,7 @@
 block discarded – undo
51 51
             return $value;
52 52
         }
53 53
 
54
-        return $this->searchOr($model, $value, function () use ($exception, $value) {
54
+        return $this->searchOr($model, $value, function() use ($exception, $value) {
55 55
             throw new $exception($value);
56 56
         });
57 57
     }
Please login to merge, or discard this patch.
migrations/2020_06_04_000001_modify_roles_table_add_is_root_column.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -6,14 +6,14 @@
 block discarded – undo
6 6
 {
7 7
     public function up()
8 8
     {
9
-        $this->table($this->roles, function (Blueprint $table) {
9
+        $this->table($this->roles, function(Blueprint $table) {
10 10
             $table->boolean('is_root')->default(false)->after('name');
11 11
         });
12 12
     }
13 13
 
14 14
     public function down()
15 15
     {
16
-        $this->table($this->roles, function (Blueprint $table) {
16
+        $this->table($this->roles, function(Blueprint $table) {
17 17
             $table->dropColumn('is_root');
18 18
         });
19 19
     }
Please login to merge, or discard this patch.
2020_06_04_000002_modify_roles_and_permissions_tables_remove_timestamps.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -18,14 +18,14 @@
 block discarded – undo
18 18
 
19 19
     protected function dropTimestamps(string $table)
20 20
     {
21
-        $this->table($table, function (Blueprint $table) {
21
+        $this->table($table, function(Blueprint $table) {
22 22
             $table->dropTimestamps();
23 23
         });
24 24
     }
25 25
 
26 26
     protected function createTimestamps(string $table)
27 27
     {
28
-        $this->table($table, function (Blueprint $table) {
28
+        $this->table($table, function(Blueprint $table) {
29 29
             $table->timestamps();
30 30
         });
31 31
     }
Please login to merge, or discard this patch.
migrations/2019_04_22_115951_create_roles_and_permissions_tables.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -24,7 +24,7 @@  discard block
 block discarded – undo
24 24
 
25 25
     protected function createTable(string $table)
26 26
     {
27
-        $this->create($table, function (Blueprint $table) {
27
+        $this->create($table, function(Blueprint $table) {
28 28
             $table->bigIncrements('id');
29 29
             $table->string('name')->unique();
30 30
             $table->timestamps();
@@ -33,7 +33,7 @@  discard block
 block discarded – undo
33 33
 
34 34
     protected function createPivot(string $table, string $first_table, string $second_table, string $first_key, string $second_key)
35 35
     {
36
-        $this->create($table, function (Blueprint $table) use ($first_table, $second_table, $first_key, $second_key) {
36
+        $this->create($table, function(Blueprint $table) use ($first_table, $second_table, $first_key, $second_key) {
37 37
             $table->unsignedBigInteger($first_key);
38 38
             $table->unsignedBigInteger($second_key);
39 39
 
Please login to merge, or discard this patch.
database/migrations/2020_06_05_000000_create_user_permission_table.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -23,7 +23,7 @@
 block discarded – undo
23 23
 
24 24
     protected function createPivot(string $table, string $first_table, string $second_table, string $first_key, string $second_key)
25 25
     {
26
-        $this->create($table, function (Blueprint $table) use ($first_table, $second_table, $first_key, $second_key) {
26
+        $this->create($table, function(Blueprint $table) use ($first_table, $second_table, $first_key, $second_key) {
27 27
             $table->unsignedBigInteger($first_key)->index();
28 28
             $table->unsignedBigInteger($second_key);
29 29
 
Please login to merge, or discard this patch.
src/Support/Database/Search.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -43,7 +43,7 @@  discard block
 block discarded – undo
43 43
      */
44 44
     protected function map($values): array
45 45
     {
46
-        return array_map(function ($value) {
46
+        return array_map(function($value) {
47 47
             return $this->getId($value);
48 48
         }, $this->toArray($values));
49 49
     }
@@ -52,7 +52,7 @@  discard block
 block discarded – undo
52 52
     {
53 53
         if ($this->isArrayable($values)) {
54 54
             $values = $values->toArray();
55
-        } elseif (! $this->isArray($values)) {
55
+        } elseif ( ! $this->isArray($values)) {
56 56
             $values = Arr::wrap($values);
57 57
         }
58 58
 
Please login to merge, or discard this patch.
src/Traits/HasRoles.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -30,7 +30,7 @@  discard block
 block discarded – undo
30 30
 
31 31
     public function hasRootRole(): bool
32 32
     {
33
-        return $this->cache(__FUNCTION__, function () {
33
+        return $this->cache(__FUNCTION__, function() {
34 34
             return $this->roles()
35 35
                 ->where('is_root', true)
36 36
                 ->exists();
@@ -105,7 +105,7 @@  discard block
 block discarded – undo
105 105
      */
106 106
     public function hasRole(...$roles): bool
107 107
     {
108
-        return $this->cache(__FUNCTION__, function () use ($roles) {
108
+        return $this->cache(__FUNCTION__, function() use ($roles) {
109 109
             return Search::by($this->roles(), $roles)->exists();
110 110
         }, $roles);
111 111
     }
@@ -117,7 +117,7 @@  discard block
 block discarded – undo
117 117
      */
118 118
     public function hasRoles(...$roles): bool
119 119
     {
120
-        return $this->cache(__FUNCTION__, function () use ($roles) {
120
+        return $this->cache(__FUNCTION__, function() use ($roles) {
121 121
             $count = Search::by($this->roles(), $roles)->count();
122 122
 
123 123
             return $count === count($roles);
@@ -200,11 +200,11 @@  discard block
 block discarded – undo
200 200
      */
201 201
     public function hasPermission($permission): bool
202 202
     {
203
-        return $this->cache(__FUNCTION__, function () use ($permission) {
203
+        return $this->cache(__FUNCTION__, function() use ($permission) {
204 204
             $first = Search::by($this->permissions(), $permission)->exists();
205 205
 
206 206
             $second = $this->roles()
207
-                ->whereHas('permissions', function (Builder $builder) use ($permission) {
207
+                ->whereHas('permissions', function(Builder $builder) use ($permission) {
208 208
                     return Search::by($builder, $permission);
209 209
                 })->exists();
210 210
 
@@ -219,7 +219,7 @@  discard block
 block discarded – undo
219 219
      */
220 220
     public function hasPermissions(...$permissions): bool
221 221
     {
222
-        return $this->cache(__FUNCTION__, function () use ($permissions) {
222
+        return $this->cache(__FUNCTION__, function() use ($permissions) {
223 223
             $count = Search::by($this->permissions(), $permissions)->count();
224 224
 
225 225
             return $count === count($permissions);
Please login to merge, or discard this patch.
src/ServiceProvider.php 1 patch
Spacing   +12 added lines, -12 removed lines patch added patch discarded remove patch
@@ -48,57 +48,57 @@
 block discarded – undo
48 48
 
49 49
     protected function blade()
50 50
     {
51
-        if (! Config::useBlade()) {
51
+        if ( ! Config::useBlade()) {
52 52
             return;
53 53
         }
54 54
 
55 55
         /* Role */
56
-        Blade::directive('role', function ($role) {
56
+        Blade::directive('role', function($role) {
57 57
             return "<?php if(\auth()->check() && \auth()->user()->hasRole($role)) { ?>";
58 58
         });
59 59
 
60
-        Blade::directive('endrole', function () {
60
+        Blade::directive('endrole', function() {
61 61
             return '<?php } ?>';
62 62
         });
63 63
 
64 64
         /* Roles */
65
-        Blade::directive('role', function ($roles) {
65
+        Blade::directive('role', function($roles) {
66 66
             return "<?php if(\auth()->check() && \auth()->user()->hasRoles($roles)) { ?>";
67 67
         });
68 68
 
69
-        Blade::directive('endroles', function () {
69
+        Blade::directive('endroles', function() {
70 70
             return '<?php } ?>';
71 71
         });
72 72
 
73 73
         /* Permission */
74
-        Blade::directive('permission', function ($permission) {
74
+        Blade::directive('permission', function($permission) {
75 75
             return "<?php if(\auth()->check() && \auth()->user()->hasPermission($permission)) ?>";
76 76
         });
77 77
 
78
-        Blade::directive('endpermission', function () {
78
+        Blade::directive('endpermission', function() {
79 79
             return '<?php } ?>';
80 80
         });
81 81
 
82 82
         /* Permissions */
83
-        Blade::directive('permissions', function ($permissions) {
83
+        Blade::directive('permissions', function($permissions) {
84 84
             return "<?php if(\auth()->check() && \auth()->user()->hasPermissions($permissions)) ?>";
85 85
         });
86 86
 
87
-        Blade::directive('endpermissions', function () {
87
+        Blade::directive('endpermissions', function() {
88 88
             return '<?php } ?>';
89 89
         });
90 90
     }
91 91
 
92 92
     protected function can()
93 93
     {
94
-        if (! Config::useCanDirective()) {
94
+        if ( ! Config::useCanDirective()) {
95 95
             return;
96 96
         }
97 97
 
98 98
         Permission::query()
99 99
             ->get(['slug'])
100
-            ->each(function (Permission $permission) {
101
-                Gate::define($permission->slug, function (Authenticatable $user) use ($permission) {
100
+            ->each(function(Permission $permission) {
101
+                Gate::define($permission->slug, function(Authenticatable $user) use ($permission) {
102 102
                     return $user->hasPermission($permission);
103 103
                 });
104 104
             });
Please login to merge, or discard this patch.
2020_09_06_000001_modify_roles_and_permissions_tables_add_title_column.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -19,14 +19,14 @@
 block discarded – undo
19 19
 
20 20
     protected function addTitleColumn(string $table): void
21 21
     {
22
-        $this->table($table, function (Blueprint $table) {
22
+        $this->table($table, function(Blueprint $table) {
23 23
             $table->string('title')->nullable()->after('slug');
24 24
         });
25 25
     }
26 26
 
27 27
     protected function dropTitleColumn(string $table): void
28 28
     {
29
-        $this->table($table, function (Blueprint $table) {
29
+        $this->table($table, function(Blueprint $table) {
30 30
             $table->dropColumn('title');
31 31
         });
32 32
     }
Please login to merge, or discard this patch.