Passed
Pull Request — master (#15)
by Mr
05:17
created

Reminders::all()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 7
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 3
nc 1
nop 1
dl 0
loc 7
rs 10
c 0
b 0
f 0
1
<?php
2
3
namespace Uon\Endpoints;
4
5
use Uon\Client;
6
7
/**
8
 * Class Reminders
9
 *
10
 * @package Uon\Endpoint
11
 */
12
class Reminders extends Client
13
{
14
    /**
15
     * Create new reminder
16
     *
17
     * @link https://api.u-on.ru/{key}/reminder/create.{_format}
18
     *
19
     * @param array $parameters List of parameters
20
     *
21
     * @return null|object|\Uon\Interfaces\ClientInterface
22
     */
23
    public function create(array $parameters)
24
    {
25
        // Set HTTP params
26
        $this->type     = 'post';
27
        $this->endpoint = 'reminder/create';
28
        $this->params   = $parameters;
29
30
        return $this->done();
31
    }
32
33
    /**
34
     * Get list of all reminder
35
     *
36
     * @link https://api.u-on.ru/{key}/reminder/{page}.{_format}
37
     *
38
     * @param int $page Unique ID of reminder
39
     *
40
     * @return null|object|\Uon\Interfaces\ClientInterface
41
     */
42
    public function all(int $page = 1)
43
    {
44
        // Set HTTP params
45
        $this->type     = 'post';
46
        $this->endpoint = 'reminder/' . $page;
47
48
        return $this->done();
49
    }
50
51
    /**
52
     * Get reminder by id
53
     *
54
     * @link https://api.u-on.ru/{key}/reminder/{r_id}.{_format}
55
     *
56
     * @param int $id Unique ID of reminder
57
     *
58
     * @return null|object|\Uon\Interfaces\ClientInterface
59
     */
60
    public function get(int $id)
61
    {
62
        // Set HTTP params
63
        $this->type     = 'get';
64
        $this->endpoint = 'reminder/' . $id;
65
66
        return $this->done();
67
    }
68
}
69