Skip to content
Snippets Groups Projects
Unverified Commit e977788e authored by Alex Pott's avatar Alex Pott
Browse files

Issue #3480293 by gapple: ConfigTarget::__construct() documentation references...

Issue #3480293 by gapple: ConfigTarget::__construct() documentation references incorrect ToConfig enum name

(cherry picked from commit ba24f059)
(cherry picked from commit c26c5ee4)
parent 4b330801
No related branches found
No related tags found
No related merge requests found
Pipeline #339553 passed
...@@ -74,8 +74,8 @@ final class ConfigTarget { ...@@ -74,8 +74,8 @@ final class ConfigTarget {
* return an array with the transformed values, also keyed by property path. * 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 will receive the form state object as its second argument.
* The callback may return a special values: * The callback may return a special values:
* - ToConfig::NoMapping, to indicate that the given form value does not * - ToConfig::NoOp, to indicate that the given form value does not need to
* need to be mapped onto the Config object * be mapped onto the Config object
* - ToConfig::DeleteKey to indicate that the targeted property path should * - ToConfig::DeleteKey to indicate that the targeted property path should
* be deleted from config. * be deleted from config.
* Defaults to NULL. * Defaults to NULL.
...@@ -237,7 +237,7 @@ public function setValue(Config $config, mixed $value, FormStateInterface $form_ ...@@ -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 // 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) { array_walk($value, fn (mixed $value, string $property) => match ($value) {
// No-op. // No-op.
ToConfig::NoOp => NULL, ToConfig::NoOp => NULL,
......
...@@ -286,14 +286,14 @@ public function testSingleTarget(): void { ...@@ -286,14 +286,14 @@ public function testSingleTarget(): void {
$config->set('something', FALSE)->shouldBeCalledTimes(1); $config->set('something', FALSE)->shouldBeCalledTimes(1);
$config_target->setValue($config->reveal(), 'No', $this->prophesize(FormStateInterface::class)->reveal()); $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 = $this->prophesize(Config::class);
$config->getName()->willReturn('foo.settings'); $config->getName()->willReturn('foo.settings');
$config->set('something', Argument::any())->shouldBeCalledTimes(0); $config->set('something', Argument::any())->shouldBeCalledTimes(0);
$config->clear('something', Argument::any())->shouldBeCalledTimes(0); $config->clear('something', Argument::any())->shouldBeCalledTimes(0);
$config_target->setValue($config->reveal(), '<test:noop>', $this->prophesize(FormStateInterface::class)->reveal()); $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 = $this->prophesize(Config::class);
$config->getName()->willReturn('foo.settings'); $config->getName()->willReturn('foo.settings');
$config->clear('something')->shouldBeCalledTimes(1); $config->clear('something')->shouldBeCalledTimes(1);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment