Passed
Pull Request — master (#21)
by Thijs
02:17
created

ManagesStates::states()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 5
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 3
CRAP Score 1

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 2
c 1
b 0
f 0
nc 1
nop 2
dl 0
loc 5
ccs 3
cts 3
cp 1
crap 1
rs 10
1
<?php
2
3
namespace TestMonitor\DevOps\Actions;
4
5
use TestMonitor\DevOps\Transforms\TransformsStates;
6
7
trait ManagesStates
8
{
9
    use TransformsStates;
10
11
    /**
12
     * Get a list of states for a project and work item type.
13
     *
14
     * @param string $projectId
15
     * @param string $workItemType
16
     *
17
     * @throws \TestMonitor\DevOps\Exceptions\InvalidDataException
18
     *
19
     * @return \TestMonitor\DevOps\Resources\States[]
20
     */
21 7
    public function states($projectId, $workItemType)
22
    {
23 7
        $response = $this->get("{$projectId}/_apis/wit/workitemtypes/{$workItemType}/states");
0 ignored issues
show
Bug introduced by
It seems like get() must be provided by classes using this trait. How about adding it as abstract method to this trait? ( Ignorable by Annotation )

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

23
        /** @scrutinizer ignore-call */ 
24
        $response = $this->get("{$projectId}/_apis/wit/workitemtypes/{$workItemType}/states");
Loading history...
24
25 1
        return $this->fromDevOpsStates($response['value']);
26
    }
27
}
28