Passed
Pull Request — master (#342)
by
unknown
03:21
created

SprintReportService::getSprintReportData()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 8
Code Lines 5

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 1
Metric Value
cc 1
eloc 5
c 1
b 0
f 1
nc 1
nop 3
dl 0
loc 8
rs 10
1
<?php
2
3
namespace JiraRestApi\RapidCharts;
4
5
use JiraRestApi\Configuration\ConfigurationInterface;
6
use JiraRestApi\GreenHopperTrait;
7
use Psr\Log\LoggerInterface;
8
9
class SprintReportService extends \JiraRestApi\JiraClient
10
{
11
    use GreenHopperTrait;
12
13
    private $uri = '/rapid/charts/sprintreport';
14
15
    public function __construct(ConfigurationInterface $configuration = null, LoggerInterface $logger = null, $path = './')
16
    {
17
        parent::__construct($configuration, $logger, $path);
18
        $this->setupAPIUri();
19
    }
20
21
    public function getSprintReportData($rapidViewId, $sprintId, $paramArray = [])
22
    {
23
        $paramArray['rapidViewId'] = $rapidViewId;
24
        $paramArray['sprintId'] = $sprintId;
25
        $json = $this->exec($this->uri.'/'.$this->toHttpQueryParameter($paramArray), null);
26
        $sprintReport = json_decode($json);
0 ignored issues
show
Bug introduced by
It seems like $json can also be of type true; however, parameter $json of json_decode() does only seem to accept string, maybe add an additional type check? ( Ignorable by Annotation )

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

26
        $sprintReport = json_decode(/** @scrutinizer ignore-type */ $json);
Loading history...
27
28
        return $sprintReport;
29
    }
30
}
31