News::getTibiaUrl()   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\Newslist;
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 News
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 $id;
18
19
    /**
20
     * @var string
21
     */
22
    private $type;
23
24
    /**
25
     * @var string
26
     */
27
    private $news;
28
29
    /**
30
     * @var string
31
     */
32
    private $apiUrl;
33
34
    /**
35
     * @var string
36
     */
37
    private $tibiaUrl;
38
39
    /**
40
     * @var Carbon
41
     */
42
    private $date;
43
44
    /**
45
     * News constructor.
46
     * @param  int  $id
47
     * @param  string  $type
48
     * @param  string  $news
49
     * @param  string  $apiUrl
50
     * @param  string  $tibiaUrl
51
     * @param  Carbon  $date
52
     * @throws ImmutableException
53
     */
54
    public function __construct(int $id, string $type, string $news, string $apiUrl, string $tibiaUrl, Carbon $date)
55
    {
56
        $this->handleImmutableConstructor();
57
58
        $this->id = $id;
59
        $this->type = $type;
60
        $this->news = $news;
61
        $this->apiUrl = $apiUrl;
62
        $this->tibiaUrl = $tibiaUrl;
63
        $this->date = $date;
64
    }
65
66
    /**
67
     * @return int
68
     */
69
    public function getId(): int
70
    {
71
        return $this->id;
72
    }
73
74
    /**
75
     * @return string
76
     */
77
    public function getType(): string
78
    {
79
        return $this->type;
80
    }
81
82
    /**
83
     * @return string
84
     */
85
    public function getNews(): string
86
    {
87
        return $this->news;
88
    }
89
90
    /**
91
     * @return string
92
     */
93
    public function getApiUrl(): string
94
    {
95
        return $this->apiUrl;
96
    }
97
98
    /**
99
     * @return string
100
     */
101
    public function getTibiaUrl(): string
102
    {
103
        return $this->tibiaUrl;
104
    }
105
106
    /**
107
     * @return Carbon
108
     */
109
    public function getDate(): Carbon
110
    {
111
        return $this->date;
112
    }
113
}
114