Completed
Push — master ( fbdce5...2e36c4 )
by Sherif
08:54
created
src/Modules/Roles/Routes/api.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
 */
15 15
 
16
-Route::group(['prefix' => 'roles'], function () {
16
+Route::group(['prefix' => 'roles'], function() {
17 17
 
18 18
     Route::get('/', 'RoleController@index');
19 19
     Route::get('/{id}', 'RoleController@find');
Please login to merge, or discard this patch.
src/Modules/Core/BaseClasses/BaseRepository.php 1 patch
Spacing   +15 added lines, -15 removed lines patch added patch discarded remove patch
@@ -21,7 +21,7 @@  discard block
 block discarded – undo
21 21
      */
22 22
     public function __construct($model)
23 23
     {
24
-        $this->model  = $model;
24
+        $this->model = $model;
25 25
     }
26 26
 
27 27
     /**
@@ -85,7 +85,7 @@  discard block
 block discarded – undo
85 85
         /**
86 86
          * Construct the select conditions for the model.
87 87
          */
88
-        $model->where(function ($q) use ($query, $conditionColumns, $relations) {
88
+        $model->where(function($q) use ($query, $conditionColumns, $relations) {
89 89
 
90 90
             if (count($conditionColumns)) {
91 91
                 $column = 'LOWER('.array_shift($conditionColumns).')';
@@ -127,9 +127,9 @@  discard block
 block discarded – undo
127 127
                     /**
128 128
                      * Construct the relation condition.
129 129
                      */
130
-                    $q->orWhereHas($relation, function ($subModel) use ($query, $relation) {
130
+                    $q->orWhereHas($relation, function($subModel) use ($query, $relation) {
131 131
 
132
-                        $subModel->where(function ($q) use ($query, $relation) {
132
+                        $subModel->where(function($q) use ($query, $relation) {
133 133
 
134 134
                             /**
135 135
                              * Get columns of the relation.
@@ -215,7 +215,7 @@  discard block
 block discarded – undo
215 215
         $model      = false;
216 216
         $relations  = [];
217 217
 
218
-        \DB::transaction(function () use (&$model, $relations, $data) {
218
+        \DB::transaction(function() use (&$model, $relations, $data) {
219 219
             
220 220
             $model     = $this->prepareModel($data);
221 221
             $relations = $this->prepareRelations($data, $model);
@@ -236,17 +236,17 @@  discard block
 block discarded – undo
236 236
     public function delete($value, $attribute = 'id')
237 237
     {
238 238
         if ($attribute == 'id') {
239
-            \DB::transaction(function () use ($value) {
239
+            \DB::transaction(function() use ($value) {
240 240
                 $model = $this->model->lockForUpdate()->find($value);
241
-                if (! $model) {
241
+                if ( ! $model) {
242 242
                     \ErrorHandler::notFound(class_basename($this->model).' with id : '.$value);
243 243
                 }
244 244
                 
245 245
                 $model->delete();
246 246
             });
247 247
         } else {
248
-            \DB::transaction(function () use ($value, $attribute) {
249
-                $this->model->where($attribute, '=', $value)->lockForUpdate()->get()->each(function ($model) {
248
+            \DB::transaction(function() use ($value, $attribute) {
249
+                $this->model->where($attribute, '=', $value)->lockForUpdate()->get()->each(function($model) {
250 250
                     $model->delete();
251 251
                 });
252 252
             });
@@ -337,7 +337,7 @@  discard block
 block discarded – undo
337 337
     {
338 338
         $model = $this->model->onlyTrashed()->find($id);
339 339
 
340
-        if (! $model) {
340
+        if ( ! $model) {
341 341
             \ErrorHandler::notFound(class_basename($this->model).' with id : '.$id);
342 342
         }
343 343
 
@@ -361,7 +361,7 @@  discard block
 block discarded – undo
361 361
          * @var array
362 362
          */
363 363
         $model = Arr::has($data, 'id') ? $modelClass->lockForUpdate()->find($data['id']) : new $modelClass;
364
-        if (! $model) {
364
+        if ( ! $model) {
365 365
             \ErrorHandler::notFound(class_basename($modelClass).' with id : '.$data['id']);
366 366
         }
367 367
 
@@ -411,7 +411,7 @@  discard block
 block discarded – undo
411 411
                      * If the relation has no value then marke the relation data
412 412
                      * related to the model to be deleted.
413 413
                      */
414
-                    if (! $value || ! count($value)) {
414
+                    if ( ! $value || ! count($value)) {
415 415
                         $relations[$relation] = 'delete';
416 416
                     }
417 417
                 }
@@ -438,7 +438,7 @@  discard block
 block discarded – undo
438 438
                             /**
439 439
                              * If model doesn't exists.
440 440
                              */
441
-                            if (! $relationModel) {
441
+                            if ( ! $relationModel) {
442 442
                                 \ErrorHandler::notFound(class_basename($relationBaseModel).' with id : '.$val['id']);
443 443
                             }
444 444
 
@@ -469,7 +469,7 @@  discard block
 block discarded – undo
469 469
                                 /**
470 470
                                  * If model doesn't exists.
471 471
                                  */
472
-                                if (! $relationModel) {
472
+                                if ( ! $relationModel) {
473 473
                                     \ErrorHandler::notFound(class_basename($relationBaseModel).' with id : '.$value['id']);
474 474
                                 }
475 475
 
@@ -675,7 +675,7 @@  discard block
 block discarded – undo
675 675
         $value      = $removeLast === false ? $value : substr($value, 0, $removeLast);
676 676
         $path       = explode('->', $value);
677 677
         $field      = array_shift($path);
678
-        $result     = sprintf('%s->\'$.%s\'', $field, collect($path)->map(function ($part) {
678
+        $result     = sprintf('%s->\'$.%s\'', $field, collect($path)->map(function($part) {
679 679
             return '"'.$part.'"';
680 680
         })->implode('.'));
681 681
         
Please login to merge, or discard this patch.
src/Modules/Core/Http/Middleware/UpdateLocaleAndTimezone.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
             if ($timezone && $timezone !== $user->timezone) {
49 49
                 $user->timezone = $timezone;
50
-                $update       = true;
50
+                $update = true;
51 51
             }
52 52
     
53 53
             if ($update) {
Please login to merge, or discard this patch.
src/Modules/Core/Database/Factories/SettingFactory.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -1,6 +1,6 @@
 block discarded – undo
1 1
 <?php
2 2
 
3
-$factory->define(App\Modules\Core\Setting::class, function (Faker\Generator $faker) {
3
+$factory->define(App\Modules\Core\Setting::class, function(Faker\Generator $faker) {
4 4
     return [
5 5
         'name'       => $faker->randomElement(['Company Name', 'Title', 'Header Image']),
6 6
         'value'      => $faker->word(),
Please login to merge, or discard this patch.
src/Modules/Core/Http/Middleware/CheckPermissions.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -60,8 +60,8 @@  discard block
 block discarded – undo
60 60
         $permission          = $routeActions[1];
61 61
 
62 62
         $this->auth->shouldUse('api');
63
-        if (! in_array($permission, $skipLoginCheck)) {
64
-            $this->authMiddleware->handle($request, function ($request) use ($modelName, $skipPermissionCheck, $skipLoginCheck, $permission) {
63
+        if ( ! in_array($permission, $skipLoginCheck)) {
64
+            $this->authMiddleware->handle($request, function($request) use ($modelName, $skipPermissionCheck, $skipLoginCheck, $permission) {
65 65
                 $user             = $this->auth->user();
66 66
                 $isPasswordClient = $user->token()->client->password_client;
67 67
     
@@ -70,7 +70,7 @@  discard block
 block discarded – undo
70 70
                 }
71 71
     
72 72
                 if ($isPasswordClient && (in_array($permission, $skipPermissionCheck) || $this->core->users()->can($permission, $modelName))) {
73
-                } elseif (! $isPasswordClient && $user->tokenCan($modelName.'-'.$permission)) {
73
+                } elseif ( ! $isPasswordClient && $user->tokenCan($modelName.'-'.$permission)) {
74 74
                 } else {
75 75
                     $this->errorHandler->noPermissions();
76 76
                 }
Please login to merge, or discard this patch.
src/Modules/Core/Console/Commands/GenerateDoc.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -83,7 +83,7 @@  discard block
 block discarded – undo
83 83
      */
84 84
     protected function getRoutes()
85 85
     {
86
-        return collect(\Route::getRoutes())->map(function ($route) {
86
+        return collect(\Route::getRoutes())->map(function($route) {
87 87
             if (strpos($route->uri(), 'api/') !== false) {
88 88
                 return [
89 89
                     'method' => $route->methods()[0],
@@ -114,7 +114,7 @@  discard block
 block discarded – undo
114 114
         ];
115 115
 
116 116
 
117
-        if (! $skipLoginCheck || ! in_array($method, $skipLoginCheck)) {
117
+        if ( ! $skipLoginCheck || ! in_array($method, $skipLoginCheck)) {
118 118
             $route['headers']['Authorization'] = 'Bearer {token}';
119 119
         }
120 120
     }
@@ -162,7 +162,7 @@  discard block
 block discarded – undo
162 162
         if (count($parameters)) {
163 163
             $className = optional($reflectionMethod->getParameters()[0]->getType())->getName();
164 164
             if ($className) {
165
-                $reflectionClass  = new \ReflectionClass($className);
165
+                $reflectionClass = new \ReflectionClass($className);
166 166
     
167 167
                 if ($reflectionClass->hasMethod('rules')) {
168 168
                     $reflectionMethod = $reflectionClass->getMethod('rules');
Please login to merge, or discard this patch.