8000 Add deprecation · symfony/symfony@47875df · GitHub
[go: up one dir, main page]

Skip to content

Commit 47875df

Browse files
Add deprecation
1 parent 2762e67 commit 47875df

File tree

3 files changed

+12
-0
lines changed

3 files changed

+12
-0
lines changed

src/Symfony/Component/Form/ChoiceList/Factory/CachingFactoryDecorator.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -183,6 +183,10 @@ public function createListFromLoader(ChoiceLoaderInterface $loader, $value = nul
183183
*/
184184
public function createView(ChoiceListInterface $list, $preferredChoices = null, $label = null, $index = null, $groupBy = null, $attr = null/*, $labelTranslationParameters = []*/)
185185
{
186+
if (\count(\func_get_args()) < 7) {
187+
trigger_deprecation('symfony/form', '5.2', 'Calling %s without passing the label translation parameters is deprecated.', __METHOD__);
188+
}
189+
186190
$labelTranslationParameters = \func_get_args()[6] ?? [];
187191
$cache = true;
188192

src/Symfony/Component/Form/ChoiceList/Factory/DefaultChoiceListFactory.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,10 @@ public function createListFromLoader(ChoiceLoaderInterface $loader, callable $va
7171
*/
7272
public function createView(ChoiceListInterface $list, $preferredChoices = null, $label = null, callable $index = null, callable $groupBy = null, $attr = null/*, $labelTranslationParameters = []*/)
7373
{
74+
if (\count(\func_get_args()) < 7) {
75+
trigger_deprecation('symfony/form', '5.2', 'Calling %s without passing the label translation parameters is deprecated.', __METHOD__);
76+
}
77+
7478
$labelTranslationParameters = \func_get_args()[6] ?? [];
7579
$preferredViews = [];
7680
$preferredViewsOrder = [];

src/Symfony/Component/Form/ChoiceList/Factory/PropertyAccessDecorator.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -156,6 +156,10 @@ public function createListFromLoader(ChoiceLoaderInterface $loader, $value = nul
156156
*/
157157
public function createView(ChoiceListInterface $list, $preferredChoices = null, $label = null, $index = null, $groupBy = null, $attr = null/*, $labelTranslationParameters = []*/)
158158
{
159+
if (\count(\func_get_args()) < 7) {
160+
trigger_deprecation('symfony/form', '5.2', 'Calling %s without passing the label translation parameters is deprecated.', __METHOD__);
161+
}
162+
159163
$labelTranslationParameters = \func_get_args()[6] ?? [];
160164
$accessor = $this->propertyAccessor;
161165

0 commit comments

Comments
 (0)
0