Skip to content
Snippets Groups Projects
Unverified Commit ba24f059 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
parent 1c0440c8
No related branches found
No related tags found
13 merge requests!11197Issue #3506427 by eduardo morales alberti: Remove responsive_image.ajax from hook,!11131[10.4.x-only-DO-NOT-MERGE]: Issue ##2842525 Ajax attached to Views exposed filter form does not trigger callbacks,!10786Issue #3490579 by shalini_jha, mstrelan: Add void return to all views...,!10210Issue #3487907: Drupal.displace() use getComputedStyle() for hidden chk.,!3878Removed unused condition head title for views,!3818Issue #2140179: $entity->original gets stale between updates,!3154Fixes #2987987 - CSRF token validation broken on routes with optional parameters.,!3133core/modules/system/css/components/hidden.module.css,!2964Issue #2865710 : Dependencies from only one instance of a widget are used in display modes,!2062Issue #3246454: Add weekly granularity to views date sort,!10223132456: Fix issue where views instances are emptied before an ajax request is complete,!617Issue #3043725: Provide a Entity Handler for user cancelation,!579Issue #2230909: Simple decimals fail to pass validation
......@@ -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,
......
......@@ -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);
......
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