Notifications   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 37
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 2

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
wmc 2
lcom 1
cbo 2
dl 0
loc 37
ccs 7
cts 7
cp 1
rs 10
c 0
b 0
f 0

2 Methods

Rating   Name   Duplication   Size   Complexity  
A all() 0 4 1
A filter() 0 9 1
1
<?php
2
3
namespace Trello\Api\Member;
4
5
use Trello\Api\AbstractApi;
6
use Trello\Events;
7
8
/**
9
 * Trello Member Notifications API
10
 * @link https://trello.com/docs/api/member
11
 *
12
 * Fully implemented.
13
 */
14
class Notifications extends AbstractApi
15
{
16
    protected $path = 'members/#id#/notifications';
17
18
    /**
19
     * Get notifications related to a given list
20
     * @link https://trello.com/docs/api/member/#get-1-members-idmember-or-username-notifications
21
     *
22
     * @param string $id     the member's id or username
23
     * @param array  $params optional parameters
24
     *
25
     * @return array
26
     */
27 1
    public function all($id, array $params = array())
28
    {
29 1
        return $this->get($this->getPath($id), $params);
30
    }
31
32
    /**
33
     * Filter notifications related to a given member
34
     * @link https://trello.com/docs/api/member/#get-1-members-idmember-or-username-notifications-filter
35
     *
36
     * @param string $id    the member's id or username
37
     * @param array  $event one of the events defined in \Trello\Events or 'all'
38
     *
39
     * @return array
40
     */
41 3
    public function filter($id, $event = 'all')
42
    {
43 3
        $events = Events::all();
44 3
        $events[] = 'all';
45
46 3
        $events = $this->validateAllowedParameters($events, $event, 'event');
47
48 3
        return $this->get($this->getPath($id).'/'.implode(',', $events));
49
    }
50
}
51