diff --git a/CRM/Campaign/BAO/Campaign.php b/CRM/Campaign/BAO/Campaign.php index 9c1a0447c109..40a0ae36d130 100644 --- a/CRM/Campaign/BAO/Campaign.php +++ b/CRM/Campaign/BAO/Campaign.php @@ -301,20 +301,11 @@ public static function getPermissionedCampaigns( /** * Is CiviCampaign enabled. + * * @return bool */ - public static function isCampaignEnable() { - static $isEnable = NULL; - - if (!isset($isEnable)) { - $isEnable = FALSE; - $config = CRM_Core_Config::singleton(); - if (in_array('CiviCampaign', $config->enableComponents)) { - $isEnable = TRUE; - } - } - - return $isEnable; + public static function isCampaignEnable(): bool { + return in_array('CiviCampaign', CRM_Core_Config::singleton()->enableComponents, TRUE); } /**