Completed
Pull Request — master (#37)
by Vitaliy
30:07 queued 26:47
created

UserBalanceMessage::getOperationType()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 1
Bugs 0 Features 0
Metric Value
c 1
b 0
f 0
dl 0
loc 4
ccs 0
cts 4
cp 0
rs 10
cc 1
eloc 2
nc 1
nop 0
crap 2
1
<?php
2
3
namespace Xsolla\SDK\Webhook\Message;
4
5
class UserBalanceMessage extends Message
6
{
7
    const PAYMENT = 'payment';
8
    const IN_GAME_PURCHASE = 'inGamePurchase';
9
    const COUPON = 'coupon';
10
    const INTERNAL = 'internal';
11
    const CANCELLATION = 'cancellation';
12
13
    /**
14
     * @return array
15
     */
16
    public function getVirtualCurrencyBalance()
17
    {
18
        if (!array_key_exists('virtual_currency_balance', $this->request)) {
19
            return array();
20
        }
21
22
        return $this->request['virtual_currency_balance'];
23
    }
24
25
    /**
26
     * @return string
27
     */
28
    public function getOperationType()
29
    {
30
        return $this->request['operation_type'];
31
    }
32
33
    /**
34
     * @return int
35
     */
36
    public function getOperationId()
37
    {
38
        return $this->request['id_operation'];
39
    }
40
41
    /**
42
     * @return array
43
     */
44
    public function getCoupon()
45
    {
46
        if (!array_key_exists('coupon', $this->request)) {
47
            return array();
48
        }
49
50
        return $this->request['coupon'];
51
    }
52
53
    /**
54
     * @return string|null
55
     */
56
    public function getItemsOperationType()
57
    {
58
        if (array_key_exists('items_operation_type', $this->request)) {
59
            return $this->request['items_operation_type'];
60
        }
61
    }
62
}
63