Passed
Pull Request — master (#28)
by Manuel
09:19
created

AliasAssertInsertRequest   A

Complexity

Total Complexity 4

Size/Duplication

Total Lines 38
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
eloc 12
dl 0
loc 38
rs 10
c 0
b 0
f 0
wmc 4

4 Methods

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