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>
22 private $options = array(
28 * @param string $value
29 * @param array $options
31 public function __construct($value = '', array $options = array())
33 if (is_numeric($value) && !is_string($value)) {
34 $value = (string) $value;
37 $this->value = $value;
40 if ($diff = array_diff(array_keys($options), array_keys($this->options))) {
41 throw new InvalidArgumentException(sprintf('The TableCell does not support the following options: \'%s\'.', implode('\', \'', $diff)));
44 $this->options = array_merge($this->options, $options);
48 * Returns the cell value.
52 public function __toString()
58 * Gets number of colspan.
62 public function getColspan()
64 return (int) $this->options['colspan'];
68 * Gets number of rowspan.
72 public function getRowspan()
74 return (int) $this->options['rowspan'];