Skip to content

Commit ef8ffc9

Browse files
committed
TermInput: Correct return-type of prepareMultipartUpdate
1 parent 6eb7bf9 commit ef8ffc9

1 file changed

Lines changed: 4 additions & 3 deletions

File tree

src/FormElement/TermInput.php

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
use ipl\Html\FormElement\HiddenElement;
1010
use ipl\Html\HtmlElement;
1111
use ipl\Html\HtmlString;
12+
use ipl\Html\ValidHtml;
1213
use ipl\Stdlib\Events;
1314
use ipl\Web\FormElement\TermInput\RegisteredTerm;
1415
use ipl\Web\FormElement\TermInput\TermContainer;
@@ -261,13 +262,13 @@ public function parseValue(string $value): array
261262
*
262263
* @param ServerRequestInterface $request
263264
*
264-
* @return array
265+
* @return array<array{0: ValidHtml, 1: ?string}>
265266
*/
266267
public function prepareMultipartUpdate(ServerRequestInterface $request): array
267268
{
268269
$updates = [];
269270
if ($this->valueHasBeenPasted()) {
270-
$updates[] = $this->termContainer();
271+
$updates[] = [$this->termContainer(), null];
271272
$updates[] = [
272273
HtmlString::create(json_encode(
273274
['#' . Attribute::sanitizeId($this->getValueOfNameAttribute()) . '-search-input', []]
@@ -284,7 +285,7 @@ public function prepareMultipartUpdate(ServerRequestInterface $request): array
284285
}
285286

286287
if (empty($updates) && $this->hasBeenAutoSubmitted()) {
287-
$updates[] = $updates[] = [
288+
$updates[] = [
288289
HtmlString::create(json_encode(
289290
['#' . Attribute::sanitizeId($this->getValueOfNameAttribute()) . '-search-input', 'bogus']
290291
)),

0 commit comments

Comments
 (0)