FetchOrder::getXml()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 2
Bugs 0 Features 0
Metric Value
eloc 1
c 2
b 0
f 0
dl 0
loc 3
rs 10
cc 1
nc 1
nop 0
1
<?php
2
declare(strict_types=1);
3
4
namespace Bpost\BpostApiClient\Bpost\HttpRequestBuilder;
5
6
use Bpost\BpostApiClient\Common\ApiVersions;
7
8
class FetchOrder implements HttpRequestBuilderInterface
9
{
10
    public function __construct(
11
        private readonly string $reference
12
    ) {}
13
14
    public function getXml(): ?string
15
    {
16
        return null;
17
    }
18
19
    public function getHeaders(): array
20
    {
21
        return [
22
            'Accept: application/vnd.bpost.shm-order-' . ApiVersions::V3_3 . '+XML',
23
        ];
24
    }
25
26
    public function getUrl(): string
27
    {
28
        return '/orders/' . $this->reference;
29
    }
30
31
    public function isExpectXml(): bool
32
    {
33
        return true;
34
    }
35
36
    public function getMethod(): string
37
    {
38
        return self::METHOD_GET;
39
    }
40
}