From 3fba8eb8050b4efd8f07d7217cbb6ecf944bb80d Mon Sep 17 00:00:00 2001
From: Lee Rowlands <lee.rowlands@previousnext.com.au>
Date: Thu, 19 Dec 2024 09:53:51 +1000
Subject: [PATCH] Issue #3494373 by nicxvan: Move helpers in
 field_ui_test.module and delete it

---
 core/.phpstan-baseline.php                           |  6 ------
 .../tests/modules/field_ui_test/field_ui_test.module | 12 ------------
 .../field_ui_test/src/Hook/FieldUiTestHooks.php      |  6 +++++-
 3 files changed, 5 insertions(+), 19 deletions(-)
 delete mode 100644 core/modules/field_ui/tests/modules/field_ui_test/field_ui_test.module

diff --git a/core/.phpstan-baseline.php b/core/.phpstan-baseline.php
index f88dc2ba1a60..64dbef610a49 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 5da81c7ab5f7..000000000000
--- 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 9aa01810a087..97a999c6b6bb 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';
+  }
+
 }
-- 
GitLab