AssertRequest   A
last analyzed

Complexity

Total Complexity 4

Size/Duplication

Total Lines 39
Duplicated Lines 0 %

Importance

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

4 Methods

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