Simplified business logic

This commit is contained in:
objecttothis
2023-02-13 01:28:09 +04:00
committed by Steve Ireland
parent 7b7de41ffc
commit 29997d9083
2 changed files with 5 additions and 11 deletions

View File

@@ -13,12 +13,12 @@ define('DEFAULT_DATETIME', mktime(0, 0, 0, 1, 1, 2010));
/**
* Currency locale helper
*/
function current_language_code(bool $load_system_language = FALSE): string
function current_language_code(bool $load_system_language = false): string
{
$employee = model(Employee::class);
// Returns the language code of the employee if set or system language code if not
if($employee->is_logged_in() && $load_system_language != TRUE) //TODO: !==
if($employee->is_logged_in() && $load_system_language === false)
{
$employee_info = $employee->get_logged_in_employee_info();

View File

@@ -39,15 +39,9 @@ class MailchimpConnector
{
$encrypter = Services::encrypter();
if(empty($api_key))
{
$stored_key = config('OSPOS')->settings['mailchimp_api_key'];
$this->_api_key = $encrypter->decrypt($stored_key); //TODO: Hungarian notation
}
else
{
$this->_api_key = $api_key; //TODO: Hungarian notation
}
$this->_api_key = empty($api_key)
? $encrypter->decrypt(config('OSPOS')->settings['mailchimp_api_key']) //TODO: Hungarian notation
: $api_key; //TODO: Hungarian notation
if(!empty($this->_api_key)) //TODO: Hungarian notation
{