SummonerApi::getSummonerByAccountId()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 6

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 1

Importance

Changes 0
Metric Value
dl 0
loc 6
ccs 2
cts 2
cp 1
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 1
crap 1
1
<?php
2
3
namespace LoLApi\Api;
4
5
use LoLApi\Result\ApiResult;
6
7
/**
8
 * Class SummonerApi
9
 *
10
 * @package LoLApi\Api
11
 * @see     https://developer.riotgames.com/api-methods/
12
 */
13
class SummonerApi extends BaseApi
14
{
15
    const API_URL_SUMMONER_BY_NAME = '/lol/summoner/v4/summoners/by-name/{summonerName}';
16
    const API_URL_SUMMONER_BY_ID = '/lol/summoner/v4/summoners/{encryptedSummonerId}';
17
    const API_URL_SUMMONER_BY_ACCOUNT_ID = '/lol/summoner/v4/summoners/by-account/{encryptedAccountId}';
18
19
    /**
20
     * @param string $summonerName
21
     *
22
     * @return ApiResult
23
     */
24
    public function getSummonerBySummonerName($summonerName)
25
    {
26 1
        $url = str_replace('{summonerName}', $summonerName, self::API_URL_SUMMONER_BY_NAME);
27
28 1
        return $this->callApiUrl($url, []);
29
    }
30 1
31
    /**
32
     * @param string $summonerId
0 ignored issues
show
Documentation introduced by
There is no parameter named $summonerId. Did you maybe mean $encryptedSummonerId?

This check looks for PHPDoc comments describing methods or function parameters that do not exist on the corresponding method or function. It has, however, found a similar but not annotated parameter which might be a good fit.

Consider the following example. The parameter $ireland is not defined by the method finale(...).

/**
 * @param array $germany
 * @param array $ireland
 */
function finale($germany, $island) {
    return "2:1";
}

The most likely cause is that the parameter was changed, but the annotation was not.

Loading history...
33
     *
34
     * @return ApiResult
35
     */
36
    public function getSummonerBySummonerId($encryptedSummonerId)
37
    {
38 1
        $url = str_replace('{encryptedSummonerId}', $encryptedSummonerId, self::API_URL_SUMMONER_BY_ID);
39
40 1
        return $this->callApiUrl($url, []);
41
    }
42 1
43
    /**
44
     * @param string $accountId
0 ignored issues
show
Documentation introduced by
There is no parameter named $accountId. Did you maybe mean $encryptedAccountId?

This check looks for PHPDoc comments describing methods or function parameters that do not exist on the corresponding method or function. It has, however, found a similar but not annotated parameter which might be a good fit.

Consider the following example. The parameter $ireland is not defined by the method finale(...).

/**
 * @param array $germany
 * @param array $ireland
 */
function finale($germany, $island) {
    return "2:1";
}

The most likely cause is that the parameter was changed, but the annotation was not.

Loading history...
45
     *
46
     * @return ApiResult
47
     */
48
    public function getSummonerByAccountId($encryptedAccountId)
49
    {
50 5
        $url = str_replace('{encryptedAccountId}', $encryptedAccountId, self::API_URL_SUMMONER_BY_ACCOUNT_ID);
51
52 1
        return $this->callApiUrl($url, []);
53
    }
54
}
55