DigitalOceanFactory   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 8
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
eloc 3
dl 0
loc 8
rs 10
c 0
b 0
f 0
wmc 1

1 Method

Rating   Name   Duplication   Size   Complexity  
A adapter() 0 5 1
1
<?php declare(strict_types=1);
2
3
namespace Cocotte\DigitalOcean;
4
5
use Assert\Assertion;
6
use DigitalOceanV2\Adapter\AdapterInterface;
7
8
final class DigitalOceanFactory
9
{
10
11
    public function adapter(string $adapterClass, ApiToken $token): AdapterInterface
12
    {
13
        Assertion::implementsInterface($adapterClass, AdapterInterface::class);
14
15
        return new $adapterClass($token->toString());
16
    }
17
18
}