Completed
Push — master ( 1e9a17...80ace9 )
by David
11:17
created

Guzzle7Factory   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 14
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Importance

Changes 0
Metric Value
wmc 2
lcom 0
cbo 0
dl 0
loc 14
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\Guzzle7\Client;
8
9
/**
10
 * @author Tobias Nyholm <[email protected]>
11
 */
12
class Guzzle7Factory implements ClientFactory
13
{
14
    /**
15
     * {@inheritdoc}
16
     */
17
    public function createClient(array $config = [])
18
    {
19
        if (!class_exists('Http\Adapter\Guzzle7\Client')) {
20
            throw new \LogicException('To use the Guzzle7 adapter you need to install the "php-http/guzzle7-adapter" package.');
21
        }
22
23
        return Client::createWithConfig($config);
24
    }
25
}
26