Completed
Push — master ( 4f2fad...dd1cd3 )
by Guillaume
07:10
created

GuzzleClient::createClient()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 11
Code Lines 6

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
c 1
b 0
f 0
dl 0
loc 11
rs 9.4286
cc 1
eloc 6
nc 1
nop 1
1
<?php
2
3
namespace Hogosha\Monitor\Client;
4
5
use GuzzleHttp\Client;
6
use GuzzleHttp\Handler\CurlMultiHandler;
7
8
/**
9
 * @author Guillaume Cavana <[email protected]>
10
 */
11
class GuzzleClient
12
{
13
    /**
14
     * createClient.
15
     * @param array $options
16
     * @return Client
17
     */
18
    public static function createClient($options = [])
19
    {
20
        $defaults = [
21
            'handler' => new CurlMultiHandler(),
22
            'allow_redirects' => false,
23
        ];
24
25
        $options = array_merge($defaults, $options);
26
27
        return new Client($options);
28
    }
29
}
30