8000 [Form] Add choice_translation_parameters option for ChoiceType form by VincentLanglet · Pull Request #36851 · symfony/symfony · GitHub
[go: up one dir, main page]

Skip to content

[Form] Add choice_translation_parameters option for ChoiceType form #36851

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Add deprecation
  • Loading branch information
VincentLanglet committed Oct 4, 2020
commit 47875dff3cf5d161c63782429fa4ae3da8928f0c
Original file line number Diff line number Diff line change
Expand Up @@ -183,6 +183,10 @@ public function createListFromLoader(ChoiceLoaderInterface $loader, $value = nul
*/
public function createView(ChoiceListInterface $list, $preferredChoices = null, $label = null, $index = null, $groupBy = null, $attr = null/*, $labelTranslationParameters = []*/)
{
if (\count(\func_get_args()) < 7) {
trigger_deprecation('symfony/form', '5.2', 'Calling %s without passing the label translation parameters is deprecated.', __METHOD__);
}

$labelTranslationParameters = \func_get_args()[6] ?? [];
$cache = true;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,10 @@ public function createListFromLoader(ChoiceLoaderInterface $loader, callable $va
*/
public function createView(ChoiceListInterface $list, $preferredChoices = null, $label = null, callable $index = null, callable $groupBy = null, $attr = null/*, $labelTranslationParameters = []*/)
{
if (\count(\func_get_args()) < 7) {
trigger_deprecation('symfony/form', '5.2', 'Calling %s without passing the label translation parameters is deprecated.', __METHOD__);
}

$labelTranslationParameters = \func_get_args()[6] ?? [];
$preferredViews = [];
$preferredViewsOrder = [];
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -156,6 +156,10 @@ public function createListFromLoader(ChoiceLoaderInterface $loader, $value = nul
*/
public function createView(ChoiceListInterface $list, $preferredChoices = null, $label = null, $index = null, $groupBy = null, $attr = null/*, $labelTranslationParameters = []*/)
{
if (\count(\func_get_args()) < 7) {
trigger_deprecation('symfony/form', '5.2', 'Calling %s without passing the label translation parameters is deprecated.', __METHOD__);
}

$labelTranslationParameters = \func_get_args()[6] ?? [];
$accessor = $this->propertyAccessor;

Expand Down
0