Completed
Push — master ( 6a871e...8be5d6 )
by Dan
02:29
created

GuzzleFactory   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 13
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 4

Importance

Changes 0
Metric Value
wmc 1
c 0
b 0
f 0
lcom 0
cbo 4
dl 0
loc 13
rs 10

1 Method

Rating   Name   Duplication   Size   Complexity  
A newGuzzle() 0 10 1
1
<?php
2
namespace Nopolabs\Yabot\Guzzle;
3
4
use GuzzleHttp\Client;
5
use GuzzleHttp\Handler\CurlMultiHandler;
6
use GuzzleHttp\HandlerStack;
7
use React\EventLoop\LoopInterface;
8
9
class GuzzleFactory
10
{
11
    static public function newGuzzle(LoopInterface $eventLoop, array $config) : Guzzle
0 ignored issues
show
Coding Style introduced by
As per PSR2, the static declaration should come after the visibility declaration.
Loading history...
12
    {
13
        $handler = new CurlMultiHandler();
14
15
        $config['handler'] = HandlerStack::create($handler);
16
17
        $client = new Client($config);
18
19
        return new Guzzle($client, $handler, $eventLoop);
20
    }
21
}