SetByCode::getQuery()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 10
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 4
c 0
b 0
f 0
nc 1
nop 0
dl 0
loc 10
rs 10
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