Completed
Push — master ( d15cf4...5163a0 )
by Valentyn
06:05
created

MovieTMDB::setVoteAverage()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 5
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 3
CRAP Score 1

Importance

Changes 0
Metric Value
dl 0
loc 5
ccs 3
cts 3
cp 1
rs 9.4285
c 0
b 0
f 0
cc 1
eloc 3
nc 1
nop 1
crap 1
1
<?php
2
declare(strict_types=1);
3
4
namespace App\Movies\Entity;
5
6
use Doctrine\ORM\Mapping as ORM;
7
use Symfony\Component\Serializer\Annotation\Groups;
8
9
/**
10
 * @ORM\Embeddable
11
 */
12
class MovieTMDB
13
{
14
    /**
15
     * @Groups({"list", "view"})
16
     * @ORM\Column(type="integer")
17
     */
18
    private $id;
19
20
    /**
21
     * @Groups({"list", "view"})
22
     * @ORM\Column(type="decimal", nullable=true)
23
     */
24
    private $voteAverage;
25
26
    /**
27
     * @Groups({"list", "view"})
28
     * @ORM\Column(type="integer", nullable=true)
29
     */
30
    private $voteCount;
31
32 1
    public function __construct(int $tmdbId)
33
    {
34 1
        $this->id = $tmdbId;
35 1
    }
36
37
    /**
38
     * @param float $voteAverage
39
     * @return MovieTMDB
40
     */
41 1
    public function setVoteAverage(float $voteAverage): self
42
    {
43 1
        $this->voteAverage = $voteAverage;
44 1
        return $this;
45
    }
46
47
    /**
48
     * @param int $voteCount
49
     * @return MovieTMDB
50
     */
51 1
    public function setVoteCount(int $voteCount): self
52
    {
53 1
        $this->voteCount = $voteCount;
54 1
        return $this;
55
    }
56
57
    /**
58
     * @return mixed
59
     */
60 2
    public function getId()
61
    {
62 2
        return $this->id;
63
    }
64
65
    /**
66
     * @return mixed
67
     */
68 2
    public function getVoteAverage()
69
    {
70 2
        return $this->voteAverage;
71
    }
72
73
    /**
74
     * @return mixed
75
     */
76 2
    public function getVoteCount()
77
    {
78 2
        return $this->voteCount;
79
    }
80
}