Skip to content

Commit

Permalink
Change PHP keywords to comply with PSR2
Browse files Browse the repository at this point in the history
Signed-off-by: CodeLingoBot <[email protected]>
  • Loading branch information
CodeLingoBot committed Apr 13, 2019
1 parent e64dacc commit 62ca3ae
Showing 1 changed file with 12 additions and 12 deletions.
24 changes: 12 additions & 12 deletions safemysql.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -79,9 +79,9 @@ class SafeMySQL
'user' => 'root',
'pass' => '',
'db' => 'test',
'port' => NULL,
'socket' => NULL,
'pconnect' => FALSE,
'port' => null,
'socket' => null,
'pconnect' => false,
'charset' => 'utf8',
'errmode' => 'exception', //or 'error'
'exception' => 'Exception', //Exception class name
Expand Down Expand Up @@ -213,7 +213,7 @@ public function getOne()
}
$this->free($res);
}
return FALSE;
return false;
}

/**
Expand All @@ -235,7 +235,7 @@ public function getRow()
$this->free($res);
return $ret;
}
return FALSE;
return false;
}

/**
Expand Down Expand Up @@ -398,10 +398,10 @@ public function parse()
* @param string $default - optional variable to set if no match found. Default to false.
* @return string|FALSE - either sanitized value or FALSE
*/
public function whiteList($input,$allowed,$default=FALSE)
public function whiteList($input,$allowed,$default=false)
{
$found = array_search($input,$allowed);
return ($found === FALSE) ? $default : $allowed[$found];
return ($found === false) ? $default : $allowed[$found];
}

/**
Expand Down Expand Up @@ -462,9 +462,9 @@ public function getStats()
*/
protected function rawQuery($query)
{
$start = microtime(TRUE);
$start = microtime(true);
$res = mysqli_query($this->conn, $query);
$timer = microtime(TRUE) - $start;
$timer = microtime(true) - $start;

$this->stats[] = array(
'query' => $query,
Expand Down Expand Up @@ -535,14 +535,14 @@ protected function prepareQuery($args)

protected function escapeInt($value)
{
if ($value === NULL)
if ($value === null)
{
return 'NULL';
}
if(!is_numeric($value))
{
$this->error("Integer (?i) placeholder expects numeric value, ".gettype($value)." given");
return FALSE;
return false;
}
if (is_float($value))
{
Expand All @@ -553,7 +553,7 @@ protected function escapeInt($value)

protected function escapeString($value)
{
if ($value === NULL)
if ($value === null)
{
return 'NULL';
}
Expand Down

0 comments on commit 62ca3ae

Please sign in to comment.