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 ( f252bb...862be0 )
by Sergey
10:05
created

ApiRequest::toArray()   A

Complexity

Conditions 4
Paths 6

Size

Total Lines 18
Code Lines 10

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 1
Metric Value
c 1
b 0
f 1
dl 0
loc 18
rs 9.2
cc 4
eloc 10
nc 6
nop 0
1
<?php
2
/*
3
 * This file is part of the reva2/jsonapi.
4
 *
5
 * (c) OrbitScripts LLC <[email protected]>
6
 *
7
 * For the full copyright and license information, please view the LICENSE
8
 * file that was distributed with this source code.
9
 */
10
11
12
namespace Reva2\JsonApi\Annotations;
13
14
/**
15
 * JSON API request annotation
16
 *
17
 * @package Reva2\JsonApi\Annotations
18
 * @author Sergey Revenko <[email protected]>
19
 *
20
 * @Annotation
21
 * @Target({"CLASS","METHOD"})
22
 */
23
class ApiRequest
24
{
25
    /**
26
     * Query type
27
     *
28
     * @var string
29
     */
30
    public $query;
31
32
    /**
33
     * Body type
34
     *
35
     * @var string
36
     */
37
    public $body;
38
39
    /**
40
     * Code matcher
41
     *
42
     * @var Reva2\JsonApi\Annotations\Matcher
43
     */
44
    public $matcher;
45
46
    /**
47
     * Prefix for URLs generator
48
     *
49
     * @var string
50
     */
51
    public $urlPrefix;
52
53
    /**
54
     * @return array
55
     */
56
    public function toArray()
57
    {
58
        $data = [];
59
60
        $properties = ['query', 'body', 'urlPrefix'];
61
        foreach ($properties as $property) {
62
            $value = $this->{$property};
63
            if (null !== $value) {
64
                $data[$property] = $value;
65
            }
66
        }
67
68
        if (null !== $this->matcher) {
69
            $data['matcher'] = $this->matcher->toArray();
70
        }
71
72
        return $data;
73
    }
74
}