Passed
Pull Request — master (#228)
by
unknown
02:26
created

BoardService::__construct()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 2
nc 1
nop 3
dl 0
loc 4
rs 10
c 0
b 0
f 0
1
<?php
2
3
namespace JiraRestApi\Board;
4
5
use JiraRestApi\Configuration\ConfigurationInterface;
6
use JiraRestApi\Issue\Issue;
7
8
class BoardService extends \JiraRestApi\JiraClient
9
{
10
    private $uri = '/board';
11
12
    public function __construct(ConfigurationInterface $configuration = null, Logger $logger = null, $path = './')
0 ignored issues
show
Bug introduced by
The type JiraRestApi\Board\Logger was not found. Maybe you did not declare it correctly or list all dependencies?

The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g. excluded_paths: ["lib/*"], you can move it to the dependency path list as follows:

filter:
    dependency_paths: ["lib/*"]

For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths

Loading history...
13
    {
14
        parent::__construct($configuration, $logger, $path);
15
        $this->setAPIUri('/rest/agile/1.0');
16
    }
17
18
    /**
19
     * get all project list.
20
     *
21
     * @param array $paramArray
22
     *
23
     * @throws \JiraRestApi\JiraException
24
     *
25
     * @return Project[] array of Project class
26
     */
27
    public function getBoardList($paramArray = [])
28
    {
29
        $json = $this->exec($this->uri.$this->toHttpQueryParameter($paramArray), null);
30
        $boards = $this->json_mapper->mapArray(
31
            json_decode($json)->values, new \ArrayObject(), Board::class
32
        );
33
34
        return $boards;
35
    }
36
37
    public function getBoard($id, $paramArray = [])
38
    {
39
        $json = $this->exec($this->uri.'/'.$id.$this->toHttpQueryParameter($paramArray), null);
40
        $board = $this->json_mapper->map(
41
            json_decode($json), new Board()
42
        );
43
44
        return $board;
45
    }
46
47
    public function getBoardIssues($id, $paramArray = [])
48
    {
49
        $json = $this->exec($this->uri.'/'.$id.'/issue'.$this->toHttpQueryParameter($paramArray), null);
50
        $board = $this->json_mapper->mapArray(
51
            json_decode($json)->issues, new \ArrayObject(), Issue::class
52
        );
53
54
        return $board;
55
    }
56
}
57