Passed
Pull Request — master (#34)
by Adam
03:39
created

Account   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 21
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 3
dl 0
loc 21
rs 10
c 1
b 0
f 0
wmc 2

2 Methods

Rating   Name   Duplication   Size   Complexity  
A getDrushAliases() 0 3 1
A get() 0 3 1
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 Account
11
 * @package AcquiaCloudApi\CloudApi
12
 */
13
class Account extends CloudApiBase implements CloudApiInterface
14
{
15
16
    /**
17
     * Returns details about your account.
18
     *
19
     * @return AccountResponse
20
     */
21
    public function get()
22
    {
23
        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

23
        return new AccountResponse(/** @scrutinizer ignore-type */ $this->client->request('get', '/account'));
Loading history...
24
    }
25
26
    /**
27
     * Provides an archived set of files for Acquia Drush aliases.
28
     *
29
     * @return object
30
     */
31
    public function getDrushAliases()
32
    {
33
        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...
34
    }
35
}
36