Information   A
last analyzed

Complexity

Total Complexity 5

Size/Duplication

Total Lines 74
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 2

Importance

Changes 0
Metric Value
wmc 5
lcom 0
cbo 2
dl 0
loc 74
rs 10
c 0
b 0
f 0

5 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 9 1
A getApiVersion() 0 4 1
A getExecutionTime() 0 4 1
A getLastUpdated() 0 4 1
A getTimestamp() 0 4 1
1
<?php
2
3
namespace Igorsgm\TibiaDataApi\Models;
4
5
use Carbon\Carbon;
6
use Igorsgm\TibiaDataApi\Traits\ImmutableTrait;
7
use Igorsgm\TibiaDataApi\Traits\SerializableTrait;
8
9
class Information
10
{
11
    use ImmutableTrait, SerializableTrait;
12
13
    /**
14
     * @var int
15
     */
16
    private $apiVersion;
17
18
    /**
19
     * @var float
20
     */
21
    private $executionTime;
22
23
    /**
24
     * @var Carbon
25
     */
26
    private $lastUpdated;
27
28
    /**
29
     * @var Carbon
30
     */
31
    private $timestamp;
32
33
    /**
34
     * Information constructor.
35
     * @param  int  $apiVersion
36
     * @param  float  $executionTime
37
     * @param  Carbon  $lastUpdate
38
     * @param  Carbon  $timestamp
39
     * @throws \Igorsgm\TibiaDataApi\Exceptions\ImmutableException
40
     */
41
    public function __construct(int $apiVersion, float $executionTime, Carbon $lastUpdate, Carbon $timestamp)
42
    {
43
        $this->handleImmutableConstructor();
44
45
        $this->apiVersion = $apiVersion;
46
        $this->executionTime = $executionTime;
47
        $this->lastUpdated = $lastUpdate;
48
        $this->timestamp = $timestamp;
49
    }
50
51
    /**
52
     * @return int
53
     */
54
    public function getApiVersion(): int
55
    {
56
        return $this->apiVersion;
57
    }
58
59
    /**
60
     * @return float
61
     */
62
    public function getExecutionTime(): float
63
    {
64
        return $this->executionTime;
65
    }
66
67
    /**
68
     * @return Carbon
69
     */
70
    public function getLastUpdated(): Carbon
71
    {
72
        return $this->lastUpdated;
73
    }
74
75
    /**
76
     * @return Carbon
77
     */
78
    public function getTimestamp(): Carbon
79
    {
80
        return $this->timestamp;
81
    }
82
}
83