Guzzle6Factory   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 14
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Test Coverage

Coverage 75%

Importance

Changes 0
Metric Value
wmc 2
lcom 0
cbo 0
dl 0
loc 14
ccs 3
cts 4
cp 0.75
rs 10
c 0
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A createClient() 0 8 2
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Http\HttplugBundle\ClientFactory;
6
7
use Http\Adapter\Guzzle6\Client;
8
9
/**
10
 * @author Tobias Nyholm <[email protected]>
11
 */
12
class Guzzle6Factory implements ClientFactory
13
{
14
    /**
15
     * {@inheritdoc}
16
     */
17 5
    public function createClient(array $config = [])
18
    {
19 5
        if (!class_exists('Http\Adapter\Guzzle6\Client')) {
20
            throw new \LogicException('To use the Guzzle6 adapter you need to install the "php-http/guzzle6-adapter" package.');
21
        }
22
23 5
        return Client::createWithConfig($config);
24
    }
25
}
26