Completed
Pull Request — master (#245)
by Tobias
07:56
created

PaginationResponse::getLastUrl()   A

Complexity

Conditions 2
Paths 2

Size

Total Lines 8
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 8
rs 9.4285
c 0
b 0
f 0
cc 2
eloc 4
nc 2
nop 0
1
<?php
2
3
namespace Mailgun\Resource\Api;
4
5
/**
6
 * @author Tobias Nyholm <[email protected]>
7
 */
8
trait PaginationResponse
9
{
10
    /**
11
     * @var array
12
     */
13
    protected $paging;
14
15
    /**
16
     * @return string
17
     */
18
    public function getNextUrl()
19
    {
20
        if (!isset($this->paging['next'])) {
21
            return;
22
        }
23
24
        return $this->paging['next'];
25
    }
26
27
    /**
28
     * @return string
29
     */
30
    public function getPreviousUrl()
31
    {
32
        if (!isset($this->paging['previous'])) {
33
            return;
34
        }
35
36
        return $this->paging['previous'];
37
    }
38
39
    /**
40
     * @return string
41
     */
42
    public function getFistUrl()
43
    {
44
        if (!isset($this->paging['first'])) {
45
            return;
46
        }
47
48
        return $this->paging['first'];
49
    }
50
51
    /**
52
     * @return string
53
     */
54
    public function getLastUrl()
55
    {
56
        if (!isset($this->paging['last'])) {
57
            return;
58
        }
59
60
        return $this->paging['last'];
61
    }
62
}
63