@@ -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 {
0 commit comments