4 * This file is part of the Symfony package.
6 * (c) Fabien Potencier <fabien@symfony.com>
8 * For the full copyright and license information, please view the LICENSE
9 * file that was distributed with this source code.
12 namespace Symfony\Component\DomCrawler\Field;
15 * TextareaFormField represents a textarea form field (an HTML textarea tag).
17 * @author Fabien Potencier <fabien@symfony.com>
19 class TextareaFormField extends FormField
22 * Initializes the form field.
24 * @throws \LogicException When node type is incorrect
26 protected function initialize()
28 if ('textarea' !== $this->node->nodeName) {
29 throw new \LogicException(sprintf('A TextareaFormField can only be created from a textarea tag (%s given).', $this->node->nodeName));
33 foreach ($this->node->childNodes as $node) {
34 $this->value .= $node->wholeText;