Passed
Push — master ( e69457...6104b4 )
by Christophe
03:08
created

Gantt::__construct()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 10
Code Lines 8

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 9
CRAP Score 1

Importance

Changes 1
Bugs 0 Features 0
Metric Value
c 1
b 0
f 0
dl 0
loc 10
ccs 9
cts 9
cp 1
rs 9.4285
cc 1
eloc 8
nc 1
nop 0
crap 1
1
<?php
2
3
namespace CMEN\GoogleChartsBundle\GoogleCharts\Options\GanttChart;
4
5
/**
6
 * @author Christophe Meneses
7
 */
8
class Gantt
9
{
10
    /**
11
     * @var Arrow
12
     */
13
    protected $arrow;
14
15
    /**
16
     * The radius for defining the curve of a bar's corners.
17
     *
18
     * @var int
19
     */
20
    protected $barCornerRadius;
21
22
    /**
23
     * The height of the bars for tasks.
24
     *
25
     * @var int
26
     */
27
    protected $barHeight;
28
29
    /**
30
     * If true any arrows on the critical path will be styled differently.
31
     *
32
     * @var bool
33
     */
34
    protected $criticalPathEnabled;
35
36
    /**
37
     * @var CriticalPathStyle
38
     */
39
    protected $criticalPathStyle;
40
41
    /**
42
     * If the start date cannot be computed from the values in the DataTable, the start date will be set to this.
43
     * Accepts a number, which is the number of milliseconds to use.
44
     *
45
     * @var int
46
     */
47
    protected $defaultStartDate;
48
49
    /**
50
     * @var InnerGridHorizLine
51
     */
52
    protected $innerGridHorizLine;
53
54
    /**
55
     * @var InnerGridTrack
56
     */
57
    protected $innerGridTrack;
58
59
    /**
60
     * @var InnerGridDarkTrack
61
     */
62
    protected $innerGridDarkTrack;
63
64
    /**
65
     * The maximum amount of space allowed for each task label.
66
     *
67
     * @var int
68
     */
69
    protected $labelMaxWidth;
70
71
    /**
72
     * @var LabelStyle
73
     */
74
    protected $labelStyle;
75
76
    /**
77
     * Fills the task bar based on the percentage completed for the task.
78
     *
79
     * @var bool
80
     */
81
    protected $percentEnabled;
82
83
    /**
84
     * @var PercentStyle
85
     */
86
    protected $percentStyle;
87
88
    /**
89
     * If set to true, draws a shadow under each task bar which has dependencies.
90
     *
91
     * @var bool
92
     */
93
    protected $shadowEnabled;
94
95
    /**
96
     * Defines the color of the shadows under any task bar which has dependencies.
97
     *
98
     * @var string
99
     */
100
    protected $shadowColor;
101
102
    /**
103
     * Defines the offset, in pixels, of the shadows under any task bar which has dependencies.
104
     *
105
     * @var int
106
     */
107
    protected $shadowOffset;
108
109
    /**
110
     * The height of the tracks.
111
     *
112
     * @var int
113
     */
114
    protected $trackHeight;
115
116
    /**
117
     * Gantt constructor.
118
     */
119 2
    public function __construct()
120
    {
121 2
        $this->arrow = new Arrow();
122 2
        $this->criticalPathStyle = new CriticalPathStyle();
123 2
        $this->innerGridHorizLine = new InnerGridHorizLine();
124 2
        $this->innerGridTrack = new InnerGridTrack();
125 2
        $this->innerGridDarkTrack = new InnerGridDarkTrack();
126 2
        $this->labelStyle = new LabelStyle();
127 2
        $this->percentStyle = new PercentStyle();
128 2
    }
129
130
    /**
131
     * @return Arrow
132
     */
133 1
    public function getArrow()
134
    {
135 1
        return $this->arrow;
136
    }
137
138
    /**
139
     * @return CriticalPathStyle
140
     */
141 1
    public function getCriticalPathStyle()
142
    {
143 1
        return $this->criticalPathStyle;
144
    }
145
146
    /**
147
     * @return InnerGridHorizLine
148
     */
149 1
    public function getInnerGridHorizLine()
150
    {
151 1
        return $this->innerGridHorizLine;
152
    }
153
154
    /**
155
     * @return InnerGridTrack
156
     */
157 1
    public function getInnerGridTrack()
158
    {
159 1
        return $this->innerGridTrack;
160
    }
161
162
    /**
163
     * @return InnerGridDarkTrack
164
     */
165 1
    public function getInnerGridDarkTrack()
166
    {
167 1
        return $this->innerGridDarkTrack;
168
    }
169
170
    /**
171
     * @return LabelStyle
172
     */
173 1
    public function getLabelStyle()
174
    {
175 1
        return $this->labelStyle;
176
    }
177
178
    /**
179
     * @return PercentStyle
180
     */
181 1
    public function getPercentStyle()
182
    {
183 1
        return $this->percentStyle;
184
    }
185
186
    /**
187
     * @param int $barCornerRadius
188
     *
189
     * @return $this
190
     */
191 1
    public function setBarCornerRadius($barCornerRadius)
192
    {
193 1
        $this->barCornerRadius = $barCornerRadius;
194
195 1
        return $this;
196
    }
197
198
    /**
199
     * @param int $barHeight
200
     *
201
     * @return $this
202
     */
203 1
    public function setBarHeight($barHeight)
204
    {
205 1
        $this->barHeight = $barHeight;
206
207 1
        return $this;
208
    }
209
210
    /**
211
     * @param bool $criticalPathEnabled
212
     *
213
     * @return $this
214
     */
215 1
    public function setCriticalPathEnabled($criticalPathEnabled)
216
    {
217 1
        $this->criticalPathEnabled = $criticalPathEnabled;
218
219 1
        return $this;
220
    }
221
222
    /**
223
     * @param int $defaultStartDate
224
     *
225
     * @return $this
226
     */
227 1
    public function setDefaultStartDate($defaultStartDate)
228
    {
229 1
        $this->defaultStartDate = $defaultStartDate;
230
231 1
        return $this;
232
    }
233
234
    /**
235
     * @param int $labelMaxWidth
236
     *
237
     * @return $this
238
     */
239 1
    public function setLabelMaxWidth($labelMaxWidth)
240
    {
241 1
        $this->labelMaxWidth = $labelMaxWidth;
242
243 1
        return $this;
244
    }
245
246
    /**
247
     * @param bool $percentEnabled
248
     *
249
     * @return $this
250
     */
251 1
    public function setPercentEnabled($percentEnabled)
252
    {
253 1
        $this->percentEnabled = $percentEnabled;
254
255 1
        return $this;
256
    }
257
258
    /**
259
     * @param bool $shadowEnabled
260
     *
261
     * @return $this
262
     */
263 1
    public function setShadowEnabled($shadowEnabled)
264
    {
265 1
        $this->shadowEnabled = $shadowEnabled;
266
267 1
        return $this;
268
    }
269
270
    /**
271
     * @param string $shadowColor
272
     *
273
     * @return $this
274
     */
275 1
    public function setShadowColor($shadowColor)
276
    {
277 1
        $this->shadowColor = $shadowColor;
278
279 1
        return $this;
280
    }
281
282
    /**
283
     * @param int $shadowOffset
284
     *
285
     * @return $this
286
     */
287 1
    public function setShadowOffset($shadowOffset)
288
    {
289 1
        $this->shadowOffset = $shadowOffset;
290
291 1
        return $this;
292
    }
293
294
    /**
295
     * @param int $trackHeight
296
     *
297
     * @return $this
298
     */
299 1
    public function setTrackHeight($trackHeight)
300
    {
301 1
        $this->trackHeight = $trackHeight;
302
303 1
        return $this;
304
    }
305
}
306