diff --git a/core/lib/Drupal/Core/Update/UpdateRegistry.php b/core/lib/Drupal/Core/Update/UpdateRegistry.php index 8428018bbe986ed116ccb3b36ff0c0a54e704a66..212a9c73b24dafb13ac2c4d707ebcd5adaae856f 100644 --- a/core/lib/Drupal/Core/Update/UpdateRegistry.php +++ b/core/lib/Drupal/Core/Update/UpdateRegistry.php @@ -255,25 +255,6 @@ public function getUpdateFunctions($extension_name) { }); } - /** - * Returns all available updates for a given module. - * - * @param string $module_name - * The module name. - * - * @return callable[] - * A list of update functions. - * - * @deprecated in drupal:9.4.0 and is removed from drupal:10.0.0. Use - * \Drupal\Core\Update\UpdateRegistry::getUpdateFunctions() instead. - * - * @see https://www.drupal.org/node/3260162 - */ - public function getModuleUpdateFunctions($module_name) { - @trigger_error(__CLASS__ . '\getModuleUpdateFunctions() is deprecated in drupal:9.4.0 and is removed from drupal:10.0.0. Use \Drupal\Core\Update\UpdateRegistry::getUpdateFunctions() instead. See https://www.drupal.org/node/3260162', E_USER_DEPRECATED); - return $this->getUpdateFunctions($module_name); - } - /** * Scans all module, theme, and profile extensions and load the update files. */ @@ -304,23 +285,6 @@ public function filterOutInvokedUpdatesByExtension(string $extension) { $this->keyValue->set('existing_updates', array_values($remaining_update_functions)); } - /** - * Filters out already executed update functions by module. - * - * @param string $module - * The module name. - * - * @deprecated in drupal:9.4.0 and is removed from drupal:10.0.0. Use - * \Drupal\Core\Update\UpdateRegistry::filterOutInvokedUpdatesByExtension() - * instead. - * - * @see https://www.drupal.org/node/3260162 - */ - public function filterOutInvokedUpdatesByModule($module) { - @trigger_error(__CLASS__ . '\filterOutInvokedUpdatesByModule() is deprecated in drupal:9.4.0 and is removed from drupal:10.0.0. Use \Drupal\Core\Update\UpdateRegistry::filterOutInvokedUpdatesByExtension() instead. See https://www.drupal.org/node/3260162', E_USER_DEPRECATED); - $this->filterOutInvokedUpdatesByExtension($module); - } - /** * @return bool */ diff --git a/core/modules/update/src/Controller/UpdateController.php b/core/modules/update/src/Controller/UpdateController.php index aba3c1ed25ad2f5de471d9c04d0dfd5486ddc871..9873f894dc8f9c4065aaa3d1cd2289b532c70e30 100644 --- a/core/modules/update/src/Controller/UpdateController.php +++ b/core/modules/update/src/Controller/UpdateController.php @@ -33,15 +33,11 @@ class UpdateController extends ControllerBase { * * @param \Drupal\update\UpdateManagerInterface $update_manager * Update Manager Service. - * @param \Drupal\Core\Render\RendererInterface|null $renderer + * @param \Drupal\Core\Render\RendererInterface $renderer * The renderer. */ - public function __construct(UpdateManagerInterface $update_manager, RendererInterface $renderer = NULL) { + public function __construct(UpdateManagerInterface $update_manager, RendererInterface $renderer) { $this->updateManager = $update_manager; - if (is_null($renderer)) { - @trigger_error('The renderer service should be passed to UpdateController::__construct() since 9.1.0. This will be required in Drupal 10.0.0. See https://www.drupal.org/node/3179315', E_USER_DEPRECATED); - $renderer = \Drupal::service('renderer'); - } $this->renderer = $renderer; } diff --git a/core/modules/update/src/UpdateFetcher.php b/core/modules/update/src/UpdateFetcher.php index b103f25c7b5c5abd950242bd1e46bf182d8a674f..3bec19dc9e2534589b5ed4992eefafcfe3f7c3db 100644 --- a/core/modules/update/src/UpdateFetcher.php +++ b/core/modules/update/src/UpdateFetcher.php @@ -55,17 +55,13 @@ class UpdateFetcher implements UpdateFetcherInterface { * The config factory. * @param \GuzzleHttp\ClientInterface $http_client * A Guzzle client object. - * @param \Drupal\Core\Site\Settings|null $settings + * @param \Drupal\Core\Site\Settings $settings * The settings instance. */ - public function __construct(ConfigFactoryInterface $config_factory, ClientInterface $http_client, Settings $settings = NULL) { + public function __construct(ConfigFactoryInterface $config_factory, ClientInterface $http_client, Settings $settings) { $this->fetchUrl = $config_factory->get('update.settings')->get('fetch.url'); $this->httpClient = $http_client; $this->updateSettings = $config_factory->get('update.settings'); - if (is_null($settings)) { - @trigger_error('The settings service should be passed to UpdateFetcher::__construct() since 9.1.0. This will be required in Drupal 10.0.0. See https://www.drupal.org/node/3179315', E_USER_DEPRECATED); - $settings = \Drupal::service('settings'); - } $this->withHttpFallback = $settings->get('update_fetch_with_http_fallback', FALSE); } diff --git a/core/tests/Drupal/Tests/Core/Update/UpdateRegistryTest.php b/core/tests/Drupal/Tests/Core/Update/UpdateRegistryTest.php index e432d678b729d8e2cb4c9a19d20bd9ba4036d0ee..f1ff0e0ed9bf3eb9a347536a7f6535bf8134434c 100644 --- a/core/tests/Drupal/Tests/Core/Update/UpdateRegistryTest.php +++ b/core/tests/Drupal/Tests/Core/Update/UpdateRegistryTest.php @@ -342,24 +342,6 @@ public function testGetUpdateFunctions() { $this->assertEquals(['theme_d_post_update_b', 'theme_d_post_update_c'], array_values($update_registry->getUpdateFunctions('theme_d'))); } - /** - * @covers ::getModuleUpdateFunctions - * @group legacy - */ - public function testGetModuleUpdateFunctions() { - $this->expectDeprecation('Drupal\Core\Update\UpdateRegistry\getModuleUpdateFunctions() is deprecated in drupal:9.4.0 and is removed from drupal:10.0.0. Use \Drupal\Core\Update\UpdateRegistry::getUpdateFunctions() instead. See https://www.drupal.org/node/3260162'); - $this->setupBasicExtensions(); - $key_value = $this->prophesize(KeyValueStoreInterface::class)->reveal(); - - $update_registry = new UpdateRegistry('vfs://drupal', 'sites/default', [ - 'module_a', - 'module_b', - ], $key_value, FALSE); - - $this->assertEquals(['module_a_post_update_a', 'module_a_post_update_b'], array_values($update_registry->getModuleUpdateFunctions('module_a'))); - $this->assertEquals(['module_b_post_update_a'], array_values($update_registry->getModuleUpdateFunctions('module_b'))); - } - /** * @covers ::registerInvokedUpdates */ @@ -448,28 +430,4 @@ public function testFilterOutInvokedUpdatesByExtension() { $update_registry->filterOutInvokedUpdatesByExtension('module_a'); } - /** - * @covers ::filterOutInvokedUpdatesByModule - * @group legacy - */ - public function testFilterOutInvokedUpdatesByModule() { - $this->expectDeprecation('Drupal\Core\Update\UpdateRegistry\filterOutInvokedUpdatesByModule() is deprecated in drupal:9.4.0 and is removed from drupal:10.0.0. Use \Drupal\Core\Update\UpdateRegistry::filterOutInvokedUpdatesByExtension() instead. See https://www.drupal.org/node/3260162'); - $this->setupBasicExtensions(); - $key_value = $this->prophesize(KeyValueStoreInterface::class); - $key_value->get('existing_updates', []) - ->willReturn(['module_a_post_update_b', 'module_a_post_update_a', 'module_b_post_update_a']) - ->shouldBeCalledTimes(1); - $key_value->set('existing_updates', ['module_b_post_update_a']) - ->willReturn(NULL) - ->shouldBeCalledTimes(1); - $key_value = $key_value->reveal(); - - $update_registry = new UpdateRegistry('vfs://drupal', 'sites/default', [ - 'module_a', - 'module_b', - ], $key_value, FALSE); - - $update_registry->filterOutInvokedUpdatesByModule('module_a'); - } - }