Link   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 42
Duplicated Lines 0 %

Test Coverage

Coverage 0%

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 8
c 1
b 0
f 0
dl 0
loc 42
ccs 0
cts 7
cp 0
rs 10
wmc 3

3 Methods

Rating   Name   Duplication   Size   Complexity  
A getColor() 0 3 1
A setColorMode() 0 5 1
A __construct() 0 3 1
1
<?php
2
3
namespace CMEN\GoogleChartsBundle\GoogleCharts\Options\SankeyDiagram;
4
5
use CMEN\GoogleChartsBundle\GoogleCharts\Options\ColorsTrait;
6
7
/**
8
 * @author Christophe Meneses
9
 */
10
class Link
11
{
12
    use ColorsTrait;
13
14
    /**
15
     * @var Color
16
     */
17
    protected $color;
18
19
    /**
20
     * Sets a coloring mode for the links between nodes. Possible values :
21
     *    'source' - The color of the source node is used for the links to all target nodes.
22
     *    'target' - The color of the target node is used for the link to its source nodes.
23
     *    'gradient' - The link between a source and target node is colored as a gradient from the source node color
24
     *          to the target node color.
25
     *    'none' - the default option; link colors will be set to the default (or a color as specified by the
26
     *          sankey.link.color.fill and sankey.link.color.fillOpacity options).
27
     *
28
     * This option overrides sankey.link.color.
29
     *
30
     * @var string
31
     */
32
    protected $colorMode;
33
34
    public function __construct()
35
    {
36
        $this->color = new Color();
37
    }
38
39
    public function getColor(): Color
40
    {
41
        return $this->color;
42
    }
43
44
    /**
45
     * @return $this
46
     */
47
    public function setColorMode(string $colorMode)
48
    {
49
        $this->colorMode = $colorMode;
50
51
        return $this;
52
    }
53
}
54