Skip to content

Commit 68a38f8

Browse files
Merge pull request #152 from CodeWithDennis/revert-149-fix-131
Revert "Fix #131"
2 parents df656d6 + ab99409 commit 68a38f8

File tree

1 file changed

+3
-22
lines changed

1 file changed

+3
-22
lines changed

src/SelectTree.php

Lines changed: 3 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -301,13 +301,7 @@ public function multiple(Closure|bool $multiple = true): static
301301

302302
public function prepend(Closure|array|null $prepend = null): static
303303
{
304-
$this->prepend = $this->evaluate($prepend);
305-
306-
if (is_array($this->prepend) && isset($this->prepend['name'], $this->prepend['value'])) {
307-
$this->prepend['value'] = (string) $this->prepend['value'];
308-
} else {
309-
throw new \InvalidArgumentException('The provided prepend value must be an array with "name" and "value" keys.');
310-
}
304+
$this->prepend = $prepend;
311305

312306
return $this;
313307
}
@@ -447,11 +441,9 @@ public function getIndependent(): bool
447441
return $this->evaluate($this->independent);
448442
}
449443

450-
public function getCustomKey($record): string
444+
public function getCustomKey($record)
451445
{
452-
$key = is_null($this->customKey) ? $record->getKey() : $record->{$this->customKey};
453-
454-
return (string) $key;
446+
return is_null($this->customKey) ? $record->getKey() : $record->{$this->customKey};
455447
}
456448

457449
public function getWithCount(): bool
@@ -622,15 +614,4 @@ public function createOptionModalHeading(string|Closure|null $heading): static
622614

623615
return $this;
624616
}
625-
626-
public function getState(): mixed
627-
{
628-
$state = parent::getState();
629-
630-
if (is_array($state)) {
631-
return array_map(fn ($value) => (string) $value, $state);
632-
}
633-
634-
return (string) $state;
635-
}
636617
}

0 commit comments

Comments
 (0)