CafebazaarPurchase   A
last analyzed

Complexity

Total Complexity 7

Size/Duplication

Total Lines 33
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 0

Importance

Changes 0
Metric Value
wmc 7
lcom 1
cbo 0
dl 0
loc 33
rs 10
c 0
b 0
f 0

7 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 3 1
A getConsumptionState() 0 3 1
A getPurchaseState() 0 3 1
A getKind() 0 3 1
A getPayload() 0 3 1
A getTime() 0 3 1
A isValid() 0 3 1
1
<?php
2
namespace Nikandlv\LaravelCafebazaar;
3
4
class CafebazaarPurchase {
5
6
    public $data;
7
    
8
    public function __construct($data) {
9
        $this->data = $data;
10
    }
11
12
    public function getConsumptionState() {
13
        return $this->data->consumptionState;
14
    }
15
16
    public function getPurchaseState() {
17
        return $this->data->purchaseState;
18
    }
19
20
    public function getKind() {
21
        return $this->data->kind;
22
    }
23
24
    public function getPayload() {
25
        return $this->data->developerPayload;
26
    }
27
28
    public function getTime() {
29
        return $this->data->purchaseTime;
30
    }
31
32
    public function isValid() {
33
        return $this->getPurchaseState() === 0;
34
    }
35
36
}