BaseApiAwareAction   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 19
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Test Coverage

Coverage 80%

Importance

Changes 0
Metric Value
wmc 2
lcom 0
cbo 1
dl 0
loc 19
ccs 4
cts 5
cp 0.8
rs 10
c 0
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A setApi() 0 8 2
1
<?php
2
3
namespace PayumTW\Ecpay\Action\Api;
4
5
use PayumTW\Ecpay\Api;
6
use Payum\Core\ApiAwareInterface;
7
use Payum\Core\Action\ActionInterface;
8
use Payum\Core\Exception\UnsupportedApiException;
9
10
abstract class BaseApiAwareAction implements ActionInterface, ApiAwareInterface
11
{
12
    /**
13
     * @var \PayumTW\Ecpay\Api
14
     */
15
    protected $api;
16
17
    /**
18
     * {@inheritdoc}
19
     */
20 9
    public function setApi($api)
21
    {
22 9
        if (false === $api instanceof Api) {
23
            throw new UnsupportedApiException('Not supported.');
24
        }
25
26 9
        $this->api = $api;
27 9
    }
28
}
29