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

Notifications   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 26
Duplicated Lines 0 %

Importance

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

2 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 3 1
A get() 0 6 1
1
<?php
2
3
namespace AcquiaCloudApi\Endpoints;
4
5
use AcquiaCloudApi\Connector\ClientInterface;
6
use AcquiaCloudApi\Response\NotificationResponse;
7
8
/**
9
 * Class Client
10
 * @package AcquiaCloudApi\CloudApi
11
 */
12
class Notifications 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
     * Returns details about a notification.
29
     *
30
     * @return NotificationResponse
31
     */
32
    public function get($notificationUuid)
33
    {
34
        return new NotificationResponse(
35
            $this->client->request(
0 ignored issues
show
Bug introduced by
It seems like $this->client->request('...ns/'.$notificationUuid) can also be of type array; however, parameter $notification 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

35
            /** @scrutinizer ignore-type */ $this->client->request(
Loading history...
36
                'get',
37
                "/notifications/${notificationUuid}"
38
            )
39
        );
40
    }
41
}
42