Skip to content

Commit 8f76ccf

Browse files
committed
Merge branch '2.7' into 2.8
* 2.7: Fix test name fixed CS Allow new lines in Messages translated with transchoice() (replacement for #14867) [Form] Swap new ChoiceView constructor arguments to ease migrating from the deprecated one [2.3] Fix tests on Windows [Yaml] remove partial deprecation annotation Silence invasive deprecation warnings, opt-in for warnings Documenting how to keep option value BC - see #14377 Conflicts: src/Symfony/Bridge/Doctrine/composer.json src/Symfony/Bridge/Twig/composer.json
2 parents 0952d50 + 9ca087d commit 8f76ccf

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

46 files changed

+139
-140
lines changed

ButtonBuilder.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -597,7 +597,7 @@ public function getByReference()
597597
*/
598598
public function getVirtual()
599599
{
600-
trigger_error('The '.__METHOD__.' method is deprecated since version 2.3 and will be removed in 3.0. Use the Symfony\Component\Form\FormConfigBuilder::getInheritData method instead.', E_USER_DEPRECATED);
600+
@trigger_error('The '.__METHOD__.' method is deprecated since version 2.3 and will be removed in 3.0. Use the Symfony\Component\Form\FormConfigBuilder::getInheritData method instead.', E_USER_DEPRECATED);
601601

602602
return false;
603603
}

ChoiceList/Factory/DefaultChoiceListFactory.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -144,7 +144,7 @@ public function createView(ChoiceListInterface $list, $preferredChoices = null,
144144
if ($list instanceof LegacyChoiceListInterface && empty($preferredChoices)
145145
&& null === $label && null === $index && null === $groupBy && null === $attr) {
146146
$mapToNonLegacyChoiceView = function (LegacyChoiceView $choiceView) {
147-
return new ChoiceView($choiceView->label, $choiceView->value, $choiceView->data);
147+
return new ChoiceView($choiceView->data, $choiceView->value, $choiceView->label);
148148
};
149149

150150
return new ChoiceListView(
@@ -245,10 +245,10 @@ private static function addChoiceView($choice, $key, $label, $values, &$index, $
245245
$nextIndex = is_int($index) ? $index++ : call_user_func($index, $choice, $key, $value);
246246

247247
$view = new ChoiceView(
248+
$choice,
249+
$value,
248250
// If the labels are null, use the choice key by default
249251
null === $label ? (string) $key : (string) call_user_func($label, $choice, $key, $value),
250-
$value,
251-
$choice,
252252
// The attributes may be a callable or a mapping from choice indices
253253
// to nested arrays
254254
is_callable($attr) ? call_user_func($attr, $choice, $key, $value) : (isset($attr[$key]) ? $attr[$key] : array())

ChoiceList/View/ChoiceView.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -78,12 +78,12 @@ class ChoiceView extends LegacyChoiceView
7878
/**
7979
* Creates a new choice view.
8080
*
81-
* @param string $label The label displayed to humans
82-
* @param string $value The view representation of the choice
8381
* @param mixed $data The original choice
82+
* @param string $value The view representation of the choice
83+
* @param string $label The label displayed to humans
8484
* @param array $attr Additional attributes for the HTML tag
8585
*/
86-
public function __construct($label, $value, $data, array $attr = array())
86+
public function __construct($data, $value, $label, array $attr = array())
8787
{
8888
parent::__construct($data, $value, $label);
8989

Deprecated/FormEvents.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111

1212
namespace Symfony\Component\Form\Deprecated;
1313

14-
trigger_error('Constants PRE_BIND, BIND and POST_BIND in class Symfony\Component\Form\FormEvents are deprecated since version 2.3 and will be removed in 3.0. Use PRE_SUBMIT, SUBMIT and POST_SUBMIT instead.', E_USER_DEPRECATED);
14+
@trigger_error('Constants PRE_BIND, BIND and POST_BIND in class Symfony\Component\Form\FormEvents are deprecated since version 2.3 and will be removed in 3.0. Use PRE_SUBMIT, SUBMIT and POST_SUBMIT instead.', E_USER_DEPRECATED);
1515

1616
/**
1717
* @deprecated since version 2.7, to be removed in 3.0.

Exception/AlreadyBoundException.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ class AlreadyBoundException extends LogicException
2222
public function __construct($message = '', $code = 0, \Exception $previous = null)
2323
{
2424
if (__CLASS__ === get_class($this)) {
25-
trigger_error('The '.__CLASS__.' class is deprecated since version 2.3 and will be removed in 3.0. Use the Symfony\Component\Form\Exception\AlreadySubmittedException class instead.', E_USER_DEPRECATED);
25+
@trigger_error('The '.__CLASS__.' class is deprecated since version 2.3 and will be removed in 3.0. Use the Symfony\Component\Form\Exception\AlreadySubmittedException class instead.', E_USER_DEPRECATED);
2626
}
2727

2828
parent::__construct($message, $code, $previous);

Extension/Core/ChoiceList/ChoiceList.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111

1212
namespace Symfony\Component\Form\Extension\Core\ChoiceList;
1313

14-
trigger_error('The '.__NAMESPACE__.'\ChoiceList class is deprecated since version 2.7 and will be removed in 3.0. Use Symfony\Component\Form\ChoiceList\ArrayChoiceList instead.', E_USER_DEPRECATED);
14+
@trigger_error('The '.__NAMESPACE__.'\ChoiceList class is deprecated since version 2.7 and will be removed in 3.0. Use Symfony\Component\Form\ChoiceList\ArrayChoiceList instead.', E_USER_DEPRECATED);
1515

1616
use Symfony\Component\Form\FormConfigBuilder;
1717
use Symfony\Component\Form\Exception\UnexpectedTypeException;
@@ -208,7 +208,7 @@ public function getValuesForChoices(array $choices)
208208
*/
209209
public function getIndicesForChoices(array $choices)
210210
{
211-
trigger_error('The '.__METHOD__.' method is deprecated since version 2.4 and will be removed in 3.0.', E_USER_DEPRECATED);
211+
@trigger_error('The '.__METHOD__.' method is deprecated since version 2.4 and will be removed in 3.0.', E_USER_DEPRECATED);
212212

213213
$choices = $this->fixChoices($choices);
214214
$indices = array();
@@ -236,7 +236,7 @@ public function getIndicesForChoices(array $choices)
236236
*/
237237
public function getIndicesForValues(array $values)
238238
{
239-
trigger_error('The '.__METHOD__.' method is deprecated since version 2.4 and will be removed in 3.0.', E_USER_DEPRECATED);
239+
@trigger_error('The '.__METHOD__.' method is deprecated since version 2.4 and will be removed in 3.0.', E_USER_DEPRECATED);
240240

241241
$values = $this->fixValues($values);
242242
$indices = array();

Extension/Core/ChoiceList/LazyChoiceList.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111

1212
namespace Symfony\Component\Form\Extension\Core\ChoiceList;
1313

14-
trigger_error('The '.__NAMESPACE__.'\LazyChoiceList class is deprecated since version 2.7 and will be removed in 3.0. Use Symfony\Component\Form\ChoiceList\ArrayChoiceList instead.', E_USER_DEPRECATED);
14+
@trigger_error('The '.__NAMESPACE__.'\LazyChoiceList class is deprecated since version 2.7 and will be removed in 3.0. Use Symfony\Component\Form\ChoiceList\ArrayChoiceList instead.', E_USER_DEPRECATED);
1515

1616
use Symfony\Component\Form\Exception\InvalidArgumentException;
1717

@@ -115,7 +115,7 @@ public function getValuesForChoices(array $choices)
115115
*/
116116
public function getIndicesForChoices(array $choices)
117117
{
118-
trigger_error('The '.__METHOD__.' method is deprecated since version 2.4 and will be removed in 3.0.', E_USER_DEPRECATED);
118+
@trigger_error('The '.__METHOD__.' method is deprecated since version 2.4 and will be removed in 3.0.', E_USER_DEPRECATED);
119119

120120
if (!$this->choiceList) {
121121
$this->load();
@@ -131,7 +131,7 @@ public function getIndicesForChoices(array $choices)
131131
*/
132132
public function getIndicesForValues(array $values)
133133
{
134-
trigger_error('The '.__METHOD__.' method is deprecated since version 2.4 and will be removed in 3.0.', E_USER_DEPRECATED);
134+
@trigger_error('The '.__METHOD__.' method is deprecated since version 2.4 and will be removed in 3.0.', E_USER_DEPRECATED);
135135

136136
if (!$this->choiceList) {
137137
$this->load();

Extension/Core/ChoiceList/ObjectChoiceList.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111

1212
namespace Symfony\Component\Form\Extension\Core\ChoiceList;
1313

14-
trigger_error('The '.__NAMESPACE__.'\ObjectChoiceList class is deprecated since version 2.7 and will be removed in 3.0. Use Symfony\Component\Form\ChoiceList\ArrayChoiceList instead.', E_USER_DEPRECATED);
14+
@trigger_error('The '.__NAMESPACE__.'\ObjectChoiceList class is deprecated since version 2.7 and will be removed in 3.0. Use Symfony\Component\Form\ChoiceList\ArrayChoiceList instead.', E_USER_DEPRECATED);
1515

1616
use Symfony\Component\Form\Exception\StringCastException;
1717
use Symfony\Component\Form\Exception\InvalidArgumentException;
@@ -196,7 +196,7 @@ public function getValuesForChoices(array $choices)
196196
*/
197197
public function getIndicesForChoices(array $choices)
198198
{
199-
trigger_error('The '.__METHOD__.' method is deprecated since version 2.4 and will be removed in 3.0.', E_USER_DEPRECATED);
199+
@trigger_error('The '.__METHOD__.' method is deprecated since version 2.4 and will be removed in 3.0.', E_USER_DEPRECATED);
200200

201201
if (!$this->valuePath) {
202202
return parent::getIndicesForChoices($choices);

Extension/Core/ChoiceList/SimpleChoiceList.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111

1212
namespace Symfony\Component\Form\Extension\Core\ChoiceList;
1313

14-
trigger_error('The '.__NAMESPACE__.'\SimpleChoiceList class is deprecated since version 2.7 and will be removed in 3.0. Use Symfony\Component\Form\ChoiceList\ArrayChoiceList instead.', E_USER_DEPRECATED);
14+
@trigger_error('The '.__NAMESPACE__.'\SimpleChoiceList class is deprecated since version 2.7 and will be removed in 3.0. Use Symfony\Component\Form\ChoiceList\ArrayChoiceList instead.', E_USER_DEPRECATED);
1515

1616
/**
1717
* A choice list for choices of type string or integer.

Extension/Core/DataTransformer/ChoiceToBooleanArrayTransformer.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111

1212
namespace Symfony\Component\Form\Extension\Core\DataTransformer;
1313

14-
trigger_error('The class '.__NAMESPACE__.'\ChoiceToBooleanArrayTransformer is deprecated since version 2.7 and will be removed in 3.0. Use Symfony\Component\Form\Extension\Core\DataMapper\RadioListMapper instead.', E_USER_DEPRECATED);
14+
@trigger_error('The class '.__NAMESPACE__.'\ChoiceToBooleanArrayTransformer is deprecated since version 2.7 and will be removed in 3.0. Use Symfony\Component\Form\Extension\Core\DataMapper\RadioListMapper instead.', E_USER_DEPRECATED);
1515

1616
use Symfony\Component\Form\ChoiceList\ChoiceListInterface;
1717
use Symfony\Component\Form\DataTransformerInterface;

0 commit comments

Comments
 (0)