diff --git a/pdb.module b/pdb.module
index 2c7112a..888d021 100644
--- a/pdb.module
+++ b/pdb.module
@@ -1,5 +1,12 @@
 <?php
 
+/**
+ * @file
+ */
+
+use Drupal\Core\Hook\Attribute\LegacyHook;
+use Drupal\pdb\Hook\PdbHooks;
+
 /**
  * @file
  * PDB Module.
@@ -8,70 +15,9 @@
 /**
  * Implements hook_library_info_build().
  */
+#[LegacyHook]
 function pdb_library_info_build() {
-  $libraries = [];
-
-  $discovery = \Drupal::service('pdb.component_discovery');
-  $components = $discovery->getComponents();
-
-  foreach ($components as $component) {
-    $info = $component->info;
-    $path = $component->getPath();
-
-    $library_header = [];
-    $library_footer = [];
-
-    if (isset($info['add_css'])) {
-      // Build the css assets, grouping them by header and footer.
-      $css_assets = _pdb_library_build_css($info, $path);
-      if (!empty($css_assets)) {
-        if (!empty($css_assets['header'])) {
-          $library_header += $css_assets['header'];
-        }
-
-        if (!empty($css_assets['footer'])) {
-          $library_footer += $css_assets['footer'];
-        }
-      }
-    }
-
-    if (isset($info['add_js'])) {
-      // Build the js assets, grouping them by header and footer.
-      $js_assets = _pdb_library_build_js($info, $path);
-      if (!empty($js_assets)) {
-        if (!empty($js_assets['header'])) {
-          $library_header += $js_assets['header'];
-        }
-
-        if (!empty($js_assets['footer'])) {
-          $library_footer += $js_assets['footer'];
-        }
-      }
-    }
-
-    $pres = $info['presentation'];
-    $pres_library = ['pdb_' . $pres . '/' . $pres];
-
-    // Build a library to include assets in header.
-    if (!empty($library_header)) {
-      $library_header['header'] = TRUE;
-
-      $library_header['dependencies'] = $library_header['dependencies'] ?? [];
-      $library_header['dependencies'] = array_merge($library_header['dependencies'], $pres_library);
-
-      $libraries += [$info['machine_name'] . '/header' => $library_header];
-    }
-
-    // Build a library to include assets in footer.
-    if (!empty($library_footer)) {
-      $library_footer['dependencies'] = $library_footer['dependencies'] ?? [];
-      $library_footer['dependencies'] = array_merge($library_footer['dependencies'], $pres_library);
-
-      $libraries += [$info['machine_name'] . '/footer' => $library_footer];
-    }
-  }
-
-  return $libraries;
+  return \Drupal::service(PdbHooks::class)->libraryInfoBuild();
 }
 
 /**
diff --git a/pdb.services.yml b/pdb.services.yml
index 16009bd..a7b1a5b 100644
--- a/pdb.services.yml
+++ b/pdb.services.yml
@@ -6,3 +6,7 @@ services:
       - '@event_dispatcher'
       - '@module_handler'
     public: true
+
+  Drupal\pdb\Hook\PdbHooks:
+    class: Drupal\pdb\Hook\PdbHooks
+    autowire: true
diff --git a/src/Hook/PdbHooks.php b/src/Hook/PdbHooks.php
new file mode 100644
index 0000000..539c8e2
--- /dev/null
+++ b/src/Hook/PdbHooks.php
@@ -0,0 +1,78 @@
+<?php
+
+namespace Drupal\pdb\Hook;
+
+use Drupal\Core\Hook\Attribute\Hook;
+
+/**
+ * Hook implementations for pdb.
+ */
+class PdbHooks {
+  /**
+   * @file
+   * PDB Module.
+   */
+
+  /**
+   * Implements hook_library_info_build().
+   */
+  #[Hook('library_info_build')]
+  public function libraryInfoBuild() {
+    $libraries = [];
+    $discovery = \Drupal::service('pdb.component_discovery');
+    $components = $discovery->getComponents();
+    foreach ($components as $component) {
+      $info = $component->info;
+      $path = $component->getPath();
+      $library_header = [];
+      $library_footer = [];
+      if (isset($info['add_css'])) {
+        // Build the css assets, grouping them by header and footer.
+        $css_assets = _pdb_library_build_css($info, $path);
+        if (!empty($css_assets)) {
+          if (!empty($css_assets['header'])) {
+            $library_header += $css_assets['header'];
+          }
+          if (!empty($css_assets['footer'])) {
+            $library_footer += $css_assets['footer'];
+          }
+        }
+      }
+      if (isset($info['add_js'])) {
+        // Build the js assets, grouping them by header and footer.
+        $js_assets = _pdb_library_build_js($info, $path);
+        if (!empty($js_assets)) {
+          if (!empty($js_assets['header'])) {
+            $library_header += $js_assets['header'];
+          }
+          if (!empty($js_assets['footer'])) {
+            $library_footer += $js_assets['footer'];
+          }
+        }
+      }
+      $pres = $info['presentation'];
+      $pres_library = [
+        'pdb_' . $pres . '/' . $pres,
+      ];
+      // Build a library to include assets in header.
+      if (!empty($library_header)) {
+        $library_header['header'] = TRUE;
+        $library_header['dependencies'] = $library_header['dependencies'] ?? [];
+        $library_header['dependencies'] = array_merge($library_header['dependencies'], $pres_library);
+        $libraries += [
+          $info['machine_name'] . '/header' => $library_header,
+        ];
+      }
+      // Build a library to include assets in footer.
+      if (!empty($library_footer)) {
+        $library_footer['dependencies'] = $library_footer['dependencies'] ?? [];
+        $library_footer['dependencies'] = array_merge($library_footer['dependencies'], $pres_library);
+        $libraries += [
+          $info['machine_name'] . '/footer' => $library_footer,
+        ];
+      }
+    }
+    return $libraries;
+  }
+
+}
diff --git a/tests/src/Unit/Plugin/Block/PdbBlockTest.php b/tests/src/Unit/Plugin/Block/PdbBlockTest.php
index ff2ac1c..308f903 100644
--- a/tests/src/Unit/Plugin/Block/PdbBlockTest.php
+++ b/tests/src/Unit/Plugin/Block/PdbBlockTest.php
@@ -2,6 +2,8 @@
 
 namespace Drupal\Tests\pdb\Unit\Plugin\Block;
 
+use PHPUnit\Framework\Attributes\Group;
+use PHPUnit\Framework\Attributes\DataProvider;
 use Drupal\Component\Uuid\UuidInterface;
 use Drupal\Core\Form\FormStateInterface;
 use Drupal\Core\Plugin\Context\EntityContextDefinition;
@@ -14,6 +16,7 @@ use Prophecy\PhpUnit\ProphecyTrait;
  * @coversDefaultClass \Drupal\pdb\Plugin\Block\PdbBlock
  * @group pdb
  */
+#[Group('pdb')]
 class PdbBlockTest extends UnitTestCase {
 
   use ProphecyTrait;
@@ -173,6 +176,7 @@ class PdbBlockTest extends UnitTestCase {
    *
    * @dataProvider attachLibrariesProvider
    */
+  #[DataProvider('attachLibrariesProvider')]
   public function testAttachLibraries($value, $expected) {
     $component = [
       'machine_name' => 'example-1',
diff --git a/tests/src/Unit/Plugin/Derivative/PdbBlockDeriverTest.php b/tests/src/Unit/Plugin/Derivative/PdbBlockDeriverTest.php
index 5aaea39..3206df6 100644
--- a/tests/src/Unit/Plugin/Derivative/PdbBlockDeriverTest.php
+++ b/tests/src/Unit/Plugin/Derivative/PdbBlockDeriverTest.php
@@ -2,6 +2,7 @@
 
 namespace Drupal\Tests\pdb\Unit\Plugin\Derivative;
 
+use PHPUnit\Framework\Attributes\Group;
 use Drupal\pdb\ComponentDiscoveryInterface;
 use Drupal\pdb\Plugin\Derivative\PdbBlockDeriver;
 use Drupal\Tests\UnitTestCase;
@@ -12,6 +13,7 @@ use Symfony\Component\DependencyInjection\ContainerInterface;
  * @coversDefaultClass \Drupal\pdb\Plugin\Derivative\PdbBlockDeriver
  * @group pdb
  */
+#[Group('pdb')]
 class PdbBlockDeriverTest extends UnitTestCase {
 
   use ProphecyTrait;
