Upgrade to 4.6.0

This commit is contained in:
Bastian Allgeier
2025-01-30 12:15:44 +01:00
parent d71db84033
commit daf499e2e4
179 changed files with 1848 additions and 688 deletions

View File

@@ -127,7 +127,7 @@ class Field extends Component
/**
* Sets the focus on this field when the form loads. Only the first field with this label gets
*/
'autofocus' => function (bool $autofocus = null): bool {
'autofocus' => function (bool|null $autofocus = null): bool {
return $autofocus ?? false;
},
/**
@@ -145,7 +145,7 @@ class Field extends Component
/**
* If `true`, the field is no longer editable and will not be saved
*/
'disabled' => function (bool $disabled = null): bool {
'disabled' => function (bool|null $disabled = null): bool {
return $disabled ?? false;
},
/**
@@ -157,7 +157,7 @@ class Field extends Component
/**
* Optional icon that will be shown at the end of the field
*/
'icon' => function (string $icon = null) {
'icon' => function (string|null $icon = null) {
return $icon;
},
/**
@@ -175,7 +175,7 @@ class Field extends Component
/**
* If `true`, the field has to be filled in correctly to be saved.
*/
'required' => function (bool $required = null): bool {
'required' => function (bool|null $required = null): bool {
return $required ?? false;
},
/**

View File

@@ -214,7 +214,7 @@ class BlocksField extends FieldClass
'action' => function (
string $fieldsetType,
string $fieldName,
string $path = null
string|null $path = null
) use ($field) {
$fields = $field->fields($fieldsetType);
$field = $field->form($fields)->field($fieldName);
@@ -276,7 +276,7 @@ class BlocksField extends FieldClass
);
}
protected function setGroup(string $group = null): void
protected function setGroup(string|null $group = null): void
{
$this->group = $group;
}

View File

@@ -175,7 +175,7 @@ class LayoutField extends BlocksField
'method' => 'ALL',
'action' => function (
string $fieldName,
string $path = null
string|null $path = null
) use ($field): array {
$form = $field->attrsForm();
$field = $form->field($fieldName);

View File

@@ -610,7 +610,7 @@ abstract class FieldClass
}
protected function valueToJson(
array $value = null,
array|null $value = null,
bool $pretty = false
): string {
$constants = JSON_UNESCAPED_SLASHES | JSON_UNESCAPED_UNICODE;
@@ -622,7 +622,7 @@ abstract class FieldClass
return json_encode($value, $constants);
}
protected function valueToYaml(array $value = null): string
protected function valueToYaml(array|null $value = null): string
{
return Data::encode($value, 'yaml');
}

View File

@@ -39,7 +39,7 @@ class Fields extends Collection
* array and also does that for every
* included field.
*/
public function toArray(Closure $map = null): array
public function toArray(Closure|null $map = null): array
{
$array = [];

View File

@@ -11,7 +11,7 @@ trait Max
return $this->max;
}
protected function setMax(int $max = null)
protected function setMax(int|null $max = null)
{
$this->max = $max;
}

View File

@@ -11,7 +11,7 @@ trait Min
return $this->min;
}
protected function setMin(int $min = null)
protected function setMin(int|null $min = null)
{
$this->min = $min;
}