Passed
Pull Request — master (#48)
by
unknown
03:49
created

Change::__construct()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 7
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 4
CRAP Score 1

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 3
c 1
b 0
f 0
nc 1
nop 2
dl 0
loc 7
ccs 4
cts 4
cp 1
crap 1
rs 10
1
<?php declare(strict_types = 1);
2
/**
3
 * This file is part of the Tmdb package.
4
 *
5
 * (c) Vincent Faliès <[email protected]>
6
 *
7
 * For the full copyright and license information, please view the LICENSE
8
 * file that was distributed with this source code.
9
 *
10
 * @author Vincent Faliès <[email protected]>
11
 * @copyright Copyright (c) 2017-2020
12
 */
13
14
namespace VfacTmdb\Results;
15
16
use VfacTmdb\Abstracts\Results;
17
use VfacTmdb\Interfaces\TmdbInterface;
18
use VfacTmdb\Interfaces\Results\ChangeResultsInterface;
19
20
/**
21
 * Class to manipulate a Change result
22
 * @package Tmdb
23
 * @author Steve Richter <[email protected]>
24
 * @copyright Copyright (c) 2017-2020
25
 */
26
class Change extends Results implements ChangeResultsInterface
27
{
28
    /**
29
     * Adult
30
     * @var bool
31
     */
32
    protected $adult = null;
33
    /**
34
     * Id
35
     * @var int
36
     */
37
    protected $id = null;
38
39
    /**
40
     * Constructor
41
     * @param TmdbInterface $tmdb
42
     * @param \stdClass $result
43
     */
44 15
    public function __construct(TmdbInterface $tmdb, \stdClass $result)
45
    {
46 15
        parent::__construct($tmdb, $result);
47
48
        // Populate data
49 15
        $this->id             = $this->data->id;
50 15
        $this->adult          = $this->data->adult;
51 15
    }
52
53
    /**
54
     * Get Id
55
     * @return int
56
     */
57 3
    public function getId() : int
58
    {
59 3
        return (int) $this->id;
60
    }
61
62
    /**
63
     * Adult
64
     * @return bool
65
     */
66 3
    public function getAdult() : bool
67
    {
68 3
        return $this->adult;
69
    }
70
}
71