Stats   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 32
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 0

Importance

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

2 Methods

Rating   Name   Duplication   Size   Complexity  
A totalStats() 0 7 1
A monthlyStats() 0 7 1
1
<?php
2
3
namespace MarkSitko\LaravelUnsplash\Endpoints;
4
5
trait Stats
6
{
7
    /**
8
     * Totals
9
     * Get a list of counts for all of Unsplash.
10
     * @link https://unsplash.com/documentation#totals
11
     *
12
     * @return MarkSitko\LaravelUnsplash\Endpoints\Stats
13
     */
14
    public function totalStats()
15
    {
16
        $this->apiCall = [
0 ignored issues
show
Bug introduced by
The property apiCall does not exist. Did you maybe forget to declare it?

In PHP it is possible to write to properties without declaring them. For example, the following is perfectly valid PHP code:

class MyClass { }

$x = new MyClass();
$x->foo = true;

Generally, it is a good practice to explictly declare properties to avoid accidental typos and provide IDE auto-completion:

class MyClass {
    public $foo;
}

$x = new MyClass();
$x->foo = true;
Loading history...
17
            'endpoint' => 'stats/total',
18
        ];
19
        return $this;
20
    }
21
22
    /**
23
     * Month
24
     * Get the overall Unsplash stats for the past 30 days.
25
     * @link https://unsplash.com/documentation#month
26
     *
27
     * @return MarkSitko\LaravelUnsplash\Endpoints\Stats
28
     */
29
    public function monthlyStats()
30
    {
31
        $this->apiCall = [
32
            'endpoint' => 'stats/month',
33
        ];
34
        return $this;
35
    }
36
}
37