ApiAwareTrait   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 12
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
eloc 5
dl 0
loc 12
rs 10
c 0
b 0
f 0
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
 * another great project.
7
 * You can find more information about us on https://bitbag.shop and write us
8
 * an email on [email protected].
9
 */
10
11
declare(strict_types=1);
12
13
namespace BitBag\SyliusQuadPayPlugin\Action\Api;
14
15
use BitBag\SyliusQuadPayPlugin\Client\QuadPayApiClientInterface;
16
use Payum\Core\Exception\UnsupportedApiException;
17
18
trait ApiAwareTrait
19
{
20
    /** @var QuadPayApiClientInterface */
21
    protected $quadPayApiClient;
22
23
    public function setApi($quadPayApiClient): void
24
    {
25
        if (false === $quadPayApiClient instanceof QuadPayApiClientInterface) {
26
            throw new UnsupportedApiException('Not supported.Expected an instance of ' . QuadPayApiClientInterface::class);
27
        }
28
29
        $this->quadPayApiClient = $quadPayApiClient;
30
    }
31
}
32