OnlineRecord::getNumber()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 4

Duplication

Lines 4
Ratio 100 %

Importance

Changes 0
Metric Value
dl 4
loc 4
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 0
1
<?php
2
3
namespace Igorsgm\TibiaDataApi\Models\World;
4
5
use Carbon\Carbon;
6
use Igorsgm\TibiaDataApi\Exceptions\ImmutableException;
7
use Igorsgm\TibiaDataApi\Traits\ImmutableTrait;
8
use Igorsgm\TibiaDataApi\Traits\SerializableTrait;
9
10 View Code Duplication
class OnlineRecord
0 ignored issues
show
Duplication introduced by
This class seems to be duplicated in your project.

Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.

You can also find more detailed suggestions in the “Code” section of your repository.

Loading history...
11
{
12
    use ImmutableTrait, SerializableTrait;
13
14
    /**
15
     * @var int
16
     */
17
    private $number;
18
19
    /**
20
     * @var Carbon
21
     */
22
    private $date;
23
24
    /**
25
     * OnlineRecord constructor.
26
     * @param  int  $number
27
     * @param  Carbon  $date
28
     * @throws ImmutableException
29
     */
30
    public function __construct(int $number, Carbon $date)
31
    {
32
        $this->handleImmutableConstructor();
33
34
        $this->number = $number;
35
        $this->date = $date;
36
    }
37
38
    /**
39
     * @return int
40
     */
41
    public function getNumber(): int
42
    {
43
        return $this->number;
44
    }
45
46
    /**
47
     * @return Carbon
48
     */
49
    public function getDate(): Carbon
50
    {
51
        return $this->date;
52
    }
53
}
54