Completed
Pull Request — master (#51)
by Konrad
03:32
created

Item::slug()   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
3
declare(strict_types=1);
4
5
namespace BitBag\SyliusElasticsearchPlugin\Controller\Response\DTO;
6
7
final class Item
8
{
9
    /** @var string */
10
    private $taxonName;
11
12
    /** @var string */
13
    private $name;
14
15
    /** @var string */
16
    private $description;
17
18
    /** @var string */
19
    private $slug;
20
21
    /** @var string */
22
    private $price;
23
24
    /** @var string */
25
    private $image;
26
27
    public function __construct(
28
        string $taxonName,
29
        string $name,
30
        string $description,
31
        string $slug,
32
        string $price,
33
        string $image
34
    ) {
35
        $this->taxonName = $taxonName;
36
        $this->name = $name;
37
        $this->description = $description;
38
        $this->slug = $slug;
39
        $this->price = $price;
40
        $this->image = $image;
41
    }
42
43
    public function taxonName(): string
44
    {
45
        return $this->taxonName;
46
    }
47
48
    public function name(): string
49
    {
50
        return $this->name;
51
    }
52
53
    public function description(): string
54
    {
55
        return $this->description;
56
    }
57
58
    public function slug(): string
59
    {
60
        return $this->slug;
61
    }
62
63
    public function price(): string
64
    {
65
        return $this->price;
66
    }
67
68
    public function image(): string
69
    {
70
        return $this->image;
71
    }
72
73
    public function toArray(): array
74
    {
75
        return [
76
            'taxon_name' => $this->taxonName(),
77
            'name' => $this->name(),
78
            'description' => $this->description(),
79
            'slug' => $this->slug(),
80
            'price' => $this->price(),
81
            'image' => $this->image(),
82
        ];
83
    }
84
}
85