Code Coverage
 
Lines
Functions and Methods
Classes and Traits
Total
100.00% covered (success)
100.00%
5 / 5
100.00% covered (success)
100.00%
2 / 2
CRAP
100.00% covered (success)
100.00%
1 / 1
AnimateTransform
100.00% covered (success)
100.00%
5 / 5
100.00% covered (success)
100.00%
2 / 2
3
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
 type
100.00% covered (success)
100.00%
4 / 4
100.00% covered (success)
100.00%
1 / 1
2
1<?php
2
3declare(strict_types=1);
4
5namespace Phpdftk\Svg;
6
7/**
8 * SVG 2 §19.5 — `<animateTransform>` interpolates a
9 * `transform=` attribute. Has an additional `type` attribute
10 * choosing the transform family (translate / scale / rotate /
11 * skewX / skewY).
12 */
13final class AnimateTransform extends Animation
14{
15    public function __construct()
16    {
17        parent::__construct('animateTransform');
18    }
19
20    public function type(): string
21    {
22        $v = strtolower($this->getAttribute('type') ?? 'translate');
23        return in_array($v, ['translate', 'scale', 'rotate', 'skewx', 'skewy'], true)
24            ? $v
25            : 'translate';
26    }
27}