| Total Complexity | 5 |
| Total Lines | 59 |
| Duplicated Lines | 0 % |
| Coverage | 100% |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 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 | 1 | public function __construct( |
|
| 27 | string $type, |
||
| 28 | ?string $subscriptionId, |
||
| 29 | string $purchaseToken, |
||
| 30 | string $productId |
||
| 31 | ) |
||
| 32 | { |
||
| 33 | 1 | $this->type = $type; |
|
| 34 | 1 | $this->subscriptionId = $subscriptionId; |
|
| 35 | 1 | $this->purchaseToken = $purchaseToken; |
|
| 36 | 1 | $this->productId = $productId; |
|
| 37 | 1 | } |
|
| 38 | |||
| 39 | /** |
||
| 40 | * @return string |
||
| 41 | */ |
||
| 42 | 1 | public function getType(): string |
|
| 43 | { |
||
| 44 | 1 | return $this->type; |
|
| 45 | } |
||
| 46 | |||
| 47 | /** |
||
| 48 | * SubscriptionId is null for in-app purchase |
||
| 49 | * |
||
| 50 | * @return string|null |
||
| 51 | */ |
||
| 52 | 1 | public function getSubscriptionId(): ?string |
|
| 53 | { |
||
| 54 | 1 | return $this->subscriptionId; |
|
| 55 | } |
||
| 56 | |||
| 57 | /** |
||
| 58 | * @return string |
||
| 59 | */ |
||
| 60 | 1 | public function getPurchaseToken(): string |
|
| 61 | { |
||
| 62 | 1 | return $this->purchaseToken; |
|
| 63 | } |
||
| 64 | |||
| 65 | /** |
||
| 66 | * @return string |
||
| 67 | */ |
||
| 68 | 1 | public function getProductId(): string |
|
| 71 | } |
||
| 72 | } |
||
| 73 |