These results are based on our legacy PHP analysis, consider migrating to our new PHP analysis engine instead. Learn more
1 | <?php |
||
2 | |||
3 | namespace CMEN\GoogleChartsBundle\GoogleCharts\Options; |
||
4 | |||
5 | /** |
||
6 | * @author Christophe Meneses |
||
7 | */ |
||
8 | View Code Duplication | class Gridlines |
|
0 ignored issues
–
show
|
|||
9 | { |
||
10 | /** |
||
11 | * The color of the horizontal gridlines inside the chart area. Specify a valid HTML color string. |
||
12 | * |
||
13 | * @var string |
||
14 | */ |
||
15 | protected $color; |
||
16 | |||
17 | /** |
||
18 | * The number of horizontal gridlines inside the chart area. Minimum value is 2. Specify -1 to automatically |
||
19 | * compute the number of gridlines. |
||
20 | * |
||
21 | * @var int |
||
22 | */ |
||
23 | protected $count; |
||
24 | |||
25 | /** |
||
26 | * @var Units |
||
27 | */ |
||
28 | protected $units; |
||
29 | |||
30 | |||
31 | /** |
||
32 | * Gridlines constructor. |
||
33 | */ |
||
34 | 3 | public function __construct() |
|
35 | { |
||
36 | 3 | $this->units = new Units(); |
|
37 | 3 | } |
|
38 | |||
39 | |||
40 | /** |
||
41 | * @return Units |
||
42 | */ |
||
43 | 1 | public function getUnits() |
|
44 | { |
||
45 | 1 | return $this->units; |
|
46 | } |
||
47 | |||
48 | /** |
||
49 | * @param int $count |
||
50 | * |
||
51 | * @return $this |
||
52 | */ |
||
53 | 2 | public function setCount($count) |
|
54 | 1 | { |
|
55 | 2 | $this->count = $count; |
|
56 | |||
57 | 2 | return $this; |
|
58 | } |
||
59 | |||
60 | /** |
||
61 | * @param string $color |
||
62 | * |
||
63 | * @return $this |
||
64 | */ |
||
65 | 1 | public function setColor($color) |
|
66 | { |
||
67 | 1 | $this->color = $color; |
|
68 | |||
69 | 1 | return $this; |
|
70 | } |
||
71 | } |
||
72 |
Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.
You can also find more detailed suggestions in the “Code” section of your repository.