Skip to content

Commit daa6b9a

Browse files
committed
Apply fixes from StyleCI
1 parent 2525fe1 commit daa6b9a

30 files changed

+104
-108
lines changed

src/Actions/ActionEvent.php

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -69,12 +69,12 @@ public function target()
6969
};
7070

7171
return $this->morphTo('target', 'target_type', 'target_id')
72-
->constrain(
73-
collect(Nova::$resources)
74-
->filter(static fn ($resource) => $resource::softDeletes())
75-
->mapWithKeys(static fn ($resource) => [$resource::$model => $queryWithTrashed])
76-
->all()
77-
)->when(true, static fn ($query) => $query->hasMacro('withTrashed') ? $queryWithTrashed($query) : $query);
72+
->constrain(
73+
collect(Nova::$resources)
74+
->filter(static fn ($resource) => $resource::softDeletes())
75+
->mapWithKeys(static fn ($resource) => [$resource::$model => $queryWithTrashed])
76+
->all()
77+
)->when(true, static fn ($query) => $query->hasMacro('withTrashed') ? $queryWithTrashed($query) : $query);
7878
}
7979

8080
/**
@@ -348,9 +348,9 @@ public static function prune(Collection $models, int $limit = 25): void
348348
->whereNotIn('id', static function ($query) use ($model, $limit) {
349349
$query->select('id')->fromSub(
350350
static::select('id')->orderBy('id', 'desc')
351-
->where('actionable_id', $model['actionable_id'])
352-
->where('actionable_type', $model['actionable_type'])
353-
->limit($limit)->toBase(),
351+
->where('actionable_id', $model['actionable_id'])
352+
->where('actionable_type', $model['actionable_type'])
353+
->limit($limit)->toBase(),
354354
'action_events_temp'
355355
);
356356
})->delete();
@@ -363,7 +363,7 @@ public static function prune(Collection $models, int $limit = 25): void
363363
public static function markBatchAsRunning(string $batchId): int
364364
{
365365
return static::where('batch_id', $batchId)
366-
->whereNotIn('status', ['finished', 'failed'])->update([
366+
->whereNotIn('status', ['finished', 'failed'])->update([
367367
'status' => 'running',
368368
]);
369369
}
@@ -374,7 +374,7 @@ public static function markBatchAsRunning(string $batchId): int
374374
public static function markBatchAsFinished(string $batchId): int
375375
{
376376
return static::where('batch_id', $batchId)
377-
->whereNotIn('status', ['finished', 'failed'])->update([
377+
->whereNotIn('status', ['finished', 'failed'])->update([
378378
'status' => 'finished',
379379
]);
380380
}
@@ -397,7 +397,7 @@ public static function markAsFinished(string $batchId, $model): int
397397
public static function markBatchAsFailed(string $batchId, Throwable|string|null $e = null): int
398398
{
399399
return static::where('batch_id', $batchId)
400-
->whereNotIn('status', ['finished', 'failed'])->update([
400+
->whereNotIn('status', ['finished', 'failed'])->update([
401401
'status' => 'failed',
402402
'exception' => $e ? (string) $e : '',
403403
]);
@@ -421,9 +421,9 @@ public static function markAsFailed(string $batchId, $model, Throwable|string|nu
421421
public static function updateStatus(string $batchId, $model, string $status, Throwable|string|null $e = null): int
422422
{
423423
return static::where('batch_id', $batchId)
424-
->where('model_type', $model->getMorphClass())
425-
->where('model_id', $model->getKey())
426-
->update(['status' => $status, 'exception' => (string) $e]);
424+
->where('model_type', $model->getMorphClass())
425+
->where('model_id', $model->getKey())
426+
->update(['status' => $status, 'exception' => (string) $e]);
427427
}
428428

429429
/**

src/Actions/CallQueuedAction.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ public function handle()
5656
}
5757

5858
return $action->withActionBatchId($this->actionBatchId)
59-
->{$this->method}($this->fields, $this->models);
59+
->{$this->method}($this->fields, $this->models);
6060
});
6161
}
6262

src/Auth/Actions/LoginViewResponse.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ public function toResponse($request)
1919
$initialYear = config('app.initialyear', date('Y'));
2020
$currentYear = date('Y');
2121
$years = $initialYear <= $currentYear ? range($initialYear, $currentYear) : [];
22+
2223
return Inertia::render('Nova.Login', [
2324
'username' => Nova::fortify()->username,
2425
'email' => Nova::fortify()->email,

src/Auth/Actions/LogoutResponse.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44

55
use Illuminate\Http\JsonResponse;
66
use Laravel\Fortify\Contracts\LogoutResponse as Responsable;
7-
use Laravel\Nova\Nova;
87

98
class LogoutResponse implements Responsable
109
{

src/Concerns/HandlesRoutes.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,8 +46,8 @@ public static function url(?string $url = null): string
4646
public static function router(?array $middleware = null, ?string $prefix = null): RouteRegistrar
4747
{
4848
return Route::domain(config('nova.domain', null))
49-
->prefix(static::url($prefix))
50-
->middleware($middleware ?? config('nova.middleware', []));
49+
->prefix(static::url($prefix))
50+
->middleware($middleware ?? config('nova.middleware', []));
5151
}
5252

5353
/**

src/Fields/DetachesPivotModels.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -26,11 +26,11 @@ protected function detachmentCallback(): callable
2626
$pivotFields = $resource->resolvePivotFields($request, $request->resource);
2727

2828
$pivotFields->whereInstanceOf(Deletable::class)
29-
->filter->isPrunable()
30-
->each(static function ($field) use ($request, $pivot) {
31-
/** @var \Laravel\Nova\Fields\Field&\Laravel\Nova\Contracts\Deletable $field */
32-
DeleteField::forRequest($request, $field, $pivot)->save();
33-
});
29+
->filter->isPrunable()
30+
->each(static function ($field) use ($request, $pivot) {
31+
/** @var \Laravel\Nova\Fields\Field&\Laravel\Nova\Contracts\Deletable $field */
32+
DeleteField::forRequest($request, $field, $pivot)->save();
33+
});
3434

3535
$pivot->delete();
3636
}

src/Fields/HasOne.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -121,16 +121,16 @@ public function __construct($name, ?string $attribute = null, ?string $resource
121121

122122
if ($this->ofManyRelationship === false && $request->viaRelationship === $this->attribute && $request->viaResourceId) {
123123
$parent = $parentResource::newModel()
124-
->with($this->attribute)
125-
->find($request->viaResourceId);
124+
->with($this->attribute)
125+
->find($request->viaResourceId);
126126

127127
return model_exists($parent->{$this->attribute});
128128
}
129129

130130
return false;
131131
})->showOnCreating(static fn ($request) => ! \in_array($request->relationshipType, ['hasOne', 'morphOne']))
132-
->showOnUpdating(static fn ($request) => ! \in_array($request->relationshipType, ['hasOne', 'morphOne']))
133-
->nullable();
132+
->showOnUpdating(static fn ($request) => ! \in_array($request->relationshipType, ['hasOne', 'morphOne']))
133+
->nullable();
134134
}
135135

136136
/**

src/Fields/ID.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -66,8 +66,8 @@ public static function forResource(Resource $resource): ?static
6666
/** @phpstan-ignore argument.templateType */
6767
$field = transform(
6868
$resource->availableFieldsOnIndexOrDetail(app(NovaRequest::class))
69-
->whereInstanceOf(self::class)
70-
->first(),
69+
->whereInstanceOf(self::class)
70+
->first(),
7171
static fn ($field) => tap($field)->resolve($model),
7272
static fn () => model_exists($model) ? static::forModel($model) : null,
7373
);

src/Fields/MorphTo.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -542,9 +542,9 @@ protected function filterableAttribute(NovaRequest $request)
542542
protected function defaultFilterableCallback()
543543
{
544544
$morphToTypes = collect($this->morphToTypes)
545-
->pluck('type')
546-
->mapWithKeys(static fn ($type) => [$type => $type::newModel()->getMorphClass()])
547-
->all();
545+
->pluck('type')
546+
->mapWithKeys(static fn ($type) => [$type => $type::newModel()->getMorphClass()])
547+
->all();
548548

549549
return function (NovaRequest $request, $query, $value, $attribute) use ($morphToTypes) {
550550
$query->whereHasMorph(

src/Fields/MorphToMany.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -229,9 +229,9 @@ public function singularLabel(Stringable|string $singularLabel)
229229
public function asPanel(): Panel
230230
{
231231
return Panel::make($this->name, [$this])
232-
->withMeta([
233-
'prefixComponent' => true,
234-
])->withComponent('relationship-panel');
232+
->withMeta([
233+
'prefixComponent' => true,
234+
])->withComponent('relationship-panel');
235235
}
236236

237237
/**

0 commit comments

Comments
 (0)