Skip to content

Commit

Permalink
Fix options according to changes in Statamic (#68)
Browse files Browse the repository at this point in the history
  • Loading branch information
aerni authored Aug 19, 2024
1 parent 246a8f5 commit aab0a95
Show file tree
Hide file tree
Showing 5 changed files with 5 additions and 7 deletions.
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
"laravel/prompts": "^0.1.13",
"livewire/livewire": "^3.2",
"spatie/invade": "^2.0",
"statamic/cms": "^5.0"
"statamic/cms": "^5.22"
},
"require-dev": {
"orchestra/testbench": "^8.19",
Expand Down
2 changes: 1 addition & 1 deletion src/Fields/Properties/WithOptions.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ protected function optionsProperty(?array $options = null): array
}

return collect($options)
->mapWithKeys(fn ($value) => [$value => __($value)])
->mapWithKeys(fn ($value) => [$value['key'] => __($value['value']) ?? __($value['key'])])
->toArray();
}
}
3 changes: 1 addition & 2 deletions src/Form/Section.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,7 @@ public function __construct(
protected array $fields,
protected ?string $display,
protected ?string $instructions,
) {
}
) {}

public function number(): int
{
Expand Down
3 changes: 1 addition & 2 deletions src/Form/Step.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,7 @@ public function __construct(
protected array $fields,
protected ?string $display,
protected ?string $instructions,
) {
}
) {}

public function number(): int
{
Expand Down
2 changes: 1 addition & 1 deletion src/Livewire/Concerns/WithHandle.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,6 @@ protected function handle(): string
return str($this->getName())->beforeLast('-form')->replace('-', '_');
}

throw new HandleNotFoundException();
throw new HandleNotFoundException;
}
}

0 comments on commit aab0a95

Please sign in to comment.