Issues (19)

src/Actions/ManagesProjects.php (1 issue)

Labels
Severity
1
<?php
2
3
namespace TestMonitor\DevOps\Actions;
4
5
use TestMonitor\DevOps\Resources\Project;
6
use TestMonitor\DevOps\Transforms\TransformsProjects;
7
8
trait ManagesProjects
9
{
10
    use TransformsProjects;
11
12
    /**
13
     * Get a single project.
14
     *
15
     * @param string $id
16
     *
17
     * @throws \TestMonitor\DevOps\Exceptions\InvalidDataException
18
     *
19
     * @return \TestMonitor\DevOps\Resources\Project
20
     */
21 4
    public function project(string $id): Project
22
    {
23 4
        $response = $this->get("_apis/projects/{$id}");
0 ignored issues
show
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("_apis/projects/{$id}");
Loading history...
24
25 1
        return $this->fromDevOpsProject($response);
26
    }
27
28
    /**
29
     * Get a list of of projects.
30
     *
31
     * @throws \TestMonitor\DevOps\Exceptions\InvalidDataException
32
     *
33
     * @return \TestMonitor\DevOps\Resources\Project[]
34
     */
35 7
    public function projects()
36
    {
37 7
        $response = $this->get('_apis/projects');
38
39 1
        return $this->fromDevOpsProjects($response['value']);
40
    }
41
}
42