Completed
Push — master ( 1409bd...fad66a )
by Edgar
03:44
created

Gradient   A

Complexity

Total Complexity 4

Size/Duplication

Total Lines 25
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 2

Test Coverage

Coverage 100%

Importance

Changes 5
Bugs 0 Features 0
Metric Value
wmc 4
c 5
b 0
f 0
lcom 0
cbo 2
dl 0
loc 25
ccs 11
cts 11
cp 1
rs 10

2 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 7 2
A appendStop() 0 7 2
1
<?php
2
namespace nstdio\svg\gradient;
3
4
use nstdio\svg\ElementInterface;
5
use nstdio\svg\SVGElement;
6
use nstdio\svg\util\Identifier;
7
8
/**
9
 * Class Gradient
10
 *
11
 * @package nstdio\svg\gradient
12
 * @author  Edgar Asatryan <[email protected]>
13
 */
14
abstract class Gradient extends SVGElement
15
{
16
    const LINEAR = 'linear';
17
18
    const RADIAL = 'radial';
19
20 36
    public function __construct(ElementInterface $parent, $id = null)
21
    {
22 36
        $defs = self::getDefs($parent);
23 36
        parent::__construct($defs);
24
25 36
        $this->id = $id === null ? Identifier::random('__gradient', 4) : $id;
26 36
    }
27
28
    /**
29
     * @param Stop|Stop[] $stops
30
     */
31 36
    public function appendStop(Stop $stops)
0 ignored issues
show
Unused Code introduced by
The parameter $stops is not used and could be removed.

This check looks from parameters that have been defined for a function or method, but which are not used in the method body.

Loading history...
32
    {
33 36
        $stops = func_get_args();
34 36
        foreach ($stops as $stop) {
35 36
            $this->append($stop);
36 36
        }
37
    }
38
}