Checklists   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 38
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 1

Test Coverage

Coverage 100%

Importance

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

2 Methods

Rating   Name   Duplication   Size   Complexity  
A all() 0 4 1
A create() 0 6 1
1
<?php
2
3
namespace Trello\Api\Board;
4
5
use Trello\Api\AbstractApi;
6
7
/**
8
 * Trello Board Checklists API
9
 * @link https://trello.com/docs/api/board
10
 *
11
 * Fully implemented.
12
 */
13
class Checklists extends AbstractApi
14
{
15
    /**
16
     * Base path of board checklists api
17
     * @var string
18
     */
19
    protected $path = 'boards/#id#/checklists';
20
21
    /**
22
     * Get cards related to a given board
23
     * @link https://trello.com/docs/api/board/#get-1-boards-board-id-cards
24
     *
25
     * @param string $id     the board's
26
     * @param array  $params optional parameters
27
     *
28
     * @return array
29
     */
30 1
    public function all($id, array $params = array())
31
    {
32 1
        return $this->get($this->getPath($id), $params);
33
    }
34
35
    /**
36
     * Add an checklist to a given board
37
     * @link https://trello.com/docs/api/board/#post-1-boards-board-id-checklists
38
     *
39
     * @param string $id     the board's id
40
     * @param array  $params optional parameters
41
     *
42
     * @return array
43
     */
44 2
    public function create($id, array $params)
45
    {
46 2
        $this->validateRequiredParameters(array('name'), $params);
47
48 1
        return $this->post($this->getPath($id), $params);
49
    }
50
}
51