Skip to content

Commit d782d84

Browse files
committed
Remove support for nested options definition via setDefault(), use setOptions() instead
1 parent acce50a commit d782d84

File tree

3 files changed

+5
-632
lines changed

3 files changed

+5
-632
lines changed

CHANGELOG.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,11 @@
11
CHANGELOG
22
=========
33

4+
8.0
5+
---
6+
7+
* Remove support for nested options definition via `setDefault()`, use `setOptions()` instead
8+
49
7.3
510
---
611

OptionsResolver.php

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -229,22 +229,6 @@ public function setDefault(string $option, mixed $value): static
229229

230230
return $this;
231231
}
232-
233-
// Remove in Symfony 8.0.
234-
if (isset($params[0]) && ($type = $params[0]->getType()) instanceof \ReflectionNamedType && self::class === $type->getName() && (!isset($params[1]) || (($type = $params[1]->getType()) instanceof \ReflectionNamedType && Options::class === $type->getName()))) {
235-
trigger_deprecation('symfony/options-resolver', '7.3', 'Defining nested options via "%s()" is deprecated and will be removed in Symfony 8.0, use "setOptions()" method instead.', __METHOD__);
236-
$this->deprecatedNestedOptions[$option] = true;
237-
238-
// Store closure for later evaluation
239-
$this->nested[$option][] = $value;
240-
$this->defaults[$option] = [];
241-
$this->defined[$option] = true;
242-
243-
// Make sure the option is processed and is not lazy anymore
244-
unset($this->resolved[$option], $this->lazy[$option]);
245-
246-
return $this;
247-
}
248232
}
249233

250234
// This option is not lazy anymore

0 commit comments

Comments
 (0)