Completed
Pull Request — master (#80)
by John
02:58
created

Pet::__construct()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 7
Code Lines 5

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 7
rs 9.4285
c 0
b 0
f 0
cc 1
eloc 5
nc 1
nop 4
1
<?php declare(strict_types = 1);
2
3
namespace KleijnWeb\SwaggerBundle\Tests\Functional\PetStore\Model\Resources;
4
5
class Pet
6
{
7
    /**
8
     * @var int
9
     */
10
    private $id;
11
12
    /**
13
     * @var string
14
     */
15
    private $name;
16
17
    /**
18
     * @var string[]
19
     */
20
    private $photoUrls;
21
22
    /**
23
     * @var Category
24
     */
25
    private $category;
26
27
    /**
28
     * @var Tag[]
29
     */
30
    private $tags = [];
31
32
    /**
33
     * Pet constructor.
34
     *
35
     * @param string   $name
36
     * @param string[] $photoUrls
37
     * @param Category $category
38
     * @param Tag[]    $tags
39
     */
40
    public function __construct(string $name, array $photoUrls, Category $category, array $tags)
41
    {
42
        $this->name      = $name;
43
        $this->photoUrls = $photoUrls;
44
        $this->category  = $category;
45
        $this->tags      = $tags;
46
    }
47
48
    /**
49
     * @param int $id
50
     *
51
     * @return Pet
52
     */
53
    public function setId(int $id): Pet
54
    {
55
        $this->id = $id;
56
57
        return $this;
58
    }
59
60
    /**
61
     * @return Category
62
     */
63
    public function getCategory(): Category
64
    {
65
        return $this->category;
66
    }
67
68
    /**
69
     * @return Tag[]
70
     */
71
    public function getTags(): array
72
    {
73
        return $this->tags;
74
    }
75
}
76