Completed
Push — master ( 2d22de...e2d103 )
by Sherif
02:14
created
src/Modules/Core/Utl/Media.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
      */
25 25
     public function uploadImageBas64($image, $dir)
26 26
     {
27
-        if (! strlen($image)) {
27
+        if ( ! strlen($image)) {
28 28
             return null;
29 29
         }
30 30
 
Please login to merge, or discard this patch.
src/Modules/Core/Utl/ApiConsumer.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -214,7 +214,7 @@
 block discarded – undo
214 214
         $server = [];
215 215
 
216 216
         foreach ($headers as $headerType => $headerValue) {
217
-            $headerType = 'HTTP_' . $headerType;
217
+            $headerType = 'HTTP_'.$headerType;
218 218
 
219 219
             $server[$headerType] = $headerValue;
220 220
         }
Please login to merge, or discard this patch.
src/Modules/Core/Routes/api.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -11,9 +11,9 @@
 block discarded – undo
11 11
 |
12 12
 */
13 13
 
14
-Route::group(['prefix' => 'core'], function () {
14
+Route::group(['prefix' => 'core'], function() {
15 15
 
16
-    Route::group(['prefix' => 'settings'], function () {
16
+    Route::group(['prefix' => 'settings'], function() {
17 17
         
18 18
         Route::get('list/{sortBy?}/{desc?}', 'SettingsController@index');
19 19
         Route::get('find/{id}', 'SettingsController@find');
Please login to merge, or discard this patch.
src/Modules/Core/AbstractRepositories/AbstractRepository.php 1 patch
Spacing   +15 added lines, -15 removed lines patch added patch discarded remove patch
@@ -65,7 +65,7 @@  discard block
 block discarded – undo
65 65
         /**
66 66
          * Construct the select conditions for the model.
67 67
          */
68
-        $model->where(function ($q) use ($query, $conditionColumns, $relations) {
68
+        $model->where(function($q) use ($query, $conditionColumns, $relations) {
69 69
 
70 70
             if (count($conditionColumns)) {
71 71
                 $column = 'LOWER('.array_shift($conditionColumns).')';
@@ -107,9 +107,9 @@  discard block
 block discarded – undo
107 107
                     /**
108 108
                      * Construct the relation condition.
109 109
                      */
110
-                    $q->orWhereHas($relation, function ($subModel) use ($query, $relation) {
110
+                    $q->orWhereHas($relation, function($subModel) use ($query, $relation) {
111 111
 
112
-                        $subModel->where(function ($q) use ($query, $relation) {
112
+                        $subModel->where(function($q) use ($query, $relation) {
113 113
 
114 114
                             /**
115 115
                              * Get columns of the relation.
@@ -197,14 +197,14 @@  discard block
 block discarded – undo
197 197
         $modelClass = $this->model;
198 198
         $relations  = [];
199 199
 
200
-        \DB::transaction(function () use (&$model, &$relations, $data, $modelClass) {
200
+        \DB::transaction(function() use (&$model, &$relations, $data, $modelClass) {
201 201
             /**
202 202
              * If the id is present in the data then select the model for updating,
203 203
              * else create new model.
204 204
              * @var array
205 205
              */
206 206
             $model = Arr::has($data, 'id') ? $modelClass->lockForUpdate()->find($data['id']) : new $modelClass;
207
-            if (! $model) {
207
+            if ( ! $model) {
208 208
                 \ErrorHandler::notFound(class_basename($modelClass).' with id : '.$data['id']);
209 209
             }
210 210
 
@@ -227,7 +227,7 @@  discard block
 block discarded – undo
227 227
                          * If the relation has no value then marke the relation data
228 228
                          * related to the model to be deleted.
229 229
                          */
230
-                        if (! $value || ! count($value)) {
230
+                        if ( ! $value || ! count($value)) {
231 231
                             $relations[$relation] = 'delete';
232 232
                         }
233 233
                     }
@@ -254,7 +254,7 @@  discard block
 block discarded – undo
254 254
                                 /**
255 255
                                  * If model doesn't exists.
256 256
                                  */
257
-                                if (! $relationModel) {
257
+                                if ( ! $relationModel) {
258 258
                                     \ErrorHandler::notFound(class_basename($relationBaseModel).' with id : '.$val['id']);
259 259
                                 }
260 260
 
@@ -285,7 +285,7 @@  discard block
 block discarded – undo
285 285
                                     /**
286 286
                                      * If model doesn't exists.
287 287
                                      */
288
-                                    if (! $relationModel) {
288
+                                    if ( ! $relationModel) {
289 289
                                         \ErrorHandler::notFound(class_basename($relationBaseModel).' with id : '.$value['id']);
290 290
                                     }
291 291
 
@@ -422,7 +422,7 @@  discard block
 block discarded – undo
422 422
             $model = $this->model->lockForUpdate()->find($value);
423 423
             $model ? $model->update($data) : 0;
424 424
         } else {
425
-            call_user_func_array("{$this->getModel()}::where", array($attribute, '=', $value))->lockForUpdate()->get()->each(function ($model) use ($data) {
425
+            call_user_func_array("{$this->getModel()}::where", array($attribute, '=', $value))->lockForUpdate()->get()->each(function($model) use ($data) {
426 426
                 $model->update($data);
427 427
             });
428 428
         }
@@ -439,17 +439,17 @@  discard block
 block discarded – undo
439 439
     public function delete($value, $attribute = 'id')
440 440
     {
441 441
         if ($attribute == 'id') {
442
-            \DB::transaction(function () use ($value, $attribute, &$result) {
442
+            \DB::transaction(function() use ($value, $attribute, &$result) {
443 443
                 $model = $this->model->lockForUpdate()->find($value);
444
-                if (! $model) {
444
+                if ( ! $model) {
445 445
                     \ErrorHandler::notFound(class_basename($this->model).' with id : '.$value);
446 446
                 }
447 447
                 
448 448
                 $model->delete();
449 449
             });
450 450
         } else {
451
-            \DB::transaction(function () use ($value, $attribute, &$result) {
452
-                call_user_func_array("{$this->getModel()}::where", array($attribute, '=', $value))->lockForUpdate()->get()->each(function ($model) {
451
+            \DB::transaction(function() use ($value, $attribute, &$result) {
452
+                call_user_func_array("{$this->getModel()}::where", array($attribute, '=', $value))->lockForUpdate()->get()->each(function($model) {
453 453
                     $model->delete();
454 454
                 });
455 455
             });
@@ -538,7 +538,7 @@  discard block
 block discarded – undo
538 538
     {
539 539
         $model = $this->model->onlyTrashed()->find($id);
540 540
 
541
-        if (! $model) {
541
+        if ( ! $model) {
542 542
             \ErrorHandler::notFound(class_basename($this->model).' with id : '.$id);
543 543
         }
544 544
 
@@ -621,7 +621,7 @@  discard block
 block discarded – undo
621 621
         $value      = $removeLast === false ? $value : substr($value, 0, $removeLast);
622 622
         $path       = explode('->', $value);
623 623
         $field      = array_shift($path);
624
-        $result     = sprintf('%s->\'$.%s\'', $field, collect($path)->map(function ($part) {
624
+        $result     = sprintf('%s->\'$.%s\'', $field, collect($path)->map(function($part) {
625 625
             return '"'.$part.'"';
626 626
         })->implode('.'));
627 627
         
Please login to merge, or discard this patch.
src/Modules/Core/AbstractRepositories/AbstractRepositoryContainer.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -20,7 +20,7 @@
 block discarded – undo
20 20
         foreach ($this->getRepoNameSpace() as $repoNameSpace) {
21 21
             $class = rtrim($repoNameSpace, '\\').'\\'.ucfirst(Str::singular($name)).'Repository';
22 22
             if (class_exists($class)) {
23
-                \App::singleton($class, function ($app) use ($class) {
23
+                \App::singleton($class, function($app) use ($class) {
24 24
 
25 25
                     return new \App\Modules\Core\Decorators\CachingDecorator(new $class, $app['cache.store']);
26 26
                 });
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
@@ -38,7 +38,7 @@
 block discarded – undo
38 38
             return $values;
39 39
         }
40 40
 
41
-        if (! $primaryLocale || ! is_object($values) || ! property_exists($values, $primaryLocale)) {
41
+        if ( ! $primaryLocale || ! is_object($values) || ! property_exists($values, $primaryLocale)) {
42 42
             return $values ? isset($values->$fallbackLocale) ? $values->$fallbackLocale : $values : '';
43 43
         }
44 44
 
Please login to merge, or discard this patch.
src/Modules/Core/Repositories/SettingRepository.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -22,7 +22,7 @@
 block discarded – undo
22 22
      */
23 23
     public function saveMany(array $data)
24 24
     {
25
-        \DB::transaction(function () use ($data) {
25
+        \DB::transaction(function() use ($data) {
26 26
             foreach ($data as $value) {
27 27
                 $this->save($value);
28 28
             }
Please login to merge, or discard this patch.
src/Modules/Core/Providers/ModuleServiceProvider.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -28,27 +28,27 @@
 block discarded – undo
28 28
     public function register()
29 29
     {
30 30
         //Bind Core Facade to the IoC Container
31
-        \App::bind('Core', function () {
31
+        \App::bind('Core', function() {
32 32
             return new \App\Modules\Core\Core;
33 33
         });
34 34
 
35 35
         //Bind ErrorHandler Facade to the IoC Container
36
-        \App::bind('ErrorHandler', function () {
36
+        \App::bind('ErrorHandler', function() {
37 37
             return new \App\Modules\Core\Utl\ErrorHandler;
38 38
         });
39 39
 
40 40
         //Bind CoreConfig Facade to the IoC Container
41
-        \App::bind('CoreConfig', function () {
41
+        \App::bind('CoreConfig', function() {
42 42
             return new \App\Modules\Core\Utl\CoreConfig;
43 43
         });
44 44
 
45 45
         //Bind Mpgs Facade to the IoC Container
46
-        \App::bind('Media', function () {
46
+        \App::bind('Media', function() {
47 47
             return new \App\Modules\Core\Utl\Media;
48 48
         });
49 49
 
50 50
         //Bind Mpgs Facade to the IoC Container
51
-        \App::bind('ApiConsumer', function () {
51
+        \App::bind('ApiConsumer', function() {
52 52
             $app = app();
53 53
             return new \App\Modules\Core\Utl\ApiConsumer($app, $app['request'], $app['router']);
54 54
         });
Please login to merge, or discard this patch.
files/Handler.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -63,7 +63,7 @@
 block discarded – undo
63 63
                 return \Response::json(['errors' => [$errors]], $exception->getStatusCode());
64 64
             } elseif ($exception instanceof \Illuminate\Validation\ValidationException) {
65 65
                 return \Response::json(['errors' => $exception->errors()], 422);
66
-            } elseif (! $exception instanceof \Symfony\Component\ErrorHandler\Error\FatalError) {
66
+            } elseif ( ! $exception instanceof \Symfony\Component\ErrorHandler\Error\FatalError) {
67 67
                 return parent::render($request, $exception);
68 68
             }
69 69
         }
Please login to merge, or discard this patch.