Skip to content

Commit c697b39

Browse files
committed
clean up from IDE changes
1 parent 3b80435 commit c697b39

File tree

1 file changed

+33
-34
lines changed

1 file changed

+33
-34
lines changed

src/Illuminate/Database/Eloquent/Model.php

+33-34
Original file line numberDiff line numberDiff line change
@@ -275,7 +275,7 @@ public function __construct(array $attributes = [])
275275
*/
276276
protected function bootIfNotBooted()
277277
{
278-
if (!isset(static::$booted[static::class])) {
278+
if (! isset(static::$booted[static::class])) {
279279
static::$booted[static::class] = true;
280280

281281
$this->fireModelEvent('booting', false);
@@ -324,7 +324,7 @@ protected static function bootTraits()
324324
foreach (class_uses_recursive($class) as $trait) {
325325
$method = 'boot'.class_basename($trait);
326326

327-
if (method_exists($class, $method) && !in_array($method, $booted)) {
327+
if (method_exists($class, $method) && ! in_array($method, $booted)) {
328328
forward_static_call([$class, $method]);
329329

330330
$booted[] = $method;
@@ -413,7 +413,7 @@ public static function isIgnoringTouch($class = null)
413413
{
414414
$class = $class ?: static::class;
415415

416-
if (!get_class_vars($class)['timestamps'] || !$class::UPDATED_AT) {
416+
if (! get_class_vars($class)['timestamps'] || ! $class::UPDATED_AT) {
417417
return true;
418418
}
419419

@@ -586,7 +586,7 @@ public function fill(array $attributes)
586586
*/
587587
public function forceFill(array $attributes)
588588
{
589-
return static::unguarded(fn() => $this->fill($attributes));
589+
return static::unguarded(fn () => $this->fill($attributes));
590590
}
591591

592592
/**
@@ -746,7 +746,7 @@ public function load($relations)
746746
*/
747747
public function loadMorph($relation, $relations)
748748
{
749-
if (!$this->{$relation}) {
749+
if (! $this->{$relation}) {
750750
return $this;
751751
}
752752

@@ -870,7 +870,7 @@ public function loadExists($relations)
870870
*/
871871
public function loadMorphAggregate($relation, $relations, $column, $function = null)
872872
{
873-
if (!$this->{$relation}) {
873+
if (! $this->{$relation}) {
874874
return $this;
875875
}
876876

@@ -982,7 +982,7 @@ protected function decrement($column, $amount = 1, array $extra = [])
982982
*/
983983
protected function incrementOrDecrement($column, $amount, $extra, $method)
984984
{
985-
if (!$this->exists) {
985+
if (! $this->exists) {
986986
return $this->newQueryWithoutRelationships()->{$method}($column, $amount, $extra);
987987
}
988988

@@ -1000,14 +1000,13 @@ protected function incrementOrDecrement($column, $amount, $extra, $method)
10001000
$amount = (clone $this)->setAttribute($column, $amount)->getAttributeFromArray($column);
10011001
}
10021002

1003-
return tap($this->setKeysForSaveQuery($this->newQueryWithoutScopes())->{$method}($column, $amount, $extra),
1004-
function () use ($column) {
1005-
$this->syncChanges();
1003+
return tap($this->setKeysForSaveQuery($this->newQueryWithoutScopes())->{$method}($column, $amount, $extra), function () use ($column) {
1004+
$this->syncChanges();
10061005

1007-
$this->fireModelEvent('updated', false);
1006+
$this->fireModelEvent('updated', false);
10081007

1009-
$this->syncOriginalAttribute($column);
1010-
});
1008+
$this->syncOriginalAttribute($column);
1009+
});
10111010
}
10121011

10131012
/**
@@ -1019,7 +1018,7 @@ function () use ($column) {
10191018
*/
10201019
public function update(array $attributes = [], array $options = [])
10211020
{
1022-
if (!$this->exists) {
1021+
if (! $this->exists) {
10231022
return false;
10241023
}
10251024

@@ -1037,7 +1036,7 @@ public function update(array $attributes = [], array $options = [])
10371036
*/
10381037
public function updateOrFail(array $attributes = [], array $options = [])
10391038
{
1040-
if (!$this->exists) {
1039+
if (! $this->exists) {
10411040
return false;
10421041
}
10431042

@@ -1053,7 +1052,7 @@ public function updateOrFail(array $attributes = [], array $options = [])
10531052
*/
10541053
public function updateQuietly(array $attributes = [], array $options = [])
10551054
{
1056-
if (!$this->exists) {
1055+
if (! $this->exists) {
10571056
return false;
10581057
}
10591058

@@ -1098,7 +1097,7 @@ protected function decrementQuietly($column, $amount = 1, array $extra = [])
10981097
public function push()
10991098
{
11001099
return $this->withoutRecursion(function () {
1101-
if (!$this->save()) {
1100+
if (! $this->save()) {
11021101
return false;
11031102
}
11041103

@@ -1110,7 +1109,7 @@ public function push()
11101109
? $models->all() : [$models];
11111110

11121111
foreach (array_filter($models) as $model) {
1113-
if (!$model->push()) {
1112+
if (! $model->push()) {
11141113
return false;
11151114
}
11161115
}
@@ -1127,7 +1126,7 @@ public function push()
11271126
*/
11281127
public function pushQuietly()
11291128
{
1130-
return static::withoutEvents(fn() => $this->push());
1129+
return static::withoutEvents(fn () => $this->push());
11311130
}
11321131

11331132
/**
@@ -1138,7 +1137,7 @@ public function pushQuietly()
11381137
*/
11391138
public function saveQuietly(array $options = [])
11401139
{
1141-
return static::withoutEvents(fn() => $this->save($options));
1140+
return static::withoutEvents(fn () => $this->save($options));
11421141
}
11431142

11441143
/**
@@ -1174,7 +1173,7 @@ public function save(array $options = [])
11741173
else {
11751174
$saved = $this->performInsert($query);
11761175

1177-
if (!$this->getConnectionName() &&
1176+
if (! $this->getConnectionName() &&
11781177
$connection = $query->getConnection()) {
11791178
$this->setConnection($connection->getName());
11801179
}
@@ -1200,7 +1199,7 @@ public function save(array $options = [])
12001199
*/
12011200
public function saveOrFail(array $options = [])
12021201
{
1203-
return $this->getConnection()->transaction(fn() => $this->save($options));
1202+
return $this->getConnection()->transaction(fn () => $this->save($options));
12041203
}
12051204

12061205
/**
@@ -1429,7 +1428,7 @@ public function delete()
14291428
// If the model doesn't exist, there is nothing to delete so we'll just return
14301429
// immediately and not do anything else. Otherwise, we will continue with a
14311430
// deletion process on the model, firing the proper events, and so forth.
1432-
if (!$this->exists) {
1431+
if (! $this->exists) {
14331432
return;
14341433
}
14351434

@@ -1459,7 +1458,7 @@ public function delete()
14591458
*/
14601459
public function deleteQuietly()
14611460
{
1462-
return static::withoutEvents(fn() => $this->delete());
1461+
return static::withoutEvents(fn () => $this->delete());
14631462
}
14641463

14651464
/**
@@ -1471,11 +1470,11 @@ public function deleteQuietly()
14711470
*/
14721471
public function deleteOrFail()
14731472
{
1474-
if (!$this->exists) {
1473+
if (! $this->exists) {
14751474
return false;
14761475
}
14771476

1478-
return $this->getConnection()->transaction(fn() => $this->delete());
1477+
return $this->getConnection()->transaction(fn () => $this->delete());
14791478
}
14801479

14811480
/**
@@ -1674,8 +1673,8 @@ public function callNamedScope($scope, array $parameters = [])
16741673
public function toArray()
16751674
{
16761675
return $this->withoutRecursion(
1677-
fn() => array_merge($this->attributesToArray(), $this->relationsToArray()),
1678-
fn() => $this->attributesToArray(),
1676+
fn () => array_merge($this->attributesToArray(), $this->relationsToArray()),
1677+
fn () => $this->attributesToArray(),
16791678
);
16801679
}
16811680

@@ -1716,7 +1715,7 @@ public function jsonSerialize(): mixed
17161715
*/
17171716
public function fresh($with = [])
17181717
{
1719-
if (!$this->exists) {
1718+
if (! $this->exists) {
17201719
return;
17211720
}
17221721

@@ -1733,7 +1732,7 @@ public function fresh($with = [])
17331732
*/
17341733
public function refresh()
17351734
{
1736-
if (!$this->exists) {
1735+
if (! $this->exists) {
17371736
return $this;
17381737
}
17391738

@@ -1791,7 +1790,7 @@ public function replicate(?array $except = null)
17911790
*/
17921791
public function replicateQuietly(?array $except = null)
17931792
{
1794-
return static::withoutEvents(fn() => $this->replicate($except));
1793+
return static::withoutEvents(fn () => $this->replicate($except));
17951794
}
17961795

17971796
/**
@@ -1802,7 +1801,7 @@ public function replicateQuietly(?array $except = null)
18021801
*/
18031802
public function is($model)
18041803
{
1805-
return !is_null($model) &&
1804+
return ! is_null($model) &&
18061805
$this->getKey() === $model->getKey() &&
18071806
$this->getTable() === $model->getTable() &&
18081807
$this->getConnectionName() === $model->getConnectionName();
@@ -1816,7 +1815,7 @@ public function is($model)
18161815
*/
18171816
public function isNot($model)
18181817
{
1819-
return !$this->is($model);
1818+
return ! $this->is($model);
18201819
}
18211820

18221821
/**
@@ -2027,7 +2026,7 @@ public function getQueueableRelations()
20272026
$relations = [];
20282027

20292028
foreach ($this->getRelations() as $key => $relation) {
2030-
if (!method_exists($this, $key)) {
2029+
if (! method_exists($this, $key)) {
20312030
continue;
20322031
}
20332032

0 commit comments

Comments
 (0)