Skip to content

Commit

Permalink
fix stan
Browse files Browse the repository at this point in the history
  • Loading branch information
mvorisek committed Sep 7, 2022
1 parent e579300 commit 9d171d8
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
4 changes: 1 addition & 3 deletions src/Accordion.php
Original file line number Diff line number Diff line change
Expand Up @@ -136,11 +136,9 @@ public function jsBehavior($behavior, array $args, $when = null)
/**
* Return the index of an accordion section in collection.
*
* @param AccordionSection $section
*
* @return int
*/
public function getSectionIdx($section)
public function getSectionIdx(AccordionSection $section)
{
$idx = -1;
foreach ($this->sections as $key => $accordion_section) {
Expand Down
8 changes: 8 additions & 0 deletions src/Form/Layout/Section/Accordion.php
Original file line number Diff line number Diff line change
Expand Up @@ -53,4 +53,12 @@ public function addSection($title, \Closure $callback = null, $icon = 'dropdown'

return $section->add([$this->formLayout, 'form' => $this->form]);
}

/**
* @param AccordionSection|Form\Layout $section
*/
public function getSectionIdx($section)
{
return parent::getSectionIdx($section instanceof AccordionSection ? $section : $section->getOwner());
}
}

0 comments on commit 9d171d8

Please sign in to comment.