Completed
Pull Request — master (#68)
by De Cramer
05:45
created

Record::getNbFinish()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 1

Importance

Changes 0
Metric Value
dl 0
loc 4
ccs 2
cts 2
cp 1
rs 10
c 0
b 0
f 0
cc 1
eloc 2
nc 1
nop 0
crap 1
1
<?php
2
3
namespace eXpansion\Bundle\LocalRecords\Entity;
4
5
/**
6
 * Class Record
7
 *
8
 * @package eXpansion\Bundle\LocalRecords;
9
 * @author  oliver de Cramer <[email protected]>
10
 */
11
class Record
12
{
13
    /** @var int */
14
    protected $id;
15
16
    /** @var string */
17
    protected $mapUid;
18
19
    /** @var int */
20
    protected $playerLogin;
21
22
    /** @var int */
23
    protected $nbLaps;
24
25
    /** @var int */
26
    protected $score;
27
28
    /** @var int */
29
    protected $nbFinish;
30
31
    /** @var int */
32
    protected $avgScore;
33
34
    /** @var string */
35
    protected $checkpoints;
36
37
    /** @var  \DateTime */
38
    protected $date;
39
40
    /**
41
     * @return int
42
     */
43
    public function getId()
44
    {
45
        return $this->id;
46
    }
47
48
    /**
49
     * @param int $id
50
     */
51
    public function setId($id)
52
    {
53
        $this->id = $id;
54
    }
55
56
    /**
57
     * @return string
58
     */
59
    public function getMapUid()
60
    {
61
        return $this->mapUid;
62
    }
63
64
    /**
65
     * @param string $mapUid
66
     */
67 3
    public function setMapUid($mapUid)
68
    {
69 3
        $this->mapUid = $mapUid;
70 3
    }
71
72
    /**
73
     * @return int
74
     */
75 22
    public function getPlayerLogin()
76
    {
77 22
        return $this->playerLogin;
78
    }
79
80
    /**
81
     * @param int $playerLogin
82
     */
83 23
    public function setPlayerLogin($playerLogin)
84
    {
85 23
        $this->playerLogin = $playerLogin;
86 23
    }
87
88
    /**
89
     * @return int
90
     */
91
    public function getNbLaps()
92
    {
93
        return $this->nbLaps;
94
    }
95
96
    /**
97
     * @param int $nbLaps
98
     */
99 3
    public function setNbLaps($nbLaps)
100
    {
101 3
        $this->nbLaps = $nbLaps;
102 3
    }
103
104
    /**
105
     * @return int
106
     */
107 22
    public function getScore()
108
    {
109 22
        return $this->score;
110
    }
111
112
    /**
113
     * @param int $score
114
     */
115 23
    public function setScore($score)
116
    {
117 23
        $this->score = $score;
118 23
    }
119
120
    /**
121
     * @return int
122
     */
123 8
    public function getNbFinish()
124
    {
125 8
        return $this->nbFinish;
126
    }
127
128
    /**
129
     * @param int $nbFinish
130
     */
131 8
    public function setNbFinish($nbFinish)
132
    {
133 8
        $this->nbFinish = $nbFinish;
134 8
    }
135
136
    /**
137
     * @return int
138
     */
139 8
    public function getAvgScore()
140
    {
141 8
        return $this->avgScore;
142
    }
143
144
    /**
145
     * @param int $avgScore
146
     */
147 8
    public function setAvgScore($avgScore)
148
    {
149 8
        $this->avgScore = $avgScore;
150 8
    }
151
152
    /**
153
     * @return string
154
     */
155
    public function getCheckpoints()
156
    {
157
        return $this->checkpoints;
158
    }
159
160
    /**
161
     * @param string $checkpoints
162
     */
163
    public function setCheckpoints($checkpoints)
164
    {
165
        $this->checkpoints = $checkpoints;
166
    }
167
168
    /**
169
     * Get checkpoint times
170
     *
171
     * @return int[]
172
     */
173
    public function getCheckpointTimes()
174
    {
175
        return explode(',', $this->getCheckpoints());
176
    }
177
178
    /**
179
     * Set checkpoint times.
180
     *
181
     * @param int[]
182
     */
183 6
    public function setCheckpointTimes($checkpointTimes)
0 ignored issues
show
Unused Code introduced by
The parameter $checkpointTimes is not used and could be removed.

This check looks from parameters that have been defined for a function or method, but which are not used in the method body.

Loading history...
184
    {
185
        // @TODO see why cp times is empty.
186
        // $this->setCheckpointTimes(implode(',', $checkpointTimes));
0 ignored issues
show
Unused Code Comprehensibility introduced by
72% of this comment could be valid code. Did you maybe forget this after debugging?

Sometimes obsolete code just ends up commented out instead of removed. In this case it is better to remove the code once you have checked you do not need it.

The code might also have been commented out for debugging purposes. In this case it is vital that someone uncomments it again or your project may behave in very unexpected ways in production.

This check looks for comments that seem to be mostly valid code and reports them.

Loading history...
187 6
    }
188
189
    /**
190
     * @return \DateTime
191
     */
192
    public function getDate()
193
    {
194
        return $this->date;
195
    }
196
197
    /**
198
     * @param \DateTime $date
199
     */
200 6
    public function setDate($date)
201
    {
202 6
        $this->date = $date;
203
    }
204
}