AliasAssertInsertRequest::execute()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 6
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 2
nc 1
nop 0
dl 0
loc 6
rs 10
c 0
b 0
f 0
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Ticketpark\SaferpayJson\Request\SecureCardData;
6
7
use JMS\Serializer\Annotation\SerializedName;
8
use Ticketpark\SaferpayJson\Request\Request;
9
use Ticketpark\SaferpayJson\Request\RequestCommonsTrait;
10
use Ticketpark\SaferpayJson\Request\RequestConfig;
11
use Ticketpark\SaferpayJson\Response\SecureCardData\AliasAssertInsertResponse;
12
13
final class AliasAssertInsertRequest extends Request
14
{
15
    use RequestCommonsTrait;
16
    public const API_PATH = '/Payment/v1/Alias/AssertInsert';
17
    public const RESPONSE_CLASS = AliasAssertInsertResponse::class;
18
19
    /**
20
     * @var string
21
     * @SerializedName("Token")
22
     */
23
    private $token;
24
25
    public function __construct(RequestConfig $requestConfig, string $token)
26
    {
27
        $this->token = $token;
28
29
        parent::__construct($requestConfig);
30
    }
31
32
    public function getToken(): string
33
    {
34
        return $this->token;
35
    }
36
37
    public function setToken(string $token): self
38
    {
39
        $this->token = $token;
40
41
        return $this;
42
    }
43
44
    public function execute(): AliasAssertInsertResponse
45
    {
46
        /** @var AliasAssertInsertResponse $response */
47
        $response = $this->doExecute();
48
49
        return $response;
50
    }
51
}
52