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.

Status   A
last analyzed

Complexity

Total Complexity 10

Size/Duplication

Total Lines 97
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 1

Importance

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

6 Methods

Rating   Name   Duplication   Size   Complexity  
A getValue() 0 4 1
A isStopped() 0 4 1
A __construct() 0 8 2
A isChecking() 0 5 2
A isDownloading() 0 5 2
A isSeeding() 0 5 2
1
<?php
2
namespace Transmission\Model;
3
4
/**
5
 * @author Ramon Kleiss <[email protected]>
6
 */
7
class Status extends AbstractModel
8
{
9
    /**
10
     * @var integer
11
     */
12
    const STATUS_STOPPED = 0;
13
14
    /**
15
     * @var integer
16
     */
17
    const STATUS_CHECK_WAIT = 1;
18
19
    /**
20
     * @var integer
21
     */
22
    const STATUS_CHECK = 2;
23
24
    /**
25
     * @var integer
26
     */
27
    const STATUS_DOWNLOAD_WAIT = 3;
28
29
    /**
30
     * @var integer
31
     */
32
    const STATUS_DOWNLOAD = 4;
33
34
    /**
35
     * @var integer
36
     */
37
    const STATUS_SEED_WAIT = 5;
38
39
    /**
40
     * @var integer
41
     */
42
    const STATUS_SEED = 6;
43
44
    /**
45
     * @var integer
46
     */
47
    protected $status;
48
49
    /**
50
     * @param integer|Status $status
51
     */
52
    public function __construct($status)
53
    {
54
        if ($status instanceof self) {
55
            $this->status = $status->getValue();
56
        } else {
57
            $this->status = (integer) $status;
58
        }
59
    }
60
61
    /**
62
     * @return integer
63
     */
64
    public function getValue()
65
    {
66
        return $this->status;
67
    }
68
69
    /**
70
     * @return boolean
71
     */
72
    public function isStopped()
73
    {
74
        return $this->status == self::STATUS_STOPPED;
75
    }
76
77
    /**
78
     * @return boolean
79
     */
80
    public function isChecking()
81
    {
82
        return ($this->status == self::STATUS_CHECK ||
83
                $this->status == self::STATUS_CHECK_WAIT);
84
    }
85
86
    /**
87
     * @return boolean
88
     */
89
    public function isDownloading()
90
    {
91
        return ($this->status == self::STATUS_DOWNLOAD ||
92
                $this->status == self::STATUS_DOWNLOAD_WAIT);
93
    }
94
95
    /**
96
     * @return boolean
97
     */
98
    public function isSeeding()
99
    {
100
        return ($this->status == self::STATUS_SEED ||
101
                $this->status == self::STATUS_SEED_WAIT);
102
    }
103
}
104