[Form] Cleanup deprecation notices

This commit is contained in:
Nicolas Grekas 2015-04-07 19:06:04 +02:00
parent c0ddd3da26
commit 3f58862513
13 changed files with 55 additions and 72 deletions

View File

@ -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 <bschussek@gmail.com>
*
* @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.
@ -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 <bschussek@gmail.com>
*/
class ChoiceView extends LegacyChoiceView
{
/**
* Additional attributes for the HTML tag.
*
@ -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;
}
}

View File

@ -34,7 +34,7 @@ use Symfony\Component\Form\Extension\Core\View\ChoiceView;
*
* @author Bernhard Schussek <bschussek@gmail.com>
*
* @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

View File

@ -28,7 +28,7 @@ use Symfony\Component\Form\ChoiceList\ChoiceListInterface as BaseChoiceListInter
*
* @author Bernhard Schussek <bschussek@gmail.com>
*
* @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

View File

@ -22,9 +22,8 @@ use Symfony\Component\Form\Exception\InvalidArgumentException;
*
* @author Bernhard Schussek <bschussek@gmail.com>
*
* @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
{

View File

@ -33,9 +33,8 @@ use Symfony\Component\PropertyAccess\PropertyAccessorInterface;
*
* @author Bernhard Schussek <bschussek@gmail.com>
*
* @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
{

View File

@ -29,9 +29,8 @@ namespace Symfony\Component\Form\Extension\Core\ChoiceList;
*
* @author Bernhard Schussek <bschussek@gmail.com>
*
* @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
{

View File

@ -18,9 +18,8 @@ use Symfony\Component\Form\Exception\TransformationFailedException;
/**
* @author Bernhard Schussek <bschussek@gmail.com>
*
* @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
{

View File

@ -18,9 +18,8 @@ use Symfony\Component\Form\Exception\TransformationFailedException;
/**
* @author Bernhard Schussek <bschussek@gmail.com>
*
* @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
{

View File

@ -23,9 +23,8 @@ use Symfony\Component\Form\FormEvents;
*
* @author Bernhard Schussek <bschussek@gmail.com>
*
* @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
{

View File

@ -22,9 +22,8 @@ use Symfony\Component\Form\FormEvents;
*
* @author Bernhard Schussek <bschussek@gmail.com>
*
* @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
{

View File

@ -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 <bschussek@gmail.com>
*
* @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');

View File

@ -64,7 +64,7 @@ interface FormTypeExtensionInterface
*
* @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
*/

View File

@ -73,7 +73,7 @@ interface FormTypeInterface
*
* @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.
*/