Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

replaced curly brackets #303

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions QuickBooks/Cast.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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] = ' ';
}
}
}
Expand Down Expand Up @@ -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;
}
Expand Down
2 changes: 1 addition & 1 deletion QuickBooks/Driver/Sql.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down
16 changes: 8 additions & 8 deletions QuickBooks/IPP/Object.php
Original file line number Diff line number Diff line change
Expand Up @@ -401,19 +401,19 @@ protected function _asXML_v3($indent, $parent, $optype, $flavor)
//$xml .= QuickBooks_XML::encode($value, $for_qbxml);
//$xml .= '</' . $key . '>' . 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, '{}-');
}
Expand Down Expand Up @@ -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, '{}-');
}
Expand Down
2 changes: 1 addition & 1 deletion QuickBooks/MerchantService/CheckingAccount.php
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Expand Down
4 changes: 2 additions & 2 deletions QuickBooks/Utilities.php
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down Expand Up @@ -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;
}
Expand Down
16 changes: 8 additions & 8 deletions QuickBooks/XML.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand All @@ -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];
}
}

Expand Down