Skip to content

Commit

Permalink
Merge pull request joomla#96 from frankmayer/remove-callable-calls
Browse files Browse the repository at this point in the history
Improvements joomla#1
  • Loading branch information
mbabker authored Jun 26, 2017
2 parents a332b87 + bc3865d commit 705a71e
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 12 deletions.
6 changes: 3 additions & 3 deletions src/DatabaseDriver.php
Original file line number Diff line number Diff line change
Expand Up @@ -397,7 +397,7 @@ public static function splitSql($sql)

if ($comment && $start < $i)
{
$query = $query . substr($sql, $start, ($i - $start));
$query .= substr($sql, $start, ($i - $start));
}
}
}
Expand All @@ -412,7 +412,7 @@ public static function splitSql($sql)
{
if ($start <= $i)
{
$query = $query . substr($sql, $start, ($i - $start + 1));
$query .= substr($sql, $start, ($i - $start + 1));
}

$query = trim($query);
Expand All @@ -421,7 +421,7 @@ public static function splitSql($sql)
{
if (($i == $end - 1) && ($current != ';'))
{
$query = $query . ';';
$query .= ';';
}

$queries[] = $query;
Expand Down
2 changes: 1 addition & 1 deletion src/Mysqli/MysqliDriver.php
Original file line number Diff line number Diff line change
Expand Up @@ -637,7 +637,7 @@ public function execute()
$bindParams = array();
$bindParams[] = &$typeString;

for ($i = 0; $i < count($params); $i++)
for ($i = 0, $iMax = count($params); $i < $iMax; $i++)
{
$bindParams[] = &$params[$i];
}
Expand Down
8 changes: 4 additions & 4 deletions src/Pgsql/PgsqlDriver.php
Original file line number Diff line number Diff line change
Expand Up @@ -821,7 +821,7 @@ public function replacePrefix($sql, $prefix = '#__')
{
$sql = explode('currval', $sql);

for ($nIndex = 1; $nIndex < count($sql); $nIndex = $nIndex + 2)
for ($nIndex = 1, $nIndexMax = count($sql); $nIndex < $nIndexMax; $nIndex += 2)
{
$sql[$nIndex] = str_replace($prefix, $this->tablePrefix, $sql[$nIndex]);
}
Expand All @@ -834,7 +834,7 @@ public function replacePrefix($sql, $prefix = '#__')
{
$sql = explode('nextval', $sql);

for ($nIndex = 1; $nIndex < count($sql); $nIndex = $nIndex + 2)
for ($nIndex = 1, $nIndexMax = count($sql); $nIndex < $nIndexMax; $nIndex += 2)
{
$sql[$nIndex] = str_replace($prefix, $this->tablePrefix, $sql[$nIndex]);
}
Expand All @@ -847,7 +847,7 @@ public function replacePrefix($sql, $prefix = '#__')
{
$sql = explode('setval', $sql);

for ($nIndex = 1; $nIndex < count($sql); $nIndex = $nIndex + 2)
for ($nIndex = 1, $nIndexMax = count($sql); $nIndex < $nIndexMax; $nIndex += 2)
{
$sql[$nIndex] = str_replace($prefix, $this->tablePrefix, $sql[$nIndex]);
}
Expand All @@ -857,7 +857,7 @@ public function replacePrefix($sql, $prefix = '#__')

$explodedQuery = explode('\'', $sql);

for ($nIndex = 0; $nIndex < count($explodedQuery); $nIndex = $nIndex + 2)
for ($nIndex = 0, $nIndexMax = count($explodedQuery); $nIndex < $nIndexMax; $nIndex += 2)
{
if (strpos($explodedQuery[$nIndex], $prefix))
{
Expand Down
8 changes: 4 additions & 4 deletions src/Postgresql/PostgresqlDriver.php
Original file line number Diff line number Diff line change
Expand Up @@ -1417,7 +1417,7 @@ public function replacePrefix($sql, $prefix = '#__')
{
$sql = explode('currval', $sql);

for ($nIndex = 1; $nIndex < count($sql); $nIndex = $nIndex + 2)
for ($nIndex = 1, $nIndexMax = count($sql); $nIndex < $nIndexMax; $nIndex += 2)
{
$sql[$nIndex] = str_replace($prefix, $this->tablePrefix, $sql[$nIndex]);
}
Expand All @@ -1430,7 +1430,7 @@ public function replacePrefix($sql, $prefix = '#__')
{
$sql = explode('nextval', $sql);

for ($nIndex = 1; $nIndex < count($sql); $nIndex = $nIndex + 2)
for ($nIndex = 1, $nIndexMax = count($sql); $nIndex < $nIndexMax; $nIndex += 2)
{
$sql[$nIndex] = str_replace($prefix, $this->tablePrefix, $sql[$nIndex]);
}
Expand All @@ -1443,7 +1443,7 @@ public function replacePrefix($sql, $prefix = '#__')
{
$sql = explode('setval', $sql);

for ($nIndex = 1; $nIndex < count($sql); $nIndex = $nIndex + 2)
for ($nIndex = 1, $nIndexMax = count($sql); $nIndex < $nIndexMax; $nIndex += 2)
{
$sql[$nIndex] = str_replace($prefix, $this->tablePrefix, $sql[$nIndex]);
}
Expand All @@ -1453,7 +1453,7 @@ public function replacePrefix($sql, $prefix = '#__')

$explodedQuery = explode('\'', $sql);

for ($nIndex = 0; $nIndex < count($explodedQuery); $nIndex = $nIndex + 2)
for ($nIndex = 0, $nIndexMax = count($explodedQuery); $nIndex < $nIndexMax; $nIndex += 2)
{
if (strpos($explodedQuery[$nIndex], $prefix))
{
Expand Down

0 comments on commit 705a71e

Please sign in to comment.