Passed
Pull Request — master (#5)
by Pulkit
07:52
created

GeoService::getTopArtists()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 10

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 5
CRAP Score 1

Importance

Changes 0
Metric Value
dl 0
loc 10
c 0
b 0
f 0
ccs 5
cts 5
cp 1
rs 9.9332
cc 1
nc 1
nop 3
crap 1
1
<?php
2
namespace Sourceout\LastFm\Services;
3
4
class GeoService extends AbstractService
5
{
6
    /**
7
     * Get the most popular artists by country
8
     *
9
     * @param string $country
10
     * @param integer $page
11
     * @param integer $limit
12
     */
13 1
    public function getTopArtists(
14
        string $country,
15
        int $page = 1,
16
        int $limit = 50
17
    )
18
    {
0 ignored issues
show
Coding Style introduced by
The closing parenthesis and the opening brace of a multi-line function declaration must be on the same line
Loading history...
19 1
        return $this->provider
20 1
            ->getResource($this->http)
21 1
            ->geo()
22 1
            ->getTopArtists($country, $page, $limit);
23
    }
24
25
    /**
26
     * Get the most popular tracks by country
27
     *
28
     * @param string $country
29
     * @param string $location
30
     * @param integer $limit
31
     * @param integer $page
32
     * @return \Tightenco\Collect\Support\Collection
33
     */
34 1
    public function getTopTracks(
35
        string $country,
36
        string $location = null,
37
        int $limit = 50,
38
        int $page = 1
39
    ) {
40 1
        return $this->provider
41 1
            ->getResource($this->http)
42 1
            ->geo()
43 1
            ->getTopTracks($country, $location, $limit, $page);
44
    }
45
}