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

PriceRule::__construct()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 6
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 5
CRAP Score 1

Importance

Changes 0
Metric Value
dl 0
loc 6
ccs 5
cts 5
cp 1
rs 9.4285
c 0
b 0
f 0
cc 1
eloc 4
nc 1
nop 3
crap 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
}