Issues (21)

src/Product.php (4 issues)

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