Passed
Pull Request — master (#14)
by ARCANEDEV
09:41
created
src/Auth/Socialite.php 2 patches
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -32,7 +32,7 @@  discard block
 block discarded – undo
32 32
     {
33 33
         $providers = Auth::config('authentication.socialite.providers', []);
34 34
 
35
-        return Collection::make($providers)->transform(function (array $provider, string $key) {
35
+        return Collection::make($providers)->transform(function(array $provider, string $key) {
36 36
             return new SocialiteProvider(array_merge($provider, ['type' => $key]));
37 37
         });
38 38
     }
@@ -44,7 +44,7 @@  discard block
 block discarded – undo
44 44
      */
45 45
     public static function getEnabledProviders(): Collection
46 46
     {
47
-        return static::getProviders()->filter(function (SocialiteProvider $provider) {
47
+        return static::getProviders()->filter(function(SocialiteProvider $provider) {
48 48
             return $provider->enabled ?? false;
49 49
         });
50 50
     }
@@ -60,7 +60,7 @@  discard block
 block discarded – undo
60 60
     {
61 61
         $options = config("services.{$provider}", []);
62 62
 
63
-        return tap(static::driver($provider), function (Provider $socialite) use ($provider, $options) {
63
+        return tap(static::driver($provider), function(Provider $socialite) use ($provider, $options) {
64 64
             $scopes = $options['scopes'] ?? [];
65 65
             $with   = $options['with'] ?? [];
66 66
             $fields = $options['fields'] ?? [];
Please login to merge, or discard this patch.
Braces   +9 added lines, -6 removed lines patch added patch discarded remove patch
@@ -65,14 +65,17 @@
 block discarded – undo
65 65
             $with   = $options['with'] ?? [];
66 66
             $fields = $options['fields'] ?? [];
67 67
 
68
-            if ( ! empty($scopes))
69
-                $socialite->scopes($scopes);
68
+            if ( ! empty($scopes)) {
69
+                            $socialite->scopes($scopes);
70
+            }
70 71
 
71
-            if ( ! empty($with))
72
-                $socialite->with($with);
72
+            if ( ! empty($with)) {
73
+                            $socialite->with($with);
74
+            }
73 75
 
74
-            if ( ! empty($fields))
75
-                $socialite->fields($fields);
76
+            if ( ! empty($fields)) {
77
+                            $socialite->fields($fields);
78
+            }
76 79
         })->redirect();
77 80
     }
78 81
 
Please login to merge, or discard this patch.
src/Auth/Console/MakeUser.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -70,7 +70,7 @@
 block discarded – undo
70 70
      */
71 71
     protected static function defaultCreateUserCallback(): Closure
72 72
     {
73
-        return function (string $firstName, string $lastName, string $email, string $password) {
73
+        return function(string $firstName, string $lastName, string $email, string $password) {
74 74
             /** @var  \Arcanesoft\Foundation\Auth\Repositories\UsersRepository  $repo */
75 75
             $repo = app(UsersRepository::class);
76 76
             $now  = now();
Please login to merge, or discard this patch.
src/Auth/Console/MakeAdmin.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -71,7 +71,7 @@
 block discarded – undo
71 71
      */
72 72
     protected static function defaultCreateUserCallback(): Closure
73 73
     {
74
-        return function (string $firstName, string $lastName, string $email, string $password) {
74
+        return function(string $firstName, string $lastName, string $email, string $password) {
75 75
             $repo = static::getAdministratorsRepository();
76 76
 
77 77
             $administrator = $repo->createOne([
Please login to merge, or discard this patch.
src/Auth/Session/DatabaseSessionHandler.php 2 patches
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -212,7 +212,7 @@
 block discarded – undo
212 212
             return $payload;
213 213
         }
214 214
 
215
-        return tap($payload, function (&$payload) {
215
+        return tap($payload, function(&$payload) {
216 216
             $this->addUserInformation($payload);
217 217
             $this->addRequestInformation($payload);
218 218
         });
Please login to merge, or discard this patch.
Braces   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -98,8 +98,9 @@  discard block
 block discarded – undo
98 98
     {
99 99
         $session = $this->findSession($sessionId);
100 100
 
101
-        if (is_null($session))
102
-            return '';
101
+        if (is_null($session)) {
102
+                    return '';
103
+        }
103 104
 
104 105
         if ($session->hasExpired()) {
105 106
             $this->exists = true;
@@ -148,8 +149,7 @@  discard block
 block discarded – undo
148 149
 
149 150
         try {
150 151
             return $this->repo->newModelInstance($attributes)->save();
151
-        }
152
-        catch (QueryException $e) {
152
+        } catch (QueryException $e) {
153 153
             $this->performUpdate($sessionId, $attributes);
154 154
         }
155 155
 
Please login to merge, or discard this patch.
src/Auth/Views/Components/UsersDatatable.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -77,13 +77,13 @@
 block discarded – undo
77 77
     {
78 78
         return $repo
79 79
             ->onlyTrashed($this->trash)
80
-            ->unless(empty($this->search), function (Builder $query) {
80
+            ->unless(empty($this->search), function(Builder $query) {
81 81
                 $query
82 82
                     ->where('first_name', 'like', '%'.$this->search.'%')
83 83
                     ->orWhere('last_name', 'like', '%'.$this->search.'%')
84 84
                     ->orWhere('email', 'like', '%'.$this->search.'%');
85 85
             })
86
-            ->unless(empty($this->sortField), function (Builder $query) {
86
+            ->unless(empty($this->sortField), function(Builder $query) {
87 87
                 $query->orderBy($this->sortField, $this->getSortDirection());
88 88
             })
89 89
             ->paginate($this->perPage);
Please login to merge, or discard this patch.
src/Auth/Views/Components/PasswordResetsDatatable.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -58,7 +58,7 @@  discard block
 block discarded – undo
58 58
      */
59 59
     public function render(PasswordResetsRepository $repo)
60 60
     {
61
-        return view('foundation::authorization.password-resets._datatables.index',[
61
+        return view('foundation::authorization.password-resets._datatables.index', [
62 62
             'passwordResets' => $this->getResults($repo),
63 63
             'fields'         => $this->getFields(),
64 64
         ]);
@@ -74,10 +74,10 @@  discard block
 block discarded – undo
74 74
     private function getResults(PasswordResetsRepository $repo): LengthAwarePaginator
75 75
     {
76 76
         return $repo
77
-            ->unless(empty($this->search), function (Builder $query) {
77
+            ->unless(empty($this->search), function(Builder $query) {
78 78
                 $query->Where('email', 'like', '%'.$this->search.'%');
79 79
             })
80
-            ->unless(empty($this->sortField), function (Builder $query) {
80
+            ->unless(empty($this->sortField), function(Builder $query) {
81 81
                 $query->orderBy($this->sortField, $this->getSortDirection());
82 82
             })
83 83
             ->paginate($this->perPage);
Please login to merge, or discard this patch.
src/Auth/Views/Components/PermissionsDatatable.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -81,13 +81,13 @@
 block discarded – undo
81 81
             ->with(['group'])
82 82
             ->withCount(['roles'])
83 83
             ->join($groupsTable, "{$permissionTable}.group_id", '=', "{$groupsTable}.id")
84
-            ->unless(empty($this->search), function (Builder $query) use ($permissionTable, $groupsTable) {
84
+            ->unless(empty($this->search), function(Builder $query) use ($permissionTable, $groupsTable) {
85 85
                 $query
86 86
                     ->where("{$groupsTable}.name", 'like', '%'.$this->search.'%')
87 87
                     ->orWhere("{$permissionTable}.category", 'like', '%'.$this->search.'%')
88 88
                     ->orWhere("{$permissionTable}.name", 'like', '%'.$this->search.'%');
89 89
             })
90
-            ->unless(empty($this->sortField), function (Builder $query) use ($permissionTable, $groupsTable) {
90
+            ->unless(empty($this->sortField), function(Builder $query) use ($permissionTable, $groupsTable) {
91 91
                 $sortField = $this->sortField === 'group'
92 92
                     ? "{$groupsTable}.name"
93 93
                     : "{$permissionTable}.{$this->sortField}";
Please login to merge, or discard this patch.
src/Auth/Views/Components/RolesDatatable.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -75,10 +75,10 @@
 block discarded – undo
75 75
     {
76 76
         return $repo
77 77
             ->withCount(['administrators'])
78
-            ->unless(empty($this->search), function (Builder $query) {
78
+            ->unless(empty($this->search), function(Builder $query) {
79 79
                 $query->where('name', 'like', '%'.$this->search.'%');
80 80
             })
81
-            ->unless(empty($this->sortField), function (Builder $query) {
81
+            ->unless(empty($this->sortField), function(Builder $query) {
82 82
                 $query->orderBy($this->sortField, $this->getSortDirection());
83 83
             })
84 84
             ->paginate($this->perPage);
Please login to merge, or discard this patch.
src/Auth/Models/Presenters/PermissionPresenter.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -30,7 +30,7 @@
 block discarded – undo
30 30
      */
31 31
     public function getUsersCountAttribute(): int
32 32
     {
33
-        return $this->roles->sum(function (Role $role) {
33
+        return $this->roles->sum(function(Role $role) {
34 34
             return $role->administrators->count();
35 35
         });
36 36
     }
Please login to merge, or discard this patch.