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

GuzzleClient   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 19
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 2

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 1
c 1
b 0
f 0
lcom 0
cbo 2
dl 0
loc 19
rs 10

1 Method

Rating   Name   Duplication   Size   Complexity  
A createClient() 0 11 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