From 541f985cc5660439ca5b117b17f962ed1bda43b8 Mon Sep 17 00:00:00 2001
From: Lee Rowlands <lee.rowlands@previousnext.com.au>
Date: Fri, 3 Jan 2025 14:07:10 +1000
Subject: [PATCH] Issue #3495506 by nicxvan, deepali sardana, dww, bramdriesen:
 Mark Update module procedural hooks as converted

---
 core/modules/update/update.authorize.inc | 2 ++
 core/modules/update/update.compare.inc   | 2 ++
 core/modules/update/update.fetch.inc     | 2 ++
 core/modules/update/update.install       | 2 ++
 core/modules/update/update.manager.inc   | 2 ++
 core/modules/update/update.module        | 2 ++
 core/modules/update/update.report.inc    | 2 ++
 7 files changed, 14 insertions(+)

diff --git a/core/modules/update/update.authorize.inc b/core/modules/update/update.authorize.inc
index 6883f7207171..303db3fc5c15 100644
--- a/core/modules/update/update.authorize.inc
+++ b/core/modules/update/update.authorize.inc
@@ -5,6 +5,7 @@
  */
 
 use Drupal\Core\Batch\BatchBuilder;
+use Drupal\Core\Hook\Attribute\StopProceduralHookScan;
 use Drupal\Core\Updater\UpdaterException;
 use Drupal\Core\Url;
 
@@ -30,6 +31,7 @@
  *   an instance of \Symfony\Component\HttpFoundation\Response the calling code
  *   should use that response for the current page request.
  */
+#[StopProceduralHookScan]
 function update_authorize_run_update($filetransfer, $projects) {
   $batch_builder = (new BatchBuilder())
     ->setFile(\Drupal::service('extension.list.module')->getPath('update') . '/update.authorize.inc')
diff --git a/core/modules/update/update.compare.inc b/core/modules/update/update.compare.inc
index c5ca79e46ae3..545556e10ba9 100644
--- a/core/modules/update/update.compare.inc
+++ b/core/modules/update/update.compare.inc
@@ -5,6 +5,7 @@
  */
 
 use Drupal\Core\Extension\ExtensionVersion;
+use Drupal\Core\Hook\Attribute\StopProceduralHookScan;
 use Drupal\Core\Utility\Error;
 use Drupal\update\ProjectRelease;
 use Drupal\update\UpdateFetcherInterface;
@@ -22,6 +23,7 @@
  *   Array of project information from
  *   \Drupal\update\UpdateManager::getProjects().
  */
+#[StopProceduralHookScan]
 function update_process_project_info(&$projects) {
   foreach ($projects as $key => $project) {
     // Assume an official release until we see otherwise.
diff --git a/core/modules/update/update.fetch.inc b/core/modules/update/update.fetch.inc
index 0056bb8ea3e4..063b9743b238 100644
--- a/core/modules/update/update.fetch.inc
+++ b/core/modules/update/update.fetch.inc
@@ -4,6 +4,7 @@
  * @file
  */
 
+use Drupal\Core\Hook\Attribute\StopProceduralHookScan;
 use Drupal\update\UpdateManagerInterface;
 
 /**
@@ -15,6 +16,7 @@
  *
  * @see update_requirements()
  */
+#[StopProceduralHookScan]
 function _update_cron_notify() {
   $update_config = \Drupal::config('update.settings');
   \Drupal::moduleHandler()->loadInclude('update', 'install');
diff --git a/core/modules/update/update.install b/core/modules/update/update.install
index ad1f9bc20ee0..694fe84af710 100644
--- a/core/modules/update/update.install
+++ b/core/modules/update/update.install
@@ -5,6 +5,7 @@
  * Install, update, and uninstall functions for the Update Manager module.
  */
 
+use Drupal\Core\Hook\Attribute\StopProceduralHookScan;
 use Drupal\Core\Link;
 use Drupal\Core\Url;
 use Drupal\update\ProjectSecurityData;
@@ -73,6 +74,7 @@ function update_requirements($phase) {
 /**
  * Implements hook_install().
  */
+#[StopProceduralHookScan]
 function update_install(): void {
   $queue = \Drupal::queue('update_fetch_tasks', TRUE);
   $queue->createQueue();
diff --git a/core/modules/update/update.manager.inc b/core/modules/update/update.manager.inc
index ba3632e97e36..8598e51b6c2f 100644
--- a/core/modules/update/update.manager.inc
+++ b/core/modules/update/update.manager.inc
@@ -7,6 +7,7 @@
 use Drupal\Core\File\Exception\FileException;
 use Drupal\Core\File\Exception\InvalidStreamWrapperException;
 use Drupal\Core\File\FileExists;
+use Drupal\Core\Hook\Attribute\StopProceduralHookScan;
 use Drupal\Core\Url;
 use Psr\Http\Client\ClientExceptionInterface;
 use Symfony\Component\HttpFoundation\RedirectResponse;
@@ -19,6 +20,7 @@
  * @param array $results
  *   An associative array of results from the batch operation.
  */
+#[StopProceduralHookScan]
 function update_manager_download_batch_finished($success, $results) {
   if (!empty($results['errors'])) {
     $item_list = [
diff --git a/core/modules/update/update.module b/core/modules/update/update.module
index 654ce8f37faf..0ddab79fbfaf 100644
--- a/core/modules/update/update.module
+++ b/core/modules/update/update.module
@@ -5,6 +5,7 @@
  */
 
 use Drupal\Core\File\Exception\FileException;
+use Drupal\Core\Hook\Attribute\StopProceduralHookScan;
 use Drupal\Core\Link;
 use Drupal\Core\Url;
 use Drupal\Core\Site\Settings;
@@ -21,6 +22,7 @@
  *   TRUE if the current user can access the updater menu items; FALSE
  *   otherwise.
  */
+#[StopProceduralHookScan]
 function _update_manager_access() {
   return Settings::get('allow_authorize_operations', TRUE) && \Drupal::currentUser()->hasPermission('administer software updates');
 }
diff --git a/core/modules/update/update.report.inc b/core/modules/update/update.report.inc
index 75957754bd87..615e54b35b20 100644
--- a/core/modules/update/update.report.inc
+++ b/core/modules/update/update.report.inc
@@ -4,6 +4,7 @@
  * @file
  */
 
+use Drupal\Core\Hook\Attribute\StopProceduralHookScan;
 use Drupal\Core\Template\Attribute;
 use Drupal\Core\Url;
 use Drupal\update\ProjectRelease;
@@ -19,6 +20,7 @@
  *   An associative array containing:
  *   - data: An array of data about each project's status.
  */
+#[StopProceduralHookScan]
 function template_preprocess_update_report(&$variables): void {
   $data = isset($variables['data']) && is_array($variables['data']) ? $variables['data'] : [];
 
-- 
GitLab