From fe90c7e9356dbe10b499cb41323b34deb527c0c7 Mon Sep 17 00:00:00 2001 From: vibbow Date: Wed, 17 Apr 2019 23:12:45 +0800 Subject: [PATCH 1/3] Fix some side issue --- system/Database/BaseBuilder.php | 2 +- system/Database/BaseConnection.php | 16 ++++++++-------- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/system/Database/BaseBuilder.php b/system/Database/BaseBuilder.php index d62bca882fd6..15f17f8482e7 100644 --- a/system/Database/BaseBuilder.php +++ b/system/Database/BaseBuilder.php @@ -1024,7 +1024,7 @@ protected function _like($field, string $match = '', string $type = 'AND ', stri * * @return string $like_statement */ - public function _like_statement(string $prefix = null, string $column, string $not = null, string $bind, bool $insensitiveSearch = false): string + private function _like_statement(string $prefix = null, string $column, string $not = null, string $bind, bool $insensitiveSearch = false): string { $like_statement = "{$prefix} {$column} {$not} LIKE :{$bind}:"; diff --git a/system/Database/BaseConnection.php b/system/Database/BaseConnection.php index c278568f1e33..295c24ba310f 100644 --- a/system/Database/BaseConnection.php +++ b/system/Database/BaseConnection.php @@ -1247,7 +1247,7 @@ public function protectIdentifiers($item, bool $prefixSingle = false, bool $prot * * This function escapes column and table names * - * @param mixed + * @param mixed $item * * @return mixed */ @@ -1442,7 +1442,7 @@ public function escapeString($str, bool $like = false) * specific escaping for LIKE conditions * * @param string|string[] - * @return mixed + * @return string|string[] */ public function escapeLikeString($str) { @@ -1507,11 +1507,11 @@ public function callFunction(string $functionName, ...$params): bool /** * Returns an array of table names * - * @param boolean $constrain_by_prefix = FALSE + * @param boolean $constrainByPrefix = FALSE * @return boolean|array * @throws \CodeIgniter\Database\Exceptions\DatabaseException */ - public function listTables(bool $constrain_by_prefix = false) + public function listTables(bool $constrainByPrefix = false) { // Is there a cached result? if (isset($this->dataCache['table_names']) && $this->dataCache['table_names']) @@ -1519,7 +1519,7 @@ public function listTables(bool $constrain_by_prefix = false) return $this->dataCache['table_names']; } - if (false === ($sql = $this->_listTables($constrain_by_prefix))) + if (false === ($sql = $this->_listTables($constrainByPrefix))) { if ($this->DBDebug) { @@ -1567,12 +1567,12 @@ public function listTables(bool $constrain_by_prefix = false) /** * Determine if a particular table exists * - * @param string $table_name + * @param string $tableName * @return boolean */ - public function tableExists(string $table_name): bool + public function tableExists(string $tableName): bool { - return in_array($this->protectIdentifiers($table_name, true, false, false), $this->listTables()); + return in_array($this->protectIdentifiers($tableName, true, false, false), $this->listTables()); } //-------------------------------------------------------------------- From be7ce77b63ee5405271fdd38f802153fb3a9c887 Mon Sep 17 00:00:00 2001 From: vibbow Date: Wed, 17 Apr 2019 23:21:01 +0800 Subject: [PATCH 2/3] Fix _like_statement from private to protected --- system/Database/BaseBuilder.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/system/Database/BaseBuilder.php b/system/Database/BaseBuilder.php index 15f17f8482e7..fe2becf3823d 100644 --- a/system/Database/BaseBuilder.php +++ b/system/Database/BaseBuilder.php @@ -1024,7 +1024,7 @@ protected function _like($field, string $match = '', string $type = 'AND ', stri * * @return string $like_statement */ - private function _like_statement(string $prefix = null, string $column, string $not = null, string $bind, bool $insensitiveSearch = false): string + protected function _like_statement(string $prefix = null, string $column, string $not = null, string $bind, bool $insensitiveSearch = false): string { $like_statement = "{$prefix} {$column} {$not} LIKE :{$bind}:"; From 904cc343cbdc0a675e556a104560316d300414a8 Mon Sep 17 00:00:00 2001 From: vibbow Date: Thu, 18 Apr 2019 18:52:27 +0800 Subject: [PATCH 3/3] fix side issue --- system/Entity.php | 1 + 1 file changed, 1 insertion(+) diff --git a/system/Entity.php b/system/Entity.php index 6a7472a55f93..504cc81ca5ce 100644 --- a/system/Entity.php +++ b/system/Entity.php @@ -40,6 +40,7 @@ use CodeIgniter\I18n\Time; use CodeIgniter\Exceptions\CastException; +use CodeIgniter\Exceptions\EntityException; /** * Entity encapsulation, for use with CodeIgniter\Model