CategoryEndpoint::getAll()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 8
Code Lines 5

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 8
c 0
b 0
f 0
rs 9.4285
cc 1
eloc 5
nc 1
nop 0
1
<?php
2
3
namespace Realshadow\Redtube\Endpoints;
4
5
use Illuminate\Support\Collection;
6
use Realshadow\Redtube\Entities\Categories;
7
8
9
/**
10
 * Category Endpoint
11
 *
12
 * @package Realshadow\Redtube\Endpoints
13
 * @author Lukáš Homza <[email protected]>
14
 */
15
class CategoryEndpoint extends AbstractEndpoint
16
{
17
18
    /**
19
     * Get all categories
20
     *
21
     * @return Collection
22
     * @throws \RuntimeException
23
     */
24
    public function getAll()
25
    {
26
        $response = $this->call('Categories.getCategoriesList');
27
28
        return $this->serializer
29
            ->deserialize($response, Categories::class, static::OUTPUT_FORMAT)
30
            ->flatten();
31
    }
32
    
33
}
34