ContractEndpoints   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 40
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 3
eloc 4
c 1
b 0
f 0
dl 0
loc 40
rs 10

3 Methods

Rating   Name   Duplication   Size   Complexity  
A activateContract() 0 3 1
A itemUpgrades() 0 3 1
A contracts() 0 3 1
1
<?php
2
3
namespace Seaony\ValorantApi\Endpoints;
4
5
trait ContractEndpoints
6
{
7
    /**
8
     * Get details for item upgrades
9
     *
10
     * @param  string  $shard
11
     *
12
     * @return mixed|\Psr\Http\Message\ResponseInterface
13
     * @throws \GuzzleHttp\Exception\GuzzleException
14
     */
15
    public function itemUpgrades(string $shard)
16
    {
17
        return $this->request('GET', "https://pd.{$shard}.a.pvp.net/contract-definitions/v3/item-upgrades");
0 ignored issues
show
Bug introduced by
It seems like request() must be provided by classes using this trait. How about adding it as abstract method to this trait? ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-call  annotation

17
        return $this->/** @scrutinizer ignore-call */ request('GET', "https://pd.{$shard}.a.pvp.net/contract-definitions/v3/item-upgrades");
Loading history...
18
    }
19
20
    /**
21
     * @param  string  $shard
22
     * @param  string  $puuid
23
     *
24
     * @return mixed|\Psr\Http\Message\ResponseInterface
25
     * @throws \GuzzleHttp\Exception\GuzzleException
26
     */
27
    public function contracts(string $shard, string $puuid)
28
    {
29
        return $this->request('GET', "https://pd.{$shard}.a.pvp.net/contracts/v1/contracts/{$puuid}");
30
    }
31
32
    /**
33
     * Activate a specific contract by ID
34
     *
35
     * @param  string  $shard
36
     * @param  string  $puuid
37
     * @param  string  $contractId
38
     *
39
     * @return mixed|\Psr\Http\Message\ResponseInterface
40
     * @throws \GuzzleHttp\Exception\GuzzleException
41
     */
42
    public function activateContract(string $shard, string $puuid, string $contractId)
43
    {
44
        return $this->request('POST', "https://pd.{$shard}.a.pvp.net/contracts/v1/contracts/{$puuid}/special/{$contractId}");
45
    }
46
47
}
48