UpdatePaymentMethodRequest   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 41
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 2

Test Coverage

Coverage 72.72%

Importance

Changes 0
Metric Value
wmc 3
lcom 1
cbo 2
dl 0
loc 41
ccs 16
cts 22
cp 0.7272
rs 10
c 0
b 0
f 0

3 Methods

Rating   Name   Duplication   Size   Complexity  
A getData() 0 16 1
A getEndpoint() 0 4 1
A getHttpMethod() 0 4 1
1
<?php
2
3
namespace Omnipay\Spreedly\Message;
4
use Omnipay\Spreedly\Concerns\HasOwnerData;
5
6
/**
7
 * @method Response send()
8
 */
9
class UpdatePaymentMethodRequest extends AbstractPaymentMethodRequest
10
{
11
    use HasOwnerData;
12
13
    /**
14
     * @return array
15
     * @throws \Omnipay\Common\Exception\InvalidRequestException
16
     */
17 4
    public function getData()
18
    {
19 4
        $this->validate('payment_method_token');
20
21 4
        $data = $this->fillExistingParameters(array(), array(
22 4
            'allow_blank_name' => 'allow_blank_name',
23 4
            'allow_expired_date' => 'allow_expired_date',
24 4
            'allow_blank_date' => 'allow_blank_date',
25 4
            'first_name' => 'first_name',
26 4
            'last_name' => 'last_name',
27 4
            'email' => 'email',
28 4
            'data' => 'extra',
29 4
        ));
30
31 4
        return array('payment_method' => $data);
32
    }
33
34
    /**
35
     * @return string
36
     */
37 4
    public function getEndpoint()
38
    {
39 4
        return $this->endpoint . 'payment_methods/' . $this->getPaymentMethodToken();
40
    }
41
42
    /**
43
     * @return string
44
     */
45 2
    public function getHttpMethod()
46
    {
47 2
        return 'PUT';
48
    }
49
}
50