* name of the relevant table.
* @param array $cols
* Mixed array of columns to add or null (to check for the missing columns).
- *
- * @return bool
*/
- public function fixSchemaDifferencesFor($table, $cols = []) {
- if (empty($table)) {
- return FALSE;
+ public function fixSchemaDifferencesFor(string $table, array $cols = []): void {
+ if (!in_array($table, $this->tables, TRUE)) {
+ // Create the table if the log table does not exist and
+ // the table is in 'this->tables'. This latter array
+ // could have been altered by a hook if the site does not
+ // want to log a specific table.
+ return;
}
if (empty($this->logs[$table])) {
$this->createLogTableFor($table);
- return TRUE;
+ return;
}
if (empty($cols)) {
}
$this->resetSchemaCacheForTable("log_$table");
-
- return TRUE;
}
/**
* Get column query.
*
* @param string $col
- * @param bool $createQuery
+ * @param array $createQuery
*
* @return array|mixed|string
*/
* Get trigger info.
*
* @param array $info
- * @param null $tableName
+ * @param string|null $tableName
* @param bool $force
*/
public function triggerInfo(&$info, $tableName = NULL, $force = FALSE) {