Passed
Push — master ( 754b1f...8ec9da )
by Andrey
03:32
created

Limit::getLimit()   A

Complexity

Conditions 2
Paths 2

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 2
eloc 2
c 0
b 0
f 0
nc 2
nop 0
dl 0
loc 4
rs 10
1
<?php
2
3
namespace Daaner\NovaPoshta\Traits;
4
5
trait Limit
6
{
7
    protected $limit;
8
    protected $page;
9
10
    /**
11
     * Установка лимита записей.
12
     *
13
     * @param  int  $limit  Лимит записей
14
     * @return $this
15
     */
16
    public function setLimit(int $limit): self
17
    {
18
        $this->limit = $limit;
19
20
        return $this;
21
    }
22
23
    /**
24
     * Установка страницы.
25
     *
26
     * @param  int  $page  Номер страницы данных
27
     * @return $this
28
     */
29
    public function setPage(int $page): self
30
    {
31
        $this->page = $page;
32
33
        return $this;
34
    }
35
36
    /**
37
     * @return void
38
     */
39
    public function getLimit(): void
40
    {
41
        if ($this->limit) {
42
            $this->methodProperties['Limit'] = $this->limit;
43
        }
44
    }
45
46
    /**
47
     * @return void
48
     */
49
    public function getPage(): void
50
    {
51
        if ($this->page) {
52
            $this->methodProperties['Page'] = $this->page;
53
        }
54
    }
55
}
56