House::getHouseId()   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\Houses;
4
5
use Igorsgm\TibiaDataApi\Exceptions\ImmutableException;
6
use Igorsgm\TibiaDataApi\Traits\ImmutableTrait;
7
use Igorsgm\TibiaDataApi\Traits\SerializableTrait;
8
9 View Code Duplication
class House
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...
10
{
11
    use ImmutableTrait, SerializableTrait;
12
13
    /**
14
     * @var int
15
     */
16
    private $houseId;
17
18
    /**
19
     * @var string
20
     */
21
    private $name;
22
23
    /**
24
     * @var int
25
     */
26
    private $size;
27
28
    /**
29
     * @var int
30
     */
31
    private $rent;
32
33
    /**
34
     * @var string
35
     */
36
    private $status;
37
38
    /**
39
     * House constructor.
40
     * @param  int  $id
41
     * @param  string  $name
42
     * @param  int  $size
43
     * @param  int  $rent
44
     * @param  string  $status
45
     * @throws ImmutableException
46
     */
47
    public function __construct(int $id, string $name, int $size, int $rent, string $status)
48
    {
49
        $this->handleImmutableConstructor();
50
51
        $this->houseId = $id;
52
        $this->name = $name;
53
        $this->size = $size;
54
        $this->rent = $rent;
55
        $this->status = $status;
56
    }
57
58
    /**
59
     * @return int
60
     */
61
    public function getHouseId(): int
62
    {
63
        return $this->houseId;
64
    }
65
66
    /**
67
     * @return string
68
     */
69
    public function getName(): string
70
    {
71
        return $this->name;
72
    }
73
74
    /**
75
     * @return int
76
     */
77
    public function getSize(): int
78
    {
79
        return $this->size;
80
    }
81
82
    /**
83
     * @return int
84
     */
85
    public function getRent(): int
86
    {
87
        return $this->rent;
88
    }
89
90
    /**
91
     * @return string
92
     */
93
    public function getStatus(): string
94
    {
95
        return $this->status;
96
    }
97
98
    /**
99
     * @return bool
100
     */
101
    public function isRented()
102
    {
103
        return $this->status === 'rented';
104
    }
105
}
106