Skip to content

Commit f081fea

Browse files
committed
Apply fixes from StyleCI
1 parent 5bd422b commit f081fea

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

58 files changed

+274
-278
lines changed

src/Actions/ActionEvent.php

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

6969
return $this->morphTo('target', 'target_type', 'target_id')
70-
->constrain(
71-
collect(Nova::$resources)
72-
->filter(function ($resource) {
73-
return $resource::softDeletes();
74-
})->mapWithKeys(function ($resource) use ($queryWithTrashed) {
75-
return [$resource::$model => $queryWithTrashed];
76-
})->all()
77-
)->when(true, function ($query) use ($queryWithTrashed) {
70+
->constrain(
71+
collect(Nova::$resources)
72+
->filter(function ($resource) {
73+
return $resource::softDeletes();
74+
})->mapWithKeys(function ($resource) use ($queryWithTrashed) {
75+
return [$resource::$model => $queryWithTrashed];
76+
})->all()
77+
)->when(true, function ($query) use ($queryWithTrashed) {
7878
return $query->hasMacro('withTrashed') ? $queryWithTrashed($query) : $query;
7979
});
8080
}
@@ -355,9 +355,9 @@ public static function prune(Collection $models, int $limit = 25): void
355355
->whereNotIn('id', function ($query) use ($model, $limit) {
356356
$query->select('id')->fromSub(
357357
static::select('id')->orderBy('id', 'desc')
358-
->where('actionable_id', $model['actionable_id'])
359-
->where('actionable_type', $model['actionable_type'])
360-
->limit($limit)->toBase(),
358+
->where('actionable_id', $model['actionable_id'])
359+
->where('actionable_type', $model['actionable_type'])
360+
->limit($limit)->toBase(),
361361
'action_events_temp'
362362
);
363363
})->delete();
@@ -370,7 +370,7 @@ public static function prune(Collection $models, int $limit = 25): void
370370
public static function markBatchAsRunning(string $batchId): int
371371
{
372372
return static::where('batch_id', $batchId)
373-
->whereNotIn('status', ['finished', 'failed'])->update([
373+
->whereNotIn('status', ['finished', 'failed'])->update([
374374
'status' => 'running',
375375
]);
376376
}
@@ -381,7 +381,7 @@ public static function markBatchAsRunning(string $batchId): int
381381
public static function markBatchAsFinished(string $batchId): int
382382
{
383383
return static::where('batch_id', $batchId)
384-
->whereNotIn('status', ['finished', 'failed'])->update([
384+
->whereNotIn('status', ['finished', 'failed'])->update([
385385
'status' => 'finished',
386386
]);
387387
}
@@ -404,7 +404,7 @@ public static function markAsFinished(string $batchId, $model): int
404404
public static function markBatchAsFailed(string $batchId, Throwable|string|null $e = null): int
405405
{
406406
return static::where('batch_id', $batchId)
407-
->whereNotIn('status', ['finished', 'failed'])->update([
407+
->whereNotIn('status', ['finished', 'failed'])->update([
408408
'status' => 'failed',
409409
'exception' => $e ? (string) $e : '',
410410
]);
@@ -428,9 +428,9 @@ public static function markAsFailed(string $batchId, $model, Throwable|string|nu
428428
public static function updateStatus(string $batchId, $model, string $status, Throwable|string|null $e = null): int
429429
{
430430
return static::where('batch_id', $batchId)
431-
->where('model_type', $model->getMorphClass())
432-
->where('model_id', $model->getKey())
433-
->update(['status' => $status, 'exception' => (string) $e]);
431+
->where('model_type', $model->getMorphClass())
432+
->where('model_id', $model->getKey())
433+
->update(['status' => $status, 'exception' => (string) $e]);
434434
}
435435

436436
/**
@@ -447,8 +447,8 @@ public function getTable(): string
447447
protected static function hydrateChangesPayload(array $attributes): array
448448
{
449449
return collect($attributes)
450-
->transform(function ($value) {
451-
return Util::hydrate($value);
452-
})->all();
450+
->transform(function ($value) {
451+
return Util::hydrate($value);
452+
})->all();
453453
}
454454
}

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/AssociatableRelation.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -155,8 +155,8 @@ public function buildAssociatableQuery(NovaRequest $request, string $resourceCla
155155
$query = app()->make(QueryBuilder::class, [$resourceClass]);
156156

157157
return $query->search($request, $model->newQuery(), null, [], [], TrashedStatus::fromBoolean($withTrashed))
158-
->tap(function (Builder $query) use ($request, $resourceClass, $model) {
159-
$this->applyAssociatableCallbacks($query, $request, $resourceClass, $model);
160-
});
158+
->tap(function (Builder $query) use ($request, $resourceClass, $model) {
159+
$this->applyAssociatableCallbacks($query, $request, $resourceClass, $model);
160+
});
161161
}
162162
}

src/Fields/Attachments/DeleteAttachments.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -39,11 +39,11 @@ public function __construct($field)
3939
public function __invoke(Request $request, $model): array
4040
{
4141
static::$model::query()
42-
->where('attachable_type', $model->getMorphClass())
43-
->where('attachable_id', $model->getKey())
44-
->get()
45-
->each
46-
->purge();
42+
->where('attachable_type', $model->getMorphClass())
43+
->where('attachable_id', $model->getKey())
44+
->get()
45+
->each
46+
->purge();
4747

4848
return [$this->field->attribute => ''];
4949
}

src/Fields/Attachments/DetachAttachment.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,8 @@ class DetachAttachment
1919
public function __invoke(NovaRequest $request): void
2020
{
2121
static::$model::where('url', $request->attachmentUrl)
22-
->get()
23-
->each
24-
->purge();
22+
->get()
23+
->each
24+
->purge();
2525
}
2626
}

src/Fields/Attachments/DiscardPendingAttachments.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,8 @@ class DiscardPendingAttachments
1919
public function __invoke(Request $request): void
2020
{
2121
static::$model::where('draft_id', $request->draftId)
22-
->get()
23-
->each
24-
->purge();
22+
->get()
23+
->each
24+
->purge();
2525
}
2626
}

src/Fields/BelongsToMany.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -314,9 +314,9 @@ public function serializeForFilter(): array
314314
public function asPanel(): Panel
315315
{
316316
return Panel::make($this->name, [$this])
317-
->withMeta([
318-
'prefixComponent' => true,
319-
])->withComponent('relationship-panel');
317+
->withMeta([
318+
'prefixComponent' => true,
319+
])->withComponent('relationship-panel');
320320
}
321321

322322
/**

0 commit comments

Comments
 (0)