diff --git a/.gitignore b/.gitignore index c7b6d033..baae0238 100644 --- a/.gitignore +++ b/.gitignore @@ -166,3 +166,5 @@ pip-log.txt # Mac crap .DS_Store + +*.code-workspace \ No newline at end of file diff --git a/QuickBooks/Cast.php b/QuickBooks/Cast.php index d58f5c11..f97d3818 100755 --- a/QuickBooks/Cast.php +++ b/QuickBooks/Cast.php @@ -255,7 +255,7 @@ static public function cast($type_or_action, $field, $value, $use_abbrevs = true $dh = opendir(dirname(__FILE__) . '/QBXML/Schema/Object'); while (false !== ($file = readdir($dh))) { - if ($file{0} == '.' or substr($file, -6, 6) != 'Rq.php') + if ($file[0] == '.' or substr($file, -6, 6) != 'Rq.php') { continue; } diff --git a/QuickBooks/Driver/Sql/Mysqli.php b/QuickBooks/Driver/Sql/Mysqli.php index fe856210..6747b708 100644 --- a/QuickBooks/Driver/Sql/Mysqli.php +++ b/QuickBooks/Driver/Sql/Mysqli.php @@ -436,7 +436,7 @@ protected function _escape($str) $str = ''; } - return $this->_conn->real_escape_string($str); + return $this->_conn->real_escape_string($str ?? ''); } /** diff --git a/QuickBooks/MerchantService/CheckingAccount.php b/QuickBooks/MerchantService/CheckingAccount.php index ac0dd32d..7f7a6339 100644 --- a/QuickBooks/MerchantService/CheckingAccount.php +++ b/QuickBooks/MerchantService/CheckingAccount.php @@ -55,7 +55,7 @@ public function __construct($routing, $account, $info, $type, $first_name, $last $phone = trim(str_replace(array('(', ')', '+', ' ', '.', '-'), '', $phone)); if (strlen($phone) == 11 and - $phone{0} == '1') + $phone[0] == '1') { $phone = substr($phone, 1); } diff --git a/QuickBooks/Utilities.php b/QuickBooks/Utilities.php index c90ece51..ab81ac6d 100755 --- a/QuickBooks/Utilities.php +++ b/QuickBooks/Utilities.php @@ -92,7 +92,7 @@ static public function mask($message) // It's an XML tag $contents = QuickBooks_Utilities::_extractTagContents(trim($key, '<> '), $message); - $masked = str_repeat('x', min(strlen($contents), 12)) . substr($contents, 12); + $masked = str_repeat('x', min(strlen($contents ?? ''), 12)) . substr($contents ?? '', 12); $message = str_replace($key . $contents . ' ') . '>', $key . $masked . ' ') . '>', $message); } diff --git a/QuickBooks/WebConnector/Handlers.php b/QuickBooks/WebConnector/Handlers.php index 3348875d..51d68d6d 100755 --- a/QuickBooks/WebConnector/Handlers.php +++ b/QuickBooks/WebConnector/Handlers.php @@ -544,7 +544,7 @@ public function authenticate($obj) $customauth_wait_before_next_update = null; $customauth_min_run_every_n_seconds = null; - if (is_array($override_dsn) or strlen($override_dsn)) // Custom autj + if (is_array($override_dsn) or strlen($override_dsn ?? '')) // Custom autj { //if ($auth->authenticate($obj->strUserName, $obj->strPassword, $customauth_company_file, $customauth_wait_before_next_update, $customauth_min_run_every_n_seconds) and diff --git a/QuickBooks/XML.php b/QuickBooks/XML.php index b58ec3c5..48ade04e 100755 --- a/QuickBooks/XML.php +++ b/QuickBooks/XML.php @@ -434,7 +434,7 @@ static public function decode($str, $for_qbxml = true) '&' => '&', // Make sure that this is *the last* transformation to run, otherwise we end up double-un-encoding things ); - return str_replace(array_keys($transform), array_values($transform), $str); + return str_replace(array_keys($transform), array_values($transform), $str ?? ''); } } diff --git a/QuickBooks/XML/Backend/Builtin.php b/QuickBooks/XML/Backend/Builtin.php index 76849412..b35d99e5 100644 --- a/QuickBooks/XML/Backend/Builtin.php +++ b/QuickBooks/XML/Backend/Builtin.php @@ -376,7 +376,7 @@ protected function _parseHelper($xml, &$Root, &$errnum, &$errmsg, $indent = 0) $Node->addAttribute($key, $value); } - if (false !== strpos($payload, '<')) + if (false !== strpos($payload ?? '', '<')) { // The tag contains child tags diff --git a/composer.json b/composer.json index d7a21d8b..3e76bef6 100644 --- a/composer.json +++ b/composer.json @@ -1,5 +1,5 @@ { - "name": "consolibyte/quickbooks", + "name": "xtremevision/quickbooks", "type": "library", "description": "QuickBooks DevKit with support for Intuit Anywhere, Intuit Partner Platform, Web Connector, QuickBooks Merchant Services, and more.", "keywords": ["quickbooks","intuit","intuit anywhere","intuit partner platform","quickbooks web connector","qbxml","intuit data services","quickbooks merchant services","intuit merchant services","web connector"],