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 ( b04e0b...0f07bb )
by Sergey
02:50
created

ApiRequest   A

Complexity

Total Complexity 4

Size/Duplication

Total Lines 67
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 1

Test Coverage

Coverage 90%

Importance

Changes 0
Metric Value
wmc 4
lcom 1
cbo 1
dl 0
loc 67
ccs 9
cts 10
cp 0.9
rs 10
c 0
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A toArray() 0 18 4
1
<?php
2
/*
3
 * This file is part of the reva2/jsonapi.
4
 *
5
 * (c) Sergey Revenko <[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 Matcher
43
     */
44
    public $matcher;
45
46
    /**
47
     * Prefix for URLs generator
48
     *
49
     * @var string
50
     */
51
    public $urlPrefix;
52
53
    /**
54
     * List of serialization groups
55
     *
56
     * @var array
57
     */
58
    public $serialization = ['Default'];
59
60
    /**
61
     * List of validation groups that should be
62
     * automatically checked on request parsing
63
     *
64
     * @var array<string>
65
     */
66
    public $validation = ['Default'];
67
68
    /**
69
     * @return array
70
     */
71 1
    public function toArray()
72
    {
73 1
        $data = [];
74
75 1
        $properties = ['query', 'body', 'urlPrefix', 'validation', 'serialization'];
76 1
        foreach ($properties as $property) {
77 1
            $value = $this->{$property};
78 1
            if (null !== $value) {
79 1
                $data[$property] = $value;
80
            }
81
        }
82
83 1
        if (null !== $this->matcher) {
84
            $data['matcher'] = $this->matcher->toArray();
85
        }
86
87 1
        return $data;
88
    }
89
}
90