Completed
Push — master ( f90dd6...0a073f )
by WEBEWEB
05:01
created

VideosResponse   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 35
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 7

Importance

Changes 0
Metric Value
wmc 3
lcom 0
cbo 7
dl 0
loc 35
rs 10
c 0
b 0
f 0

3 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 3 1
A addVideo() 0 3 1
A getVideos() 0 3 1
1
<?php
2
3
/*
4
 * This file is part of the pexels-library package.
5
 *
6
 * (c) 2019 WEBEWEB
7
 *
8
 * For the full copyright and license information, please view the LICENSE
9
 * file that was distributed with this source code.
10
 */
11
12
namespace WBW\Library\Pexels\Model\Response;
13
14
use WBW\Library\Pexels\Model\AbstractResponse;
15
use WBW\Library\Pexels\Model\Video;
16
use WBW\Library\Pexels\Traits\NextPageTrait;
17
use WBW\Library\Pexels\Traits\PageTrait;
18
use WBW\Library\Pexels\Traits\PerPageTrait;
19
use WBW\Library\Pexels\Traits\PrevPageTrait;
20
use WBW\Library\Pexels\Traits\TotalResultsTrait;
21
use WBW\Library\Pexels\Traits\UrlTrait;
22
23
/**
24
 * Videos response.
25
 *
26
 * @author webeweb <https://github.com/webeweb/>
27
 * @package WBW\Library\Pexels\Model\Response
28
 */
29
class VideosResponse extends AbstractResponse {
30
31
    use NextPageTrait;
32
    use PageTrait;
33
    use PerPageTrait;
34
    use PrevPageTrait;
35
    use TotalResultsTrait;
36
    use UrlTrait;
37
38
    /**
39
     * Constructor.
40
     */
41
    public function __construct() {
42
        parent::__construct();
43
    }
44
45
    /**
46
     * Add a video.
47
     *
48
     * @param Video $video The video.
49
     * @return VideosResponse Returns this video response.
50
     */
51
    public function addVideo(Video $video) {
52
        return $this->addMedia($video);
53
    }
54
55
    /**
56
     * Get the videos.
57
     *
58
     * @return Video[] Returns the videos.
59
     */
60
    public function getVideos() {
61
        return $this->getMedias();
62
    }
63
}
64