From 52efe9dbf63de31880670862272102a3036b0aa0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Milan=20Felix=20=C5=A0ulc?= Date: Sun, 25 Feb 2024 17:10:24 +0100 Subject: [PATCH] QA: improvements --- src/Bridge/Nette/Form/ImageUploadControl.php | 3 ++- src/Bridge/Nette/Form/Remove/ImageRemove.php | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/src/Bridge/Nette/Form/ImageUploadControl.php b/src/Bridge/Nette/Form/ImageUploadControl.php index a864385..6d41b9b 100644 --- a/src/Bridge/Nette/Form/ImageUploadControl.php +++ b/src/Bridge/Nette/Form/ImageUploadControl.php @@ -15,6 +15,7 @@ use Nette\Forms\Controls\UploadControl; use Nette\Http\FileUpload; use Nette\Utils\Html; +use Stringable; final class ImageUploadControl extends UploadControl { @@ -31,7 +32,7 @@ final class ImageUploadControl extends UploadControl private ?FileUpload $uploadValue = null; - public function __construct(string|object|null $label = null) + public function __construct(string|Stringable|null $label = null) { $this->entity = new UploadControlEntity(); $this->containerPart = Html::el('div', ['class' => 'image-upload-container']); diff --git a/src/Bridge/Nette/Form/Remove/ImageRemove.php b/src/Bridge/Nette/Form/Remove/ImageRemove.php index 3122ee8..8013c29 100644 --- a/src/Bridge/Nette/Form/Remove/ImageRemove.php +++ b/src/Bridge/Nette/Form/Remove/ImageRemove.php @@ -47,7 +47,7 @@ public function getHttpData(ImageUploadControl $input): bool $form = $input->getForm(); assert($form !== null); - return (bool) $form->getHttpData(Form::DATA_TEXT, $input->getName() . '_remove'); + return (bool) $form->getHttpData(Form::DataText, $input->getName() . '_remove'); } public function getHtml(ImageUploadControl $input): ?Html