Code Coverage
 
Lines
Functions and Methods
Classes and Traits
Total
40.00% covered (danger)
40.00%
4 / 10
40.00% covered (danger)
40.00%
4 / 10
CRAP
0.00% covered (danger)
0.00%
0 / 1
Animation
40.00% covered (danger)
40.00%
4 / 10
40.00% covered (danger)
40.00%
4 / 10
31.60
0.00% covered (danger)
0.00%
0 / 1
 attributeName
100.00% covered (success)
100.00%
1 / 1
100.00% covered (success)
100.00%
1 / 1
1
 attributeType
0.00% covered (danger)
0.00%
0 / 1
0.00% covered (danger)
0.00%
0 / 1
2
 begin
0.00% covered (danger)
0.00%
0 / 1
0.00% covered (danger)
0.00%
0 / 1
2
 dur
100.00% covered (success)
100.00%
1 / 1
100.00% covered (success)
100.00%
1 / 1
1
 end
0.00% covered (danger)
0.00%
0 / 1
0.00% covered (danger)
0.00%
0 / 1
2
 repeatCount
0.00% covered (danger)
0.00%
0 / 1
0.00% covered (danger)
0.00%
0 / 1
2
 from
100.00% covered (success)
100.00%
1 / 1
100.00% covered (success)
100.00%
1 / 1
1
 to
100.00% covered (success)
100.00%
1 / 1
100.00% covered (success)
100.00%
1 / 1
1
 by
0.00% covered (danger)
0.00%
0 / 1
0.00% covered (danger)
0.00%
0 / 1
2
 values
0.00% covered (danger)
0.00%
0 / 1
0.00% covered (danger)
0.00%
0 / 1
2
1<?php
2
3declare(strict_types=1);
4
5namespace Phpdftk\Svg;
6
7/**
8 * SVG 2 §19 — common base for animation elements (`<animate>`,
9 * `<animateTransform>`, `<animateMotion>`, `<set>`). Animation
10 * is out of scope for the static print medium, but the
11 * elements still parse to typed classes so external tooling
12 * (sanitisers, validators, optimisers) can recognise them
13 * without re-walking attribute strings, and so the renderer
14 * can explicitly skip them rather than recursing.
15 *
16 * Exposes the SMIL-style attribute surface authors target:
17 * `attributeName`, `attributeType`, the timing keywords
18 * (`begin` / `dur` / `end` / `repeatCount`), and the value
19 * specification (`from` / `to` / `by` / `values`).
20 */
21abstract class Animation extends Element
22{
23    public function attributeName(): ?string
24    {
25        return $this->getAttribute('attributeName');
26    }
27
28    public function attributeType(): ?string
29    {
30        return $this->getAttribute('attributeType');
31    }
32
33    public function begin(): ?string
34    {
35        return $this->getAttribute('begin');
36    }
37
38    public function dur(): ?string
39    {
40        return $this->getAttribute('dur');
41    }
42
43    public function end(): ?string
44    {
45        return $this->getAttribute('end');
46    }
47
48    public function repeatCount(): ?string
49    {
50        return $this->getAttribute('repeatCount');
51    }
52
53    public function from(): ?string
54    {
55        return $this->getAttribute('from');
56    }
57
58    public function to(): ?string
59    {
60        return $this->getAttribute('to');
61    }
62
63    public function by(): ?string
64    {
65        return $this->getAttribute('by');
66    }
67
68    public function values(): ?string
69    {
70        return $this->getAttribute('values');
71    }
72}