Proyectos de Subversion Moodle

Rev

| Ultima modificación | Ver Log |

Rev Autor Línea Nro. Línea
1 efrain 1
<?php
2
 
3
declare(strict_types=1);
4
 
5
namespace OpenSpout\Common\Entity\Style;
6
 
7
final class Border
8
{
9
    public const LEFT = 'left';
10
    public const RIGHT = 'right';
11
    public const TOP = 'top';
12
    public const BOTTOM = 'bottom';
13
 
14
    public const STYLE_NONE = 'none';
15
    public const STYLE_SOLID = 'solid';
16
    public const STYLE_DASHED = 'dashed';
17
    public const STYLE_DOTTED = 'dotted';
18
    public const STYLE_DOUBLE = 'double';
19
 
20
    public const WIDTH_THIN = 'thin';
21
    public const WIDTH_MEDIUM = 'medium';
22
    public const WIDTH_THICK = 'thick';
23
 
24
    /** @var array<string, BorderPart> */
25
    private array $parts;
26
 
27
    public function __construct(BorderPart ...$borderParts)
28
    {
29
        foreach ($borderParts as $borderPart) {
30
            $this->parts[$borderPart->getName()] = $borderPart;
31
        }
32
    }
33
 
34
    public function getPart(string $name): ?BorderPart
35
    {
36
        return $this->parts[$name] ?? null;
37
    }
38
 
39
    /**
40
     * @return array<string, BorderPart>
41
     */
42
    public function getParts(): array
43
    {
44
        return $this->parts;
45
    }
46
}