PHP 8.2.31
Preview: TableCell.php Size: 1.77 KB
/opt/cpanel/ea-wappspector/vendor/symfony/console/Helper/TableCell.php

<?php

/*
 * This file is part of the Symfony package.
 *
 * (c) Fabien Potencier <fabien@symfony.com>
 *
 * For the full copyright and license information, please view the LICENSE
 * file that was distributed with this source code.
 */

namespace Symfony\Component\Console\Helper;

use Symfony\Component\Console\Exception\InvalidArgumentException;

/**
 * @author Abdellatif Ait boudad <a.aitboudad@gmail.com>
 */
class TableCell
{
    private $value;
    private $options = [
        'rowspan' => 1,
        'colspan' => 1,
        'style' => null,
    ];

    public function __construct(string $value = '', array $options = [])
    {
        $this->value = $value;

        // check option names
        if ($diff = array_diff(array_keys($options), array_keys($this->options))) {
            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()
    {
        return $this->value;
    }

    /**
     * Gets number of colspan.
     *
     * @return int
     */
    public function getColspan()
    {
        return (int) $this->options['colspan'];
    }

    /**
     * Gets number of rowspan.
     *
     * @return int
     */
    public function getRowspan()
    {
        return (int) $this->options['rowspan'];
    }

    public function getStyle(): ?TableCellStyle
    {
        return $this->options['style'];
    }
}

Directory Contents

Dirs: 0 × Files: 19

Name Size Perms Modified Actions
3.32 KB lrw-r--r-- 2024-11-06 11:30:55
Edit Download
2.43 KB lrw-r--r-- 2024-11-06 11:30:55
Edit Download
1.98 KB lrw-r--r-- 2024-11-06 11:30:55
Edit Download
2.34 KB lrw-r--r-- 2024-11-06 11:30:55
Edit Download
5.06 KB lrw-r--r-- 2024-11-06 11:30:55
Edit Download
846 B lrw-r--r-- 2024-11-06 11:30:55
Edit Download
2.52 KB lrw-r--r-- 2024-11-06 11:30:55
Edit Download
747 B lrw-r--r-- 2024-11-06 11:30:55
Edit Download
4.87 KB lrw-r--r-- 2024-11-06 11:30:55
Edit Download
18.28 KB lrw-r--r-- 2024-11-06 11:30:55
Edit Download
7.02 KB lrw-r--r-- 2024-11-06 11:30:55
Edit Download
19.05 KB lrw-r--r-- 2024-11-06 11:30:55
Edit Download
3.20 KB lrw-r--r-- 2024-11-06 11:30:55
Edit Download
29.15 KB lrw-r--r-- 2024-11-06 11:30:55
Edit Download
1.77 KB lrw-r--r-- 2024-11-06 11:30:55
Edit Download
2.22 KB lrw-r--r-- 2024-11-06 11:30:55
Edit Download
581 B lrw-r--r-- 2024-11-06 11:30:55
Edit Download
531 B lrw-r--r-- 2024-11-06 11:30:55
Edit Download
12.39 KB lrw-r--r-- 2024-11-06 11:30:55
Edit Download

If ZipArchive is unavailable, a .tar will be created (no compression).