Upgrade framework

This commit is contained in:
2023-11-14 16:54:35 +01:00
parent 1648a5cd42
commit 4fcf6fffcc
10548 changed files with 693138 additions and 466698 deletions

View File

@@ -18,29 +18,15 @@ use Symfony\Component\Console\Exception\InvalidArgumentException;
*/
class TableCell
{
/**
* @var string
*/
private $value;
/**
* @var array
*/
private $options = array(
private string $value;
private array $options = [
'rowspan' => 1,
'colspan' => 1,
);
'style' => null,
];
/**
* @param string $value
* @param array $options
*/
public function __construct($value = '', array $options = array())
public function __construct(string $value = '', array $options = [])
{
if (is_numeric($value) && !is_string($value)) {
$value = (string) $value;
}
$this->value = $value;
// check option names
@@ -48,36 +34,39 @@ class TableCell
throw new InvalidArgumentException(sprintf('The TableCell does not support the following options: \'%s\'.', implode('\', \'', $diff)));
}
if (isset($options['style']) && !$options['style'] instanceof TableCellStyle) {
throw new InvalidArgumentException('The style option must be an instance of "TableCellStyle".');
}
$this->options = array_merge($this->options, $options);
}
/**
* Returns the cell value.
*
* @return string
*/
public function __toString()
public function __toString(): string
{
return $this->value;
}
/**
* Gets number of colspan.
*
* @return int
*/
public function getColspan()
public function getColspan(): int
{
return (int) $this->options['colspan'];
}
/**
* Gets number of rowspan.
*
* @return int
*/
public function getRowspan()
public function getRowspan(): int
{
return (int) $this->options['rowspan'];
}
public function getStyle(): ?TableCellStyle
{
return $this->options['style'];
}
}