diff --git a/core/includes/schema.inc b/core/includes/schema.inc index cbbc6389b5..ce2217d055 100644 --- a/core/includes/schema.inc +++ b/core/includes/schema.inc @@ -76,13 +76,12 @@ function drupal_get_schema_versions($module) { * * @return string|int * The currently installed schema version, or - * \Drupal\Core\Extension\SchemaInstallerInterface::UNINSTALLED if the module - * is not installed. + * SchemaInstallerInterface::UNINSTALLED if the module is not installed. * * @deprecated in Drupal 8.8.0 and will be removed before Drupal 9.0.0. Use - * \Drupal\Core\Extension\SchemaInstallerInterface::getInstalledVersion() - * instead. + * SchemaInstallerInterface::getInstalledVersion() instead. * + * @see Drupal\Core\Extension\SchemaInstallerInterface * @see https://www.drupal.org/node/2970993 */ function drupal_get_installed_schema_version($module, $reset = FALSE, $array = FALSE) { @@ -99,9 +98,9 @@ function drupal_get_installed_schema_version($module, $reset = FALSE, $array = F * The new schema version. * * @deprecated in Drupal 8.8.0 and will be removed before Drupal 9.0.0. Use - * \Drupal\Core\Extension\SchemaInstallerInterface::setInstalledVersion() - * instead. + * SchemaInstallerInterface::setInstalledVersion() instead. * + * @see Drupal\Core\Extension\SchemaInstallerInterface * @see https://www.drupal.org/node/2970993 */ function drupal_set_installed_schema_version($module, $version) { @@ -116,8 +115,9 @@ function drupal_set_installed_schema_version($module, $version) { * The module for which the tables will be created. * * @deprecated in Drupal 8.8.0 and will be removed before Drupal 9.0.0. Use - * \Drupal\Core\Extension\SchemaInstallerInterface::install() instead. + * SchemaInstallerInterface::install() instead. * + * @see \Drupal\Core\Extension\SchemaInstallerInterface * @see https://www.drupal.org/node/2970993 */ function drupal_install_schema($module) { @@ -132,8 +132,9 @@ function drupal_install_schema($module) { * The module for which the tables will be removed. * * @deprecated in Drupal 8.8.0 and will be removed before Drupal 9.0.0. Use - * \Drupal\Core\Extension\SchemaInstallerInterface::uninstall() instead. + * SchemaInstallerInterface::uninstall() instead. * + * @see \Drupal\Core\Extension\SchemaInstallerInterface * @see https://www.drupal.org/node/2970993 */ function drupal_uninstall_schema($module) { @@ -155,8 +156,9 @@ function drupal_uninstall_schema($module) { * is returned. * * @deprecated in Drupal 8.8.0 and will be removed before Drupal 9.0.0. Use - * \Drupal\Core\Extension\SchemaInstallerInterface::getSchema() instead. + * SchemaInstallerInterface::getSchema() instead. * + * @see \Drupal\Core\Extension\SchemaInstallerInterface * @see https://www.drupal.org/node/2970993 */ function drupal_get_module_schema($module, $table = NULL) { diff --git a/core/lib/Drupal/Core/Extension/ModuleInstaller.php b/core/lib/Drupal/Core/Extension/ModuleInstaller.php index 8f3e0e6b3c..a472c84379 100644 --- a/core/lib/Drupal/Core/Extension/ModuleInstaller.php +++ b/core/lib/Drupal/Core/Extension/ModuleInstaller.php @@ -67,7 +67,7 @@ class ModuleInstaller implements ModuleInstallerInterface { * @param \Drupal\Core\DrupalKernelInterface $kernel * The drupal kernel. * @param \Drupal\Core\Extension\SchemaInstallerInterface|null $schema_installer - * The schema installer service. + * (optional) The schema installer service. * * @see \Drupal\Core\DrupalKernel * @see \Drupal\Core\CoreServiceProvider @@ -77,6 +77,7 @@ public function __construct($root, ModuleHandlerInterface $module_handler, Drupa $this->moduleHandler = $module_handler; $this->kernel = $kernel; if (!$schema_installer) { + @trigger('Calling ModuleInstaller::constructor() with the $schema_installer argument is supported in Drupal 8.8.0 and will be required in Drupal 9.0.0. See https://www.drupal.org/project/drupal/issues/2908886', E_USER_DEPRECATED); $schema_installer = \Drupal::service('schema_installer'); } $this->schemaInstaller = $schema_installer; diff --git a/core/lib/Drupal/Core/Extension/SchemaInstaller.php b/core/lib/Drupal/Core/Extension/SchemaInstaller.php index 3acdf4b3cb..a66d52139f 100644 --- a/core/lib/Drupal/Core/Extension/SchemaInstaller.php +++ b/core/lib/Drupal/Core/Extension/SchemaInstaller.php @@ -185,7 +185,7 @@ public function getSchema($module, $table = NULL) { * tables and fields to improve performance of serialize() and * unserialize(). Defaults to TRUE. */ - private function initialize(&$schema, $module, $remove_descriptions = TRUE) { + private function initialize(array &$schema, $module, $remove_descriptions = TRUE) { // Set the name and module key for all tables. foreach ($schema as $name => &$table) { if (empty($table['module'])) {