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\Console\Helper;
14 use Symfony\Component\Console\Exception\InvalidArgumentException;
17 * @author Abdellatif Ait boudad <a.aitboudad@gmail.com>
29 private $options = array(
35 * @param string $value
36 * @param array $options
38 public function __construct($value = '', array $options = array())
40 if (is_numeric($value) && !is_string($value)) {
41 $value = (string) $value;
44 $this->value = $value;
47 if ($diff = array_diff(array_keys($options), array_keys($this->options))) {
48 throw new InvalidArgumentException(sprintf('The TableCell does not support the following options: \'%s\'.', implode('\', \'', $diff)));
51 $this->options = array_merge($this->options, $options);
55 * Returns the cell value.
59 public function __toString()
65 * Gets number of colspan.
69 public function getColspan()
71 return (int) $this->options['colspan'];
75 * Gets number of rowspan.
79 public function getRowspan()
81 return (int) $this->options['rowspan'];