Thanks to visit codestin.com
Credit goes to github.com

Skip to content

[Form] Cleanup deprecation notices #14258

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

Merged
merged 1 commit into from
Apr 8, 2015
Merged
Show file tree
Hide file tree
Changes from all commits
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
40 changes: 33 additions & 7 deletions src/Symfony/Component/Form/ChoiceList/View/ChoiceView.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,16 +9,17 @@
* file that was distributed with this source code.
*/

namespace Symfony\Component\Form\ChoiceList\View;

use Symfony\Component\Form\Extension\Core\View\ChoiceView as LegacyChoiceView;
namespace Symfony\Component\Form\Extension\Core\View;

/**
* Represents a choice in templates.
*
* @author Bernhard Schussek <[email protected]>
*
* @deprecated since version 2.7, to be removed in 3.0.
* Use {@link \Symfony\Component\Form\ChoiceList\View\ChoiceView} instead.
*/
class ChoiceView extends LegacyChoiceView
class ChoiceView
{
/**
* The label displayed to humans.
Expand All @@ -41,6 +42,32 @@ class ChoiceView extends LegacyChoiceView
*/
public $data;

/**
* Creates a new ChoiceView.
*
* @param mixed $data The original choice.
* @param string $value The view representation of the choice.
* @param string $label The label displayed to humans.
*/
public function __construct($data, $value, $label)
{
$this->data = $data;
$this->value = $value;
$this->label = $label;
}
}

namespace Symfony\Component\Form\ChoiceList\View;

use Symfony\Component\Form\Extension\Core\View\ChoiceView as LegacyChoiceView;

/**
* Represents a choice in templates.
*
* @author Bernhard Schussek <[email protected]>
*/
class ChoiceView extends LegacyChoiceView
{
/**
* Additional attributes for the HTML tag.
*
Expand All @@ -58,9 +85,8 @@ class ChoiceView extends LegacyChoiceView
*/
public function __construct($label, $value, $data, array $attr = array())
{
$this->label = $label;
$this->value = $value;
$this->data = $data;
parent::__construct($data, $value, $label);

$this->attr = $attr;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
*
* @author Bernhard Schussek <[email protected]>
*
* @deprecated Deprecated since Symfony 2.7, to be removed in Symfony 3.0.
* @deprecated since version 2.7, to be removed in 3.0.
* Use {@link \Symfony\Component\Form\ChoiceList\ArrayChoiceList} instead.
*/
class ChoiceList implements ChoiceListInterface
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
*
* @author Bernhard Schussek <[email protected]>
*
* @deprecated Deprecated since Symfony 2.7, to be removed in Symfony 3.0.
* @deprecated since version 2.7, to be removed in 3.0.
* Use {@link BaseChoiceListInterface} instead.
*/
interface ChoiceListInterface extends BaseChoiceListInterface
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,8 @@
*
* @author Bernhard Schussek <[email protected]>
*
* @deprecated Deprecated since Symfony 2.7, to be removed in Symfony 3.0.
* Use {@link \Symfony\Component\Form\ChoiceList\LazyChoiceList}
* instead.
* @deprecated since version 2.7, to be removed in 3.0.
* Use {@link \Symfony\Component\Form\ChoiceList\LazyChoiceList} instead.
*/
abstract class LazyChoiceList implements ChoiceListInterface
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,8 @@
*
* @author Bernhard Schussek <[email protected]>
*
* @deprecated Deprecated since Symfony 2.7, to be removed in Symfony 3.0.
* Use {@link \Symfony\Component\Form\ChoiceList\ArrayChoiceList}
* instead.
* @deprecated since Symfony 2.7, to be removed in version 3.0.
* Use {@link \Symfony\Component\Form\ChoiceList\ArrayChoiceList} instead.
*/
class ObjectChoiceList extends ChoiceList
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,8 @@
*
* @author Bernhard Schussek <[email protected]>
*
* @deprecated Deprecated since Symfony 2.7, to be removed in Symfony 3.0.
* Use {@link \Symfony\Component\Form\ChoiceList\ArrayChoiceList}
* instead.
* @deprecated since version 2.7, to be removed in 3.0.
* Use {@link \Symfony\Component\Form\ChoiceList\ArrayChoiceList} instead.
*/
class SimpleChoiceList extends ChoiceList
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,8 @@
/**
* @author Bernhard Schussek <[email protected]>
*
* @deprecated Deprecated since Symfony 2.7, to be removed in Symfony 3.0.
* Use {@link \Symfony\Component\Form\ChoiceList\LazyChoiceList}
* instead.
* @deprecated since version 2.7, to be removed in 3.0.
* Use {@link \Symfony\Component\Form\ChoiceList\LazyChoiceList} instead.
*/
class ChoiceToBooleanArrayTransformer implements DataTransformerInterface
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,8 @@
/**
* @author Bernhard Schussek <[email protected]>
*
* @deprecated Deprecated since Symfony 2.7, to be removed in Symfony 3.0.
* Use {@link \Symfony\Component\Form\ChoiceList\LazyChoiceList}
* instead.
* @deprecated since version 2.7, to be removed in 3.0.
* Use {@link \Symfony\Component\Form\ChoiceList\LazyChoiceList} instead.
*/
class ChoicesToBooleanArrayTransformer implements DataTransformerInterface
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,8 @@
*
* @author Bernhard Schussek <[email protected]>
*
* @deprecated Deprecated since Symfony 2.7, to be removed in Symfony 3.0.
* Use {@link \Symfony\Component\Form\Extension\Core\DataMapper\CheckboxListMapper}
* instead.
* @deprecated since version 2.7, to be removed in 3.0.
* Use {@link \Symfony\Component\Form\Extension\Core\DataMapper\CheckboxListMapper} instead.
*/
class FixCheckboxInputListener implements EventSubscriberInterface
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,8 @@
*
* @author Bernhard Schussek <[email protected]>
*
* @deprecated Deprecated since Symfony 2.7, to be removed in Symfony 3.0.
* Use {@link \Symfony\Component\Form\Extension\Core\DataMapper\RadioListMapper}
* instead.
* @deprecated since version 2.7, to be removed in 3.0.
* Use {@link \Symfony\Component\Form\Extension\Core\DataMapper\RadioListMapper} instead.
*/
class FixRadioInputListener implements EventSubscriberInterface
{
Expand Down
44 changes: 4 additions & 40 deletions src/Symfony/Component/Form/Extension/Core/View/ChoiceView.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,50 +11,14 @@

namespace Symfony\Component\Form\Extension\Core\View;

trigger_error('The '.__NAMESPACE__.'\ChoiceView class is deprecated since version 2.7 and will be removed in 3.0. Use Symfony\Component\Form\ChoiceList\View\ChoiceView instead.', E_USER_DEPRECATED);

/**
* Represents a choice in templates.
*
* @author Bernhard Schussek <[email protected]>
*
* @deprecated Deprecated since Symfony 2.7, to be removed in Symfony 3.0.
* @deprecated since version 2.7, to be removed in 3.0.
* Use {@link \Symfony\Component\Form\ChoiceList\View\ChoiceView} instead.
*/
class ChoiceView
{
/**
* The original choice value.
*
* @var mixed
*/
public $data;

/**
* The view representation of the choice.
*
* @var string
*/
public $value;

/**
* The label displayed to humans.
*
* @var string
*/
public $label;

/**
* Creates a new ChoiceView.
*
* @param mixed $data The original choice.
* @param string $value The view representation of the choice.
* @param string $label The label displayed to humans.
*/
public function __construct($data, $value, $label)
{
$this->data = $data;
$this->value = $value;
$this->label = $label;

trigger_error('The '.__CLASS__.' class is deprecated since version 2.7 and will be removed in 3.0. Use Symfony\Component\Form\ChoiceList\View\ChoiceView instead.', E_USER_DEPRECATED);
}
}
class_exists('Symfony\Component\Form\ChoiceList\View\ChoiceView');
2 changes: 1 addition & 1 deletion src/Symfony/Component/Form/FormTypeExtensionInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ public function finishView(FormView $view, FormInterface $form, array $options);
*
* @param OptionsResolverInterface $resolver The resolver for the options.
*
* @deprecated Deprecated since Symfony 2.7, to be removed in Symfony 3.0.
* @deprecated since version 2.7, to be removed in 3.0.
* Use the method configureOptions instead. This method will be
* added to the FormTypeExtensionInterface with Symfony 3.0
*/
Expand Down
2 changes: 1 addition & 1 deletion src/Symfony/Component/Form/FormTypeInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ public function finishView(FormView $view, FormInterface $form, array $options);
*
* @param OptionsResolverInterface $resolver The resolver for the options.
*
* @deprecated Deprecated since Symfony 2.7, to be renamed in Symfony 3.0.
* @deprecated since version 2.7, to be renamed in 3.0.
* Use the method configureOptions instead. This method will be
* added to the FormTypeInterface with Symfony 3.0.
*/
Expand Down