Completed
Push — master ( de5c78...60eb24 )
by Sherif
09:23
created
src/Modules/Users/Http/Requests/StoreUser.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
         return [
27 27
             'name'     => 'nullable|string',
28
-            'email'    => 'required|email|unique:users,email,' . $this->route('id'),
28
+            'email'    => 'required|email|unique:users,email,'.$this->route('id'),
29 29
             'password' => 'nullable|min:6'
30 30
         ];
31 31
     }
Please login to merge, or discard this patch.
src/Modules/Users/Database/Seeds/UsersTableSeeder.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -20,7 +20,7 @@  discard block
 block discarded – undo
20 20
          */
21 21
         Role::updateOrInsert([
22 22
             'name' => 'Admin',
23
-        ],[
23
+        ], [
24 24
             'created_at' => \DB::raw('NOW()'),
25 25
             'updated_at' => \DB::raw('NOW()')
26 26
         ]);
@@ -30,7 +30,7 @@  discard block
 block discarded – undo
30 30
          */
31 31
         AclUser::updateOrInsert([
32 32
             'email' => '[email protected]',
33
-        ],[
33
+        ], [
34 34
             'name'       => 'Admin',
35 35
             'password'   => \Hash::make('123456'),
36 36
             'confirmed'  => 1,
Please login to merge, or discard this patch.
src/Modules/Users/Services/UserService.php 1 patch
Spacing   +11 added lines, -11 removed lines patch added patch discarded remove patch
@@ -67,7 +67,7 @@  discard block
 block discarded – undo
67 67
         $permissions = [];
68 68
         $user        = $this->repo->find(\Auth::id(), $relations);
69 69
         foreach ($user->roles as $role) {
70
-            $role->permissions->each(function ($permission) use (&$permissions) {
70
+            $role->permissions->each(function($permission) use (&$permissions) {
71 71
                 $permissions[$permission->repo][$permission->id] = $permission->name;
72 72
             });
73 73
         }
@@ -130,7 +130,7 @@  discard block
 block discarded – undo
130 130
     public function assignRoles($userId, $roleIds)
131 131
     {
132 132
         $user = false;
133
-        \DB::transaction(function () use ($userId, $roleIds, &$user) {
133
+        \DB::transaction(function() use ($userId, $roleIds, &$user) {
134 134
             $user = $this->repo->find($userId);
135 135
             $this->repo->detachRoles($user);
136 136
             $this->repo->attachRoles($user, $roleIds);
@@ -148,11 +148,11 @@  discard block
 block discarded – undo
148 148
      */
149 149
     public function login($email, $password)
150 150
     {
151
-        if (! $user = $this->repo->first(['email' => $email])) {
151
+        if ( ! $user = $this->repo->first(['email' => $email])) {
152 152
             \Errors::loginFailed();
153 153
         } elseif ($user->blocked) {
154 154
             \Errors::userIsBlocked();
155
-        } elseif (! config('user.disable_confirm_email') && ! $user->confirmed) {
155
+        } elseif ( ! config('user.disable_confirm_email') && ! $user->confirmed) {
156 156
             \Errors::emailNotConfirmed();
157 157
         }
158 158
 
@@ -171,11 +171,11 @@  discard block
 block discarded – undo
171 171
         $accessToken = $authCode ? Arr::get(\Socialite::driver($type)->getAccessTokenResponse($authCode), 'access_token') : $accessToken;
172 172
         $user        = \Socialite::driver($type)->userFromToken($accessToken)->user;
173 173
 
174
-        if (! \Arr::has($user, 'email')) {
174
+        if ( ! \Arr::has($user, 'email')) {
175 175
             \Errors::noSocialEmail();
176 176
         }
177 177
 
178
-        if (! $this->repo->first(['email' => $user['email']])) {
178
+        if ( ! $this->repo->first(['email' => $user['email']])) {
179 179
             $this->register($user['name'], $user['email'], '', true);
180 180
         }
181 181
 
@@ -200,7 +200,7 @@  discard block
 block discarded – undo
200 200
             'confirmed' => $skipConfirmEmail
201 201
         ]);
202 202
 
203
-        if (! $skipConfirmEmail && ! config('user.disable_confirm_email')) {
203
+        if ( ! $skipConfirmEmail && ! config('user.disable_confirm_email')) {
204 204
             $this->sendConfirmationEmail($user->email);
205 205
         }
206 206
 
@@ -241,7 +241,7 @@  discard block
 block discarded – undo
241 241
      */
242 242
     public function sendReset($email)
243 243
     {
244
-        if (! $user = $this->repo->first(['email' => $email])) {
244
+        if ( ! $user = $this->repo->first(['email' => $email])) {
245 245
             \Errors::notFound('email');
246 246
         }
247 247
 
@@ -265,7 +265,7 @@  discard block
 block discarded – undo
265 265
             'password'              => $password,
266 266
             'password_confirmation' => $passwordConfirmation,
267 267
             'token'                 => $token
268
-        ], function ($user, $password) {
268
+        ], function($user, $password) {
269 269
             $this->repo->save(['id' => $user->id, 'password' => $password]);
270 270
         });
271 271
 
@@ -298,7 +298,7 @@  discard block
 block discarded – undo
298 298
     public function changePassword($password, $oldPassword)
299 299
     {
300 300
         $user = \Auth::user();
301
-        if (! \Hash::check($oldPassword, $user->password)) {
301
+        if ( ! \Hash::check($oldPassword, $user->password)) {
302 302
             \Errors::invalidOldPassword();
303 303
         }
304 304
 
@@ -313,7 +313,7 @@  discard block
 block discarded – undo
313 313
      */
314 314
     public function confirmEmail($confirmationCode)
315 315
     {
316
-        if (! $user = $this->repo->first(['confirmation_code' => $confirmationCode])) {
316
+        if ( ! $user = $this->repo->first(['confirmation_code' => $confirmationCode])) {
317 317
             \Errors::invalidConfirmationCode();
318 318
         }
319 319
 
Please login to merge, or discard this patch.
src/Modules/Roles/Http/Requests/StoreRole.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -24,7 +24,7 @@
 block discarded – undo
24 24
     public function rules()
25 25
     {
26 26
         return [
27
-            'name' => 'required|string|max:100|unique:roles,name,' . $this->route('id')
27
+            'name' => 'required|string|max:100|unique:roles,name,'.$this->route('id')
28 28
         ];
29 29
     }
30 30
 }
Please login to merge, or discard this patch.
src/Modules/Roles/Services/RoleService.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -28,7 +28,7 @@
 block discarded – undo
28 28
     public function assignPermissions($roleId, $permissionIds)
29 29
     {
30 30
         $role = false;
31
-        \DB::transaction(function () use ($roleId, $permissionIds, &$role) {
31
+        \DB::transaction(function() use ($roleId, $permissionIds, &$role) {
32 32
             $role = $this->repo->find($roleId);
33 33
             $this->repo->detachPermissions($role);
34 34
             $this->repo->attachPermissions($role, $permissionIds);
Please login to merge, or discard this patch.
src/Modules/OauthClients/Services/OauthClientService.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -26,7 +26,7 @@
 block discarded – undo
26 26
      */
27 27
     public function revoke($clientId)
28 28
     {
29
-        \DB::transaction(function () use ($clientId) {
29
+        \DB::transaction(function() use ($clientId) {
30 30
             $client = $this->repo->find($clientId);
31 31
             $this->repo->revokeClientTokens($client);
32 32
             $this->repo->save(['id'=> $clientId, 'revoked' => true]);
Please login to merge, or discard this patch.
src/Modules/Core/Core.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -19,12 +19,12 @@
 block discarded – undo
19 19
     public function __call($name, $arguments)
20 20
     {
21 21
         foreach (\Module::all() as $module) {
22
-            $nameSpace = 'App\\Modules\\' . $module['basename'] ;
22
+            $nameSpace = 'App\\Modules\\'.$module['basename'];
23 23
             $model = ucfirst(\Str::singular($name));
24
-            if(count($arguments) == 1 && $arguments[0]) {
25
-                $class = $nameSpace . '\\Services\\' . $model . 'Service';
24
+            if (count($arguments) == 1 && $arguments[0]) {
25
+                $class = $nameSpace.'\\Services\\'.$model.'Service';
26 26
             } else {
27
-                $class = $nameSpace . '\\Repositories\\' . $model . 'Repository';
27
+                $class = $nameSpace.'\\Repositories\\'.$model.'Repository';
28 28
             }
29 29
 
30 30
             if (class_exists($class)) {
Please login to merge, or discard this patch.
src/Modules/Core/Traits/Translatable.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -40,7 +40,7 @@
 block discarded – undo
40 40
             return $values;
41 41
         }
42 42
 
43
-        if (! $primaryLocale || ! is_object($values) || ! property_exists($values, $primaryLocale)) {
43
+        if ( ! $primaryLocale || ! is_object($values) || ! property_exists($values, $primaryLocale)) {
44 44
             return $values ? (isset($values->$fallbackLocale) ? $values->$fallbackLocale : $values) : '';
45 45
         }
46 46
 
Please login to merge, or discard this patch.
src/Modules/Core/BaseClasses/BaseService.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -37,7 +37,7 @@  discard block
 block discarded – undo
37 37
     {
38 38
         $translatable = $this->repo->model->translatable ?? [];
39 39
         $filters = $this->constructFilters($conditions);
40
-        $sortBy = in_array($sortBy, $translatable) ? $sortBy . '->' . \Session::get('locale') : $sortBy;
40
+        $sortBy = in_array($sortBy, $translatable) ? $sortBy.'->'.\Session::get('locale') : $sortBy;
41 41
 
42 42
         if ($trashed) {
43 43
             return $this->deleted(['and' => $filters], $perPage ?? 15, $sortBy ?? 'created_at', $desc ?? true);
@@ -202,22 +202,22 @@  discard block
 block discarded – undo
202 202
         $translatable = $this->repo->model->translatable ?? [];
203 203
         foreach ($conditions as $key => $value) {
204 204
             if ((in_array($key, $this->repo->model->fillable ?? []) || method_exists($this->repo->model, $key) || in_array($key, ['or', 'and'])) && $key !== 'trashed') {
205
-                $key = in_array($key, $translatable) ? $key . '->' . (\Session::get('locale') == 'all' ? 'en' : \Session::get('locale')) : $key;
205
+                $key = in_array($key, $translatable) ? $key.'->'.(\Session::get('locale') == 'all' ? 'en' : \Session::get('locale')) : $key;
206 206
                 if (filter_var($value, FILTER_VALIDATE_BOOLEAN, FILTER_NULL_ON_FAILURE) !== null && strpos($key, '_id') === false && ! is_null($value)) {
207 207
                     $filters[$key] = filter_var($value, FILTER_VALIDATE_BOOLEAN);
208
-                } elseif (! is_array($value) && strpos($key, '_id')) {
208
+                } elseif ( ! is_array($value) && strpos($key, '_id')) {
209 209
                     $filters[$key] = [
210 210
                         'op' => 'in',
211 211
                         'val' => explode(',', $value)
212 212
                     ];
213 213
                 } elseif (is_array($value)) {
214 214
                     $filters[$key] = $value;
215
-                } elseif($value) {
216
-                    $key = 'LOWER(' . $key . ')';
215
+                } elseif ($value) {
216
+                    $key = 'LOWER('.$key.')';
217 217
                     $value = strtolower($value);
218 218
                     $filters[$key] = [
219 219
                         'op' => 'like',
220
-                        'val' => '%' . $value . '%'
220
+                        'val' => '%'.$value.'%'
221 221
                     ];
222 222
                 }
223 223
             }
Please login to merge, or discard this patch.