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

ManagesStates   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 19
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 4
c 1
b 0
f 0
dl 0
loc 19
ccs 3
cts 3
cp 1
rs 10
wmc 1

1 Method

Rating   Name   Duplication   Size   Complexity  
A states() 0 5 1
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