Skip to content

Commit

Permalink
Comments
Browse files Browse the repository at this point in the history
  • Loading branch information
daftspunk committed Oct 8, 2024
1 parent 38750a9 commit 61e32e1
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/Element/OptionDefinition.php
Original file line number Diff line number Diff line change
Expand Up @@ -40,15 +40,17 @@ protected function initDefaultValues()
/**
* useOptionConfig
*/
public function useOptionConfig($value, $option = null): OptionDefinition
public function useOptionConfig($value, $option): OptionDefinition
{
$this->value($value)->label($value);

// Option as string
if (!is_array($option)) {
$this->label($option);
return $this;
}

// Option as definition
if (Arr::isAssoc($option)) {
if (isset($option['children']) && is_array($option['children'])) {
$option['children'] = $this->evalChildOptions($option['children']);
Expand All @@ -58,6 +60,7 @@ public function useOptionConfig($value, $option = null): OptionDefinition
return $this;
}

// Option as [label, comment]
$firstPart = (string) ($option[0] ?? '');
$secondPart = (string) ($option[1] ?? '');

Expand Down

0 comments on commit 61e32e1

Please sign in to comment.