diff --git a/src/Symfony/Component/Form/ButtonBuilder.php b/src/Symfony/Component/Form/ButtonBuilder.php index bbddd9cfa212..5980ff1500ea 100644 --- a/src/Symfony/Component/Form/ButtonBuilder.php +++ b/src/Symfony/Component/Form/ButtonBuilder.php @@ -592,9 +592,14 @@ public function getByReference() * Unsupported method. * * @return bool Always returns false. + * + * @deprecated Deprecated since version 2.3, to be removed in 3.0. Use + * {@link getInheritData()} instead. */ public function getVirtual() { + trigger_error('ButtonBuilder::getVirtual() is deprecated since version 2.3 and will be removed in 3.0. Use FormConfigBuilder::getInheritData() instead.', E_USER_DEPRECATED); + return false; } diff --git a/src/Symfony/Component/Form/Extension/Core/Type/FormType.php b/src/Symfony/Component/Form/Extension/Core/Type/FormType.php index e22d90cfa885..dc8c60a947f4 100644 --- a/src/Symfony/Component/Form/Extension/Core/Type/FormType.php +++ b/src/Symfony/Component/Form/Extension/Core/Type/FormType.php @@ -155,8 +155,8 @@ public function setDefaultOptions(OptionsResolverInterface $resolver) // BC with old "virtual" option $inheritData = function (Options $options) { if (null !== $options['virtual']) { - // Uncomment this as soon as the deprecation note should be shown - // trigger_error('The form option "virtual" is deprecated since version 2.3 and will be removed in 3.0. Use "inherit_data" instead.', E_USER_DEPRECATED); + trigger_error('The form option "virtual" is deprecated since version 2.3 and will be removed in 3.0. Use "inherit_data" instead.', E_USER_DEPRECATED); + return $options['virtual']; } diff --git a/src/Symfony/Component/Form/FormConfigBuilder.php b/src/Symfony/Component/Form/FormConfigBuilder.php index 2bc7c2ec220f..8ebfd543b9a9 100644 --- a/src/Symfony/Component/Form/FormConfigBuilder.php +++ b/src/Symfony/Component/Form/FormConfigBuilder.php @@ -356,8 +356,8 @@ public function getInheritData() */ public function getVirtual() { - // Uncomment this as soon as the deprecation note should be shown - // trigger_error('getVirtual() is deprecated since version 2.3 and will be removed in 3.0. Use getInheritData() instead.', E_USER_DEPRECATED); + trigger_error('FormConfigBuilder::getVirtual() is deprecated since version 2.3 and will be removed in 3.0. Use FormConfigBuilder::getInheritData() instead.', E_USER_DEPRECATED); + return $this->getInheritData(); } @@ -722,8 +722,7 @@ public function setInheritData($inheritData) */ public function setVirtual($inheritData) { - // Uncomment this as soon as the deprecation note should be shown - // trigger_error('setVirtual() is deprecated since version 2.3 and will be removed in 3.0. Use setInheritData() instead.', E_USER_DEPRECATED); + trigger_error('FormConfigBuilder::setVirtual() is deprecated since version 2.3 and will be removed in 3.0. Use FormConfigBuilder::setInheritData() instead.', E_USER_DEPRECATED); $this->setInheritData($inheritData); }