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

GuzzleFactory::newGuzzle()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 10
Code Lines 5

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
c 0
b 0
f 0
dl 0
loc 10
rs 9.4285
cc 1
eloc 5
nc 1
nop 2
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
}