Notifications   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 26
Duplicated Lines 0 %

Importance

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

2 Methods

Rating   Name   Duplication   Size   Complexity  
A getAll() 0 6 1
A get() 0 6 1
1
<?php
2
3
namespace AcquiaCloudApi\Endpoints;
4
5
use AcquiaCloudApi\Response\NotificationResponse;
6
use AcquiaCloudApi\Response\NotificationsResponse;
7
8
/**
9
 * Class Notifications
10
 *
11
 * @package AcquiaCloudApi\CloudApi
12
 */
13
class Notifications extends CloudApiBase
14
{
15
    /**
16
     * Returns details about a notification.
17
     */
18
    public function get(string $notificationUuid): NotificationResponse
19
    {
20
        return new NotificationResponse(
21
            $this->client->request(
22
                'get',
23
                "/notifications/$notificationUuid"
24
            )
25
        );
26
    }
27
28
    /**
29
     * Returns a list of notifications.
30
     *
31
     * @return NotificationsResponse<NotificationResponse>
32
     */
33
    public function getAll(string $applicationUuid): NotificationsResponse
34
    {
35
        return new NotificationsResponse(
36
            $this->client->request(
37
                'get',
38
                "/applications/$applicationUuid/notifications"
39
            )
40
        );
41
    }
42
}
43