Passed
Push — master ( d265e3...e69457 )
by Christophe
05:00
created

Gradient::setUseObjectBoundingBoxUnits()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 6
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 3
CRAP Score 1

Importance

Changes 0
Metric Value
dl 0
loc 6
ccs 3
cts 3
cp 1
rs 9.4285
c 0
b 0
f 0
cc 1
eloc 3
nc 1
nop 1
crap 1
1
<?php
2
3
namespace CMEN\GoogleChartsBundle\GoogleCharts\Options;
4
5
/**
6
 * @author Christophe Meneses
7
 */
8
class Gradient
9
{
10
    /**
11
     * Start color for gradient.
12
     *
13
     * @var string
14
     */
15
    protected $color1;
16
17
    /**
18
     * Finish color for gradient.
19
     *
20
     * @var string
21
     */
22
    protected $color2;
23
24
    /**
25
     * Where on the boundary to start the color1 gradient, relative to the upper left corner of the boundary.
26
     *
27
     * @var string
28
     */
29
    protected $x1;
30
31
    /**
32
     * Where on the boundary to end the color1 gradient, relative to the upper left corner of the boundary.
33
     *
34
     * @var string
35
     */
36
    protected $y1;
37
38
    /**
39
     * Where on the boundary to start the color2 gradient, relative to the upper left corner of the boundary.
40
     *
41
     * @var string
42
     */
43
    protected $x2;
44
45
    /**
46
     * Where on the boundary to end the color2 gradient, relative to the upper left corner of the boundary.
47
     *
48
     * @var string
49
     */
50
    protected $y2;
51
52
    /**
53
     * If true, the boundary for x1, y1, x2, and y2 is the box. If false, it's the entire chart.
54
     *
55
     * @var bool
56
     */
57
    protected $useObjectBoundingBoxUnits;
58
59
    /**
60
     * @param string $color1
61
     *
62
     * @return $this
63
     */
64 1
    public function setColor1($color1)
65
    {
66 1
        $this->color1 = $color1;
67
68 1
        return $this;
69
    }
70
71
    /**
72
     * @param string $color2
73
     *
74
     * @return $this
75
     */
76 1
    public function setColor2($color2)
77
    {
78 1
        $this->color2 = $color2;
79
80 1
        return $this;
81
    }
82
83
    /**
84
     * @param string $x1
85
     *
86
     * @return $this
87
     */
88 1
    public function setX1($x1)
89
    {
90 1
        $this->x1 = $x1;
91
92 1
        return $this;
93
    }
94
95
    /**
96
     * @param string $y1
97
     *
98
     * @return $this
99
     */
100 1
    public function setY1($y1)
101
    {
102 1
        $this->y1 = $y1;
103
104 1
        return $this;
105
    }
106
107
    /**
108
     * @param string $x2
109
     *
110
     * @return $this
111
     */
112 1
    public function setX2($x2)
113
    {
114 1
        $this->x2 = $x2;
115
116 1
        return $this;
117
    }
118
119
    /**
120
     * @param string $y2
121
     *
122
     * @return $this
123
     */
124 1
    public function setY2($y2)
125
    {
126 1
        $this->y2 = $y2;
127
128 1
        return $this;
129
    }
130
131
    /**
132
     * @param bool $useObjectBoundingBoxUnits
133
     *
134
     * @return $this
135
     */
136 1
    public function setUseObjectBoundingBoxUnits($useObjectBoundingBoxUnits)
137
    {
138 1
        $this->useObjectBoundingBoxUnits = $useObjectBoundingBoxUnits;
139
140 1
        return $this;
141
    }
142
}
143