Product   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 19
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
eloc 7
dl 0
loc 19
c 0
b 0
f 0
rs 10
wmc 3

3 Methods

Rating   Name   Duplication   Size   Complexity  
A name() 0 3 1
A price() 0 3 1
A __construct() 0 4 1
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Damax\ChargeableApi\Product;
6
7
use Damax\ChargeableApi\Credit;
8
9
final class Product
10
{
11
    private $name;
12
    private $price;
13
14
    public function __construct(string $name, int $price)
15
    {
16
        $this->name = $name;
17
        $this->price = $price;
18
    }
19
20
    public function name(): string
21
    {
22
        return $this->name;
23
    }
24
25
    public function price(): Credit
26
    {
27
        return Credit::fromInteger($this->price);
28
    }
29
}
30