BarChart   A
last analyzed

Complexity

Total Complexity 5

Size/Duplication

Total Lines 33
Duplicated Lines 0 %

Test Coverage

Coverage 0%

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 9
c 1
b 0
f 0
dl 0
loc 33
ccs 0
cts 12
cp 0
rs 10
wmc 5

5 Methods

Rating   Name   Duplication   Size   Complexity  
A getOptions() 0 3 1
A __construct() 0 6 1
A getType() 0 3 1
A getLibrary() 0 3 1
A getPackage() 0 3 1
1
<?php
2
3
namespace CMEN\GoogleChartsBundle\GoogleCharts\Charts\Material;
4
5
use CMEN\GoogleChartsBundle\GoogleCharts\Options\BarChart\Material\BarChartOptions;
6
use CMEN\GoogleChartsBundle\GoogleCharts\Options\ChartOptionsInterface;
7
8
/**
9
 * @author Christophe Meneses
10
 */
11
class BarChart extends \CMEN\GoogleChartsBundle\GoogleCharts\Charts\BarChart
12
{
13
    /**
14
     * @var BarChartOptions
15
     */
16
    protected ChartOptionsInterface $options;
17
18
    public function __construct()
19
    {
20
        parent::__construct();
21
22
        $this->options = new BarChartOptions();
23
        $this->options->setBars('horizontal');
0 ignored issues
show
Bug introduced by
The method setBars() does not exist on CMEN\GoogleChartsBundle\...s\ChartOptionsInterface. It seems like you code against a sub-type of CMEN\GoogleChartsBundle\...s\ChartOptionsInterface such as CMEN\GoogleChartsBundle\...rial\ColumnChartOptions or CMEN\GoogleChartsBundle\...aterial\BarChartOptions. ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-call  annotation

23
        $this->options->/** @scrutinizer ignore-call */ 
24
                        setBars('horizontal');
Loading history...
24
    }
25
26
    public function getPackage(): string
27
    {
28
        return 'bar';
29
    }
30
31
    public function getLibrary(): string
32
    {
33
        return 'charts';
34
    }
35
36
    public function getType(): string
37
    {
38
        return 'Bar';
39
    }
40
41
    public function getOptions(): BarChartOptions
42
    {
43
        return $this->options;
0 ignored issues
show
Bug Best Practice introduced by
The expression return $this->options returns the type CMEN\GoogleChartsBundle\...s\ChartOptionsInterface which includes types incompatible with the type-hinted return CMEN\GoogleChartsBundle\...aterial\BarChartOptions.
Loading history...
44
    }
45
}
46