Skip to content

Commit

Permalink
[rector] Rector fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
lee-to authored and github-actions[bot] committed Feb 5, 2025
1 parent e07bed8 commit 2587ae7
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 5 deletions.
5 changes: 2 additions & 3 deletions src/Laravel/src/Fields/Relationships/BelongsToMany.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@
use MoonShine\Laravel\Traits\Fields\WithAsyncSearch;
use MoonShine\Laravel\Traits\Fields\WithRelatedLink;
use MoonShine\Laravel\Traits\Fields\WithRelatedValues;
use MoonShine\Support\DTOs\Select\Options;
use MoonShine\Support\Enums\Color;
use MoonShine\UI\Collections\ActionButtons;
use MoonShine\UI\Components\ActionButton;
Expand Down Expand Up @@ -388,7 +387,7 @@ protected function resolveOldValue(mixed $old): mixed
$oldPivot = $this->getCore()->getRequest()->getOld($this->getPivotName());

return collect($old)
->map(fn ($key) => clone $this->makeRelatedModel($key, relations: $oldPivot[$key] ?? []))
->map(fn ($key): ?Model => clone $this->makeRelatedModel($key, relations: $oldPivot[$key] ?? []))
->values();
}

Expand Down Expand Up @@ -581,7 +580,7 @@ public function prepareReactivityValue(mixed $value, mixed &$casted, array &$exc
{
$casted = $this->getRelatedModel();
$value = collect($value)
->map(fn ($key) => clone $this->makeRelatedModel($key))
->map(fn ($key): ?Model => clone $this->makeRelatedModel($key))
->values();

$casted?->setRelation($this->getRelationName(), $value);
Expand Down
1 change: 0 additions & 1 deletion src/Laravel/src/Fields/Relationships/HasMany.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@
use MoonShine\Contracts\UI\ComponentContract;
use MoonShine\Contracts\UI\FieldContract;
use MoonShine\Contracts\UI\FieldWithComponent;
use MoonShine\Contracts\UI\FormBuilderContract;
use MoonShine\Contracts\UI\HasFieldsContract;
use MoonShine\Contracts\UI\TableBuilderContract;
use MoonShine\Laravel\Buttons\HasManyButton;
Expand Down
2 changes: 1 addition & 1 deletion src/UI/src/Fields/Json.php
Original file line number Diff line number Diff line change
Expand Up @@ -451,7 +451,7 @@ public function getComponent(): ComponentContract
fn (TableBuilder $tableBuilder) => value($this->modifyTable, $tableBuilder, $this->isPreviewMode()),
);

if(!$this->isObjectMode() && !$this->isPreviewMode()) {
if(!$this->isPreviewMode()) {
$component = $component
->editable()
->reindex(prepared: true)
Expand Down

0 comments on commit 2587ae7

Please sign in to comment.