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.

File   A
last analyzed

Complexity

Total Complexity 9

Size/Duplication

Total Lines 90
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 1

Importance

Changes 7
Bugs 0 Features 5
Metric Value
wmc 9
c 7
b 0
f 5
lcom 1
cbo 1
dl 0
loc 90
rs 10

9 Methods

Rating   Name   Duplication   Size   Complexity  
A setName() 0 4 1
A getName() 0 4 1
A setSize() 0 4 1
A getSize() 0 4 1
A setCompleted() 0 4 1
A getCompleted() 0 4 1
A isDone() 0 4 1
A __toString() 0 4 1
A getMapping() 0 8 1
1
<?php
2
namespace Transmission\Model;
3
4
/**
5
 * @author Ramon Kleiss <[email protected]>
6
 */
7
class File extends AbstractModel
8
{
9
    /**
10
     * @var string
11
     */
12
    protected $name;
13
14
    /**
15
     * @var integer
16
     */
17
    protected $size;
18
19
    /**
20
     * @var integer
21
     */
22
    protected $completed;
23
24
    /**
25
     * @param string $name
26
     */
27
    public function setName($name)
28
    {
29
        $this->name = (string) $name;
30
    }
31
32
    /**
33
     * @return string
34
     */
35
    public function getName()
36
    {
37
        return $this->name;
38
    }
39
40
    /**
41
     * @param integer $size
42
     */
43
    public function setSize($size)
44
    {
45
        $this->size = (integer) $size;
46
    }
47
48
    /**
49
     * @return integer
50
     */
51
    public function getSize()
52
    {
53
        return $this->size;
54
    }
55
56
    /**
57
     * @param integer $size
0 ignored issues
show
Bug introduced by
There is no parameter named $size. Was it maybe removed?

This check looks for PHPDoc comments describing methods or function parameters that do not exist on the corresponding method or function.

Consider the following example. The parameter $italy is not defined by the method finale(...).

/**
 * @param array $germany
 * @param array $island
 * @param array $italy
 */
function finale($germany, $island) {
    return "2:1";
}

The most likely cause is that the parameter was removed, but the annotation was not.

Loading history...
58
     */
59
    public function setCompleted($completed)
60
    {
61
        $this->completed = (integer) $completed;
62
    }
63
64
    /**
65
     * @return integer
66
     */
67
    public function getCompleted()
68
    {
69
        return $this->completed;
70
    }
71
72
    /**
73
     * @return boolean
74
     */
75
    public function isDone()
76
    {
77
        return $this->getSize() == $this->getCompleted();
78
    }
79
80
    /**
81
     * {@inheritDoc}
82
     */
83
    public static function getMapping()
84
    {
85
        return array(
86
            'name' => 'name',
87
            'length' => 'size',
88
            'bytesCompleted' => 'completed'
89
        );
90
    }
91
92
    public function __toString()
93
    {
94
        return $this->name;
95
    }
96
}
97