Code Coverage
 
Lines
Functions and Methods
Classes and Traits
Total
100.00% covered (success)
100.00%
2 / 2
100.00% covered (success)
100.00%
2 / 2
CRAP
100.00% covered (success)
100.00%
1 / 1
Polygon
100.00% covered (success)
100.00%
2 / 2
100.00% covered (success)
100.00%
2 / 2
2
100.00% covered (success)
100.00%
1 / 1
 __construct
100.00% covered (success)
100.00%
1 / 1
100.00% covered (success)
100.00%
1 / 1
1
 points
100.00% covered (success)
100.00%
1 / 1
100.00% covered (success)
100.00%
1 / 1
1
1<?php
2
3declare(strict_types=1);
4
5namespace Phpdftk\Svg\Shape;
6
7use Phpdftk\Svg\Element;
8
9/**
10 * SVG `<polygon>` element per SVG 2 ยง10.9. Shares the `points` attribute
11 * grammar with `<polyline>`; the difference (auto-closing stroke) is a
12 * painter concern, not a parser one.
13 */
14final class Polygon extends Element
15{
16    public function __construct()
17    {
18        parent::__construct('polygon');
19    }
20
21    /** @return list<array{float, float}> */
22    public function points(): array
23    {
24        return self::parsePoints($this->getAttribute('points'));
25    }
26}