Episode::__construct()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 11

Duplication

Lines 11
Ratio 100 %

Importance

Changes 0
Metric Value
dl 11
loc 11
rs 9.9
c 0
b 0
f 0
cc 1
nc 1
nop 1
1
<?php
2
3
namespace Zmaglica\RickAndMortyApiWrapper\Api;
4
5
use GuzzleHttp\Client;
6
use Zmaglica\RickAndMortyApiWrapper\Model\Episode as EpisodeModel;
7
8 View Code Duplication
class Episode extends AbstractApi
0 ignored issues
show
Duplication introduced by
This class seems to be duplicated in your project.

Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.

You can also find more detailed suggestions in the “Code” section of your repository.

Loading history...
9
{
10
    public function __construct(Client $client)
11
    {
12
        $this->client = $client;
13
        $this->uri = 'episode';
14
        $this->arguments = [];
15
        $this->supportedFilters = [
16
            'name',
17
            'episode',
18
        ];
19
        $this->model = EpisodeModel::class;
20
    }
21
22
    /**
23
     * Get residents of location
24
     * @param null $id
25
     * @return mixed
26
     */
27
    public function getCharacters($id = null)
28
    {
29
        return $this->get($id)->getCharacters();
30
    }
31
}
32