Completed
Pull Request — master (#34)
by Adam
08:58
created

Account::getDrushAliases()   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\AccountResponse;
7
use Psr\Http\Message\StreamInterface;
8
9
/**
10
 * Class Client
11
 * @package AcquiaCloudApi\CloudApi
12
 */
13
class Account implements CloudApi
14
{
15
16
    /** @var ClientInterface The API client. */
17
    protected $client;
18
19
    /**
20
     * Client constructor.
21
     *
22
     * @param ClientInterface $client
23
     */
24
    public function __construct(ClientInterface $client)
25
    {
26
        $this->client = $client;
27
    }
28
29
    /**
30
     * Returns details about your account.
31
     *
32
     * @return AccountResponse
33
     */
34
    public function getAccount()
35
    {
36
        return new AccountResponse($this->client->request('get', '/account'));
0 ignored issues
show
Bug introduced by
It seems like $this->client->request('get', '/account') can also be of type array; however, parameter $account of AcquiaCloudApi\Response\...Response::__construct() does only seem to accept object, 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

36
        return new AccountResponse(/** @scrutinizer ignore-type */ $this->client->request('get', '/account'));
Loading history...
37
    }
38
39
    /**
40
     * Provides an archived set of files for Acquia Drush aliases.
41
     *
42
     * @return object
43
     */
44
    public function getDrushAliases()
45
    {
46
        return $this->client->request('get', '/account/drush-aliases/download');
0 ignored issues
show
Bug Best Practice introduced by
The expression return $this->client->re...rush-aliases/download') also could return the type array which is incompatible with the documented return type object.
Loading history...
47
    }
48
}
49