BarChart::getPackage()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 1
c 1
b 0
f 0
nc 1
nop 0
dl 0
loc 3
ccs 0
cts 2
cp 0
crap 2
rs 10
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