Completed
Pull Request — master (#34)
by Adam
02:26
created

Permissions::getPermissions()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 1
dl 0
loc 3
rs 10
c 1
b 0
f 0
cc 1
nc 1
nop 0
1
<?php
2
3
namespace AcquiaCloudApi\Endpoints;
4
5
use AcquiaCloudApi\Connector\ClientInterface;
6
use AcquiaCloudApi\Response\PermissionsResponse;
7
8
/**
9
 * Class Client
10
 * @package AcquiaCloudApi\CloudApi
11
 */
12
class Permissions implements CloudApi
13
{
14
15
    /** @var ClientInterface The API client. */
16
    protected $client;
17
18
    /**
19
     * Client constructor.
20
     *
21
     * @param ClientInterface $client
22
     */
23
    public function __construct(ClientInterface $client)
24
    {
25
        $this->client = $client;
26
    }
27
28
    /**
29
     * Show all available permissions.
30
     *
31
     * @return PermissionsResponse
32
     */
33
    public function getPermissions()
34
    {
35
        return new PermissionsResponse($this->client->request('get', '/permissions'));
0 ignored issues
show
Bug introduced by
It seems like $this->client->request('get', '/permissions') can also be of type Psr\Http\Message\StreamInterface and object; however, parameter $permissions of AcquiaCloudApi\Response\...Response::__construct() does only seem to accept array, 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

35
        return new PermissionsResponse(/** @scrutinizer ignore-type */ $this->client->request('get', '/permissions'));
Loading history...
36
    }
37
}
38