Code Coverage
 
Lines
Functions and Methods
Classes and Traits
Total
100.00% covered (success)
100.00%
3 / 3
100.00% covered (success)
100.00%
3 / 3
CRAP
100.00% covered (success)
100.00%
1 / 1
FeDistantLight
100.00% covered (success)
100.00%
3 / 3
100.00% covered (success)
100.00%
3 / 3
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
 azimuth
100.00% covered (success)
100.00%
1 / 1
100.00% covered (success)
100.00%
1 / 1
1
 elevation
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\Filter;
6
7use Phpdftk\Svg\Element;
8
9/**
10 * SVG 2 Filter Effects §15.15.1 — `<feDistantLight>`. Direction
11 * source for `<feDiffuseLighting>` / `<feSpecularLighting>`.
12 * Infinitely far away; rays are parallel.
13 *
14 *   azimuth:    direction in the XY plane, degrees (default 0)
15 *   elevation:  pitch above the XY plane, degrees (default 0)
16 */
17final class FeDistantLight extends Element
18{
19    public function __construct()
20    {
21        parent::__construct('feDistantLight');
22    }
23
24    public function azimuth(): float
25    {
26        return (float) ($this->getAttribute('azimuth') ?? 0);
27    }
28
29    public function elevation(): float
30    {
31        return (float) ($this->getAttribute('elevation') ?? 0);
32    }
33}