SetByCode   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 22
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
eloc 7
c 0
b 0
f 0
dl 0
loc 22
rs 10
wmc 2

2 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 3 1
A getQuery() 0 10 1
1
<?php
2
3
namespace Viktoras\Scryfall\Client\Request\Sets;
4
5
use Viktoras\Scryfall\Client\Request\AbstractRequest;
6
7
class SetByCode extends AbstractRequest
8
{
9
    /**
10
     * @var string
11
     */
12
    private $code;
13
14
    public function __construct(string $code)
15
    {
16
        $this->code = $code;
17
    }
18
19
    public function getQuery(): string
20
    {
21
        $queryString = http_build_query(
22
            [
23
                'format' => $this->format,
24
                'pretty' => $this->isPretty()
25
            ]
26
        );
27
28
        return sprintf('sets/%s?%s', $this->code, $queryString);
29
    }
30
}
31