Skip to content

Commit 6d1f90d

Browse files
authored
Merge pull request #6615 from WoltLab/63-select-form-field-int-default-value
Allow `int` as default value in `SelectFormField`
2 parents 4359cde + ae84fb8 commit 6d1f90d

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

wcfsetup/install/files/lib/system/form/builder/field/SelectFormField.class.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ final class SelectFormField extends AbstractFormField implements
3939
/**
4040
* @since 6.2
4141
*/
42-
private ?string $defaultValue = null;
42+
private string|int|null $defaultValue = null;
4343

4444
/**
4545
* @inheritDoc
@@ -117,7 +117,7 @@ public function ignoreInvalidValues(bool $ignoreInvalidValues = true): self
117117
*
118118
* @since 6.2
119119
*/
120-
public function defaultValue(?string $defaultValue = null): self
120+
public function defaultValue(string|int|null $defaultValue = null): self
121121
{
122122
if ($defaultValue !== null && !isset($this->getOptions()[$defaultValue])) {
123123
throw new \InvalidArgumentException("Unknown default value '{$defaultValue}' for field '{$this->getId()}'.");

0 commit comments

Comments
 (0)