From f248b8a861226e9c72fb41f514b9b1997219b326 Mon Sep 17 00:00:00 2001 From: alistair3149 Date: Thu, 4 Jun 2020 01:40:32 -0400 Subject: [PATCH] Removed try catch exception from bottombar There should not be exception so no need for exception catching --- includes/CitizenTemplate.php | 23 ++++++++--------------- 1 file changed, 8 insertions(+), 15 deletions(-) diff --git a/includes/CitizenTemplate.php b/includes/CitizenTemplate.php index 863ba6dd..1dbfcd7d 100644 --- a/includes/CitizenTemplate.php +++ b/includes/CitizenTemplate.php @@ -139,25 +139,18 @@ class CitizenTemplate extends BaseTemplate { * TODO: Refactor the bottom bar to be customizable * @return array */ - private function buildBottombar() { - try { - $buttonEnabled = $this->config->get( 'CitizenEnableButton' ); - $buttonLink = $this->config->get( 'CitizenButtonLink' ); - $buttonTitle = $this->config->get( 'CitizenButtonTitle' ); - $buttonText = $this->config->get( 'CitizenButtonText' ); - } catch ( ConfigException $e ) { - return ''; - } - + private function buildBottombar() : array { + $config = $this->config; + $buttonEnabled = $config->get( 'CitizenEnableButton' ); if ( $buttonEnabled === false ) { return ''; } - - return [ - 'html-citizen-bottombar-button-href' => $buttonLink, - 'html-citizen-bottombar-button-title' => $buttonTitle, - 'html-citizen-bottombar-button-text' => $buttonText + $props = [ + 'html-citizen-bottombar-button-href' => $config->get( 'CitizenButtonLink' ), + 'html-citizen-bottombar-button-title' => $config->get( 'CitizenButtonTitle' ), + 'html-citizen-bottombar-button-text' => $config->get( 'CitizenButtonText' ), ]; + return $props; } /**