UnsplashPhotos   A
last analyzed

Complexity

Total Complexity 6

Size/Duplication

Total Lines 75
Duplicated Lines 0 %

Importance

Changes 2
Bugs 1 Features 0
Metric Value
eloc 7
c 2
b 1
f 0
dl 0
loc 75
rs 10
wmc 6

6 Methods

Rating   Name   Duplication   Size   Complexity  
A random() 0 3 1
A single() 0 3 1
A statistics() 0 3 1
A curated() 0 3 1
A photos() 0 3 1
A download() 0 3 1
1
<?php
2
3
namespace shweshi\LaravelUnsplashWrapper;
4
5
class UnsplashPhotos extends BaseClass
6
{
7
    /**
8
     * Retrieve a single page from the list of all photos.
9
     *
10
     * @param array $params
11
     *
12
     * @return mixed
13
     */
14
    public function photos(array $params)
15
    {
16
        return $this->call('photos', $params);
17
    }
18
19
    /**
20
     * Retrieve curated list of photos.
21
     *
22
     * @param array $params
23
     *
24
     * @return mixed
25
     */
26
    public function curated(array $params)
27
    {
28
        return $this->call('photos/curated', $params);
29
    }
30
31
    /**
32
     * Retrieve a single photo using id.
33
     *
34
     * @param string $id
35
     * @param array  $params
36
     *
37
     * @return mixed
38
     */
39
    public function single($id, array $params)
40
    {
41
        return $this->call('photos/'.$id, $params);
42
    }
43
44
    /**
45
     * Retrieve a random photo.
46
     *
47
     * @param array $params
48
     *
49
     * @return mixed
50
     */
51
    public function random(array $params)
52
    {
53
        return $this->call('photos/random', $params);
54
    }
55
56
    /**
57
     * Retrieve statistics of the photo.
58
     *
59
     * @param string $id
60
     * @param array  $params
61
     *
62
     * @return mixed
63
     */
64
    public function statistics($id, array $params)
65
    {
66
        return $this->call('/photos/'.$id.'/statistics', $params);
67
    }
68
69
    /**
70
     * Retrieve download link of the photo.
71
     *
72
     * @param string $id
73
     * @param array  $params
74
     *
75
     * @return mixed
76
     */
77
    public function download($id, array $params)
78
    {
79
        return $this->call('/photos/'.$id.'/download', $params);
80
    }
81
}
82