GitHub Access Token became invalid

It seems like the GitHub access token used for retrieving details about this repository from GitHub became invalid. This might prevent certain types of inspections from being run (in particular, everything related to pull requests).
Please ask an admin of your repository to re-new the access token on this website.
Completed
Push — master ( a47fdd...83abd3 )
by
unknown
11s
created

ItemList::setGetParams()   A

Complexity

Conditions 2
Paths 2

Size

Total Lines 7
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 7
rs 9.4285
c 0
b 0
f 0
cc 2
eloc 4
nc 2
nop 1
1
<?php
2
3
namespace SimaLand\API\Entities;
4
5
use SimaLand\API\AbstractList;
6
use SimaLand\API\Record;
7
use SimaLand\API\Rest\Request;
8
9
/**
10
 * Товары.
11
 */
12
class ItemList extends AbstractList
13
{
14
    /**
15
     * GET параметр отвечающий за поток.
16
     *
17
     * @var string
18
     */
19
    public $keyThreads = 'id-mf';
20
21
    /**
22
     * @inheritdoc
23
     */
24
    public function getEntity()
25
    {
26
        return 'item';
27
    }
28
29
    /**
30
     * GET параметры запроса.
31
     *
32
     * @var array
33
     */
34
    protected $_getParams = [
35
        'id-greater-than' => 0
36
    ];
37
38
    /**
39
     * @inheritdoc
40
     */
41
    public function assignPage(Request &$request, Record $record = null)
42
    {
43
        $lastId = 0;
44
        if ($record && $record->data) {
45
            $lastId = (int)$record->data['id'];
46
        }
47
        if (!is_array($request->getParams)) {
48
            $request->getParams = (array)$request->getParams;
49
        }
50
        $request->getParams[$this->keyAlternativePagination] = $lastId;
51
    }
52
53
    /**
54
     * @inheritdoc
55
     */
56
    public function assignThreadsNumber(Request &$request, $number = 0)
57
    {
58
        if (!is_array($request->getParams)) {
59
            $request->getParams = (array)$request->getParams;
60
        }
61
        $request->getParams[$this->keyThreads] = "{$this->countThreads},$number";
62
    }
63
64
    /**
65
     * @inheritdoc
66
     */
67
    public function setGetParams(array $value)
68
    {
69
        if (!isset($value[$this->keyAlternativePagination])) {
70
            $value[$this->keyAlternativePagination] = 0;
71
        }
72
        parent::setGetParams($value);
73
    }
74
}
75