Completed
Push — master ( 8675c0...7e0d41 )
by KwangSeob
23s queued 13s
created

EpicService   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 26
Duplicated Lines 0 %

Importance

Changes 2
Bugs 1 Features 1
Metric Value
eloc 11
c 2
b 1
f 1
dl 0
loc 26
rs 10
wmc 3

3 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 4 1
A getEpicIssues() 0 6 1
A getEpic() 0 6 1
1
<?php
2
3
namespace JiraRestApi\Epic;
4
5
use JiraRestApi\AgileApiTrait;
6
use JiraRestApi\Configuration\ConfigurationInterface;
7
use JiraRestApi\Issue\Issue;
8
use Psr\Log\LoggerInterface;
9
10
class EpicService extends \JiraRestApi\JiraClient
11
{
12
    use AgileApiTrait;
13
14
    private $uri = '/epic';
15
16
    public function __construct(ConfigurationInterface $configuration = null, LoggerInterface $logger = null, $path = './')
17
    {
18
        parent::__construct($configuration, $logger, $path);
19
        $this->setupAPIUri();
20
    }
21
22
    public function getEpic($id, $paramArray = [])
23
    {
24
        $json = $this->exec($this->uri.'/'.$id.$this->toHttpQueryParameter($paramArray), null);
25
        $epic = $this->json_mapper->map(json_decode($json), new Epic());
26
27
        return $epic;
28
    }
29
30
    public function getEpicIssues($id, $paramArray = [])
31
    {
32
        $json = $this->exec($this->uri.'/'.$id.'/issue'.$this->toHttpQueryParameter($paramArray), null);
33
        $issues = $this->json_mapper->mapArray(json_decode($json)->issues, new \ArrayObject(), Issue::class);
34
35
        return $issues;
36
    }
37
}
38