core/modules/serialization/src/Normalizer/NormalizerBase.php | 6 +++--- .../serialization/tests/src/Kernel/NoFieldTypeNormalizersTest.php | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/core/modules/serialization/src/Normalizer/NormalizerBase.php b/core/modules/serialization/src/Normalizer/NormalizerBase.php index 3f4e482..4215fb3 100644 --- a/core/modules/serialization/src/Normalizer/NormalizerBase.php +++ b/core/modules/serialization/src/Normalizer/NormalizerBase.php @@ -127,7 +127,7 @@ protected static function disallowFieldLevelNormalizers(array $supported, $norma EntityReferenceFieldItemNormalizer::class, HalEntityReferenceItemNormalizer::class, // The NULL normalizer allows one to prevent listed classes from ever - // being normalized. By default, this is applied only tothe 'password' + // being normalized. By default, this is applied only to the 'password' // field type. NullNormalizer::class, // TextItemSillyNormalizer is a test-only normalizer. @@ -143,11 +143,11 @@ protected static function disallowFieldLevelNormalizers(array $supported, $norma || is_subclass_of($name, FieldItemListInterface::class, TRUE); }; - array_walk($supported, function ($name) use ($normalizer_class, $allowed_exceptions, $is_disallowed) { + foreach ($supported as $name) { if (!in_array($normalizer_class, $allowed_exceptions, TRUE) && $is_disallowed($name)) { @trigger_error(sprintf('%s is a normalizer for a @FieldType plugin. This is very strongly discouraged because it requires similar logic to be implemented for every normalization. Please write this as a normalizer for a @DataType plugin instead, then it works for the entire Drupal API-First ecosystem!', $normalizer_class), E_USER_DEPRECATED); } - }); + } } } diff --git a/core/modules/serialization/tests/src/Kernel/NoFieldTypeNormalizersTest.php b/core/modules/serialization/tests/src/Kernel/NoFieldTypeNormalizersTest.php index e65a841..5fc8fc7 100644 --- a/core/modules/serialization/tests/src/Kernel/NoFieldTypeNormalizersTest.php +++ b/core/modules/serialization/tests/src/Kernel/NoFieldTypeNormalizersTest.php @@ -21,7 +21,7 @@ class NoFieldTypeNormalizersTest extends KernelTestBase { */ public function testEntityTypeRestTestCoverage() { // Enable all modules. - $listing = new ExtensionDiscovery(\Drupal::root()); + $listing = new ExtensionDiscovery($this->root); $stable_core_modules = $listing->scan('module'); $this->enableModules(array_keys($stable_core_modules));