Completed
Pull Request — master (#30)
by vincent
03:53
created

Company   A

Complexity

Total Complexity 4

Size/Duplication

Total Lines 60
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
wmc 4
lcom 0
cbo 1
dl 0
loc 60
ccs 12
cts 12
cp 1
rs 10
c 0
b 0
f 0

4 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 9 1
A getId() 0 4 1
A getLogoPath() 0 4 1
A getName() 0 4 1
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
12
 */
13
14
15
namespace VfacTmdb\Results;
16
17
use VfacTmdb\Abstracts\Results;
18
use VfacTmdb\Interfaces\Results\CompanyResultsInterface;
19
use VfacTmdb\Interfaces\TmdbInterface;
20
21
/**
22
 * Class to manipulate a company result
23
 * @package Tmdb
24
 * @author Vincent Faliès <[email protected]>
25
 * @copyright Copyright (c) 2017
26
 */
27
class Company extends Results implements CompanyResultsInterface
28
{
29
    /**
30
     * Collection name
31
     * @var string
32
     */
33
    protected $name = null;
34
    /**
35
     * Collection image logo path
36
     * @var string
37
     */
38
    protected $logo_path = null;
39
    /**
40
     * Collection Id
41
     * @var int
42
     */
43
    protected $id = null;
44
45
    /**
46
     * Constructor
47
     * @param TmdbInterface $tmdb
48
     * @param \stdClass $result
49
     */
50 5
    public function __construct(TmdbInterface $tmdb, \stdClass $result)
51
    {
52 5
        parent::__construct($tmdb, $result);
53
54
        // Populate data
55 5
        $this->id        = $this->data->id;
56 5
        $this->name      = $this->data->name;
57 5
        $this->logo_path = $this->data->logo_path;
58 5
    }
59
60
    /**
61
     * Collection id
62
     * @return int
63
     */
64 1
    public function getId() : int
65
    {
66 1
        return $this->id;
67
    }
68
69
    /**
70
     * Image logo path
71
     * @return string
72
     */
73 1
    public function getLogoPath() : string
74
    {
75 1
        return $this->logo_path;
76
    }
77
78
    /**
79
     * Collection name
80
     * @return string
81
     */
82 2
    public function getName() : string
83
    {
84 2
        return $this->name;
85
    }
86
}
87