Completed
Push — master ( 39b104...a0772e )
by Sherif
01:57
created
src/Modules/Core/BaseClasses/BaseRepository.php 2 patches
Doc Comments   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -27,7 +27,7 @@  discard block
 block discarded – undo
27 27
      *
28 28
      * @param  array   $relations
29 29
      * @param  string  $sortBy
30
-     * @param  boolean $desc
30
+     * @param  integer $desc
31 31
      * @param  array   $columns
32 32
      * @return collection
33 33
      */
@@ -43,7 +43,7 @@  discard block
 block discarded – undo
43 43
      * @param  integer $perPage
44 44
      * @param  array   $relations
45 45
      * @param  string  $sortBy
46
-     * @param  boolean $desc
46
+     * @param  integer $desc
47 47
      * @param  array   $columns
48 48
      * @return collection
49 49
      */
@@ -61,7 +61,7 @@  discard block
 block discarded – undo
61 61
      * @param  integer $perPage
62 62
      * @param  array   $relations
63 63
      * @param  string  $sortBy
64
-     * @param  boolean $desc
64
+     * @param  integer $desc
65 65
      * @param  array   $columns
66 66
      * @return collection
67 67
      */
@@ -76,7 +76,7 @@  discard block
 block discarded – undo
76 76
      * Save the given model to the storage.
77 77
      *
78 78
      * @param  array $data
79
-     * @return mixed
79
+     * @return boolean
80 80
      */
81 81
     public function save(array $data)
82 82
     {
@@ -132,7 +132,7 @@  discard block
 block discarded – undo
132 132
      * @param  array   $conditions array of conditions
133 133
      * @param  array   $relations
134 134
      * @param  string  $sortBy
135
-     * @param  boolean $desc
135
+     * @param  integer $desc
136 136
      * @param  array   $columns
137 137
      * @return collection
138 138
      */
@@ -164,7 +164,7 @@  discard block
 block discarded – undo
164 164
      * @param  array   $conditions array of conditions
165 165
      * @param  integer $perPage
166 166
      * @param  string  $sortBy
167
-     * @param  boolean $desc
167
+     * @param  integer $desc
168 168
      * @param  array   $columns
169 169
      * @return collection
170 170
      */
Please login to merge, or discard this patch.
Spacing   +10 added lines, -10 removed lines patch added patch discarded remove patch
@@ -19,7 +19,7 @@  discard block
 block discarded – undo
19 19
      */
20 20
     public function __construct($model)
21 21
     {
22
-        $this->model  = $model;
22
+        $this->model = $model;
23 23
     }
24 24
 
25 25
     /**
@@ -84,7 +84,7 @@  discard block
 block discarded – undo
84 84
         $model      = false;
85 85
         $relations  = [];
86 86
 
87
-        \DB::transaction(function () use (&$model, $relations, $data) {
87
+        \DB::transaction(function() use (&$model, $relations, $data) {
88 88
             
89 89
             $model     = $this->prepareModel($data);
90 90
             $relations = $this->prepareRelations($data, $model);
@@ -104,8 +104,8 @@  discard block
 block discarded – undo
104 104
      */
105 105
     public function delete($value, $attribute = 'id')
106 106
     {
107
-        \DB::transaction(function () use ($value, $attribute) {
108
-            $this->model->where($attribute, '=', $value)->lockForUpdate()->get()->each(function ($model) {
107
+        \DB::transaction(function() use ($value, $attribute) {
108
+            $this->model->where($attribute, '=', $value)->lockForUpdate()->get()->each(function($model) {
109 109
                 $model->delete();
110 110
             });
111 111
         });
@@ -195,7 +195,7 @@  discard block
 block discarded – undo
195 195
     {
196 196
         $model = $this->model->onlyTrashed()->find($id);
197 197
 
198
-        if (! $model) {
198
+        if ( ! $model) {
199 199
             \Errors::notFound(class_basename($this->model).' with id : '.$id);
200 200
         }
201 201
 
@@ -219,7 +219,7 @@  discard block
 block discarded – undo
219 219
          * @var array
220 220
          */
221 221
         $model = Arr::has($data, 'id') ? $modelClass->lockForUpdate()->find($data['id']) : new $modelClass;
222
-        if (! $model) {
222
+        if ( ! $model) {
223 223
             \Errors::notFound(class_basename($modelClass).' with id : '.$data['id']);
224 224
         }
225 225
 
@@ -269,7 +269,7 @@  discard block
 block discarded – undo
269 269
                      * If the relation has no value then marke the relation data
270 270
                      * related to the model to be deleted.
271 271
                      */
272
-                    if (! $value || ! count($value)) {
272
+                    if ( ! $value || ! count($value)) {
273 273
                         $relations[$relation] = 'delete';
274 274
                     }
275 275
                 }
@@ -296,7 +296,7 @@  discard block
 block discarded – undo
296 296
                             /**
297 297
                              * If model doesn't exists.
298 298
                              */
299
-                            if (! $relationModel) {
299
+                            if ( ! $relationModel) {
300 300
                                 \Errors::notFound(class_basename($relationBaseModel).' with id : '.$val['id']);
301 301
                             }
302 302
 
@@ -327,7 +327,7 @@  discard block
 block discarded – undo
327 327
                                 /**
328 328
                                  * If model doesn't exists.
329 329
                                  */
330
-                                if (! $relationModel) {
330
+                                if ( ! $relationModel) {
331 331
                                     \Errors::notFound(class_basename($relationBaseModel).' with id : '.$value['id']);
332 332
                                 }
333 333
 
@@ -533,7 +533,7 @@  discard block
 block discarded – undo
533 533
         $value      = $removeLast === false ? $value : substr($value, 0, $removeLast);
534 534
         $path       = explode('->', $value);
535 535
         $field      = array_shift($path);
536
-        $result     = sprintf('%s->\'$.%s\'', $field, collect($path)->map(function ($part) {
536
+        $result     = sprintf('%s->\'$.%s\'', $field, collect($path)->map(function($part) {
537 537
             return '"'.$part.'"';
538 538
         })->implode('.'));
539 539
         
Please login to merge, or discard this patch.
src/Modules/Core/BaseClasses/BaseService.php 1 patch
Doc Comments   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -52,7 +52,7 @@  discard block
 block discarded – undo
52 52
      *
53 53
      * @param  array   $relations
54 54
      * @param  string  $sortBy
55
-     * @param  boolean $desc
55
+     * @param  integer $desc
56 56
      * @param  array   $columns
57 57
      * @return collection
58 58
      */
@@ -67,7 +67,7 @@  discard block
 block discarded – undo
67 67
      * @param  integer $perPage
68 68
      * @param  array   $relations
69 69
      * @param  string  $sortBy
70
-     * @param  boolean $desc
70
+     * @param  integer $desc
71 71
      * @param  array   $columns
72 72
      * @return collection
73 73
      */
@@ -84,7 +84,7 @@  discard block
 block discarded – undo
84 84
      * @param  integer $perPage
85 85
      * @param  array   $relations
86 86
      * @param  string  $sortBy
87
-     * @param  boolean $desc
87
+     * @param  integer $desc
88 88
      * @param  array   $columns
89 89
      * @return collection
90 90
      */
@@ -138,7 +138,7 @@  discard block
 block discarded – undo
138 138
      * @param  array   $conditions array of conditions
139 139
      * @param  array   $relations
140 140
      * @param  string  $sortBy
141
-     * @param  boolean $desc
141
+     * @param  integer $desc
142 142
      * @param  array   $columns
143 143
      * @return collection
144 144
      */
@@ -167,7 +167,7 @@  discard block
 block discarded – undo
167 167
      * @param  array   $conditions array of conditions
168 168
      * @param  integer $perPage
169 169
      * @param  string  $sortBy
170
-     * @param  boolean $desc
170
+     * @param  integer $desc
171 171
      * @param  array   $columns
172 172
      * @return collection
173 173
      */
Please login to merge, or discard this patch.