You've already forked postfixadmin
mirror of
https://github.com/postfixadmin/postfixadmin.git
synced 2025-08-09 05:02:44 +03:00
improve typehints on db_insert (requires php7)
This commit is contained in:
@@ -1901,7 +1901,7 @@ function db_delete($table, $where, $delete, $additionalwhere='') {
|
||||
* @param boolean $throw_exceptions
|
||||
* @return int - number of inserted rows
|
||||
*/
|
||||
function db_insert($table, array $values, $timestamp = array('created', 'modified'), $throw_exceptions = false) {
|
||||
function db_insert(string $table, array $values, array $timestamp = array('created', 'modified'), bool $throw_exceptions = false) : int {
|
||||
$table = table_by_key($table);
|
||||
|
||||
foreach ($timestamp as $key) {
|
||||
@@ -1926,7 +1926,6 @@ function db_insert($table, array $values, $timestamp = array('created', 'modifie
|
||||
$comma = ',';
|
||||
}
|
||||
|
||||
|
||||
return db_execute(
|
||||
"INSERT INTO $table (" . implode(",", array_keys($values)) .") VALUES ($value_string)",
|
||||
$prepared_statment_values,
|
||||
|
Reference in New Issue
Block a user