diff --git a/core/includes/common.inc b/core/includes/common.inc index 95b9ffae5c..d522615f00 100644 --- a/core/includes/common.inc +++ b/core/includes/common.inc @@ -1239,10 +1239,10 @@ function archiver_get_extensions() { * If a remote stream wrapper path was passed. * * @deprecated in Drupal 8.5.x, will be removed before Drupal 9.0.0. Use - * \Drupal::service('plugin.manager.archiver')->getArchiver() instead. + * \Drupal::service('plugin.manager.archiver')->getArchiverByFile() instead. */ function archiver_get_archiver($file) { - return \Drupal::service('plugin.manager.archiver')->getArchiver($file); + return \Drupal::service('plugin.manager.archiver')->getArchiverByFile($file); } /** diff --git a/core/lib/Drupal/Core/Archiver/ArchiverManager.php b/core/lib/Drupal/Core/Archiver/ArchiverManager.php index 5894c73ab3..910da6d0cd 100644 --- a/core/lib/Drupal/Core/Archiver/ArchiverManager.php +++ b/core/lib/Drupal/Core/Archiver/ArchiverManager.php @@ -108,7 +108,7 @@ public function getExtensions() { * @throws \Exception * If a remote stream wrapper path was passed. */ - public function getArchiver($file) { + public function getArchiverByFile($file) { // Archivers can only work on local paths $filepath = $this->fileSystem->realpath($file); if (!is_file($filepath)) { diff --git a/core/modules/update/update.manager.inc b/core/modules/update/update.manager.inc index 399694f2c7..76095b2c6b 100644 --- a/core/modules/update/update.manager.inc +++ b/core/modules/update/update.manager.inc @@ -142,13 +142,14 @@ function _update_manager_check_backends(&$form, $operation) { * @param string $directory * The directory you wish to extract the archive into. * - * @return Archiver + * @return \Drupal\Core\Archiver\ArchiverInterface * The Archiver object used to extract the archive. * * @throws Exception */ function update_manager_archive_extract($file, $directory) { - $archiver = archiver_get_archiver($file); + /** @var \Drupal\Core\Archiver\ArchiverInterface $archiver */ + $archiver = \Drupal::service('plugin.manager.archiver')->getArchiverByFile($file); if (!$archiver) { throw new Exception(t('Cannot extract %file, not a valid archive.', ['%file' => $file])); }