Code Coverage
 
Lines
Functions and Methods
Classes and Traits
Total
100.00% covered (success)
100.00%
4 / 4
100.00% covered (success)
100.00%
4 / 4
CRAP
100.00% covered (success)
100.00%
1 / 1
Circle
100.00% covered (success)
100.00%
4 / 4
100.00% covered (success)
100.00%
4 / 4
4
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
 cx
100.00% covered (success)
100.00%
1 / 1
100.00% covered (success)
100.00%
1 / 1
1
 cy
100.00% covered (success)
100.00%
1 / 1
100.00% covered (success)
100.00%
1 / 1
1
 r
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 `<circle>` element per SVG 2 ยง10.5. `cx` / `cy` default to 0 when
11 * absent; `r` defaults to 0 (renders nothing, per spec).
12 */
13final class Circle extends Element
14{
15    public function __construct()
16    {
17        parent::__construct('circle');
18    }
19
20    public function cx(): float
21    {
22        return $this->parseLengthOrZero('cx');
23    }
24
25    public function cy(): float
26    {
27        return $this->parseLengthOrZero('cy');
28    }
29
30    public function r(): float
31    {
32        return $this->parseLengthOrZero('r');
33    }
34}