Passed
Pull Request — master (#17)
by
unknown
04:11
created

TVEpisode   A

Complexity

Total Complexity 14

Size/Duplication

Total Lines 102
Duplicated Lines 0 %

Coupling/Cohesion

Components 4
Dependencies 2

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
wmc 14
lcom 4
cbo 2
dl 0
loc 102
ccs 35
cts 35
cp 1
rs 10
c 0
b 0
f 0

14 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 16 1
A getAirDate() 0 4 1
A getCrew() 0 4 1
A getEpisodeNumber() 0 4 1
A getGuestStars() 0 4 1
A getId() 0 4 1
A getName() 0 4 1
A getNote() 0 4 1
A getNoteCount() 0 4 1
A getOverview() 0 4 1
A getProductionCode() 0 4 1
A getReleaseDate() 0 4 1
A getSeasonNumber() 0 4 1
A getStillPath() 0 4 1
1
<?php
2
3
namespace vfalies\tmdb\Results;
4
5
use vfalies\tmdb\Abstracts\Results;
6
use vfalies\tmdb\Tmdb;
7
use vfalies\tmdb\Interfaces\Results\TVEpisodeResultsInterface;
8
use vfalies\tmdb\Exceptions\NotYetImplementedException;
9
10
class TVEpisode extends Results implements TVEpisodeResultsInterface
11
{
12
13
    protected $episode_number = 0;
14
    protected $name           = '';
15
16
    /**
17
     * Constructor
18
     * @param \vfalies\tmdb\Tmdb $tmdb
19
     * @param \stdClass $result
20
     * @throws \Exception
21
     */
22 12
    public function __construct(Tmdb $tmdb, \stdClass $result)
23
    {
24 12
        parent::__construct($tmdb, $result);
25
26
        // Populate data
27 12
        $this->id              = $this->data->id;
28 12
        $this->release_date    = $this->data->air_date;
0 ignored issues
show
Bug introduced by
The property release_date does not exist. Did you maybe forget to declare it?

In PHP it is possible to write to properties without declaring them. For example, the following is perfectly valid PHP code:

class MyClass { }

$x = new MyClass();
$x->foo = true;

Generally, it is a good practice to explictly declare properties to avoid accidental typos and provide IDE auto-completion:

class MyClass {
    public $foo;
}

$x = new MyClass();
$x->foo = true;
Loading history...
29 12
        $this->season_number   = $this->data->season_number;
0 ignored issues
show
Bug introduced by
The property season_number does not exist. Did you maybe forget to declare it?

In PHP it is possible to write to properties without declaring them. For example, the following is perfectly valid PHP code:

class MyClass { }

$x = new MyClass();
$x->foo = true;

Generally, it is a good practice to explictly declare properties to avoid accidental typos and provide IDE auto-completion:

class MyClass {
    public $foo;
}

$x = new MyClass();
$x->foo = true;
Loading history...
30 12
        $this->episode_number  = $this->data->episode_number;
31 12
        $this->name            = $this->data->name;
32 12
        $this->vote_average    = $this->data->vote_average;
0 ignored issues
show
Bug introduced by
The property vote_average does not exist. Did you maybe forget to declare it?

In PHP it is possible to write to properties without declaring them. For example, the following is perfectly valid PHP code:

class MyClass { }

$x = new MyClass();
$x->foo = true;

Generally, it is a good practice to explictly declare properties to avoid accidental typos and provide IDE auto-completion:

class MyClass {
    public $foo;
}

$x = new MyClass();
$x->foo = true;
Loading history...
33 12
        $this->vote_count      = $this->data->vote_count;
0 ignored issues
show
Bug introduced by
The property vote_count does not exist. Did you maybe forget to declare it?

In PHP it is possible to write to properties without declaring them. For example, the following is perfectly valid PHP code:

class MyClass { }

$x = new MyClass();
$x->foo = true;

Generally, it is a good practice to explictly declare properties to avoid accidental typos and provide IDE auto-completion:

class MyClass {
    public $foo;
}

$x = new MyClass();
$x->foo = true;
Loading history...
34 12
        $this->overview        = $this->data->overview;
0 ignored issues
show
Bug introduced by
The property overview does not exist. Did you maybe forget to declare it?

In PHP it is possible to write to properties without declaring them. For example, the following is perfectly valid PHP code:

class MyClass { }

$x = new MyClass();
$x->foo = true;

Generally, it is a good practice to explictly declare properties to avoid accidental typos and provide IDE auto-completion:

class MyClass {
    public $foo;
}

$x = new MyClass();
$x->foo = true;
Loading history...
35 12
        $this->production_code = $this->data->production_code;
0 ignored issues
show
Bug introduced by
The property production_code does not exist. Did you maybe forget to declare it?

In PHP it is possible to write to properties without declaring them. For example, the following is perfectly valid PHP code:

class MyClass { }

$x = new MyClass();
$x->foo = true;

Generally, it is a good practice to explictly declare properties to avoid accidental typos and provide IDE auto-completion:

class MyClass {
    public $foo;
}

$x = new MyClass();
$x->foo = true;
Loading history...
36 12
        $this->still_path      = $this->data->still_path;
0 ignored issues
show
Bug introduced by
The property still_path does not exist. Did you maybe forget to declare it?

In PHP it is possible to write to properties without declaring them. For example, the following is perfectly valid PHP code:

class MyClass { }

$x = new MyClass();
$x->foo = true;

Generally, it is a good practice to explictly declare properties to avoid accidental typos and provide IDE auto-completion:

class MyClass {
    public $foo;
}

$x = new MyClass();
$x->foo = true;
Loading history...
37 12
    }
38
39 1
    public function getAirDate(): string
40
    {
41 1
        return $this->release_date;
42
    }
43
44
    /**
45
     * @codeCoverageIgnore
46
     * @throws NotYetImplementedException
47
     */
48
    public function getCrew(): \Generator
49
    {
50
        throw new NotYetImplementedException;
51
    }
52
53 1
    public function getEpisodeNumber(): int
54
    {
55 1
        return (int) $this->episode_number;
56
    }
57
58
    /**
59
     * @codeCoverageIgnore
60
     * @throws NotYetImplementedException
61
     */
62
    public function getGuestStars(): \Generator
63
    {
64
        throw new NotYetImplementedException;
65
    }
66
67 1
    public function getId(): int
68
    {
69 1
        return (int) $this->id;
70
    }
71
72 1
    public function getName(): string
73
    {
74 1
        return $this->name;
75
    }
76
77 1
    public function getNote(): float
78
    {
79 1
        return $this->vote_average;
80
    }
81
82 1
    public function getNoteCount(): int
83
    {
84 1
        return (int) $this->vote_count;
85
    }
86
87 1
    public function getOverview(): string
88
    {
89 1
        return $this->overview;
90
    }
91
92 1
    public function getProductionCode(): string
93
    {
94 1
        return $this->production_code;
95
    }
96
97 1
    public function getReleaseDate(): string
98
    {
99 1
        return $this->release_date;
100
    }
101
102 1
    public function getSeasonNumber(): int
103
    {
104 1
        return (int) $this->season_number;
105
    }
106
107 1
    public function getStillPath(): string
108
    {
109 1
        return $this->still_path;
110
    }
111
}
112