GetTransactionDataAction   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 26
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 4

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
wmc 3
lcom 1
cbo 4
dl 0
loc 26
ccs 8
cts 8
cp 1
rs 10
c 0
b 0
f 0

2 Methods

Rating   Name   Duplication   Size   Complexity  
A execute() 0 8 1
A supports() 0 6 2
1
<?php
2
3
namespace PayumTW\Ezship\Action\Api;
4
5
use Payum\Core\Bridge\Spl\ArrayObject;
6
use PayumTW\Ezship\Request\Api\GetTransactionData;
7
use Payum\Core\Exception\RequestNotSupportedException;
8
9
class GetTransactionDataAction extends BaseApiAwareAction
10
{
11
    /**
12
     * {@inheritdoc}
13
     *
14
     * @param $request GetTransactionData
15
     */
16 1
    public function execute($request)
17
    {
18 1
        RequestNotSupportedException::assertSupports($this, $request);
19
20 1
        $details = ArrayObject::ensureArrayObject($request->getModel());
21
22 1
        $details->replace($this->api->getTransactionData((array) $details));
23 1
    }
24
25
    /**
26
     * {@inheritdoc}
27
     */
28 1
    public function supports($request)
29
    {
30
        return
31 1
            $request instanceof GetTransactionData &&
32 1
            $request->getModel() instanceof \ArrayAccess;
33
    }
34
}
35