Added deprecation note about 'virtual' form option. Issue #12603.

This commit is contained in:
Lenard Palko 2014-11-29 11:23:41 +01:00 committed by Fabien Potencier
parent d277c16a27
commit 13083106c2
3 changed files with 10 additions and 6 deletions

View File

@ -592,9 +592,14 @@ class ButtonBuilder implements \IteratorAggregate, FormBuilderInterface
* 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;
}

View File

@ -155,8 +155,8 @@ class FormType extends BaseType
// 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'];
}

View File

@ -356,8 +356,8 @@ class FormConfigBuilder implements FormConfigBuilderInterface
*/
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 @@ class FormConfigBuilder implements FormConfigBuilderInterface
*/
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);
}