Completed
Push — master ( d2b124...4b6f70 )
by Sherif
02:08
created
src/Modules/Core/BaseClasses/BaseRepository.php 1 patch
Spacing   +12 added lines, -12 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
     /**
@@ -82,7 +82,7 @@  discard block
 block discarded – undo
82 82
      */
83 83
     public function count($conditions = false)
84 84
     {
85
-        if($conditions) {
85
+        if ($conditions) {
86 86
             $conditions = $this->constructConditions($conditions, $this->model);
87 87
             return $this->model->whereRaw($conditions['conditionString'], $conditions['conditionValues'])->count();
88 88
         }
@@ -116,7 +116,7 @@  discard block
 block discarded – undo
116 116
         $model      = false;
117 117
         $relations  = [];
118 118
 
119
-        \DB::transaction(function () use (&$model, &$relations, $data) {
119
+        \DB::transaction(function() use (&$model, &$relations, $data) {
120 120
             
121 121
             $model     = $this->prepareModel($data);
122 122
             $relations = $this->prepareRelations($data, $model);
@@ -152,8 +152,8 @@  discard block
 block discarded – undo
152 152
      */
153 153
     public function delete($value, $attribute = 'id')
154 154
     {
155
-        \DB::transaction(function () use ($value, $attribute) {
156
-            $this->model->where($attribute, '=', $value)->lockForUpdate()->get()->each(function ($model) {
155
+        \DB::transaction(function() use ($value, $attribute) {
156
+            $this->model->where($attribute, '=', $value)->lockForUpdate()->get()->each(function($model) {
157 157
                 $model->delete();
158 158
             });
159 159
         });
@@ -243,7 +243,7 @@  discard block
 block discarded – undo
243 243
     {
244 244
         $model = $this->model->onlyTrashed()->find($id);
245 245
 
246
-        if (! $model) {
246
+        if ( ! $model) {
247 247
             \Errors::notFound(class_basename($this->model).' with id : '.$id);
248 248
         }
249 249
 
@@ -267,7 +267,7 @@  discard block
 block discarded – undo
267 267
          * @var array
268 268
          */
269 269
         $model = Arr::has($data, 'id') ? $modelClass->lockForUpdate()->find($data['id']) : new $modelClass;
270
-        if (! $model) {
270
+        if ( ! $model) {
271 271
             \Errors::notFound(class_basename($modelClass).' with id : '.$data['id']);
272 272
         }
273 273
 
@@ -324,7 +324,7 @@  discard block
 block discarded – undo
324 324
                      * If the relation has no value then marke the relation data
325 325
                      * related to the model to be deleted.
326 326
                      */
327
-                    if (! $value || ! count($value)) {
327
+                    if ( ! $value || ! count($value)) {
328 328
                         $relations[$relation] = 'delete';
329 329
                     }
330 330
                 }
@@ -342,7 +342,7 @@  discard block
 block discarded – undo
342 342
                          * Check if the relation is a collection.
343 343
                          */
344 344
                         if (class_basename($model->$relation) == 'Collection') {
345
-                            if (! is_array($val)) {
345
+                            if ( ! is_array($val)) {
346 346
                                 $relationModel = $relationBaseModel->lockForUpdate()->find($val);
347 347
                             } else {
348 348
                                 /**
@@ -355,7 +355,7 @@  discard block
 block discarded – undo
355 355
                             /**
356 356
                              * If model doesn't exists.
357 357
                              */
358
-                            if (! $relationModel) {
358
+                            if ( ! $relationModel) {
359 359
                                 \Errors::notFound(class_basename($relationBaseModel).' with id : '.$val['id']);
360 360
                             }
361 361
 
@@ -393,7 +393,7 @@  discard block
 block discarded – undo
393 393
                                 /**
394 394
                                  * If model doesn't exists.
395 395
                                  */
396
-                                if (! $relationModel) {
396
+                                if ( ! $relationModel) {
397 397
                                     \Errors::notFound(class_basename($relationBaseModel).' with id : '.$value['id']);
398 398
                                 }
399 399
 
@@ -603,7 +603,7 @@  discard block
 block discarded – undo
603 603
         $value      = $removeLast === false ? $value : substr($value, 0, $removeLast);
604 604
         $path       = explode('->', $value);
605 605
         $field      = array_shift($path);
606
-        $result     = sprintf('%s->\'$.%s\'', $field, collect($path)->map(function ($part) {
606
+        $result     = sprintf('%s->\'$.%s\'', $field, collect($path)->map(function($part) {
607 607
             return '"'.$part.'"';
608 608
         })->implode('.'));
609 609
         
Please login to merge, or discard this patch.
src/Modules/Roles/Http/Requests/StoreRole.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -23,9 +23,9 @@
 block discarded – undo
23 23
      */
24 24
     public function rules()
25 25
     {
26
-        $requiredOrNullable = request()->isMethod('PATCH') ? 'nullable' : 'required' . '';
26
+        $requiredOrNullable = request()->isMethod('PATCH') ? 'nullable' : 'required'.'';
27 27
         return [
28
-            'name' => $requiredOrNullable . '|string|max:100|unique:roles,name,' . $this->route('id')
28
+            'name' => $requiredOrNullable.'|string|max:100|unique:roles,name,'.$this->route('id')
29 29
         ];
30 30
     }
31 31
 }
Please login to merge, or discard this patch.
src/Modules/OauthClients/Http/Requests/StoreOauthClient.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -23,11 +23,11 @@
 block discarded – undo
23 23
      */
24 24
     public function rules()
25 25
     {
26
-        $requiredOrNullable = request()->isMethod('PATCH') ? 'nullable' : 'required' . '';
26
+        $requiredOrNullable = request()->isMethod('PATCH') ? 'nullable' : 'required'.'';
27 27
         return [
28
-            'name'     => $requiredOrNullable . '|max:255',
29
-            'redirect' => $requiredOrNullable . '|url',
30
-            'user_id'  => $requiredOrNullable . '|exists:users,id',
28
+            'name'     => $requiredOrNullable.'|max:255',
29
+            'redirect' => $requiredOrNullable.'|url',
30
+            'user_id'  => $requiredOrNullable.'|exists:users,id',
31 31
             'revoked'  => 'boolean'
32 32
         ];
33 33
     }
Please login to merge, or discard this patch.
src/Modules/Users/Http/Requests/StoreUser.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -23,10 +23,10 @@
 block discarded – undo
23 23
      */
24 24
     public function rules()
25 25
     {
26
-        $requiredOrNullable = request()->isMethod('PATCH') ? 'nullable' : 'required' . '';
26
+        $requiredOrNullable = request()->isMethod('PATCH') ? 'nullable' : 'required'.'';
27 27
         return [
28 28
             'name'     => 'nullable|string',
29
-            'email'    => $requiredOrNullable . '|email|unique:users,email,' . $this->route('id'),
29
+            'email'    => $requiredOrNullable.'|email|unique:users,email,'.$this->route('id'),
30 30
             'password' => 'nullable|min:6'
31 31
         ];
32 32
     }
Please login to merge, or discard this patch.
PushNotificationDevices/Http/Requests/StorePushNotificationDevice.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -23,10 +23,10 @@
 block discarded – undo
23 23
      */
24 24
     public function rules()
25 25
     {
26
-        $requiredOrNullable = request()->isMethod('PATCH') ? 'nullable' : 'required' . '';
26
+        $requiredOrNullable = request()->isMethod('PATCH') ? 'nullable' : 'required'.'';
27 27
         return [
28
-            'device_token' => $requiredOrNullable . '|string|max:255',
29
-            'user_id'      => $requiredOrNullable . '|exists:users,id'
28
+            'device_token' => $requiredOrNullable.'|string|max:255',
29
+            'user_id'      => $requiredOrNullable.'|exists:users,id'
30 30
         ];
31 31
     }
32 32
 }
Please login to merge, or discard this patch.