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 ( b6f94c...1f3339 )
by
unknown
10s
created

CategoryList::__construct()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 4
rs 10
c 0
b 0
f 0
cc 1
eloc 2
nc 1
nop 2
1
<?php
2
3
namespace SimaLand\API\Entities;
4
5
use SimaLand\API\AbstractList;
6
use SimaLand\API\Rest\Client;
7
use SimaLand\API\Record;
8
use SimaLand\API\Rest\Request;
9
10
/**
11
 * Категории.
12
 */
13
class CategoryList extends AbstractList
14
{
15
    /**
16
     * GET параметр отвечающий за поток.
17
     *
18
     * @var string
19
     */
20
    public $keyThreads = 'id-mf';
21
22
    /**
23
     * @inheritdoc
24
     */
25
    public function __construct(Client $client, array $options = [])
26
    {
27
        parent::__construct($client, $options);
28
    }
29
30
    /**
31
     * @inheritdoc
32
     */
33 View Code Duplication
    public function assignPage(Request &$request, Record $record = null)
0 ignored issues
show
Duplication introduced by
This method seems to be duplicated in your project.

Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.

You can also find more detailed suggestions in the “Code” section of your repository.

Loading history...
34
    {
35
        $lastId = 0;
36
        if ($record && $record->data) {
37
            $lastId = (int)$record->data['id'];
38
        }
39
        if (!is_array($request->getParams)) {
40
            $request->getParams = (array)$request->getParams;
41
        }
42
        $request->getParams[$this->keyAlternativePagination] = $lastId;
43
    }
44
45
    /**
46
     * @inheritdoc
47
     */
48 View Code Duplication
    public function assignThreadsNumber(Request &$request, $number = 0)
0 ignored issues
show
Duplication introduced by
This method seems to be duplicated in your project.

Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.

You can also find more detailed suggestions in the “Code” section of your repository.

Loading history...
49
    {
50
        if (!is_array($request->getParams)) {
51
            $request->getParams = (array)$request->getParams;
52
        }
53
        $request->getParams[$this->keyThreads] = "{$this->countThreads},$number";
54
    }
55
56
    /**
57
     * @inheritdoc
58
     */
59
    public function getEntity()
60
    {
61
        return 'category';
62
    }
63
64
    /**
65
     * @inheritdoc
66
     */
67 View Code Duplication
    public function setGetParams(array $value)
0 ignored issues
show
Duplication introduced by
This method seems to be duplicated in your project.

Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.

You can also find more detailed suggestions in the “Code” section of your repository.

Loading history...
68
    {
69
        if (!isset($value[$this->keyAlternativePagination])) {
70
            $value[$this->keyAlternativePagination] = 0;
71
        }
72
        parent::setGetParams($value);
73
    }
74
}
75