Completed
Branch develop (e3a612)
by Patryk
10:42 queued 45s
created

GuzzleClientFactory::create()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 6
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 6
rs 9.4285
c 0
b 0
f 0
cc 1
eloc 3
nc 1
nop 1
1
<?php
2
3
namespace KaLLoSz\Twig\Extension\Client;
4
5
use GuzzleHttp\Client;
6
use GuzzleHttp\ClientInterface;
7
use KaLLoSz\Twig\Extension\IframelyClientInterface;
8
9
/**
10
 * Class GuzzleClientFactory
11
 * @package KaLLoSz\Twig\Extension
12
 *
13
 * @author Patryk Kala <[email protected]>
14
 */
15
class GuzzleClientFactory
16
{
17
    /**
18
     * @param array $config
19
     *
20
     * @return ClientInterface
21
     */
22
    public static function create(array $config = []): ClientInterface
23
    {
24
        return new Client(array_merge($config, [
25
            'base_uri' => IframelyClientInterface::API_URI,
26
        ]));
27
    }
28
}
29