diff --git a/src/Forms/Controls/ChoiceControl.php b/src/Forms/Controls/ChoiceControl.php index 9095c4af8..3d36d4de1 100644 --- a/src/Forms/Controls/ChoiceControl.php +++ b/src/Forms/Controls/ChoiceControl.php @@ -85,7 +85,7 @@ public function getValue(): mixed /** * Returns selected key (not checked). */ - public function getRawValue(): string|int + public function getRawValue(): string|int|null { return $this->value; } diff --git a/src/Forms/Helpers.php b/src/Forms/Helpers.php index 6d1a13179..3a2fdb480 100644 --- a/src/Forms/Helpers.php +++ b/src/Forms/Helpers.php @@ -70,7 +70,7 @@ private static function sanitize(int $type, $value) { if ($type === Form::DataText) { return is_scalar($value) - ? Strings::normalizeNewLines($value) + ? Strings::normalizeNewLines((string) $value) : null; } elseif ($type === Form::DataLine) { diff --git a/src/Forms/Rendering/DefaultFormRenderer.php b/src/Forms/Rendering/DefaultFormRenderer.php index 1f8336ec2..34ebcb936 100644 --- a/src/Forms/Rendering/DefaultFormRenderer.php +++ b/src/Forms/Rendering/DefaultFormRenderer.php @@ -117,7 +117,7 @@ class DefaultFormRenderer implements Nette\Forms\FormRenderer ]; protected Nette\Forms\Form $form; - protected int $counter; + protected int $counter = 0; /**