diff --git a/QuickBooks/Cast.php b/QuickBooks/Cast.php index d58f5c11..c541bf6c 100755 --- a/QuickBooks/Cast.php +++ b/QuickBooks/Cast.php @@ -96,7 +96,7 @@ static protected function _castCharset($str) $count = strlen($str); for ($i = 0; $i < $count; $i++) { - $ord = ord($str{$i}); + $ord = ord($str[$i]); if ($ord != ord("\t") and $ord != ord("\n") and @@ -105,11 +105,11 @@ static protected function _castCharset($str) { if (isset($replace[$ord])) { - $str{$i} = $replace[$ord]; + $str[$i] = $replace[$ord]; } else { - $str{$i} = ' '; + $str[$i] = ' '; } } } @@ -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.php b/QuickBooks/Driver/Sql.php index c0601f34..74e400a1 100755 --- a/QuickBooks/Driver/Sql.php +++ b/QuickBooks/Driver/Sql.php @@ -3254,7 +3254,7 @@ protected function _initialize($init_options = array()) $dh = opendir($defaults['quickbooks_sql_schema']); while (false !== ($file = readdir($dh))) { - if ($file{0} == '.' or is_dir($defaults['quickbooks_sql_schema'] . '/' . $file)) + if ($file[0] == '.' or is_dir($defaults['quickbooks_sql_schema'] . '/' . $file)) { continue; } diff --git a/QuickBooks/IPP/Object.php b/QuickBooks/IPP/Object.php index b71b0867..6dd1421a 100644 --- a/QuickBooks/IPP/Object.php +++ b/QuickBooks/IPP/Object.php @@ -401,19 +401,19 @@ protected function _asXML_v3($indent, $parent, $optype, $flavor) //$xml .= QuickBooks_XML::encode($value, $for_qbxml); //$xml .= '' . QUICKBOOKS_CRLF; - if (substr($key, -3, 3) == 'Ref' and $svalue{0} == '{') + if (substr($key, -3, 3) == 'Ref' and $svalue[0] == '{') { $svalue = trim($svalue, '{}-'); } - else if ($key == 'Id' and $svalue{0} == '{') + else if ($key == 'Id' and $svalue[0] == '{') { $svalue = trim($svalue, '{}-'); } - else if ($key == 'DefinitionId' and $svalue{0} == '{') + else if ($key == 'DefinitionId' and $svalue[0] == '{') { $svalue = trim($svalue, '{}-'); } - else if ($key == 'TxnId' and $svalue{0} == '{') + else if ($key == 'TxnId' and $svalue[0] == '{') { $svalue = trim($svalue, '{}-'); } @@ -444,19 +444,19 @@ protected function _asXML_v3($indent, $parent, $optype, $flavor) { $for_qbxml = false; - if (substr($key, -3, 3) == 'Ref' and $value{0} == '{') + if (substr($key, -3, 3) == 'Ref' and $value[0] == '{') { $value = trim($value, '{}-'); } - else if ($key == 'Id' and $value{0} == '{') + else if ($key == 'Id' and $value[0] == '{') { $value = trim($value, '{}-'); } - else if ($key == 'DefinitionId' and $value{0} == '{') + else if ($key == 'DefinitionId' and $value[0] == '{') { $value = trim($value, '{}-'); } - else if ($key == 'TxnId' and $value{0} == '{') + else if ($key == 'TxnId' and $value[0] == '{') { $value = trim($value, '{}-'); } 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 9d6bf36f..693287a6 100755 --- a/QuickBooks/Utilities.php +++ b/QuickBooks/Utilities.php @@ -87,7 +87,7 @@ static public function mask($message) foreach ($masks as $key) { - if ($key{0} == '<') + if ($key[0] == '<') { // It's an XML tag $contents = QuickBooks_Utilities::_extractTagContents(trim($key, '<> '), $message); @@ -301,7 +301,7 @@ static public function intervalToSeconds($interval) $count = strlen($interval); for ($i = 0; $i < $count; $i++) { - if (ord($interval{$i}) < 97 or ord($interval{$i}) > 122) + if (ord($interval[$i]) < 97 or ord($interval[$i]) > 122) { $justletters = false; } diff --git a/QuickBooks/XML.php b/QuickBooks/XML.php index 3fc0b842..c82fb02d 100755 --- a/QuickBooks/XML.php +++ b/QuickBooks/XML.php @@ -309,26 +309,26 @@ static public function extractTagAttributes($tag_w_attrs, $return_tag_first = fa for ($i = 0; $i < $length; $i++) { - if ($attrs{$i} == '=') + if ($attrs[$i] == '=') { $in_key = false; $in_value = false; $expect_value = true; } /* - else if ($attrs{$i} == '"' and $expect_value) + else if ($attrs[$i] == '"' and $expect_value) { $in_value = true; $expect_value = false; } */ - /*else if ($attrs{$i} == '"' and $in_value)*/ - else if (($attrs{$i} == '"' or $attrs{$i} == '\'') and $expect_value) + /*else if ($attrs[$i] == '"' and $in_value)*/ + else if (($attrs[$i] == '"' or $attrs[$i] == '\'') and $expect_value) { $in_value = true; $expect_value = false; } - else if (($attrs{$i} == '"' or $attrs{$i} == '\'') and $in_value) + else if (($attrs[$i] == '"' or $attrs[$i] == '\'') and $in_value) { $attributes[trim($key)] = $value; @@ -338,18 +338,18 @@ static public function extractTagAttributes($tag_w_attrs, $return_tag_first = fa $in_value = false; $expect_key = true; } - else if ($attrs{$i} == ' ' and $expect_key) + else if ($attrs[$i] == ' ' and $expect_key) { $expect_key = false; $in_key = true; } else if ($in_key) { - $key .= $attrs{$i}; + $key .= $attrs[$i]; } else if ($in_value) { - $value .= $attrs{$i}; + $value .= $attrs[$i]; } }