Passed
Push — master ( 61b2f8...584670 )
by Chubarov
05:03
created

Product::getPrice()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 1
nc 1
nop 0
dl 0
loc 3
rs 10
c 0
b 0
f 0
1
<?php
2
declare(strict_types=1);
3
4
namespace Fns;
5
6
class Product
7
{
8
    public function __construct(array $item)
9
    {
10
        foreach ($item as $property => $value) {
11
            $this->{$property} = $value;
12
        }
13
    }
14
15
    public function getName() : string
16
    {
17
        return $this->name;
0 ignored issues
show
Bug Best Practice introduced by
The property name does not exist on Fns\Product. Did you maybe forget to declare it?
Loading history...
18
    }
19
20
    public function getPrice():int
21
    {
22
        return (int)$this->price;
0 ignored issues
show
Bug Best Practice introduced by
The property price does not exist on Fns\Product. Did you maybe forget to declare it?
Loading history...
23
    }
24
25
    public function getQuantity() : int
26
    {
27
        return (int)$this->quantity;
0 ignored issues
show
Bug Best Practice introduced by
The property quantity does not exist on Fns\Product. Did you maybe forget to declare it?
Loading history...
28
    }
29
30
    public function getCost() : int
31
    {
32
        return (int)$this->sum;
0 ignored issues
show
Bug Best Practice introduced by
The property sum does not exist on Fns\Product. Did you maybe forget to declare it?
Loading history...
33
    }
34
}
35