diff --git a/app/code/Magento/Backend/Block/Widget/Tabs.php b/app/code/Magento/Backend/Block/Widget/Tabs.php index 573af01a78955..fd6c61b14dbd6 100644 --- a/app/code/Magento/Backend/Block/Widget/Tabs.php +++ b/app/code/Magento/Backend/Block/Widget/Tabs.php @@ -235,6 +235,7 @@ protected function _beforeToHtml() $this->_tabs = $this->reorderTabs(); if ($this->_activeTab === null) { + /** @var $tab */ foreach ($this->_tabs as $tab) { $this->_activeTab = $tab->getId(); break; @@ -263,8 +264,10 @@ protected function reorderTabs() $position = 100; /** - * @var string $key - * @var \Magento\Backend\Block\Widget\Tab\TabInterface $tab + * Set the initial positions for each tab. + * + * @var string $key + * @var TabInterface $tab */ foreach ($this->_tabs as $key => $tab) { $tab->setPosition($position); @@ -277,6 +280,12 @@ protected function reorderTabs() $positionFactor = 1; + /** + * Rearrange the positions by using the after tag for each tab. + * + * @var integer $position + * @var TabInterface $tab + */ foreach ($orderByPosition as $position => $tab) { if (!$tab->getAfter() || !in_array($tab->getAfter(), array_keys($orderByIdentity))) { $positionFactor = 1;