From 78e8f7609844339d91fcd858a6aa4fedc48ef928 Mon Sep 17 00:00:00 2001 From: Alex Pott <alex.a.pott@googlemail.com> Date: Thu, 14 Nov 2024 12:34:17 +0000 Subject: [PATCH] Issue #3480293 by gapple: ConfigTarget::__construct() documentation references incorrect ToConfig enum name (cherry picked from commit ba24f0596778613c7df211e3dfc556a9f9fdc192) --- core/lib/Drupal/Core/Form/ConfigTarget.php | 6 +++--- core/tests/Drupal/Tests/Core/Form/ConfigTargetTest.php | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/core/lib/Drupal/Core/Form/ConfigTarget.php b/core/lib/Drupal/Core/Form/ConfigTarget.php index 55b86dc6b4b5..4eab41288b6d 100644 --- a/core/lib/Drupal/Core/Form/ConfigTarget.php +++ b/core/lib/Drupal/Core/Form/ConfigTarget.php @@ -74,8 +74,8 @@ final class ConfigTarget { * return an array with the transformed values, also keyed by property path. * The callback will receive the form state object as its second argument. * The callback may return a special values: - * - ToConfig::NoMapping, to indicate that the given form value does not - * need to be mapped onto the Config object + * - ToConfig::NoOp, to indicate that the given form value does not need to + * be mapped onto the Config object * - ToConfig::DeleteKey to indicate that the targeted property path should * be deleted from config. * Defaults to NULL. @@ -237,7 +237,7 @@ public function setValue(Config $config, mixed $value, FormStateInterface $form_ } // Set the returned value, or if a special value (one of the cases in the - // ConfigTargetValue enum): apply the appropriate action. + // ToConfig enum): apply the appropriate action. array_walk($value, fn (mixed $value, string $property) => match ($value) { // No-op. ToConfig::NoOp => NULL, diff --git a/core/tests/Drupal/Tests/Core/Form/ConfigTargetTest.php b/core/tests/Drupal/Tests/Core/Form/ConfigTargetTest.php index a2588857886d..5c7ad53788dd 100644 --- a/core/tests/Drupal/Tests/Core/Form/ConfigTargetTest.php +++ b/core/tests/Drupal/Tests/Core/Form/ConfigTargetTest.php @@ -286,14 +286,14 @@ public function testSingleTarget(): void { $config->set('something', FALSE)->shouldBeCalledTimes(1); $config_target->setValue($config->reveal(), 'No', $this->prophesize(FormStateInterface::class)->reveal()); - // Test `ConfigTargetValue::NoMapping`: nothing should happen to the Config. + // Test `ToConfig::NoOp`: nothing should happen to the Config. $config = $this->prophesize(Config::class); $config->getName()->willReturn('foo.settings'); $config->set('something', Argument::any())->shouldBeCalledTimes(0); $config->clear('something', Argument::any())->shouldBeCalledTimes(0); $config_target->setValue($config->reveal(), '<test:noop>', $this->prophesize(FormStateInterface::class)->reveal()); - // Test `ConfigTargetValue::DeleteKey`: Config::clear() should be called. + // Test `ToConfig::DeleteKey`: Config::clear() should be called. $config = $this->prophesize(Config::class); $config->getName()->willReturn('foo.settings'); $config->clear('something')->shouldBeCalledTimes(1); -- GitLab