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.

BaseTransformer   A
last analyzed

Complexity

Total Complexity 4

Size/Duplication

Total Lines 58
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Test Coverage

Coverage 0%

Importance

Changes 3
Bugs 1 Features 1
Metric Value
wmc 4
lcom 0
cbo 0
dl 0
loc 58
ccs 0
cts 16
cp 0
rs 10
c 3
b 1
f 1

5 Methods

Rating   Name   Duplication   Size   Complexity  
A setData() 0 4 1
A getData() 0 4 1
A getSupportedKeys() 0 4 1
A isResponsible() 0 4 1
transform() 0 1 ?
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
abstract class BaseTransformer implements TransformerInterface
14
{
15
16
    /**
17
     * Data to transform
18
     *
19
     * @var array
20
     */
21
    private $data;
22
23
    /**
24
     * Set the data to transform
25
     *
26
     * @param array $data
27
     * @return void
28
     */
29
    public function setData(array $data)
30
    {
31
        $this->data = $data;
32
    }
33
34
    /**
35
     * Returns the data to transform
36
     *
37
     * @return array
38
     */
39
    public function getData()
40
    {
41
        return $this->data;
42
    }
43
44
    /**
45
     * Returns the supported index names by the Gerrit API.
46
     *
47
     * @return array
48
     */
49
    public function getSupportedKeys()
50
    {
51
        return $this->supportedKeys;
0 ignored issues
show
Bug introduced by
The property supportedKeys does not exist. Did you maybe forget to declare it?

In PHP it is possible to write to properties without declaring them. For example, the following is perfectly valid PHP code:

class MyClass { }

$x = new MyClass();
$x->foo = true;

Generally, it is a good practice to explictly declare properties to avoid accidental typos and provide IDE auto-completion:

class MyClass {
    public $foo;
}

$x = new MyClass();
$x->foo = true;
Loading history...
52
    }
53
54
    /**
55
     * Checks if the current data transformer is responsible to transform the given data.
56
     *
57
     * @return boolean
58
     */
59
    public function isResponsible()
60
    {
61
        return false;
62
    }
63
64
    /**
65
     * Transforms the data into one unique format
66
     *
67
     * @return array
68
     */
69
    abstract public function transform();
70
}