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

Change PHP keywords to comply with PSR2 #56

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
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
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