SpectatorApi::getFeaturedGames()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 4

Duplication

Lines 4
Ratio 100 %

Importance

Changes 0
Metric Value
dl 4
loc 4
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 0
1
<?php
2
3
namespace LoLApi\Api;
4
5
use LoLApi\Result\ApiResult;
6
7
/**
8
 * Class FeaturedGamesApi
9
 *
10
 * @package LoLApi\Api
11
 * @see     https://developer.riotgames.com/api-methods/
12
 */
13 View Code Duplication
class SpectatorApi extends BaseApi
0 ignored issues
show
Duplication introduced by
This class seems to be duplicated in your project.

Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.

You can also find more detailed suggestions in the “Code” section of your repository.

Loading history...
14
{
15
    const API_URL_SPECTATOR_FEATURED = '/lol/spectator/v3/featured-games';
16
    const API_URL_CURRENT_GAME_BY_SUMMONER_ID = '/lol/spectator/v3/active-games/by-summoner/{summonerId}';
17
18
    /**
19
     * @return ApiResult
20
     */
21
    public function getFeaturedGames()
22
    {
23
        return $this->callApiUrl(self::API_URL_SPECTATOR_FEATURED, []);
24
    }
25
26
    /**
27
     * @param string $summonerId
28
     *
29
     * @return ApiResult
30
     */
31
    public function getCurrentGameByPlatformIdAndSummonerId($summonerId)
32
    {
33
        $url = str_replace('{summonerId}', $summonerId, self::API_URL_CURRENT_GAME_BY_SUMMONER_ID);
34
35
        return $this->callApiUrl($url, []);
36
    }
37
}
38