}
- $sql = sprintf("%s INDEX `%s` (%s)", $method, DBA::escape($indexName), $names);
- return ($sql);
+ return sprintf("%s INDEX `%s` (%s)", $method, DBA::escape($indexName), $names);
}
/**
* @return string Empty string if the update is successful, error messages otherwise
* @throws Exception
*/
- public static function performUpdate(bool $enable_maintenance_mode = true, bool $verbose = false)
+ public static function performUpdate(bool $enable_maintenance_mode = true, bool $verbose = false): string
{
if ($enable_maintenance_mode) {
DI::config()->set('system', 'maintenance', 1);
* @return string Empty string if the update is successful, error messages otherwise
* @throws Exception
*/
- public static function install(string $basePath)
+ public static function install(string $basePath): string
{
return self::update($basePath, false, true, true);
}
* @return string Empty string if the update is successful, error messages otherwise
* @throws Exception
*/
- private static function update($basePath, $verbose, $action, $install = false, array $tables = null, array $definition = null)
+ private static function update(string $basePath, bool $verbose, bool $action, bool $install = false, array $tables = null, array $definition = null): string
{
$in_maintenance_mode = DI::config()->get('system', 'maintenance');
return $errors;
}
- private static function tableStructure($table)
+ /**
+ * Returns an array with table structure information
+ *
+ * @param string $table Name of table
+ * @return array Table structure information
+ */
+ private static function tableStructure(string $table): array
{
// This query doesn't seem to be executable as a prepared statement
$indexes = DBA::toArray(DBA::p("SHOW INDEX FROM " . DBA::quoteIdentifier($table)));