Completed
Pull Request — master (#26)
by
unknown
15:31 queued 04:31
created

GetPinCodeMessage   A

Complexity

Total Complexity 6

Size/Duplication

Total Lines 38
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 1

Test Coverage

Coverage 100%

Importance

Changes 1
Bugs 0 Features 1
Metric Value
wmc 6
c 1
b 0
f 1
lcom 1
cbo 1
dl 0
loc 38
ccs 12
cts 12
cp 1
rs 10

3 Methods

Rating   Name   Duplication   Size   Complexity  
A getPinCode() 0 8 2
A getDigitalContent() 0 8 2
A getDRM() 0 8 2
1
<?php
2
3
namespace Xsolla\SDK\Webhook\Message;
4
5
class GetPinCodeMessage extends Message
6
{
7
    /**
8
     * @return array
9
     */
10 2
    public function getPinCode()
11
    {
12 2
        if (!array_key_exists('pin_code', $this->request)) {
13 1
            return array();
14
        }
15
16 1
        return $this->request['pin_code'];
17
    }
18
19
    /**
20
     * @return string
21
     */
22 2
    public function getDigitalContent()
23
    {
24 2
        if (!array_key_exists('pin_code', $this->request)) {
25 1
            return;
26
        }
27
28 1
        return $this->request['pin_code']['digital_content'];
29
    }
30
31
    /**
32
     * @return string
33
     */
34 2
    public function getDRM()
35
    {
36 2
        if (!array_key_exists('pin_code', $this->request)) {
37 1
            return;
38
        }
39
40 1
        return $this->request['pin_code']['DRM'];
41
    }
42
}
43