Code Coverage |
||||||||||
Lines |
Functions and Methods |
Classes and Traits |
||||||||
| Total | |
100.00% |
2 / 2 |
|
100.00% |
2 / 2 |
CRAP | |
100.00% |
1 / 1 |
| Polyline | |
100.00% |
2 / 2 |
|
100.00% |
2 / 2 |
2 | |
100.00% |
1 / 1 |
| __construct | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
1 | |||
| points | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
1 | |||
| 1 | <?php |
| 2 | |
| 3 | declare(strict_types=1); |
| 4 | |
| 5 | namespace Phpdftk\Svg\Shape; |
| 6 | |
| 7 | use Phpdftk\Svg\Element; |
| 8 | |
| 9 | /** |
| 10 | * SVG `<polyline>` element per SVG 2 ยง10.8. Difference from `<polygon>` |
| 11 | * is purely paint-time: a polyline's stroke does not auto-close, a |
| 12 | * polygon's does. Both share the same `points` attribute grammar. |
| 13 | */ |
| 14 | final class Polyline extends Element |
| 15 | { |
| 16 | public function __construct() |
| 17 | { |
| 18 | parent::__construct('polyline'); |
| 19 | } |
| 20 | |
| 21 | /** @return list<array{float, float}> */ |
| 22 | public function points(): array |
| 23 | { |
| 24 | return self::parsePoints($this->getAttribute('points')); |
| 25 | } |
| 26 | } |