BaseApiAwareAction   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 12
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
eloc 5
c 0
b 0
f 0
dl 0
loc 12
rs 10
wmc 2

1 Method

Rating   Name   Duplication   Size   Complexity  
A setApi() 0 7 2
1
<?php
2
3
/*
4
 * This file has been created by developers from BitBag.
5
 * Feel free to contact us once you face any issues or want to start
6
 * You can find more information about us on https://bitbag.io and write us
7
 * an email on [email protected].
8
 */
9
10
declare(strict_types=1);
11
12
namespace BitBag\SyliusMolliePlugin\Action\Api;
13
14
use BitBag\SyliusMolliePlugin\Client\MollieApiClient;
15
use Payum\Core\Action\ActionInterface;
16
use Payum\Core\ApiAwareInterface;
17
use Payum\Core\Exception\UnsupportedApiException;
18
19
abstract class BaseApiAwareAction implements ActionInterface, ApiAwareInterface
20
{
21
    /** @var MollieApiClient */
22
    protected $mollieApiClient;
23
24
    public function setApi($mollieApiClient): void
25
    {
26
        if (false === $mollieApiClient instanceof MollieApiClient) {
27
            throw new UnsupportedApiException('Not supported.Expected an instance of ' . MollieApiClient::class);
28
        }
29
30
        $this->mollieApiClient = $mollieApiClient;
31
    }
32
}
33