Skip to content

Commit 6a72f5c

Browse files
committed
Change PHP keywords to comply with PSR2
Signed-off-by: CodeLingoBot <[email protected]>
1 parent a61c4f5 commit 6a72f5c

File tree

4 files changed

+19
-19
lines changed

4 files changed

+19
-19
lines changed

mssql.php

+3-3
Original file line numberDiff line numberDiff line change
@@ -63,9 +63,9 @@ function connect($config) {
6363

6464
if ($this->db = mssql_pconnect($config['server'], $config['username'], $config['password'])) {
6565
mssql_select_db($config['database']);
66-
return TRUE;
66+
return true;
6767
}
68-
return FALSE;
68+
return false;
6969
}
7070

7171
/**
@@ -126,7 +126,7 @@ function getDatabase() {
126126
* @return str[] The primary key field names
127127
*/
128128
function getPrimaryKeys($table) {
129-
$primary = NULL;
129+
$primary = null;
130130
$query = sprintf("SELECT [name]
131131
FROM syscolumns
132132
WHERE [id] IN (SELECT [id]

mysql.php

+5-5
Original file line numberDiff line numberDiff line change
@@ -45,10 +45,10 @@ function connect($config) {
4545
$config['password']
4646
)) {
4747
if ($this->select_db($config['database'])) {
48-
return TRUE;
48+
return true;
4949
}
5050
}
51-
return FALSE;
51+
return false;
5252
}
5353

5454
/**
@@ -63,9 +63,9 @@ function close() {
6363
*/
6464
function select_db($database) {
6565
if (mysql_select_db($database, $this->db)) {
66-
return TRUE;
66+
return true;
6767
}
68-
return FALSE;
68+
return false;
6969
}
7070

7171
/**
@@ -111,7 +111,7 @@ function getDatabase() {
111111
*/
112112
function getPrimaryKeys($table) {
113113
$resource = $this->getColumns($table);
114-
$primary = NULL;
114+
$primary = null;
115115
if ($resource) {
116116
while ($row = $this->row($resource)) {
117117
if ($row['Key'] == 'PRI') {

phprestsql.php

+8-8
Original file line numberDiff line numberDiff line change
@@ -46,25 +46,25 @@ class PHPRestSQL {
4646
* The HTTP request data sent (if any).
4747
* @var str
4848
*/
49-
var $requestData = NULL;
49+
var $requestData = null;
5050

5151
/**
5252
* The URL extension stripped off of the request URL
5353
* @var str
5454
*/
55-
var $extension = NULL;
55+
var $extension = null;
5656

5757
/**
5858
* The database table to query.
5959
* @var str
6060
*/
61-
var $table = NULL;
61+
var $table = null;
6262

6363
/**
6464
* The primary key of the database row to query.
6565
* @var str[]
6666
*/
67-
var $uid = NULL;
67+
var $uid = null;
6868

6969
/**
7070
* Array of strings to convert into the HTTP response.
@@ -75,15 +75,15 @@ class PHPRestSQL {
7575
/**
7676
* Type of display, database, table or row.
7777
*/
78-
var $display = NULL;
78+
var $display = null;
7979

8080
/**
8181
* Constructor. Parses the configuration file "phprestsql.ini", grabs any request data sent, records the HTTP
8282
* request method used and parses the request URL to find out the requested table name and primary key values.
8383
* @param str iniFile Configuration file to use
8484
*/
8585
function PHPRestSQL($iniFile = 'phprestsql.ini') {
86-
$this->config = parse_ini_file($iniFile, TRUE);
86+
$this->config = parse_ini_file($iniFile, true);
8787

8888
if (isset($_SERVER['REQUEST_URI']) && isset($_SERVER['REQUEST_METHOD'])) {
8989

@@ -101,7 +101,7 @@ function PHPRestSQL($iniFile = 'phprestsql.ini') {
101101

102102
$lastPart = array_pop($urlParts);
103103
$dotPosition = strpos($lastPart, '.');
104-
if ($dotPosition !== FALSE) {
104+
if ($dotPosition !== false) {
105105
$this->extension = substr($lastPart, $dotPosition + 1);
106106
$lastPart = substr($lastPart, 0, $dotPosition);
107107
}
@@ -519,7 +519,7 @@ function generateResponseData() {
519519
/**
520520
* Send a HTTP 201 response header.
521521
*/
522-
function created($url = FALSE) {
522+
function created($url = false) {
523523
header('HTTP/1.0 201 Created');
524524
if ($url) {
525525
header('Location: '.$url);

postgresql.php

+3-3
Original file line numberDiff line numberDiff line change
@@ -62,9 +62,9 @@ function connect($config) {
6262
);
6363

6464
if ($this->db = pg_pconnect($connString)) {
65-
return TRUE;
65+
return true;
6666
}
67-
return FALSE;
67+
return false;
6868
}
6969

7070
/**
@@ -126,7 +126,7 @@ function getDatabase() {
126126
*/
127127
function getPrimaryKeys($table) {
128128
$i = 0;
129-
$primary = NULL;
129+
$primary = null;
130130
do {
131131
$query = sprintf('SELECT pg_attribute.attname
132132
FROM pg_class, pg_attribute, pg_index

0 commit comments

Comments
 (0)