$this->assertContains('Exception trace', $tester->getDisplay(), '->renderException() renders a pretty exception with a stack trace when verbosity is verbose');
$this->assertStringEqualsFile(self::$fixturesPath.'/application_renderexception2.txt', $this->normalizeLineBreaks($tester->getDisplay()), '->renderException() renders the command synopsis when an exception occurs in the context of a command');
$this->assertStringEqualsFile(self::$fixturesPath.'/application_renderexception2.txt', $tester->getDisplay(true), '->renderException() renders the command synopsis when an exception occurs in the context of a command');
$this->assertStringEqualsFile(self::$fixturesPath.'/application_renderexception3.txt', $this->normalizeLineBreaks($tester->getDisplay()), '->renderException() renders a pretty exceptions with previous exceptions');
$this->assertStringEqualsFile(self::$fixturesPath.'/application_renderexception3.txt', $tester->getDisplay(true), '->renderException() renders a pretty exceptions with previous exceptions');
$this->assertStringEqualsFile(self::$fixturesPath.'/application_renderexception4.txt', $this->normalizeLineBreaks($tester->getDisplay()), '->renderException() wraps messages when they are bigger than the terminal');
$this->assertStringEqualsFile(self::$fixturesPath.'/application_renderexception4.txt', $tester->getDisplay(true), '->renderException() wraps messages when they are bigger than the terminal');
}
public function testRun()
@ -443,19 +449,19 @@ class ApplicationTest extends \PHPUnit_Framework_TestCase
$this->assertStringEqualsFile(self::$fixturesPath.'/application_run1.txt', $this->normalizeLineBreaks($tester->getDisplay()), '->run() runs the list command if no argument is passed');
$this->assertStringEqualsFile(self::$fixturesPath.'/application_run1.txt', $tester->getDisplay(true), '->run() runs the list command if no argument is passed');
$this->assertStringEqualsFile(self::$fixturesPath.'/application_run2.txt', $this->normalizeLineBreaks($tester->getDisplay()), '->run() runs the help command if --help is passed');
$this->assertStringEqualsFile(self::$fixturesPath.'/application_run2.txt', $tester->getDisplay(true), '->run() runs the help command if --help is passed');
$this->assertStringEqualsFile(self::$fixturesPath.'/application_run2.txt', $this->normalizeLineBreaks($tester->getDisplay()), '->run() runs the help command if -h is passed');
$this->assertStringEqualsFile(self::$fixturesPath.'/application_run2.txt', $tester->getDisplay(true), '->run() runs the help command if -h is passed');
$this->assertStringEqualsFile(self::$fixturesPath.'/application_run3.txt', $this->normalizeLineBreaks($tester->getDisplay()), '->run() displays the help if --help is passed');
$this->assertStringEqualsFile(self::$fixturesPath.'/application_run3.txt', $tester->getDisplay(true), '->run() displays the help if --help is passed');
$this->assertStringEqualsFile(self::$fixturesPath.'/application_run3.txt', $this->normalizeLineBreaks($tester->getDisplay()), '->run() displays the help if -h is passed');
$this->assertStringEqualsFile(self::$fixturesPath.'/application_run3.txt', $tester->getDisplay(true), '->run() displays the help if -h is passed');
$tester->run(array('--ansi' => true));
$this->assertTrue($tester->getOutput()->isDecorated(), '->run() forces color output if --ansi is passed');
@ -464,10 +470,10 @@ class ApplicationTest extends \PHPUnit_Framework_TestCase
$this->assertFalse($tester->getOutput()->isDecorated(), '->run() forces color output to be disabled if --no-ansi is passed');
$this->assertStringEqualsFile(self::$fixturesPath.'/application_run4.txt', $this->normalizeLineBreaks($tester->getDisplay()), '->run() displays the program version if --version is passed');
$this->assertStringEqualsFile(self::$fixturesPath.'/application_run4.txt', $tester->getDisplay(true), '->run() displays the program version if --version is passed');
$this->assertStringEqualsFile(self::$fixturesPath.'/application_run4.txt', $this->normalizeLineBreaks($tester->getDisplay()), '->run() displays the program version if -v is passed');
$this->assertStringEqualsFile(self::$fixturesPath.'/application_run4.txt', $tester->getDisplay(true), '->run() displays the program version if -v is passed');
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 @@ abstract class AbstractType implements FormTypeInterface
{
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
trigger_error('getExtensions() is deprecated since version 2.1 and will be removed in 2.3. Use ResolvedFormTypeInterface::getTypeExtensions instead.', E_USER_DEPRECATED);
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.
@ -56,10 +55,6 @@ class FormType extends AbstractType
->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 @@ class FormType extends AbstractType
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 @@ class FormType extends AbstractType
@ -16,7 +16,6 @@ use Symfony\Component\Form\Exception\UnexpectedTypeException;
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 @@ class Form implements \IteratorAggregate, FormInterface
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);
@ -272,21 +250,6 @@ class Form implements \IteratorAggregate, FormInterface
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 @@ class Form implements \IteratorAggregate, FormInterface
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 @@ class Form implements \IteratorAggregate, FormInterface
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);
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);
@ -595,14 +499,9 @@ class Form implements \IteratorAggregate, FormInterface
// 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);
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 @@ class Form implements \IteratorAggregate, FormInterface
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 @@ class Form implements \IteratorAggregate, FormInterface
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 @@ class Form implements \IteratorAggregate, FormInterface
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 @@ class Form implements \IteratorAggregate, FormInterface
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 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.');
@ -195,22 +195,6 @@ class FormConfigBuilder implements FormConfigBuilderInterface
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 @@ class FormConfigBuilder implements FormConfigBuilderInterface
* @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 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 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 @@ class FormConfigBuilder implements FormConfigBuilderInterface
return $this;
}
/**
* Appends a transformer to the normalization transformer chain
* @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 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 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 @@ class FormConfigBuilder implements FormConfigBuilderInterface
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 @@ class FormConfigBuilder implements FormConfigBuilderInterface
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 @@ class FormConfigBuilder implements FormConfigBuilderInterface
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);
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);
trigger_error('getType() is deprecated since version 2.1 and will be removed in 2.3. Use FormRegistryInterface::getType() instead.', E_USER_DEPRECATED);
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 @@ class FormRegistry implements FormRegistryInterface
@ -53,124 +53,6 @@ class FormView implements \ArrayAccess, \IteratorAggregate, \Countable
$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 @@ class FormView implements \ArrayAccess, \IteratorAggregate, \Countable
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).
* @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);