diff --git a/dubbot.module b/dubbot.module
index 5c977ef..b2fa064 100644
--- a/dubbot.module
+++ b/dubbot.module
@@ -4,48 +4,24 @@
  * @file
  * Primary module hooks for DubBot module.
  */
-
+use Drupal\Core\Hook\Attribute\LegacyHook;
+use Drupal\dubbot\Hook\DubbotHooks;
 use Drupal\Core\Language\LanguageInterface;
 use Drupal\language\Plugin\LanguageNegotiation\LanguageNegotiationUrl;
 
 /**
  * Implements hook_theme().
  */
+#[LegacyHook]
 function dubbot_theme(): array {
-  return [
-    'dubbot_svg_icon' => [
-      'variables' => [
-        'color' => '#000000',
-      ],
-    ],
-  ];
+  return \Drupal::service(DubbotHooks::class)->theme();
 }
 
 /**
  * Implements hook_dubbot_domains_alter().
  */
-function dubbot_dubbot_domains_alter(&$domains): void {
-  if (!\Drupal::moduleHandler()->moduleExists('language')) {
-    return;
-  }
-
-  $negotiator = \Drupal::service('language_negotiator');
-  if (!$negotiator->isNegotiationMethodEnabled('language-url', LanguageInterface::TYPE_INTERFACE)) {
-    return;
-  }
-
-  $config = \Drupal::config('language.negotiation')->get('url');
-  if ($config['source'] !== LanguageNegotiationUrl::CONFIG_DOMAIN) {
-    return;
-  }
-
-  $scheme = \Drupal::request()->getScheme();
-
-  array_walk($config['domains'], function ($domain) use (&$domains, $scheme) {
-    $new_domain = $scheme . '://' . $domain;
-
-    if (!in_array($new_domain, $domains)) {
-      $domains[] = $new_domain;
-    }
-  });
+#[LegacyHook]
+function dubbot_dubbot_domains_alter(&$domains): void
+{
+    \Drupal::service(DubbotHooks::class)->dubbotDomainsAlter($domains);
 }
diff --git a/dubbot.services.yml b/dubbot.services.yml
index 6a7fc9f..fd6ed99 100644
--- a/dubbot.services.yml
+++ b/dubbot.services.yml
@@ -10,3 +10,7 @@ services:
   dubbot.domain_negotiator:
     class: Drupal\dubbot\DomainNegotiator
     arguments: ['@request_stack', '@module_handler']
+
+  Drupal\dubbot\Hook\DubbotHooks:
+    class: Drupal\dubbot\Hook\DubbotHooks
+    autowire: true
diff --git a/modules/dubbot_toolbar/dubbot_toolbar.module b/modules/dubbot_toolbar/dubbot_toolbar.module
index 04abfe9..93ab955 100644
--- a/modules/dubbot_toolbar/dubbot_toolbar.module
+++ b/modules/dubbot_toolbar/dubbot_toolbar.module
@@ -4,13 +4,14 @@
  * @file
  * Primary module hooks for DubBot Toolbar module.
  */
-
+use Drupal\Core\Hook\Attribute\LegacyHook;
+use Drupal\dubbot_toolbar\Hook\DubbotToolbarHooks;
 use Drupal\dubbot_toolbar\ToolbarHandler;
 
 /**
  * Implements hook_toolbar().
  */
+#[LegacyHook]
 function dubbot_toolbar_toolbar() {
-  return \Drupal::classResolver(ToolbarHandler::class)
-    ->toolbar();
+  return \Drupal::service(DubbotToolbarHooks::class)->toolbar();
 }
diff --git a/modules/dubbot_toolbar/dubbot_toolbar.services.yml b/modules/dubbot_toolbar/dubbot_toolbar.services.yml
new file mode 100644
index 0000000..e8c444f
--- /dev/null
+++ b/modules/dubbot_toolbar/dubbot_toolbar.services.yml
@@ -0,0 +1,5 @@
+
+services:
+  Drupal\dubbot_toolbar\Hook\DubbotToolbarHooks:
+    class: Drupal\dubbot_toolbar\Hook\DubbotToolbarHooks
+    autowire: true
diff --git a/modules/dubbot_toolbar/src/Hook/DubbotToolbarHooks.php b/modules/dubbot_toolbar/src/Hook/DubbotToolbarHooks.php
new file mode 100644
index 0000000..34dd6de
--- /dev/null
+++ b/modules/dubbot_toolbar/src/Hook/DubbotToolbarHooks.php
@@ -0,0 +1,20 @@
+<?php
+
+namespace Drupal\dubbot_toolbar\Hook;
+
+use Drupal\dubbot_toolbar\ToolbarHandler;
+use Drupal\Core\Hook\Attribute\Hook;
+/**
+ * Hook implementations for dubbot_toolbar.
+ */
+class DubbotToolbarHooks
+{
+    /**
+     * Implements hook_toolbar().
+     */
+    #[Hook('toolbar')]
+    public static function toolbar()
+    {
+        return \Drupal::classResolver(\Drupal\dubbot_toolbar\ToolbarHandler::class)->toolbar();
+    }
+}
diff --git a/src/Client.php b/src/Client.php
index 71dbb39..db43be0 100644
--- a/src/Client.php
+++ b/src/Client.php
@@ -129,7 +129,7 @@ class Client implements ClientInterface {
    * @return string|null
    *   The endpoint URL for the given path. NULL if unable to build it.
    */
-  protected function buildUrl(string $path, array $query = [], string $embed_key = NULL): ?string {
+  protected function buildUrl(string $path, array $query = [], ?string $embed_key = NULL): ?string {
     if (!isset($embed_key)) {
       $embed_key = $this->dubbotEmbedKey();
       if (empty($embed_key)) {
diff --git a/src/DubBotEmbedJsonResponse.php b/src/DubBotEmbedJsonResponse.php
index dec7a38..420e2b8 100644
--- a/src/DubBotEmbedJsonResponse.php
+++ b/src/DubBotEmbedJsonResponse.php
@@ -59,7 +59,7 @@ final class DubBotEmbedJsonResponse {
    * @param string|null $error
    *   (Optional) The error message.
    */
-  public function __construct(int $code, string $page_id = NULL, int $issues_count = NULL, \DateTime $crawled_at = NULL, string $error = NULL) {
+  public function __construct(int $code, ?string $page_id = NULL, ?int $issues_count = NULL, ?\DateTime $crawled_at = NULL, ?string $error = NULL) {
     $this->code = $code;
     $this->pageId = $page_id;
     $this->issuesCount = $issues_count;
diff --git a/src/Hook/DubbotHooks.php b/src/Hook/DubbotHooks.php
new file mode 100644
index 0000000..eea6ab6
--- /dev/null
+++ b/src/Hook/DubbotHooks.php
@@ -0,0 +1,52 @@
+<?php
+
+namespace Drupal\dubbot\Hook;
+
+use Drupal\Core\Language\LanguageInterface;
+use Drupal\language\Plugin\LanguageNegotiation\LanguageNegotiationUrl;
+use Drupal\Core\Hook\Attribute\Hook;
+/**
+ * Hook implementations for dubbot.
+ */
+class DubbotHooks
+{
+    /**
+     * Implements hook_theme().
+     */
+    #[Hook('theme')]
+    public static function theme(): array
+    {
+        return [
+            'dubbot_svg_icon' => [
+                'variables' => [
+                    'color' => '#000000',
+                ],
+            ],
+        ];
+    }
+    /**
+     * Implements hook_dubbot_domains_alter().
+     */
+    #[Hook('dubbot_domains_alter')]
+    public static function dubbotDomainsAlter(&$domains): void
+    {
+        if (!\Drupal::moduleHandler()->moduleExists('language')) {
+            return;
+        }
+        $negotiator = \Drupal::service('language_negotiator');
+        if (!$negotiator->isNegotiationMethodEnabled('language-url', \Drupal\Core\Language\LanguageInterface::TYPE_INTERFACE)) {
+            return;
+        }
+        $config = \Drupal::config('language.negotiation')->get('url');
+        if ($config['source'] !== \Drupal\language\Plugin\LanguageNegotiation\LanguageNegotiationUrl::CONFIG_DOMAIN) {
+            return;
+        }
+        $scheme = \Drupal::request()->getScheme();
+        array_walk($config['domains'], function ($domain) use (&$domains, $scheme) {
+            $new_domain = $scheme . '://' . $domain;
+            if (!in_array($new_domain, $domains)) {
+                $domains[] = $new_domain;
+            }
+        });
+    }
+}
diff --git a/src/RequirementsHandler.php b/src/RequirementsHandler.php
index babaaca..2c85cd0 100644
--- a/src/RequirementsHandler.php
+++ b/src/RequirementsHandler.php
@@ -2,6 +2,8 @@
 
 namespace Drupal\dubbot;
 
+use Drupal\Component\Utility\DeprecationHelper;
+use Drupal\Core\Extension\Requirement\RequirementSeverity;
 use Drupal\Core\Config\ConfigFactoryInterface;
 use Drupal\Core\DependencyInjection\ContainerInjectionInterface;
 use Drupal\Core\Link;
@@ -60,7 +62,7 @@ class RequirementsHandler implements ContainerInjectionInterface {
     }
 
     $description = $this->t('DubBot Embed key can be set from the @link.', ['@link' => Link::createFromRoute('DubBot settings page', 'dubbot.settings')->toString()]);
-    $severity = REQUIREMENT_INFO;
+    $severity = DeprecationHelper::backwardsCompatibleCall(\Drupal::VERSION, '11.2.0', fn() => RequirementSeverity::Info, fn() => REQUIREMENT_INFO);
     $key = $this->dubbotEmbedKey();
 
     if (!$key) {
@@ -70,16 +72,16 @@ class RequirementsHandler implements ContainerInjectionInterface {
       try {
         if ($this->dubbotClient->isValidEmbedKey($key)) {
           $value = $this->t('Valid DubBot Embed key set.');
-          $severity = REQUIREMENT_OK;
+          $severity = DeprecationHelper::backwardsCompatibleCall(\Drupal::VERSION, '11.2.0', fn() => RequirementSeverity::OK, fn() => REQUIREMENT_OK);
         }
         else {
           $value = $this->t('Invalid DubBot Embed key set.');
-          $severity = REQUIREMENT_ERROR;
+          $severity = DeprecationHelper::backwardsCompatibleCall(\Drupal::VERSION, '11.2.0', fn() => RequirementSeverity::Error, fn() => REQUIREMENT_ERROR);
         }
       }
       catch (\Exception $e) {
         $value = $this->t('Unable to validate the embed key. Please try again or contact the site administrator.');
-        $severity = REQUIREMENT_WARNING;
+        $severity = DeprecationHelper::backwardsCompatibleCall(\Drupal::VERSION, '11.2.0', fn() => RequirementSeverity::Warning, fn() => REQUIREMENT_WARNING);
       }
     }
 
diff --git a/tests/dubbot_test/dubbot_test.module b/tests/dubbot_test/dubbot_test.module
index 3fad070..0323c2e 100644
--- a/tests/dubbot_test/dubbot_test.module
+++ b/tests/dubbot_test/dubbot_test.module
@@ -1,14 +1,17 @@
 <?php
 
+use Drupal\Core\Hook\Attribute\LegacyHook;
+use Drupal\dubbot_test\Hook\DubbotTestHooks;
+
 /**
  * @file
  * Primary module hooks for DubBot test module.
  */
-
 /**
  * Implements hook_dubbot_domains_alter().
  */
-function dubbot_test_dubbot_domains_alter(&$domains): void {
-  $domains[] = 'http://foo.com';
-  $domains[] = 'https://bar.com';
+#[LegacyHook]
+function dubbot_test_dubbot_domains_alter(&$domains): void
+{
+    \Drupal::service(DubbotTestHooks::class)->dubbotDomainsAlter($domains);
 }
diff --git a/tests/dubbot_test/dubbot_test.services.yml b/tests/dubbot_test/dubbot_test.services.yml
index cb6625f..e92c8b3 100644
--- a/tests/dubbot_test/dubbot_test.services.yml
+++ b/tests/dubbot_test/dubbot_test.services.yml
@@ -2,3 +2,7 @@ services:
   dubbot_test.http_client:
     decorates: 'http_client'
     class: 'Drupal\dubbot_test\MockHttpClient'
+
+  Drupal\dubbot_test\Hook\DubbotTestHooks:
+    class: Drupal\dubbot_test\Hook\DubbotTestHooks
+    autowire: true
diff --git a/tests/dubbot_test/src/Hook/DubbotTestHooks.php b/tests/dubbot_test/src/Hook/DubbotTestHooks.php
new file mode 100644
index 0000000..942ef03
--- /dev/null
+++ b/tests/dubbot_test/src/Hook/DubbotTestHooks.php
@@ -0,0 +1,24 @@
+<?php
+
+namespace Drupal\dubbot_test\Hook;
+
+use Drupal\Core\Hook\Attribute\Hook;
+/**
+ * Hook implementations for dubbot_test.
+ */
+class DubbotTestHooks
+{
+    /**
+     * @file
+     * Primary module hooks for DubBot test module.
+     */
+    /**
+     * Implements hook_dubbot_domains_alter().
+     */
+    #[Hook('dubbot_domains_alter')]
+    public static function dubbotDomainsAlter(&$domains): void
+    {
+        $domains[] = 'http://foo.com';
+        $domains[] = 'https://bar.com';
+    }
+}
diff --git a/tests/src/Unit/LikGeneratorTest.php b/tests/src/Unit/LikGeneratorTest.php
index 599c098..082e615 100644
--- a/tests/src/Unit/LikGeneratorTest.php
+++ b/tests/src/Unit/LikGeneratorTest.php
@@ -56,7 +56,7 @@ class LikGeneratorTest extends UnitTestCase {
 
     $this->dubbotClient->expects($this->any())
       ->method('reportByUrl')
-      ->will($this->returnValueMap([
+      ->willReturnMap([
         [
           'https://example.com',
           new DubBotEmbedJsonResponse(200, $this->randomMachineName(), 0),
@@ -69,7 +69,7 @@ class LikGeneratorTest extends UnitTestCase {
           'https://invalid-example.com',
           new DubBotEmbedJsonResponse(404),
         ],
-      ]));
+      ]);
 
     $this->configFactory = $this->getConfigFactoryStub([
       'dubbot.settings' => [
