Skip to content

Commit 8da4d45

Browse files
committed
Apply fixes from StyleCI
1 parent 8f2a18c commit 8da4d45

30 files changed

+98
-102
lines changed

src/Actions/ActionEvent.php

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

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

7878
/**
@@ -346,9 +346,9 @@ public static function prune(Collection $models, int $limit = 25): void
346346
->whereNotIn('id', static function ($query) use ($model, $limit) {
347347
$query->select('id')->fromSub(
348348
static::select('id')->orderBy('id', 'desc')
349-
->where('actionable_id', $model['actionable_id'])
350-
->where('actionable_type', $model['actionable_type'])
351-
->limit($limit)->toBase(),
349+
->where('actionable_id', $model['actionable_id'])
350+
->where('actionable_type', $model['actionable_type'])
351+
->limit($limit)->toBase(),
352352
'action_events_temp'
353353
);
354354
})->delete();
@@ -361,7 +361,7 @@ public static function prune(Collection $models, int $limit = 25): void
361361
public static function markBatchAsRunning(string $batchId): int
362362
{
363363
return static::where('batch_id', $batchId)
364-
->whereNotIn('status', ['finished', 'failed'])->update([
364+
->whereNotIn('status', ['finished', 'failed'])->update([
365365
'status' => 'running',
366366
]);
367367
}
@@ -372,7 +372,7 @@ public static function markBatchAsRunning(string $batchId): int
372372
public static function markBatchAsFinished(string $batchId): int
373373
{
374374
return static::where('batch_id', $batchId)
375-
->whereNotIn('status', ['finished', 'failed'])->update([
375+
->whereNotIn('status', ['finished', 'failed'])->update([
376376
'status' => 'finished',
377377
]);
378378
}
@@ -395,7 +395,7 @@ public static function markAsFinished(string $batchId, $model): int
395395
public static function markBatchAsFailed(string $batchId, Throwable|string|null $e = null): int
396396
{
397397
return static::where('batch_id', $batchId)
398-
->whereNotIn('status', ['finished', 'failed'])->update([
398+
->whereNotIn('status', ['finished', 'failed'])->update([
399399
'status' => 'failed',
400400
'exception' => $e ? (string) $e : '',
401401
]);
@@ -419,9 +419,9 @@ public static function markAsFailed(string $batchId, $model, Throwable|string|nu
419419
public static function updateStatus(string $batchId, $model, string $status, Throwable|string|null $e = null): int
420420
{
421421
return static::where('batch_id', $batchId)
422-
->where('model_type', $model->getMorphClass())
423-
->where('model_id', $model->getKey())
424-
->update(['status' => $status, 'exception' => (string) $e]);
422+
->where('model_type', $model->getMorphClass())
423+
->where('model_id', $model->getKey())
424+
->update(['status' => $status, 'exception' => (string) $e]);
425425
}
426426

427427
/**

src/Actions/CallQueuedAction.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ public function handle()
5858
}
5959

6060
return $action->withActionBatchId($this->actionBatchId)
61-
->{$this->method}($this->fields, $this->models);
61+
->{$this->method}($this->fields, $this->models);
6262
});
6363
}
6464

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
@@ -120,16 +120,16 @@ public function __construct($name, ?string $attribute = null, ?string $resource
120120

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

126126
return optional($parent->{$this->attribute})->exists === true;
127127
}
128128

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

135135
/**

src/Fields/ID.php

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

src/Fields/MorphTo.php

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

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

src/Fields/MorphToMany.php

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

238238
/**

0 commit comments

Comments
 (0)