Completed
Push — master ( 5163a0...712d21 )
by Valentyn
06:59
created

MovieTMDB::getVoteAverage()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 1

Importance

Changes 0
Metric Value
dl 0
loc 4
ccs 2
cts 2
cp 1
rs 10
c 0
b 0
f 0
cc 1
eloc 2
nc 1
nop 0
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 2
    public function __construct(int $tmdbId, ?float $voteAverage, ?int $voteCount)
33
    {
34 2
        $this->id = $tmdbId;
35 2
        $this->voteAverage = $voteAverage;
36 2
        $this->voteCount = $voteCount;
37 2
    }
38
39 4
    public function getId(): int
40
    {
41 4
        return $this->id;
42
    }
43
44 4
    public function getVoteAverage(): ?float
45
    {
46 4
        return (float)$this->voteAverage;
47
    }
48
49 4
    public function getVoteCount(): ?int
50
    {
51 4
        return (int)$this->voteCount;
52
    }
53
}