Passed
Push — master ( 9b3fb0...881b80 )
by Jérémy
02:18
created

HourlyRateDto   A

Complexity

Total Complexity 4

Size/Duplication

Total Lines 24
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 8
c 1
b 0
f 0
dl 0
loc 24
rs 10
wmc 4

4 Methods

Rating   Name   Duplication   Size   Complexity  
A amount() 0 3 1
A fromArray() 0 3 1
A __construct() 0 4 1
A currency() 0 3 1
1
<?php
2
3
declare(strict_types=1);
4
5
namespace JDecool\Clockify\Model;
6
7
class HourlyRateDto
8
{
9
    private $amount;
10
    private $currency;
11
12
    public static function fromArray(array $data): self
13
    {
14
        return new self($data['amount'], $data['currency']);
15
    }
16
17
    public function __construct(int $amount, string $currency)
18
    {
19
        $this->amount = $amount;
20
        $this->currency = $currency;
21
    }
22
23
    public function amount(): int
24
    {
25
        return $this->amount;
26
    }
27
28
    public function currency(): string
29
    {
30
        return $this->currency;
31
    }
32
}
33