Code Coverage |
||||||||||
Lines |
Functions and Methods |
Classes and Traits |
||||||||
| Total | |
100.00% |
5 / 5 |
|
100.00% |
5 / 5 |
CRAP | |
100.00% |
1 / 1 |
| Line | |
100.00% |
5 / 5 |
|
100.00% |
5 / 5 |
5 | |
100.00% |
1 / 1 |
| __construct | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
1 | |||
| x1 | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
1 | |||
| y1 | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
1 | |||
| x2 | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
1 | |||
| y2 | |
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 `<line>` element per SVG 2 ยง10.7. Each endpoint coordinate |
| 11 | * defaults to 0 when its attribute is absent. |
| 12 | */ |
| 13 | final class Line extends Element |
| 14 | { |
| 15 | public function __construct() |
| 16 | { |
| 17 | parent::__construct('line'); |
| 18 | } |
| 19 | |
| 20 | public function x1(): float |
| 21 | { |
| 22 | return $this->parseLengthOrZero('x1'); |
| 23 | } |
| 24 | |
| 25 | public function y1(): float |
| 26 | { |
| 27 | return $this->parseLengthOrZero('y1'); |
| 28 | } |
| 29 | |
| 30 | public function x2(): float |
| 31 | { |
| 32 | return $this->parseLengthOrZero('x2'); |
| 33 | } |
| 34 | |
| 35 | public function y2(): float |
| 36 | { |
| 37 | return $this->parseLengthOrZero('y2'); |
| 38 | } |
| 39 | } |