protected function getCurrentPage(array $pages, array $slugsArray): Page
    {
        if (count($pages) === count($slugsArray)) {
            $currentPage = $this->getFinalTreeElement($slugsArray, $pages);
        } else {
            $currentPage = current($pages);
        }

        return $currentPage;
    }
protected function getCurrentPage(array $pages, array $slugsArray): Page
    {
        if (count($pages) === count($slugsArray)) {
            $currentPage = $this->getFinalTreeElement($slugsArray, $pages);
        } else {
            $currentPage = current($pages);
        }

        return $currentPage;
    }
protected function getCurrentPage ( array $ pages , array $ slugsArray ) : Page { if ( count ( $ pages ) === count ( $ slugsArray ) ) { $ currentPage = $ this -> getFinalTreeElement ( $ slugsArray , $ pages ) ; } else { $ currentPage = current ( $ pages ) ; } return $ currentPage ; }
Retrieves the current page based on page list and entered slugs.

@param Page[] $pages
@param array  $slugsArray

@return Page
Retrieves the current page based on page list and entered slugs .