Completed
Push — Lonja/albertg ( 67863a...bda4e5 )
by Albert
07:39 queued 05:26
created

PriceRule   A

Complexity

Total Complexity 4

Size/Duplication

Total Lines 28
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
wmc 4
lcom 0
cbo 0
dl 0
loc 28
ccs 11
cts 11
cp 1
rs 10
c 0
b 0
f 0

4 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 6 1
A city() 0 4 1
A product() 0 4 1
A price() 0 4 1
1
<?php
2
3
namespace Kata\Lonja\Domain;
4
5
use Kata\Lonja\Domain\Model\Product;
6
7
final class PriceRule
8
{
9
    private $city;
10
    private $product;
11
    private $price;
12
13 1
    public function __construct(string $a_city, Product $a_product, float $a_price)
14
    {
15 1
        $this->city    = $a_city;
16 1
        $this->product = $a_product;
17 1
        $this->price   = $a_price;
18 1
    }
19
20 4
    public function city()
21
    {
22 4
        return $this->city;
23
    }
24
25 4
    public function product(): Product
26
    {
27 4
        return $this->product;
28
    }
29
30 4
    public function price(): float
31
    {
32 4
        return $this->price;
33
    }
34
}