Completed
Push — master ( 45987f...d5d263 )
by KwangSeob
11s
created

BoardService   A

Complexity

Total Complexity 4

Size/Duplication

Total Lines 47
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
eloc 16
dl 0
loc 47
rs 10
c 0
b 0
f 0
wmc 4

4 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 4 1
A getBoardList() 0 8 1
A getBoardIssues() 0 8 1
A getBoard() 0 8 1
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