Skip to content

Commit

Permalink
[Form] Remove deprecation layer for duplicated preferred choices
Browse files Browse the repository at this point in the history
  • Loading branch information
HeahDude committed Oct 14, 2023
1 parent 04724ca commit 8945228
Show file tree
Hide file tree
Showing 5 changed files with 5 additions and 16 deletions.
1 change: 1 addition & 0 deletions UPGRADE-7.0.md
Original file line number Diff line number Diff line change
Expand Up @@ -177,6 +177,7 @@ Form
* Require explicit argument when calling `Button/Form::setParent()`, `ButtonBuilder/FormConfigBuilder::setDataMapper()`, `TransformationFailedException::setInvalidMessage()`
* `PostSetDataEvent::setData()` throws an exception, use `PreSetDataEvent::setData()` instead
* `PostSubmitEvent::setData()` throws an exception, use `PreSubmitDataEvent::setData()` or `SubmitDataEvent::setData()` instead
* Add `$duplicatePreferredChoices` parameter to `ChoiceListFactoryInterface::createView()`

FrameworkBundle
---------------
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -145,12 +145,8 @@ public function createListFromLoader(ChoiceLoaderInterface $loader, mixed $value
return $this->lists[$hash];
}

/**
* @param bool $duplicatePreferredChoices
*/
public function createView(ChoiceListInterface $list, mixed $preferredChoices = null, mixed $label = null, mixed $index = null, mixed $groupBy = null, mixed $attr = null, mixed $labelTranslationParameters = []/* , bool $duplicatePreferredChoices = true */): ChoiceListView
public function createView(ChoiceListInterface $list, mixed $preferredChoices = null, mixed $label = null, mixed $index = null, mixed $groupBy = null, mixed $attr = null, mixed $labelTranslationParameters = [], bool $duplicatePreferredChoices = true): ChoiceListView
{
$duplicatePreferredChoices = \func_num_args() > 7 ? func_get_arg(7) : true;
$cache = true;

if ($preferredChoices instanceof Cache\PreferredChoice) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -81,5 +81,5 @@ public function createListFromLoader(ChoiceLoaderInterface $loader, callable $va
* on top of the list and in their original position
* or only in the top of the list
*/
public function createView(ChoiceListInterface $list, array|callable $preferredChoices = null, callable|false $label = null, callable $index = null, callable $groupBy = null, array|callable $attr = null, array|callable $labelTranslationParameters = []/* , bool $duplicatePreferredChoices = true */): ChoiceListView;
public function createView(ChoiceListInterface $list, array|callable $preferredChoices = null, callable|false $label = null, callable $index = null, callable $groupBy = null, array|callable $attr = null, array|callable $labelTranslationParameters = [], bool $duplicatePreferredChoices = true): ChoiceListView;
}
Original file line number Diff line number Diff line change
Expand Up @@ -52,12 +52,8 @@ public function createListFromLoader(ChoiceLoaderInterface $loader, callable $va
return new LazyChoiceList($loader, $value);
}

/**
* @param bool $duplicatePreferredChoices
*/
public function createView(ChoiceListInterface $list, array|callable $preferredChoices = null, callable|false $label = null, callable $index = null, callable $groupBy = null, array|callable $attr = null, array|callable $labelTranslationParameters = []/* , bool $duplicatePreferredChoices = true */): ChoiceListView
public function createView(ChoiceListInterface $list, array|callable $preferredChoices = null, callable|false $label = null, callable $index = null, callable $groupBy = null, array|callable $attr = null, array|callable $labelTranslationParameters = [], bool $duplicatePreferredChoices = true): ChoiceListView
{
$duplicatePreferredChoices = \func_num_args() > 7 ? func_get_arg(7) : true;
$preferredViews = [];
$preferredViewsOrder = [];
$otherViews = [];
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -109,12 +109,8 @@ public function createListFromLoader(ChoiceLoaderInterface $loader, mixed $value
return $this->decoratedFactory->createListFromLoader($loader, $value, $filter);
}

/**
* @param bool $duplicatePreferredChoices
*/
public function createView(ChoiceListInterface $list, mixed $preferredChoices = null, mixed $label = null, mixed $index = null, mixed $groupBy = null, mixed $attr = null, mixed $labelTranslationParameters = []/* , bool $duplicatePreferredChoices = true */): ChoiceListView
public function createView(ChoiceListInterface $list, mixed $preferredChoices = null, mixed $label = null, mixed $index = null, mixed $groupBy = null, mixed $attr = null, mixed $labelTranslationParameters = [], bool $duplicatePreferredChoices = true): ChoiceListView
{
$duplicatePreferredChoices = \func_num_args() > 7 ? func_get_arg(7) : true;
$accessor = $this->propertyAccessor;

if (\is_string($label)) {
Expand Down

0 comments on commit 8945228

Please sign in to comment.