--- /dev/fd/63	2025-06-25 14:49:02.177900929 +1000
+++ /dev/fd/62	2025-06-25 14:49:02.177900929 +1000
@@ -8,7 +8,7 @@
  *
  * @see \Drupal\node\Controller\NodeController::addPage()
  */
-function template_preprocess_node_add_list(&$variables): void {
+  public function preprocessNodeAddList(&$variables): void {
   $variables['types'] = [];
   if (!empty($variables['content'])) {
     foreach ($variables['content'] as $type) {
@@ -21,29 +21,29 @@ function template_preprocess_node_add_li
       ];
     }
   }
-}
+  }
 
-/**
+  /**
  * Implements hook_preprocess_HOOK() for HTML document templates.
  */
-function node_preprocess_html(&$variables): void {
+  #[Hook('preprocess_html')]
+  public function preprocessHtml(&$variables): void {
   // If on an individual node page or node preview page, add the node type to
   // the body classes.
-  if (($node = \Drupal::routeMatch()->getParameter('node')) || ($node = \Drupal::routeMatch()->getParameter('node_preview'))) {
+    if (($node = $this->routeMatch->getParameter('node')) || ($node = $this->routeMatch->getParameter('node_preview'))) {
     if ($node instanceof NodeInterface) {
       $variables['node_type'] = $node->getType();
     }
   }
-}
+  }
 
-/**
+  /**
  * Implements hook_preprocess_HOOK() for block templates.
  */
-function node_preprocess_block(&$variables): void {
+  #[Hook('preprocess_block')]
+  public function preprocessBlock(&$variables): void {
   if ($variables['configuration']['provider'] == 'node') {
     switch ($variables['elements']['#plugin_id']) {
       case 'node_syndicate_block':
         $variables['attributes']['role'] = 'complementary';
         break;
-    }
-  }
--- /dev/fd/63	2025-06-25 14:49:02.181900933 +1000
+++ /dev/fd/62	2025-06-25 14:49:02.182900933 +1000
@@ -1,6 +1,7 @@
  * Implements hook_theme_suggestions_HOOK().
  */
-function node_theme_suggestions_node(array $variables): array {
+  #[Hook('theme_suggestions_node')]
+  public function themeSuggestionsNode(array $variables): array {
   $suggestions = [];
   $node = $variables['elements']['#node'];
   $sanitized_view_mode = strtr($variables['elements']['#view_mode'], '.', '_');
--- /dev/fd/63	2025-06-25 14:49:02.185900936 +1000
+++ /dev/fd/62	2025-06-25 14:49:02.186900937 +1000
@@ -24,15 +24,15 @@
  * @see hook_entity_type_build()
  * @see \Drupal\Core\Field\BaseFieldDefinition::setDisplayConfigurable()
  */
-function template_preprocess_node(&$variables): void {
+  public function preprocessNode(&$variables): void {
   $variables['view_mode'] = $variables['elements']['#view_mode'];
 
   // The teaser variable is deprecated.
   $variables['deprecations']['teaser'] = "'teaser' is deprecated in drupal:11.1.0 and is removed in drupal:12.0.0. Use 'view_mode' instead. See https://www.drupal.org/node/3458185";
   $variables['teaser'] = $variables['view_mode'] == 'teaser';
 
-  // The 'metadata' variable was originally added to support RDF, which has now
-  // been moved to contrib. It was needed because it is not possible to
+    // The 'metadata' variable was originally added to support RDF, which has
+    // now been moved to contrib. It was needed because it is not possible to
   // extend the markup of the 'submitted' variable generically.
   $variables['deprecations']['metadata'] = "'metadata' is deprecated in drupal:11.1.0 and is removed in drupal:12.0.0. There is no replacement. See https://www.drupal.org/node/3458638";
 
@@ -49,9 +49,9 @@ function template_preprocess_node(&$vari
   //   $variables['content'] is more flexible and consistent.
   $submitted_configurable = $node->getFieldDefinition('created')->isDisplayConfigurable('view') || $node->getFieldDefinition('uid')->isDisplayConfigurable('view');
   if (!$skip_custom_preprocessing || !$submitted_configurable) {
-    $variables['date'] = \Drupal::service('renderer')->render($variables['elements']['created']);
+      $variables['date'] = $this->renderer->render($variables['elements']['created']);
     unset($variables['elements']['created']);
-    $variables['author_name'] = \Drupal::service('renderer')->render($variables['elements']['uid']);
+      $variables['author_name'] = $this->renderer->render($variables['elements']['uid']);
     unset($variables['elements']['uid']);
   }
 
@@ -77,8 +77,8 @@ function template_preprocess_node(&$vari
     // Display post information on certain node types. This only occurs if
     // custom preprocessing occurred for both of the created and uid fields.
     // @todo https://www.drupal.org/project/drupal/issues/3015623
-    //   Eventually delete this code and matching template lines. Using a field
-    //   formatter is more flexible and consistent.
+      //   Eventually delete this code and matching template lines. Using a
+      //   field formatter is more flexible and consistent.
     $node_type = $node->type->entity;
     $variables['author_attributes'] = new Attribute();
     $variables['display_submitted'] = $node_type->displaySubmitted();
@@ -89,7 +89,7 @@ function template_preprocess_node(&$vari
         // view mode might not be configured, so remember to always check the
         // theme setting first.
         if ($node_owner = $node->getOwner()) {
-          $variables['author_picture'] = \Drupal::entityTypeManager()
+            $variables['author_picture'] = $this->entityTypeManager
             ->getViewBuilder('user')
             ->view($node_owner, 'compact');
         }
