Skip to content

Commit 4449433

Browse files
bug #14900 Silence deprecation warnings by default (reecefowell)
This PR was merged into the 2.7 branch. Discussion ---------- [RFC] Fixing Deprecation Warnings This PR address an issue that causes Symfony to vomit E_DEPRECATED warnings everywhere. ```markdown | Q | A | ------------- | --- | Bug fix? | yes | New feature? | no | BC breaks? | no | Deprecations? | no | Tests pass? | yes | Fixed tickets | #14899 | License | MIT ``` Fixes #14899 ![http://cdn.meme.am/instances2/500x/125359.jpg](http://cdn.meme.am/instances2/500x/125359.jpg) Commits ------- 73bbaa6 Silence invasive deprecation warnings, opt-in for warnings
2 parents 27dcb8b + 5b85ade commit 4449433

35 files changed

+51
-51
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
}

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;

Extension/Core/DataTransformer/ChoicesToBooleanArrayTransformer.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__.'\ChoicesToBooleanArrayTransformer is deprecated since version 2.7 and will be removed in 3.0. Use Symfony\Component\Form\Extension\Core\DataMapper\CheckboxListMapper instead.', E_USER_DEPRECATED);
14+
@trigger_error('The class '.__NAMESPACE__.'\ChoicesToBooleanArrayTransformer is deprecated since version 2.7 and will be removed in 3.0. Use Symfony\Component\Form\Extension\Core\DataMapper\CheckboxListMapper instead.', E_USER_DEPRECATED);
1515

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

Extension/Core/EventListener/FixCheckboxInputListener.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\EventListener;
1313

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

1616
use Symfony\Component\EventDispatcher\EventSubscriberInterface;
1717
use Symfony\Component\Form\ChoiceList\ChoiceListInterface;
@@ -91,7 +91,7 @@ public function preSubmit(FormEvent $event)
9191
*/
9292
public function preBind(FormEvent $event)
9393
{
94-
trigger_error('The '.__METHOD__.' method is deprecated since version 2.3 and will be removed in 3.0. Use the preSubmit() method instead.', E_USER_DEPRECATED);
94+
@trigger_error('The '.__METHOD__.' method is deprecated since version 2.3 and will be removed in 3.0. Use the preSubmit() method instead.', E_USER_DEPRECATED);
9595

9696
$this->preSubmit($event);
9797
}

0 commit comments

Comments
 (0)