Passed
Push — master ( bb4b24...67574e )
by KwangSeob
02:29
created

IssueTypeService   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 21
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 8
c 1
b 0
f 0
dl 0
loc 21
rs 10
wmc 1

1 Method

Rating   Name   Duplication   Size   Complexity  
A getAll() 0 9 1
1
<?php
2
3
namespace JiraRestApi\IssueType;
4
5
use JiraRestApi\JiraException;
6
use JsonMapper_Exception;
7
8
class IssueTypeService extends \JiraRestApi\JiraClient
9
{
10
    private $uri = '/issuetype';
11
12
    /**
13
     * get all issuetypes.
14
     *
15
     * @throws JiraException
16
     * @throws JsonMapper_Exception
17
     *
18
     * @return IssueType[] array of Project class
19
     */
20
    public function getAll()
21
    {
22
        $ret = $this->exec($this->uri.'/', null);
23
        $this->log->info("Result=\n".$ret);
0 ignored issues
show
Bug introduced by
Are you sure $ret of type string|true can be used in concatenation? ( Ignorable by Annotation )

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

23
        $this->log->info("Result=\n"./** @scrutinizer ignore-type */ $ret);
Loading history...
24
25
        return $this->json_mapper->mapArray(
26
            json_decode($ret, false),
0 ignored issues
show
Bug introduced by
It seems like $ret 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
            json_decode(/** @scrutinizer ignore-type */ $ret, false),
Loading history...
27
            new \ArrayObject(),
28
            \JiraRestApi\Issue\IssueType::class
29
        );
30
    }
31
}
32