diff --git a/core/.phpstan-baseline.php b/core/.phpstan-baseline.php
index f88dc2ba1a60f301323ea1f3a492dbcedec514a2..64dbef610a4962504a3b05c74c00410b78ccfb6f 100644
--- a/core/.phpstan-baseline.php
+++ b/core/.phpstan-baseline.php
@@ -19126,12 +19126,6 @@
 	'count' => 1,
 	'path' => __DIR__ . '/modules/field_ui/src/Routing/RouteSubscriber.php',
 ];
-$ignoreErrors[] = [
-	// identifier: missingType.return
-	'message' => '#^Function field_ui_test_region_callback\\(\\) has no return type specified\\.$#',
-	'count' => 1,
-	'path' => __DIR__ . '/modules/field_ui/tests/modules/field_ui_test/field_ui_test.module',
-];
 $ignoreErrors[] = [
 	// identifier: missingType.return
 	'message' => '#^Method Drupal\\\\field_ui_test\\\\Hook\\\\FieldUiTestHooks\\:\\:fieldConfigAccess\\(\\) has no return type specified\\.$#',
diff --git a/core/modules/field_ui/tests/modules/field_ui_test/field_ui_test.module b/core/modules/field_ui/tests/modules/field_ui_test/field_ui_test.module
deleted file mode 100644
index 5da81c7ab5f72432b9d388fd47981aa3a0e8c7fe..0000000000000000000000000000000000000000
--- a/core/modules/field_ui/tests/modules/field_ui_test/field_ui_test.module
+++ /dev/null
@@ -1,12 +0,0 @@
-<?php
-
-/**
- * @file
- * Field UI test module.
- */
-
-declare(strict_types=1);
-
-function field_ui_test_region_callback($row) {
-  return 'content';
-}
diff --git a/core/modules/field_ui/tests/modules/field_ui_test/src/Hook/FieldUiTestHooks.php b/core/modules/field_ui/tests/modules/field_ui_test/src/Hook/FieldUiTestHooks.php
index 9aa01810a0872bee1c2ffcfcac5ef90c0d6fed87..97a999c6b6bbd2c12b6fed68f3748d0fe6f521d0 100644
--- a/core/modules/field_ui/tests/modules/field_ui_test/src/Hook/FieldUiTestHooks.php
+++ b/core/modules/field_ui/tests/modules/field_ui_test/src/Hook/FieldUiTestHooks.php
@@ -42,7 +42,7 @@ public function formEntityViewDisplayEditFormAlter(&$form, FormStateInterface $f
         'id' => 'indent-id',
       ],
       '#row_type' => 'group',
-      '#region_callback' => 'field_ui_test_region_callback',
+      '#region_callback' => [$this, 'regionCallback'],
       '#js_settings' => [
         'rowHandler' => 'group',
       ],
@@ -93,4 +93,8 @@ public function formEntityViewDisplayEditFormAlter(&$form, FormStateInterface $f
     ];
   }
 
+  public function regionCallback($row): string {
+    return 'content';
+  }
+
 }