Skip to content

Commit a45a605

Browse files
committed
Database Utils typos changes
1 parent a283a9a commit a45a605

4 files changed

Lines changed: 15 additions & 12 deletions

File tree

system/Database/BaseUtils.php

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,7 @@ public function listDatabases()
136136
* @param string $database_name
137137
* @return boolean
138138
*/
139-
public function databaseExists($database_name)
139+
public function databaseExists(string $database_name): bool
140140
{
141141
return in_array($database_name, $this->listDatabases());
142142
}
@@ -147,10 +147,10 @@ public function databaseExists($database_name)
147147
* Optimize Table
148148
*
149149
* @param string $table_name
150-
* @return boolean|mixed
150+
* @return mixed
151151
* @throws \CodeIgniter\Database\Exceptions\DatabaseException
152152
*/
153-
public function optimizeTable($table_name)
153+
public function optimizeTable(string $table_name)
154154
{
155155
if ($this->optimizeTable === false)
156156
{
@@ -231,7 +231,7 @@ public function optimizeDatabase()
231231
* @return mixed
232232
* @throws \CodeIgniter\Database\Exceptions\DatabaseException
233233
*/
234-
public function repairTable($table_name)
234+
public function repairTable(string $table_name)
235235
{
236236
if ($this->repairTable === false)
237237
{
@@ -264,7 +264,7 @@ public function repairTable($table_name)
264264
*
265265
* @return string
266266
*/
267-
public function getCSVFromResult(ResultInterface $query, $delim = ',', $newline = "\n", $enclosure = '"')
267+
public function getCSVFromResult(ResultInterface $query, string $delim = ',', string $newline = "\n", string $enclosure = '"')
268268
{
269269
$out = '';
270270
// First generate the headings from the table column names
@@ -299,7 +299,7 @@ public function getCSVFromResult(ResultInterface $query, $delim = ',', $newline
299299
*
300300
* @return string
301301
*/
302-
public function getXMLFromResult(ResultInterface $query, $params = [])
302+
public function getXMLFromResult(ResultInterface $query, array $params = []): string
303303
{
304304
// Set our default values
305305
foreach (['root' => 'root', 'element' => 'element', 'newline' => "\n", 'tab' => "\t"] as $key => $val)
@@ -336,7 +336,7 @@ public function getXMLFromResult(ResultInterface $query, $params = [])
336336
/**
337337
* Database Backup
338338
*
339-
* @param array $params
339+
* @param array|string $params
340340
* @return mixed
341341
* @throws \CodeIgniter\Database\Exceptions\DatabaseException
342342
*/
@@ -390,7 +390,7 @@ public function backup($params = [])
390390
// Is the encoder supported? If not, we'll either issue an
391391
// error or use plain text depending on the debug settings
392392
if (($prefs['format'] === 'gzip' && ! function_exists('gzencode'))
393-
|| ( $prefs['format'] === 'zip' && ! function_exists('gzcompress')))
393+
|| ( $prefs['format'] === 'zip' && ! function_exists('gzcompress')))
394394
{
395395
if ($this->db->DBDebug)
396396
{
@@ -407,7 +407,7 @@ public function backup($params = [])
407407
if ($prefs['filename'] === '')
408408
{
409409
$prefs['filename'] = (count($prefs['tables']) === 1 ? $prefs['tables'] : $this->db->database)
410-
. date('Y-m-d_H-i', time()) . '.sql';
410+
. date('Y-m-d_H-i', time()) . '.sql';
411411
}
412412
else
413413
{

system/Database/MySQLi/Utils.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,12 +38,13 @@
3838

3939
namespace CodeIgniter\Database\MySQLi;
4040

41+
use CodeIgniter\Database\BaseUtils;
4142
use CodeIgniter\Database\Exceptions\DatabaseException;
4243

4344
/**
4445
* Utils for MySQLi
4546
*/
46-
class Utils extends \CodeIgniter\Database\BaseUtils
47+
class Utils extends BaseUtils
4748
{
4849

4950
/**

system/Database/Postgre/Utils.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,12 +37,13 @@
3737

3838
namespace CodeIgniter\Database\Postgre;
3939

40+
use CodeIgniter\Database\BaseUtils;
4041
use CodeIgniter\Database\Exceptions\DatabaseException;
4142

4243
/**
4344
* Utils for Postgre
4445
*/
45-
class Utils extends \CodeIgniter\Database\BaseUtils
46+
class Utils extends BaseUtils
4647
{
4748

4849
/**

system/Database/SQLite3/Utils.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,12 +38,13 @@
3838

3939
namespace CodeIgniter\Database\SQLite3;
4040

41+
use CodeIgniter\Database\BaseUtils;
4142
use CodeIgniter\Database\Exceptions\DatabaseException;
4243

4344
/**
4445
* Utils for SQLite3
4546
*/
46-
class Utils extends \CodeIgniter\Database\BaseUtils
47+
class Utils extends BaseUtils
4748
{
4849

4950
/**

0 commit comments

Comments
 (0)