Guzzle6Factory::createClient()   A
last analyzed

Complexity

Conditions 2
Paths 2

Size

Total Lines 8

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 3
CRAP Score 2.0625

Importance

Changes 0
Metric Value
dl 0
loc 8
ccs 3
cts 4
cp 0.75
rs 10
c 0
b 0
f 0
cc 2
nc 2
nop 1
crap 2.0625
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