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

PhotosResponse::setNextPage()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 4
c 0
b 0
f 0
rs 10
cc 1
nc 1
nop 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\Photo;
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
 * Photos response.
25
 *
26
 * @author webeweb <https://github.com/webeweb/>
27
 * @package WBW\Library\Pexels\Model\Response
28
 */
29
class PhotosResponse 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 photo.
47
     *
48
     * @param Photo $photo The photo.
49
     * @return PhotosResponse Returns this photo response.
50
     */
51
    public function addPhoto(Photo $photo) {
52
        return $this->addMedia($photo);
53
    }
54
55
    /**
56
     * Get the photos.
57
     *
58
     * @return Photo[] Returns the photos.
59
     */
60
    public function getPhotos() {
61
        return $this->getMedias();
62
    }
63
}
64