From 625ec18f8139c441c2c0635a7e09f47b5d231105 Mon Sep 17 00:00:00 2001 From: Stephen Niedzielski Date: Mon, 18 Nov 2019 15:23:48 -0500 Subject: [PATCH] Hygiene: divide VectorTemplate.renderNavigation() Cut up renderNavigation() into several discrete methods. Smaller methods are easier to read and reason about. Change-Id: I4e55d858ab1745fb2baddef02f7046ec842eb149 --- includes/VectorTemplate.php | 335 +++++++++++++++++++----------------- 1 file changed, 179 insertions(+), 156 deletions(-) diff --git a/includes/VectorTemplate.php b/includes/VectorTemplate.php index 189b66c43..52b16aafa 100644 --- a/includes/VectorTemplate.php +++ b/includes/VectorTemplate.php @@ -270,172 +270,22 @@ class VectorTemplate extends BaseTemplate { foreach ( $elements as $name => $element ) { switch ( $element ) { case 'NAMESPACES': - ?> - - renderNamespacesComponent(); break; case 'VARIANTS': - ?> - - renderVariantsComponent(); break; case 'VIEWS': - ?> - - renderViewsComponent(); break; case 'ACTIONS': - ?> - - renderActionsComponent(); break; case 'PERSONAL': - ?> - - renderPersonalComponent(); break; case 'SEARCH': - ?> - - - - renderSearchComponent(); break; } } @@ -462,4 +312,177 @@ class VectorTemplate extends BaseTemplate { return parent::makeListItem( $key, $item, $options ); } + + private function renderNamespacesComponent() { + ?> + + + + + + + + + + + + + +