Completed
Branch master (436403)
by Sherif
32s
created
src/Modules/Core/BaseClasses/BaseRepository.php 1 patch
Spacing   +16 added lines, -16 removed lines patch added patch discarded remove patch
@@ -248,7 +248,7 @@  discard block
 block discarded – undo
248 248
         $model = $this->model->onlyTrashed()->find($id);
249 249
 
250 250
         if (!$model) {
251
-            Errors::notFound(class_basename($this->model) . ' with id : ' . $id);
251
+            Errors::notFound(class_basename($this->model).' with id : '.$id);
252 252
         }
253 253
 
254 254
         $model->restore();
@@ -268,7 +268,7 @@  discard block
 block discarded – undo
268 268
         $model = Arr::has($data, 'id') ? $modelClass->lockForUpdate()->find($data['id']) : new $modelClass;
269 269
 
270 270
         if (!$model) {
271
-            Errors::notFound(class_basename($modelClass) . ' with id : ' . $data['id']);
271
+            Errors::notFound(class_basename($modelClass).' with id : '.$data['id']);
272 272
         }
273 273
 
274 274
         foreach ($data as $key => $value) {
@@ -331,7 +331,7 @@  discard block
 block discarded – undo
331 331
         }
332 332
 
333 333
         if (!$relatedModel) {
334
-            Errors::notFound(class_basename($relationBaseModel) . ' with id : ' . $relatedModelData['id']);
334
+            Errors::notFound(class_basename($relationBaseModel).' with id : '.$relatedModelData['id']);
335 335
         }
336 336
 
337 337
         if (is_array($relatedModelData)) {
@@ -401,11 +401,11 @@  discard block
 block discarded – undo
401 401
 
402 402
             if ($key == 'and') {
403 403
                 $conditions       = $this->constructConditions($value, $model);
404
-                $conditionString .= str_replace('{op}', 'and', $conditions['conditionString']) . ' {op} ';
404
+                $conditionString .= str_replace('{op}', 'and', $conditions['conditionString']).' {op} ';
405 405
                 $conditionValues  = array_merge($conditionValues, $conditions['conditionValues']);
406 406
             } elseif ($key == 'or') {
407 407
                 $conditions       = $this->constructConditions($value, $model);
408
-                $conditionString .= str_replace('{op}', 'or', $conditions['conditionString']) . ' {op} ';
408
+                $conditionString .= str_replace('{op}', 'or', $conditions['conditionString']).' {op} ';
409 409
                 $conditionValues  = array_merge($conditionValues, $conditions['conditionValues']);
410 410
             } else {
411 411
                 if (is_array($value)) {
@@ -421,38 +421,38 @@  discard block
 block discarded – undo
421 421
                 }
422 422
 
423 423
                 if (strtolower($operator) == 'between') {
424
-                    $conditionString  .= $key . ' >= ? and ';
424
+                    $conditionString  .= $key.' >= ? and ';
425 425
                     $conditionValues[] = $value1;
426 426
 
427
-                    $conditionString  .= $key . ' <= ? {op} ';
427
+                    $conditionString  .= $key.' <= ? {op} ';
428 428
                     $conditionValues[] = $value2;
429 429
                 } elseif (strtolower($operator) == 'in') {
430 430
                     $conditionValues  = array_merge($conditionValues, $value);
431 431
                     $inBindingsString = rtrim(str_repeat('?,', count($value)), ',');
432
-                    $conditionString .= $key . ' in (' . rtrim($inBindingsString, ',') . ') {op} ';
432
+                    $conditionString .= $key.' in ('.rtrim($inBindingsString, ',').') {op} ';
433 433
                 } elseif (strtolower($operator) == 'null') {
434
-                    $conditionString .= $key . ' is null {op} ';
434
+                    $conditionString .= $key.' is null {op} ';
435 435
                 } elseif (strtolower($operator) == 'not null') {
436
-                    $conditionString .= $key . ' is not null {op} ';
436
+                    $conditionString .= $key.' is not null {op} ';
437 437
                 } elseif (strtolower($operator) == 'has') {
438 438
                     $sql              = $model->withTrashed()->withoutGlobalScopes()->has($key)->toSql();
439 439
                     $bindings         = $model->withTrashed()->withoutGlobalScopes()->has($key)->getBindings();
440 440
                     if ($value) {
441 441
                         $conditions       = $this->constructConditions($value, $model->$key()->getRelated());
442
-                        $conditionString .= substr(substr($sql, strpos($sql, 'exists')), 0, -1) . ' and ' . $conditions['conditionString'] . ') {op} ';
442
+                        $conditionString .= substr(substr($sql, strpos($sql, 'exists')), 0, -1).' and '.$conditions['conditionString'].') {op} ';
443 443
                         $conditionValues  = array_merge($conditionValues, $bindings);
444 444
                         $conditionValues  = array_merge($conditionValues, $conditions['conditionValues']);
445 445
                     } else {
446
-                        $conditionString .= substr(substr($sql, strpos($sql, 'exists')), 0, -1) . ') {op} ';
446
+                        $conditionString .= substr(substr($sql, strpos($sql, 'exists')), 0, -1).') {op} ';
447 447
                         $conditionValues  = array_merge($conditionValues, $bindings);
448 448
                     }
449 449
                 } else {
450
-                    $conditionString  .= $key . ' ' . $operator . ' ? {op} ';
450
+                    $conditionString  .= $key.' '.$operator.' ? {op} ';
451 451
                     $conditionValues[] = $value;
452 452
                 }
453 453
             }
454 454
         }
455
-        $conditionString = '(' . rtrim($conditionString, '{op} ') . ')';
455
+        $conditionString = '('.rtrim($conditionString, '{op} ').')';
456 456
         return ['conditionString' => $conditionString, 'conditionValues' => $conditionValues];
457 457
     }
458 458
 
@@ -469,9 +469,9 @@  discard block
 block discarded – undo
469 469
         $path       = explode('->', $value);
470 470
         $field      = array_shift($path);
471 471
         $result     = sprintf('%s->\'$.%s\'', $field, collect($path)->map(function ($part) {
472
-            return '"' . $part . '"';
472
+            return '"'.$part.'"';
473 473
         })->implode('.'));
474 474
 
475
-        return $removeLast === false ? $result : $result . ')';
475
+        return $removeLast === false ? $result : $result.')';
476 476
     }
477 477
 }
Please login to merge, or discard this patch.
src/Modules/Users/Proxy/LoginProxy.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -51,7 +51,7 @@
 block discarded – undo
51 51
 
52 52
         $response = \ApiConsumer::post('/oauth/token', $data);
53 53
 
54
-        if (! $response->isSuccessful()) {
54
+        if (!$response->isSuccessful()) {
55 55
             if ($grantType == 'refresh_token') {
56 56
                 \Errors::invalidRefreshToken();
57 57
             }
Please login to merge, or discard this patch.
src/Modules/Users/Repositories/UserRepository.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -26,7 +26,7 @@  discard block
 block discarded – undo
26 26
      */
27 27
     public function detachRoles(mixed $user): bool
28 28
     {
29
-        $user = ! filter_var($user, FILTER_VALIDATE_INT) ? $user : $this->find($user);
29
+        $user = !filter_var($user, FILTER_VALIDATE_INT) ? $user : $this->find($user);
30 30
         $user->roles()->detach();
31 31
 
32 32
         return true;
@@ -41,7 +41,7 @@  discard block
 block discarded – undo
41 41
      */
42 42
     public function attachRoles(mixed $user, array $roleIds): bool
43 43
     {
44
-        $user = ! filter_var($user, FILTER_VALIDATE_INT) ? $user : $this->find($user);
44
+        $user = !filter_var($user, FILTER_VALIDATE_INT) ? $user : $this->find($user);
45 45
         $user->roles()->attach($roleIds);
46 46
 
47 47
         return true;
@@ -56,7 +56,7 @@  discard block
 block discarded – undo
56 56
      */
57 57
     public function countRoles(mixed $user, array $roles): int
58 58
     {
59
-        $user = ! filter_var($user, FILTER_VALIDATE_INT) ? $user : $this->find($user);
59
+        $user = !filter_var($user, FILTER_VALIDATE_INT) ? $user : $this->find($user);
60 60
         return $user->roles()->whereIn('name', $roles)->count();
61 61
     }
62 62
 }
Please login to merge, or discard this patch.
src/Modules/Reporting/Http/Resources/Report.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -15,7 +15,7 @@
 block discarded – undo
15 15
      */
16 16
     public function toArray($request)
17 17
     {
18
-        if (! $this->resource) {
18
+        if (!$this->resource) {
19 19
             return [];
20 20
         }
21 21
 
Please login to merge, or discard this patch.
src/Modules/OauthClients/Http/Resources/OauthClient.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -15,7 +15,7 @@
 block discarded – undo
15 15
      */
16 16
     public function toArray($request)
17 17
     {
18
-        if (! $this->resource) {
18
+        if (!$this->resource) {
19 19
             return [];
20 20
         }
21 21
 
Please login to merge, or discard this patch.
src/Modules/Notifications/Http/Resources/Notification.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -15,7 +15,7 @@
 block discarded – undo
15 15
      */
16 16
     public function toArray($request)
17 17
     {
18
-        if (! $this->resource) {
18
+        if (!$this->resource) {
19 19
             return [];
20 20
         }
21 21
 
Please login to merge, or discard this patch.
src/Modules/Users/Http/Resources/AclUser.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -15,7 +15,7 @@
 block discarded – undo
15 15
      */
16 16
     public function toArray($request)
17 17
     {
18
-        if (! $this->resource) {
18
+        if (!$this->resource) {
19 19
             return [];
20 20
         }
21 21
 
Please login to merge, or discard this patch.
src/Modules/Core/Http/Resources/Setting.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -15,7 +15,7 @@
 block discarded – undo
15 15
      */
16 16
     public function toArray($request)
17 17
     {
18
-        if (! $this->resource) {
18
+        if (!$this->resource) {
19 19
             return [];
20 20
         }
21 21
 
Please login to merge, or discard this patch.
Modules/Core/Console/Commands/Stubs/Module/Http/Resources/DummyResource.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -15,7 +15,7 @@
 block discarded – undo
15 15
      */
16 16
     public function toArray($request)
17 17
     {
18
-        if (! $this->resource) {
18
+        if (!$this->resource) {
19 19
             return [];
20 20
         }
21 21
 
Please login to merge, or discard this patch.