diff --git a/tests/modules/fivestar_widget_provider/fivestar_widget_provider.module b/tests/modules/fivestar_widget_provider/fivestar_widget_provider.module
index ffa3ca3..1463faf 100644
--- a/tests/modules/fivestar_widget_provider/fivestar_widget_provider.module
+++ b/tests/modules/fivestar_widget_provider/fivestar_widget_provider.module
@@ -8,7 +8,7 @@
 /**
  * Implements hook_fivestar_widgets().
  */
-function fivestar_widget_provider_fivestar_widgets() {
+function fivestar_widget_provider_fivestar_widgets(): array {
   // Widgets defined by this module.
   $widgets = [
     'awesome' => [
@@ -27,7 +27,7 @@ function fivestar_widget_provider_fivestar_widgets() {
 /**
  * Implements hook_fivestar_widgets_alter().
  */
-function fivestar_widget_provider_fivestar_widgets_alter(&$widgets) {
+function fivestar_widget_provider_fivestar_widgets_alter(array &$widgets): void {
   // Change the label of the 'basic' widget to be 'Altered'.
   $widgets['basic']['label'] = t('Altered');
 }
diff --git a/tests/src/Functional/FivestarTest.php b/tests/src/Functional/FivestarTest.php
index 7f69f0b..fc71bc4 100644
--- a/tests/src/Functional/FivestarTest.php
+++ b/tests/src/Functional/FivestarTest.php
@@ -48,7 +48,7 @@ class FivestarTest extends BrowserTestBase {
   /**
    * {@inheritdoc}
    */
-  protected function setUp() {
+  protected function setUp(): void {
     parent::setUp();
 
     // Create content type for testing.
@@ -74,7 +74,7 @@ class FivestarTest extends BrowserTestBase {
   /**
    * Tests that authors can rate their own content.
    */
-  public function testAuthorRating() {
+  public function testAuthorRating(): void {
     $this->drupalLogin($this->adminUser);
     // Add an author-rated fivestar field to the test_node_type content type.
     $this->createFivestarField([
@@ -114,7 +114,7 @@ class FivestarTest extends BrowserTestBase {
    * Tests that users cannot rate content with exposed widgets that has the
    * exposed display setting set to FALSE.
    */
-  public function testViewerNonRating() {
+  public function testViewerNonRating(): void {
     // Add an exposed field, with the 'exposed' display settings set to FALSE.
     $this->createFivestarField([
       'widget_type' => 'exposed',
diff --git a/tests/src/FunctionalJavascript/FivestarAjaxTestBase.php b/tests/src/FunctionalJavascript/FivestarAjaxTestBase.php
index 82487e4..e9a07f9 100644
--- a/tests/src/FunctionalJavascript/FivestarAjaxTestBase.php
+++ b/tests/src/FunctionalJavascript/FivestarAjaxTestBase.php
@@ -47,7 +47,7 @@ abstract class FivestarAjaxTestBase extends WebDriverTestBase {
   /**
    * {@inheritdoc}
    */
-  protected function setUp() {
+  protected function setUp(): void {
     parent::setUp();
 
     // Create content type for testing.
diff --git a/tests/src/Kernel/HookFivestarWidgetsAlterTest.php b/tests/src/Kernel/HookFivestarWidgetsAlterTest.php
index 53c0c45..f2b2e04 100644
--- a/tests/src/Kernel/HookFivestarWidgetsAlterTest.php
+++ b/tests/src/Kernel/HookFivestarWidgetsAlterTest.php
@@ -30,7 +30,7 @@ class HookFivestarWidgetsAlterTest extends KernelTestBase {
   /**
    * {@inheritdoc}
    */
-  protected function setUp() {
+  protected function setUp(): void {
     parent::setUp();
 
     $this->widgetManager = $this->container->get('fivestar.widget_manager');
@@ -39,7 +39,7 @@ class HookFivestarWidgetsAlterTest extends KernelTestBase {
   /**
    * Tests that fivestar_widget_provider_fivestar_widgets_alter() was called.
    */
-  public function testWidgetAlter() {
+  public function testWidgetAlter(): void {
     // Invoke the hook and collect all defined and altered widgets.
     $widgets = $this->widgetManager->getWidgets();
 
diff --git a/tests/src/Kernel/HookFivestarWidgetsTest.php b/tests/src/Kernel/HookFivestarWidgetsTest.php
index 88bc193..10b5578 100644
--- a/tests/src/Kernel/HookFivestarWidgetsTest.php
+++ b/tests/src/Kernel/HookFivestarWidgetsTest.php
@@ -30,7 +30,7 @@ class HookFivestarWidgetsTest extends KernelTestBase {
   /**
    * {@inheritdoc}
    */
-  protected function setUp() {
+  protected function setUp(): void {
     parent::setUp();
 
     $this->widgetManager = $this->container->get('fivestar.widget_manager');
@@ -39,7 +39,7 @@ class HookFivestarWidgetsTest extends KernelTestBase {
   /**
    * Tests finding widgets defined by hook_fivestar_widgets().
    */
-  public function testWidgetDiscovery() {
+  public function testWidgetDiscovery(): void {
     $expected = [
       // Awesome Stars is defined in the fivestar_widget_provider module.
       'awesome' => [
diff --git a/tests/src/Traits/FivestarTestTrait.php b/tests/src/Traits/FivestarTestTrait.php
index 737d8e1..9ae768c 100644
--- a/tests/src/Traits/FivestarTestTrait.php
+++ b/tests/src/Traits/FivestarTestTrait.php
@@ -22,7 +22,7 @@ trait FivestarTestTrait {
    *   - widget_type: Defaults to 'stars'.
    *   - display: Defaults to an empty array.
    */
-  protected function createFivestarField(array $options = []) {
+  protected function createFivestarField(array $options = []): void {
     $options = $options + [
       'content_type' => 'test_node_type',
       'widget_type' => 'stars',
