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

Database typos changes #1938

Merged
merged 16 commits into from
Apr 11, 2019
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
Prev Previous commit
Next Next commit
Database Utils typos changes
  • Loading branch information
atishhamte committed Apr 11, 2019
commit a45a605b60dad38f91a00152193c7cde27caf6bc
18 changes: 9 additions & 9 deletions system/Database/BaseUtils.php
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ public function listDatabases()
* @param string $database_name
* @return boolean
*/
public function databaseExists($database_name)
public function databaseExists(string $database_name): bool
{
return in_array($database_name, $this->listDatabases());
}
Expand All @@ -147,10 +147,10 @@ public function databaseExists($database_name)
* Optimize Table
*
* @param string $table_name
* @return boolean|mixed
* @return mixed
* @throws \CodeIgniter\Database\Exceptions\DatabaseException
*/
public function optimizeTable($table_name)
public function optimizeTable(string $table_name)
{
if ($this->optimizeTable === false)
{
Expand Down Expand Up @@ -231,7 +231,7 @@ public function optimizeDatabase()
* @return mixed
* @throws \CodeIgniter\Database\Exceptions\DatabaseException
*/
public function repairTable($table_name)
public function repairTable(string $table_name)
{
if ($this->repairTable === false)
{
Expand Down Expand Up @@ -264,7 +264,7 @@ public function repairTable($table_name)
*
* @return string
*/
public function getCSVFromResult(ResultInterface $query, $delim = ',', $newline = "\n", $enclosure = '"')
public function getCSVFromResult(ResultInterface $query, string $delim = ',', string $newline = "\n", string $enclosure = '"')
{
$out = '';
// First generate the headings from the table column names
Expand Down Expand Up @@ -299,7 +299,7 @@ public function getCSVFromResult(ResultInterface $query, $delim = ',', $newline
*
* @return string
*/
public function getXMLFromResult(ResultInterface $query, $params = [])
public function getXMLFromResult(ResultInterface $query, array $params = []): string
{
// Set our default values
foreach (['root' => 'root', 'element' => 'element', 'newline' => "\n", 'tab' => "\t"] as $key => $val)
Expand Down Expand Up @@ -336,7 +336,7 @@ public function getXMLFromResult(ResultInterface $query, $params = [])
/**
* Database Backup
*
* @param array $params
* @param array|string $params
* @return mixed
* @throws \CodeIgniter\Database\Exceptions\DatabaseException
*/
Expand Down Expand Up @@ -390,7 +390,7 @@ public function backup($params = [])
// Is the encoder supported? If not, we'll either issue an
// error or use plain text depending on the debug settings
if (($prefs['format'] === 'gzip' && ! function_exists('gzencode'))
|| ( $prefs['format'] === 'zip' && ! function_exists('gzcompress')))
|| ( $prefs['format'] === 'zip' && ! function_exists('gzcompress')))
{
if ($this->db->DBDebug)
{
Expand All @@ -407,7 +407,7 @@ public function backup($params = [])
if ($prefs['filename'] === '')
{
$prefs['filename'] = (count($prefs['tables']) === 1 ? $prefs['tables'] : $this->db->database)
. date('Y-m-d_H-i', time()) . '.sql';
. date('Y-m-d_H-i', time()) . '.sql';
}
else
{
Expand Down
3 changes: 2 additions & 1 deletion system/Database/MySQLi/Utils.php
Original file line number Diff line number Diff line change
Expand Up @@ -38,12 +38,13 @@

namespace CodeIgniter\Database\MySQLi;

use CodeIgniter\Database\BaseUtils;
use CodeIgniter\Database\Exceptions\DatabaseException;

/**
* Utils for MySQLi
*/
class Utils extends \CodeIgniter\Database\BaseUtils
class Utils extends BaseUtils
{

/**
Expand Down
3 changes: 2 additions & 1 deletion system/Database/Postgre/Utils.php
Original file line number Diff line number Diff line change
Expand Up @@ -37,12 +37,13 @@

namespace CodeIgniter\Database\Postgre;

use CodeIgniter\Database\BaseUtils;
use CodeIgniter\Database\Exceptions\DatabaseException;

/**
* Utils for Postgre
*/
class Utils extends \CodeIgniter\Database\BaseUtils
class Utils extends BaseUtils
{

/**
Expand Down
3 changes: 2 additions & 1 deletion system/Database/SQLite3/Utils.php
Original file line number Diff line number Diff line change
Expand Up @@ -38,12 +38,13 @@

namespace CodeIgniter\Database\SQLite3;

use CodeIgniter\Database\BaseUtils;
use CodeIgniter\Database\Exceptions\DatabaseException;

/**
* Utils for SQLite3
*/
class Utils extends \CodeIgniter\Database\BaseUtils
class Utils extends BaseUtils
{

/**
Expand Down