Removed try catch exception from bottombar

There should not be exception so no need for exception catching
This commit is contained in:
alistair3149 2020-06-04 01:40:32 -04:00
parent 575a700425
commit f248b8a861
No known key found for this signature in database
GPG key ID: 94D081060FD3DD9C

View file

@ -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;
}
/**