Skip to content

Commit 56a590d

Browse files
[Form] Cleanup deprecation notices
1 parent 7194701 commit 56a590d

13 files changed

+55
-72
lines changed

ChoiceList/View/ChoiceView.php

Lines changed: 33 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -9,16 +9,17 @@
99
* file that was distributed with this source code.
1010
*/
1111

12-
namespace Symfony\Component\Form\ChoiceList\View;
13-
14-
use Symfony\Component\Form\Extension\Core\View\ChoiceView as LegacyChoiceView;
12+
namespace Symfony\Component\Form\Extension\Core\View;
1513

1614
/**
1715
* Represents a choice in templates.
1816
*
1917
* @author Bernhard Schussek <[email protected]>
18+
*
19+
* @deprecated since version 2.7, to be removed in 3.0.
20+
* Use {@link \Symfony\Component\Form\ChoiceList\View\ChoiceView} instead.
2021
*/
21-
class ChoiceView extends LegacyChoiceView
22+
class ChoiceView
2223
{
2324
/**
2425
* The label displayed to humans.
@@ -41,6 +42,32 @@ class ChoiceView extends LegacyChoiceView
4142
*/
4243
public $data;
4344

45+
/**
46+
* Creates a new ChoiceView.
47+
*
48+
* @param mixed $data The original choice.
49+
* @param string $value The view representation of the choice.
50+
* @param string $label The label displayed to humans.
51+
*/
52+
public function __construct($data, $value, $label)
53+
{
54+
$this->data = $data;
55+
$this->value = $value;
56+
$this->label = $label;
57+
}
58+
}
59+
60+
namespace Symfony\Component\Form\ChoiceList\View;
61+
62+
use Symfony\Component\Form\Extension\Core\View\ChoiceView as LegacyChoiceView;
63+
64+
/**
65+
* Represents a choice in templates.
66+
*
67+
* @author Bernhard Schussek <[email protected]>
68+
*/
69+
class ChoiceView extends LegacyChoiceView
70+
{
4471
/**
4572
* Additional attributes for the HTML tag.
4673
*
@@ -58,9 +85,8 @@ class ChoiceView extends LegacyChoiceView
5885
*/
5986
public function __construct($label, $value, $data, array $attr = array())
6087
{
61-
$this->label = $label;
62-
$this->value = $value;
63-
$this->data = $data;
88+
parent::__construct($data, $value, $label);
89+
6490
$this->attr = $attr;
6591
}
6692
}

Extension/Core/ChoiceList/ChoiceList.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@
3434
*
3535
* @author Bernhard Schussek <[email protected]>
3636
*
37-
* @deprecated Deprecated since Symfony 2.7, to be removed in Symfony 3.0.
37+
* @deprecated since version 2.7, to be removed in 3.0.
3838
* Use {@link \Symfony\Component\Form\ChoiceList\ArrayChoiceList} instead.
3939
*/
4040
class ChoiceList implements ChoiceListInterface

Extension/Core/ChoiceList/ChoiceListInterface.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
2828
*
2929
* @author Bernhard Schussek <[email protected]>
3030
*
31-
* @deprecated Deprecated since Symfony 2.7, to be removed in Symfony 3.0.
31+
* @deprecated since version 2.7, to be removed in 3.0.
3232
* Use {@link BaseChoiceListInterface} instead.
3333
*/
3434
interface ChoiceListInterface extends BaseChoiceListInterface

Extension/Core/ChoiceList/LazyChoiceList.php

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,9 +22,8 @@
2222
*
2323
* @author Bernhard Schussek <[email protected]>
2424
*
25-
* @deprecated Deprecated since Symfony 2.7, to be removed in Symfony 3.0.
26-
* Use {@link \Symfony\Component\Form\ChoiceList\LazyChoiceList}
27-
* instead.
25+
* @deprecated since version 2.7, to be removed in 3.0.
26+
* Use {@link \Symfony\Component\Form\ChoiceList\LazyChoiceList} instead.
2827
*/
2928
abstract class LazyChoiceList implements ChoiceListInterface
3029
{

Extension/Core/ChoiceList/ObjectChoiceList.php

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -33,9 +33,8 @@
3333
*
3434
* @author Bernhard Schussek <[email protected]>
3535
*
36-
* @deprecated Deprecated since Symfony 2.7, to be removed in Symfony 3.0.
37-
* Use {@link \Symfony\Component\Form\ChoiceList\ArrayChoiceList}
38-
* instead.
36+
* @deprecated since Symfony 2.7, to be removed in version 3.0.
37+
* Use {@link \Symfony\Component\Form\ChoiceList\ArrayChoiceList} instead.
3938
*/
4039
class ObjectChoiceList extends ChoiceList
4140
{

Extension/Core/ChoiceList/SimpleChoiceList.php

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,9 +29,8 @@
2929
*
3030
* @author Bernhard Schussek <[email protected]>
3131
*
32-
* @deprecated Deprecated since Symfony 2.7, to be removed in Symfony 3.0.
33-
* Use {@link \Symfony\Component\Form\ChoiceList\ArrayChoiceList}
34-
* instead.
32+
* @deprecated since version 2.7, to be removed in 3.0.
33+
* Use {@link \Symfony\Component\Form\ChoiceList\ArrayChoiceList} instead.
3534
*/
3635
class SimpleChoiceList extends ChoiceList
3736
{

Extension/Core/DataTransformer/ChoiceToBooleanArrayTransformer.php

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,8 @@
1818
/**
1919
* @author Bernhard Schussek <[email protected]>
2020
*
21-
* @deprecated Deprecated since Symfony 2.7, to be removed in Symfony 3.0.
22-
* Use {@link \Symfony\Component\Form\ChoiceList\LazyChoiceList}
23-
* instead.
21+
* @deprecated since version 2.7, to be removed in 3.0.
22+
* Use {@link \Symfony\Component\Form\ChoiceList\LazyChoiceList} instead.
2423
*/
2524
class ChoiceToBooleanArrayTransformer implements DataTransformerInterface
2625
{

Extension/Core/DataTransformer/ChoicesToBooleanArrayTransformer.php

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,8 @@
1818
/**
1919
* @author Bernhard Schussek <[email protected]>
2020
*
21-
* @deprecated Deprecated since Symfony 2.7, to be removed in Symfony 3.0.
22-
* Use {@link \Symfony\Component\Form\ChoiceList\LazyChoiceList}
23-
* instead.
21+
* @deprecated since version 2.7, to be removed in 3.0.
22+
* Use {@link \Symfony\Component\Form\ChoiceList\LazyChoiceList} instead.
2423
*/
2524
class ChoicesToBooleanArrayTransformer implements DataTransformerInterface
2625
{

Extension/Core/EventListener/FixCheckboxInputListener.php

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,9 +23,8 @@
2323
*
2424
* @author Bernhard Schussek <[email protected]>
2525
*
26-
* @deprecated Deprecated since Symfony 2.7, to be removed in Symfony 3.0.
27-
* Use {@link \Symfony\Component\Form\Extension\Core\DataMapper\CheckboxListMapper}
28-
* instead.
26+
* @deprecated since version 2.7, to be removed in 3.0.
27+
* Use {@link \Symfony\Component\Form\Extension\Core\DataMapper\CheckboxListMapper} instead.
2928
*/
3029
class FixCheckboxInputListener implements EventSubscriberInterface
3130
{

Extension/Core/EventListener/FixRadioInputListener.php

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,9 +22,8 @@
2222
*
2323
* @author Bernhard Schussek <[email protected]>
2424
*
25-
* @deprecated Deprecated since Symfony 2.7, to be removed in Symfony 3.0.
26-
* Use {@link \Symfony\Component\Form\Extension\Core\DataMapper\RadioListMapper}
27-
* instead.
25+
* @deprecated since version 2.7, to be removed in 3.0.
26+
* Use {@link \Symfony\Component\Form\Extension\Core\DataMapper\RadioListMapper} instead.
2827
*/
2928
class FixRadioInputListener implements EventSubscriberInterface
3029
{

0 commit comments

Comments
 (0)