Edit PHP version constraint and update Composer dependencies
This commit is contained in:
parent
231e1bce63
commit
e5b51981ff
52 changed files with 806 additions and 613 deletions
|
@ -24,16 +24,20 @@ return [
|
|||
},
|
||||
/**
|
||||
* Allowed incremental steps between numbers (i.e `0.5`)
|
||||
* Use `any` to allow any decimal value.
|
||||
*/
|
||||
'step' => function ($step = null) {
|
||||
return $this->toNumber($step) ?? '';
|
||||
'step' => function ($step = null): float|string {
|
||||
return match ($step) {
|
||||
'any' => 'any',
|
||||
default => $this->toNumber($step) ?? ''
|
||||
};
|
||||
},
|
||||
'value' => function ($value = null) {
|
||||
return $this->toNumber($value) ?? '';
|
||||
}
|
||||
],
|
||||
'methods' => [
|
||||
'toNumber' => function ($value) {
|
||||
'toNumber' => function ($value): float|null {
|
||||
if ($this->isEmpty($value) === true) {
|
||||
return null;
|
||||
}
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
<?php
|
||||
|
||||
use Kirby\Field\FieldOptions;
|
||||
use Kirby\Toolkit\I18n;
|
||||
|
||||
return [
|
||||
'extends' => 'radio',
|
||||
|
@ -19,8 +20,8 @@ return [
|
|||
/**
|
||||
* Custom placeholder string for empty option.
|
||||
*/
|
||||
'placeholder' => function (string $placeholder = '—') {
|
||||
return $placeholder;
|
||||
'placeholder' => function (string|array $placeholder = '—') {
|
||||
return I18n::translate($placeholder, $placeholder);
|
||||
},
|
||||
],
|
||||
'methods' => [
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue