Skip to content

Commit

Permalink
Fixed styleCI
Browse files Browse the repository at this point in the history
  • Loading branch information
daguilarm committed May 11, 2021
1 parent 2408e23 commit b885503
Showing 1 changed file with 16 additions and 14 deletions.
30 changes: 16 additions & 14 deletions src/Components/ComboboxComponent.php
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ private function resolveElements(array $elements): array
// Update elements on event (change)
$this->updateValues();

// Resolve the child element
// Resolve the child elements
return collect($elements)
->map(function ($element) {
return $this->resolveChildElements($element);
Expand Down Expand Up @@ -118,19 +118,8 @@ private function resolveChildElements(object $element): ?object
}

/**
* Reset the all the elements if parent element is empty.
*/
private function updateValues(): void
{
// Get current position in the array and set the limit
$limit = $this->getPosition() + 1;

// Update the values
$this->comboboxValues = $this->getComboboxValues($limit);
}

/**
* Reset the all the elements if parent element is empty.
* Reset all the elements if parent element is empty.
* When you change the first element.
*/
private function resetValuesIfParentIsEmpty(): void
{
Expand All @@ -144,6 +133,19 @@ private function resetValuesIfParentIsEmpty(): void
}
}

/**
* Reset the all the elements if parent element is empty.
*/
private function updateValues(): void
{
// Get current position in the array and set the limit
// of the visible elements (current + 1)
$limit = $this->getPosition() + 1;

// Update the values
$this->comboboxValues = $this->getComboboxValues($limit);
}

/**
* Get the current loop position.
*/
Expand Down

0 comments on commit b885503

Please sign in to comment.