StoreEndpoints   A
last analyzed

Complexity

Total Complexity 4

Size/Duplication

Total Lines 55
Duplicated Lines 0 %

Importance

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

4 Methods

Rating   Name   Duplication   Size   Complexity  
A storefront() 0 3 1
A ownedItems() 0 3 1
A wallet() 0 3 1
A prices() 0 3 1
1
<?php
2
3
namespace Seaony\ValorantApi\Endpoints;
4
5
trait StoreEndpoints
6
{
7
    /**
8
     * Get the current store prices for all items
9
     *
10
     * @param  string  $shard
11
     *
12
     * @return mixed
13
     */
14
    public function prices(string $shard)
15
    {
16
        return $this->request('GET', "https://pd.{$shard}.a.pvp.net/store/v1/offers");
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

16
        return $this->/** @scrutinizer ignore-call */ request('GET', "https://pd.{$shard}.a.pvp.net/store/v1/offers");
Loading history...
17
    }
18
19
    /**
20
     * Get the currently available items in the store
21
     *
22
     * @param  string  $shard
23
     * @param  string  $puuid
24
     *
25
     * @return mixed|\Psr\Http\Message\ResponseInterface
26
     * @throws \GuzzleHttp\Exception\GuzzleException
27
     */
28
    public function storefront(string $shard, string $puuid)
29
    {
30
        return $this->request('GET', "https://pd.{$shard}.a.pvp.net/store/v2/storefront/{$puuid}");
31
    }
32
33
    /**
34
     * Get the current wallet balance for the user
35
     *
36
     * @param  string  $shard
37
     * @param  string  $puuid
38
     *
39
     * @return mixed|\Psr\Http\Message\ResponseInterface
40
     * @throws \GuzzleHttp\Exception\GuzzleException
41
     */
42
    public function wallet(string $shard, string $puuid)
43
    {
44
        return $this->request('GET', "https://pd.{$shard}.a.pvp.net/store/v1/wallet/{$puuid}");
45
    }
46
47
    /**
48
     * List what the player owns (agents, skins, buddies, ect.) Category names and IDs:
49
     *
50
     * @param  string  $shard
51
     * @param  string  $puuid
52
     * @param  int  $ItemTypeID
53
     *
54
     * @return mixed|\Psr\Http\Message\ResponseInterface
55
     * @throws \GuzzleHttp\Exception\GuzzleException
56
     */
57
    public function ownedItems(string $shard, string $puuid, string $ItemTypeID)
58
    {
59
        return $this->request('GET', "https://pd.{$shard}.a.pvp.net/store/v1/entitlements/{$puuid}/{$ItemTypeID}");
60
    }
61
}
62