diff --git a/src/Symfony/Bridge/Doctrine/Form/DoctrineOrmTypeGuesser.php b/src/Symfony/Bridge/Doctrine/Form/DoctrineOrmTypeGuesser.php index ebe4ccc9203a..d857de7fcf3d 100644 --- a/src/Symfony/Bridge/Doctrine/Form/DoctrineOrmTypeGuesser.php +++ b/src/Symfony/Bridge/Doctrine/Form/DoctrineOrmTypeGuesser.php @@ -138,14 +138,6 @@ public function guessMaxLength($class, $property) } } - /** - * {@inheritDoc} - */ - public function guessMinLength($class, $property) - { - trigger_error('guessMinLength() is deprecated since version 2.1 and will be removed in 2.3.', E_USER_DEPRECATED); - } - /** * {@inheritDoc} */ diff --git a/src/Symfony/Bridge/Propel1/Form/PropelTypeGuesser.php b/src/Symfony/Bridge/Propel1/Form/PropelTypeGuesser.php index a75b046a66b4..9f36afafec18 100644 --- a/src/Symfony/Bridge/Propel1/Form/PropelTypeGuesser.php +++ b/src/Symfony/Bridge/Propel1/Form/PropelTypeGuesser.php @@ -129,14 +129,6 @@ public function guessMaxLength($class, $property) } } - /** - * {@inheritDoc} - */ - public function guessMinLength($class, $property) - { - trigger_error('guessMinLength() is deprecated since version 2.1 and will be removed in 2.3.', E_USER_DEPRECATED); - } - /** * {@inheritDoc} */ diff --git a/src/Symfony/Component/Form/AbstractType.php b/src/Symfony/Component/Form/AbstractType.php index 8769415ea6ed..6f7f5da653b1 100644 --- a/src/Symfony/Component/Form/AbstractType.php +++ b/src/Symfony/Component/Form/AbstractType.php @@ -18,13 +18,6 @@ */ abstract class AbstractType implements FormTypeInterface { - /** - * @var array - * - * @deprecated Deprecated since version 2.1, to be removed in 2.3. - */ - private $extensions = array(); - /** * {@inheritdoc} */ @@ -51,50 +44,6 @@ public function finishView(FormView $view, FormInterface $form, array $options) */ public function setDefaultOptions(OptionsResolverInterface $resolver) { - $defaults = $this->getDefaultOptions(array()); - $allowedTypes = $this->getAllowedOptionValues(array()); - - if (!empty($defaults)) { - trigger_error('getDefaultOptions() is deprecated since version 2.1 and will be removed in 2.3. Use setDefaultOptions() instead.', E_USER_DEPRECATED); - - $resolver->setDefaults($defaults); - } - - if (!empty($allowedTypes)) { - trigger_error('getAllowedOptionValues() is deprecated since version 2.1 and will be removed in 2.3. Use setDefaultOptions() instead.', E_USER_DEPRECATED); - - $resolver->addAllowedValues($allowedTypes); - } - } - - /** - * Returns the default options for this type. - * - * @param array $options Unsupported as of Symfony 2.1. - * - * @return array The default options - * - * @deprecated Deprecated since version 2.1, to be removed in 2.3. - * Use {@link setDefaultOptions()} instead. - */ - public function getDefaultOptions(array $options) - { - return array(); - } - - /** - * Returns the allowed option values for each option (if any). - * - * @param array $options Unsupported as of Symfony 2.1. - * - * @return array The allowed option values - * - * @deprecated Deprecated since version 2.1, to be removed in 2.3. - * Use {@link setDefaultOptions()} instead. - */ - public function getAllowedOptionValues(array $options) - { - return array(); } /** @@ -104,35 +53,4 @@ public function getParent() { return 'form'; } - - /** - * Sets the extensions for this type. - * - * @param FormTypeExtensionInterface[] $extensions An array of FormTypeExtensionInterface - * - * @throws Exception\UnexpectedTypeException if any extension does not implement FormTypeExtensionInterface - * - * @deprecated Deprecated since version 2.1, to be removed in 2.3. - */ - public function setExtensions(array $extensions) - { - trigger_error('setExtensions() is deprecated since version 2.1 and will be removed in 2.3.', E_USER_DEPRECATED); - - $this->extensions = $extensions; - } - - /** - * Returns the extensions associated with this type. - * - * @return FormTypeExtensionInterface[] An array of FormTypeExtensionInterface - * - * @deprecated Deprecated since version 2.1, to be removed in 2.3. Use - * {@link ResolvedFormTypeInterface::getTypeExtensions()} instead. - */ - public function getExtensions() - { - trigger_error('getExtensions() is deprecated since version 2.1 and will be removed in 2.3. Use ResolvedFormTypeInterface::getTypeExtensions instead.', E_USER_DEPRECATED); - - return $this->extensions; - } } diff --git a/src/Symfony/Component/Form/AbstractTypeExtension.php b/src/Symfony/Component/Form/AbstractTypeExtension.php index 3e51ed442b48..351c80097fa2 100644 --- a/src/Symfony/Component/Form/AbstractTypeExtension.php +++ b/src/Symfony/Component/Form/AbstractTypeExtension.php @@ -44,45 +44,5 @@ public function finishView(FormView $view, FormInterface $form, array $options) */ public function setDefaultOptions(OptionsResolverInterface $resolver) { - $defaults = $this->getDefaultOptions(array()); - $allowedTypes = $this->getAllowedOptionValues(array()); - - if (!empty($defaults)) { - trigger_error('getDefaultOptions() is deprecated since version 2.1 and will be removed in 2.3. Use setDefaultOptions() instead.', E_USER_DEPRECATED); - - $resolver->setDefaults($defaults); - } - - if (!empty($allowedTypes)) { - trigger_error('getAllowedOptionValues() is deprecated since version 2.1 and will be removed in 2.3. Use setDefaultOptions() instead.', E_USER_DEPRECATED); - - $resolver->addAllowedValues($allowedTypes); - } - } - - /** - * Overrides the default options form the extended type. - * - * @return array - * - * @deprecated Deprecated since version 2.1, to be removed in 2.3. - * Use {@link setDefaultOptions()} instead. - */ - public function getDefaultOptions() - { - return array(); - } - - /** - * Returns the allowed option values for each option (if any). - * - * @return array The allowed option values - * - * @deprecated Deprecated since version 2.1, to be removed in 2.3. - * Use {@link setDefaultOptions()} instead. - */ - public function getAllowedOptionValues() - { - return array(); } } diff --git a/src/Symfony/Component/Form/CallbackValidator.php b/src/Symfony/Component/Form/CallbackValidator.php deleted file mode 100644 index f769cc7cbdf9..000000000000 --- a/src/Symfony/Component/Form/CallbackValidator.php +++ /dev/null @@ -1,44 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Form; - -/** - * Deprecated. You should use FormEvents::POST_BIND event listeners instead. - * - * @author Bernhard Schussek - * - * @deprecated Deprecated since version 2.1, to be removed in 2.3. - */ -class CallbackValidator implements FormValidatorInterface -{ - private $callback; - - /** - * @deprecated Deprecated since version 2.1, to be removed in 2.3. - */ - public function __construct($callback) - { - trigger_error('CallbackValidator is deprecated since version 2.1 and will be removed in 2.3. Use the FormEvents::POST_BIND event instead.', E_USER_DEPRECATED); - - $this->callback = $callback; - } - - /** - * @deprecated Deprecated since version 2.1, to be removed in 2.3. - */ - public function validate(FormInterface $form) - { - trigger_error('validate() is deprecated since version 2.1 and will be removed in 2.3.', E_USER_DEPRECATED); - - return call_user_func($this->callback, $form); - } -} diff --git a/src/Symfony/Component/Form/Event/DataEvent.php b/src/Symfony/Component/Form/Event/DataEvent.php deleted file mode 100644 index 773968882318..000000000000 --- a/src/Symfony/Component/Form/Event/DataEvent.php +++ /dev/null @@ -1,74 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Form\Event; - -use Symfony\Component\EventDispatcher\Event; -use Symfony\Component\Form\FormInterface; -use Symfony\Component\Form\FormEvent; - -/** - * @author Bernhard Schussek - * - * @deprecated Deprecated since version 2.1, to be removed in 2.3. Code against - * {@link \Symfony\Component\Form\FormEvent} instead. - */ -class DataEvent extends Event -{ - private $form; - protected $data; - - /** - * Constructs an event. - * - * @param FormInterface $form The associated form - * @param mixed $data The data - */ - public function __construct(FormInterface $form, $data) - { - if (!$this instanceof FormEvent) { - trigger_error(sprintf('%s is deprecated since version 2.1 and will be removed in 2.3. Code against \Symfony\Component\Form\FormEvent instead.', get_class($this)), E_USER_DEPRECATED); - } - - $this->form = $form; - $this->data = $data; - } - - /** - * Returns the form at the source of the event. - * - * @return FormInterface - */ - public function getForm() - { - return $this->form; - } - - /** - * Returns the data associated with this event. - * - * @return mixed - */ - public function getData() - { - return $this->data; - } - - /** - * Allows updating with some filtered data. - * - * @param mixed $data - */ - public function setData($data) - { - $this->data = $data; - } -} diff --git a/src/Symfony/Component/Form/Event/FilterDataEvent.php b/src/Symfony/Component/Form/Event/FilterDataEvent.php deleted file mode 100644 index d20f483c6975..000000000000 --- a/src/Symfony/Component/Form/Event/FilterDataEvent.php +++ /dev/null @@ -1,22 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Form\Event; - -/** - * @author Bernhard Schussek - * - * @deprecated Deprecated since version 2.1, to be removed in 2.3. Code against - * {@link \Symfony\Component\Form\FormEvent} instead. - */ -class FilterDataEvent extends DataEvent -{ -} diff --git a/src/Symfony/Component/Form/Extension/Core/CoreExtension.php b/src/Symfony/Component/Form/Extension/Core/CoreExtension.php index ab6529d6dc56..ff7a1a3e0e68 100644 --- a/src/Symfony/Component/Form/Extension/Core/CoreExtension.php +++ b/src/Symfony/Component/Form/Extension/Core/CoreExtension.php @@ -24,7 +24,6 @@ class CoreExtension extends AbstractExtension protected function loadTypes() { return array( - new Type\FieldType(), new Type\FormType(PropertyAccess::getPropertyAccessor()), new Type\BirthdayType(), new Type\CheckboxType(), diff --git a/src/Symfony/Component/Form/Extension/Core/Type/CheckboxType.php b/src/Symfony/Component/Form/Extension/Core/Type/CheckboxType.php index 8d489d6db0cd..214e581aff61 100644 --- a/src/Symfony/Component/Form/Extension/Core/Type/CheckboxType.php +++ b/src/Symfony/Component/Form/Extension/Core/Type/CheckboxType.php @@ -57,14 +57,6 @@ public function setDefaultOptions(OptionsResolverInterface $resolver) )); } - /** - * {@inheritdoc} - */ - public function getParent() - { - return 'field'; - } - /** * {@inheritdoc} */ diff --git a/src/Symfony/Component/Form/Extension/Core/Type/ChoiceType.php b/src/Symfony/Component/Form/Extension/Core/Type/ChoiceType.php index 28327b6291a1..20d72d78545b 100644 --- a/src/Symfony/Component/Form/Extension/Core/Type/ChoiceType.php +++ b/src/Symfony/Component/Form/Extension/Core/Type/ChoiceType.php @@ -211,14 +211,6 @@ public function setDefaultOptions(OptionsResolverInterface $resolver) )); } - /** - * {@inheritdoc} - */ - public function getParent() - { - return 'field'; - } - /** * {@inheritdoc} */ diff --git a/src/Symfony/Component/Form/Extension/Core/Type/DateTimeType.php b/src/Symfony/Component/Form/Extension/Core/Type/DateTimeType.php index 1ffc0a155f02..383ab90b15c2 100644 --- a/src/Symfony/Component/Form/Extension/Core/Type/DateTimeType.php +++ b/src/Symfony/Component/Form/Extension/Core/Type/DateTimeType.php @@ -284,14 +284,6 @@ public function setDefaultOptions(OptionsResolverInterface $resolver) )); } - /** - * {@inheritdoc} - */ - public function getParent() - { - return 'field'; - } - /** * {@inheritdoc} */ diff --git a/src/Symfony/Component/Form/Extension/Core/Type/DateType.php b/src/Symfony/Component/Form/Extension/Core/Type/DateType.php index 71ae631c673b..ad5914aae8af 100644 --- a/src/Symfony/Component/Form/Extension/Core/Type/DateType.php +++ b/src/Symfony/Component/Form/Extension/Core/Type/DateType.php @@ -247,14 +247,6 @@ public function setDefaultOptions(OptionsResolverInterface $resolver) )); } - /** - * {@inheritdoc} - */ - public function getParent() - { - return 'field'; - } - /** * {@inheritdoc} */ diff --git a/src/Symfony/Component/Form/Extension/Core/Type/FieldType.php b/src/Symfony/Component/Form/Extension/Core/Type/FieldType.php deleted file mode 100644 index dbafde1f65b6..000000000000 --- a/src/Symfony/Component/Form/Extension/Core/Type/FieldType.php +++ /dev/null @@ -1,32 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Form\Extension\Core\Type; - -use Symfony\Component\Form\AbstractType; - -/** - * Deprecated. You should extend FormType instead. - * - * @author Bernhard Schussek - * - * @deprecated Deprecated since version 2.1, to be removed in 2.3. - */ -class FieldType extends AbstractType -{ - /** - * {@inheritdoc} - */ - public function getName() - { - return 'field'; - } -} diff --git a/src/Symfony/Component/Form/Extension/Core/Type/FileType.php b/src/Symfony/Component/Form/Extension/Core/Type/FileType.php index d6c9932cc4f8..2c09da6f6b6c 100644 --- a/src/Symfony/Component/Form/Extension/Core/Type/FileType.php +++ b/src/Symfony/Component/Form/Extension/Core/Type/FileType.php @@ -51,14 +51,6 @@ public function setDefaultOptions(OptionsResolverInterface $resolver) )); } - /** - * {@inheritdoc} - */ - public function getParent() - { - return 'field'; - } - /** * {@inheritdoc} */ diff --git a/src/Symfony/Component/Form/Extension/Core/Type/FormType.php b/src/Symfony/Component/Form/Extension/Core/Type/FormType.php index 8e089bd4d6f4..26c1f0893410 100644 --- a/src/Symfony/Component/Form/Extension/Core/Type/FormType.php +++ b/src/Symfony/Component/Form/Extension/Core/Type/FormType.php @@ -45,8 +45,7 @@ public function buildForm(FormBuilderInterface $builder, array $options) ->setDisabled($options['disabled']) ->setErrorBubbling($options['error_bubbling']) ->setEmptyData($options['empty_data']) - // BC compatibility, when "property_path" could be false - ->setPropertyPath(is_string($options['property_path']) ? $options['property_path'] : null) + ->setPropertyPath($options['property_path']) ->setMapped($options['mapped']) ->setByReference($options['by_reference']) ->setVirtual($options['virtual']) @@ -56,10 +55,6 @@ public function buildForm(FormBuilderInterface $builder, array $options) ->setDataMapper($options['compound'] ? new PropertyPathMapper($this->propertyAccessor) : null) ; - if (false === $options['property_path']) { - trigger_error('Setting "property_path" to "false" is deprecated since version 2.1 and will be removed in 2.3. Set "mapped" to "false" instead.', E_USER_DEPRECATED); - } - if ($options['trim']) { $builder->addEventSubscriber(new TrimListener()); } @@ -200,11 +195,6 @@ public function setDefaultOptions(OptionsResolverInterface $resolver) return $options['compound']; }; - // BC clause: former property_path=false now equals mapped=false - $mapped = function (Options $options) { - return false !== $options['property_path']; - }; - // If data is given, the form is locked to that data // (independent of its value) $resolver->setOptional(array( @@ -222,7 +212,7 @@ public function setDefaultOptions(OptionsResolverInterface $resolver) 'max_length' => null, 'pattern' => null, 'property_path' => null, - 'mapped' => $mapped, + 'mapped' => true, 'by_reference' => true, 'error_bubbling' => $errorBubbling, 'label' => null, diff --git a/src/Symfony/Component/Form/Extension/Core/Type/HiddenType.php b/src/Symfony/Component/Form/Extension/Core/Type/HiddenType.php index fc1533648b02..bd4fa898e6e3 100644 --- a/src/Symfony/Component/Form/Extension/Core/Type/HiddenType.php +++ b/src/Symfony/Component/Form/Extension/Core/Type/HiddenType.php @@ -30,14 +30,6 @@ public function setDefaultOptions(OptionsResolverInterface $resolver) )); } - /** - * {@inheritdoc} - */ - public function getParent() - { - return 'field'; - } - /** * {@inheritdoc} */ diff --git a/src/Symfony/Component/Form/Extension/Core/Type/IntegerType.php b/src/Symfony/Component/Form/Extension/Core/Type/IntegerType.php index c3ab0546dade..b224cac5fd7e 100644 --- a/src/Symfony/Component/Form/Extension/Core/Type/IntegerType.php +++ b/src/Symfony/Component/Form/Extension/Core/Type/IntegerType.php @@ -58,14 +58,6 @@ public function setDefaultOptions(OptionsResolverInterface $resolver) )); } - /** - * {@inheritdoc} - */ - public function getParent() - { - return 'field'; - } - /** * {@inheritdoc} */ diff --git a/src/Symfony/Component/Form/Extension/Core/Type/MoneyType.php b/src/Symfony/Component/Form/Extension/Core/Type/MoneyType.php index 433e8dddfec5..9e36f9ce16eb 100644 --- a/src/Symfony/Component/Form/Extension/Core/Type/MoneyType.php +++ b/src/Symfony/Component/Form/Extension/Core/Type/MoneyType.php @@ -59,14 +59,6 @@ public function setDefaultOptions(OptionsResolverInterface $resolver) )); } - /** - * {@inheritdoc} - */ - public function getParent() - { - return 'field'; - } - /** * {@inheritdoc} */ diff --git a/src/Symfony/Component/Form/Extension/Core/Type/NumberType.php b/src/Symfony/Component/Form/Extension/Core/Type/NumberType.php index 93a3d9824e9a..beb3c89a4134 100644 --- a/src/Symfony/Component/Form/Extension/Core/Type/NumberType.php +++ b/src/Symfony/Component/Form/Extension/Core/Type/NumberType.php @@ -56,14 +56,6 @@ public function setDefaultOptions(OptionsResolverInterface $resolver) )); } - /** - * {@inheritdoc} - */ - public function getParent() - { - return 'field'; - } - /** * {@inheritdoc} */ diff --git a/src/Symfony/Component/Form/Extension/Core/Type/PercentType.php b/src/Symfony/Component/Form/Extension/Core/Type/PercentType.php index 52ca820e93cf..b1df94364d8d 100644 --- a/src/Symfony/Component/Form/Extension/Core/Type/PercentType.php +++ b/src/Symfony/Component/Form/Extension/Core/Type/PercentType.php @@ -45,14 +45,6 @@ public function setDefaultOptions(OptionsResolverInterface $resolver) )); } - /** - * {@inheritdoc} - */ - public function getParent() - { - return 'field'; - } - /** * {@inheritdoc} */ diff --git a/src/Symfony/Component/Form/Extension/Core/Type/TextType.php b/src/Symfony/Component/Form/Extension/Core/Type/TextType.php index ebfeaf6ac2bb..11503261c5cd 100644 --- a/src/Symfony/Component/Form/Extension/Core/Type/TextType.php +++ b/src/Symfony/Component/Form/Extension/Core/Type/TextType.php @@ -26,14 +26,6 @@ public function setDefaultOptions(OptionsResolverInterface $resolver) )); } - /** - * {@inheritdoc} - */ - public function getParent() - { - return 'field'; - } - /** * {@inheritdoc} */ diff --git a/src/Symfony/Component/Form/Extension/Core/Type/TimeType.php b/src/Symfony/Component/Form/Extension/Core/Type/TimeType.php index bc661f66b95e..22df9547f829 100644 --- a/src/Symfony/Component/Form/Extension/Core/Type/TimeType.php +++ b/src/Symfony/Component/Form/Extension/Core/Type/TimeType.php @@ -228,14 +228,6 @@ public function setDefaultOptions(OptionsResolverInterface $resolver) )); } - /** - * {@inheritdoc} - */ - public function getParent() - { - return 'field'; - } - /** * {@inheritdoc} */ diff --git a/src/Symfony/Component/Form/Extension/Validator/Type/FormTypeValidatorExtension.php b/src/Symfony/Component/Form/Extension/Validator/Type/FormTypeValidatorExtension.php index fe55ed79710d..6b9ac4e4f03c 100644 --- a/src/Symfony/Component/Form/Extension/Validator/Type/FormTypeValidatorExtension.php +++ b/src/Symfony/Component/Form/Extension/Validator/Type/FormTypeValidatorExtension.php @@ -53,11 +53,6 @@ public function buildForm(FormBuilderInterface $builder, array $options) */ public function setDefaultOptions(OptionsResolverInterface $resolver) { - // BC clause - $constraints = function (Options $options) { - return $options['validation_constraint']; - }; - // Make sure that validation groups end up as null, closure or array $validationGroupsNormalizer = function (Options $options, $groups) { if (empty($groups)) { @@ -79,9 +74,7 @@ public function setDefaultOptions(OptionsResolverInterface $resolver) $resolver->setDefaults(array( 'error_mapping' => array(), 'validation_groups' => null, - // "validation_constraint" is deprecated. Use "constraints". - 'validation_constraint' => null, - 'constraints' => $constraints, + 'constraints' => null, 'cascade_validation' => false, 'invalid_message' => 'This value is not valid.', 'invalid_message_parameters' => array(), diff --git a/src/Symfony/Component/Form/Extension/Validator/ValidatorTypeGuesser.php b/src/Symfony/Component/Form/Extension/Validator/ValidatorTypeGuesser.php index 387a724de2a5..dcd9cc552f63 100644 --- a/src/Symfony/Component/Form/Extension/Validator/ValidatorTypeGuesser.php +++ b/src/Symfony/Component/Form/Extension/Validator/ValidatorTypeGuesser.php @@ -65,14 +65,6 @@ public function guessMaxLength($class, $property) }); } - /** - * {@inheritDoc} - */ - public function guessMinLength($class, $property) - { - trigger_error('guessMinLength() is deprecated since version 2.1 and will be removed in 2.3.', E_USER_DEPRECATED); - } - /** * {@inheritDoc} */ diff --git a/src/Symfony/Component/Form/Form.php b/src/Symfony/Component/Form/Form.php index f1c8e5cc60d7..401d7a2872b9 100644 --- a/src/Symfony/Component/Form/Form.php +++ b/src/Symfony/Component/Form/Form.php @@ -16,7 +16,6 @@ use Symfony\Component\Form\Exception\AlreadyBoundException; use Symfony\Component\Form\Exception\TransformationFailedException; use Symfony\Component\Form\Util\FormUtil; -use Symfony\Component\HttpFoundation\Request; use Symfony\Component\PropertyAccess\PropertyPath; /** @@ -201,27 +200,6 @@ public function getPropertyPath() return new PropertyPath($this->getName()); } - /** - * Returns the types used by this form. - * - * @return FormTypeInterface[] An array of FormTypeInterface - * - * @deprecated Deprecated since version 2.1, to be removed in 2.3. Use - * {@link getConfig()} and {@link FormConfigInterface::getType()} instead. - */ - public function getTypes() - { - trigger_error('getTypes() is deprecated since version 2.1 and will be removed in 2.3. Use getConfig() and FormConfigInterface::getType() instead.', E_USER_DEPRECATED); - - $types = array(); - - for ($type = $this->config->getType(); null !== $type; $type = $type->getParent()) { - array_unshift($types, $type->getInnerType()); - } - - return $types; - } - /** * {@inheritdoc} */ @@ -272,21 +250,6 @@ public function getParent() return $this->parent; } - /** - * Returns whether the form has a parent. - * - * @return Boolean - * - * @deprecated Deprecated since version 2.1, to be removed in 2.3. Use - * {@link getParent()} or inverse {@link isRoot()} instead. - */ - public function hasParent() - { - trigger_error('hasParent() is deprecated since version 2.1 and will be removed in 2.3. Use getParent() or inverse isRoot() instead.', E_USER_DEPRECATED); - - return null !== $this->parent; - } - /** * {@inheritdoc} */ @@ -303,40 +266,6 @@ public function isRoot() return null === $this->parent; } - /** - * Returns whether the form has an attribute with the given name. - * - * @param string $name The name of the attribute. - * - * @return Boolean Whether the attribute exists. - * - * @deprecated Deprecated since version 2.1, to be removed in 2.3. Use - * {@link getConfig()} and {@link FormConfigInterface::hasAttribute()} instead. - */ - public function hasAttribute($name) - { - trigger_error('hasAttribute() is deprecated since version 2.1 and will be removed in 2.3. Use getConfig() and FormConfigInterface::hasAttribute() instead.', E_USER_DEPRECATED); - - return $this->config->hasAttribute($name); - } - - /** - * Returns the value of the attributes with the given name. - * - * @param string $name The name of the attribute - * - * @return mixed The attribute value. - * - * @deprecated Deprecated since version 2.1, to be removed in 2.3. Use - * {@link getConfig()} and {@link FormConfigInterface::getAttribute()} instead. - */ - public function getAttribute($name) - { - trigger_error('getAttribute() is deprecated since version 2.1 and will be removed in 2.3. Use getConfig() and FormConfigInterface::getAttribute() instead.', E_USER_DEPRECATED); - - return $this->config->getAttribute($name); - } - /** * {@inheritdoc} */ @@ -366,14 +295,9 @@ public function setData($modelData) $dispatcher = $this->config->getEventDispatcher(); // Hook to change content of the data - if ($dispatcher->hasListeners(FormEvents::PRE_SET_DATA) || $dispatcher->hasListeners(FormEvents::SET_DATA)) { + if ($dispatcher->hasListeners(FormEvents::PRE_SET_DATA)) { $event = new FormEvent($this, $modelData); $dispatcher->dispatch(FormEvents::PRE_SET_DATA, $event); - // BC until 2.3 - if ($dispatcher->hasListeners(FormEvents::SET_DATA)) { - trigger_error('The FormEvents::SET_DATA event is deprecated since 2.1 and will be removed in 2.3. Use the FormEvents::PRE_SET_DATA event instead.', E_USER_DEPRECATED); - } - $dispatcher->dispatch(FormEvents::SET_DATA, $event); $modelData = $event->getData(); } @@ -472,21 +396,6 @@ public function getViewData() return $this->viewData; } - /** - * Alias of {@link getViewData()}. - * - * @return string - * - * @deprecated Deprecated since version 2.1, to be removed in 2.3. Use - * {@link getViewData()} instead. - */ - public function getClientData() - { - trigger_error('getClientData() is deprecated since version 2.1 and will be removed in 2.3. Use getViewData() instead.', E_USER_DEPRECATED); - - return $this->getViewData(); - } - /** * {@inheritdoc} */ @@ -532,14 +441,9 @@ public function bind($submittedData) $dispatcher = $this->config->getEventDispatcher(); // Hook to change content of the data bound by the browser - if ($dispatcher->hasListeners(FormEvents::PRE_BIND) || $dispatcher->hasListeners(FormEvents::BIND_CLIENT_DATA)) { + if ($dispatcher->hasListeners(FormEvents::PRE_BIND)) { $event = new FormEvent($this, $submittedData); $dispatcher->dispatch(FormEvents::PRE_BIND, $event); - // BC until 2.3 - if ($dispatcher->hasListeners(FormEvents::BIND_CLIENT_DATA)) { - trigger_error('The FormEvents::BIND_CLIENT_DATA event is deprecated since 2.1 and will be removed in 2.3. Use the FormEvents::PRE_BIND event instead.', E_USER_DEPRECATED); - } - $dispatcher->dispatch(FormEvents::BIND_CLIENT_DATA, $event); $submittedData = $event->getData(); } @@ -595,14 +499,9 @@ public function bind($submittedData) // Hook to change content of the data into the normalized // representation - if ($dispatcher->hasListeners(FormEvents::BIND) || $dispatcher->hasListeners(FormEvents::BIND_NORM_DATA)) { + if ($dispatcher->hasListeners(FormEvents::BIND)) { $event = new FormEvent($this, $normData); $dispatcher->dispatch(FormEvents::BIND, $event); - // BC until 2.3 - if ($dispatcher->hasListeners(FormEvents::BIND_NORM_DATA)) { - trigger_error('The FormEvents::BIND_NORM_DATA event is deprecated since 2.1 and will be removed in 2.3. Use the FormEvents::BIND event instead.', E_USER_DEPRECATED); - } - $dispatcher->dispatch(FormEvents::BIND_NORM_DATA, $event); $normData = $event->getData(); } @@ -623,41 +522,9 @@ public function bind($submittedData) $dispatcher->dispatch(FormEvents::POST_BIND, $event); } - set_error_handler(array('Symfony\Component\Form\Test\DeprecationErrorHandler', 'handleBC')); - $validators = $this->config->getValidators(); - restore_error_handler(); - - foreach ($validators as $validator) { - trigger_error(sprintf('FormConfigInterface::getValidators() is deprecated since 2.1 and will be removed in 2.3. Convert your %s class to a listener on the FormEvents::POST_BIND event.', get_class($validator)), E_USER_DEPRECATED); - - $validator->validate($this); - } - return $this; } - /** - * Binds a request to the form. - * - * If the request method is POST, PUT or GET, the data is bound to the form, - * transformed and written into the form data (an object or an array). - * - * @param Request $request The request to bind to the form - * - * @return Form This form - * - * @throws FormException if the method of the request is not one of GET, POST or PUT - * - * @deprecated Deprecated since version 2.1, to be removed in 2.3. Use - * {@link FormConfigInterface::bind()} instead. - */ - public function bindRequest(Request $request) - { - trigger_error('bindRequest() is deprecated since version 2.1 and will be removed in 2.3. Use FormConfigInterface::bind() instead.', E_USER_DEPRECATED); - - return $this->bind($request); - } - /** * {@inheritdoc} */ @@ -672,21 +539,6 @@ public function addError(FormError $error) return $this; } - /** - * Returns whether errors bubble up to the parent. - * - * @return Boolean - * - * @deprecated Deprecated since version 2.1, to be removed in 2.3. Use - * {@link getConfig()} and {@link FormConfigInterface::getErrorBubbling()} instead. - */ - public function getErrorBubbling() - { - trigger_error('getErrorBubbling() is deprecated since version 2.1 and will be removed in 2.3. Use getConfig() and FormConfigInterface::getErrorBubbling() instead.', E_USER_DEPRECATED); - - return $this->config->getErrorBubbling(); - } - /** * {@inheritdoc} */ @@ -745,21 +597,6 @@ public function isValid() return true; } - /** - * Returns whether there are errors associated with this form. - * - * @return Boolean - * - * @deprecated Deprecated since version 2.1, to be removed in 2.3. Count - * {@link getErrors()} instead. - */ - public function hasErrors() - { - trigger_error('hasErrors() is deprecated since version 2.1 and will be removed in 2.3. Count getErrors() instead.', E_USER_DEPRECATED); - - return count($this->errors) > 0; - } - /** * {@inheritdoc} */ @@ -796,36 +633,6 @@ public function getErrorsAsString($level = 0) return $errors; } - /** - * Returns the model transformers of the form. - * - * @return DataTransformerInterface[] An array of DataTransformerInterface - * - * @deprecated Deprecated since version 2.1, to be removed in 2.3. Use - * {@link getConfig()} and {@link FormConfigInterface::getModelTransformers()} instead. - */ - public function getNormTransformers() - { - trigger_error('getNormTransformers() is deprecated since version 2.1 and will be removed in 2.3. Use getConfig() and FormConfigInterface::getModelTransformers() instead.', E_USER_DEPRECATED); - - return $this->config->getModelTransformers(); - } - - /** - * Returns the view transformers of the form. - * - * @return DataTransformerInterface[] An array of DataTransformerInterface - * - * @deprecated Deprecated since version 2.1, to be removed in 2.3. Use - * {@link getConfig()} and {@link FormConfigInterface::getViewTransformers()} instead. - */ - public function getClientTransformers() - { - trigger_error('getClientTransformers() is deprecated since version 2.1 and will be removed in 2.3. Use getConfig() and FormConfigInterface::getViewTransformers() instead.', E_USER_DEPRECATED); - - return $this->config->getViewTransformers(); - } - /** * {@inheritdoc} */ @@ -834,36 +641,6 @@ public function all() return $this->children; } - /** - * Returns all children in this group. - * - * @return array - * - * @deprecated Deprecated since version 2.1, to be removed in 2.3. Use - * {@link all()} instead. - */ - public function getChildren() - { - trigger_error('getChildren() is deprecated since version 2.1 and will be removed in 2.3. Use all() instead.', E_USER_DEPRECATED); - - return $this->all(); - } - - /** - * Returns whether the form has children. - * - * @return Boolean - * - * @deprecated Deprecated since version 2.1, to be removed in 2.3. Use - * {@link count()} instead. - */ - public function hasChildren() - { - trigger_error('hasChildren() is deprecated since version 2.1 and will be removed in 2.3. Use count() instead.', E_USER_DEPRECATED); - - return count($this->children) > 0; - } - /** * {@inheritdoc} */ diff --git a/src/Symfony/Component/Form/FormBuilder.php b/src/Symfony/Component/Form/FormBuilder.php index a47d969e0529..a626980c59a1 100644 --- a/src/Symfony/Component/Form/FormBuilder.php +++ b/src/Symfony/Component/Form/FormBuilder.php @@ -288,34 +288,6 @@ public function getIterator() return new \ArrayIterator($this->children); } - /** - * Returns the types used by this builder. - * - * @return FormTypeInterface[] An array of FormTypeInterface - * - * @deprecated Deprecated since version 2.1, to be removed in 2.3. Use - * {@link FormConfigInterface::getType()} instead. - * - * @throws BadMethodCallException If the builder was turned into a {@link FormConfigInterface} - * via {@link getFormConfig()}. - */ - public function getTypes() - { - trigger_error('getTypes() is deprecated since version 2.1 and will be removed in 2.3. Use getConfig() and FormConfigInterface::getType() instead.', E_USER_DEPRECATED); - - if ($this->locked) { - throw new BadMethodCallException('FormBuilder methods cannot be accessed anymore once the builder is turned into a FormConfigInterface instance.'); - } - - $types = array(); - - for ($type = $this->getType(); null !== $type; $type = $type->getParent()) { - array_unshift($types, $type->getInnerType()); - } - - return $types; - } - /** * Converts an unresolved child into a {@link FormBuilder} instance. * diff --git a/src/Symfony/Component/Form/FormBuilderInterface.php b/src/Symfony/Component/Form/FormBuilderInterface.php index 002bd43fc3eb..d862c49bf514 100644 --- a/src/Symfony/Component/Form/FormBuilderInterface.php +++ b/src/Symfony/Component/Form/FormBuilderInterface.php @@ -84,42 +84,4 @@ public function all(); * @return Form The form */ public function getForm(); - - /** - * Sets the parent builder. - * - * @param FormBuilderInterface $parent The parent builder - * - * @return FormBuilderInterface The builder object. - * - * @deprecated Deprecated since version 2.2, to be removed in 2.3. You - * should not rely on the parent of a builder, because it is - * likely that the parent is only set after turning the builder - * into a form. - */ - public function setParent(FormBuilderInterface $parent = null); - - /** - * Returns the parent builder. - * - * @return FormBuilderInterface The parent builder - * - * @deprecated Deprecated since version 2.2, to be removed in 2.3. You - * should not rely on the parent of a builder, because it is - * likely that the parent is only set after turning the builder - * into a form. - */ - public function getParent(); - - /** - * Returns whether the builder has a parent. - * - * @return Boolean - * - * @deprecated Deprecated since version 2.2, to be removed in 2.3. You - * should not rely on the parent of a builder, because it is - * likely that the parent is only set after turning the builder - * into a form. - */ - public function hasParent(); } diff --git a/src/Symfony/Component/Form/FormConfigBuilder.php b/src/Symfony/Component/Form/FormConfigBuilder.php index 5d1f3a2331a5..7d297ed33d3c 100644 --- a/src/Symfony/Component/Form/FormConfigBuilder.php +++ b/src/Symfony/Component/Form/FormConfigBuilder.php @@ -195,22 +195,6 @@ public function addEventSubscriber(EventSubscriberInterface $subscriber) return $this; } - /** - * {@inheritdoc} - */ - public function addValidator(FormValidatorInterface $validator) - { - trigger_error('addValidator() is deprecated since version 2.1 and will be removed in 2.3.', E_USER_DEPRECATED); - - if ($this->locked) { - throw new BadMethodCallException('FormConfigBuilder methods cannot be accessed anymore once the builder is turned into a FormConfigInterface instance.'); - } - - $this->validators[] = $validator; - - return $this; - } - /** * {@inheritdoc} */ @@ -243,72 +227,6 @@ public function resetViewTransformers() return $this; } - /** - * Alias of {@link addViewTransformer()}. - * - * @param DataTransformerInterface $viewTransformer - * - * @return FormConfigBuilder The configuration object. - * - * @throws BadMethodCallException if the form configuration is locked - * - * @deprecated Deprecated since version 2.1, to be removed in 2.3. Use - * {@link addViewTransformer()} instead. - */ - public function appendClientTransformer(DataTransformerInterface $viewTransformer) - { - trigger_error('appendClientTransformer() is deprecated since version 2.1 and will be removed in 2.3. Use addViewTransformer() instead.', E_USER_DEPRECATED); - - if ($this->locked) { - throw new BadMethodCallException('FormConfigBuilder methods cannot be accessed anymore once the builder is turned into a FormConfigInterface instance.'); - } - - return $this->addViewTransformer($viewTransformer); - } - - /** - * Prepends a transformer to the client transformer chain. - * - * @param DataTransformerInterface $viewTransformer - * - * @return FormConfigBuilder The configuration object. - * - * @throws BadMethodCallException if the form configuration is locked - * - * @deprecated Deprecated since version 2.1, to be removed in 2.3. - */ - public function prependClientTransformer(DataTransformerInterface $viewTransformer) - { - trigger_error('prependClientTransformer() is deprecated since version 2.1 and will be removed in 2.3.', E_USER_DEPRECATED); - - if ($this->locked) { - throw new BadMethodCallException('FormConfigBuilder methods cannot be accessed anymore once the builder is turned into a FormConfigInterface instance.'); - } - - return $this->addViewTransformer($viewTransformer, true); - } - - /** - * Alias of {@link resetViewTransformers()}. - * - * @return FormConfigBuilder The configuration object. - * - * @throws BadMethodCallException if the form configuration is locked - * - * @deprecated Deprecated since version 2.1, to be removed in 2.3. Use - * {@link resetViewTransformers()} instead. - */ - public function resetClientTransformers() - { - trigger_error('resetClientTransformers() is deprecated since version 2.1 and will be removed in 2.3. Use resetViewTransformers() instead.', E_USER_DEPRECATED); - - if ($this->locked) { - throw new BadMethodCallException('FormConfigBuilder methods cannot be accessed anymore once the builder is turned into a FormConfigInterface instance.'); - } - - return $this->resetViewTransformers(); - } - /** * {@inheritdoc} */ @@ -341,72 +259,6 @@ public function resetModelTransformers() return $this; } - /** - * Appends a transformer to the normalization transformer chain - * - * @param DataTransformerInterface $modelTransformer - * - * @return FormConfigBuilder The configuration object. - * - * @throws BadMethodCallException if the form configuration is locked - * - * @deprecated Deprecated since version 2.1, to be removed in 2.3. - */ - public function appendNormTransformer(DataTransformerInterface $modelTransformer) - { - trigger_error('appendNormTransformer() is deprecated since version 2.1 and will be removed in 2.3.', E_USER_DEPRECATED); - - if ($this->locked) { - throw new BadMethodCallException('FormConfigBuilder methods cannot be accessed anymore once the builder is turned into a FormConfigInterface instance.'); - } - - return $this->addModelTransformer($modelTransformer, true); - } - - /** - * Alias of {@link addModelTransformer()}. - * - * @param DataTransformerInterface $modelTransformer - * - * @return FormConfigBuilder The configuration object. - * - * @throws BadMethodCallException if the form configuration is locked - * - * @deprecated Deprecated since version 2.1, to be removed in 2.3. Use - * {@link addModelTransformer()} instead. - */ - public function prependNormTransformer(DataTransformerInterface $modelTransformer) - { - trigger_error('prependNormTransformer() is deprecated since version 2.1 and will be removed in 2.3. Use addModelTransformer() instead.', E_USER_DEPRECATED); - - if ($this->locked) { - throw new BadMethodCallException('FormConfigBuilder methods cannot be accessed anymore once the builder is turned into a FormConfigInterface instance.'); - } - - return $this->addModelTransformer($modelTransformer); - } - - /** - * Alias of {@link resetModelTransformers()}. - * - * @return FormConfigBuilder The configuration object. - * - * @throws BadMethodCallException if the form configuration is locked - * - * @deprecated Deprecated since version 2.1, to be removed in 2.3. Use - * {@link resetModelTransformers()} instead. - */ - public function resetNormTransformers() - { - trigger_error('resetNormTransformers() is deprecated since version 2.1 and will be removed in 2.3. Use resetModelTransformers() instead.', E_USER_DEPRECATED); - - if ($this->locked) { - throw new BadMethodCallException('FormConfigBuilder methods cannot be accessed anymore once the builder is turned into a FormConfigInterface instance.'); - } - - return $this->resetModelTransformers(); - } - /** * {@inheritdoc} */ @@ -479,21 +331,6 @@ public function getViewTransformers() return $this->viewTransformers; } - /** - * Alias of {@link getViewTransformers()}. - * - * @return array The view transformers. - * - * @deprecated Deprecated since version 2.1, to be removed in 2.3. Use - * {@link getViewTransformers()} instead. - */ - public function getClientTransformers() - { - trigger_error('getClientTransformers() is deprecated since version 2.1 and will be removed in 2.3. Use getViewTransformers() instead.', E_USER_DEPRECATED); - - return $this->getViewTransformers(); - } - /** * {@inheritdoc} */ @@ -502,21 +339,6 @@ public function getModelTransformers() return $this->modelTransformers; } - /** - * Alias of {@link getModelTransformers()}. - * - * @return array The model transformers. - * - * @deprecated Deprecated since version 2.1, to be removed in 2.3. Use - * {@link getModelTransformers()} instead. - */ - public function getNormTransformers() - { - trigger_error('getNormTransformers() is deprecated since version 2.1 and will be removed in 2.3. Use getModelTransformers() instead.', E_USER_DEPRECATED); - - return $this->getModelTransformers(); - } - /** * {@inheritdoc} */ @@ -525,16 +347,6 @@ public function getDataMapper() return $this->dataMapper; } - /** - * {@inheritdoc} - */ - public function getValidators() - { - trigger_error('getValidators() is deprecated since version 2.1 and will be removed in 2.3.', E_USER_DEPRECATED); - - return $this->validators; - } - /** * {@inheritdoc} */ diff --git a/src/Symfony/Component/Form/FormConfigBuilderInterface.php b/src/Symfony/Component/Form/FormConfigBuilderInterface.php index c63f0e8aaac3..c0d8c2b1f9bb 100644 --- a/src/Symfony/Component/Form/FormConfigBuilderInterface.php +++ b/src/Symfony/Component/Form/FormConfigBuilderInterface.php @@ -40,17 +40,6 @@ public function addEventListener($eventName, $listener, $priority = 0); */ public function addEventSubscriber(EventSubscriberInterface $subscriber); - /** - * Adds a validator to the form. - * - * @param FormValidatorInterface $validator The validator. - * - * @return self The configuration object. - * - * @deprecated Deprecated since version 2.1, to be removed in 2.3. - */ - public function addValidator(FormValidatorInterface $validator); - /** * Appends / prepends a transformer to the view transformer chain. * diff --git a/src/Symfony/Component/Form/FormConfigInterface.php b/src/Symfony/Component/Form/FormConfigInterface.php index 0a27c2a7fb01..002b54cfac90 100644 --- a/src/Symfony/Component/Form/FormConfigInterface.php +++ b/src/Symfony/Component/Form/FormConfigInterface.php @@ -104,15 +104,6 @@ public function getModelTransformers(); */ public function getDataMapper(); - /** - * Returns the validators of the form. - * - * @return FormValidatorInterface The form validator. - * - * @deprecated Deprecated since version 2.1, to be removed in 2.3. - */ - public function getValidators(); - /** * Returns whether the form is required. * diff --git a/src/Symfony/Component/Form/FormEvent.php b/src/Symfony/Component/Form/FormEvent.php index ed3fc7700654..57cebade65c3 100644 --- a/src/Symfony/Component/Form/FormEvent.php +++ b/src/Symfony/Component/Form/FormEvent.php @@ -11,11 +11,55 @@ namespace Symfony\Component\Form; -use Symfony\Component\Form\Event\FilterDataEvent; +use Symfony\Component\EventDispatcher\Event; /** * @author Bernhard Schussek */ -class FormEvent extends FilterDataEvent +class FormEvent extends Event { + private $form; + protected $data; + + /** + * Constructs an event. + * + * @param FormInterface $form The associated form + * @param mixed $data The data + */ + public function __construct(FormInterface $form, $data) + { + $this->form = $form; + $this->data = $data; + } + + /** + * Returns the form at the source of the event. + * + * @return FormInterface + */ + public function getForm() + { + return $this->form; + } + + /** + * Returns the data associated with this event. + * + * @return mixed + */ + public function getData() + { + return $this->data; + } + + /** + * Allows updating with some filtered data. + * + * @param mixed $data + */ + public function setData($data) + { + $this->data = $data; + } } diff --git a/src/Symfony/Component/Form/FormEvents.php b/src/Symfony/Component/Form/FormEvents.php index 6ddfe3e8e4b5..114bfcd22634 100644 --- a/src/Symfony/Component/Form/FormEvents.php +++ b/src/Symfony/Component/Form/FormEvents.php @@ -26,24 +26,6 @@ final class FormEvents const POST_SET_DATA = 'form.post_set_data'; - /** - * @deprecated Deprecated since version 2.1, to be removed in 2.3. - * Use {@link PRE_BIND} instead. - */ - const BIND_CLIENT_DATA = 'form.bind_client_data'; - - /** - * @deprecated Deprecated since version 2.1, to be removed in 2.3. - * Use {@link BIND} instead. - */ - const BIND_NORM_DATA = 'form.bind_norm_data'; - - /** - * @deprecated Deprecated since version 2.1, to be removed in 2.3. - * Use {@link PRE_SET_DATA} instead. - */ - const SET_DATA = 'form.set_data'; - private function __construct() { } diff --git a/src/Symfony/Component/Form/FormFactory.php b/src/Symfony/Component/Form/FormFactory.php index cf6c6c748fa1..36efc903d5c2 100644 --- a/src/Symfony/Component/Form/FormFactory.php +++ b/src/Symfony/Component/Form/FormFactory.php @@ -98,20 +98,14 @@ public function createBuilderForProperty($class, $property, $data = null, array $typeGuess = $guesser->guessType($class, $property); $maxLengthGuess = $guesser->guessMaxLength($class, $property); - // Keep $minLengthGuess for BC until Symfony 2.3 - set_error_handler(array('Symfony\Component\Form\Test\DeprecationErrorHandler', 'handleBC')); - $minLengthGuess = $guesser->guessMinLength($class, $property); - restore_error_handler(); $requiredGuess = $guesser->guessRequired($class, $property); $patternGuess = $guesser->guessPattern($class, $property); $type = $typeGuess ? $typeGuess->getType() : 'text'; $maxLength = $maxLengthGuess ? $maxLengthGuess->getValue() : null; - $minLength = $minLengthGuess ? $minLengthGuess->getValue() : null; $pattern = $patternGuess ? $patternGuess->getValue() : null; - // overrides $minLength, if set if (null !== $pattern) { $options = array_merge(array('pattern' => $pattern), $options); } @@ -120,10 +114,6 @@ public function createBuilderForProperty($class, $property, $data = null, array $options = array_merge(array('max_length' => $maxLength), $options); } - if (null !== $minLength && $minLength > 0) { - $options = array_merge(array('pattern' => '.{'.$minLength.','.$maxLength.'}'), $options); - } - if ($requiredGuess) { $options = array_merge(array('required' => $requiredGuess->getValue()), $options); } @@ -136,66 +126,6 @@ public function createBuilderForProperty($class, $property, $data = null, array return $this->createNamedBuilder($property, $type, $data, $options, $parent); } - /** - * Returns whether the given type is supported. - * - * @param string $name The name of the type - * - * @return Boolean Whether the type is supported - * - * @deprecated Deprecated since version 2.1, to be removed in 2.3. Use - * {@link FormRegistryInterface::hasType()} instead. - */ - public function hasType($name) - { - trigger_error('hasType() is deprecated since version 2.1 and will be removed in 2.3. Use FormRegistryInterface::hasType() instead.', E_USER_DEPRECATED); - - return $this->registry->hasType($name); - } - - /** - * Adds a type. - * - * @param FormTypeInterface $type The type - * - * @deprecated Deprecated since version 2.1, to be removed in 2.3. Use - * form extensions or type registration in the Dependency - * Injection Container instead. - */ - public function addType(FormTypeInterface $type) - { - trigger_error('addType() is deprecated since version 2.1 and will be removed in 2.3. Use form extensions or type registration in the Dependency Injection Container instead.', E_USER_DEPRECATED); - - $parentType = $type->getParent(); - - $this->registry->addType($this->resolvedTypeFactory->createResolvedType( - $type, - array(), - $parentType ? $this->registry->getType($parentType) : null - )); - } - - /** - * Returns a type by name. - * - * This methods registers the type extensions from the form extensions. - * - * @param string $name The name of the type - * - * @return FormTypeInterface The type - * - * @throws Exception\FormException if the type can not be retrieved from any extension - * - * @deprecated Deprecated since version 2.1, to be removed in 2.3. Use - * {@link FormRegistryInterface::getType()} instead. - */ - public function getType($name) - { - trigger_error('getType() is deprecated since version 2.1 and will be removed in 2.3. Use FormRegistryInterface::getType() instead.', E_USER_DEPRECATED); - - return $this->registry->getType($name)->getInnerType(); - } - /** * Wraps a type into a ResolvedFormTypeInterface implementation and connects * it with its parent type. diff --git a/src/Symfony/Component/Form/FormRegistry.php b/src/Symfony/Component/Form/FormRegistry.php index 53f6d906de3e..cb2599c93233 100644 --- a/src/Symfony/Component/Form/FormRegistry.php +++ b/src/Symfony/Component/Form/FormRegistry.php @@ -64,16 +64,6 @@ public function __construct(array $extensions, ResolvedFormTypeFactoryInterface $this->resolvedTypeFactory = $resolvedTypeFactory; } - /** - * {@inheritdoc} - */ - public function addType(ResolvedFormTypeInterface $type) - { - trigger_error('addType() is deprecated since version 2.1 and will be removed in 2.3. Use form extensions or type registration in the Dependency Injection Container instead.', E_USER_DEPRECATED); - - $this->types[$type->getName()] = $type; - } - /** * {@inheritdoc} */ @@ -132,13 +122,11 @@ private function resolveAndAddType(FormTypeInterface $type) ); } - set_error_handler(array('Symfony\Component\Form\Test\DeprecationErrorHandler', 'handleBC')); - $this->addType($this->resolvedTypeFactory->createResolvedType( + $this->types[$type->getName()] = $this->resolvedTypeFactory->createResolvedType( $type, $typeExtensions, $parentType ? $this->getType($parentType) : null - )); - restore_error_handler(); + ); } /** diff --git a/src/Symfony/Component/Form/FormRegistryInterface.php b/src/Symfony/Component/Form/FormRegistryInterface.php index 49915ad68a92..4edb9833c8d5 100644 --- a/src/Symfony/Component/Form/FormRegistryInterface.php +++ b/src/Symfony/Component/Form/FormRegistryInterface.php @@ -18,17 +18,6 @@ */ interface FormRegistryInterface { - /** - * Adds a form type. - * - * @param ResolvedFormTypeInterface $type The type - * - * @deprecated Deprecated since version 2.1, to be removed in 2.3. Use - * form extensions or type registration in the Dependency - * Injection Container instead. - */ - public function addType(ResolvedFormTypeInterface $type); - /** * Returns a form type by name. * diff --git a/src/Symfony/Component/Form/FormTypeGuesserChain.php b/src/Symfony/Component/Form/FormTypeGuesserChain.php index 5890e5b246c4..c7f8ece3709d 100644 --- a/src/Symfony/Component/Form/FormTypeGuesserChain.php +++ b/src/Symfony/Component/Form/FormTypeGuesserChain.php @@ -70,18 +70,6 @@ public function guessMaxLength($class, $property) }); } - /** - * {@inheritDoc} - */ - public function guessMinLength($class, $property) - { - trigger_error('guessMinLength() is deprecated since version 2.1 and will be removed in 2.3.', E_USER_DEPRECATED); - - return $this->guess(function ($guesser) use ($class, $property) { - return $guesser->guessMinLength($class, $property); - }); - } - /** * {@inheritDoc} */ diff --git a/src/Symfony/Component/Form/FormTypeGuesserInterface.php b/src/Symfony/Component/Form/FormTypeGuesserInterface.php index d5b570f33c04..e8b603faa1f0 100644 --- a/src/Symfony/Component/Form/FormTypeGuesserInterface.php +++ b/src/Symfony/Component/Form/FormTypeGuesserInterface.php @@ -46,18 +46,6 @@ public function guessRequired($class, $property); */ public function guessMaxLength($class, $property); - /** - * Returns a guess about the field's minimum length - * - * @param string $class The fully qualified class name - * @param string $property The name of the property to guess for - * - * @return Guess\Guess A guess for the field's minimum length - * - * @deprecated Deprecated since version 2.1, to be removed in 2.3. - */ - public function guessMinLength($class, $property); - /** * Returns a guess about the field's pattern * diff --git a/src/Symfony/Component/Form/FormValidatorInterface.php b/src/Symfony/Component/Form/FormValidatorInterface.php deleted file mode 100644 index 2fdd51f8313a..000000000000 --- a/src/Symfony/Component/Form/FormValidatorInterface.php +++ /dev/null @@ -1,28 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Form; - -/** - * This interface is deprecated. You should use a FormEvents::POST_BIND event - * listener instead. - * - * @author Bernhard Schussek - * - * @deprecated Deprecated since version 2.1, to be removed in 2.3. - */ -interface FormValidatorInterface -{ - /** - * @deprecated Deprecated since version 2.1, to be removed in 2.3. - */ - public function validate(FormInterface $form); -} diff --git a/src/Symfony/Component/Form/FormView.php b/src/Symfony/Component/Form/FormView.php index d4a3f93d82ca..8b9528c3b75f 100644 --- a/src/Symfony/Component/Form/FormView.php +++ b/src/Symfony/Component/Form/FormView.php @@ -53,124 +53,6 @@ public function __construct(FormView $parent = null) $this->parent = $parent; } - /** - * Returns the name of the form. - * - * @return string The form name. - * - * @deprecated Deprecated since version 2.1, to be removed in 2.3. Access - * the public property {@link vars} instead which contains an - * entry named "name". - */ - public function getName() - { - trigger_error('getName() is deprecated since version 2.1 and will be removed in 2.3. Access the public property \'vars\' instead which contains an entry named "name".', E_USER_DEPRECATED); - - return $this->vars['name']; - } - - /** - * @param string $name - * @param mixed $value - * - * @return FormView The current view - * - * @deprecated Deprecated since version 2.1, to be removed in 2.3. Access - * the public property {@link vars} instead. - */ - public function set($name, $value) - { - trigger_error('set() is deprecated since version 2.1 and will be removed in 2.3. Access the public property \'vars\' instead.', E_USER_DEPRECATED); - - $this->vars[$name] = $value; - - return $this; - } - - /** - * @param $name - * - * @return Boolean - * - * @deprecated Deprecated since version 2.1, to be removed in 2.3. Access - * the public property {@link vars} instead. - */ - public function has($name) - { - trigger_error('has() is deprecated since version 2.1 and will be removed in 2.3. Access the public property \'vars\' instead.', E_USER_DEPRECATED); - - return array_key_exists($name, $this->vars); - } - - /** - * @param $name - * @param $default - * - * @return mixed - * - * @deprecated Deprecated since version 2.1, to be removed in 2.3. Access - * the public property {@link vars} instead. - */ - public function get($name, $default = null) - { - trigger_error('get() is deprecated since version 2.1 and will be removed in 2.3. Access the public property \'vars\' instead.', E_USER_DEPRECATED); - - if (false === $this->has($name)) { - return $default; - } - - return $this->vars[$name]; - } - - /** - * @return array - * - * @deprecated Deprecated since version 2.1, to be removed in 2.3. Access - * the public property {@link vars} instead. - */ - public function all() - { - trigger_error('all() is deprecated since version 2.1 and will be removed in 2.3. Access the public property \'vars\' instead.', E_USER_DEPRECATED); - - return $this->vars; - } - - /** - * Returns the values of all view variables. - * - * @return array The values of all variables. - * - * @deprecated Deprecated since version 2.1, to be removed in 2.3. Access - * the public property {@link vars} instead. - */ - public function getVars() - { - trigger_error('getVars() is deprecated since version 2.1 and will be removed in 2.3. Access the public property \'vars\' instead.', E_USER_DEPRECATED); - - return $this->vars; - } - - /** - * Sets the value for an attribute. - * - * @param string $name The name of the attribute - * @param string $value The value - * - * @return FormView The current view - * - * @deprecated Deprecated since version 2.1, to be removed in 2.3. Access - * the public property {@link vars} instead which contains an - * entry named "attr". - */ - public function setAttribute($name, $value) - { - trigger_error('setAttribute() is deprecated since version 2.1 and will be removed in 2.3. Access the public property \'vars\' instead which contains an entry named "attr".', E_USER_DEPRECATED); - - $this->vars['attr'][$name] = $value; - - return $this; - } - /** * Returns whether the view was already rendered. * @@ -209,121 +91,6 @@ public function setRendered() return $this; } - /** - * Sets the parent view. - * - * @param FormView $parent The parent view. - * - * @return FormView The view object. - * - * @deprecated Deprecated since version 2.1, to be removed in 2.3. Access - * the public property {@link parent} instead. - */ - public function setParent(FormView $parent = null) - { - trigger_error('setParent() is deprecated since version 2.1 and will be removed in 2.3. Access the public property \'parent\' instead.', E_USER_DEPRECATED); - - $this->parent = $parent; - - return $this; - } - - /** - * Returns the parent view. - * - * @return FormView The parent view. - * - * @deprecated Deprecated since version 2.1, to be removed in 2.3. Access - * the public property {@link parent} instead. - */ - public function getParent() - { - trigger_error('getParent() is deprecated since version 2.1 and will be removed in 2.3. Access the public property \'parent\' instead.', E_USER_DEPRECATED); - - return $this->parent; - } - - /** - * Returns whether this view has a parent. - * - * @return Boolean Whether this view has a parent - * - * @deprecated Deprecated since version 2.1, to be removed in 2.3. Access - * the public property {@link parent} instead. - */ - public function hasParent() - { - trigger_error('hasParent() is deprecated since version 2.1 and will be removed in 2.3. Access the public property \'parent\' instead.', E_USER_DEPRECATED); - - return null !== $this->parent; - } - - /** - * Sets the children view. - * - * @param array $children The children as instances of FormView - * - * @return FormView The current view - * - * @deprecated Deprecated since version 2.1, to be removed in 2.3. Access - * the public property {@link children} instead. - */ - public function setChildren(array $children) - { - trigger_error('setChildren() is deprecated since version 2.1 and will be removed in 2.3. Access the public property \'children\' instead.', E_USER_DEPRECATED); - - $this->children = $children; - - return $this; - } - - /** - * Returns the children. - * - * @return array The children as instances of FormView - * - * @deprecated Deprecated since version 2.1, to be removed in 2.3. Access - * the public property {@link children} instead. - */ - public function getChildren() - { - trigger_error('getChildren() is deprecated since version 2.1 and will be removed in 2.3. Access the public property \'children\' instead.', E_USER_DEPRECATED); - - return $this->children; - } - - /** - * Returns a given child. - * - * @param string $name The name of the child - * - * @return FormView The child view - * - * @deprecated Deprecated since version 2.1, to be removed in 2.3. Access - * the public property {@link children} instead. - */ - public function getChild($name) - { - trigger_error('getChild() is deprecated since version 2.1 and will be removed in 2.3. Access the public property \'children\' instead.', E_USER_DEPRECATED); - - return $this->children[$name]; - } - - /** - * Returns whether this view has any children. - * - * @return Boolean Whether the view has children. - * - * @deprecated Deprecated since version 2.1, to be removed in 2.3. Use - * {@link count()} instead. - */ - public function hasChildren() - { - trigger_error('hasChildren() is deprecated since version 2.1 and will be removed in 2.3. Use count() instead.', E_USER_DEPRECATED); - - return count($this->children) > 0; - } - /** * Returns a child by name (implements \ArrayAccess). * diff --git a/src/Symfony/Component/Form/ResolvedFormType.php b/src/Symfony/Component/Form/ResolvedFormType.php index d20f3b390fdc..f2ef06c8b8a4 100644 --- a/src/Symfony/Component/Form/ResolvedFormType.php +++ b/src/Symfony/Component/Form/ResolvedFormType.php @@ -59,14 +59,6 @@ public function __construct(FormTypeInterface $innerType, array $typeExtensions } } - // BC - if ($innerType instanceof AbstractType) { - /* @var AbstractType $innerType */ - set_error_handler(array('Symfony\Component\Form\Test\DeprecationErrorHandler', 'handleBC')); - $innerType->setExtensions($typeExtensions); - restore_error_handler(); - } - $this->innerType = $innerType; $this->typeExtensions = $typeExtensions; $this->parent = $parent; diff --git a/src/Symfony/Component/Form/Tests/CompoundFormTest.php b/src/Symfony/Component/Form/Tests/CompoundFormTest.php index ca97c8ec2a0b..06e9b4d19e57 100644 --- a/src/Symfony/Component/Form/Tests/CompoundFormTest.php +++ b/src/Symfony/Component/Form/Tests/CompoundFormTest.php @@ -114,22 +114,6 @@ public function testNotValidIfChildNotValid() $this->assertFalse($this->form->isValid()); } - public function testHasChildren() - { - $this->form->add($this->getBuilder()->getForm()); - - set_error_handler(array('Symfony\Component\Form\Test\DeprecationErrorHandler', 'handle')); - $this->assertTrue($this->form->hasChildren()); - restore_error_handler(); - } - - public function testHasNoChildren() - { - set_error_handler(array('Symfony\Component\Form\Test\DeprecationErrorHandler', 'handle')); - $this->assertFalse($this->form->hasChildren()); - restore_error_handler(); - } - public function testAdd() { $child = $this->getBuilder('foo')->getForm(); diff --git a/src/Symfony/Component/Form/Tests/Extension/Core/Type/FormTypeTest.php b/src/Symfony/Component/Form/Tests/Extension/Core/Type/FormTypeTest.php index 2d0bf3045569..6b906ea4f34b 100644 --- a/src/Symfony/Component/Form/Tests/Extension/Core/Type/FormTypeTest.php +++ b/src/Symfony/Component/Form/Tests/Extension/Core/Type/FormTypeTest.php @@ -598,19 +598,6 @@ public function testPropertyPathNullImpliesDefault() $this->assertTrue($form->getConfig()->getMapped()); } - // BC - public function testPropertyPathFalseImpliesDefaultNotMapped() - { - set_error_handler(array('Symfony\Component\Form\Test\DeprecationErrorHandler', 'handle')); - $form = $this->factory->createNamed('name', 'form', null, array( - 'property_path' => false, - )); - restore_error_handler(); - - $this->assertEquals(new PropertyPath('name'), $form->getPropertyPath()); - $this->assertFalse($form->getConfig()->getMapped()); - } - public function testNotMapped() { $form = $this->factory->create('form', null, array( diff --git a/src/Symfony/Component/Form/Tests/FormFactoryTest.php b/src/Symfony/Component/Form/Tests/FormFactoryTest.php index aa43310850ef..cbb72f2bb31d 100644 --- a/src/Symfony/Component/Form/Tests/FormFactoryTest.php +++ b/src/Symfony/Component/Form/Tests/FormFactoryTest.php @@ -71,56 +71,6 @@ protected function setUp() )))); } - public function testAddType() - { - $type = new FooType(); - $resolvedType = $this->getMockResolvedType(); - - $this->resolvedTypeFactory->expects($this->once()) - ->method('createResolvedType') - ->with($type) - ->will($this->returnValue($resolvedType)); - - $this->registry->expects($this->once()) - ->method('addType') - ->with($resolvedType); - - set_error_handler(array('Symfony\Component\Form\Test\DeprecationErrorHandler', 'handle')); - $this->factory->addType($type); - restore_error_handler(); - } - - public function testHasType() - { - $this->registry->expects($this->once()) - ->method('hasType') - ->with('name') - ->will($this->returnValue('RESULT')); - - set_error_handler(array('Symfony\Component\Form\Test\DeprecationErrorHandler', 'handle')); - $this->assertSame('RESULT', $this->factory->hasType('name')); - restore_error_handler(); - } - - public function testGetType() - { - $type = new FooType(); - $resolvedType = $this->getMockResolvedType(); - - $resolvedType->expects($this->once()) - ->method('getInnerType') - ->will($this->returnValue($type)); - - $this->registry->expects($this->once()) - ->method('getType') - ->with('name') - ->will($this->returnValue($resolvedType)); - - set_error_handler(array('Symfony\Component\Form\Test\DeprecationErrorHandler', 'handle')); - $this->assertEquals($type, $this->factory->getType('name')); - restore_error_handler(); - } - public function testCreateNamedBuilderWithTypeName() { $options = array('a' => '1', 'b' => '2'); @@ -484,74 +434,6 @@ public function testCreateBuilderUsesMaxLengthIfFound() $this->assertEquals('builderInstance', $builder); } - public function testCreateBuilderUsesMinLengthIfFound() - { - $this->guesser1->expects($this->once()) - ->method('guessMinLength') - ->with('Application\Author', 'firstName') - ->will($this->returnValue(new ValueGuess( - 2, - Guess::MEDIUM_CONFIDENCE - ))); - - $this->guesser2->expects($this->once()) - ->method('guessMinLength') - ->with('Application\Author', 'firstName') - ->will($this->returnValue(new ValueGuess( - 5, - Guess::HIGH_CONFIDENCE - ))); - - $factory = $this->getMockFactory(array('createNamedBuilder')); - - $factory->expects($this->once()) - ->method('createNamedBuilder') - ->with('firstName', 'text', null, array('pattern' => '.{5,}')) - ->will($this->returnValue('builderInstance')); - - $builder = $factory->createBuilderForProperty( - 'Application\Author', - 'firstName' - ); - - $this->assertEquals('builderInstance', $builder); - } - - public function testCreateBuilderPrefersPatternOverMinLength() - { - // min length is deprecated - $this->guesser1->expects($this->once()) - ->method('guessMinLength') - ->with('Application\Author', 'firstName') - ->will($this->returnValue(new ValueGuess( - 2, - Guess::HIGH_CONFIDENCE - ))); - - // pattern is preferred even though confidence is lower - $this->guesser2->expects($this->once()) - ->method('guessPattern') - ->with('Application\Author', 'firstName') - ->will($this->returnValue(new ValueGuess( - '.{5,10}', - Guess::LOW_CONFIDENCE - ))); - - $factory = $this->getMockFactory(array('createNamedBuilder')); - - $factory->expects($this->once()) - ->method('createNamedBuilder') - ->with('firstName', 'text', null, array('pattern' => '.{5,10}')) - ->will($this->returnValue('builderInstance')); - - $builder = $factory->createBuilderForProperty( - 'Application\Author', - 'firstName' - ); - - $this->assertEquals('builderInstance', $builder); - } - public function testCreateBuilderUsesRequiredSettingWithHighestConfidence() { $this->guesser1->expects($this->once()) diff --git a/src/Symfony/Component/Form/Tests/FormRegistryTest.php b/src/Symfony/Component/Form/Tests/FormRegistryTest.php index 50aec90d4f27..d29631dcc11b 100644 --- a/src/Symfony/Component/Form/Tests/FormRegistryTest.php +++ b/src/Symfony/Component/Form/Tests/FormRegistryTest.php @@ -68,21 +68,6 @@ protected function setUp() ), $this->resolvedTypeFactory); } - public function testGetTypeReturnsAddedType() - { - $resolvedType = $this->getMock('Symfony\Component\Form\ResolvedFormTypeInterface'); - - $resolvedType->expects($this->any()) - ->method('getName') - ->will($this->returnValue('foo')); - - set_error_handler(array('Symfony\Component\Form\Test\DeprecationErrorHandler', 'handle')); - $this->registry->addType($resolvedType); - restore_error_handler(); - - $this->assertSame($resolvedType, $this->registry->getType('foo')); - } - public function testGetTypeFromExtension() { $type = new FooType(); @@ -215,23 +200,6 @@ public function testGetTypeThrowsExceptionIfNoString() $this->registry->getType(array()); } - public function testHasTypeAfterAdding() - { - $resolvedType = $this->getMock('Symfony\Component\Form\ResolvedFormTypeInterface'); - - $resolvedType->expects($this->any()) - ->method('getName') - ->will($this->returnValue('foo')); - - $this->assertFalse($this->registry->hasType('foo')); - - set_error_handler(array('Symfony\Component\Form\Test\DeprecationErrorHandler', 'handle')); - $this->registry->addType($resolvedType); - restore_error_handler(); - - $this->assertTrue($this->registry->hasType('foo')); - } - public function testHasTypeAfterLoadingFromExtension() { $type = new FooType(); diff --git a/src/Symfony/Component/Form/Tests/SimpleFormTest.php b/src/Symfony/Component/Form/Tests/SimpleFormTest.php index eee38d80f72c..c26991959984 100644 --- a/src/Symfony/Component/Form/Tests/SimpleFormTest.php +++ b/src/Symfony/Component/Form/Tests/SimpleFormTest.php @@ -640,27 +640,6 @@ public function testEmptyDataFromClosure() $this->assertEquals('bar', $form->getData()); } - public function testBindValidatesAfterTransformation() - { - $test = $this; - $validator = $this->getFormValidator(); - set_error_handler(array('Symfony\Component\Form\Test\DeprecationErrorHandler', 'handle')); - $form = $this->getBuilder() - ->addValidator($validator) - ->getForm(); - - $validator->expects($this->once()) - ->method('validate') - ->with($form) - ->will($this->returnCallback(function ($form) use ($test) { - $test->assertEquals('foobar', $form->getData()); - })); - - $form->bind('foobar'); - - restore_error_handler(); - } - public function testBindResetsErrors() { $this->form->addError(new FormError('Error!')); diff --git a/src/Symfony/Component/Form/Util/FormUtil.php b/src/Symfony/Component/Form/Util/FormUtil.php index 481f6a5080d9..7647691e0a4d 100644 --- a/src/Symfony/Component/Form/Util/FormUtil.php +++ b/src/Symfony/Component/Form/Util/FormUtil.php @@ -11,8 +11,6 @@ namespace Symfony\Component\Form\Util; -use Symfony\Component\PropertyAccess\StringUtil; - /** * @author Bernhard Schussek */ @@ -23,19 +21,6 @@ class FormUtil */ private function __construct() {} - /** - * Alias for {@link StringUtil::singularify()} - * - * @deprecated Deprecated since version 2.2, to be removed in 2.3. Use - * {@link StringUtil::singularify()} instead. - */ - public static function singularify($plural) - { - trigger_error('\Symfony\Component\Form\Util\FormUtil::singularify() is deprecated since version 2.2 and will be removed in 2.3. Use \Symfony\Component\PropertyAccess\StringUtil::singularify() in the PropertyAccess component instead.', E_USER_DEPRECATED); - - return StringUtil::singularify($plural); - } - /** * Returns whether the given data is empty. * diff --git a/src/Symfony/Component/Form/Util/PropertyPath.php b/src/Symfony/Component/Form/Util/PropertyPath.php deleted file mode 100644 index 41acf0d88953..000000000000 --- a/src/Symfony/Component/Form/Util/PropertyPath.php +++ /dev/null @@ -1,57 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Form\Util; - -use Symfony\Component\PropertyAccess\PropertyPath as BasePropertyPath; -use Symfony\Component\PropertyAccess\PropertyAccess; - -/** - * Alias for {@link \Symfony\Component\PropertyAccess\PropertyPath}. - * - * @author Bernhard Schussek - * - * @deprecated deprecated since version 2.2, to be removed in 2.3. Use - * {@link \Symfony\Component\PropertyAccess\PropertyPath} - * instead. - */ -class PropertyPath extends BasePropertyPath -{ - /** - * {@inheritdoc} - */ - public function __construct($propertyPath) - { - parent::__construct($propertyPath); - - trigger_error('\Symfony\Component\Form\Util\PropertyPath is deprecated since version 2.2 and will be removed in 2.3. Use \Symfony\Component\PropertyAccess\PropertyPath instead.', E_USER_DEPRECATED); - } - - /** - * Alias for {@link PropertyAccessor::getValue()} - */ - public function getValue($objectOrArray) - { - $propertyAccessor = PropertyAccess::getPropertyAccessor(); - - return $propertyAccessor->getValue($objectOrArray, $this); - } - - /** - * Alias for {@link PropertyAccessor::setValue()} - */ - public function setValue(&$objectOrArray, $value) - { - $propertyAccessor = PropertyAccess::getPropertyAccessor(); - - return $propertyAccessor->setValue($objectOrArray, $this, $value); - } -} diff --git a/src/Symfony/Component/Form/Util/PropertyPathBuilder.php b/src/Symfony/Component/Form/Util/PropertyPathBuilder.php deleted file mode 100644 index 31836b63bde7..000000000000 --- a/src/Symfony/Component/Form/Util/PropertyPathBuilder.php +++ /dev/null @@ -1,36 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Form\Util; - -use Symfony\Component\PropertyAccess\PropertyPathBuilder as BasePropertyPathBuilder; - -/** - * Alias for {@link \Symfony\Component\PropertyAccess\PropertyPathBuilder}. - * - * @author Bernhard Schussek - * - * @deprecated deprecated since version 2.2, to be removed in 2.3. Use - * {@link \Symfony\Component\PropertyAccess\PropertyPathBuilder} - * instead. - */ -class PropertyPathBuilder extends BasePropertyPathBuilder -{ - /** - * {@inheritdoc} - */ - public function __construct($propertyPath) - { - parent::__construct($propertyPath); - - trigger_error('\Symfony\Component\Form\Util\PropertyPathBuilder is deprecated since version 2.2 and will be removed in 2.3. Use \Symfony\Component\PropertyAccess\PropertyPathBuilder instead.', E_USER_DEPRECATED); - } -} diff --git a/src/Symfony/Component/Form/Util/PropertyPathInterface.php b/src/Symfony/Component/Form/Util/PropertyPathInterface.php deleted file mode 100644 index ec2d5e9efbcf..000000000000 --- a/src/Symfony/Component/Form/Util/PropertyPathInterface.php +++ /dev/null @@ -1,27 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Form\Util; - -use Symfony\Component\PropertyAccess\PropertyPathInterface as BasePropertyPathInterface; - -/** - * Alias for {@link \Symfony\Component\PropertyAccess\PropertyPathInterface}. - * - * @author Bernhard Schussek - * - * @deprecated deprecated since version 2.2, to be removed in 2.3. Use - * {@link \Symfony\Component\PropertyAccess\PropertyPathInterface} - * instead. - */ -interface PropertyPathInterface extends BasePropertyPathInterface -{ -} diff --git a/src/Symfony/Component/Form/Util/PropertyPathIterator.php b/src/Symfony/Component/Form/Util/PropertyPathIterator.php deleted file mode 100644 index 024ed6a65367..000000000000 --- a/src/Symfony/Component/Form/Util/PropertyPathIterator.php +++ /dev/null @@ -1,36 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Form\Util; - -use Symfony\Component\PropertyAccess\PropertyPathIterator as BasePropertyPathIterator; - -/** - * Alias for {@link \Symfony\Component\PropertyAccess\PropertyPathIterator}. - * - * @author Bernhard Schussek - * - * @deprecated deprecated since version 2.2, to be removed in 2.3. Use - * {@link \Symfony\Component\PropertyAccess\PropertyPathIterator} - * instead. - */ -class PropertyPathIterator extends BasePropertyPathIterator -{ - /** - * {@inheritdoc} - */ - public function __construct($propertyPath) - { - parent::__construct($propertyPath); - - trigger_error('\Symfony\Component\Form\Util\PropertyPathIterator is deprecated since version 2.2 and will be removed in 2.3. Use \Symfony\Component\PropertyAccess\PropertyPathIterator instead.', E_USER_DEPRECATED); - } -} diff --git a/src/Symfony/Component/Form/Util/PropertyPathIteratorInterface.php b/src/Symfony/Component/Form/Util/PropertyPathIteratorInterface.php deleted file mode 100644 index 35406395301a..000000000000 --- a/src/Symfony/Component/Form/Util/PropertyPathIteratorInterface.php +++ /dev/null @@ -1,27 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Form\Util; - -use Symfony\Component\PropertyAccess\PropertyPathIteratorInterface as BasePropertyPathIteratorInterface; - -/** - * Alias for {@link \Symfony\Component\PropertyAccess\PropertyPathIteratorInterface}. - * - * @author Bernhard Schussek - * - * @deprecated deprecated since version 2.2, to be removed in 2.3. Use - * {@link \Symfony\Component\PropertyAccess\PropertyPathIterator} - * instead. - */ -interface PropertyPathIteratorInterface extends BasePropertyPathIteratorInterface -{ -}