StarEndpoint   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 29
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 2

Importance

Changes 0
Metric Value
dl 0
loc 29
c 0
b 0
f 0
wmc 2
lcom 1
cbo 2
rs 10

2 Methods

Rating   Name   Duplication   Size   Complexity  
A getAll() 0 8 1
A getAllDetailed() 0 4 1
1
<?php
2
3
namespace Realshadow\Redtube\Endpoints;
4
5
use Illuminate\Support\Collection;
6
use Realshadow\Redtube\Entities\Stars;
7
8
9
/**
10
 * Star Endpoint
11
 *
12
 * @package Realshadow\Redtube\Endpoints
13
 * @author Lukáš Homza <[email protected]>
14
 */
15
class StarEndpoint extends AbstractEndpoint
16
{
17
18
    /**
19
     * Get all stars
20
     *
21
     * @return Collection
22
     * @throws \RuntimeException
23
     */
24
    public function getAll()
25
    {
26
        $response = $this->call('Stars.getStarList');
27
28
        return $this->serializer
29
            ->deserialize($response, Stars::class, static::OUTPUT_FORMAT)
30
            ->flatten();
31
    }
32
33
    /**
34
     * At the time of writing this (07.07.2017) this method always ends with "There are no stars!" error
35
     *
36
     * @throws \BadMethodCallException
37
     */
38
    public function getAllDetailed()
39
    {
40
        throw new \BadMethodCallException('This method is not yet implemented.');
41
    }
42
43
}
44