Skip to content

Commit 0011b88

Browse files
committed
cs
1 parent 2aeabca commit 0011b88

File tree

3 files changed

+2
-20
lines changed

3 files changed

+2
-20
lines changed

src/Forms/Controls/ChoiceControl.php

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -53,11 +53,7 @@ public function setValue($value)
5353
}
5454

5555
if ($this->checkDefaultValue && $value !== null && !array_key_exists((string) $value, $this->items)) {
56-
$set = Nette\Utils\Strings::truncate(
57-
implode(', ', array_map(fn($s) => var_export($s, return: true), array_keys($this->items))),
58-
70,
59-
'...',
60-
);
56+
$set = Nette\Utils\Strings::truncate(implode(', ', array_map(fn($s) => var_export($s, return: true), array_keys($this->items))), 70, '...');
6157
throw new Nette\InvalidArgumentException("Value '$value' is out of allowed set [$set] in field '{$this->getName()}'.");
6258
}
6359

src/Forms/Controls/MultiChoiceControl.php

Lines changed: 1 addition & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -65,11 +65,7 @@ public function setValue($values)
6565

6666
$values = array_keys($flip);
6767
if ($this->checkDefaultValue && ($diff = array_diff($values, array_keys($this->items)))) {
68-
$set = Nette\Utils\Strings::truncate(
69-
implode(', ', array_map(fn($s) => var_export($s, return: true), array_keys($this->items))),
70-
70,
71-
'...',
72-
);
68+
$set = Nette\Utils\Strings::truncate(implode(', ', array_map(fn($s) => var_export($s, return: true), array_keys($this->items))), 70, '...');
7369
$vals = (count($diff) > 1 ? 's' : '') . " '" . implode("', '", $diff) . "'";
7470
throw new Nette\InvalidArgumentException("Value$vals are out of allowed set [$set] in field '{$this->getName()}'.");
7571
}
@@ -97,15 +93,6 @@ public function getRawValue(): array
9793
}
9894

9995

100-
/**
101-
* Is any item selected?
102-
*/
103-
public function isFilled(): bool
104-
{
105-
return $this->getValue() !== [];
106-
}
107-
108-
10996
/**
11097
* Sets items from which to choose.
11198
* @return static

src/Forms/Form.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -473,7 +473,6 @@ public function getHttpData(?int $type = null, ?string $htmlName = null): string
473473
return $htmlName === null
474474
? $this->httpData
475475
: Helpers::extractHttpData($this->httpData, $htmlName, $type);
476-
477476
}
478477

479478

0 commit comments

Comments
 (0)