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.

ProjectTransformer   A
last analyzed

Complexity

Total Complexity 6

Size/Duplication

Total Lines 39
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Test Coverage

Coverage 0%

Importance

Changes 6
Bugs 0 Features 4
Metric Value
wmc 6
lcom 0
cbo 1
dl 0
loc 39
ccs 0
cts 13
cp 0
rs 10
c 6
b 0
f 4

1 Method

Rating   Name   Duplication   Size   Complexity  
B transform() 0 15 6
1
<?php
2
/**
3
 * This file is part of the Gerrie package.
4
 *
5
 * (c) Andreas Grunwald <[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
namespace Gerrie\Transformer;
12
13
class ProjectTransformer extends BaseTransformer
14
{
15
16
    /**
17
     * Supported index names returned by the Gerrie API.
18
     *
19
     * @var array
20
     */
21
    protected $supportedKeys = [
22
        'id',
23
        // _name is a self added key by Gerrie. This is not a key received by the Gerrit API!
24
        '_name',
25
        'description',
26
        'parent',
27
        'kind',
28
        'state'
29
    ];
30
31
    /**
32
     * Transforms the data into one unique format
33
     *
34
     * @return array
35
     */
36
    public function transform()
37
    {
38
        $data = $this->getData();
39
40
        $transformedData = [
41
            'identifier' => ((isset($data['id']) === true) ? $data['id'] : ''),
42
            'name' => $data['_name'],
43
            'description' => ((isset($data['description']) === true) ? $data['description'] : ''),
44
            'kind' => ((isset($data['kind']) === true) ? $data['kind'] : ''),
45
            'state' => ((isset($data['state']) === true) ? $data['state'] : ''),
46
            'parent' => ((isset($data['parent']) === true) ? $data['parent'] : '')
47
        ];
48
49
        return $transformedData;
50
    }
51
}