Passed
Push — main ( 4dc4a3...97513a )
by Stas
14:40 queued 04:40
created

PurchaseData::getType()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 1
c 1
b 0
f 0
nc 1
nop 0
dl 0
loc 3
rs 10
1
<?php
2
3
namespace Huawei\IAP;
4
5
/**
6
 * Class PurchaseData
7
 *
8
 * VO for IAP data
9
 *
10
 * @package Huawei\IAP
11
 */
12
class PurchaseData
13
{
14
    private $type;
15
    private $subscriptionId;
16
    private $purchaseToken;
17
    private $productId;
18
19
    /**
20
     * PurchaseData constructor.
21
     * @param string $type
22
     * @param string|null $subscriptionId
23
     * @param string $purchaseToken
24
     * @param string $productId
25
     */
26
    public function __construct(
27
        string $type,
28
        ?string $subscriptionId,
29
        string $purchaseToken,
30
        string $productId
31
    )
32
    {
33
        $this->type = $type;
34
        $this->subscriptionId = $subscriptionId;
35
        $this->purchaseToken = $purchaseToken;
36
        $this->productId = $productId;
37
    }
38
39
    /**
40
     * @return string
41
     */
42
    public function getType(): string
43
    {
44
        return $this->type;
45
    }
46
47
    /**
48
     * SubscriptionId is null for in-app purchase
49
     *
50
     * @return string|null
51
     */
52
    public function getSubscriptionId(): ?string
53
    {
54
        return $this->subscriptionId;
55
    }
56
57
    /**
58
     * @return string
59
     */
60
    public function getPurchaseToken(): string
61
    {
62
        return $this->purchaseToken;
63
    }
64
65
    /**
66
     * @return string
67
     */
68
    public function getProductId(): string
69
    {
70
        return $this->productId;
71
    }
72
}
73