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.

AbstractModel   A
last analyzed

Complexity

Total Complexity 6

Size/Duplication

Total Lines 55
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 2

Importance

Changes 7
Bugs 2 Features 1
Metric Value
wmc 6
c 7
b 2
f 1
lcom 1
cbo 2
dl 0
loc 55
rs 10

5 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 4 1
A setClient() 0 4 1
A getClient() 0 4 1
A getMapping() 0 4 1
A call() 0 9 2
1
<?php
2
namespace Transmission\Model;
3
4
use Transmission\Client;
5
use Transmission\Util\ResponseValidator;
6
7
/**
8
 * Base class for Transmission models
9
 *
10
 * @author Ramon Kleiss <[email protected]>
11
 */
12
abstract class AbstractModel implements ModelInterface
13
{
14
    /**
15
     * @var Client
16
     */
17
    protected $client;
18
19
    /**
20
     * Constructor
21
     *
22
     * @param Client $client
23
     */
24
    public function __construct(Client $client = null)
25
    {
26
        $this->client = $client;
27
    }
28
29
    /**
30
     * @param Client $client
31
     */
32
    public function setClient(Client $client)
33
    {
34
        $this->client = $client;
35
    }
36
37
    /**
38
     * @return Client
39
     */
40
    public function getClient()
41
    {
42
        return $this->client;
43
    }
44
45
    /**
46
     * {@inheritDoc}
47
     */
48
    public static function getMapping()
49
    {
50
        return array();
51
    }
52
53
    /**
54
     * @param string $method
55
     * @param array  $arguments
56
     */
57
    protected function call($method, $arguments)
58
    {
59
        if ($this->client) {
60
            ResponseValidator::validate(
61
                $method,
62
                $this->client->call($method, $arguments)
63
            );
64
        }
65
    }
66
}
67